1 2009-05-08 Marek Safar <marek.safar@gmail.com>
4 * expression: Always use temporary variable when using object
7 2009-04-28 Marek Safar <marek.safar@gmail.com>
10 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
13 2009-04-27 Miguel de Icaza <miguel@novell.com>
15 * driver.cs: Add a flag to work as a replacement for CSC in VS.
17 2009-04-24 Miguel de Icaza <miguel@novell.com>
19 * complete.cs: No idea how gonzalo got a null in the list, but
22 2009-04-24 Miguel de Icaza <miguel@novell.com>
24 * complete.cs (CompletionElementInitializer): New completion class
25 to support completing inside a C# 3 element initializer, so this
26 allows completion for Silverlight situations where it is very
29 new TextBlock () { Fo<TAB>
31 (CompletionSimpleName): Expose the prefix that was
32 passed to the simple name.
34 * cs-parser.jay (object_or_collection_initializer): Add support
35 for element_initializers.
37 * expression.cs (CollectionOrObjectInitializers.DoResolve):
38 special case completion expressions as this method aggressively
39 collects data before it operates, and errors were being thrown
40 earlier than we were able to complete.
42 2009-04-23 Miguel de Icaza <miguel@novell.com>
44 * eval.cs: Make getcompletions silent and enable debugging output
45 if the -v option is passed.
47 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
48 Consider looking up the namespace that matches the prefix being
51 This is part of the support for allowing completions like:
52 `System.Co<TAB>' to complete to System.Console.
54 * complete.cs (CompletionSimpleName.AppendResults): Make this
57 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
59 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
60 COMPLETE_COMPLETION as internal.
62 2009-04-17 Miguel de Icaza <miguel@novell.com>
64 * complete.cs: Include namespace resolution in simple names as
65 well as global types and types in the using scope in the
68 * namespace.cs: Supporting infrastrcture to provide completions
69 based on the current using scope.
71 * eval.cs: Introduce an entry point that allows for initialization
72 to return a list of the files passed on the command line.
74 2009-04-14 Marek Safar <marek.safar@gmail.com>
77 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
79 2009-04-13 Marek Safar <marek.safar@gmail.com>
82 * statement.cs: Don't skip string multi-section with default or
83 null label when populating string hashtable.
85 2009-04-06 Marek Safar <marek.safar@gmail.com>
88 * expression.cs (New): Load variable when assigning type parameter
91 2009-04-06 Marek Safar <marek.safar@gmail.com>
94 * decl.cs: Compare MVAR types using non-null values.
96 2009-03-27 Marek Safar <marek.safar@gmail.com>
98 * typemanager.cs, expression.cs: Removed unused nullable checks.
100 2009-03-27 Marek Safar <marek.safar@gmail.com>
102 * *.cs: Removed some gmcs conditionals.
104 2009-03-26 Marek Safar <marek.safar@gmail.com>
106 * generic.cs, support.cs: Moved generics stuff out of support.cs
108 2009-03-24 Marek Safar <marek.safar@gmail.com>
110 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
113 2009-03-23 Marek Safar <marek.safar@gmail.com>
115 * attribute.cs: Consider all members for error reporting when
116 checking named arguments.
118 2009-03-23 Marek Safar <marek.safar@gmail.com>
120 A fix for bug #487625
121 * namespace.cs: Use a warning for all predefined type conflicts.
123 2009-03-23 Marek Safar <marek.safar@gmail.com>
125 A fix for bug #485706
126 * statement.cs: Explicitly type catch type argument to pass verifier
129 2009-03-22 Miguel de Icaza <miguel@novell.com>
131 Initial support to provide code completion facilities to consumers
132 of the evaluator API.
134 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
135 support the completion engine. When we reach the end of the
136 input stream instead of returning EOF, when this flag is true the
137 tokenizer instead produces:
139 One GENERATE_COMPLETION token: this token then must be
140 handled in the grammar at every point where the user
141 would likely request a completion.
143 As many COMPLETE_COMPLETION tokens as necessary. These
144 tokens are generated to assist the parser in unwinding and
145 producing a valid parse tree.
147 The parser rules do not have to be perfect, the parser needs to be
148 augmented with judicious use of GENERATE_COMPLETION tokens to
149 improve the areas where we can provide completion and the parser
150 needs to add support for COMPLETE_COMPLETION tokens in productions
153 It is common to not have enough support for COMPLETE_COMPLETION
154 under certain rules and that even if we generated the
155 GENERATE_COMPLETION token that the resulting tree will be invalid
156 due to the missing rules that support COMPLETE_COMPLETION.
158 The final EOF token is produced by having the parser notify the
159 tokenizer when it reaches the root production that the next token
162 * support.cs (CompletionResult): New Exception. This exception
163 is thrown to return the completion results when one of the special
164 completion expressions is reached.
166 This exception is thrown by the completing ExpressionStatements
167 classes that live in complete.cs
169 * complete.cs (CompletingExpression): a new base class for
170 completing expressions. This derives from the
171 ExpressionStatement class and not from Expression as it allows
172 completion to happen not only where expressions are expected in
173 the grammar, but also where statements are expected.
175 (CompletionSimpleName): A new class used to provide completions
176 for SimpleNames. This currently only resolves to local
177 variables from the evaluator context (GetVars call).
179 (CompletionMemberAccess): Implements support for completing member
182 * cs-parser.jay: Add support for completion in a few places.
184 * eval.cs (GetCompletions): New public API for the evaluator that
185 returns a list of possible completions given the input. The
186 return value is an array of completions
188 * anonymous.cs (Compatible): If the exception thrown from the
189 resolved expression is a CompletionResult exception let that one
190 through instead of printing a diagnostic error in the try/catch.
192 2009-03-22 Miguel de Icaza <miguel@novell.com>
196 * driver.cs (Main): Use Environment.Exit to quit quickly and
197 prevent the compiler from doing the usual wait for helper thread
200 This is to prevent a slowdown that was reported by Gonzalo on
203 2009-03-19 Marek Safar <marek.safar@gmail.com>
205 * ecore.cs: Load build-in types directly instead of accessing
208 2009-03-18 Marek Safar <marek.safar@gmail.com>
210 * ecore.cs: Always use unbox.any when available.
212 2009-03-18 Marek Safar <marek.safar@gmail.com>
214 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
216 2009-03-17 Marek Safar <marek.safar@gmail.com>
218 * generic.cs: Removed obsolete version of type inference.
220 2009-03-16 Marek Safar <marek.safar@gmail.com>
222 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
223 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
224 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
225 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
227 2009-03-11 Marek Safar <marek.safar@gmail.com>
229 A fix for bug #482996
230 * anonymous.cs: Make sure we are not infering return type when
231 checking type compatibility.
233 2009-03-11 Marek Safar <marek.safar@gmail.com>
235 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
236 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
237 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
238 attributes in their own structure. Needed when accessing their
239 properties before they are resolved.
241 2009-03-09 Marek Safar <marek.safar@gmail.com>
243 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
244 hashtable (~10x faster).
246 * driver.cs: Removed wrong Reset.
248 2009-03-08 Marek Safar <marek.safar@gmail.com>
250 * class.cs: Use correct common base type for unmanaged delayed
253 * rootcontext.cs: Wrap unhandled exception.
255 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
257 Make SeekableStreamReader self-tuning and arbitrarily seekable
258 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
260 (SeekableStreamReader.Position.set): Use it. Simplify logic
261 which, as a side-effect, makes it arbitrarily-seekable. Tune the
262 buffer size when the stream needs to be re-read from the beginning.
264 2009-03-05 Marek Safar <marek.safar@gmail.com>
266 A fix for bug #480100
267 * parameter.cs: A parameter is not hoisted when used directly as ET.
269 2009-03-04 Marek Safar <marek.safar@gmail.com>
271 * statement.cs: Fixed an issue when using variable is of interface
274 2009-03-03 Marek Safar <marek.safar@gmail.com>
276 A fix for bug #480319
277 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
279 2009-03-03 Marek Safar <marek.safar@gmail.com>
281 A fix for bug #480867
282 * typemanager.cs, expression.cs, ecore.cs: Changed method group
283 expression to have no valid type.
285 2009-03-03 Marek Safar <marek.safar@gmail.com>
287 A fix for bug #481258
288 * class.cs: Set extension method flag in partial container.
290 2009-03-03 Marek Safar <marek.safar@gmail.com>
292 * statement.cs, typemanager.cs: Use expression for StringEmitter.
294 * attribute.cs: Add sanity check.
296 2009-02-27 Marek Safar <marek.safar@gmail.com>
298 * class.cs: Add external constructor error.
300 2009-02-26 Marek Safar <marek.safar@gmail.com>
302 A fix for bug #475354
303 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
304 correctly user defined nullable equality operators.
306 2009-02-25 Marek Safar <marek.safar@gmail.com>
308 A fix for bug #479532
309 * expression.cs: Implement NewInitialize::AddressOf.
311 2009-02-25 Marek Safar <marek.safar@gmail.com>
313 A fix for bug #413633
314 * expression.cs: Iterate all base class-constraint types.
316 2009-02-24 Marek Safar <marek.safar@gmail.com>
318 A fix for bug #479209
319 * literal.cs: Mutate null underlying type.
321 2009-02-24 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #476295
324 * convert.cs: Avoid wrapping implicitly convertible reference type.
326 2009-02-23 Marek Safar <marek.safar@gmail.com>
328 * iterators.cs: Create MemberName correctly.
330 2009-02-23 Marek Safar <marek.safar@gmail.com>
332 A fix for bug #478655
333 * literal.cs: Check also underlying null type conversion.
335 2009-02-21 Marek Safar <marek.safar@gmail.com>
337 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
339 2009-02-20 Marek Safar <marek.safar@gmail.com>
341 A fix for bug #477447
342 * statement.cs: Add reference to correct parent storey when this
343 is accessible from deep children storey (more than 1 level).
345 2009-02-19 Marek Safar <marek.safar@gmail.com>
347 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
348 * class.cs: Define base type members before setting up member cache.
350 2009-02-18 Marek Safar <marek.safar@gmail.com>
352 A fix for bug #477378
353 * nullable.cs, expression.cs, statement.cs: More precise null type
356 2009-02-18 Marek Safar <marek.safar@gmail.com>
358 A fix for bug #472805
359 * typemanager.cs, namespace.cs: Import only visible extension method
362 2009-02-18 Marek Safar <marek.safar@gmail.com>
364 A fix for bug #476895
365 * attribute.cs: Use correct resolve context for attribute type.
367 2009-02-18 Marek Safar <marek.safar@gmail.com>
369 A fix for bug #476266
370 * anonymous.cs: Mutate multi-dimensional arrays.
372 2009-02-18 Marek Safar <marek.safar@gmail.com>
374 A fix for bug #476400
375 * statement.cs, expression.cs: Removed wrong Dispose optimization.
377 2009-02-18 Marek Safar <marek.safar@gmail.com>
379 A fix for bug #476811
380 * generics.cs: Fixed null-literal check.
382 2009-02-17 Marek Safar <marek.safar@gmail.com>
384 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
385 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
386 messing with static variables.
388 2009-02-16 Marek Safar <marek.safar@gmail.com>
390 A fix for bug #475965
391 * generics.cs: Check generic parameter type after extracting from
394 2009-02-16 Marek Safar <marek.safar@gmail.com>
396 A fix for bug #475823
397 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
400 2009-02-14 Marek Safar <marek.safar@gmail.com>
402 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
403 Simplified event field definition using backing field and not
404 field builder directly.
406 * expression.cs (EmitLdArg): Optimize fast paths.
408 2009-02-13 Marek Safar <marek.safar@gmail.com>
410 A fix for bug #475327
411 * expression.cs (ArrayCreation): Don't mutate values optimized away.
413 2009-02-13 Marek Safar <marek.safar@gmail.com>
415 A fix for bug #475342
416 * cs-parser.jay: Using 'super' instead of 'base' to call base
417 constructor crashes compiler.
419 2009-02-13 Marek Safar <marek.safar@gmail.com>
421 A fix for bug #475354
422 * expression.cs (Constantify): Add nullable types.
424 * const.cs (EmitDecimalConstant): Avoid explicit cast.
426 2009-02-12 Marek Safar <marek.safar@gmail.com>
428 A fix for bug #475246
429 * expression.cs: More broken flowanalysis hacking needed.
431 2009-02-12 Marek Safar <marek.safar@gmail.com>
433 * attribute.cs: Compare only ref/out array modifiers.
435 2009-02-11 Marek Safar <marek.safar@gmail.com>
437 * statement.cs: Use member cache when looking for foreach members.
439 2009-02-11 Marek Safar <marek.safar@gmail.com>
441 * expression.cs: Don't expose internal initializer types.
443 * statement.cs: Check also explicit conversions for goto case.
445 2009-02-11 Marek Safar <marek.safar@gmail.com>
447 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
449 2009-02-10 Marek Safar <marek.safar@gmail.com>
451 * *.cs: Replace null-type with NullLiteral where appropriate.
453 2009-02-09 Marek Safar <marek.safar@gmail.com>
455 * expression.cs: Initializer of reference argument use temporary
456 variable to be verifiable.
458 * parameter.cs: Share EmitLdArg.
460 2009-02-09 Marek Safar <marek.safar@gmail.com>
462 A fix for bug #473559
463 * class.cs: Fixed: Not reporting error about nested class with the
466 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
468 Contributed under the MIT/X11 license.
470 * generic.cs: Added VerifyVariantTypeParameters which performs new
471 variance verification logic. The old logic, based on the spec, was
472 wrong because the spec is full of LIES!
474 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
476 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
479 * ecore.cs: Added calls to the new variance verification logic.
482 * delegate.cs: Removed calls to the old variance verification logic.
484 2009-02-06 Marek Safar <marek.safar@gmail.com>
486 * delegate.cs: Use cached Invoke method directly.
488 2009-02-06 Marek Safar <marek.safar@gmail.com>
490 * expression.cs: Emit expression tree for hoisted variable access.
492 2009-02-04 Marek Safar <marek.safar@gmail.com>
494 * namespace.cs: Add better extension class check.
496 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
498 * generic.cs: Fixed typeo (TypeParameter.Variacne).
500 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
502 This patch adds initial generic variance support to the compiler.
503 It is contributed under the MIT/X11 license.
505 * typemanager.cs: Modified ImplementsInterface to check variance.
506 Added VerifyVariantTypeParameters which checks the specified type to see
507 if it uses a variant type parameter as a type argument (which is not
508 allowed). Added IsVariantOf which determins if the first type is a
509 variant of the second. NOTE: This only supports reference types at
510 the moment to conform with the current level of VM support. When the
511 VM supports value types, this will follow step.
513 * generic.cs: Added the Variance enum. Added a Variance property to
514 TypeParameter and added variance support to definition phase. Added a
515 Variance property to TypeParameterName. Also check to make sure that
516 no variant types appear in generic method parameters.
518 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
519 keywords if the langversion supports it.
521 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
522 that variant types are only used in legal positions. Also added
523 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
526 * decl.cs: Construct TypeParameter with the variance information.
528 * convert.cs: Checks variance in ImplicitReferenceConversionExists
529 and ImplicitConversionStandard.
531 * rootcontext.cs: Added new "Future" language version.
533 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
534 type parameters are not used as type arguments in interface inheritance.
535 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
536 parameters are not used as method return types. In MemberBase.
537 ResolveMemberType, ensure that variant type parameters are not used
538 as type arguments. Also call VerifyNoVariantTypeParameters on every
539 set of parameters which are resolved.
541 * delegate.cs: Modified Delegate.Define to ensure that variant
542 parameters are not used as type arguments and that a contravariant
543 parameter is not used as the return type. Also call
544 VerifyNoVariantTypeParameters on the delegate parameters.
546 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
547 to specify generic variance.
549 * driver.cs: Added support for LanguageVersion.Future in the form of
550 "-langversion:future".
552 * generic-mcs.cs: Stubbed out new members in generic.cs.
554 2009-02-03 Marek Safar <marek.safar@gmail.com>
556 * class.cs, generic.cs: Emit type parameter constraints for nested
559 2009-02-02 Marek Safar <marek.safar@gmail.com>
561 A fix for bug #471213
562 * class.cs: Avoid emitting backing field for abstract event fields.
564 2009-02-01 Marek Safar <marek.safar@gmail.com>
566 A fix for bug #359731
567 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
570 2009-01-30 Marek Safar <marek.safar@gmail.com>
572 A fix for bug #470767
573 * statement.cs: Introduced BlockScopeExpression, needed when
574 expression tree conversion has to emit scope variables.
576 2009-01-29 Marek Safar <marek.safar@gmail.com>
578 * class.cs: Remove duplicate CallingConvention.
580 2009-01-29 Marek Safar <marek.safar@gmail.com>
582 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
583 when I finally found the right naming convention.
585 2009-01-29 Marek Safar <marek.safar@gmail.com>
587 * cs-tokenizer.cs: Put back different open parens optimization.
589 2009-01-28 Marek Safar <marek.safar@gmail.com>
591 A fix for bug #470227
592 * cs-tokenizer.cs: Remove too agressive parser optimization.
594 2009-01-28 Marek Safar <marek.safar@gmail.com>
596 A fix for bug #324319
597 * class.cs: Remove too early base type resolve.
599 2009-01-27 Marek Safar <marek.safar@gmail.com>
601 A fix for bug #324319
602 * ecore.cs: Explicitly type null when assigning to type argument to
603 make pass verifier check.
605 2009-01-27 Marek Safar <marek.safar@gmail.com>
607 * anonymous.cs: Fixed recent regression when initializing captured
610 2009-01-26 Marek Safar <marek.safar@gmail.com>
612 A fix for bug #469019
613 * anonymous.cs: Use all parent type parameters when instantiating
614 nested generic storey.
616 2009-01-26 Marek Safar <marek.safar@gmail.com>
618 * expression.cs: Check for null instance methodgroup expression.
620 2009-01-26 Marek Safar <marek.safar@gmail.com>
622 A fix for bug #469244
623 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
624 instance inside a conditional expression.
626 2009-01-23 Marek Safar <marek.safar@gmail.com>
628 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
629 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
630 GetElementType and HasElementType. IsValueType clean up.
632 2009-01-23 Marek Safar <marek.safar@gmail.com>
634 * nullable.cs: Use common EmitCall.
636 * expression.cs: Emit constraint. for virtual calls only.
638 2009-01-23 Marek Safar <marek.safar@gmail.com>
640 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
641 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
642 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
645 2009-01-22 Jb Evain <jbevain@novell.com>
647 * anonymous.cs: make anonymous types' ToString implementation
648 match what csc outputs.
650 2009-01-21 Marek Safar <marek.safar@gmail.com>
652 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
655 2009-01-17 Marek Safar <marek.safar@gmail.com>
657 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
660 2009-01-16 Marek Safar <marek.safar@gmail.com>
662 * nullable.cs (LiftedBinaryOperator): Check for all possible null
665 2009-01-15 Marek Safar <marek.safar@gmail.com>
667 A fix for bug #466634
668 * statement.cs: Add reference for nested storey when only this
671 2009-01-15 Marek Safar <marek.safar@gmail.com>
673 A fix for bug #466474
674 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
677 2009-01-15 Marek Safar <marek.safar@gmail.com>
679 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
680 Fixed nested stories parent referencing process. Also fixes #463985.
682 2009-01-06 Marek Safar <marek.safar@gmail.com>
684 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
685 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
686 implementation. Also fixes #463108.
688 2009-01-05 Marek Safar <marek.safar@gmail.com>
690 A fix for bug #416109
691 * decl.cs: Issue correct CLSAttribute warning location.
693 2009-01-05 Marek Safar <marek.safar@gmail.com>
695 A fix for bug #456775
696 * attribute.cs: Use attribute owner scope when resolving attribute
699 2009-01-05 Marek Safar <marek.safar@gmail.com>
701 A fix for bug #457257
702 * decl.cs: Fixed incorrect member declaring type comparison.
704 2009-01-05 Marek Safar <marek.safar@gmail.com>
706 A fix for bug #460896
707 * driver.cs: Handle /RES resources as embeddable.
709 2009-01-05 Marek Safar <marek.safar@gmail.com>
711 A fix for bug #462515
712 * ecore.cs: Report inacessible members upwards.
714 2009-01-05 Marek Safar <marek.safar@gmail.com>
716 A fix for bug #463190, #463192
717 * decl.cs, namespace.cs: Also import internal extension classes.
719 2009-01-04 Marek Safar <marek.safar@gmail.com>
721 A fix for bug #463415
722 * generic.cs: Use right index for RemoveDependentTypes.
724 2009-01-02 Marek Safar <marek.safar@gmail.com>
726 A fix for bug #463196
727 * expression.cs: Fixed enum to null comparison.
729 2009-01-02 Marek Safar <marek.safar@gmail.com>
731 A fix for bug #463121
732 * nullable.cs: Fixed nullable user equality operator comparison.
734 2009-01-02 Marek Safar <marek.safar@gmail.com>
736 A fix for bug #462950
737 * class.cs, decl.cs: Use full explicit name when defining automatic
738 property backing field.
740 2009-01-02 Marek Safar <marek.safar@gmail.com>
742 A fix for bug #462592
743 * pending.cs: Emit type arguments for generic proxy method.
745 2008-12-30 Marek Safar <marek.safar@gmail.com>
747 * expression.cs (As): Mutate all type arguments.
749 2008-12-29 Marek Safar <marek.safar@gmail.com>
751 A fix for bug #462622
752 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
755 2008-12-29 Marek Safar <marek.safar@gmail.com>
757 A fix for bug #450782
758 * ecore.cs: Consider more variables of form V.I to be fixed.
760 2008-12-29 Marek Safar <marek.safar@gmail.com>
762 A fix for bug #460712
763 * typemanager.cs: Core types could be imported.
765 2008-12-28 Marek Safar <marek.safar@gmail.com>
767 A fix for bugs #460847, #460772, #458049, #457339, #447807
768 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
769 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
770 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
771 user lambdas used inside query clauses.
773 2008-12-18 Marek Safar <marek.safar@gmail.com>
775 A fix for bug #460229
776 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
778 2008-12-18 Marek Safar <marek.safar@gmail.com>
780 A fix for bug #459952
781 * decl.cs, namespace.cs: Use common CheckAccessLevel.
783 2008-12-18 Marek Safar <marek.safar@gmail.com>
785 A fix for bug #459630
786 * convert.cs: Enum to valuetype conversion is not allowed.
788 2008-12-18 Marek Safar <marek.safar@gmail.com>
790 A fix for bug #457087
791 * generic.cs: Don't crash when constraint comes from type
794 2008-12-16 Marek Safar <marek.safar@gmail.com>
796 A fix for bug #459221
797 * anonymous.cs, statement.cs: Delay only captured this
800 2008-12-12 Marek Safar <marek.safar@gmail.com>
802 A fix for bug #457489
803 * anonymous.cs, statement.cs: Split anonymous storey instantiation
804 and initialization to capture scope initializers correctly.
806 2008-12-11 Marek Safar <marek.safar@gmail.com>
808 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
809 ParameterReference refactoring.
811 2008-12-03 Marek Safar <marek.safar@gmail.com>
813 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
814 to be imported from any assembly.
816 2008-12-03 Marek Safar <marek.safar@gmail.com>
818 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
819 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
820 from anonymous method and lambda expression.
822 2008-12-01 Marek Safar <marek.safar@gmail.com>
824 A fix for bug #448560
825 * expression.cs (As): Box any generic type arguments to be
828 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
830 Add tripwire for implicit conversion bugs
831 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
833 (MethodGroupExpr.OverloadResolve): Add sanity check between
834 IsApplicable and VerifyArgumentsCompat.
835 (VerifyArgumentsCompat): Report CS1501 where appropriate.
837 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
839 Fix build break in System.Data_test
840 * convert.cs (ImplicitConversionExists): Move NullLiteral
842 (ImplicitStandardConversionExists): ... here.
844 2008-11-28 Marek Safar <marek.safar@gmail.com>
846 * literal.cs: Emit correctly explicit null to nullable cast.
848 2008-11-28 Marek Safar <marek.safar@gmail.com>
850 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
853 2008-11-28 Marek Safar <marek.safar@gmail.com>
855 A fix for bug #449005
856 * convert.cs, nullable.cs: Use only one implicit nullable
859 2008-11-27 Marek Safar <marek.safar@gmail.com>
861 * convert.cs, literal.cs: More Convert cleanup is needed.
863 2008-11-27 Marek Safar <marek.safar@gmail.com>
865 * decl.cs, class.cs: Fixed misleading error message.
867 2008-11-26 Marek Safar <marek.safar@gmail.com>
869 A fix for bug #449005
870 * nullable.cs (EmitEquality): Disable optimization for user operator
873 2008-11-25 Marek Safar <marek.safar@gmail.com>
875 A fix for bug #447027
876 * anonymous.cs (HoistedVariable): Cache also outer access to deal
877 with context variables stored as expression instances.
879 2008-11-25 Marek Safar <marek.safar@gmail.com>
881 A fix for bug #447027
882 * delegate.cs: Fixed delegate VerifyMethod logic.
884 2008-11-24 Marek Safar <marek.safar@gmail.com>
886 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
889 2008-11-21 Marek Safar <marek.safar@gmail.com>
891 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
892 member type resolve to follow normal flow, instead of random
895 2008-11-21 Marek Safar <marek.safar@gmail.com>
897 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
900 2008-11-21 Marek Safar <marek.safar@gmail.com>
902 * const.cs: Emit decimal array constant as literal.
904 2008-11-20 Marek Safar <marek.safar@gmail.com>
906 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
908 2008-11-19 Marek Safar <marek.safar@gmail.com>
910 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
911 into real property (saves 8 MB for corlib compilation).
913 2008-11-19 Marek Safar <marek.safar@gmail.com>
915 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
916 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
917 generic-mcs.cs: Small cleanup of TypeArguments.
919 2008-11-18 Marek Safar <marek.safar@gmail.com>
921 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
922 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
923 of ConstructedType expression, renamed to GenericTypeExpr.
925 2008-11-17 Marek Safar <marek.safar@gmail.com>
927 A fix for bug #445303
928 * location.cs (IsConditionalDefined): Handle undefined global
931 2008-11-17 Marek Safar <marek.safar@gmail.com>
933 A fix for bug #444678
934 * expression.cs (TryReduceConstant): Always create new constant
937 2008-11-17 Marek Safar <marek.safar@gmail.com>
939 A fix for bug #444673
940 * ecore.cs: Ignore open generic types when used as generic type
943 2008-11-17 Marek Safar <marek.safar@gmail.com>
945 A fix for bug #445458
946 * expression.cs, cs-parser.jay: Don't crash when an expression
949 2008-11-17 Marek Safar <marek.safar@gmail.com>
951 A fix for bug #445464
952 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
955 2008-11-14 Jb Evain <jbevain@novell.com>
957 * driver.cs: ignore empty -nowarn argument such as
958 the one in -nowarn:12,13,,.
960 2008-11-13 Marek Safar <marek.safar@gmail.com>
962 A fix for bug #444271
963 * anonymous.cs: Rescan parent storeys when best candidate was
966 2008-11-13 Marek Safar <marek.safar@gmail.com>
968 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
969 useless UnboundTypeExpression.
971 * attribute.cs: Do check obsolete attribute on generic types.
973 2008-11-12 Marek Safar <marek.safar@gmail.com>
975 A fix for bugs #425680, #400139
976 * ecore.cs, expression.cs: Trying to do some almost_matched_members
979 2008-11-11 Marek Safar <marek.safar@gmail.com>
981 A fix for bug #435747
982 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
983 compound value types assignment. Few micro optimizations added.
985 2008-11-10 Marek Safar <marek.safar@gmail.com>
987 A fix for bug #442610
988 * anonymous.cs (MutateConstructor): More SRE hacking.
990 2008-11-10 Marek Safar <marek.safar@gmail.com>
992 A fix for bug #442579
993 * ecore.cs: Also initialize expanded form of a method with 1 params
996 2008-11-06 Marek Safar <marek.safar@gmail.com>
998 * expression.cs (UnaryMutator): Do early l-side check.
1000 2008-11-05 Miguel de Icaza <miguel@novell.com>
1002 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1003 Init, otherwise we would crash later on when checking for friend
1006 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1007 Otherwise we never get any meaningful information as to what
1010 2008-11-05 Marek Safar <marek.safar@gmail.com>
1012 A fix for bug #436318
1013 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1015 2008-11-05 Miguel de Icaza <miguel@novell.com>
1017 * namespace.cs: Turns out that it was a really bad idea to hide
1018 the errors for namespaces not found here in eval mode.
1020 * eval.cs: When we process using clauses, only enter those into
1021 the list of valid using clauses after they have been validated.
1023 The above change gives the proper semantics: it does not
1024 senselessly report the same errors with broken using statements by
1025 never storing them in the first place when they are invalid.
1027 2008-11-05 Marek Safar <marek.safar@gmail.com>
1029 A fix for bug #421839
1030 * cs-parser.jay: Remove expression from coalesce rule to force lower
1031 priority than the assignment operator.
1033 2008-11-05 Marek Safar <marek.safar@gmail.com>
1035 A fix for bug #437875
1036 * nullable.cs: Compile correctly method group operand used with null
1037 coalescing operator.
1039 2008-11-04 Marek Safar <marek.safar@gmail.com>
1041 A fix for bug #434589
1042 * expression.cs (Binary): Ignore lifted conversions when at least
1043 one operand is of reference type.
1045 2008-11-04 Marek Safar <marek.safar@gmail.com>
1047 * cs-parser.jay: Better syntax error report.
1049 2008-11-03 Marek Safar <marek.safar@gmail.com>
1051 A fix for bug #436792
1052 * cs-parser.jay: Use GetLocation to access location.
1054 2008-11-03 Marek Safar <marek.safar@gmail.com>
1056 A fix for bug #440774
1057 * cs-parser.jay: Also set current_array_type when parsing local
1060 2008-11-03 Marek Safar <marek.safar@gmail.com>
1062 A fix for bug #440785
1063 * expression.cs (As): Don't resolve self modifing expression
1066 2008-11-03 Marek Safar <marek.safar@gmail.com>
1068 A fix for bug #439447
1069 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1071 2008-11-03 Marek Safar <marek.safar@gmail.com>
1073 A fix for bug #437571
1074 * cs-parser.jay: Fixes internal error for invalid expression
1077 2008-10-17 Marek Safar <marek.safar@gmail.com>
1079 * ecore.cs: Resolve correctly ambiguous params delegate methods.
1081 2008-10-17 Marek Safar <marek.safar@gmail.com>
1083 * generic.cs, anonymous.cs: Simplified GetDeclarations.
1085 2008-10-17 Marek Safar <marek.safar@gmail.com>
1087 * cs-tokenizer.cs: More precise cast parsing.
1089 2008-10-16 Martin Baulig <martin@ximian.com>
1091 * anonymous.cs (AnonymousMethodStorey): Put back the
1092 `hoisted_locals' hashtable and use it in EmitType().
1094 2008-10-15 Marek Safar <marek.safar@gmail.com>
1096 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1097 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1100 2008-10-14 Marek Safar <marek.safar@gmail.com>
1102 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1104 2008-10-14 Marek Safar <marek.safar@gmail.com>
1106 * statement.cs: Mutate scope initializers.
1108 2008-10-14 Marek Safar <marek.safar@gmail.com>
1110 * expression.cs: Use typeless value for This constant.
1112 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1114 2008-10-14 Marek Safar <marek.safar@gmail.com>
1116 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1119 2008-10-13 Marek Safar <marek.safar@gmail.com>
1121 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1124 2008-10-13 Marek Safar <marek.safar@gmail.com>
1126 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1127 parser and tokenizer. Fixes many ambiguities including #433258.
1129 2008-10-10 Marek Safar <marek.safar@gmail.com>
1131 * cs-parser.jay: Fixed missing accessor recovery.
1133 2008-10-10 Marek Safar <marek.safar@gmail.com>
1135 A fix for bug #433701
1136 * expression.cs: Better error message.
1138 2008-10-10 Marek Safar <marek.safar@gmail.com>
1140 * cs-parser.jay, expression.cs: Start reporting real parser errors.
1142 * Makefile: Disabled unused debug symbols.
1144 Also fixes: #320556, #321097, #321656, #321876, #351316
1146 2008-10-09 Miguel de Icaza <miguel@novell.com>
1148 * eval.cs: rename "<interactive>" to "{interactive}", to work
1149 around a requirement in the compiler that this be a valid
1150 filename, and in Windows it is not (433886).
1152 2008-10-09 Marek Safar <marek.safar@gmail.com>
1154 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1156 2008-10-08 Marek Safar <marek.safar@gmail.com>
1158 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1159 cs-parser.jay: Generic type declaration and type arguments cleanup.
1161 2008-10-05 Marek Safar <marek.safar@gmail.com>
1163 * cs-parser.jay: Allow parsing weird array creation construct.
1165 2008-10-05 Marek Safar <marek.safar@gmail.com>
1167 * cs-parser.jay: Conflicts reduction.
1169 2008-10-04 Marek Safar <marek.safar@gmail.com>
1171 * cs-parser.jay: Conflicts reduction.
1173 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
1176 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1177 property. Add a 'count' hint about the use of the shared vector.
1178 Ensure that we don't leak out dirty bits.
1179 (UsageVector.MergeChild): Throw away information about variables
1181 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1183 2008-10-03 Marek Safar <marek.safar@gmail.com>
1185 A fix for bug #431746
1186 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1187 parameters when iterator is created.
1189 2008-10-03 Marek Safar <marek.safar@gmail.com>
1191 A fix for bug #431827
1192 * expression.cs: Fixed right based pointer arithmetic operations
1195 2008-10-03 Marek Safar <marek.safar@gmail.com>
1197 A fix for bug #353779
1198 * assign.cs, expression.cs: Fixed compound assignment conversions.
1200 2008-10-02 Marek Safar <marek.safar@gmail.com>
1202 A fix for bug #375262
1203 * statement.cs: Refactor ArrayForeach to be usable with string
1204 indexer. Optimized single dimentional arrays foreach.
1206 2008-10-02 Marek Safar <marek.safar@gmail.com>
1208 A fix for bug #431255
1209 * anonymous.cs, expression.cs: Removed broken optimization.
1211 2008-10-01 Marek Safar <marek.safar@gmail.com>
1213 * anonymous.cs: Use full type parameters of parent generic
1214 containers. Removed unnecessary AddParentStoreyReference call.
1216 2008-10-01 Marek Safar <marek.safar@gmail.com>
1218 A fix for bug #324702
1219 * class.cs: Use better shorter names for explicit interface member
1222 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1224 2008-10-01 Marek Safar <marek.safar@gmail.com>
1226 * expression.cs: Use new interface to check fixed expression.
1228 2008-10-01 Marek Safar <marek.safar@gmail.com>
1230 A fix for bug #421101
1231 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1232 interface to check for fixed fixed-buffers.
1234 2008-10-01 Marek Safar <marek.safar@gmail.com>
1236 A fix for bug #429264
1237 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1239 * delegate.cs: Removed unnecessary casts.
1241 2008-09-30 Marek Safar <marek.safar@gmail.com>
1243 A fix for bug #352151
1244 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1245 class.cs: Fixed already defined explicit interface members check.
1247 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
1249 cs-tokenizer.cs: Fix typo.
1251 2008-09-28 Miguel de Icaza <miguel@novell.com>
1253 * eval.cs (InteractiveBase): The quit command now just sets a
1254 flag, instead of calling Environment.Exit(), it is milder on
1257 CompiledMethod is now in Mono.CSharp, not nested inside
1258 the Evaluator, it was inconvenient to use.
1260 2008-09-27 Miguel de Icaza <miguel@novell.com>
1262 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1263 code to be invoked without having to reparse.
1265 2008-09-27 Miguel de Icaza <miguel@novell.com>
1267 * ecore.cs: The recent changes to FieldExpr broke this as well.
1268 Fixes LINQ queries in the interactive shell.
1270 * Multiple files: indentation fixing for the Mono coding
1271 guidelines for the switch statement.
1273 * eval.cs: Make the Evaluator API thread safe.
1275 2008-09-26 Marek Safar <marek.safar@gmail.com>
1277 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1278 constructor parsing.
1280 2008-09-26 Marek Safar <marek.safar@gmail.com>
1282 A fix for bug #325326
1283 * statement.cs: Check possible mistaken empty statement using
1284 explicit blocks only.
1286 2008-09-25 Miguel de Icaza <miguel@novell.com>
1288 * eval.cs (LoadAssembly, ReferenceAssembly): Call
1289 RootNamespace.ComputeNamespaces to update the internal list of
1290 namespaces, this is no longer done for us.
1292 (InteractiveBase): Use the Evaluator APIs instead of calling into
1295 2008-09-25 Marek Safar <marek.safar@gmail.com>
1297 A fix for bug #429264
1298 * expression.cs: Missing mutator for access to multidimensional
1301 2008-09-25 Marek Safar <marek.safar@gmail.com>
1303 * class.cs, statement: Emit DebuggerHidden attribute for iterator
1306 * driver.cs: Missing input argument check.
1308 2008-09-25 Marek Safar <marek.safar@gmail.com>
1310 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1311 expression.cs, statement.cs, rootcontext.cs, class.cs,
1312 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1315 2008-09-24 Miguel de Icaza <miguel@novell.com>
1317 * ecore.cs (FieldExpr): Only initialize eclass when we return a
1318 fully constructed FieldExpr, fixes the regression introduced in
1321 * ecore.cs, expression.cs: Plug back the eclass initialization as
1322 otherwise it regresses `csharp'.
1324 2008-09-24 Marek Safar <marek.safar@gmail.com>
1326 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1327 ecore.cs, attribute.cs: Moved obsolete method checks from emit
1328 phase to resolve phase. It resolves problems with expression trees
1329 and fixes bugs #323796, #325156.
1331 2008-09-23 Marek Safar <marek.safar@gmail.com>
1333 * codegen.cs: Report better error when symbol writer is missing.
1335 2008-09-23 Marek Safar <marek.safar@gmail.com>
1337 * codegen.cs: Set .NET symbol writer.
1339 * decl.cs: Guard against null generic arguments.
1341 * report.cs: Don't report exactly same additional details.
1343 2008-09-22 Marek Safar <marek.safar@gmail.com>
1345 A fix for bug #324917
1346 * cs-parser.jay: Add missing multidimensional non-expression type
1349 2008-09-22 Marek Safar <marek.safar@gmail.com>
1351 A fix for bug #428191
1352 * anonymous.cs: Create an outer generic fields also for non-storey
1355 2008-09-22 Marek Safar <marek.safar@gmail.com>
1357 A fix for bug #378294
1358 * class.cs: Make fixed size buffers gmcs feature only.
1360 2008-09-22 Marek Safar <marek.safar@gmail.com>
1362 A fix for bug #355622, #324993
1363 * assign.cs, const.cs, class.cs: Create new EmitContext for each
1366 2008-09-19 Marek Safar <marek.safar@gmail.com>
1368 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1371 2008-09-19 Marek Safar <marek.safar@gmail.com>
1373 A fix for bug #416110
1374 * generic.cs: Struct constraint results in default ctor and
1375 ValueType base type constraint to be set.
1377 2008-09-19 Marek Safar <marek.safar@gmail.com>
1379 A fix for bug #423791
1380 * generic.cs: Fixed params output type type-inference.
1382 2008-09-19 Marek Safar <marek.safar@gmail.com>
1384 * cs-parser.jay, expression.cs: Fixed few expression crashes.
1386 2008-09-19 Marek Safar <marek.safar@gmail.com>
1388 * cs-tokenizer.cs: Don't break on extra partial modifier.
1390 2008-09-19 Marek Safar <marek.safar@gmail.com>
1392 A fix for bug #427592
1393 * generic.cs: Use common parameter resolve method.
1395 2008-09-18 Marek Safar <marek.safar@gmail.com>
1397 A fix for bug #414758
1398 * expression.cs, ecore.cs: Fixed crash when accessing non-static
1401 2008-09-18 Marek Safar <marek.safar@gmail.com>
1403 * driver.cs, namespace.cs: Read types and namespaces after all
1404 requested assemblies are loaded, fixes issues with System.Core
1405 auto-reference, and #419888.
1407 2008-09-18 Marek Safar <marek.safar@gmail.com>
1409 A fix for bug #417705
1410 * cs-parser.jay: Fixed as/is operator expression split.
1412 2008-09-18 Marek Safar <marek.safar@gmail.com>
1414 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1415 Fixed expression tree representation of empty new expression and
1416 new initializer expression.
1418 2008-09-18 Miguel de Icaza <miguel@novell.com>
1420 * eval.cs: Remove warning, keep reference to driver around.
1422 * Hide fields that do not need to be public.
1424 2008-09-17 Marek Safar <marek.safar@gmail.com>
1426 A fix for bug #426385
1427 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1428 conversion for array elements.
1430 2008-09-17 Marek Safar <marek.safar@gmail.com>
1432 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1433 void parsing conflicts.
1435 2008-09-15 Marek Safar <marek.safar@gmail.com>
1437 A fix for bug #425601
1438 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1439 System.Core only when there is no custom ExtensionAttribute
1442 2008-09-15 Miguel de Icaza <miguel@novell.com>
1444 * namespace.cs: Do not report CS0246 (name
1446 2008-09-12 Marek Safar <marek.safar@gmail.com>
1448 A fix for bug #425669
1449 * generic.cs: Don't cache generic static anonymous method
1452 2008-09-12 Marek Safar <marek.safar@gmail.com>
1454 * generic.cs, class.cs, delegate.cs: Check recursive inherited
1455 conflicting constraints.
1457 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
1459 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1462 2008-09-12 Marek Safar <marek.safar@gmail.com>
1464 * literal.cs, convert.cs, expression.cs, statement.cs: More null
1465 to null pointer conversion fixes.
1467 2008-09-11 Marek Safar <marek.safar@gmail.com>
1469 * cs-parser.jay, expression.cs: An implicitly typed local variable
1470 declarator cannot use an array initializer.
1472 2008-09-11 Marek Safar <marek.safar@gmail.com>
1474 * cs-parser.jay: Reduced number of printed tokens, add sorting.
1476 2008-09-11 Marek Safar <marek.safar@gmail.com>
1478 * generic.cs (InflatedConstraints): Don't crash when constraints
1481 * cs-parser.jay: const_declarator is a block.
1483 * constant.cs: Check for not allowed NaN conversions.
1485 2008-09-10 Miguel de Icaza <miguel@novell.com>
1487 * driver.cs: Drop --shell argument, the compiler is no longer a
1490 * eval.cs: Move most of the code that deals with evaluation into
1491 this file and document the public API from repl.cs
1493 * repl.cs: Remove from here.
1495 2008-09-10 Marek Safar <marek.safar@gmail.com>
1497 A fix for bug #424684
1498 * generic.cs: Generic class constraints must come first.
1500 2008-09-09 Miguel de Icaza <miguel@novell.com>
1502 * cs-parser.jay: Improve error reporting for syntax errors in
1503 statements and expressions, we now report the expected tokens
1504 instead of reporting the useless "; expected".
1506 Drop the strings from the token declaration, it turns out that
1507 they did not do what I thought they did. Instead they were adding
1508 two sets of tokens to the tables.
1510 2008-09-09 Marek Safar <marek.safar@gmail.com>
1512 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1513 delegate.cs: Share special type check.
1515 2008-09-09 Marek Safar <marek.safar@gmail.com>
1517 A fix for bug #423981
1518 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1520 2008-09-09 Marek Safar <marek.safar@gmail.com>
1522 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1525 2008-09-09 Marek Safar <marek.safar@gmail.com>
1527 A fix for bugs: #324750, #335946
1528 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
1529 lookup rule to determine ?-based tokens.
1531 2008-09-08 Miguel de Icaza <miguel@novell.com>
1533 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1534 expressions (like event adding or removing) end up here, so we
1535 need to treat those as statements.
1537 Add LoadAssembly method.
1539 2008-09-04 Miguel de Icaza <miguel@novell.com>
1541 * repl.cs: Add Time method.
1543 2008-09-05 Marek Safar <marek.safar@gmail.com>
1545 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1547 2008-09-05 Miguel de Icaza <miguel@novell.com>
1549 * repl.cs: Add workaround for old compilers.
1551 2008-09-04 Jb Evain <jbevain@novell.com>
1553 * repl.cs (PrettyPrint): pretty print everything that
1554 implements IDictionary, as well as IEnumerables. Also,
1555 add a quit helper property.
1557 2008-09-04 Marek Safar <marek.safar@gmail.com>
1559 * constant.cs: Better error reporting for decimal literals.
1561 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1564 2008-09-04 Marek Safar <marek.safar@gmail.com>
1565 Miguel de Icaza <miguel@novell.com>
1567 A fix for bug #422951
1568 * assign.cs (Assign.DoResolve): Perform the type conversions
1569 checks before we attempt to initialize `New' initializers.
1571 2008-09-04 Marek Safar <marek.safar@gmail.com>
1573 A fix for bug #422853
1574 * delegate.cs (DelegateCreation): Add special handling for
1575 EmptyExpression.Null instance expression which is just another
1576 hack for undecided member instance exression.
1578 2008-09-04 Marek Safar <marek.safar@gmail.com>
1580 * expression.cs, ecore.cs: Emit full expression tree for reduced
1583 2008-09-04 Marek Safar <marek.safar@gmail.com>
1585 * expression.cs (This): Guard against multi-resolving.
1587 * ecore.cs, statement.cs (Throw): Simplified.
1589 * flowanalysis.cs: Also verify event fields.
1591 2008-09-04 Miguel de Icaza <miguel@novell.com>
1593 * assign.cs (Assign.DoResolve): Perform the type conversions
1594 checks before we attempt to initialize `New' initializers.
1596 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1598 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1601 * repl.cs: Update help.
1603 2008-09-03 Miguel de Icaza <miguel@novell.com>
1605 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1606 handling of the default config handling, including the special
1607 treatment of System.Core assembly.
1609 Fixes the REPL processing for LINQ.
1611 2008-09-03 Marek Safar <marek.safar@gmail.com>
1613 A fix for bug #422507
1614 * expression.cs (UnboxCast): Add missing child expression mutator.
1616 2008-09-03 Marek Safar <marek.safar@gmail.com>
1618 * driver.cs: Don't self reference System.Core assembly.
1620 2008-09-03 Marek Safar <marek.safar@gmail.com>
1622 A fix for bug #422507
1623 * expression.cs (StringConcat): Add missing type mutator.
1625 2008-09-03 Marek Safar <marek.safar@gmail.com>
1627 * generic.cs (TypeInferenceContext): Follow equality rule for
1628 constructed type lower bound type inference.
1630 2008-09-02 Miguel de Icaza <miguel@novell.com>
1632 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1633 <dblank@cs.brynmawr.edu> which updates the cursor position on
1636 2008-09-02 Marek Safar <marek.safar@gmail.com>
1638 A fix for bug #367145
1639 * driver.cs: Fixed import of extension methods when using -noconfig
1642 2008-09-02 Marek Safar <marek.safar@gmail.com>
1644 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1645 version from non-generic implementation instead.
1647 2008-09-01 Marek Safar <marek.safar@gmail.com>
1649 A fix for bug #418908
1650 * class.cs: Use AddScopeStatement for field initializers.
1652 2008-09-01 Marek Safar <marek.safar@gmail.com>
1654 A fix for bug #415385
1655 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1657 2008-09-01 Marek Safar <marek.safar@gmail.com>
1659 A fix for bug #421736
1660 * iterators.cs: Don't crash on unreachable iterators.
1662 2008-09-01 Marek Safar <marek.safar@gmail.com>
1664 A fix for bug #421628
1665 * parameter.cs, attribute.cs: Clone also parameter attributes.
1667 2008-08-30 Miguel de Icaza <miguel@novell.com>
1669 * namespace.cs (LookupType): In EvalMode, try to replace
1670 the TypeBuilder from our cache with a Type as Reflection.Emit does
1671 not like to mix code from older assemblies emitted and new
1674 This sounds like a serious Mono bug that prevents multiple
1675 assemblies to be generated and consumed at the same time.
1677 * cs-parser.jay (push_current_class): Do not make interactive
1678 classes internal or private, make them public as we currently
1679 generate each new class in a new assembly.
1681 2008-08-29 Miguel de Icaza <miguel@novell.com>
1683 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1684 remove types that are entered into the global namespace during
1685 parsing so that we can remove them on failure.
1687 * cs-parser.jay: Parsing: we now keep track of types that are
1688 entered into global variables and queue those in case the parsing
1691 This happens in a few situations: during partial-input, we invoke
1692 the parser repeatedly for example with the string "class X", this
1693 would cause X to be registed, and we need to remove this
1694 registration so that another parse attempt later with say "class X {"
1695 would actually work.
1697 Additionally, if there is an error in the resolution phase, for
1698 example: "class X : NonExistant {}" th
1700 * cs-parser.jay: Be more precise with the errors being raised,
1701 instead of flagging all exceptions during parsing to be attributed
1702 to the parsing process, distinguish those from errors happening in
1703 the actions and hint that using -v would produce the actual
1706 * repl.cs: Do not load all compiler references on each reset,
1707 doing the partial reset takes care of this.
1709 2008-08-28 Miguel de Icaza <miguel@novell.com>
1711 * repl.cs: Add support for loading all the files from
1712 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1715 Introduce a micro-parser that is able to deambiguate on its input
1716 whether we are dealing with a compilation unit (namespace, class,
1717 interface, struct, delegate) declaration or a statement. This
1718 allows both declarations and statements to be entered.
1720 Set history size by default to 300 lines.
1722 Instead of distinguishing based on the parser.InteractiveResult,
1723 have only two cases: statements were parsed, or a compilation unit
1724 was. Always pull the Using statement additions from the
1725 compilation unit parse.
1727 * cs-tokenizer.cs: Rename tokens to better describe their intent
1728 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1730 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1731 EvalMode is used to trigger the lookup of global variables while
1732 StatementMode is used turn variable declarations into static
1735 * getline.cs: Allow history size to be set.
1737 2008-08-29 Marek Safar <marek.safar@gmail.com>
1739 A fix for bug #360755
1740 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1742 2008-08-29 Marek Safar <marek.safar@gmail.com>
1744 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1746 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1747 member name, it is too confusing
1749 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1751 * rootcontext.cs: Finally default to warning level 4.
1753 2008-08-28 Marek Safar <marek.safar@gmail.com>
1755 * class.cs (CheckBase): Ignore overloaded operators.
1757 2008-08-28 Marek Safar <marek.safar@gmail.com>
1759 A fix for bug #420830
1760 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1762 2008-08-28 Marek Safar <marek.safar@gmail.com>
1764 A fix for bug #420832
1765 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1767 2008-08-28 Marek Safar <marek.safar@gmail.com>
1769 A fix for bug #420386
1770 * nullables.cs: Fixed logic of nullable user comparison operators involving
1773 2008-08-28 Marek Safar <marek.safar@gmail.com>
1775 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1777 2008-08-27 Miguel de Icaza <miguel@novell.com>
1779 * repl.cs: Add support for aborting the running code with C-c.
1781 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1783 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1785 2008-08-27 Miguel de Icaza <miguel@novell.com>
1787 * cs-parser.jay (interactive_statement_list): A new set of rules
1788 for hosting statements that uses the "interactive_" prefix.
1790 * repl.cs: Add support for parsing `using' as a statement or as a
1791 directive. Deambiguating before passing this to the parser.
1793 We need to distinguish statement_expressions that occur at the
1794 toplevel vs those that occur embedded into expressions.
1796 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1797 that fixes the cursor key handling, and a history bug.
1799 2008-08-26 Miguel de Icaza <miguel@novell.com>
1801 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1802 limitations in Console, instead the 2.0 bootstrap libraries now
1803 include the Console bits.
1805 Also, remove the use of Nullables from getline.cs
1809 Interactive support for the C# compiler. Use gmcs --shell to
1810 enter a read-eval-print loop shell.
1812 Docs: http://www.mono-project.com/CsharpRepl
1814 * sources: include repl.cs here and getline.cs for gmcs.exe,
1815 everything else is getline.cs impaired.
1817 * Makefile: when bootstrapping pass a special flag
1818 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1819 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1820 This distinguishes those two cases.
1822 * repl.cs: Support for a read-eval-print loop. Will be soon
1823 refactored into eval support and then REPL on top of it.
1825 * ecore.cs: If a simplename lookup fails, before erroring out,
1826 if we are in EvalMode to resolve the name to a declaration in the
1829 This means that variable declarations that happened in previous
1830 classes (as repl puts every statement in a separate class) are
1831 made visible in this way.
1833 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1834 triggered an error due to the end of file being reached. This is
1835 used to do multi-line input, and notify the caller that the user
1836 needs to provide more text before a successful parse.
1838 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1839 to drive the evaluation with a custom wrapper.
1841 * driver.cs: Add support for --shell, and refactor some code to be
1844 * namespace.cs: Add support for serializing the contents of the
1845 namespaces and reloading them.
1847 * getline.cs: A managed implementation of ReadLine under
1848 X11/Apache2 license terms. Easy to embed in other applications as
1851 * namespace.cs: Add some functions to save and restore the
1854 * rootcontext.cs: New public field.
1856 * cs-tokenizer.cs: Add support for one of the possible characters
1857 we introduce into the token stream.
1859 This patch does not affect the regular tokenization process, the
1860 only performance hit would happen if there is an invalid character
1861 on the input string.
1863 * support.cs: Move isatty helper routine here.
1865 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1866 code generator for in-memory assemblies.
1868 2008-08-26 Marek Safar <marek.safar@gmail.com>
1870 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1871 parameter cannot be always used as a type.
1873 2008-08-21 Marek Safar <marek.safar@gmail.com>
1875 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1877 2008-08-21 Marek Safar <marek.safar@gmail.com>
1879 * convert.cs: Implement explicit array to IList<T> conversion.
1881 2008-08-20 Marek Safar <marek.safar@gmail.com>
1883 A fix for bug #362740
1884 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1886 2008-08-20 Marek Safar <marek.safar@gmail.com>
1888 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1889 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1890 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1891 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1892 handling to use just one type of infrastructure and deal with generics
1895 2008-07-23 Martin Baulig <martin@ximian.com>
1897 *** Merged this from trunk revision 108527 ***
1900 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1901 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1904 2008-08-15 Marek Safar <marek.safar@gmail.com>
1906 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1909 2008-08-15 Marek Safar <marek.safar@gmail.com>
1911 * delegate.cs: Fixed compiler crash when creating delegate using partial
1914 * typemanager.cs: MulticastDelegate is not a delegate.
1916 2008-08-14 Marek Safar <marek.safar@gmail.com>
1918 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1921 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1923 * cs-parser.jay (type): Allow 'var' in mcs too.
1924 (local_variable_type): Likewise.
1926 2008-08-14 Marek Safar <marek.safar@gmail.com>
1928 * driver.cs: Removed broken -noconfig variants.
1930 2008-08-14 Marek Safar <marek.safar@gmail.com>
1932 A fix for bug #417078
1933 * expression.cs: Emit correctly left side pointer operators.
1935 2008-08-13 Marek Safar <marek.safar@gmail.com>
1937 * generic.cs, lambda.cs: Inflate method generic arguments only.
1939 2008-08-12 Marek Safar <marek.safar@gmail.com>
1941 * class.cs: Fixed struct layout check regression.
1943 2008-08-12 Marek Safar <marek.safar@gmail.com>
1945 * cs-parser.jay, enum.cs: Simplified enum parsing.
1947 * decl.cs: Check all type parameters conflicts.
1949 * expression.cs, statement.cs, attribute.cs: More expression checks.
1951 2008-08-11 Marek Safar <marek.safar@gmail.com>
1953 * generic.cs: Add type inference types restriction.
1955 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1956 anonymous.cs, expression.cs: Allocate less accessor parameters.
1958 2008-08-08 Marek Safar <marek.safar@gmail.com>
1960 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1963 2008-08-08 Marek Safar <marek.safar@gmail.com>
1965 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1967 2008-08-07 Marek Safar <marek.safar@gmail.com>
1969 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1970 Also fixes #362146 and #381592.
1972 2008-08-07 Marek Safar <marek.safar@gmail.com>
1974 * ecore.cs: Reduced constant cannot be used as an attribute value.
1976 * cs-parser.jay: Base expression has to be a type.
1978 * expression.cs (Conditional): Uses ReducedExpression.
1980 2008-08-06 Marek Safar <marek.safar@gmail.com>
1982 A fix for bug #376826
1983 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1984 address of hoisted local variable or parameter cannot be taken.
1986 2008-08-05 Marek Safar <marek.safar@gmail.com>
1988 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1989 anonymous method inside checked/unchecked expression.
1991 2008-08-05 Marek Safar <marek.safar@gmail.com>
1993 * typemanager.cs (IsEqual): Guard against null.
1995 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1996 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1997 routine. Fixed few misleading conversion errors.
1999 2008-08-04 Marek Safar <marek.safar@gmail.com>
2001 * class.cs: Consider generics when checking cycles in struct layout.
2003 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
2005 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
2007 2008-08-04 Marek Safar <marek.safar@gmail.com>
2009 A fix for bug #414165
2010 * anonymous.cs: Use same anonymous implementation method for all anonymous
2013 2008-08-04 Marek Safar <marek.safar@gmail.com>
2015 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2018 2008-08-04 Marek Safar <marek.safar@gmail.com>
2020 * cs-parser.jay: Typeof argument has to be a type expression.
2022 * namespace.cs: Check alias and namespace definitions collisions.
2024 * class.cs, pending.cs: Moved explicit interface accessor implementation
2027 * delegate.cs, expression.cs: Verify special name invocations.
2029 2008-08-01 Marek Safar <marek.safar@gmail.com>
2031 * cs-parser.jay: Don't choke on empty generic type arguments.
2033 * cs-tokenizer.cs: Handle escaped preprocessor directives.
2035 * expression.cs, ecore.cs: Minor expressions bugs.
2037 2008-08-01 Marek Safar <marek.safar@gmail.com>
2039 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2040 and added more error handling.
2042 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2044 * modifiers.cs, enum.cs: Fixed.
2046 2008-07-31 Jb Evain <jbevain@novell.com>
2048 * driver.cs: remove -pkg ability of smcs.
2050 2008-07-30 Marek Safar <marek.safar@gmail.com>
2052 * statement.cs (Switch): Correctly set empty default target for single
2055 2008-07-30 Marek Safar <marek.safar@gmail.com>
2057 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2058 string switch statement implementation to use string dictionary which
2059 significantly (2-8x) improves performance of generated code.
2061 2008-07-29 Marek Safar <marek.safar@gmail.com>
2063 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2064 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2066 2008-07-29 Marek Safar <marek.safar@gmail.com>
2068 A fix for bug #412595
2069 * typemanager.cs, convert.cs, expression.cs: Some types are never
2070 convertible to each other.
2072 2008-07-29 Marek Safar <marek.safar@gmail.com>
2074 * nullable.cs (CreateNullConstant): An error messages update.
2076 2008-07-29 Marek Safar <marek.safar@gmail.com>
2078 A fix for bug #412595
2079 * cfold.cs: Don't cast undefined bool constant.
2081 2008-07-29 Martin Baulig <martin@ximian.com>
2084 (SymbolWriter.Reset): New public static method.
2087 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2089 2008-07-28 Marek Safar <marek.safar@gmail.com>
2091 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2093 * expression.cs (ElementAccess): Exact size allocation.
2095 2008-07-26 Marek Safar <marek.safar@gmail.com>
2097 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2099 2008-07-25 Marek Safar <marek.safar@gmail.com>
2101 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2103 * class.cs: Removed $PRIVATE$ field hack which caused problems during
2106 2008-07-25 Marek Safar <marek.safar@gmail.com>
2108 A fix for bug #412217
2109 * assign.cs: Mutate also assignment type.
2111 2008-07-25 Marek Safar <marek.safar@gmail.com>
2113 A fix for bug #323644
2114 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2117 2008-07-25 Marek Safar <marek.safar@gmail.com>
2119 A fix for bug #412134
2120 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2121 non-enumerable operands when overloading equality or bitwise operators.
2123 2008-07-25 Marek Safar <marek.safar@gmail.com>
2125 * anonymous.cs: Cache closed generic anonymous method delegates.
2127 2008-07-24 Marek Safar <marek.safar@gmail.com>
2129 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
2130 anonymous.cs, statement.cs: Always emit anonymous method as static method
2131 when is instance free. Use nesting for nested anynomous methods blocks.
2133 2008-07-23 Marek Safar <marek.safar@gmail.com>
2135 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2138 2008-07-23 Marek Safar <marek.safar@gmail.com>
2140 * expression.cs: Removed MakeSimpleCall.
2142 2008-07-23 Marek Safar <marek.safar@gmail.com>
2144 A fix for bug #323012
2145 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2146 Base method implementing interface has to be public.
2148 2008-07-23 Marek Safar <marek.safar@gmail.com>
2150 * cs-parser.jay: Don't break on missing argument.
2152 2008-07-22 Marek Safar <marek.safar@gmail.com>
2154 A fix for bug #320993
2155 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2156 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2158 2008-07-22 Marek Safar <marek.safar@gmail.com>
2160 A fix for bug #320748
2161 * convert.cs: Implicit user operators cannot convert to interfaces
2163 2008-07-22 Marek Safar <marek.safar@gmail.com>
2165 A fix for bug #312686
2166 * driver.cs: Ignore empty assembly references.
2168 2008-07-22 Marek Safar <marek.safar@gmail.com>
2170 A fix for bug #387040
2171 * ecore.cs: Skip constrains check for an explicit implementation.
2173 2008-07-21 Marek Safar <marek.safar@gmail.com>
2175 A fix for bug #409045
2176 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2177 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2178 identifiers are file specific unless passed as input arguments.
2180 2008-07-21 Marek Safar <marek.safar@gmail.com>
2182 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2183 to emit UnmanagedMarshal data under 2.0 profile.
2185 2008-07-21 Marek Safar <marek.safar@gmail.com>
2187 A fix for bug #410369
2188 * parameter.cs: Clone correctly ParamsParameter.
2190 2008-07-21 Marek Safar <marek.safar@gmail.com>
2192 * expression.cs (Argument): Always report type for type based expressions
2195 2008-07-18 Marek Safar <marek.safar@gmail.com>
2197 A fix for bug #410666
2198 * anonymous.cs: Correctly initialize generic storey reference.
2200 2008-07-18 Marek Safar <marek.safar@gmail.com>
2202 * convert.cs: Don't box same type arguments.
2204 2008-07-18 Marek Safar <marek.safar@gmail.com>
2206 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2207 Finished missing generic type mutators.
2209 2008-07-18 Marek Safar <marek.safar@gmail.com>
2211 * iterators.cs, statement.cs: Finished statements CloneTo.
2213 2008-07-18 Marek Safar <marek.safar@gmail.com>
2215 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2217 * expression.cs: Emit optimized default value expressions in expression tree
2220 2008-07-18 Marek Safar <marek.safar@gmail.com>
2222 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2224 2008-07-17 Marek Safar <marek.safar@gmail.com>
2226 A fix for bug #367536
2227 * cs-parser.jay: Check static constructor of generic types for an access
2230 2008-07-17 Marek Safar <marek.safar@gmail.com>
2232 A fix for bug #353800
2233 * lambda.cs: Emit ret for contextual statements.
2235 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2236 up emitting redundant ret for all anonymous methods with return.
2238 2008-07-17 Marek Safar <marek.safar@gmail.com>
2240 A fix for bug #365188
2241 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2242 create anonymous method storey in unreachable block.
2244 2008-07-17 Marek Safar <marek.safar@gmail.com>
2246 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2247 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2248 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2249 statement.cs: Fixed relevant defects found by Gendarme.
2251 2008-07-17 Marek Safar <marek.safar@gmail.com>
2253 A fix for bug #325291
2254 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
2255 statement.cs: Replaced IAnonymousHost with top level block flag.
2257 2008-07-17 Marek Safar <marek.safar@gmail.com>
2259 * cs-parser.jay: Clean up unused open_parens.
2261 2008-07-17 Marek Safar <marek.safar@gmail.com>
2263 * ecore.cs: Custom error message for a range variable assignment.
2265 2008-07-16 Marek Safar <marek.safar@gmail.com>
2267 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2270 2008-07-16 Marek Safar <marek.safar@gmail.com>
2272 * literal.cs: Null literal is of object type.
2274 2008-07-16 Marek Safar <marek.safar@gmail.com>
2276 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2277 expression of nullable equality comparison.
2279 2008-07-15 Marek Safar <marek.safar@gmail.com>
2281 * expression.cs(PointerArithmetic): Removed redundant assignment.
2283 2008-07-15 Marek Safar <marek.safar@gmail.com>
2285 * decl.cs (GetSignatureForError): Report full namespace name for containers.
2287 2008-07-14 Marek Safar <marek.safar@gmail.com>
2289 A fix for bug #408361
2290 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2291 they are replaced by GetMethod.
2293 2008-07-14 Marek Safar <marek.safar@gmail.com>
2295 A fix for bug #408721 by jeremie.laval@gmail.com
2296 * expression.cs (Indirection): Implemented CloneTo.
2298 2008-07-14 Marek Safar <marek.safar@gmail.com>
2300 * statement.cs (AssignableSlots): Temporary disabled variable initialization
2303 2008-07-14 Marek Safar <marek.safar@gmail.com>
2305 * report.cs (EnableReporting): Don't reinitialize 0-based values.
2307 2008-07-11 Marek Safar <marek.safar@gmail.com>
2309 * linq.cs: Reset tranparent parameter counter in probing mode.
2311 2008-07-11 Marek Safar <marek.safar@gmail.com>
2313 * anonymous.cs: Mutate anonymous method type.
2315 2008-07-11 Marek Safar <marek.safar@gmail.com>
2317 * ecore.cs, anonymous.cs: Mutate field expressions.
2319 2008-07-10 Marek Safar <marek.safar@gmail.com>
2321 A fix for bug #369670
2322 * linq.cs, statement.cs: Use explicit block for query expressions variables.
2324 2008-07-10 Marek Safar <marek.safar@gmail.com>
2326 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2328 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
2331 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2332 only one '>', and finds a '>>', abort the generic lookahead.
2334 2008-07-10 Marek Safar <marek.safar@gmail.com>
2336 A fix for bug #319902
2337 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
2339 2008-07-10 Marek Safar <marek.safar@gmail.com>
2341 A fix for bug #406371
2342 * statement.cs: Moved EmitSymbolInfo to Block.
2344 2008-07-09 Marek Safar <marek.safar@gmail.com>
2346 * ecore.cs: Report better error for extension method overload failures.
2348 2008-07-09 Marek Safar <marek.safar@gmail.com>
2350 * expression.cs (Is): No need to box reference values.
2352 2008-07-09 Marek Safar <marek.safar@gmail.com>
2354 * class.cs: Use event resolve context when initializing CreateEmitContext.
2356 2008-07-09 Marek Safar <marek.safar@gmail.com>
2358 A fix for bug #394436
2359 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2360 method used inside expression trees. Added more LINQ to expression tree
2363 2008-07-08 Marek Safar <marek.safar@gmail.com>
2365 A fix for bug #378189, #370577
2366 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2369 2008-07-08 Marek Safar <marek.safar@gmail.com>
2371 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2374 2008-07-08 Marek Safar <marek.safar@gmail.com>
2376 A fix for bug #406702
2377 * anonymous.cs: Always park anonymous method in the nearest parent storey.
2379 2008-07-07 Marek Safar <marek.safar@gmail.com>
2381 A fix for bug #406648
2382 * cs-parser.jay: Report nullable use in mcs for some cases.
2384 2008-07-07 Marek Safar <marek.safar@gmail.com>
2386 * ecore.cs: Improved argument mismatch error messages.
2388 2008-07-07 Marek Safar <marek.safar@gmail.com>
2390 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2392 2008-07-07 Marek Safar <marek.safar@gmail.com>
2394 * expression.cs (TypeOf): Mutate type argument.
2396 2008-07-04 Marek Safar <marek.safar@gmail.com>
2398 * class.cs: Report missing partial modifier for correct type.
2400 2008-07-04 Marek Safar <marek.safar@gmail.com>
2402 * ecore.cs, expression.cs (VariableReference): Variable property is
2405 2008-07-04 Marek Safar <marek.safar@gmail.com>
2407 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2409 2008-07-04 Marek Safar <marek.safar@gmail.com>
2411 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2414 2008-07-04 Marek Safar <marek.safar@gmail.com>
2416 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2417 anonymous method storey to an instance method when only "this" is hoisted.
2419 2008-07-03 Marek Safar <marek.safar@gmail.com>
2421 A fix for bug #321615
2422 * expression.cs: Pointer comparisons use unsigned operator.
2424 2008-07-03 Marek Safar <marek.safar@gmail.com>
2426 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2428 2008-07-02 Marek Safar <marek.safar@gmail.com>
2430 A fix for bug #404905
2431 * class.cs: Always initialize local unsafe variables.
2433 2008-06-30 Marek Safar <marek.safar@gmail.com>
2435 A fix for bug #396987
2436 * expression.cs (NewInitialize): Clear local temporary variable for next run
2438 2008-06-27 Marek Safar <marek.safar@gmail.com>
2440 A fix for bug #401020
2441 * ecore.cs: Both types and modifiers have to match for ref and out arguments
2443 2008-06-27 Marek Safar <marek.safar@gmail.com>
2445 A fix for bug #398319
2446 * cs-parser.jay: Implemented undocumented base access expression inside
2449 2008-06-26 Marek Safar <marek.safar@gmail.com>
2451 A fix for bug #404227
2452 * cs-parser.jay: Parse namespace declaration using qualified identifier.
2454 2008-06-26 Marek Safar <marek.safar@gmail.com>
2456 A fix for bug #404227
2457 * convert.cs: Fixed explicit array to interface cast.
2459 2008-06-26 Marek Safar <marek.safar@gmail.com>
2461 A fix for bug #403894
2462 * delegate.cs: Mutate DelegateInvocation type.
2464 2008-06-26 Marek Safar <marek.safar@gmail.com>
2466 A fix for bug #379348
2467 * delegate.cs: Box a load of generic parameters.
2469 2008-06-26 Marek Safar <marek.safar@gmail.com>
2471 * expression.cs: Add an array creation arguments mutate.
2473 2008-06-26 Marek Safar <marek.safar@gmail.com>
2475 A fix for bug #386068
2476 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2479 2008-06-25 Marek Safar <marek.safar@gmail.com>
2481 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2484 2008-06-25 Marek Safar <marek.safar@gmail.com>
2486 A fix for bug #403518
2487 * delegate.cs: Type correctly anonymous method new invocation.
2489 2008-06-24 Marek Safar <marek.safar@gmail.com>
2491 A fix for bug #394826
2492 * anonymous.cs: Fully qualify members when resolving anonymous type internal
2495 2008-06-24 Marek Safar <marek.safar@gmail.com>
2497 A fix for bug #394826
2498 * anonymous.cs, iterators.cs: Construct generic storey only when is really
2501 2008-06-24 Marek Safar <marek.safar@gmail.com>
2503 * class.cs: Clone indexer parameters for localized capturing.
2505 2008-06-24 Marek Safar <marek.safar@gmail.com>
2507 A fix for bug #402379
2508 * expression.cs: Don't crash when an object initializer resolve fails.
2510 2008-06-24 Marek Safar <marek.safar@gmail.com>
2512 A fix for bug #402888
2513 * expression.cs: Mutate conditional expression.
2515 2008-06-24 Marek Safar <marek.safar@gmail.com>
2517 A fix for bug #401012
2518 * class.cs: Keep StructLayout in shared container.
2520 2008-06-24 Marek Safar <marek.safar@gmail.com>
2522 A fix for bug #400438
2523 * decl.cs, class.cs: Only properties can be automatically implemented.
2525 2008-06-24 Marek Safar <marek.safar@gmail.com>
2527 * statement.cs (ChangeToIterator): Copy also labels.
2529 2008-06-23 Marek Safar <marek.safar@gmail.com>
2531 * ecore.cs: Pass type argument details to parent extension method.
2533 2008-06-23 Marek Safar <marek.safar@gmail.com>
2535 A fix for bug #375966
2536 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2538 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
2540 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2542 2008-06-22 Marek Safar <marek.safar@gmail.com>
2544 A fix for bug #394347
2545 * anonymous.cs: Cache compatible delegates as compatibility check produces
2546 a new method every time.
2548 2008-06-20 Marek Safar <marek.safar@gmail.com>
2550 * anonymous.cs: Propagate storey reference for single references.
2552 2008-06-20 Marek Safar <marek.safar@gmail.com>
2554 A fix for bug #387615
2555 * assign.cs, expression.cs: Correctly clone compound assignment.
2557 2008-06-19 Marek Safar <marek.safar@gmail.com>
2559 A fix for bug #359611, #359604
2560 * anonymous.cs: Mutate all types of hoisted parameters.
2562 2008-06-19 Marek Safar <marek.safar@gmail.com>
2564 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2565 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2566 expression.cs, codegen.cs, statement.cs
2568 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2569 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2571 ** Anonymous methods, lambda expressions rewrite **
2573 Anonymous expressions are now resolved when an explicit block is resolved
2574 and they don't require any registration procedure anymore. Further,
2575 anonymous methods are defined when explicit block is emitted which allows
2576 better control of whole process and opens possibilities for more
2577 optimizations as well as alternative to reverse whole process.
2579 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2580 process consistent and to correctly emit hoisted generic methods when they
2581 have at least 1 hoisted variable.
2583 2008-06-17 Martin Baulig <martin@ximian.com>
2585 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2587 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2588 virtual property; check it in Emit().
2589 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2591 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2593 (Indexer.Define): Likewise.
2595 2008-06-17 Marek Safar <marek.safar@gmail.com>
2597 * convert.cs: Don't use IsInterface on type arguments.
2599 * delegate.cs: DelegateInvocation uses MethodInfo.
2601 * parameter.cs: Removed IsTypeParameter.
2603 * generic-mcs.cs: More missing stuff.
2605 2008-06-16 Martin Baulig <martin@ximian.com>
2608 (Modifiers.DEBUGGER_HIDDEN): New public const.
2611 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2614 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2615 (AbstractPropertyEventMethod): Likewise.
2616 (Constructor.Emit): Likewise.
2617 (SourceMethod.SetCompilerGenerated): Removed.
2619 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2623 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2624 if we're an `IteratorHost'.
2625 (AnonymousMethodMethod..ctor): Don't set
2626 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2629 2008-06-16 Marek Safar <marek.safar@gmail.com>
2631 * statement.cs: Clean-up foreach statements.
2633 2008-06-12 Marek Safar <marek.safar@gmail.com>
2635 * class.cs: Stop using public method which should not exist
2636 (MethodBuilder.SetGenericMethodSignature).
2638 2008-06-11 Martin Baulig <martin@ximian.com>
2641 (Location.LookupFile): Add `CompilationUnit' argument; when given
2642 a relative file name, make it relative to the directory the .cs
2643 file is located in instead of using the current directory.
2645 2008-06-11 Martin Baulig <martin@ximian.com>
2648 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2649 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2650 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2651 (SourceMethod.SetCompilerGenerated): Likewise.
2653 2008-06-11 Marek Safar <marek.safar@gmail.com>
2655 * codegen.cs, driver: Only write symbol file when it's asked for.
2657 2008-06-11 Marek Safar <marek.safar@gmail.com>
2659 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2661 2008-06-10 Martin Baulig <martin@ximian.com>
2663 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2665 2008-06-09 Marek Safar <marek.safar@gmail.com>
2667 A fix for bug #316290
2668 * expression.cs: Include decimal operators in predefined table.
2670 * parameters.cs: More readonlyness.
2672 2008-06-09 Marek Safar <marek.safar@gmail.com>
2674 A fix for bug #397213
2675 * cs-parser.jay: One more missing current_local_parameters reset.
2677 2008-06-09 Marek Safar <marek.safar@gmail.com>
2679 A fix for bug #396633
2680 * class.cs: Host backing field in partial container.
2682 2008-06-09 Marek Safar <marek.safar@gmail.com>
2684 A fix for bug #397068
2685 * expression.cs: Check both operand types when predefined operator is used.
2687 2008-06-05 Martin Baulig <martin@ximian.com>
2689 Merged the `debugger-kahalo' branch.
2692 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2693 we're an iterator method.
2694 (SourceMethod): Reflect latest symbol writer changes;
2695 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2696 now `start_row' and `end_row'.
2697 (Constructor.Emit): Fix the logic whether to emit symbol information.
2699 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2703 (CompilationUnit): New public class; derives from `SourceFile'.
2704 (SourceFileEntry.DefineSymbolInfo): New public method.
2705 (SourceFileEntry.SetChecksum): New public method.
2706 (Location): Encode hidden line numbers by using `column == 255';
2707 the .ctor now accepts `column == -1' to mark a hidden line number.
2708 (Location.Hidden): New public property.
2709 (Location.CheckPoint): Add `CompilationUnit'.
2710 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2711 (Location.Push): Add `CompilationUnit compile_unit' argument.
2712 (Location.CompilationUnit): New public property.
2715 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2717 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2719 * driver.cs: `SourceFile' -> `CompilationUnit'.
2721 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2723 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2725 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2729 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2730 new symbol writer API to also pass the file.
2732 2008-06-05 Marek Safar <marek.safar@gmail.com>
2734 * statement.cs: Emit catch variable assignment using variable expression.
2736 2008-06-05 Marek Safar <marek.safar@gmail.com>
2738 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2739 with other variable types.
2741 2008-06-04 Marek Safar <marek.safar@gmail.com>
2743 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2744 GetLength method emit, it breaks resolve rules.
2746 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2747 Marek Safar <marek.safar@gmail.com>
2749 A fix for bug #395542
2750 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2753 2008-06-02 Marek Safar <marek.safar@gmail.com>
2755 A fix for bug #395287
2756 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2758 2008-05-31 Marek Safar <marek.safar@gmail.com>
2760 A fix for bug #395845
2761 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2762 non-nullable parameter type.
2764 2008-05-31 Marek Safar <marek.safar@gmail.com>
2766 * class.cs: Handle contructor initializer as a statement in top-level block.
2768 2008-05-30 Marek Safar <marek.safar@gmail.com>
2770 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2771 security attributes.
2773 2008-05-24 Marek Safar <marek.safar@gmail.com>
2775 * ecore.cs, expression.cs: Small IVariable refactoring.
2777 2008-05-22 Marek Safar <marek.safar@gmail.com>
2779 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2781 2008-05-21 Marek Safar <marek.safar@gmail.com>
2783 * cs-parser.jay: Removed redundant catch type check.
2785 2008-05-21 Marek Safar <marek.safar@gmail.com>
2787 A fix for bug #390372
2788 * nullable.cs: Set correct return type.
2790 2008-05-21 Marek Safar <marek.safar@gmail.com>
2792 A fix for bug #391062
2793 * typemanager.cs: Fixed crash when comparing null types.
2795 2008-05-21 Marek Safar <marek.safar@gmail.com>
2797 A fix for bug #391871
2798 * cs-parser.jay: Better error handling for invalid catch type.
2800 2008-05-20 Marek Safar <marek.safar@gmail.com>
2802 A fix for bug #392155
2803 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2805 2008-05-15 Marek Safar <marek.safar@gmail.com>
2807 A fix for bug #390666
2808 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2811 2008-05-15 Marek Safar <marek.safar@gmail.com>
2813 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2816 2008-05-13 Marek Safar <marek.safar@gmail.com>
2818 A fix for bug #389625
2819 * delegate.cs, generic.cs: Some progress on method group return type
2822 2008-05-13 Marek Safar <marek.safar@gmail.com>
2824 A fix for bug #378419
2825 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2827 2008-05-12 Marek Safar <marek.safar@gmail.com>
2829 * class.cs (Constructor): Added IsCompilerGenerated.
2831 2008-05-12 Marek Safar <marek.safar@gmail.com>
2833 * expression.cs: Enum binary operators can accept non-enum operand only when
2834 is implicitly convertible to underlying type.
2836 2008-05-12 Marek Safar <marek.safar@gmail.com>
2838 A fix for bug #389272
2839 * support.cs: Workaround System.InvalidOperationException for enums.
2841 2008-05-12 Marek Safar <marek.safar@gmail.com>
2843 A fix for bug #389073
2844 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2846 2008-05-10 Marek Safar <marek.safar@gmail.com>
2848 * driver.cs: Split Parse.
2850 * location.cs (LookupFile): Uses string.Empty.
2852 2008-05-07 Marek Safar <marek.safar@gmail.com>
2854 * expression.cs, parameter.cs: Small ParameterReference clean up.
2856 2008-05-07 Marek Safar <marek.safar@gmail.com>
2858 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2859 hack. Fixes #387502.
2861 2008-05-06 Martin Baulig <martin@ximian.com>
2863 * class.cs (Constructor.Emit): Fix the logic whether to emit
2866 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2869 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2870 InvalidOperationException when the iterator is before the start or
2873 2008-05-06 Marek Safar <marek.safar@gmail.com>
2875 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2876 when left is nullable type.
2878 2008-05-06 Marek Safar <marek.safar@gmail.com>
2880 A fix for bug #386628
2881 * expression.cs (LocalVariableReference): Continue in resolving when
2882 variable is not assigned.
2884 2008-05-05 Marek Safar <marek.safar@gmail.com>
2886 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2887 nullable operations.
2889 2008-05-04 Marek Safar <marek.safar@gmail.com>
2891 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2892 it saves many redundant temporary variables for nullable operations.
2894 2008-05-03 Marek Safar <marek.safar@gmail.com>
2896 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2898 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2901 * nullable.cs: Constant coalescing operator optimizations.
2903 2008-05-03 Marek Safar <marek.safar@gmail.com>
2905 * constant.cs: Use unsigned conversion for values which are unsigned only.
2907 2008-05-03 Marek Safar <marek.safar@gmail.com>
2909 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2910 coalescing operator as it should be.
2912 2008-05-02 Marek Safar <marek.safar@gmail.com>
2914 A fix for bug #371016
2915 * expression.cs: All predefined delegate operators require implicit method
2918 2008-05-02 Marek Safar <marek.safar@gmail.com>
2920 * constant.cs: Emit long constant as uint when fits the range.
2922 * convert.cs, expression.cs: Fixed few unsafe conversions.
2924 2008-05-02 Marek Safar <marek.safar@gmail.com>
2926 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2928 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2931 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2933 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2935 2008-05-01 Marek Safar <marek.safar@gmail.com>
2937 * constant.cs, literal.cs: IsLiteral property for error reporting.
2939 * ecore.cs, expression.cs: Implemented Property expression.
2941 2008-05-01 Marek Safar <marek.safar@gmail.com>
2943 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2945 * nullable.cs: Implemented nullable coalescing null operator.
2947 * ecore.cs, expression.cs: Expression trees work.
2949 2008-05-01 Marek Safar <marek.safar@gmail.com>
2951 * ecore.cs: CreateExpressionTree is finally abstract.
2953 * expression.cs, linq.cs: Updated.
2955 2008-05-01 Marek Safar <marek.safar@gmail.com>
2957 * expression.cs, ecore.cs: Block base access expression inside expression
2960 2008-05-01 Marek Safar <marek.safar@gmail.com>
2962 A fix for bug #385058
2963 * expression.cs: User-defined operator implementations always take
2964 precedence over predefined operator implementations.
2966 2008-04-30 Marek Safar <marek.safar@gmail.com>
2968 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2969 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2970 expression tree conversions.
2972 2008-04-30 Marek Safar <marek.safar@gmail.com>
2974 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2975 operators method details to Operator class.
2977 2008-04-30 Marek Safar <marek.safar@gmail.com>
2979 * anonymous.cs: Pass unsafe flags to anonymous container.
2981 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2982 inside expression tree.
2984 2008-04-29 Martin Baulig <martin@ximian.com>
2986 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2987 (Tokenizer.PopPosition): Also restore the `line'.
2989 2008-04-29 Marek Safar <marek.safar@gmail.com>
2991 * delegate.cs: Implemented Invoke expression.
2993 2008-04-29 Marek Safar <marek.safar@gmail.com>
2995 * expression.cs: Fixed equality reference comparison regression.
2997 2008-04-29 Marek Safar <marek.safar@gmail.com>
2999 * ecore.cs: Clean up EmptyCast hack.
3001 * expression.cs, nullable.cs: Implemented enum binary and unary operations
3002 using correct conversion rules. Also fixes #383993.
3004 2008-04-28 Martin Baulig <martin@ximian.com>
3006 * class.cs (Constructor.Emit): Don't emit debugging information
3007 for generated default .ctor's.
3009 2008-04-28 Marek Safar <marek.safar@gmail.com>
3011 * convert.cs: Empty-cast ushort to int conversion.
3013 2008-04-28 Marek Safar <marek.safar@gmail.com>
3015 A fix for bug #384191
3016 * ecore.cs, expression.cs: Fixed expression cloning.
3018 2008-04-28 Marek Safar <marek.safar@gmail.com>
3020 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3022 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
3024 Fix #381559, test-638.cs, test-639.cs
3025 * assign.cs (CompoundAssign.Helper): New wrapper.
3026 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3028 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3029 Pass unconverted expressions to the params array creation expression.
3030 (FieldExpr.EmitAssign): Don't special-case StringConcat.
3031 (PropertyExpr.EmitAssign): Likewise.
3032 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3033 element if it is of kind CompoundAssign.Helper.
3034 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3035 first before anything else.
3036 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3037 (ArrayAccess.LoadArrayAndArguments): Simplify.
3039 2008-04-27 Marek Safar <marek.safar@gmail.com>
3041 * expression.cs: Fixed cloning of typeof(void).
3043 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
3045 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3046 (Assign.Emit): Likewise. Move it to ...
3047 (CompoundAssign.DoResolve): ... here and ...
3048 (CompoundAssign.Emit): ... here.
3049 (EventAddOrRemove): New helper to handle += and -= on events, and
3050 avoid the use of BinaryDelegates.
3051 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3052 (EventExpr.EmitAddOrRemove): Improve.
3053 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3055 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3056 create VarExprs for 'foo.bar.var'.
3057 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3058 is a highly inappropriate name for its functionality.
3060 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3062 Simplify handling of multiple assignments
3063 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
3065 (SimpleAssign): New. Class to be used for normal assignments.
3066 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3067 * expression.cs, parameter.cs, statement.cs: Likewise.
3069 2008-04-25 Marek Safar <marek.safar@gmail.com>
3071 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3072 for incompatible underlying types, more to come, uff.
3074 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3077 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3078 Handle 'leave_copy'.
3080 2008-04-25 Marek Safar <marek.safar@gmail.com>
3082 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3084 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
3086 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
3087 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3088 * statement.cs (While, Do, For): Allow test to have side effects.
3089 (For.DoEmit): Always emit InitStatement.
3092 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3093 Always create SideEffectConstant.
3094 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3095 of type EnumConstant.
3097 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3098 Handle 'right' being SideEffectConstant of type 'bool'.
3100 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3101 Use left.EmitBranchable instead of open coding it, so as to
3102 improve optimization opportunities.
3104 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3106 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3108 (Expression.EmitSideEffect): Document.
3110 2008-04-23 Marek Safar <marek.safar@gmail.com>
3112 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3114 2008-04-23 Marek Safar <marek.safar@gmail.com>
3116 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3118 2008-04-23 Marek Safar <marek.safar@gmail.com>
3120 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3121 conversion to expression tree.
3123 2008-04-23 Marek Safar <marek.safar@gmail.com>
3125 * ecore.cs: Removed unused expression.
3127 2008-04-22 Marek Safar <marek.safar@gmail.com>
3129 * expression.cs: Implemented NegateChecked and New expressions.
3131 2008-04-22 Marek Safar <marek.safar@gmail.com>
3133 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3135 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
3138 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3139 needing final 'ret' instruction.
3141 2008-04-22 Marek Safar <marek.safar@gmail.com>
3143 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3145 2008-04-21 Marek Safar <marek.safar@gmail.com>
3147 * expression.cs: Emit ldnull and not null expression as an instance argument
3148 of static method expression calls.
3150 2008-04-21 Marek Safar <marek.safar@gmail.com>
3152 A fix for bug #378200
3153 * expression.cs: Fixed crash when creating parameterless expression tree
3156 2008-04-21 Marek Safar <marek.safar@gmail.com>
3158 A fix for bug #375297
3159 * anonymous.cs: Fixed crash when inferring from null argument anonymous
3162 2008-04-21 Marek Safar <marek.safar@gmail.com>
3164 A fix for bug #377596
3165 * decl.cs, class.cs: Emit delegate type argument attributes.
3167 2008-04-21 Marek Safar <marek.safar@gmail.com>
3169 A fix for bug #365314
3170 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3172 2008-04-21 Marek Safar <marek.safar@gmail.com>
3174 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3177 2008-04-21 Marek Safar <marek.safar@gmail.com>
3179 * generic.cs (TypeParameter): Removed redundant location.
3181 2008-04-19 Marek Safar <marek.safar@gmail.com>
3183 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3184 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3185 FullNamedExpression in all declaration type expression, statements will come
3188 2008-04-18 Marek Safar <marek.safar@gmail.com>
3190 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3191 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3193 2008-04-18 Marek Safar <marek.safar@gmail.com>
3195 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3198 2008-04-17 Marek Safar <marek.safar@gmail.com>
3200 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3203 2008-04-17 Marek Safar <marek.safar@gmail.com>
3205 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3209 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
3211 Hook up 'EmitSideEffect'
3212 * constant.cs (Constant.EmitSideEffect): New.
3213 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
3214 (SideEffectConstant.EmitSideEffect): New.
3215 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
3216 unconditional branch in EmitBranchable.
3217 (FieldExpr.EmitBranchable): New.
3218 * expression.cs (Unary.EmitSideEffect): New.
3219 (Binary.EmitSideEffect): New.
3220 (VariableReference.EmitSideEffect): New. Do nothing.
3222 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3224 Introduce 'EmitSideEffect'
3225 * ecore.cs (Expression.EmitSideEffect): New.
3226 (TypeCast): Rename from EmptyCast.
3228 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3229 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3230 * convert.cs, nullable.cs: Update to changes.
3232 2008-04-16 Marek Safar <marek.safar@gmail.com>
3234 * class.cs, cs-parser.jay: Early check for base types expression.
3236 2008-04-16 Marek Safar <marek.safar@gmail.com>
3238 * decl.cs (MemberName): Declare PrettyName as obsolete.
3240 2008-04-16 Marek Safar <marek.safar@gmail.com>
3242 * namespace.cs: Use MemberName comparison.
3244 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3247 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
3249 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3250 (MemberName.FullyQualifiedName): New. Provides the functionality
3251 that users assume FullName would have.
3252 * ecore.cs, namespace.cs: Update to changes.
3254 * statement.cs (Using.assign): Make into ExpressionStatement.
3255 (Using.EmitPreTryBody): Simplify.
3257 2008-04-16 Marek Safar <marek.safar@gmail.com>
3259 * report.cs: ColorFormat is protected.
3261 * rootcontext.cs: Unused fields clean-up.
3263 * namespace.cs: Made UsingEntry name private.
3265 2008-04-16 Marek Safar <marek.safar@gmail.com>
3267 * cs-tokenizer.cs, location.cs: Removed unused field.
3269 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
3270 Raja R Harinath <harinath@hurrynot.org>
3273 * constant.cs (SideEffectConstant.value): Rename from 'left'.
3274 (SideEffectConstant.side_effect): Rename from 'right'.
3275 (SideEffectConstant..ctor): Normalize 'side_effect'.
3276 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3277 value of this constant.
3278 * cfold.cs: Update to changes.
3280 2008-04-15 Marek Safar <marek.safar@gmail.com>
3282 * cs-paser.jay: Removed unused variable.
3284 * driver.cs: Made Compile instance method.
3286 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
3288 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3290 2008-04-15 Marek Safar <marek.safar@gmail.com>
3292 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
3294 2008-04-13 Jb Evain <jbevain@novell.com>
3296 * namespace.cs: update the System.Core fullname for 2.1
3297 * driver.cs: update the list of required assemblies for 2.1.
3298 Merged from the Moonlight 2 branch.
3300 2008-04-11 Marek Safar <marek.safar@gmail.com>
3302 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3303 types and user defined operators. User operators arguments has to be checked
3304 for null value before invocation, which also means no operator is called
3305 when any argument is not convertible to unwrapped nullable type.
3307 2008-04-09 Marek Safar <marek.safar@gmail.com>
3309 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3310 of Unary expressions to follow operator overloading rules precisely.
3311 Also fixes #321794, #323794
3313 2008-04-08 Marek Safar <marek.safar@gmail.com>
3315 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3318 2008-04-08 Marek Safar <marek.safar@gmail.com>
3320 * expression.cs, ecore.cs: Implemented MemberInit expression.
3322 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
3324 Fix mono/tests/exception4.cs
3325 * statement.cs (ExceptionStatement, TryCatch): Revert to using
3326 ec.NeedReturnLabel () rather emitting a 'nop'.
3328 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3330 (TryCatch.SomeCodeFollows): Likewise.
3331 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3332 for 'break', 'continue' and 'return' statements inside a try.
3333 We're fairly sure that the generated IL stream will have more
3334 instructions textually following the try.
3335 (FlowBranchingTryCatch): Likewise.
3337 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3338 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3341 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3342 wrapper -- forward everything to CollectionForeach.
3343 (CollectionForeach.NonDisposableWrapper): New.
3344 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3345 instead of a pop + branch to end.
3347 2008-04-07 Marek Safar <marek.safar@gmail.com>
3349 A fix for bug #377485
3350 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
3351 Propagate location for extension method groups. Report conversion failure at
3354 2008-04-07 Marek Safar <marek.safar@gmail.com>
3356 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3357 ListInit and Field expressions.
3359 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
3361 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3362 Since $PC is always -1 inside the body of MoveNext, the fault
3364 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3365 * statement.cs (ExceptionStatement.emit_finally): Likewise.
3366 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3368 The denouement! Fix #324708
3369 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3370 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3371 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3372 'finally' inside the finally clause.
3374 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3375 inside an iterator. Don't emit the body of the 'finally' inside
3376 the finally clause yet.
3378 Use the ResumableStatement infrastructure for MoveNext ()
3379 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3380 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
3381 'old_resume_points'. Move dispatcher upfront.
3382 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3383 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3384 in an enumerator. This encodes the main fix in this patch series
3385 -- we can only jump into the first instruction of a try from the
3386 outside, but we want to emit try/finally regions in iterators and
3387 resume in the middle of them.
3389 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
3391 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3392 of NeedReturnLabel here.
3394 Introduce a common point for emitting try/finally to IL
3395 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
3396 features of the various subclasses, which are now driven by ...
3397 (ExceptionStatement.EmitPreTryBody): ... this and ...
3398 (ExceptionStatement.EmitTryBody): ... this and the original
3400 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3401 Remove DoEmit and update to follow above protocol.
3403 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3404 of the dispatcher are the same, skip emitting the 'switch'.
3405 * iterator.cs (Iterator.EmitDispose): Update to changes.
3407 Clean up handling of 'using' statement
3408 * statement.cs (UsingTemporary): New. Carved out of ...
3409 (Using): ... this. Simplify drastically. Handle exactly
3411 * cs-parser.jay (using_statement): Split. Create UsingTemporary
3412 or Using as appropriate. If there are multiple variable declared,
3413 create nested Using statements.
3414 (resource_acquisition): Kill.
3416 * statement.cs (ExceptionStatement.EmitForDispose): Use
3417 EmitFinallyBody, not EmitFinally.
3419 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3420 * iterator.cs: Update to changes.
3422 Start using the ResumableStatement infrastructure
3423 * statement.cs (ResumeableStatement.PrepareForDispose): New.
3424 (ResumableStatement.EmitForDispose): New.
3425 (ExceptionStatement): Override them.
3426 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3427 EmitForDispose to create the body of the Dispose method. Don't
3430 * iterator.cs (Iterator.AddResumePoint): Move here from ...
3431 * statement.cs (Toplevel.AddResumePoint): ... here.
3432 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3433 * flowanalysis.cs (FlowBranchingIterator): New.
3434 * codegen.cs (EmitContext): Update to changes.
3436 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3437 (Iterator.old_resume_points): Rename from 'resume_points'.
3438 (Iterator.MoveNextStatement): Remove unused class.
3440 New infrastructure for try/finally in iterators (still unused)
3441 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3442 (FlowBranchingToplevel.AddResumePoint): Hook into
3443 ToplevelBlock.AddResumePoint.
3444 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3445 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3446 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
3447 resume points and assign program-counter values.
3448 (ExceptionBlock.AddResumePoint): Collect resume points for
3449 de-muxer at the top of try block.
3450 * iterators.cs (Yield.CheckContext): Simplify.
3451 (Yield.Resolve): Use FlowBranching.AddResumePoint.
3453 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
3455 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3456 argument to an ExitStatement.
3457 (FlowBranchingException): Refactor saved origins code.
3458 * statement.cs (ExitStatement): Update to cahges.
3459 * iterator.cs (YieldBreak): Likewise.
3461 * statement.cs (ResumableStatement): New. Common base class for
3462 YieldReturn and ExceptionStatement.
3463 (ExitStatement): New. Common base class for Return and YieldBreak.
3464 (Return): Update to changes.
3465 * iterator.cs (YieldBreak): Likewise.
3466 * lambda.cs (ContextualReturn): Likewise.
3469 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3470 emit a meaningful error message.
3472 Fix #324765, #319508
3473 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3474 (VariableInfo.SetAssigned): Set it.
3475 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3476 determine if CS0219 or CS0168 is appropriate. Don't use
3477 flow-analysis information.
3478 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3479 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
3480 (EmitContext.EndFlowBranching): ... this.
3482 2008-04-03 Marek Safar <marek.safar@gmail.com>
3484 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3486 2008-04-03 Marek Safar <marek.safar@gmail.com>
3488 A fix for bug #376508
3489 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3490 ImplicitConversionExists.
3492 2008-04-03 Marek Safar <marek.safar@gmail.com>
3494 * expression.cs (Binary): Added remaining binary operators to expression
3497 * nullable.cs: Optimize shift with null argument.
3499 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
3501 Fix minor IL regression
3502 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3503 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3504 * cs-parser.jay (try_statement): Update to changes.
3506 * statement.cs (TryFinally.need_exc_block): Delete.
3507 (TryFinally): Update to changes.
3509 Now all ExceptionStatements are unconditional
3510 * statement.cs (CollectionForeach.DisposableWrapper): New.
3511 Extract out the try/finally code into a new wrapper.
3512 (CollectionForeach.Resolve): Use it to simplify the code.
3514 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
3516 Start at simplifying ExceptionStatement semantics a bit
3517 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3518 * cs-parser.jay (try_statement): Update to changes.
3519 (opt_catch_clauses): Remove.
3520 * flowanalysis.cs: Update to changes.
3521 (FlowBranching.BranchingType.TryCatch): New.
3522 (FlowBranchingTryCatch): New.
3524 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3525 (FlowBranching.CreateBranching): Update to changes.
3526 (FlowBranchingBlock.AddSibling): Add sanity check.
3527 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3530 * iterators.cs (Iterator.MarkFinally): Remove.
3531 * statement.cs (ExceptionStatement): Update to changes.
3533 Add support for skipping over finally blocks at runtime. First
3534 in a series to fix #324708
3535 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3536 (Iterator.EmitMoveNext): Initialize it.
3537 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3538 branch over the body of the 'finally' clause.
3540 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
3542 Avoid lopsided use of Foo/DoFoo names
3543 * statement.cs (ExpressionStatement.EmitFinallyBody):
3544 Rename from EmitFinally.
3545 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3546 * iterator.cs: Update to changes.
3548 2008-04-02 Marek Safar <marek.safar@gmail.com>
3550 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3551 based on UserOperatorCall. More binary nullable operators clean up.
3553 2008-04-02 Martin Baulig <martin@ximian.com>
3555 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3557 2008-04-02 Marek Safar <marek.safar@gmail.com>
3559 * nullable.cs: Merge user and empty conversions when lifting expression
3562 * expression.cs (StringConcat): Implemented expression tree representation.
3564 2008-04-01 Marek Safar <marek.safar@gmail.com>
3566 * nullable.cs: When lifting null literal and a user operator exists, no call
3569 2008-04-01 Marek Safar <marek.safar@gmail.com>
3571 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3574 2008-04-01 Marek Safar <marek.safar@gmail.com>
3576 * nullable.cs, expression.cs: Use namespace instead heavily nested
3577 monster abstract class.
3579 2008-04-01 Marek Safar <marek.safar@gmail.com>
3581 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3582 lifting of null literal and user operators. Clean up of some temporary
3585 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3587 Fix #368224, test-629.cs
3588 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3589 if it crossed an unwind-protect boundary.
3590 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3591 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3592 inside an unwind-protected region.
3593 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3594 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3595 'leave' instead of a 'br' if unwind-protected.
3596 (Iterator.EmitYieldBreak): Likewise.
3598 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3600 * driver.cs: Only define versioninfo resources if no win32 resource
3603 2008-03-28 Marek Safar <marek.safar@gmail.com>
3605 A fix for bug #372375
3606 * convert.cs: Fixed boxing of nullable types.
3608 2008-03-28 Marek Safar <marek.safar@gmail.com>
3610 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3613 2008-03-28 Marek Safar <marek.safar@gmail.com>
3615 A fix for bug #374619
3616 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3618 2008-03-27 Marek Safar <marek.safar@gmail.com>
3620 * lambda.cs: Check return type only for invocation.
3622 2008-03-27 Marek Safar <marek.safar@gmail.com>
3624 A fix for bug #374214
3625 * ecore.cs: Correctly report argument type mismatch.
3627 2008-03-27 Marek Safar <marek.safar@gmail.com>
3629 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3630 and not rely on broken IsEnum.
3632 2008-03-27 Marek Safar <marek.safar@gmail.com>
3634 * nullable.cs: New file, extracted from generic.cs.
3636 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3638 2008-03-27 Marek Safar <marek.safar@gmail.com>
3640 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3641 predefined comparison operators and null literals.
3643 * report.cs: New warning ID.
3645 2008-03-25 Marek Safar <marek.safar@gmail.com>
3647 A fix for bug #370577
3648 * lambda.cs: Check return type too.
3650 2008-03-25 Marek Safar <marek.safar@gmail.com>
3652 A fix for bug #372846
3653 * class.cs: Automatic properties can be declared as unsafe.
3655 2008-03-20 Marek Safar <marek.safar@gmail.com>
3657 * location.cs: Use string based concatenation.
3659 * expression.cs: LiftedBinaryOperator is gmcs only.
3661 2008-03-20 Marek Safar <marek.safar@gmail.com>
3663 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3664 conversions rules and expression trees.
3666 2008-03-19 Marek Safar <marek.safar@gmail.com>
3668 * delegate.cs: Use extension method source as delegate target.
3670 2008-03-19 Marek Safar <marek.safar@gmail.com>
3672 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3673 binary operations to be purely based on binary operations and optimized
3674 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3675 and other ET refactoring.
3677 * typemanager.cs: Fixed warning.
3679 2008-03-17 Marek Safar <marek.safar@gmail.com>
3681 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3683 * symbolwriter.cs: Fixed.
3685 2008-03-17 Marek Safar <marek.safar@gmail.com>
3687 * anonymous.cs, driver.cs: Reset anonymous types counters.
3689 2008-03-17 Marek Safar <marek.safar@gmail.com>
3691 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3693 * class.cs: Use fullname for all type member definitions.
3695 2008-02-19 Martin Baulig <martin@ximian.com>
3698 (IMethodData.EmitExtraSymbolInfo): New interface method.
3699 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3700 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3701 interface method here as an empty public virtual method.
3704 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3705 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3706 CodeGen.SymbolWriter.SetRealMethodName().
3708 2008-02-18 Martin Baulig <martin@ximian.com>
3711 (ScopeInfo.EmitType): Override this and emit debugging
3712 information for captured variables.
3713 (RootScopeInfo.EmitType): Override this and emit symbol
3714 information for a captured `this'.
3716 2008-02-15 Martin Baulig <martin@ximian.com>
3718 * iterators.cs: Emit debugging info.
3721 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3722 (EmitContext.OmitDebuggingInfo): New public property.
3725 (While): Override Emit() and don't emit symbol info there; do it
3726 inside DoEmit() instead.
3727 (Block.Emit): Omit symbol information while emitting the scope
3728 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3730 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3731 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3732 .ctor to make `IsIterator' work.
3734 2008-03-14 Martin Baulig <martin@ximian.com>
3736 * symbolwriter.cs: Added the new symbol writer function from the
3737 debugger's `terrania' branch; temporarily enclose them inside
3738 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3741 2008-03-14 Martin Baulig <martin@ximian.com>
3744 (SymbolWriter): Make this a public static class.
3747 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3748 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3750 2008-03-14 Marek Safar <marek.safar@gmail.com>
3752 A fix for bug #370577
3753 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3756 2008-03-14 Marek Safar <marek.safar@gmail.com>
3758 * typemanager.cs (CSharpName): Made 250 times faster.
3760 2008-03-13 Marek Safar <marek.safar@gmail.com>
3762 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3764 2008-03-12 Marek Safar <marek.safar@gmail.com>
3766 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3767 crash when predefined field does not exist.
3769 2008-03-12 Marek Safar <marek.safar@gmail.com>
3771 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3773 2008-03-12 Marek Safar <marek.safar@gmail.com>
3775 * class.cs (FixedField): Don't crash when contructors are missing.
3777 2008-03-11 Marek Safar <marek.safar@gmail.com>
3779 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3780 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3781 check internal types accessibility for internal and external types.
3782 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3784 2008-03-11 Marek Safar <marek.safar@gmail.com>
3786 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3787 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3788 attribute.cs, statement: Use corect instance of predefined types (work
3789 related to #364674).
3791 2008-03-07 Marek Safar <marek.safar@gmail.com>
3793 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3795 2008-03-07 Marek Safar <marek.safar@gmail.com>
3797 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3798 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3799 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3800 predefined types clean up, delayed predefined types members initialization
3801 (work related to #364674).
3803 2008-03-05 Marek Safar <marek.safar@gmail.com>
3805 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3807 2008-03-05 Marek Safar <marek.safar@gmail.com>
3809 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3810 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3811 predefined types clean up (work related to #364674).
3813 2008-03-04 Marek Safar <marek.safar@gmail.com>
3815 * ecore.cs: Print an error message instead of throwing exception.
3817 2008-03-04 Marek Safar <marek.safar@gmail.com>
3819 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3820 expression.cs, statement.cs: Unififed null literal representation.
3822 2008-03-03 Marek Safar <marek.safar@gmail.com>
3824 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3825 expression.cs: Refactored binary operators resolve phase and improved speed.
3826 The nullable code is still missing and won't work correctly, more fixes
3829 It also fixes #323726, #324312, #324248, and many other unreported issues.
3831 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3833 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3836 2008-02-27 Marek Safar <marek.safar@gmail.com>
3838 * ecore.cs: Clean-up and split BetterConversion.
3840 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3843 * enum.cs (EnumMember.Value): Only access 'value' if
3844 ResolveValue says it's ok.
3845 (EnumMember.DoResolveValue): Don't set prev_member.value.
3846 (Enum.GetDefinition): Reverse arguments of Equals --
3847 EnumMember.Value can return 'null'.
3849 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3851 2008-02-22 Marek Safar <marek.safar@gmail.com>
3853 * generic.cs, expression.cs: More ongoing work on expression trees.
3855 2008-02-21 Marek Safar <marek.safar@gmail.com>
3857 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3858 handle missing matches when mutiple operators exist.
3860 2008-02-20 Marek Safar <marek.safar@gmail.com>
3862 A fix for bug #363218
3863 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3866 2008-02-20 Marek Safar <marek.safar@gmail.com>
3868 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3869 update. This time to deal correctly with SideEffectConstant expression used
3870 as an argument for another constant folding.
3872 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3874 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3877 2008-02-19 Marek Safar <marek.safar@gmail.com>
3879 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3881 2008-02-19 Marek Safar <marek.safar@gmail.com>
3883 A fix for bug #328136
3884 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3885 side is a false constant, because we still need to evaluate the right-hand
3888 * statement.cs (If): Emit two types of boolean constants (simple constant,
3889 side-effect constant).
3891 2008-02-19 Marek Safar <marek.safar@gmail.com>
3893 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3895 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3898 2008-02-18 Marek Safar <marek.safar@gmail.com>
3900 A fix for bug #361457
3901 * ecore.cs (IsApplicable): Params methods have lower priority.
3903 * support.cs: Return correct parameter modifier for params types.
3905 2008-02-18 Marek Safar <marek.safar@gmail.com>
3907 * generic.cs (TypeParameter): Cache attribute target name.
3909 * support.cs: Removed unused variable.
3911 * typemanager.cs: Removed debugging leftover.
3913 * ecore.cs: Use local type instead of a property;
3915 * class.cs (VerifyMembers): Consider also parent to test whether type member
3918 * expression.cs (FullMethodDesc): Removed.
3920 * attribute.cs (IsValidArgumentType): Made static.
3922 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3924 Cleanup to be more readable.
3925 * Makefile (GMCS_PROFILE): Remove.
3926 (COMPILER_NAME): New helper.
3928 2008-02-15 Miguel de Icaza <miguel@novell.com>
3930 * cs-tokenizer.cs: if a conditional expression happens inside a
3931 (...) this also means that we do not need to de-ambiguate between
3932 an parenthesized expression and a cast.
3936 * constant.cs (SideEffectConstant): a constant value that happens
3937 to have a side effect.
3939 Fixes the build regressions introduced by the fix for #359789
3941 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3943 * expression.cs (Conditional.Emit): when emitting the ternary
3944 operator, use local variables to generate code verifiable code.
3946 The verifier cannot infer that the type on stack before the
3947 stloc.0 is executed is of type ParentB. This happens because the
3948 stack merge algorithm uses only parent types when deciding which
3949 is the common type. This is described in Part III 1.8.1.3 of ECMA
3952 This code compiled with mcs is not verifiable under MS. The MS
3953 verifier picks the first common interface of Foo and Bar, which is
3954 wrong, but doesn't use a full join type of the 2 interfaces.
3956 CSC uses a clever hack to compile such code in a verifiable
3957 way. It stores the intermediate values in a local variable with
3962 2008-02-14 Miguel de Icaza <miguel@novell.com>
3964 * expression.cs: Do not fold BitwiseAnd operators when the left
3965 side is a false constant, because we still need to evaluate the
3970 * support.cs: Instead of throwing an InternalErrorException when
3971 the position of the stream is outside the boundary of our buffer,
3972 reset the state of the reader, and restart the reading from the
3973 beginning of the file.
3975 2008-02-14 Marek Safar <marek.safar@gmail.com>
3977 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3979 2008-02-14 Marek Safar <marek.safar@gmail.com>
3981 A fix for bug #361686
3982 * decl.cs: A protected types used inside a private class which parents
3983 derives from the protected class are accessible.
3985 2008-02-13 Marek Safar <marek.safar@gmail.com>
3987 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3988 the parameterless constructor.
3990 2008-02-13 Marek Safar <marek.safar@gmail.com>
3992 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3993 lookup methods to use standard member cache when doing member lookup.
3995 2008-02-12 Marek Safar <marek.safar@gmail.com>
3997 * driver.cs: Don't report full path for referenced module as assembly error.
3999 2008-02-12 Marek Safar <marek.safar@gmail.com>
4001 * Makefile: Fixed `qh' target to work on all machines.
4003 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4004 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4005 and HasElementType with TypeManager implementation.
4007 2008-02-08 Marek Safar <marek.safar@gmail.com>
4009 A fix for bugs #325134, #359749
4010 * expression.cs, ecore.cs: Try to resolve an extension method even if the
4011 first binds point to non-method member expression.
4013 2008-02-08 Marek Safar <marek.safar@gmail.com>
4015 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4017 2008-02-08 Marek Safar <marek.safar@gmail.com>
4019 A fix for bugs #321394, #323028
4020 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4021 Reworked naive IsAccessibleAs implementation to handle nested types.
4023 2008-02-05 Jb Evain <jbevain@novell.com>
4025 * class.cs: use generic type comparison for parameters
4028 2008-02-05 Marek Safar <marek.safar@gmail.com>
4030 A fix for bug #325372
4031 * class.cs: Use generic type comparison when testing method signatures.
4033 2008-02-05 Marek Safar <marek.safar@gmail.com>
4035 A fix for bug #357047
4036 * ecore.cs: Applied C# 3.0 changes to better conversion.
4038 2008-02-05 Marek Safar <marek.safar@gmail.com>
4040 A fix for bug #358374
4041 * cs-parser.jay: Correctly set modifiers for all constructor types.
4043 2008-02-04 Marek Safar <marek.safar@gmail.com>
4045 A fix for bug #355251
4046 * generic.cs: Added base class constraint based type inference.
4048 2008-02-01 Marek Safar <marek.safar@gmail.com>
4050 A fix for bug #357255
4051 * decl.cs: One more missing visibility check.
4053 2008-02-01 Marek Safar <marek.safar@gmail.com>
4055 * support.cs: Fixed broken return.
4057 2008-01-25 Marek Safar <marek.safar@gmail.com>
4059 * report.cs: Correctly reset warnings count after probing.
4061 2008-01-25 Martin Baulig <martin@ximian.com>
4064 (NamespaceEntry.SymbolFileID): Make this work again after
4065 MemberName.ToString() is gone.
4067 2008-01-25 Marek Safar <marek.safar@gmail.com>
4069 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4072 2008-01-25 Marek Safar <marek.safar@gmail.com>
4074 * generic.cs: Use full implicit conversion for type inference fixing.
4076 2008-01-24 Marek Safar <marek.safar@gmail.com>
4078 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4079 Fixed user operator conversions.
4081 2008-01-24 Marek Safar <marek.safar@gmail.com>
4083 * generic.cs: Do nullable type to null comparison optimization during
4086 2008-01-24 Marek Safar <marek.safar@gmail.com>
4088 A fix for bug #355163
4089 * generic.cs: Enabled l-value resolve on nullable expressions.
4091 2008-01-24 Marek Safar <marek.safar@gmail.com>
4093 A fix for bug #353986
4094 * class.cs: Ingore static ctors with parameters for any further checks.
4096 2008-01-24 Marek Safar <marek.safar@gmail.com>
4098 A fix for bug #354310
4099 * namespace.cs: Removed redundant check.
4101 2008-01-24 Marek Safar <marek.safar@gmail.com>
4103 A fix for bug #354928
4104 * expression.cs: ElementInitializers can be resolved only once.
4106 2008-01-24 Marek Safar <marek.safar@gmail.com>
4108 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4109 Condition expressions.
4111 2008-01-23 Marek Safar <marek.safar@gmail.com>
4113 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4115 2008-01-22 Marek Safar <marek.safar@gmail.com>
4117 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4120 * generic.cs: Implemented coalesce expression.
4122 2008-01-22 Marek Safar <marek.safar@gmail.com>
4124 A fix for bug #355145
4125 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4126 expression tree type inference.
4128 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
4131 * expression.cs (Binary.IsUnsignedType): Fix typo.
4133 2008-01-22 Marek Safar <marek.safar@gmail.com>
4135 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4137 2008-01-22 Marek Safar <marek.safar@gmail.com>
4139 A fix for bug #355161
4140 * ecore.cs, expression.cs: Wider range of extension method supported
4143 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
4145 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4146 AssemblyBuilder to operate in compiler context. Fixes mcs part of
4149 2008-01-22 Marek Safar <marek.safar@gmail.com>
4151 A fix for bug #355148
4152 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4154 2008-01-22 Miguel de Icaza <miguel@novell.com>
4156 * expression.cs (CreateExpressionTree): Add support for or and
4157 logical or, and indent following the coding conventions.
4159 * typemanager.cs (LinqExpression): renamed from
4160 ExpressionTreeManager, for a shorter name.
4162 Use TypeManager.CoreLookupType to lookup types from our core
4163 assemblies and turn those into "Type" variables.
4165 Consumers that previously used "Namespace" and "Type" from this
4166 class should instead use the TypeExpression which is a type that
4167 is fully resolved (without involving the regular C# resolution
4170 This typically looks like this:
4172 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4173 new MemberAccess (texpr, name, type_arguments, loc)
4175 This avoids the problem in: #355178
4177 2008-01-21 Marek Safar <marek.safar@gmail.com>
4179 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4180 feature in parser only as we do in other cases.
4182 2008-01-21 Marek Safar <marek.safar@gmail.com>
4184 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4185 typemanager.cs: A refactoring of params arguments to reuse existing
4186 expressions (params -> array initializer) to emit params argument instead
4187 of specialized handling.
4188 It was required by expression tree implementation and it has other benefits
4189 as well, we now apply same optimization for params arguments as we do for
4192 2008-01-18 Marek Safar <marek.safar@gmail.com>
4194 A fix for bug #353526
4195 * generic.cs: A type inference of params arguments may not required any
4196 temporary array creation.
4198 2008-01-18 Marek Safar <marek.safar@gmail.com>
4200 A fix for bug #353534
4201 * generic.cs, ecore.cs, expression.cs: A method group type inference is
4202 supported for delegates only.
4204 2008-01-18 Marek Safar <marek.safar@gmail.com>
4206 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4207 type for more than 1 candidates.
4209 2008-01-18 Marek Safar <marek.safar@gmail.com>
4211 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4214 2008-01-16 Marek Safar <marek.safar@gmail.com>
4216 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4217 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4218 operator) expressions.
4220 2008-01-16 Zoltan Varga <vargaz@gmail.com>
4222 * statement.cs: Avoid declaring an IL variable for this_variable since it is
4223 not accessed from the generated IL.
4225 2008-01-14 Marek Safar <marek.safar@gmail.com>
4227 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4228 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4229 statement.cs: The first expression tree implementation drop, mostly
4230 infrastructure work.
4232 2008-01-14 Marek Safar <marek.safar@gmail.com>
4234 * ecore.cs (IsNestedChild): Refactored.
4236 2008-01-11 Marek Safar <marek.safar@gmail.com>
4238 * lambda.cs: Don't use a cast on unknown expression statement.
4240 2008-01-10 Geoff Norton <gnorton@novell.com>
4242 * cs-tokenizer.cs: One more token to distinguish between method and lambda
4245 2008-01-09 Marek Safar <marek.safar@gmail.com>
4247 * doc.cs: Report better /doc crash details.
4249 2008-01-09 Marek Safar <marek.safar@gmail.com>
4251 A fix for bug #352536
4252 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4254 2008-01-08 Marek Safar <marek.safar@gmail.com>
4256 A fix for bug #352287
4257 * ecore.cs, expression.cs: Do `this' access checking in all member access
4260 2008-01-08 Marek Safar <marek.safar@gmail.com>
4262 * rootcontext.cs, driver.cs: Switch to linq mode by default.
4264 * report.cs: Reset message stacks.
4266 2008-01-08 Marek Safar <marek.safar@gmail.com>
4268 * generic.cs (InferInPhases): Correctly calculate params position.
4270 2008-01-08 Marek Safar <marek.safar@gmail.com>
4272 * cs-tokenizer.cs: No need to parse full string when parsing lambda
4275 2008-01-07 Marek Safar <marek.safar@gmail.com>
4277 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4279 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4281 * driver.cs: Updated --help option.
4283 2008-01-07 Marek Safar <marek.safar@gmail.com>
4285 * generic.cs (InferParamsTypeArguments): Removed.
4286 (InferInPhases): Add params type inference.
4287 (LowerBoundInference): Fixed scoring mechanism.
4289 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4291 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
4293 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4294 byte array for unsigned "baked" assemblies.
4296 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
4298 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4299 array for assemblies that are not strongnamed.
4301 2008-01-04 Marek Safar <marek.safar@gmail.com>
4303 A fix for bug #351481
4304 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4305 declaring type for nested generic types.
4307 2008-01-04 Marek Safar <marek.safar@gmail.com>
4309 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4310 instead of ToString.
4312 2008-01-03 Marek Safar <marek.safar@gmail.com>
4314 A fix for bug #351047
4315 * expression.cs (Binary.ResolveOperator): Allow equality operators between
4316 null and structs only when equality and inequality operators are defined
4317 either as an user-operators or predefined operators.
4319 2008-01-03 Marek Safar <marek.safar@gmail.com>
4321 A fix for bug #351047
4322 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4324 2008-01-03 Marek Safar <marek.safar@gmail.com>
4326 A fix for bug #351257
4327 * cs-tokenizer.cs: Advance line number for '\r' correctly.
4329 2008-01-03 Marek Safar <marek.safar@gmail.com>
4331 A fix for bug #351157
4332 * class.cs (Using): Fixed yet another broken cloning.
4334 (Block): Put back more sensible default value for statements.
4336 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
4338 * codegen.cs: Allow AssemblyVersion with only major version component.
4341 2007-12-29 Marek Safar <marek.safar@gmail.com>
4343 A fix for bug #324654
4344 * class.cs: Use FullName property as member name.
4346 2007-12-28 Marek Safar <marek.safar@gmail.com>
4348 A fix for bug #342117
4349 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4350 constructor constraint.
4352 2007-12-28 Marek Safar <marek.safar@gmail.com>
4354 A fix for bug #338273
4355 * class.cs (ProbertyBase): Access modifier checks are required for overrides
4358 2007-12-28 Marek Safar <marek.safar@gmail.com>
4360 A fix for bug #350839
4361 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4363 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4365 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4368 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4370 * statement.cs: Changed some Hashtables to use HybridDictionaries
4371 instead. It was observed that some HashTables only contained a few
4372 items in the vast majority of cases. Since HybridDictionary is
4373 more efficient on small sets (<10 elements), "known_variables"
4374 from class ExplicitBlock as well as "labels" and "constants " from
4375 class Block were changed to HybridDictionaries.
4377 Atsai results: (56216kb->54987kb)
4379 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4382 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4384 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4387 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4389 * expression.cs: foreach loop to for loop, saved on allocation of
4390 enumerator (59333kb->59141kb)
4392 * statement.cs. Changed foreach loops to for loops, saved on
4393 allocation of enumerator (59141kb->59006kb)
4395 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4396 when constructed with no specified capacity. This was causing a
4397 few ArrayLists to allocate more memory than they would potentially
4398 need in the Block class and MemberCache class. Setting the
4399 ArrayLists to construct with a capacity of 1 saves some
4400 memory. (56216kb->55585kb)
4402 2007-12-27 Marek Safar <marek.safar@gmail.com>
4404 A fix for bug #347189 (2nd issue)
4405 * expression.cs (MemberAccess): Nested type can be found in base non-generic
4408 2007-12-27 Miguel de Icaza <miguel@novell.com>
4410 * report.cs: Do not use colors if stdout and stderr are not a
4413 2007-12-27 Marek Safar <marek.safar@gmail.com>
4415 A fix for bug #346998
4416 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4419 2007-12-27 Marek Safar <marek.safar@gmail.com>
4421 A fix for bug #343465
4422 * class.cs: Explicit method name for nested types uses dots only.
4424 2007-12-27 Marek Safar <marek.safar@gmail.com>
4426 A fix for bug #343707
4427 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4429 2007-12-27 Marek Safar <marek.safar@gmail.com>
4431 * ecore.cs: Report type inference errors only when arguments count matches
4434 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4436 * expression.cs, report.cs: New warning.
4438 * typemanager.cs: Catch anonymous method type too.
4440 2007-12-23 Marek Safar <marek.safar@gmail.com>
4442 A fix for bug #346379
4443 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4445 2007-12-23 Marek Safar <marek.safar@gmail.com>
4447 A fix for bug #347359
4448 * expression.cs (Invocation): Don't resolve already resolved expression.
4450 2007-12-23 Marek Safar <marek.safar@gmail.com>
4452 A fix for bug #347189
4453 * class.cs (FixedField): Use non-dependent code only in the define phase.
4455 2007-12-23 Marek Safar <marek.safar@gmail.com>
4457 A fix for bug #348076
4458 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4460 2007-12-22 Marek Safar <marek.safar@gmail.com>
4462 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4463 discovered extension methods.
4465 2007-12-22 Marek Safar <marek.safar@gmail.com>
4467 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4470 2007-12-21 Miguel de Icaza <miguel@novell.com>
4472 * report.cs (ErrorMessage): Add support for using colors on
4473 terminals that support it.
4475 2007-12-21 Marek Safar <marek.safar@gmail.com>
4477 * ecore.cs: Use information about expanded params for error reporting.
4479 2007-12-21 Marek Safar <marek.safar@gmail.com>
4481 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4482 and logic for params overloads.
4484 2007-12-15 Miguel de Icaza <miguel@novell.com>
4486 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4487 as this is also created from the parser. Fixes #349034
4489 2007-12-12 Miguel de Icaza <miguel@novell.com>
4491 * statement.cs (Throw.CloneTo): it is valid to have empty
4492 expressions for throw.
4494 2007-12-03 Marek Safar <marek.safar@gmail.com>
4496 * cs-parser.jay: Set delegate constraint parsing region correctly.
4498 2007-12-03 Marek Safar <marek.safar@gmail.com>
4500 A fix for bug #345467
4501 * typemanager.cs (IsEqual): Compare generic parameters position only.
4503 2007-11-28 Marek Safar <marek.safar@gmail.com>
4505 * expression.cs (BaseAccess): Type arguments can be null.
4507 2007-11-27 Raja R Harinath <harinath@gmail.com>
4509 * statement.cs (Block.Resolve): Ensure flow-branching tree is
4510 consistent even when an error has occured.
4511 (Switch.Resolve): Likewise.
4513 2007-11-22 Marek Safar <marek.safar@gmail.com>
4515 A fix for bug #334505
4516 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4519 2007-11-22 Marek Safar <marek.safar@gmail.com>
4521 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
4522 refactorings required to resolve extension methods correctly when mixing
4523 generics and non-generics members.
4525 2007-11-20 Marek Safar <marek.safar@gmail.com>
4527 A fix for bug #342584
4528 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4531 2007-11-19 Marek Safar <marek.safar@gmail.com>
4533 A fix for bug #342512
4534 * delegate.cs: Use delegate argument expression when is available. Don't
4535 emit virtual call when class is sealed.
4537 2007-11-16 Marek Safar <marek.safar@gmail.com>
4539 A fix for bug #325423
4540 * assign.cs (FieldInitializer): Use resolved expression for emit.
4542 * class.cs: Print less confusing error message.
4544 2007-11-16 Marek Safar <marek.safar@gmail.com>
4546 * cs-tokenizer.cs: Removed GMCS ifdefs.
4548 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4551 * cs-parser.jay: Disabled nullable check.
4553 * generic-mcs: Copied more generic stuff.
4555 2007-11-16 Marek Safar <marek.safar@gmail.com>
4557 * gcs-parser.jay: Merged to cs-parser.jay.
4559 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4560 * *.csproj, *.sources: Updated to use only jay parser file.
4562 2007-11-16 Marek Safar <marek.safar@gmail.com>
4564 * gcs-parser.jay: Added nullable and default expression feature checks.
4566 2007-11-16 Marek Safar <marek.safar@gmail.com>
4568 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4569 it fixes many TODOs and hidden bugs.
4571 * expression: Removed duplicate error check.
4573 2007-11-15 Marek Safar <marek.safar@gmail.com>
4575 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4576 implicitly type local variable only when it is used in a declaration.
4578 2007-11-15 Marek Safar <marek.safar@gmail.com>
4580 * attribute.cs: Use CS0612 for empty strings.
4582 2007-11-14 Marek Safar <marek.safar@gmail.com>
4584 * lambda.cs, statement.cs: Contextual return may act as a statement.
4586 2007-11-14 Marek Safar <marek.safar@gmail.com>
4588 A fix for a regression cause by #324222
4589 * class.cs: Don't report unused even when it implements an interface.
4591 2007-11-13 Marek Safar <marek.safar@gmail.com>
4593 A fix for bug #341205
4594 * ecore.cs, expression.cs: Method group expression cannot do static
4595 method access with an instance reference check before overloading takes
4598 2007-11-13 Marek Safar <marek.safar@gmail.com>
4600 A fix for bug #325359
4601 * class.cs: Use predictable name for automatically generated property.
4603 2007-11-12 Marek Safar <marek.safar@gmail.com>
4605 A fix for bug #324996
4606 * expression.cs (Is): Handle case where D is nullable and T is not
4609 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4611 2007-11-12 Marek Safar <marek.safar@gmail.com>
4613 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4614 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4615 Flush small error reporting changes.
4617 2007-11-09 Marek Safar <marek.safar@gmail.com>
4619 A fix for bug #324996
4620 * expression.cs: Rewrote Is expression implementation to work with
4621 generics, nullable types, anonymous method. A const result expression
4622 uses existing infrastructure instead of custom not fully-featured one.
4624 2007-11-08 Marek Safar <marek.safar@gmail.com>
4626 A fix for bug #340202
4627 * class.cs: Consider generics for volatile field.
4629 2007-11-08 Marek Safar <marek.safar@gmail.com>
4631 A fix for bug #335594
4632 * expression.cs: Use conversion rules when handling string addition.
4634 2007-11-07 Marek Safar <marek.safar@gmail.com>
4636 A fix for bug #336651
4637 * expression.cs: Fixed a crash when probing is on.
4639 2007-11-07 Marek Safar <marek.safar@gmail.com>
4641 A fix for bug #324242
4642 * covert.cs: Added a conversion from any nullable-type with an
4643 underlying enum-type to the type System.Enum.
4645 2007-11-07 Marek Safar <marek.safar@gmail.com>
4647 A fix for bug #324222
4648 * class.cs: Report all non-used event fields.
4650 2007-11-07 Marek Safar <marek.safar@gmail.com>
4652 A fix for bug #325161
4653 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4654 qualifier for generic types.
4656 2007-11-07 Marek Safar <marek.safar@gmail.com>
4658 A fix for bug #322971
4659 * expression.cs, ecore.cs: Added intermediate result value check for
4662 2007-11-07 Marek Safar <marek.safar@gmail.com>
4664 A fix for bug #324754
4665 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4666 when it was requested.
4668 2007-11-07 Marek Safar <marek.safar@gmail.com>
4670 A fix for bug #325101
4671 * expression.cs: Do type not value comparison for `is' expression.
4673 2007-11-07 Marek Safar <marek.safar@gmail.com>
4675 A fix for bug #320236
4676 * convert.cs: Don't apply user conversion on underlying target type.
4678 2007-11-06 Marek Safar <marek.safar@gmail.com>
4680 * expression.cs: Don't use unresolved expression for error reporting.
4682 2007-11-06 Marek Safar <marek.safar@gmail.com>
4684 A fix for bugs #337712, #324490
4685 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4686 overloading resolution too.
4688 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4689 the process consistent and more robust.
4691 * expression.cs, linq.cs, report.cs: Update.
4693 2007-11-02 Marek Safar <marek.safar@gmail.com>
4695 A fix for bug #332909
4696 * attribute.cs: Resolve attributes in correct context using error
4699 * rootcontext.cs: Define Obsolete attribute members as core members.
4701 2007-11-02 Marek Safar <marek.safar@gmail.com>
4703 * statement.cs: Removed unused methods.
4705 2007-10-31 Wade Berrier <wberrier@novell.com>
4707 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4708 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4711 2007-10-31 Marek Safar <marek.safar@gmail.com>
4713 A fix for bug #338102
4714 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4715 methods registered as non-generics.
4717 2007-10-31 Marek Safar <marek.safar@gmail.com>
4719 A fix for bugs #337712, #324490
4720 * delegate.cs: Delegate covariance and contravariance is not allowed for
4723 2007-10-31 Marek Safar <marek.safar@gmail.com>
4725 A fix for bug #337719
4726 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4729 2007-10-30 Marek Safar <marek.safar@gmail.com>
4731 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4733 2007-10-29 Marek Safar <marek.safar@gmail.com>
4735 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4738 2007-10-29 Raja R Harinath <rharinath@novell.com>
4740 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4742 2007-10-29 Marek Safar <marek.safar@gmail.com>
4744 A fix for bug #334652
4745 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4746 extension methods when we have not found the best candidate in normal
4749 2007-10-27 Marek Safar <marek.safar@gmail.com>
4751 * AssemblyInfo.cs: Keep up-to-date.
4753 2007-10-27 Marek Safar <marek.safar@gmail.com>
4755 * Makefile: Fixed generics compiler name.
4757 2007-10-27 Marek Safar <marek.safar@gmail.com>
4759 * lambda.test: removed, lambda parsing is done differently.
4761 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4763 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4765 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4767 2007-10-27 Marek Safar <marek.safar@gmail.com>
4769 * Makefile, *.sources : All C# compilers are in mcs folder.
4771 * *.cs: Use existing 2_1 define for smcs.
4773 2007-10-26 Marek Safar <marek.safar@gmail.com>
4775 A fix for bug #335847
4776 * assign.cs, expression.cs: Couple of changes to avoid creating a
4777 temporary variable for each object initializer assignment statement. It
4778 simplifies struct initialization too, otherwise two temporary variables
4780 Implemented optimization of redundant default element initializers.
4782 2007-10-25 Marek Safar <marek.safar@gmail.com>
4784 A fix for bug #336766
4785 * expression.cs (Class.CheckBase): Use generic name when method is
4788 2007-10-25 Marek Safar <marek.safar@gmail.com>
4790 A fix for bug #334737
4791 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4792 variable and not variable argument for prepared copies.
4794 2007-10-24 Marek Safar <marek.safar@gmail.com>
4796 A fix for bug #325110
4797 * class.cs, expression.cs, attribute.cs: Use open generic method when
4798 checking conditional attribute.
4800 2007-10-24 Marek Safar <marek.safar@gmail.com>
4802 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4803 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4804 FeatureIsNotAvailable.
4806 2007-10-24 Marek Safar <marek.safar@gmail.com>
4808 ** C# 3.0 Partial methods
4810 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4811 methods support. Because of member cache issue with generics only
4812 non-generics partial methods are fully supported.
4814 2007-10-23 Marek Safar <marek.safar@gmail.com>
4816 * class.cs, decl.cs: Rewrote member overloads check to cope with
4817 generics and to use member cache for member checking. It also improves
4818 performance and fixes remaining overloads issues.
4820 2007-10-20 Marek Safar <marek.safar@gmail.com>
4822 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4823 roottypes.cs, typemanager.cs:
4825 A member cache creation logic changed to add members immediately and
4826 not rely on fallback. The member cache is now only prefered way
4827 how to access and find type declaration members. It saves 5 MB of memory
4828 during MWF compilation and makes code ready for more optimizations and
4829 clean-ups, it's also a pre-requirement for partial methods.
4831 2007-10-18 Raja R Harinath <harinath@gmail.com>
4833 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4834 handling for generic parameters.
4836 2007-10-15 Marek Safar <marek.safar@gmail.com>
4838 * class.cs (FixedField): Removed redundant volatile check.
4840 2007-10-15 Marek Safar <marek.safar@gmail.com>
4842 * class.cs, decl.cs: Fixed overload members verification to do only one
4843 check per possible collision.
4845 2007-10-13 Marek Safar <marek.safar@gmail.com>
4847 A fix for bug #325478
4848 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4849 and create only one disposable flags container.
4851 2007-10-12 Marek Safar <marek.safar@gmail.com>
4853 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4854 * statement.cs (Fixed): Fixed variables cloning.
4856 2007-10-12 Marek Safar <marek.safar@gmail.com>
4858 A fix for bug #333342
4859 * class.cs (EventField): Don't mark value type event as synchronized.
4861 2007-10-12 Marek Safar <marek.safar@gmail.com>
4863 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4864 inference to identify best candidate method correctly.
4865 (ProperyExpr): A range variable is read only and cannot be modified.
4867 2007-10-11 Marek Safar <marek.safar@gmail.com>
4869 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4870 logic to identify best candidate method correctly.
4872 2007-10-11 Marek Safar <marek.safar@gmail.com>
4874 * location.cs (Equals, GetHashCode): Removed.
4876 2007-10-11 Marek Safar <marek.safar@gmail.com>
4878 * report.cs: Implemented message recorder. It is used mainly for lambda
4879 expressions to capture otherwise swallowed error messages.
4881 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4883 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4885 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4887 * expression.cs (MemberAccess): Always report lookup failure.
4889 * location.cs: Implemented Equals, GetHashCode.
4891 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4893 2007-10-10 Jb Evain <jbevain@novell.com>
4895 * codegen.cs: re-enable assembly version check.
4897 2007-10-09 Marek Safar <marek.safar@gmail.com>
4899 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4902 * namespace.cs (UsingAlias): Do correct version check.
4904 2007-10-08 Marek Safar <marek.safar@gmail.com>
4906 * expresison.cs, ecore.cs: Issue extension method error message when
4909 * rootcontext.cs: Added ISO_2 compiler mode option.
4911 2007-10-08 Marek Safar <marek.safar@gmail.com>
4913 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4916 2007-10-08 Marek Safar <marek.safar@gmail.com>
4918 * attribute.cs (GetString, GetBoolean): Work with both literal and
4921 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4922 Moved method overload specific methods to MethodGroupExpr.
4924 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4925 it should be less memory consuming.
4927 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4929 * codegen.cs: remove the assembly version check until the buildbot is
4932 2007-10-07 Jb Evain <jbevain@novell.com>
4934 * attribute.cs (Attribute.GetString): if the value
4935 expression is a StringConstant, return its string value.
4937 2007-10-07 Jb Evain <jbevain@novell.com>
4939 * typemanager.cs: add `assembly_version_attribute_type`.
4940 * codegen.cs: on attribute emission, check that the
4941 AssemblyVersionAttribute doesn't overflow.
4943 2007-10-05 Marek Safar <marek.safar@gmail.com>
4945 A fix for bug #324677
4946 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4947 parent container of a scope container with currently resolved one.
4949 2007-10-05 Marek Safar <marek.safar@gmail.com>
4951 A fix for bug #325534
4952 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4955 2007-10-05 Marek Safar <marek.safar@gmail.com>
4957 A fix for bug #327504
4958 * class.cs (Operator.Define): Refactored implicit and explicit user
4959 operator conversion rules.
4961 2007-10-05 Marek Safar <marek.safar@gmail.com>
4963 A fix for bug #327520
4964 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4966 2007-10-04 Marek Safar <marek.safar@gmail.com>
4968 A fix for bug #328022
4969 * class.cs (MethodData.Define): Use correct method to check whether
4970 a method implementents an accessor.
4972 2007-10-04 Marek Safar <marek.safar@gmail.com>
4974 A fix for bug #330069
4975 * statement.cs (Fixed.Resolve): Read the first array element only when
4976 an array is instantiated.
4978 2007-10-04 Marek Safar <marek.safar@gmail.com>
4980 * expression.cs, assign.cs, generics.cs: Print correct operator when
4981 compound assignment is used.
4983 2007-10-04 Marek Safar <marek.safar@gmail.com>
4985 A fix for bug #325841
4986 * expression.cs (ArrayAccess): Use full argument cloning only for
4987 string compound concatenation.
4989 2007-10-03 Marek Safar <marek.safar@gmail.com>
4991 A fix for bug #328774
4992 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4994 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4997 2007-10-03 Raja R Harinath <rharinath@novell.com>
5000 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5001 Event accessibility checks here. Remove some bogus code that
5002 accidently made GenericMethods work.
5003 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5005 2007-09-25 Marek Safar <marek.safar@gmail.com>
5007 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5009 * statement.cs (Block): Refactored AddVariable to allow error handling
5012 * generic.cs: New stub.
5014 2007-09-23 Marek Safar <marek.safar@gmail.com>
5016 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5019 2007-09-17 Marek Safar <marek.safar@gmail.com>
5021 * class.cs: Use partial container to record whether any partial part
5022 contains static field initializer and therefore default contructor has
5025 2007-09-14 Marek Safar <marek.safar@gmail.com>
5027 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5028 mono-list when only one of two partial parts has defined accessibility
5031 2007-09-14 Marek Safar <marek.safar@gmail.com>
5033 A fix for bug #82845
5035 * class.cs (TypeContainer): Set correct resolve context for all field
5038 2007-09-13 Marek Safar <marek.safar@gmail.com>
5040 * assign.cs: Fixed a crash when field is resolved twice with an error.
5042 * codegen.cs: Changed InFieldInitializer to be flag.
5044 * anonymous.cs, ecore.cs, expression.cs: Update after
5045 IsInFieldInitializer rename.
5047 * const.cs: Removed unused parameter.
5049 * class.cs: Changed the way how we resolve and emit field initializers.
5050 The field initilizers have to have access to contructor block to emit
5051 compiler generated code.
5053 2007-09-13 Marek Safar <marek.safar@gmail.com>
5055 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5056 generics use TypeContainer instead.
5058 2007-09-12 Marek Safar <marek.safar@gmail.com>
5060 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5062 * lambda.cs (ResolveParameters): Use more powerful
5063 InflateGenericArgument.
5065 * parameters.cs: Better exception message.
5067 2007-09-10 Marek Safar <marek.safar@gmail.com>
5069 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5070 correct expression block type.
5072 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5074 * expression.cs (Invocation): Extracted method group resolve to
5077 2007-09-07 Marek Safar <marek.safar@gmail.com>
5079 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5080 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5082 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5083 generic extension methods.
5085 2007-09-06 Marek Safar <marek.safar@gmail.com>
5087 A fix for bug #82676 (Do I get it right now?)
5088 * convert.cs (Binary.ResolveOperator): An interface is converted to the
5089 object before a standard conversion is applied.
5091 2007-09-06 Marek Safar <marek.safar@gmail.com>
5093 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5096 2007-09-05 Marek Safar <marek.safar@gmail.com>
5098 A fix for bug #82676
5099 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5100 non-generic interface types.
5102 2007-09-05 Marek Safar <marek.safar@gmail.com>
5104 A fix for bug #82690
5105 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5107 2007-09-05 Marek Safar <marek.safar@gmail.com>
5109 A fix for bug #82571
5110 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
5111 modifier for container based methods.
5113 2007-09-05 Marek Safar <marek.safar@gmail.com>
5115 A fix for bug #82676
5116 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5117 any interface-type T means to any of interface type T.
5119 2007-09-04 Marek Safar <marek.safar@gmail.com>
5121 * namespace.cs: We have 2 versions of System.Core assembly.
5123 2007-09-04 Marek Safar <marek.safar@gmail.com>
5125 A fix for bug #82652
5126 * class.cs (Class.GetClassBases): Compare types and not expressions.
5128 2007-09-04 Marek Safar <marek.safar@gmail.com>
5130 A fix for bug #82620
5131 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5132 actually never worked before.
5133 (IndexerAccess): Emit prepared arguments before they are modified.
5135 2007-09-04 Marek Safar <marek.safar@gmail.com>
5137 A fix for bug #82563
5138 * assign.cs: Revert wrong fix.
5140 * expression.cs (VariableReference.EmitAssign): Handle ref reference
5142 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5143 Instead of ldelema/stdind we have to use temporary variables to handle
5144 cases like String.Concat (params string[]).
5146 2007-08-31 Marek Safar <marek.safar@gmail.com>
5148 * class.cs: EmitAttributes to Emit rename.
5150 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5152 (MemberCore.HasClsCompliantAttribute): Don't depend on
5153 GetClsCompliantAttributeValue execution.
5155 2007-08-31 Marek Safar <marek.safar@gmail.com>
5157 * anonymous.cs: Use shorter type prefix.
5159 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5162 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5163 variables when probing is on.
5165 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
5166 unresolved variables.
5167 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5168 handle transparent identifiers.
5170 2007-08-26 Marek Safar <marek.safar@gmail.com>
5172 * attribute.cs (IsClsCompliant): Add nullable types test.
5174 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
5176 * doc.cs : catch other types of exception than XmlException to
5177 report CS1570. Fixed bug #82565.
5179 2007-08-23 Marek Safar <marek.safar@gmail.com>
5181 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
5182 The number of delegate parameters has to match.
5183 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5186 2007-08-21 Marek Safar <marek.safar@gmail.com>
5188 * anonymous.cs (AnonymousMethod): Generate private anonymous method
5189 to fix problem with private arguments.
5191 2007-08-20 Marek Safar <marek.safar@gmail.com>
5193 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5195 * decl.cs (MemberName): Ignore generic type with no generic arguments.
5197 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5198 empty. Add cloning suport.
5200 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5202 2007-08-20 Marek Safar <marek.safar@gmail.com>
5204 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
5205 to create EmptyCast. It handles EmptyConstantCast specialization for
5208 2007-08-18 Marek Safar <marek.safar@gmail.com>
5210 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5211 (EmitArrayArgument): One routine for array arguments.
5212 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
5214 2007-08-17 Marek Safar <marek.safar@gmail.com>
5216 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5218 2007-08-17 Marek Safar <marek.safar@gmail.com>
5220 * anonymous.cs: MemberLookupFinal update.
5222 * class.cs (ConstructorInitializer): Is expression based.
5224 * delegate.cs: MethodGroupExpr update.
5226 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
5228 (Error_MemberLookupFailed): Customizable error override.
5229 (MethodGroupExpr): Keep queried type for later usage.
5230 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5233 * expression.cs: Error_MemberLookupFailed refactoring.
5234 (New.DoResolve): Resolve as much as possible.
5235 (ElementInitializer.Error_MemberLookupFailed): Object initializer
5236 customization for invalid member types.
5238 * statement.cs: MethodGroupExpr update.
5240 2007-08-16 Marek Safar <marek.safar@gmail.com>
5242 * modifier.cs (Check): Check all modifiers and not only accessibility
5245 2007-08-16 Marek Safar <marek.safar@gmail.com>
5247 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5248 type and not an expression.
5250 2007-08-16 Marek Safar <marek.safar@gmail.com>
5252 * statement.cs (Catch.Clone): Type and variable can be null.
5254 2007-08-16 Marek Safar <marek.safar@gmail.com>
5256 A fix for bug #81979
5257 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5258 I am really not sure whether this is the best fix.
5260 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5263 2007-08-14 Marek Safar <marek.safar@gmail.com>
5265 ** C# 3.0 Object and collection initializers (major re-write)
5267 * assign.cs (DoResolve): Initializers are not assign related.
5269 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5270 used during collection or object initialization.
5272 * expression.cs (Error_InvalidArguments): Add initializers specific
5273 messages. More will come later because it requires some general
5275 (New.DoResolve): Better error handling for unsafe types.
5276 (EmptyExpressionStatement): New class.
5277 (ElementInitializer): An object initializer expression.
5278 (CollectionElementInitializer): A collection initializer expression.
5279 (CollectionOrObjectInitializers): A block of object or collection
5281 (NewInitialize): New expression with element/object initializers.
5283 * statement.cs: Reverted object/collection initializer hacks.
5285 * typemanager.cs (CSharpName): Filter __arglist type.
5287 2007-08-09 Marek Safar <marek.safar@gmail.com>
5289 ** C# 3.0 Anonymous Types (update to the latest standard)
5291 * expression.cs (Binary.ResolveOperator): Threat all null based types
5293 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5294 (AnonymousTypeParameter): Updated.
5296 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5297 (AnonymousTypeClass): New anonymous type container.
5299 * class.cs (AddField): Return operation result.
5301 * generic.cs: Another empty TypeArguments overload.
5303 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5304 are stored at top of normal hierarchy.
5306 * typemanager.cs (CSharpName): Filter anonymous types.
5308 2007-08-09 Marek Safar <marek.safar@gmail.com>
5310 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5311 as single Concat call. How could we miss that :-(
5313 2007-08-08 Marek Safar <marek.safar@gmail.com>
5315 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5317 2007-08-07 Miguel de Icaza <miguel@novell.com>
5319 * expression.cs: Fix the previous commit, the creation of the
5320 arguments array list needs also to be conditional on the arguments
5323 * class.cs: Add a little bit of help to help narrow down problems.
5325 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5326 not try to copy in that case.
5328 * driver.cs: When building SMCS, include a new different set of
5329 default assemblies here. Do this here so we can control whether
5330 to include the default assemblies with /noconfig.
5332 2007-08-03 Marek Safar <marek.safar@gmail.com>
5334 A fix for bug #81979
5335 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5338 2007-08-03 Marek Safar <marek.safar@gmail.com>
5340 A fix for bug #82300
5342 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5343 we are in probing scope.
5345 2007-08-03 Marek Safar <marek.safar@gmail.com>
5347 A fix for bug #82301
5349 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5350 (Statement.CloneTo): Clone and not map children blocks.
5352 2007-08-03 Marek Safar <marek.safar@gmail.com>
5354 A fix for bug #82299
5356 * expression.cs (LocalVariableReference.CloneTo): Remap local info
5359 * statement.cs (Statement.CloneTo): Clone variables before statements
5360 to allow remaping of local variables.
5362 2007-08-03 Marek Safar <marek.safar@gmail.com>
5364 A fix for bug #82296
5367 * report.cs: Log crash details for future clone problems.
5369 * statement.cs (Return.Clone): Don't clone non-existent expression.
5371 2007-08-03 Raja R Harinath <harinath@gmail.com>
5373 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5374 (Class.AddBasesForPart): Move CS0537 check here from ...
5375 * cs-parser.jay (class_declaration): ... here. Move calling of
5376 'AddBasesForPart' to ...
5377 (class_bases): ... here.
5378 (struct_declaration, interface_declaration): Update to changes.
5380 2007-08-02 Marek Safar <marek.safar@gmail.com>
5382 A fix for bug #81923
5384 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5385 conversion is allowed.
5387 2007-08-02 Marek Safar <marek.safar@gmail.com>
5389 A fix for bug #81564
5391 * ecore.cs (EventExpr): Add IsBase handling.
5393 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5396 2007-08-02 Raja R Harinath <harinath@gmail.com>
5398 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5399 * cs-parser.jay: Some whitespace cleanups.
5400 (current_delegate): New.
5402 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5403 a dummy code block, and use 'type_name' instead of 'member_name'.
5404 (interface_declaration, class_declaration): Likewise.
5405 (delegate_declaration): Likewise. Rearrange slightly and use
5407 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5408 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
5410 2007-08-02 Marek Safar <marek.safar@gmail.com>
5412 A fix for bug #82039
5414 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5417 * typemanager.cs (CSharpName): Split to string overload.
5419 2007-08-02 Marek Safar <marek.safar@gmail.com>
5422 * report.cs: Updated warning CS0472.
5424 2007-08-01 Marek Safar <marek.safar@gmail.com>
5426 A fix for bug #82181
5428 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5430 2007-08-01 Marek Safar <marek.safar@gmail.com>
5432 A fix for bug #82277
5433 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5435 2007-08-01 Marek Safar <marek.safar@gmail.com>
5437 ** C# 3.0 Type Inference (major bits are working)
5439 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5440 (.ImplicitStandardConversionExists): Uses compatible.
5441 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5442 (.InferReturnType): New method.
5443 (.Compatible): Refactored.
5444 (.ResolveParameters): Uses factory to create resolved parameters.
5445 (.CompatibleMethod): Add probing mode support.
5446 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5447 clearly distinguish between 2 different operations.
5448 (LambdaMethod): Moved to lambda.cs.
5449 (AnonymousMethod): Removed unused fields and methods.
5450 (AnonymousDelegate): Simplified.
5452 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5454 * convert. cs (ImplicitConversionStandard): Compatible works differently.
5456 * delegate.cs (Delegate): New mehods to reduce code duplication.
5457 (.GetConstructor): New method.
5458 (.GetInvokeMethod): New method.
5459 (DelegateCreation): Updated.
5461 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5463 (OverloadResolve): Made probing little bit faster.
5465 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5468 * generic.cs (TypeInferenceContext): Dummy implementation.
5470 * iterators.cs: Updated after Resolve/Define rename.
5472 * lambda.cs (LambdaExpression)
5473 (.ResolveParameters): Handles both type of arguments and type inference too.
5475 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5476 (InflateTypes): Updated.
5478 * support.cs (InflateTypes): Changed signature and updated.
5480 * typemanager.cs (LookupMemberCache): Better dynamic type check.
5481 (MemberLookup_FindMembers): More MS tricks.
5482 (GetParameterData): Ditto.
5483 (GetDelegateParameters): Uses quick path for dynamic types.
5485 2007-08-01 Marek Safar <marek.safar@gmail.com>
5487 * class.cs (MethodData.Define): EmitContext is required for generic stuff
5490 2007-07-31 Marek Safar <marek.safar@gmail.com>
5492 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5495 2007-07-26 Jb Evain <jbevain@novell.com>
5497 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5498 which takes a boolean 'report_errors', similar to the GetMethod.
5499 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5500 in .net 2.1, do not report errors here.
5502 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5503 System.Runtime.CompilerServices.RequiredAttributeAttribute and
5504 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5507 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5508 of the type InternalsVisibleToAttribute before the first call
5509 to CoreLookupType which is allowed to fail (third boolean parameter
5510 to true). Because, during the resolution for a type that is not
5511 immediately found, we try to check if the type is not defined in
5512 a friend assembly, and to do so, we need the
5513 InternalVisibleToAttribute.
5515 2007-07-23 Miguel de Icaza <miguel@novell.com>
5517 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5518 feature that allows structs to be compared against null and inline
5519 the result as true or false.
5521 Notice that the same code is not permitted inside a generic block
5522 of code that would do:
5524 class Foo<T> where T : struct {
5531 It is only allowed if the type of T is not bound (no where
5532 clause). In my opinion, this CSC 2 behavior is broken but people
5533 seem to be using it (IronRuby does, a few bug reports on bugzilla
5534 have it and some people have complained about it).
5536 All of the users that depend on this behavior have code that is
5539 * report.cs (Warning, Error): make these take object arguments,
5540 not strings, as that allows us to take advantage of Format.
5542 2007-07-20 William Holmes <billholmes54@gmail.com>
5544 * decl.cs: Changed MemberName.CountTypeArguments to also check the
5545 Left member variable for the Count.
5546 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
5547 MemberName.CountTypeArguments to avoid a NRE.
5549 This code is contributed under the MIT X11 license
5551 2007-07-18 Marek Safar <marek.safar@gmail.com>
5553 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5555 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5557 * doc.cs : generic method arguments are written as ``x while generic
5558 type arguments are `x. Combined with the previous change, fixed bug
5561 2007-07-18 Raja R Harinath <rharinath@novell.com>
5564 * expression.cs (Binary.ResolveOperator): When converting
5565 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5567 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5569 * doc.cs : when T: or whatever x: is specified, it does not really
5570 check the doc comment's syntax correctness. Fixed bug #82006.
5572 2007-07-18 Marek Safar <marek.safar@gmail.com>
5574 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5575 LambdaExpression better.
5577 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5579 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5581 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5582 as it can be generated.
5584 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5587 * lambda.cs (LambdaExpression): Refactored to share same code with
5588 AnonymousMethodExpression.
5590 2007-07-17 Marek Safar <marek.safar@gmail.com>
5592 * anonymous.cs (MakeName): Include host name for easier debugging.
5593 (LambdaMethod): New class for lambda spcecific stuff.
5595 * attribute.cs: Set EmitContext return type.
5597 * class.cs: Set EmitContext return type.
5599 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5600 with null/void meaning.
5602 * iterators.cs (ContainerType): Implemented.
5604 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5606 * statement.cs (Return): Updated to lambda expressions.
5607 (Block.CloneTo): Parent can be null.
5609 2007-07-13 Marek Safar <marek.safar@gmail.com>
5611 A fix for bug #81917
5612 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5614 * class.cs (FixedField): Check whether field is in unsafe scope.
5616 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5617 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5619 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5622 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5624 2007-07-13 Marek Safar <marek.safar@gmail.com>
5626 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5627 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5630 2007-07-13 Marek Safar <marek.safar@gmail.com>
5632 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5634 2007-07-13 Marek Safar <marek.safar@gmail.com>
5636 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5637 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5639 * codegen.cs(EmitContext): Add ProbingMode flag.
5641 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5643 * driver.cs: For now set both warning values.
5645 * ecore.cs (SimpleName): Name is readonly.
5646 (MethodGroup.OverloadResolve): One quick path for probing.
5648 * expression.cs (Unary): Set Oper r/o.
5649 (Binary): Set Oper r/o.
5650 (ParameterReference): Set few instance variables as r/o.
5651 (ParameterReference.DoResolveBase): Don't capture aruments when
5653 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5654 (Arglist): arguments are private.
5655 (SizeOf): type is private and r/o.
5656 (MemberAccess): arguments are private.
5658 * report.cs: Enhanced reporting on/off capabilities.
5660 * lambda.cs: Uses ec.IsInProbingMode.
5661 (ContextualReturn): Derives from return.
5663 * rootcontext.cs: For now set both warning values.
5665 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5667 (Return.Resolve): Don't die immediately.
5668 (Block.Resolve): Speed-up probing.
5669 (Block.CloneTo): Clone only child blocks.
5671 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5673 * iterators.cs: reverted Miguel's latest change (r81925) as it
5674 breaks the build in System.
5676 2007-07-13 Miguel de Icaza <miguel@novell.com>
5678 * iterators.cs (Yield.CheckContext): Check for the iterator type
5679 also here as we can call into Yield even in codepaths that are not
5681 (MethodOrOperator is the only path that was checked).
5683 In addition to the standard check, use a more specific check for
5684 constructors to report a more verbose error.
5686 2007-07-12 Miguel de Icaza <miguel@novell.com>
5688 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5689 report the warning and continue
5691 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5692 values on the stack on the call to Emit. Use EmitStatement if
5693 possible, or using Emit + Pop if not possible. Fixes #82064
5695 2007-07-12 Raja R Harinath <rharinath@novell.com>
5697 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5698 avoid try...finally in some cases.
5700 2007-07-10 Marek Safar <marek.safar@gmail.com>
5702 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5704 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5705 instead of method. Re-use standard error handling.
5706 (ConstructorInitializer.Emit): Simplified.
5708 * delegate.cs: Updated after Invocation.EmitCall change.
5710 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5711 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5712 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5713 method and don't permanently changing input arguments.
5714 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5715 is resolved it has one of the candidates is the best one which is later
5716 used to emit. Removed a few unused method.
5717 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5719 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5720 (Binary.ResolveOperator): Ditto.
5721 (ConditionalLogicalOperator.DoResolve): Ditto.
5722 (Invocation): Uses method group.
5723 (Invocation.DoResolve): Simplified.
5724 (Invocation.EmitCall): Removed useless is_static.
5725 (Invocation.Emit): Delegate to method group.
5726 (Invocation.EmitStatement): Simplified.
5727 (New): Uses method group.
5728 (MemberAccess.DoResolve): Don't destroy original expression.
5730 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5732 2007-07-04 Marek Safar <marek.safar@gmail.com>
5734 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5737 * lambda.cs: Add custom error message type.
5739 2007-07-03 Marek Safar <marek.safar@gmail.com>
5741 * lambda.cs: Simplified little bit.
5743 * parameter.cs: Introduced ImplicitLambdaParameter.
5744 (Parameters.CreateFullyResolved): New factory instead of ctor.
5748 * delegate.cs: Updated parameter creation.
5750 2007-07-03 Marek Safar <marek.safar@gmail.com>
5752 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5755 * generic.cs: Synchronized with gmcs.
5757 2007-07-03 Marek Safar <marek.safar@gmail.com>
5759 * class.cs (Indexer): Check return type as soon as possible.
5761 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5764 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5766 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5768 * parameter.cs (Parameter): Use expression type when it is available.
5770 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5771 method modifier for the first parameter only.
5773 2007-06-24 Marek Safar <marek.safar@gmail.com>
5775 A fix for bug #81938
5776 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5778 * constant.cs: Tide up an exception message.
5780 2007-06-22 Marek Safar <marek.safar@gmail.com>
5782 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5783 an uninitialized variable is used.
5785 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5787 2007-06-22 Marek Safar <marek.safar@gmail.com>
5789 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5790 not found error handling.
5792 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5794 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5795 (ArrayCreation.DoResolve): Simplified.
5796 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5797 its own resolve process.
5798 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5800 2007-06-20 Marek Safar <marek.safar@gmail.com>
5802 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5805 2007-06-20 Marek Safar <marek.safar@gmail.com>
5807 * cs-tokenizer.cs: Removed var related stuff.
5809 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5810 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5811 a type and a keyword at same time.
5813 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5816 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5817 implicitly typed arrays, more changes will follow.
5819 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5821 2007-06-19 Marek Safar <marek.safar@gmail.com>
5823 * ecore.cs (VarExpr): Removed Handled field.
5825 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5826 build-in assign functionality.
5827 (ForEach.Resolve): Removed all implicitly typed local variable code and
5829 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5830 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5832 2007-06-18 Marek Safar <marek.safar@gmail.com>
5834 * assign.cs: Removed implicitly typed local variable check.
5836 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5837 referencing implicitly typed local variable.
5838 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5841 * statement.cs (Fixed): Removed unsupported implicitly typed local
5844 2007-06-15 Marek Safar <marek.safar@gmail.com>
5846 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5848 2007-06-14 Marek Safar <marek.safar@gmail.com>
5850 A fix for bugs #81855 and #76274
5851 * attribute.cs (AttachTo): Always set owner for global attributes to
5854 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5857 * cs-parser.jay: Assembly and module attributes must precede all other
5858 elements except using clauses and extern alias declarations.
5860 2007-06-13 Marek Safar <marek.safar@gmail.com>
5862 A fix for bug #81748
5864 * expression.cs: More checks for non ISO-1 features.
5866 2007-06-12 Marek Safar <marek.safar@gmail.com>
5868 A fix for bug #81807
5869 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5870 present inside switch statement and it is required by nullable check.
5872 2007-06-12 Marek Safar <marek.safar@gmail.com>
5874 A fix for bug #81840
5875 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5876 when type matching fails.
5878 * namespace.cs: Tiny error message change.
5880 2007-06-12 Marek Safar <marek.safar@gmail.com>
5882 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5883 reporting. Added automatic property check.
5885 * class.cs: Updated after CheckAbstractAndExtern relocation.
5886 (AEventPropertyAccessor.GetSignatureForError): Customized.
5888 2007-06-11 Marek Safar <marek.safar@gmail.com>
5890 * class.cs (DefineBaseTypes): Base type can be undefined.
5892 * ecore.cs (TypeLookup): Minor refactoring.
5893 (DoResolveAsTypeStep): Removed redundant check.
5895 * namespace.cs (Lookup): Removed redundant check.
5897 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5898 ResolveAsTypeTerminal step.
5899 (BootstrapCorlib_*): Simplified.
5900 (PopulateCoreType): Core types can be now external.
5902 2007-06-07 Marek Safar <marek.safar@gmail.com>
5904 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5906 (InferTypeArguments): Infers anonymous expression type arguments.
5907 (Compatible): Split to Compatible and InferTypeArguments.
5909 * lambda.cs: Updated.
5911 2007-06-08 Marek Safar <marek.safar@gmail.com>
5913 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5915 2007-06-07 Raja R Harinath <harinath@gmail.com>
5917 Fix #80477, cs0135-2.cs, cs0135-3.cs
5918 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5919 names to the "known" variables list.
5920 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5921 parameter names are also "known".
5922 (Block.CheckError136): Remove.
5923 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5926 2007-06-07 Marek Safar <marek.safar@gmail.com>
5928 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5930 2007-06-06 Marek Safar <marek.safar@gmail.com>
5932 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5933 internal error not an user error.
5935 * expression.cs (IsApplicable): Refactored to make debugging easier.
5937 * support.cs: More tricks for non-mono runtimes.
5939 * typemanager.cs (CoreLookupType): Made public.
5940 (InitSystemCore): All linq specific stuff moved to linq.cs
5942 2007-06-05 Marek Safar <marek.safar@gmail.com>
5944 * typemanager.cs (CSharpSignature): One more missing build-in types
5946 More tricks for non-mono runtime.
5948 2007-06-05 Raja R Harinath <harinath@gmail.com>
5950 * statement.cs (Block.CheckError136_InParents): Remove.
5951 (Block.AddVariable): Use GetParameterInfo instead.
5952 (ToplevelBlock.ProcessArguments): Likewise.
5954 2007-06-04 Raja R Harinath <rharinath@novell.com>
5956 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5958 (ToplevelBlock.GetParameterInfo): Split out of ...
5959 (ToplevelBlock.GetParameterRefernce): ... this.
5960 (ToplevelBlock.ParameterMap): Remove.
5961 * expression.cs (ParameterReference): Update to use
5962 ToplevelParameterInfo.
5964 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5967 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5968 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5970 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5971 (ToplevelBlock.ProcessParameters) ... here.
5972 (ToplevelBlock..ctor): Invoke it.
5974 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5977 * statement.cs (IKnownVariable): New interface.
5978 (LocalInfo): Implement it.
5979 (ToplevelParameterInfo): New class.
5980 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5981 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5982 GetKnownVariableInfo.
5984 2007-06-03 Raja R Harinath <harinath@gmail.com>
5986 Partly speed up CS0136 error checks.
5987 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5988 'recurse' parameter.
5989 (Block.DoCheckError136): Only check errors in parameters. Move
5990 local variable checks ...
5991 (Block.AddVariable): ... here, and ...
5992 (ToplevelBlock.ResolveMeta): ... here.
5994 2007-06-02 Raja R Harinath <harinath@gmail.com>
5996 * statement.cs (Block.IsChildOf): Remove.
5998 * statement.cs (Statement.Clone): Move special case code ...
5999 (Block.CloneTo): ... here.
6001 2007-05-29 Raja R Harinath <rharinath@novell.com>
6003 * statement.cs (ToplevelBlock.container): Remove field. It's
6004 redundant with 'Parent'.
6005 (ToplevelBlock.ContainerBlock): Remove accessor.
6006 (ToplevelBlock..ctor): Update to changes. Register anonymous
6007 child with parent here, ...
6008 * cs-parser.jay (end_anonymous): ... not here. Don't modify
6010 (start_anonymous): Don't save current_block.
6011 (top_current_block): Remove.
6013 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6014 (Block.Resolve): Update to changes.
6015 (Block..ctor): Move setting of "correct" 'Toplevel'
6016 and 'Explicit' fields to ...
6017 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6019 2007-05-27 Raja R Harinath <harinath@gmail.com>
6022 * statement.cs (Block.Implicit): Remove.
6023 (Block): Update to changes.
6024 * flowanalysis.cs: Likewise.
6026 Mildly speed up CheckInvariantMeaningInBlock
6027 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6028 Recursively call AddKnownVariable to all enclosing blocks.
6029 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6030 Remove recursive calls.
6031 (Block): Update to changes.
6033 New ExplicitBlock invariants
6034 * statement.cs (Block.Explicit): New field. It points to the
6035 immediately enclosing non-implicit block.
6036 (Block..ctor): Maintain the invariant.
6037 * cs-parser.jay: Take advantage of invariant.
6039 Introduce ExplicitBlock
6040 * statement.cs (ExplicitBlock): New.
6041 (ToplevelBlock): Derive from it.
6042 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6044 (Block.Implicit): Update to changes.
6045 * cs-parser.jay: Update to changes.
6048 * codegen.cs (EmitContext.IsLastStatement): Remove.
6049 * statement.cs (Block.DoEmit): Update to changes.
6051 2007-05-25 Raja R Harinath <rharinath@novell.com>
6053 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6054 modifying current_block directly.
6056 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
6058 * class.cs: Implemented automatic properties (C# 3.0)
6059 Thanks to Marek for the help.
6061 2007-05-23 Raja R Harinath <rharinath@novell.com>
6063 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6064 variable as assigned, note also that all its components are
6066 (MyBitVector.SetRange): New. Function to set multiple bits to true.
6068 2007-05-19 Marek Safar <marek.safar@gmail.com>
6070 * anonymous.cs, class.cs: Emit Compiler generated attribute when
6071 member is marked as compiler generated.
6073 * decl.cs (MemberCore): Refactored ModFlags into property.
6075 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6076 (Check): Check only accessibility modifiers.
6078 2007-05-18 Raja R Harinath <rharinath@novell.com>
6080 Track all assignable slots in one bit array
6081 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6082 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
6083 logic from VariableMap constructor here. Use the same 'offset'
6084 variable that's later used for computing offsets of local
6086 * flowanalysis.cs (UsageVector.parameters): Remove.
6087 (UsageVector): Update to changes.
6088 (VariableMap): Remove.
6090 Avoid creating ParameterMap in every block
6091 * statement.cs (Block.ParameterMap): Move ...
6092 (ToplevelBlock.ParameterMap): ... here.
6093 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6095 * flowanalysis.cs (FlowBranching.param_map): Remove.
6096 (FlowBranching.UsageVector): Update to changes.
6097 (FlowBranchingToplevel.CheckOutParameters): Likewise.
6099 * statement.cs (Block.CloneTo): Clone Toplevel field too.
6101 * expression.cs (ParameterReference): Distinguish between block
6102 where parameter was referenced and declared.
6104 2007-05-18 Marek Safar <marek.safar@gmail.com>
6106 * flowanalysis.cs, statement.cs: Put back improved error handling.
6108 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
6112 Imporved object and collection initialization (C# 3.0).
6114 2007-05-15 Marek Safar <marek.safar@gmail.com>
6116 A fix for bug #81380
6117 * expression.cs (Is.DoResolve): Only value types have constant `is'
6120 2007-05-15 Raja R Harinath <rharinath@novell.com>
6122 * statement.cs (ToplevelBlock.child): Remove.
6124 2007-05-15 Raja R Harinath <harinath@gmail.com>
6126 Rationalize ResolveMeta: refactoring
6127 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
6128 out constant handling code into ...
6129 (Block.DoResolveConstants): ... this.
6131 Rationalize ResolveMeta: kill local_map
6132 * statement.cs (Block.local_map, Block.LocalMap): Remove.
6133 (Block.AssignableSlots): New.
6134 (Block.ResolveMeta): Make protected. Don't create a VariableMap
6135 for locals -- move code from VariableMap here. Avoid unnecessary
6137 * flowanalysis.cs (FlowBranching.local_map): Remove.
6138 (FlowBranching..ctor): Use Block.AssignableSlots.
6139 (VariableMap): Remove unused constructors.
6141 2007-05-11 Raja R Harinath <rharinath@novell.com>
6143 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6145 2007-05-11 Marek Safar <marek.safar@gmail.com>
6147 * typemanager.cs (IsFriendAssembly): Should not be called for building
6150 2007-05-09 Marek Safar <marek.safar@gmail.com>
6152 * literal.cs (NullConstant): Print null in all cases.
6154 * expression.cs (Binary.ResolveOperator): Implemented delegate
6155 comparison based on C# 2.0 changes.
6157 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
6159 This code is contributed under the MIT X11 license
6161 The following enables support for several C# 3.0 language features:
6163 * cs-tokenizer.cs: Added support for the "var" keyword.
6165 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6166 Added VarExpr class to facilitate type inferencing.
6168 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6169 to support anonymous types.
6171 * assign.cs: Added support for type inferencing and initialization.
6173 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6175 * expression.cs: Added implicit array support to ArrayCreation.
6176 Added 5 types and 1 interface:
6178 IInitializable Implementing classes can inject initializing
6179 statements after object instantiation.
6181 Initializer Stores data for object initialization.
6183 AnonymousType An expression for anonymous types.
6185 AnonymousTypeParameter Stores data about an anonymous type's field.
6187 NewInitialize An expression for object initialization.
6189 CollectionInitialize An expression for collection initialization.
6191 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6194 2007-05-06 Marek Safar <marek.safar@gmail.com>
6196 A fix for bug #81500
6197 * cs-tokenizer.cs: Add special handling for coalescing operator.
6199 2007-05-06 Marek Safar <marek.safar@gmail.com>
6201 A fix for bug #81529
6202 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6203 its value from base class until it is redefined.
6205 2007-05-02 Raja R Harinath <rharinath@novell.com>
6207 Fix regression in cs0631-3.cs
6208 * cs-parser.jay (operator_declarator): Add opt_attributes to error
6209 fallback. Make error fallback catch more cases.
6211 2007-05-01 Miguel de Icaza <miguel@novell.com>
6213 * cs-parser.jay: Allow parameters in operator declarations to have
6216 2007-04-27 Miguel de Icaza <miguel@novell.com>
6218 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6221 * lambda.cs (ContextualReturn.Resolve): An expression is valid
6222 inside the ContextualReturn, it does not have to be an
6223 ExpressionStatement.
6225 2007-04-24 Miguel de Icaza <miguel@novell.com>
6227 * lambda.cs (ContextualReturn.Resolve): if the return type is not
6230 2007-04-23 Miguel de Icaza <miguel@novell.com>
6232 * anonymous.cs (AnonymousContainer): split the virtual Resolve
6233 method in two methods: ResolveNoDefine and Resolve.
6235 ResolveNoDefine will stop just after ResolveTopBlock has been
6238 Resolve will then continue by creating a method and issuing the
6239 call to method.Define ().
6241 (AnonymousMethod): Split and implement the new Resolve and
6242 ResolveNoDefine as well.
6244 * lambda.cs (LambdaExpression): Split the anonymous method
6245 resolution code into a separate routine (CoreCompatibilityTest)
6246 from DoCompatibleTest.
6248 (LambdaExpression.TryBuild): New method, this method tries to
6249 build the LambdaExpression with the given set of types to be used
6250 as the types for the various parameters of the lambda expression.
6252 If the compilation succeed with the given types, the infered type
6253 of the Anonymous method is returned, otherwise null is returned.
6255 2007-04-23 Marek Safar <marek.safar@gmail.com>
6257 A fix for bug #81414
6258 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6260 2007-04-22 Miguel de Icaza <miguel@novell.com>
6262 * cs-tokenizer.cs: Change various identifiers here from the
6263 camelCasing to the recommended Linux-like style for instance
6264 variables from the Coding Guidelines.
6266 2007-04-19 Martin Baulig <martin@ximian.com>
6269 (Convert.ImplicitReferenceConversionCore): Allow conversions from
6270 System.Enum to System.ValueType.
6272 2007-04-13 Martin Baulig <martin@ximian.com>
6274 Rewrote implicit reference conversions. We need to distinguish
6275 between implicit reference conversions (13.1.4) and implicit
6276 boxing conversions (13.1.5).
6278 According to the spec, there's an an implicit conversion
6279 "From a one-dimensional array-type S[] to IList<T> and base
6280 interfaces of this interface, provided there is an implicit
6281 reference conversion from S to T." Note that this does not
6282 include boxing conversions.
6285 (Convert.ImplicitTypeParameterBoxingConversion): New method.
6286 (Convert.ImplicitReferenceConversion): Split into
6287 ImplicitReferenceConversionCore() and
6288 ImplicitBoxingConversionExist().
6289 (Convert.ImplicitReferenceConversionExists): Use the new
6290 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6292 2007-04-12 Martin Baulig <martin@ximian.com>
6294 * convert.cs (Convert.ImplicitReferenceConversion): Move the
6295 `TypeManager.null_type' checks up to the top of the method.
6297 2007-04-11 Marek Safar <marek.safar@gmail.com>
6299 A fix for bug #81350
6300 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6303 2007-04-11 Martin Baulig <martin@ximian.com>
6305 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6306 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6307 to make this work for generic classes; fixes #79561.
6309 2007-04-11 Martin Baulig <martin@ximian.com>
6311 * expression.cs (As): Add support for nullable types; fixes #79371.
6313 2007-04-11 Martin Baulig <martin@ximian.com>
6315 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6316 `type.FullName' is null; fixes #80243.
6318 2007-04-11 Martin Baulig <martin@ximian.com>
6320 * expression.cs (Invocation.IsApplicable): Don't modify the method
6321 if type inference succeeded, but the method was not applicable.
6324 2007-04-10 Marek Safar <marek.safar@gmail.com>
6326 A fix for bug #81324
6327 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6328 internal and external namespaces containers.
6330 2007-04-10 Martin Baulig <martin@ximian.com>
6332 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6333 TypeManager.DropGenericMethodArguments() so we also call
6334 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
6336 2007-04-10 Martin Baulig <martin@ximian.com>
6338 * iterators.cs (Iterator.CreateIterator): Don't crash if
6339 `method.ReturnType' is null. This happens if something went wrong
6340 while resolving that typ (we already reported an error in this case).
6342 2007-04-10 Martin Baulig <martin@ximian.com>
6344 * expression.cs (New.DoResolve): Don't call CheckComImport() on
6345 generic interfaces; report the CS0144 directly.
6347 2007-04-10 Martin Baulig <martin@ximian.com>
6349 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6350 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6352 2007-04-10 Martin Baulig <martin@ximian.com>
6354 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6356 2007-04-09 Raja R Harinath <rharinath@novell.com>
6359 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6360 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6363 * statement.cs (For.Resolve): If resolution fails, use
6366 2007-04-08 Marek Safar <marek.safar@gmail.com>
6368 * anonymous.cs (MakeName): Make faster and zero-based.
6369 (VerifyExplicitParameterCompatibility): Back to mode where generic
6370 parameter is ignored.
6371 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6373 * class.cs (EmitType): Method can emit another new method.
6375 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6377 * driver.cs: Updated.
6379 * lambda.cs: Reuse predefined empty parameters.
6381 * parameter.cs: Updated
6383 * support.cs: Implemented InflateTypes.
6385 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6386 (InitSystemCore): Introduced to isolate 3.0 dependencies.
6388 2007-04-03 Martin Baulig <martin@ximian.com>
6392 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6393 version of TypeManager.IsOverride() which also works with generic
6396 2007-04-03 Martin Baulig <martin@ximian.com>
6401 (Convert.ExplicitReferenceConversion): We need to cast when
6402 converting from IList<T> to S[].
6404 2007-04-01 Marek Safar <marek.safar@gmail.com>
6406 * decl.cs (FindExtensionMethods): Consider all candidates with same name
6409 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6411 2007-03-31 Marek Safar <marek.safar@gmail.com>
6413 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6414 argument and return type inferring.
6416 * codegen.cs (InferReturnType): Flag whether return can be inferred.
6417 (ReturnType): Turned to property.
6419 * statement.cs (Return): Implemented return type inferring.
6421 * support.cs (ReflectionParameters): Use local types if possible.
6423 2007-03-30 Raja R Harinath <rharinath@novell.com>
6425 * flowanalysis.cs (FlowBranching.Reachability): Remove.
6426 (FlowBranching.UsageVector): Update to changes.
6428 Prepare to kill 'Reachability'
6429 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6430 argument of constructor.
6432 2007-03-29 Raja R Harinath <rharinath@novell.com>
6434 Prepare to kill 'Reachability'
6435 * flowanalysis.cs (UsageVector.is_unreachable): New.
6436 (UsageVector): Update to maintain 'is_unreachable' in parallel to
6437 'reachability', and verify they're consistent.
6440 * expression.cs (New.EmitStatement): Handle type parameters here too.
6442 2007-03-29 Martin Baulig <martin@ximian.com>
6447 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6448 CompilerGeneratedClass.
6449 (ScopeInfo.EmitScopeInstance): Make this protected.
6450 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6451 `ec.CurrentAnonymousMethod.Scope == Scope'.
6453 * statement.cs (Block.ScopeInfo): Make this a property.
6455 2007-03-27 Raja R Harinath <harinath@gmail.com>
6457 Prepare to kill 'Reachability'
6458 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6459 (FlowBranching.UsageVector.Reachability): Remove property.
6460 (FlowBranching.UsageVector.IsUnreachable): New property.
6461 (FlowBranching.UsageVector.ResetBarrier): New.
6462 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6463 * codegen.cs, statement.cs: Update to changes.
6465 2007-03-27 Martin Baulig <martin@ximian.com>
6470 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6473 2007-03-26 Raja R Harinath <rharinath@novell.com>
6475 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6476 instead of TriState. Remove all mention of TriState.
6478 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6479 replaced by a boolean. Add boolean 'is_unreachable' field, check
6480 and maintain invariants.
6482 2007-03-25 Marek Safar <marek.safar@gmail.com>
6484 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6486 2007-03-25 Marek Safar <marek.safar@gmail.com>
6488 * expression.cs: Stop using obsolete 2.0 opcodes.
6490 2007-03-25 Marek Safar <marek.safar@gmail.com>
6492 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6493 one of the latests Martin's fixes.
6495 2007-03-23 Miguel de Icaza <miguel@novell.com>
6497 * expression.cs: On BigEndian systems, swap the bytes, temporary
6498 solution until we get a new bitconverter class.
6500 2007-03-23 Martin Baulig <martin@ximian.com>
6504 * decl.cs (MemberCache.AddMembers): Add generic methods both as
6505 "Method" and "Method`1". Normally, a cache lookup is done on the
6506 "Method" form (ie. without the generic arity), but this one makes
6507 lookups on the full form work as well.
6509 2007-03-22 Raja R Harinath <rharinath@novell.com>
6511 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6514 2007-03-20 Bill Holmes <billholmes54@gmail.com>
6516 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6517 ordered_member_list, to TypeBuilder to store members to be defined
6518 in the order they were parsed in.
6519 - ordered_explicit_member_list contains all properties indexers
6520 and methods that are defined as explicit implementation of an
6521 interface or base class.
6522 - ordered_member_list contains all properties indexers and methods
6523 that are not defined as explicit implementation of an interface
6526 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
6527 functionality in these removed classes has been replaced with
6528 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
6529 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6531 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6532 to CheckForDuplications inside GetMethod and SetMethod Define Method
6533 to handle method property and indexer name conflicts.
6537 All code is contributed under the MIT/X11 license.
6539 2007-03-20 Martin Baulig <martin@ximian.com>
6541 * class.cs (TypeContainer.Interfaces): Removed; they're now
6542 included in `TypeContainer.Types'.
6544 2007-03-20 Martin Baulig <martin@ximian.com>
6546 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
6548 * class.cs (TypeContainer.CreateType): New public method. This is
6549 now called before DefineType() to create the TypeBuilders.
6550 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6551 has already been created by CreateType().
6552 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6553 don't resolve our base classes here; this has been moved into
6554 DefineBaseTypes(). We're now called from CreateType().
6555 (TypeContainer.DefineBaseTypes): New private method; resolve our
6556 base classes here. We're now called from DefineType().
6559 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6560 our types first to create all the TypeBuilders. After that, call
6561 TypeContainer.DefineType() on all the types which'll resolve their
6562 base classes and setup the resolve order.
6564 2007-03-20 Martin Baulig <martin@ximian.com>
6566 * class.cs (TypeContainer.Enums): Removed; they're now included in
6567 `TypeContainer.Types'.
6569 2007-03-20 Martin Baulig <martin@ximian.com>
6572 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6573 (TypeContainer.DoResolveMembers): Call DefineType() on our
6574 `compiler_generated' classes; moved here from DefineNestedTypes().
6577 (RootContext.ResolveTree): Call ResolveMembers() on all
6578 TypeContainer's in the `type_container_resolve_order'.
6580 2007-03-19 Marek Safar <marek.safar@gmail.com>
6582 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6584 2007-03-17 Marek Safar <marek.safar@gmail.com>
6586 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6587 implementation flags.
6589 2007-03-17 Marek Safar <marek.safar@gmail.com>
6591 * class.cs: More optimizations for type parameters.
6593 2007-03-15 Marek Safar <marek.safar@gmail.com>
6595 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6597 * ecore.cs, parameter.cs: More common code for both corlibs.
6599 * typemanager.cs (IsGenericMethod): Simplified.
6601 2007-03-15 Raja R Harinath <rharinath@novell.com>
6603 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6605 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6607 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6608 unconditionally. Simplify explanation.
6609 (Try.Resolve, Using.Resolve): Likewise.
6611 2007-03-15 Martin Baulig <martin@ximian.com>
6615 * decl.cs (DeclSpace): If we're a partial class, use our
6616 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6618 2007-03-15 Raja R Harinath <rharinath@novell.com>
6620 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6622 (FlowBranching.UsageVector): Update to changes.
6623 (FlowBranching.MergeSiblings): Likewise.
6624 * statement.cs: Likewise.
6626 2007-03-15 Martin Baulig <martin@ximian.com>
6631 (MemberCache): Added a special .ctor for type parameters.
6634 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6637 2007-03-09 Martin Baulig <martin@ximian.com>
6639 * enum.cs (Enum): Make this a TypeContainer.
6640 (EnumMember): Derive from `Const'.
6643 (Const.DoResolveValue): New protected virtual method; move most of
6644 the functionality of ResolveValue() here so we can override it in
6646 (Const.CreateConstantReference): Make this virtual.
6648 * class.cs (Kind): Add `Kind.Enum'.
6649 (TypeContainer.Emit): Don't emit the enums here; they're already
6650 in the `RootContext.typecontainer_resolve_order'.
6652 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6653 here; they're already in the `typecontainer_resolve_order'.
6655 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6656 TypeManager.DropGenericTypeArguments().
6659 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6660 (TypeManager.IsEnumType): Likewise.
6661 (TypeManager.EnumToUnderlying): Likewise.
6662 (TypeManager.IsEqual): Add support for enums.
6664 2007-03-12 Raja R Harinath <rharinath@novell.com>
6666 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6667 DefaultParameterValueAttribute to be undefined, say if System.dll
6670 2007-03-11 Marek Safar <marek.safar@gmail.com>
6672 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6675 2007-03-10 Marek Safar <marek.safar@gmail.com>
6677 * class.cs, parameter.cs: Unified parameters verification.
6679 2007-03-08 Martin Baulig <martin@ximian.com>
6681 * cs-parser.jay (constructor_header): Pass the location to the
6682 newly created TopLevelBlock.
6684 2007-03-07 Martin Baulig <martin@ximian.com>
6686 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6688 2007-03-06 Miguel de Icaza <miguel@novell.com>
6690 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6691 with the changes from David, fixes the build.
6693 2007-03-05 David Mitchell <dmitchell@logos.com>
6695 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6696 and its base interfaces to a one-dimensional array type S[],
6697 provided there is an implicit or explicit reference conversion
6700 2007-03-03 Marek Safar <marek.safar@gmail.com>
6702 * cs-tokenizer.cs: Implemented basic linq grammar.
6704 * driver.cs: Set linq lang version on demand.
6706 2007-02-26 Marek Safar <marek.safar@gmail.com>
6708 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6710 2007-02-25 Marek Safar <marek.safar@gmail.com>
6712 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6715 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6717 Check property and event extern attributes.
6719 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6722 2007-02-24 Marek Safar <marek.safar@gmail.com>
6724 A fix for bug #80407
6725 * ecore.cs: Don't report ambiguity error when methods have same parent.
6727 2007-02-23 Marek Safar <marek.safar@gmail.com>
6729 A fix for bug #80878
6730 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6732 2007-02-22 Marek Safar <marek.safar@gmail.com>
6734 * attribute.cs: Enable ExtensionAttribute presence test.
6736 2007-02-22 Marek Safar <marek.safar@gmail.com>
6738 * class.cs: Warn about missing GetHashCode only when Equals is override.
6740 * decl.cs: Check accessibility of type arguments.
6742 * typemanager.cs: Correctly report nullable array.
6744 2007-02-20 Marek Safar <marek.safar@gmail.com>
6746 * class.cs, report.cs: Capture more details when things go wrong.
6748 2007-02-20 Marek Safar <marek.safar@gmail.com>
6750 A fix for bug #80650
6751 * cs-parser.jay: Anonymous container starts at constructor declaration
6752 and not at block beginning because it has to be usable in constructor
6755 * statement.cs: Use context location and not block one for error reporting.
6757 2007-02-18 Marek Safar <marek.safar@gmail.com>
6759 A fix for bug #78712
6760 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6763 2007-02-18 Marek Safar <marek.safar@gmail.com>
6765 A fix for bug #80493 by Atsushi Enomoto
6766 * cs-parser.jay: Ignore invalid attribute target.
6768 2007-02-18 Marek Safar <marek.safar@gmail.com>
6770 * cs-tokenizer.cs: Ignore '\0' as white space character.
6772 2007-02-17 Miguel de Icaza <miguel@novell.com>
6774 * cs-parser.jay: Add support for lambda expressions to the mcs
6777 * lambda.cs: Only clone when we are probing, not on the final call
6778 (Compatible is the final call).
6780 * statement.cs (CloneContext): Introduce class to provide block
6781 remapping during clone.
6783 All statements Clone themselves now.
6785 (Clone): special handling for blocks, when we clone a block, we
6786 register the block inside this routine, as children of the block
6787 might trigger a lookup.
6789 * expression.cs: Add support for CloneContext in all expressions.
6791 2007-02-17 Marek Safar <marek.safar@gmail.com>
6793 A fix for bug #80493
6794 * statement.cs: Report ambiguous warning when interfaces are not related.
6796 2007-02-15 Marek Safar <marek.safar@gmail.com>
6798 C# 3.0 extension methods.
6800 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6801 cannot be used directly.
6803 * class.cs (Class.Emit): Emit extension attribute if any class method
6804 is extension method.
6805 (Method.Define): Add basic extension method validation conditions.
6806 (Method.Emit): Emit extension attribute for method.
6808 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6809 extension method exists. Currently we follow same approach as Microsoft
6810 does, emit even if a method or a class are private but this can change
6813 * cs-parser.jay: Add handling of `this' keyword in method parameters
6816 * decl.cs (DeclSpace.IsStaticClass): New property.
6817 (MemberCache.FindExtensionMethods): Looks for extension methods with
6818 defined name and extension type.
6820 * doc.cs: Updated after OverloadResolve changes.
6822 * driver.cs: Add new soft reference to System.Core.dll.
6824 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6825 (ExtensionMethodGroupExpr): Represents group of extension methods.
6827 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6828 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6829 to MethodGroupExpr and made non-static for easier customization.
6830 (Invocation.DoResolve): Add extension method lookup when no standard
6832 (MemberAccess.DoResolve): Try extension methods if no member exists.
6834 * modifiers.cs: Add METHOD_EXTENSION modifier.
6836 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6837 as well as candidate extension type.
6838 (ComputeNamespaces): When assembly constains extension methods registers
6840 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6841 extension method lookup.
6842 (Namespace.LookupExtensionMethod): Looks for extension method in this
6844 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6845 find a method which matches name and extensionType.
6847 * parameter.cs (Parameter): Add This modifer.
6848 (HasExtensionMethodModifier): New property.
6849 (Resolve): Add extension parameter check.
6850 (ModFlags): turned to property to exclude this modifier as it is not real
6852 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6854 * support.cs (ParameterData): Add ExtensionMethodType.
6855 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6857 * typemanager.cs: Add type and ctor extension attribute type.
6859 2007-02-15 Miguel de Icaza <miguel@novell.com>
6861 * report.cs (DisableErrors, EnableErrors): used to prevent error
6862 output when we are "trying" to compile various methods with
6865 * ecore.cs (Expression): Add Clone method that calls the virtual
6866 CloneTo method. The current CloneTo method in Expression throws
6867 an exception so we can track down all the places where this must
6868 be implemented (not using abstract, because that would be a lot of
6869 up-front-work before we can start testing the implementation
6872 Important: we only need Clone capabilities for expressions created
6873 by the parser, as the expressions we will be cloning are
6874 expressions in the pre-resolved state. This vastly simplifies
6877 (SimpleName): Add CloneTo that does nothing.
6878 (EmptyCast): Add CloneTo.
6880 * expression.cs (Binary): Implement CloneTo.
6881 (Invocation.IsApplicable): Store the current ec in
6882 EmitContext.TempEc and restore it on return. This is used so we
6883 do not have to sprinkle hundres of methods with an extra
6884 EmitContext, we know that the only user is the lambda expression
6885 ImplicitConversionExists code.
6887 (Argument): Add Cloning capabilities.
6888 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6889 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6890 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6891 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6892 IndexerAccess): Add Clone capability.
6894 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6896 (Argument): Add cloning capability.
6898 * assign.cs (Assign): Implement CloneTo.
6900 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6902 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6903 version by calling Convert with the EmitContext (that we are
6904 currently storing in ec, this is not great, but will do for now,
6905 to avoid passing EmitContext parameters to hundreds of functions
6906 that do not need them now).
6908 (SetExpression): Remove, it is not needed.
6910 (ContextualReturn): Implement CloneTo.
6912 * statement.cs (Statement): Implement cloning infrastructure,
6913 similar to expressions.
6915 (Block): Partial implementation of Clone for statements.
6917 (Return): Implement clone.
6919 * constant.cs (Constant.CloneTo): New method, does nothing.
6921 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6922 solution, until we decide how to exactly do this.
6924 2007-02-14 Marek Safar <marek.safar@gmail.com>
6926 A fix for bug #80493
6927 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6928 a property is override we need to use second accessor.
6930 2007-02-13 Marek Safar <marek.safar@gmail.com>
6932 A fix for bug #80418
6933 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6936 2007-02-13 Marek Safar <marek.safar@gmail.com>
6938 Another fix for bug #80749
6939 * pending.cs: Abstract class has priority over interfaces.
6941 2007-02-13 Marek Safar <marek.safar@gmail.com>
6943 Another fix for bug #80749
6944 * pending.cs: Abstract class has priority over interfaces.
6946 2007-02-13 Marek Safar <marek.safar@gmail.com>
6948 Another fix for bug #80749
6949 * pending.cs: Abstract class has priority over interfaces.
6951 2007-02-13 Marek Safar <marek.safar@gmail.com>
6953 Another fix for bug #80749
6954 * pending.cs: Abstract class has priority over interfaces.
6956 2007-02-13 Marek Safar <marek.safar@gmail.com>
6958 * class.cs Better error message.
6960 * driver.cs: Add shorter versions of -optimize option.
6962 2007-02-13 Martin Baulig <martin@ximian.com>
6964 * class.cs (Constructor.Emit): Check the return value of
6965 ec.ResolveTopBlock() and return on error.
6967 2007-02-13 Raja R Harinath <rharinath@novell.com>
6969 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6970 message to fix error message regression.
6972 2007-02-12 Marek Safar <marek.safar@gmail.com>
6974 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6976 2007-02-12 Marek Safar <marek.safar@gmail.com>
6978 A fix for bug #80749
6979 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6980 its parent container.
6982 * class.cs (DefineFieldInitializers): Each initializer can has different
6985 * const.cs: Updated.
6987 2007-02-11 Miguel de Icaza <miguel@novell.com>
6989 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6990 now all the heavy lifting to check that embedded statements or
6991 expressions have the right form is done in the ContextualReturn.
6993 (ContextualReturn): New class.
6995 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6996 method that can be invoked to report 201, so we do not replicate
6999 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7001 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7002 treating tabs as spaces.
7004 2007-02-09 Marek Safar <marek.safar@gmail.com>
7006 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7007 * assign.cs: Use full implicit conversion for right side check.
7009 2007-02-09 Marek Safar <marek.safar@gmail.com>
7011 * statement.cs (Switch): Switch over boolean type is not standardized.
7013 2007-02-08 Marek Safar <marek.safar@gmail.com>
7015 A fix for bug #80755
7016 * decl.cs (FindBaseEvent): Don't use method cache for events.
7018 2007-02-07 Marek Safar <marek.safar@gmail.com>
7020 * cs-parser.jay: Better syntax error handling.
7022 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7023 instead of underlying type value.
7025 2007-02-06 Marek Safar <marek.safar@gmail.com>
7027 * driver.cs: Check define identifier before is registered.
7029 * namespace.cs: Use existing error message.
7031 * report.cs: New warning.
7033 2007-02-06 Marek Safar <marek.safar@gmail.com>
7035 A fix for bug #80742
7036 * expression.cs: Delegate Invoke method can be called directly.
7038 2007-02-06 Marek Safar <marek.safar@gmail.com>
7040 A fix for bug #80676
7041 * class.cs (IsEntryPoint): The Main method can have params modifier.
7043 2007-02-04 Miguel de Icaza <miguel@novell.com>
7045 * parameter.cs (Parameter, Parameters): Add Clone method.
7047 * anonymous.cs (Compatible): Turn method into virtual method, so
7048 LambdaExpression can implement a different behavior.
7050 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7051 out the basic checking here, so it can be used by
7054 * lambda.cs: Introduce "Compatible" function that will do the
7057 2007-02-02 Marek Safar <marek.safar@gmail.com>
7059 * attribute.cs: Unified one error message.
7061 * class.cs (Class): Use type attributes and not properties to test static
7063 (IsEntryPoint): Don's pass local variable.
7065 * convert.cs: Removed duplicate check.
7067 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7069 * driver.cs: Don't crash when soft reference does not exist.
7071 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7072 (UsingEntry): Removed redundant allocation.
7074 * parameter.cs: Add fast path for type parameters.
7076 * support.cs: Don't allocate attribute when it's not used.
7078 2007-01-30 Miguel de Icaza <miguel@novell.com>
7081 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7082 this into a virtual method, so we can override it in LambdaExpression.
7084 * driver.cs: Improve diagnostics in case of failure.
7086 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7087 write a function that is slightly more complex and that parses:
7089 type identifier [, type identifier]* )
7091 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7094 (canEmpty ? i >= 0 : i > 0)
7096 2007-01-30 Raja R Harinath <rharinath@novell.com>
7098 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7099 exception on possibly valid code.
7101 2007-01-29 Raja R Harinath <rharinath@novell.com>
7103 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7105 (parse_opt_type_arguments): Remove. It's almost the same as
7107 (parse_namespace_or_typename): Use parse_less_than.
7109 2007-01-28 Miguel de Icaza <miguel@novell.com>
7111 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7112 this bug took a few hours to find, because the state saved and
7113 restored by PushPosition and PopPosition was ignoring the state of
7114 parse_generic_less_than.
7116 I can also now remove the handling of OP_LT and OP_GT, this solves
7119 * cs-tokenizer.cs: store the location for the ARROW token, we use
7122 (PushPosition, PopPosition): save/restore also `current_token',
7123 restore `parse_generic_less_than' (was missing).
7125 (parse_opt_type_arguments): use parse_type, not
7126 parse_namespace_or_typename to parse types.
7128 * lambda.cs: Empty new file, will eventually have the lambda
7129 expression implementation.
7131 * lambda.test: used to test the internal tokenizer.
7133 * report.cs (FeatureIsNotISO1): Rename from
7134 FeatureIsNotStandardized, because it was about the language level
7135 (1 vs 2) it was not about standarization.
7137 (FeatureRequiresLINQ): New.
7139 * support.cs (SeekableStreamReader): Only require that the reader
7140 is a TextReader, not a StreamReader, so we can plug StringReader.
7142 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7143 given position in the input stream the following tokens can be
7144 parsed as a type followed by an identifier.
7146 (is_punct): after a '(' if parse_type_and_parameter returns true,
7147 then return a special token OPEN_PARENS_LAMBDA which is used to
7148 avoid reduce/reduce errors in the grammar for the
7149 lambda_expression rules.
7151 (parse_type): implement a type parser inside the
7152 tokenizer, the parser only returns true or false depending on
7153 whether the input at a given position can be parsed as a type.
7155 (peek_token): new method used during type parsing.
7157 2007-01-28 Raja R Harinath <rharinath@novell.com>
7160 * anonymous.cs (ScopeInfo.InflateParameters): New.
7161 (AnonymousContainer.Resolve): Use it to redirect types of
7162 delegate parameters.
7164 2007-01-27 Raja R Harinath <rharinath@novell.com>
7167 * expression.cs (Error_InvalidArguments): Don't use two different
7168 messages for CS1503. Use ExtraInformation and
7169 SymbolRelatedToPreviousError instead.
7172 * decl.cs (DeclSpace.initialize_type_params): Don't access
7173 'type_params' of a partial class directly.
7175 2007-01-26 Miguel de Icaza <miguel@novell.com>
7177 * constant.cs: Removed a handful of out-of-range checks that were
7180 2007-01-25 Marek Safar <marek.safar@gmail.com>
7182 * expression.cs (CheckUselessComparison): Add additional check for char
7185 * namespace.cs: Fixed typo.
7187 2007-01-23 Miguel de Icaza <miguel@novell.com>
7189 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7190 gone, instead we inline the test, preventing the needless casts to
7191 longs, ulongs and doubles for the parameters, avoiding calls to
7192 methods that overchecked stuff, and instead inlined things
7195 2007-01-20 Marek Safar <marek.safar@gmail.com>
7197 * cs-parser.jay: Better parameter error handling.
7199 2007-01-17 Marek Safar <marek.safar@gmail.com>
7201 A fix for bug #80368, #80522
7202 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7203 whether array initializer contains constants only.
7204 (ArrayCreation.Emit): Use better formula to decide when
7205 are array initializers for static initialization.
7206 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7207 have to emit even constants otherwise they are pre-initialized.
7209 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
7210 Raja R Harinath <rharinath@novell.com>
7212 Fix emit order of 'get' vs. 'set'.
7213 * support.cs (Accessors): New.
7214 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7215 Note the order in which accessors are declared in the source.
7216 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7217 Refactored from Property.Define and Indexer.Define.
7218 (PropertyBase.DefineAccessors): New helper that calls the above in
7219 appropriate order as noted by the parser.
7220 (Property.Define, Indexer.Define): Update to changes.
7221 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7223 2007-01-17 Raja R Harinath <rharinath@novell.com>
7225 Fix cs0029-6.cs and gcs0029-2.cs (regression)
7226 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7227 there's an implicit conversion from the current type to the target
7228 type before converting the underlying constant.
7230 2007-01-16 Marek Safar <marek.safar@gmail.com>
7232 * const.cs (ResolveValue): Updated after constant conversion was made more
7235 * constant.cs (GetAttributableValue): constant to object conversion is
7236 used for attributes only.
7237 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7238 constant conversions.
7239 (LongConstant.ConvertImplicitly): Ditto.
7241 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7242 (ImplicitConversionStandard): Handle constant conversion as extra step.
7243 It solves the issue when constant conversion was called indirectly like
7244 inside array initializer and constant folding was skipped.
7246 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7249 * statement.cs(ImplicitConversionStandard): Updated after constant
7250 conversion was made more generic.
7252 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
7254 * expression.cs (As.DoResolve): Use GenericConstraints instead of
7255 Constraints, solves the problem where the compiler incorrectly
7256 reported that a type parameter was not constrained to a class (Bug
7259 2007-01-14 Marek Habersack <grendello@gmail.com>
7261 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7263 2007-01-14 Marek Safar <marek.safar@gmail.com>
7265 A fix for bug #80368
7266 * assign.cs (FieldInitializer): New class implements field
7267 initializer statement.
7269 * attribute.cs: Update after FieldMember rename.
7271 * class.cs (PropertyBasedMember): New common class for property based
7273 (InterfaceMemberBase): New base class for all members which can be used as
7274 an interface members.
7275 (MethodCore): Moved really common code to InterfaceMemberBase.
7276 (Method.Define): Equal and GetHasCode detection is relevant for methods
7278 (MethodData.Define): Don't assume that public event implements an
7279 interface automatically.
7280 (MethodData.DefineMethodBuilder): Issue an error even if only extern
7282 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7283 (FieldMember): Merged with FieldBase.
7284 (EventProperty.AEventPropertyAccessor): New specialization to check whether
7285 event extern modifier can be used.
7286 (EventField.EventFieldAccessor): Moved event field specific code here.
7287 (Event.AllowedModifiers): Even event can be extern.
7288 (Event.FindOutBaseMethod): New override specific to events.
7289 (Indexer.parameters): Reintroduce parameters because base class holds
7290 only properties common data.
7291 (Indexer.CheckForDuplications): Indexers are threated as methods so we
7292 need do extra parameters check.
7294 * const.cs: Update after FieldMember rename.
7296 * decl.cs (MemberCache.FindBaseEvent): New method.
7298 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7299 to reflect that indexer is now derived from PropertyBased.
7301 * ecore.cs (GetMemberType): Made public.
7302 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7305 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7307 * typemanager.cs (CSharpSignature): Correctly print event accessors.
7308 (RegisterEvent): Removed.
7309 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7310 (GetPrivateFieldOfEvent): Renamed to GetEventField.
7312 2007-01-11 Raja R Harinath <rharinath@novell.com>
7315 * statement.cs (CollectionForeach.TryType): Prefer generic
7316 GetEnumerator over non-generic variant. Fix code to follow comments.
7318 2007-01-09 Raja R Harinath <rharinath@novell.com>
7321 * support.cs (ReflectionParameter): Don't use an invalid index on
7322 the generic parameter data.
7324 2007-01-08 Miguel de Icaza <miguel@novell.com>
7326 * driver.cs: Just add a tiny bit of infrastructure.
7328 2007-01-02 Marek Safar <marek.safar@gmail.com>
7330 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7331 where field type is struct from current assembly.
7333 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7336 2007-01-02 Marek Safar <marek.safar@gmail.com>
7338 A fix for bug #80381
7339 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7342 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7344 (Namespace.LookupType): Always use core types from corlib when speficied.
7346 * report.cs: A new warning.
7348 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7349 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7350 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7352 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7353 (InitCoreTypes): Set expression type of object_type and value_type
7354 immediately after lookup.
7356 2007-01-01 Miguel de Icaza <miguel@novell.com>
7358 * cs-tokenizer.cs: Accept Pc class characters (Connector
7359 Punctuation) as valid identifiers. Fixes #78259
7361 * expression.cs (Invocation.DoResolve): Moved the check for the
7362 use of `this' for doing method calls to the Invocation resolution
7363 step, after overload resolution has taken place instead of doing
7364 the check at the low-level `This.DoResolve' level.
7366 The `This.DoResolve'(appens before overload resolution, so it has
7367 no way of knowing if the method that will be called will be
7368 instace or static, triggering an erroneous report for cs0188 (Bug
7371 We now do the check for instance method invocations after we know
7372 what method will be called.
7374 (This.CheckThisUsage): Move the actual use of this structure
7375 checking into its own method and expose it.
7377 * Everywhere that called Error_ValueCannotBeConverted: pass a new
7380 Exceptions: Null.ConvertImplicitly,
7381 Constant.ImplicitConversionRequired as there are too many call
7382 sites for passing the ec.
7384 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7385 EmitContext, if the value is null, then we do not try to provide
7386 the extra information from the error (If a userdefined conversion
7387 exists, as UserDefinedConversion requires a non null-EmitContext).
7391 2006-12-30 Raja R Harinath <rharinath@novell.com>
7393 * flowanalysis.cs (MyBitVector): Document some invariants.
7394 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7395 introduced below, and add a couple of others,
7397 2006-12-30 Marek Safar <marek.safar@gmail.com>
7399 * attribute.cs (GetMethodObsoleteAttribute): Uses new
7400 GetPropertyFromAccessor and GetEventFromAccessor.
7402 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7403 overrides non-obsolete one.
7404 (Indexer.Define): Error message has been moved to the parser.
7406 * cs-parser.jay: Better syntax errors handling.
7408 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7409 when an invocation has no arguments.
7411 * ecore.cs: Removed not used caching.
7413 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7416 * report.cs: Add a new warning.
7418 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7420 * typemanager.cs (enumeration_type): Removed.
7421 (CSharpSignature): Reuses IsSpecialMethod.
7422 (IsEqual): Hack for MS BCL.
7423 (GetPropertyFromAccessor): New method.
7424 (GetEventFromAccessor): New method.
7425 (IsSpecialMethod): Fixed to handle more cases.
7427 2006-12-30 Marek Safar <marek.safar@gmail.com>
7429 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7430 Made white spaces array static.
7432 * ecore.cs (RemoveGenericArity): Optimized.
7434 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7436 (MyBitVector.initialize_vector): Simplified.
7438 2006-12-22 Miguel de Icaza <miguel@novell.com>
7440 * ecore.cs: Am not entirely happy with this hack, but it seems to
7441 address the issue in 80257 (a small test case for
7444 I set the MethodGroupExpr.Type to an internal compiler type
7445 (itself in this case) to force the resolution to take place. Why
7446 it does not take place with a null is beyond me.
7448 2006-12-20 Marek Safar <marek.safar@gmail.com>
7450 A fix for bug #80288
7451 * expression.cs (ResolveOperator): Consider user defined conversion for
7452 logical and operator too.
7453 (EmitBranchable): Optimization for logical and when full constant folding
7454 could not be applied but one operand is constant.
7456 2006-12-19 Marek Safar <marek.safar@gmail.com>
7458 * class.cs (GetClassBases): Write 5 times every day, will never use
7459 FullName for error reporting.
7461 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7463 2006-12-19 Martin Baulig <martin@ximian.com>
7465 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7466 the symbol file info here.
7468 2006-12-18 Marek Safar <marek.safar@gmail.com>
7470 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7471 of `elseif' is taking then following sections are not taking.
7472 Fixes an issue reported on mono mailing list.
7474 2006-12-18 Marek Safar <marek.safar@gmail.com>
7476 A fix for bug #80300
7477 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7478 a caller is not taking.
7480 2006-12-18 Raja R Harinath <rharinath@novell.com>
7482 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7483 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7484 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7485 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7486 * class.cs: Update to changes.
7488 2006-12-17 Marek Safar <marek.safar@gmail.com>
7490 A fix for bug #79934
7491 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7494 * class.cs (ResolveMembers): Register an iterator in current container and
7497 2006-12-16 Raja R Harinath <rharinath@novell.com>
7500 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7501 satisfy a params annotated parameter.
7503 2006-12-16 Marek Safar <marek.safar@gmail.com>
7505 A fix for bug #77014
7506 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7507 paramters correctly and not rely on hacks in Parameters class.
7508 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7510 (Invocation.VerifyArgumentsCompat): Ditto.
7511 (Invocation.EmitArguments): Changed to correctly emit params arguments at
7514 * parameter.cs (HasParams): Don't assume that params is the last one.
7516 * support.cs (ReflectionParameters.ctor): Look for params attribute
7518 (ReflectionParameters.ParameterType): Removed hack when we returned last
7519 parameter for out of range parameters.
7520 (ParameterName, ParameterModifier): Ditto.
7522 2006-12-14 Marek Safar <marek.safar@gmail.com>
7524 A fix for bug #79987
7525 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7526 when assembly is not CLS compliant but type is. I have no idea why is this
7529 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7531 2006-12-13 Miguel de Icaza <miguel@novell.com>
7533 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7534 in struct constructors, they are basically no-ops.
7536 2006-12-12 Marek Safar <marek.safar@gmail.com>
7538 * cs-tokenizer.cs (Position): Save preprocessor status too.
7540 2006-12-12 Marek Safar <marek.safar@gmail.com>
7542 A fix for bug #77794
7543 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7545 2006-12-12 Marek Safar <marek.safar@gmail.com>
7547 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7549 (pp_expr): Report error for an invalid expression.
7550 (handle_preprocessing_directive): Simplified; add more error checking.
7552 2006-12-11 Marek Safar <marek.safar@gmail.com>
7554 A fix for bug #74939
7555 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7556 directives handling.
7558 2006-12-10 Marek Safar <marek.safar@gmail.com>
7560 A fix for bugs #80093, and #75984
7561 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7562 logic, it seems to me as it worked before "by coincidence".
7563 (xtoken): Simplified to use reworked handle_preprocessing_directive.
7564 (cleanup): Enabled endif check.
7566 2006-12-09 Marek Safar <marek.safar@gmail.com>
7568 A fix for bug #80162
7569 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7570 enumerators are never ambiguous.
7572 2006-12-08 Raja R Harinath <rharinath@novell.com>
7575 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7577 2006-12-06 Marek Safar <marek.safar@gmail.com>
7579 A fix for bug #80144
7580 * class.cs (EventProperty.Define): Explicit implementation means
7581 that an even is used.
7583 2006-12-06 Marek Safar <marek.safar@gmail.com>
7585 Fixes the operators implementation (part II)
7587 * cfold.cs (DoConstantNumericPromotions): Renamed to
7588 DoBinaryNumericPromotions and simplified.
7589 (BinaryFold): Couple of conversion fixes; simplified.
7591 * constant.cs, ecore.cs, literal.cs
7592 (ToType): Renamed to ConvertImplicitly.
7593 (Reduce): Renamed to ConvertExplicitly.
7595 * class.cs, convert.cs: Updated.
7597 * expression.cs: TryReduce doesn't throw an exception.
7599 2006-12-01 Marek Safar <marek.safar@gmail.com>
7601 A fix for bug #80108
7602 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7605 2006-11-30 Marek Safar <marek.safar@gmail.com>
7607 Fixes unary operators implementation (part I)
7610 * cfold.cs (Error_CompileTimeOverflow): Made internal
7612 * const.cs (IConstant): Changed to use reference to constant and
7613 not constant itself.
7614 Updated IConstant implementations.
7616 * constant.cs (CreateConstant): New factory method.
7617 Updated IConstant implementation.
7619 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7621 * ecore.cs: Updated to use CreateConstantReference.
7623 * enum.cs: Reflects IConstant changes.
7625 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7627 * literal.cs (NullConstant): Change to be independently usable.
7629 2006-11-29 Martin Baulig <martin@ximian.com>
7631 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7632 we need to emit the scope initializer before calling the base .ctor.
7634 * anonymous.cs: Merged back from the new anonymous methods branch.
7635 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7637 * expression.cs (ParameterReference.DoResolveBase): Create a
7638 "normal" ScopeInfo when capturing parameters rather than using the
7639 root scope; this makes things work with anonymous methods having
7643 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7645 2006-11-22 Marek Safar <marek.safar@gmail.com>
7647 A fix for bug #79987
7648 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7649 check to a base class.
7650 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7651 only when assembly has missing attribute.
7652 * report.cs: Update.
7654 2006-11-21 Marek Safar <marek.safar@gmail.com>
7656 * cs-tokenizer.cs: Merged with gmcs version.
7658 2006-11-20 Marek Safar <marek.safar@gmail.com>
7661 * cs-parser.jay: Better error message when partial keyword is misplaced.
7663 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7665 A fix for bug #79810
7666 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7667 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7668 a RuntimeWrappedException by default.
7670 2006-11-18 Marek Safar <marek.safar@gmail.com>
7672 A fix for bug #79843
7673 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7675 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7677 2006-11-18 Marek Safar <marek.safar@gmail.com>
7679 * driver.cs, namespace.cs: Uses faster IndexOf version.
7681 2006-11-17 Marek Safar <marek.safar@gmail.com>
7683 A fix for bug #79941
7684 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7686 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7687 even if internal name is different.
7688 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7689 (UserDefinedConversion): Simplified as the operators cannot be internal.
7690 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7692 (MethodLookup): Replaced EmitContext with parentType.
7693 * expression.cs: Updated.
7695 2006-11-09 Raja R Harinath <rharinath@novell.com>
7697 * driver.cs (BadAssembly): Handle all the ugliness of
7698 DefineDynamicAssembly.
7700 2006-11-08 Raja R Harinath <rharinath@novell.com>
7702 Address parts of #58244 -- most of what's left is in the runtime
7703 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7704 CS1509 error checks, and handle them for all assembly loads, not
7705 just the first invocation.
7706 (LoadModule): Likewise. Move handling of 'adder_method' ...
7707 * codegen.cs (AssemblyClass.AddModule): ... here.
7709 2006-11-02 Marek Safar <marek.safar@gmail.com>
7711 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7712 IEnumerable<T> is ambiguous.
7714 2006-10-31 Marek Safar <marek.safar@gmail.com>
7716 A fix for bug #67689
7717 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7718 GetEnumerator is ambiguous.
7720 * report.cs: Add new warning.
7722 2006-10-29 Marek Safar <marek.safar@gmail.com>
7724 A fix for bug #78602
7725 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7726 to protected member can be nested type.
7728 2006-10-28 Marek Safar <marek.safar@gmail.com>
7730 A fix for bug #78965
7731 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7732 to protected member must derive from current type.
7734 2006-10-27 Marek Safar <marek.safar@gmail.com>
7736 assign.cs: Reuses error method.
7738 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7739 instead of type for constants.
7740 (Expression.Error_ValueAssignment): Common error method.
7742 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7745 2006-10-27 Marek Safar <marek.safar@gmail.com>
7747 A fix for bug #79081
7748 * expression.cs (MemberAccess.DoResolve): Check nested type
7751 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7753 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7755 2006-10-26 Marek Safar <marek.safar@gmail.com>
7757 A fix for bug #76591
7758 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7760 2006-10-26 Marek Safar <marek.safar@gmail.com>
7762 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7763 type forwarder of the same type multiple times.
7765 2006-10-26 Raja R Harinath <rharinath@novell.com>
7768 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7769 instance as an rvalue, even when we later resolve as an lvalue.
7771 2006-10-25 Martin Baulig <martin@ximian.com>
7773 * anonymous.cs: Fix #79673.
7775 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7777 A fix for bug #79666
7778 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7779 ignored when is optimized (= default value) as its value is already set.
7781 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7783 A fix for bug #79724
7784 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7785 TypeContainer for type lookup.
7787 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7789 A fix for bug #79231
7790 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7791 * expression.cs (OverloadResolve): Always convert type name for
7793 (ResolveNamespaceOrType): Don't confuse a nested type with any
7796 2006-10-18 Martin Baulig <martin@ximian.com>
7798 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7800 2006-10-17 Miguel de Icaza <miguel@novell.com>
7802 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7803 an int32, but requesting an int64 from the conversion
7805 2006-10-12 Martin Baulig <martin@ximian.com>
7808 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7810 2006-10-12 Martin Baulig <martin@ximian.com>
7813 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7815 2006-10-11 Miguel de Icaza <miguel@novell.com>
7817 * convert.cs: Remove broken code: I was doing the "Existance"
7818 tests for Implicit conversions.
7820 2006-10-10 Miguel de Icaza <miguel@novell.com>
7822 * convert.cs: Added one missing case in
7823 ImplicitStandardConversionExists uint64 to intptr.
7827 * typemanager.cs (uintptr_type): another core known type.
7829 * ecore.cs (OperatorCast): routine used to do cast operations that
7830 depend on op_Explicit. We could change some of the Decimal
7831 conversions to use this.
7833 This one has a probe mechanism that checks both types for an op_
7834 which it coudl be used to eliminate two classes: CastToDecimal
7835 and CastFromDecimal.
7837 * convert.cs: Implement the conversions documented in #59800
7839 2006-10-10 Martin Baulig <martin@ximian.com>
7841 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7842 before RootScope.ResolveMembers().
7844 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7845 `CurrentType' if appropriate.
7847 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7849 A fix for bug #78568
7850 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7851 when contains binary operators.
7852 * cs-parser.jay: Updated.
7854 2006-10-09 Martin Baulig <martin@ximian.com>
7857 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7858 moved that into Define() and also do the other type parameter
7859 checks there. Fixes #79094. Added gtest-292.cs.
7862 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7863 since that doesn't include type parameters; don't use `Ldelema'
7864 for type parameters. Fixes #78980. Added gtest-293.cs.
7866 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7869 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7870 conversion is allowed.
7872 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7874 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7875 error reporting when no error occurs.
7877 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7879 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7882 2006-10-06 Raja R Harinath <rharinath@novell.com>
7885 * class.cs (DefineTypeBuilder): Check circular dependencies before
7886 setting the parent of the TypeBuilder.
7887 (CheckRecursiveDefinition): Don't use 'BaseType', since
7888 it may not be valid until after DefineTypeBuilder. Use
7889 'base_type' instead.
7891 2006-10-04 Martin Baulig <martin@ximian.com>
7893 Merged the Anonymous Methods patch.
7895 * anonymous.cs, iterators.cs: The new anonymous methods code.
7897 * statement.cs (Variable): New public abstract class.
7898 (LocalInfo.Variable): New public property.
7899 (LocalInfo.ResolveVariable): New public method.
7900 (Block.Flags): Add `IsIterator'.
7901 (Block.AddVariable): Improved the CS0136 check.
7902 (Block.AnonymousChildren): New public property.
7903 (Block.AddAnonymousChild): New public method.
7904 (ToplevelBlock): Update to use the new anonymous method framework.
7905 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7906 `ToplevelBlock'; this is required to correctly implement the
7908 (Fixed, Using): Use `TemporaryVariable' instead of directly
7909 creating the `LocalBuilder'.
7911 * parameter.cs (Parameter.ResolveVariable): New public method.
7912 (Parameters.ResolveVariable): Likewise.
7914 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7916 * class.cs (TypeContainer): Replaced the `iterators' list and
7917 corresponding methods with a list of `CompilerGeneratedClass'es.
7918 (TypeContainer.ResolveMembers): New public method.
7919 (Method): `IIteratorContainer' has been replaced by
7922 * expression.cs (VariableReference): New public abstract base
7923 class for `LocalVariableReference', `ParameterReference' and
7926 * codegen.cs (EmitContext): Removed `capture_context',
7927 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7928 (EmitContext.EmitThis): Removed.
7930 * cs-parser.jay: Replace `iterator_container' with
7933 2006-10-04 Martin Baulig <martin@ximian.com>
7935 * generic.cs (GenericMethod): Don't make this abstract.
7936 (Constraints.Clone): Added dummy implementation.
7938 2006-10-04 Raja R Harinath <harinath@gmail.com>
7941 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7942 'declspaces'. Avoid allocating arrays willy-nilly.
7945 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7946 cases out of the switch.
7948 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7950 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7951 message when non-generic type is used with the type arguments.
7952 * expression.cs: Updated.
7954 2006-09-28 Raja R Harinath <rharinath@novell.com>
7957 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7958 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7959 Change semantics slightly. Don't insist on having only one
7960 temporary EmptyExpression -- just throttle the creation of new ones.
7963 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7964 non-interfaces too. If no methods are found, don't try to create
7967 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7969 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7972 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7973 us produce better error message.
7975 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7977 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7978 of the `|' operator.
7980 * report.cs: A new warning added.
7982 2006-09-27 Martin Baulig <martin@ximian.com>
7984 * generic.cs (GenericMethod): Don't make this abstract.
7986 2006-09-27 Martin Baulig <martin@ximian.com>
7989 (InternalErrorException): Added overloaded ctor taking a params array.
7991 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7993 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7994 Fixed the cases when same error was reported twice.
7996 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7997 now report symbol information.
7999 2006-09-25 Martin Baulig <martin@ximian.com>
8001 * class.cs: Completely unified with the gmcs version.
8003 2006-09-25 Martin Baulig <martin@ximian.com>
8005 * typemanager.cs (TypeManager.IsNullableType): New public function.
8006 (TypeManager.IsNullableTypeOf): Likewise.
8007 (TypeManager.IsNullableValueType): Likewise.
8009 * class.cs (MethodCore): Added the `GenericMethod' argument from
8010 gmcs and also unified all classes derived from `MethodCore' with gmcs.
8012 2006-09-24 Raja R Harinath <harinath@gmail.com>
8014 * convert.cs: Unify with gmcs version.
8016 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8018 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8019 verify them as well.
8021 * report.cs: New warning.
8023 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8025 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8026 for anonymous block with out argument.
8028 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8030 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8031 not used private events only.
8033 2006-09-23 Marek Safar <marek.safar@seznam.cz>
8035 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8037 * const.cs (Const.Define): Check for constant type.
8038 (Const.IsConstantTypeValid): Looks for valid constant types.
8040 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8042 * ecore.cs (EmptyConstantCast): New common class for all constant based
8045 * expression.cs (Is.DoResolve): Handle null constant especially.
8046 (New.DoResolve): Check for new void().
8047 (MemberAccess.DoResolve): Cope with all kind of nulls.
8049 * literal.cs (NullConstant): Uses EmptyConstantCast.
8050 (NullDefault): Based on EmptyConstantCast.
8051 (NullLiteral): Uses EmptyConstantCast.
8053 * statement.cs (Block.ResolveMeta): Check for constant type.
8055 2006-09-22 Martin Baulig <martin@ximian.com>
8057 * delegate.cs, attribute.cs: Merged with the gmcs versions.
8059 2006-09-22 Raja R Harinath <rharinath@novell.com>
8061 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8065 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8066 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
8069 2006-09-22 Martin Baulig <martin@ximian.com>
8071 * ecore.cs: Merged with the gmcs version.
8073 * generic.cs (ConstructedType): New dummy class.
8074 (TypeArguments): Don't make this abstract.
8077 (TypeManager.IsGenericTypeDefinition): New method.
8078 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8080 2006-09-22 Raja R Harinath <rharinath@novell.com>
8082 * expression.cs (ComposedCast): Check for arrays of TypedReference
8083 before creating the type, not after.
8085 2006-09-21 Marek Safar <marek.safar@seznam.cz>
8087 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8088 after ToType change.
8090 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8091 when constant must be implicitly convertible.
8093 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8095 * ecore.cs (NullCast): Derives from NullConstant.
8097 * expression.cs (Is.DoResolve): Removed useless variables.
8098 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8099 (New.Constantify): Add enum support.
8100 (MemberAccess.DoResolve): Add warning when accessing null constant or
8103 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8106 * literal.cs (NullConstant): New abstract class with common
8107 functionality for all null specializations.
8108 (NullDefault): Represents default(X) when result can be
8110 (NullLiteral): Updated.
8112 * report.cs: Add new warning.
8114 2006-09-21 Martin Baulig <martin@ximian.com>
8116 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8118 2006-09-21 Martin Baulig <martin@ximian.com>
8120 * generic.cs (GenericConstraints): New dummy class.
8121 (Constraints): Likewise.
8122 (TypeParameter): Likewise.
8123 (TypeParameterName): Likewise.
8124 (GenericMethod): Likewise.
8126 * typemanager.cs (TypeManager.GetGenericArguments): New method.
8128 * decl.cs: Merged with the gmcs version.
8130 2006-09-21 Raja R Harinath <rharinath@novell.com>
8132 * generic.cs (TypeParameter): Implement IMemberContainer.
8133 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
8135 * rootcontext.cs: Unify with gmcs version.
8137 * report.cs: Unify with gmcs version.
8138 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8139 from gmcs/generics.cs.
8140 * generics.cs (TypeParameter): New dummy class.
8142 * support.cs: Unify with gmcs version.
8144 2006-09-20 Raja R Harinath <rharinath@novell.com>
8146 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8147 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8149 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8150 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8151 * mcs.exe.sources: Add generic.cs.
8153 * codegen.cs: Unify with gmcs version.
8155 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8156 (EmitContext): Add GenericDeclContainer implementation.
8157 * decl.cs (MemberCore, DeclSpace): Likewise.
8158 * namespace.cs: Remove #ifdef GMCS_SOURCE.
8160 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8161 MCS TypeManager has a corresponding dummy method.
8163 2006-09-19 Martin Baulig <martin@ximian.com>
8165 * expression.cs: Completely merged with the gmcs version.
8167 2006-09-19 Martin Baulig <martin@ximian.com>
8169 * expression.cs (Invocation): Merged with the gmcs version.
8170 (ArrayAccess.GetStoreOpcode): Likewise.
8172 2006-09-19 Martin Baulig <martin@ximian.com>
8175 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8176 (TypeManager.IsGenericMethodDefinition): Likewise.
8178 2006-09-19 Martin Baulig <martin@ximian.com>
8181 (TypeManager.IsEqual): Moved the gmcs implementation here.
8182 (TypeManager.DropGenericTypeArguments): Likewise.
8183 (TypeManager.DropGenericMethodArguments): Likewise.
8184 (TypeManager.GetTypeArguments): Moved here from gmcs.
8185 (TypeManager.HasGenericArguments): Likewise.
8187 2006-09-19 Martin Baulig <martin@ximian.com>
8189 * expression.cs (Binary): Merged with the gmcs version.
8191 2006-09-19 Martin Baulig <martin@ximian.com>
8193 * expression.cs (Probe, As, Is): Merged with the gmcs version.
8195 2006-09-19 Martin Baulig <martin@ximian.com>
8197 * typemanager.cs: Merged with the gmcs version.
8199 2006-09-16 Raja R Harinath <rharinath@novell.com>
8201 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8202 * driver.cs: Likewise.
8204 2006-09-16 Marek Safar <marek.safar@seznam.cz>
8207 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8208 only if parent type is class.
8209 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8212 2006-09-15 Marek Safar <marek.safar@seznam.cz>
8215 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8217 * typemanager.cs(CSharpName): Converts NullType to null.
8219 2006-09-15 Martin Baulig <martin@ximian.com>
8222 (TypeManager.GetMethodName): Added mcs implementation.
8223 (TypeManager.IsEqual): Likewise.
8226 (SimpleName.RemoveGenericArity): Added dummy implementation.
8228 * pending.cs: Merged with the gmcs version.
8230 2006-09-15 Martin Baulig <martin@ximian.com>
8232 * statement.cs: Merge with the gmcs version.
8234 2006-09-15 Martin Baulig <martin@ximian.com>
8236 * statement.cs (Switch): Merge with the gmcs implementation
8237 (without nullables), which is newer.
8239 2006-09-15 Martin Baulig <martin@ximian.com>
8241 * statement.cs (Block.Variables): Make this public.
8242 (ToplevelBlock.Parameters): Make this a property.
8243 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8245 2006-09-15 Martin Baulig <martin@ximian.com>
8247 * namespace.cs: Merge with the gmcs version.
8249 2006-09-15 Martin Baulig <martin@ximian.com>
8251 * decl.cs (MemberName): Minor code cleanups.
8253 2006-09-15 Martin Baulig <martin@ximian.com>
8255 * parameter.cs: Merge with the gmcs version.
8257 2006-09-15 Martin Baulig <martin@ximian.com>
8259 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8260 and an error in mcs.
8262 2006-09-15 Martin Baulig <martin@ximian.com>
8264 * flowanalysis.cs: Merged from GMCS; added the generics code into
8265 a `GMCS_SOURCE' conditional so we can share this file.
8267 2006-09-08 Martin Baulig <martin@ximian.com>
8269 * typemanager.cs (TypeManager.interlocked_type): New public field.
8270 (TypeManager.int_interlocked_compare-exchange): New public field.
8271 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8272 enumerator types here and call InitGenericCoreTypes().
8273 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8274 after calling InitEnumUnderlyingTypes().
8277 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8278 `classes_second_stage'.
8280 2006-09-14 Marek Safar <marek.safar@seznam.cz>
8282 * assign.cs, ecore.cs, expression.cs: Share error message text.
8283 * class.cs (FieldMember.Define): Check for varible of static type.
8284 * driver.cs (LoadAssembly): Uses error output for errors.
8285 * statement.cs: Updated.
8287 2006-09-08 Marek Safar <marek.safar@seznam.cz>
8289 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8292 2006-09-07 Martin Baulig <martin@ximian.com>
8295 (MainDriver): Revert r62663 from Marek; see #70506 for details.
8297 2006-08-29 Miguel de Icaza <miguel@novell.com>
8299 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8301 2006-08-17 Miguel de Icaza <miguel@novell.com>
8303 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8304 #52019 and #79064, the use of the \uXXXX sequence in source code
8305 to represent unicode characters.
8307 2006-08-15 Marek Safar <marek.safar@seznam.cz>
8309 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8311 * class.cs, ecore.cs, statement.cs: Merged to one error message.
8313 2006-08-13 Miguel de Icaza <miguel@novell.com>
8315 * assign.cs: Catch attempts to assign to a method groups in += and
8318 2006-08-13 Marek Safar <marek.safar@seznam.cz>
8321 * cs-parser.jay: Don't destroy current array type by typeof of array's.
8323 2006-08-12 Marek Safar <marek.safar@seznam.cz>
8325 * class.cs (Method.Define): Issue a warning when generic method looks like
8327 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8330 2006-08-09 Marek Safar <marek.safar@seznam.cz>
8332 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8334 * decl.cs (MemberCache.FindMembers): When container is interface we need to
8335 search all base interfaces as a member can be ambiguous.
8336 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8337 Constructor member type filter.
8338 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8339 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8340 reporting for returned memberinfos.
8341 * report.cs: Updated.
8342 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8343 version to work on all runtimes.
8344 (TypeManager.RealMemberLookup): Removed members filtering.
8346 2006-08-08 Raja R Harinath <rharinath@novell.com>
8348 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8349 (PropertyExpr.EmitAssign): Likewise.
8350 * expression.cs (Indirection.EmitAssign): Likewise.
8351 (LocalVariableReference.EmitAssign): Likewise.
8352 (ParameterReference.EmitAssign): Likewise.
8353 (Invocation.EmitArguments): Likewise.
8354 (ArrayAccess.EmitAssign): Likewise.
8355 (IndexerAccess.EmitAssign): Likewise.
8356 (This.EmitAssign): Likewise.
8357 (ConditionalLogicalOperator.Emit): Likewise.
8360 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
8361 instead of ArrayList. If the hashtable has a LocalBuilder, don't
8362 leave it in after returning it.
8363 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
8365 2006-08-06 Marek Safar <marek.safar@seznam.cz>
8367 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8370 2006-08-03 Raja R Harinath <rharinath@novell.com>
8372 Fix cs0146-3.cs and cs0146-4.cs.
8373 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8374 enclosing types don't depend on the current type.
8376 2006-08-02 Raja R Harinath <rharinath@novell.com>
8379 * class.cs (TypeContainer.DoDefineMembers): Use
8380 FindBaseMemberWithSameName on Parent, since we're interested in
8381 whether we hide inherited members or not.
8382 (FindBaseMemberWithSameName): Make slightly more robust.
8384 Fix the non-generic testcase from #77396
8385 * decl.cs (DeclSpace.DeclContainer): Remove override.
8387 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8388 declspaces for doppelgangers too.
8389 (UsingEntry): Implement IResolveContext.
8390 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
8391 'this' as the resolve context.
8392 (LocalAliasEntry): Likewise.
8394 Implement parts of #77403
8395 * roottypes.cs (RootDeclSpace): New. Used to represent the
8396 toplevel declaration space. Each namespace declaration introduces
8397 a "partial" root declaretion space.
8398 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8399 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8400 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8401 from 'current_namespace.SlaveDeclSpace'.
8402 (namespace_declaration): Likewise.
8403 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8404 check. It can't happen now.
8405 * decl.cs (DeclSpace.LookupType): Likewise.
8406 * driver.cs (MainDriver): Sanity check.
8408 2006-08-01 Raja R Harinath <rharinath@novell.com>
8410 * decl.cs (DeclSpace.FindNestedType): Remove.
8411 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8412 LookupTypeContainer to get the container of the nested type.
8413 * class.cs (TypeContainer.FindNestedType): Make non-override.
8415 2006-07-31 Raja R Harinath <rharinath@novell.com>
8417 * decl.cs (DeclSpace.PartialContainer): Move field from ...
8418 * class.cs (TypeContainer.PartialContainer): ... here.
8419 (TypeContainer.AddBasesForPart): New helper.
8420 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
8422 * cs-parser.jay (current_class): Convert to DeclSpace.
8423 (struct_declaration, interface_declaration, class_declaration):
8424 Use AddBasesForPart instead of .Bases directly.
8425 * const.cs, iterators.cs: Update to changes.
8427 2006-07-28 Raja R Harinath <rharinath@novell.com>
8429 * class.cs (TypeContainer.AddMemberType): Rename from
8431 (TypeContainer.AddMember): Rename from AddToMemberContainer.
8432 (AddTypeContainer): New. Combine AddClassOrStruct and
8434 (AddPartial): Update. Add 'is_partial' argument.
8435 * roottypes.cs: Update to changes.
8436 * cs-parser.jay (push_current_class): New helper for handling
8437 current_container and current_class.
8438 (struct_declaration, interface_declaration, class_declaration):
8441 2006-07-26 Raja R Harinath <rharinath@novell.com>
8443 * roottypes.cs: Rename from tree.cs.
8445 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8446 * tree.cs (Tree, ITreeDump): Remove types.
8447 * rootcontext.cs (tree, Tree): Remove fields.
8448 (root, ToplevelTypes): New.
8449 * *.cs: Update to rename.
8451 * tree.cs (Tree.RecordDecl): Remove.
8452 (RootTypes.AddToTypeContainer): Record the toplevel type in its
8454 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8456 2006-07-23 Raja R Harinath <harinath@gmail.com>
8458 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8459 DoFlowAnalysis and OmitStructFlowAnalysis here.
8460 (ec.With): Rename from WithUnsafe and generalize.
8461 (ec.WithCheckState): Remove. All users can be handled by 'With'.
8462 (ec.WithFlowAnalyis): New.
8463 * ecore.cs, expression.cs, statement.cs: Update.
8465 2006-07-22 Raja R Harinath <harinath@gmail.com>
8467 * statement.cs (Block.ResolveMeta): Simplify slightly.
8469 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
8470 multiple boolean fields. Convert InUnsafe, constant_check_state,
8471 check_state to flags.
8472 (CheckState, ConstantCheckState): Update.
8473 (InUnsafe): New read-only property.
8474 (FlagsHandle): Rename from CheckStateHandle and convert to handle
8476 (WithUnsafe): New helper similar to WithCheckState.
8477 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8478 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8480 2006-07-21 Raja R Harinath <rharinath@novell.com>
8482 Make comparisons use the same IL irrespective of whether they're
8483 in a 'checked' or 'unchecked' context: one of the issues in #78899
8484 * codegen.cs (EmitContext.CheckState): Make read-only property.
8485 (EmitContext.ConstantCheckState): Likewise.
8486 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8487 helper that implement a save/restore stack for CheckState
8488 values. This is the only way to change check-state.
8489 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8490 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8491 (CheckedExpr.EmitBranchable): New forwarding method.
8492 (UnCheckedExpr): Likewise.
8493 * statement.cs (Block.ResolveMeta): Use WithCheckState.
8494 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8495 (Checked.Resolve, checked.DoEmit): Likewise.
8497 2006-07-20 Miguel de Icaza <miguel@novell.com>
8499 * anonymous.cs: Cache the resolved anonymous delegate, and return
8500 this so that the ResolveTopBlock is only triggered once, not
8503 Currently we trigger ResolvetopBlock twice due to a first pass of
8504 argument check compatibility, and a second pass that does the
8507 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8509 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8511 * rootcontext.cs (Reset): Add helper_classes.
8513 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8516 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8519 2006-07-13 Miguel de Icaza <miguel@novell.com>
8521 * statement.cs (Lock): Handle expressions of type
8522 TypeManager.null_type specially. Fixes #78770
8524 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8526 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8529 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8531 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8532 for accessors as well.
8533 * ecore.cs (EventExpr): Add AccessorTable.
8535 2006-07-01 Marek Safar <marek.safar@seznam.cz>
8538 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8539 for CS0122 where appropriate.
8540 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8542 (Filter): Assembly can be null in the case of top level attributes.
8544 2006-06-25 Marek Safar <marek.safar@seznam.cz>
8548 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8549 is done at global level.
8551 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8553 A fix for #77002, Implemented TypeForwarder support.
8555 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8556 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8557 * typemanager.cs (): Add type_forwarder_attr_type.
8559 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8561 * report.cs: Add CS0469 warning.
8563 2006-06-21 Martin Baulig <martin@ximian.com>
8565 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8566 the `try'-block, so we also report CS0016 etc. there.
8568 2006-06-21 Martin Baulig <martin@ximian.com>
8571 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8573 2006-06-21 Martin Baulig <martin@ximian.com>
8575 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8576 also report CS1686 for parameters.
8578 2006-06-21 Martin Baulig <martin@ximian.com>
8580 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8581 instead of an error if the value is not implicitly convertible to
8582 the switch types; fixes #77964.
8584 2006-06-21 Raja R Harinath <rharinath@novell.com>
8587 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8588 FieldBuilder is null.
8591 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8592 'left' and 'right' before error-checking.
8594 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8596 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8598 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8599 (FieldExpr.DoResolve): likewise.
8600 (PropertyExpr.InstanceResolve): likewise.
8601 (EventExpr.InstanceResolve): likewise.
8603 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8605 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8606 attribute applicable tests for attribute argument.
8608 2006-06-02 Raja R Harinath <rharinath@novell.com>
8611 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8612 (Binary.OverloadResolve_PredefinedIntegral): New.
8613 (Binary.OverloadResolve_PredefinedFloating): New.
8614 (Binary.OverloadResolve_PredefinedString): New.
8615 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8616 Follow the standard more closely, and treat numeric promotions in
8617 terms of overload resolution.
8618 (Binary.CheckShiftArguments): Simplify.
8620 2006-06-01 Raja R Harinath <rharinath@novell.com>
8622 * flowanalysis.cs (MyBitVector): Simplify representation.
8623 (MyBitVector.Clone): Avoid allocating BitArray.
8624 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8625 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8626 (*): Update. Change all references to MyBitVector.And and
8627 MyBitVector.Or to &= and |=.
8629 2006-05-29 Raja R Harinath <rharinath@novell.com>
8632 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8633 to param arguments too.
8635 2006-05-26 Miguel de Icaza <miguel@novell.com>
8637 * cs-parser.jay: Catch another parsing form for arglist being
8638 followed by other arguments. Fixes #78313.
8640 2006-05-24 Raja R Harinath <rharinath@novell.com>
8642 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8643 checking of out parameters to ...
8644 (FlowBranchingToplevel.Merge): ... here.
8645 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8646 set, propagate the origin upward, and only complain if there was
8648 (FlowBranchingException.AddContinueOrigin): Likewise.
8649 (FlowBranchingException.AddReturnOrigin): Likewise.
8650 (FlowBranchingException.AddGotoOrigin): Likewise.
8652 2006-05-23 Raja R Harinath <rharinath@novell.com>
8654 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8655 unreachable, skip it.
8656 (FlowBranchingException.Merge): Always propagate jumps, even if
8657 the finally block renders subsequent code unreachable.
8659 2006-05-18 Raja R Harinath <rharinath@novell.com>
8662 * statement.cs (Goto.Resolve): Move responsibility for resolving
8663 'goto' to FlowBranching.AddGotoOrigin.
8664 (Goto.SetResolvedTarget): New. Callback to set the
8665 LabeledStatement that's the target of the goto.
8666 (Goto.DoEmit): Use Leave instead of Br when crossing an
8667 unwind-protect boundary.
8668 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8669 LookupLabel and adjust to new semantics.
8670 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8671 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8672 Goto.SetResolvedTarget to update target.
8673 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8674 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8675 AddBreakOrigin & co. Delay propagation until ...
8676 (FlowBranchingException.Merge): ... this.
8678 * statement.cs (Block.Resolve): Always depend on flow-branching to
8679 determine unreachability. Kill workaround that originally emitted
8680 only one statement after an "unreachable" label (see infloop in
8683 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8684 This is still "wrong", but anything better would probably need a
8685 multi-pass algorithm.
8686 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8687 usage vector. Force current usage vector to be reachable, to
8688 optimistically signify backward jumps.
8689 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8691 (FlowBranchingLabeled.Merge): New. If no backward jump was
8692 detected, return the original salted-away usage vector instead,
8693 updated with appropriate changes. Print unreachable warning if
8695 * statement.cs (Block.Resolve): Don't print unreachable warning on
8696 a labeled statement.
8698 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8700 * driver.cs: Pass filename without path to AssemblyBuilder's
8701 AddResourceFile. Fixes bug #78407.
8703 2006-05-17 Raja R Harinath <rharinath@novell.com>
8705 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8706 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8707 (FlowBranching.MergeChild): Overwrite
8708 reachability information from Labeled branchings too.
8710 2006-05-16 Raja R Harinath <rharinath@novell.com>
8712 * statement.cs (Goto.Resolve): Merge jump origins here ...
8713 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8715 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8716 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8717 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8718 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8720 * statement.cs (Goto.Resolve): ... not here.
8721 (Goto.Emit): Remove CS1632 check.
8723 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8725 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8728 2006-05-11 Raja R Harinath <rharinath@novell.com>
8730 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8731 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8732 (FlowBranchingException.Label): Likewise.
8734 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8736 (MyBitVector.Or): Use it to avoid losing information (Count).
8737 (FlowBranching.MergeOrigins): Likewise.
8739 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8740 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8741 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8742 (UsageVector.ToString): Simplify.
8743 (UsageVector.MergeSiblings): Move here from ...
8744 (FlowBranching.Merge): ... here.
8745 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8748 2006-05-10 Raja R Harinath <rharinath@novell.com>
8750 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8751 null bitvector is treated as all-true.
8753 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8754 (MyBitVector): Rationalize invariants. 'vector != null' implies
8755 that we have our own copy of the bitvector. Otherwise,
8756 'InheritsFrom == null' implies all inherited bits are true.
8758 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8760 * statement.cs (LocalInfo): Add IsConstant.
8761 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8762 local variable for constants.
8764 2006-05-09 Raja R Harinath <rharinath@novell.com>
8766 * flowanalysis.cs (MyBitVector.Empty): New.
8767 (MyBitVector): Don't allow InheritedFrom to be null.
8768 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8769 (UsageVector, FlowBranching): Update to changes.
8771 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8772 recursion. The 'Parent == null' condition isn't sufficient for
8774 (FlowBranching.AddBreakOrigin): Likewise.
8775 (FlowBranching.AddContinueOrigin): Likewise.
8776 (FlowBranching.AddReturnOrigin): Likewise.
8777 (FlowBranching.StealFinallyClauses): Likewise.
8778 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8779 (FlowBranching.CheckOutParameters): Likewise.
8780 (FlowBranchingToplevel): Terminate all the above recursions here.
8781 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8782 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8784 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8786 (FlowBranchingToplevel): New. Empty for now.
8787 (FlowBranching.MergeTopBlock): Update.
8788 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8789 branching for the anonymous delegate.
8790 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8792 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8793 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8794 information at the start of the merge. Reorganize.
8796 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8798 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8800 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8802 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8803 to newly introduced ctor.
8805 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8806 message to one place.
8807 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8810 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8812 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8814 * ecore.cs (Expression.ResolveAsConstant): Updated.
8816 * statement.cs (ResolveMeta): Updated.
8818 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8820 * cs-parser.jay: __arglist cannot be used in initializer.
8822 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8825 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8828 2006-05-05 Raja R Harinath <rharinath@novell.com>
8830 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8831 (LabeledStatement): Add 'name' parameter.
8832 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8833 (Block.AddLabel): Update to changes.
8834 * cs-parser.jay (labeled_statement): Likewise.
8836 * flowanalysis.cs (BranchingType.Labeled): New.
8837 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8838 (FlowBranchingLabeled): New. Does nothing for now, but will
8839 eventually handle 'goto' flows.
8840 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8841 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8842 that's terminated ...
8843 (Block.Resolve): ... here.
8845 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8846 (UsageVector.MergeFinallyOrigins): Likewise.
8847 (FlowBranching.InTryOrCatch): Likewise.
8848 (FlowBranching.AddFinallyVector): Likewise.
8849 (FlowBranchingException): Update to changes.
8852 * statement.cs (Return.Resolve): Move error checking to ...
8853 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8854 (FlowBranchingException): Handle return origins like break and
8856 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8858 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8861 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8864 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8867 * class.cs (MethodData.Define): Do public accessor check only when method
8868 implements an interface.
8870 2006-05-04 Raja R Harinath <rharinath@novell.com>
8872 Remove special handling of 'break'
8873 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8874 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8875 (UsageVector.Break): Remove.
8876 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8878 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8880 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8881 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8883 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8886 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8887 be the interface member.
8889 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8892 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8893 for emitting small (int) values.
8895 2006-05-03 Raja R Harinath <rharinath@novell.com>
8898 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8899 control-flow passes through the 'finally' after merging-in all the
8900 control-flows from 'try' and the 'catch' clauses.
8902 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8903 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8904 always true at the only non-recursive entry point.
8905 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8906 FlowBranchingBreakable.
8907 (FlowBranchingLoop): Remove.
8908 * statement.cs (Return.DoResolve): Update to changes.
8911 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8912 (FlowBranching.CreateBranching): Handle it: create a
8913 FlowBranchingContinuable.
8914 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8915 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8916 except that it handles the 'continue' command.
8917 (FlowBranching.UsageVector.MergeOrigins): Rename from
8919 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8920 except that it overrides AddContinueOrigin.
8921 (FlowBranchingException): Override AddContinueOrigin, similar to
8923 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8924 Create a new branching around the embedded statement.
8925 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8926 control flow after the embedded statement.
8927 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8929 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8930 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8931 FlowBranchingBreakable.
8932 (FlowBranchingSwitch): Remove.
8935 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8936 error reporting to ...
8937 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8938 Rename from 'AddBreakVector'. Add new location argument. Return
8939 a bool indicating whether the 'break' crosses an unwind-protect.
8940 (FlowBranchingException.AddBreakOrigin): Add.
8941 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8942 flowbranching after updating with the effects of the 'finally'
8944 (FlowBranchingBreakable): New common base class for
8945 FlowBranchingLoop and FlowBranchingSwitch.
8947 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8949 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8951 2006-05-02 Raja R Harinath <rharinath@novell.com>
8953 * statement.cs (Do.Resolve): If the loop is infinite, set the
8955 (While.Resolve, For.Resolve): Set a barrier after the embedded
8956 statement. There's no direct control flow that goes from the end
8957 of the embedded statement to the end of the loop.
8958 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8959 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8960 above ensure that the reachability is correctly computed.
8962 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8963 (UsageVector.MergeBreakOrigins): If the current path is
8964 unreachable, treat it as if all parameters/locals are initialized.
8965 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8966 infinite loops before merging-in break origins.
8968 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8969 (Reachability.Reachable): Split part into ...
8970 (Reachability.Unreachable): ... this. Simplify.
8971 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8973 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8974 (Reachability.SetThrowsSometimes): Likewise.
8975 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8976 TriState.Always, use corresponding property.
8977 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8978 (Block.Resolve): Likewise. Remove some redundant checks.
8980 2006-05-02 Raja R Harinath <harinath@gmail.com>
8982 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8983 (Reachability.Meet): Don't bother checking AlwaysThrows --
8984 barrier is always set.
8985 (FlowBranchingBlock.Merge): Likewise.
8987 2006-05-01 Raja R Harinath <harinath@gmail.com>
8989 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8990 checks for unreachable.
8992 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8995 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8997 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8998 whether field is really assigned.
9000 2006-04-30 Raja R Harinath <harinath@gmail.com>
9002 * flowanalysis.cs (Reachability): Make 4-argument constructor
9004 (Reachability.Meet): Rename from 'And'. Remove static variant.
9005 (Reachability.Always): Rename from the highly misleading
9006 'Reachability.Never'.
9007 (FlowBranching.Merge): Update to changes. Mark an impossible
9008 situation with a 'throw'.
9009 (*): Update to changes.
9011 2006-04-29 Raja R Harinath <harinath@gmail.com>
9013 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9015 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9016 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9017 (*): Update to changes.
9018 * statement.cs: Update to changes.
9020 2006-04-28 Marek Safar <marek.safar@seznam.cz>
9023 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9025 2006-04-28 Raja R Harinath <harinath@gmail.com>
9027 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9030 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9031 argument to two arguments: an usage-vector and a bool. Move call
9032 to FlowBranching.Merge () ...
9033 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9035 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9036 handling of loop and switch reachability to ...
9037 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9039 2006-04-27 Raja R Harinath <harinath@gmail.com>
9041 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9042 handling to FlowBranchingLoop.InLoop.
9043 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9045 2006-04-26 Marek Safar <marek.safar@seznam.cz>
9048 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9049 anonymous method is allowed from AnonymousContainer here.
9051 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9053 2006-04-24 Raja R Harinath <rharinath@novell.com>
9056 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9058 2006-04-23 Marek Safar <marek.safar@seznam.cz>
9061 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9062 (DoubleConstant.Reduce): Ditto.
9064 2006-04-23 Raja R Harinath <rharinath@novell.com>
9066 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9067 Remove 'lvalue_right_side' argument. Move parts to ...
9068 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9069 (LocalVariable.DoResolveLValue): ... these.
9071 2006-04-21 Raja R Harinath <rharinath@novell.com>
9074 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9075 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9076 (LocalVariableReference.DoResolveBase): Use it to implement new
9078 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9079 (Argument.Resolve): Simplify. Move CS1510 check ...
9080 * ecore.cs (Expression.ResolveLValue): ... here.
9081 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9082 (PropertyExpr.DoResolveLValue): Likewise.
9083 (FieldExpr.Report_AssignToReadonly): Likewise.
9084 (FieldExpr.DoResolve): Add 'out_access' argument. Use
9085 LValueMemberAccess or LValueMemberOutAccess on instance depending
9087 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9088 DoResolve as appropriate.
9090 2006-04-20 Raja R Harinath <rharinath@novell.com>
9093 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9094 implicit conversions on 'out' and 'ref' arguments.
9096 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9097 improve clarity. Remove dead code.
9100 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9101 (Catch.Resolve): Resolve VarBlock if it exists.
9103 2006-04-19 Miguel de Icaza <miguel@novell.com>
9105 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9106 twice, this was some residual code, the enumerator was emitted
9107 properly in the two branche of if later.
9109 2006-04-19 Raja R Harinath <rharinath@novell.com>
9111 * expression.cs (Cast.ResolveLValue): Remove. The result of a
9112 cast is never an lvalue.
9113 (Cast.DoResolve, Cast.ResolveRest): Combine.
9114 (Argument.Emit): Simplify slightly. Move 'Expr is
9115 IMemoryLocation' check ...
9116 (Argument.Resolve): ... here.
9117 (Argument.Error_LValueRequired): Remove. Inline into only user.
9119 Simplifications. Fix cs0191-2.cs
9120 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9121 CS1649 and CS1651 to ...
9122 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
9123 the actual selection of the error code and message to a lookup
9124 table. Add a dummy return value to simplify callsites.
9125 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9126 readonly fields of other instances of the same type. Move CS0197
9128 * expression.cs (Argument.Resolve): ... here. Simplify code.
9129 Ensure that ec.InRefOutArgumentResolving is only set during LValue
9130 resolution of an out or ref argument. The code simplification
9131 above uses this invariant.
9133 2006-04-18 Raja R Harinath <rharinath@novell.com>
9135 Possibly fix #77752. Fix cs1690-[4-7].cs.
9136 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9137 CheckMarshallByRefAccess. Drop parameter.
9138 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
9140 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9142 * report.cs (AllWarnings): Add CS1690.
9143 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9145 (LocalVariableReference.DoResolveBase): Update.
9147 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9149 * class.cs (MethodOrOperator): Moved common parts from method class.
9150 detect obsolete attributes.
9151 (Method.Define): Simplified as it reuses code from base.
9152 (Constructor.ValidAttributeTargets): Fixed issue found during
9154 (Destructor.ValidAttributeTargets): Fixed issue found during
9156 (Operator): Finished refactoring set off by #78020. Operator class is now
9157 ordinary method class.
9159 * anonymous.cs: Updated.
9161 * decl.cs (DeclSpace): Add IsGeneric
9163 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9165 * class.cs (Constructor.Emit): Don't emit the attributes twice.
9167 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9169 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9170 detect obsolete attributes.
9171 (Method.CreateEmitContext): Moved to MethodOrOperator.
9173 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9176 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9177 customized exception to make crash detection easier.
9178 (MethodOrOperator): Started to work on new base class for methods and
9180 (Method): Derives from MethodOrOperator.
9181 (Constructor.Emit): Emits its own attributes.
9182 (AbstractPropertyEventMethod.Emit): Ditto.
9183 (Operator): Derives from MethodOrOperator, will refactor fully in extra
9185 (Operator.Emit): It's temporary more tricky than should be.
9187 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9189 * report.cs (InternalErrorException): Add ctor with inner exception.
9191 2006-04-08 Marek Safar <marek.safar@seznam.cz>
9194 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9197 2006-04-07 Marek Safar <marek.safar@seznam.cz>
9200 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9203 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9205 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9206 attribute is present and Guid not.
9207 (Interface.ApplyAttributeBuilder): Ditto.
9209 * attribute.cs: Add error message.
9211 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9215 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9216 sources (it's composite) so hold them in extra array as they are used in
9217 Emit phase only. It worked in the previous versions by mistake.
9218 (Attribute.Emit): Emit attribute for more owners when exist.
9220 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9221 it has now different behaviour.
9223 2006-04-04 Marek Safar <marek.safar@seznam.cz>
9225 * constant.cs (Constant.IsDefaultInitializer): New method.
9227 * class.cs: Updated.
9229 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9230 re-initialize default values. It saves KBs almost for every assembly.
9231 Thanks Zoltan for the idea.
9232 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9233 (ArrayCreation.DoResolve): Resolve only once.
9234 (ArrayCreation.Emit): Emit static initializer only when it is faster.
9235 (ArrayCreation.GetAttributableValue): Cope with optimized values.
9237 2006-04-03 Zoltan Varga <vargaz@gmail.com>
9239 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9242 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9244 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9245 in an embedded statement too.
9247 2006-04-01 Raja R Harinath <rharinath@novell.com>
9250 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9252 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9256 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9259 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9261 2006-03-31 Marek Safar <marek.safar@seznam.cz>
9263 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9266 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9267 LocalTemporary change.
9269 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9271 (ClassOrStruct.DefineFieldInitializers): Implemented static field
9272 initializers optimization.
9273 (ClassOrStruct.TypeAttr): Moved from modifiers.
9274 (Constructor.CheckBase): Don't crash when static ctor has parameters.
9275 (FieldBase.ResolveInitializer): Resolves initializer.
9276 (FieldBase.HasDefaultInitializer): New property.
9278 * cs-parser.jay: Removed message.
9280 * expression.cs (CompilerGeneratedThis): New specialization.
9282 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9284 2006-03-28 Marek Safar <marek.safar@seznam.cz>
9286 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9288 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9290 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9291 be now EnumConstants only.
9293 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9295 * attribute.cs, driver.cs: Reset more caches.
9297 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9299 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9301 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9303 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9304 for easier reuse. Updated all overrides.
9305 (IntegralConstant): New base class for all integral constants.
9306 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9307 of the constant range, report custom error.
9308 (UIntConstant.Reduce): Fixed uint conversion.
9310 * ecore.cs, literal.cs: Reduce updates.
9312 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9316 * class.cs (Constructor.Define): Removed extra if for default ctors.
9317 A patch from Atsushi Enomoto.
9319 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9321 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9322 GetAttributableValue.
9324 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9327 * convert.cs (ImplicitConversionRequired): Error message moved to
9330 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9331 automatic implicit conversion of an output value.
9332 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9334 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9336 (TypeOf.GetAttributableValue): Add extra handling for object type.
9338 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9339 special error message.
9341 2006-03-25 Marek Safar <marek.safar@seznam.cz>
9343 * class.cs (Constructor.Emit): Don't crash when struct ctor is
9345 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9346 compatible with MS runtime.
9348 2006-03-23 Marek Safar <marek.safar@seznam.cz>
9350 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9351 attribute arguments here.
9353 * class.cs (Indexer.Define): The check was moved to attribute class.
9355 2006-03-22 Marek Safar <marek.safar@seznam.cz>
9357 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9358 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9361 2006-03-22 Raja R Harinath <rharinath@novell.com>
9363 Support ParameterDefaultValueAttribute in gmcs. Also applied to
9364 mcs to keep code differences small.
9365 * attribute.cs (Attribute.GetParameterDefaultValue): New.
9366 * typemanager.cs (parameter_default_value_attribute_type): New.
9367 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
9370 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9372 * expression.cs (StringConcat.Append): Reverted back to no warning state.
9374 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9376 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9378 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9381 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
9383 * doc-bootstrap.cs : fix build.
9385 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9387 * expression.cs (StringConcat.Append): Issue a warning when empty string
9390 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9392 * assign.cs (CompoundAssign.ResolveSource): Removed.
9394 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9397 * class.cs (TypeContainer.FindMethods): Removed.
9398 (TypeContainer.CheckMemberUsage): Made static.
9400 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9402 * constant.cs (CheckRange): Removed unused type argument.
9403 (CheckUnsigned): Removed unused type argument.
9405 * cs-parser.jay: Updated after MemberAccess clean up.
9406 Uses Length for empty string test.
9408 * cs-tokenizer.cs: Uses Length for empty string test.
9409 (IsCastToken): Made static.
9410 (is_hex): Made static.
9411 (real_type_suffix): Made static.
9413 * decl.cs (SetupCache): Made static.
9414 (OnGenerateDocComment): Removed unused ds argument.
9416 * delegate.cs (VerifyDelegate): Removed unused argument.
9418 * doc.cs: Uses Length for empty string test.
9420 * driver.cs: Uses Length for empty string test.
9422 * enum.cs (IsValidEnumType): Made static
9424 * expression.cs (EnumLiftUp): Removed unused argument.
9425 (ResolveMethodGroup): Ditto.
9426 (BetterConversion): Ditto.
9427 (GetVarargsTypes): Ditto.
9428 (UpdateIndices): Ditto.
9429 (ValidateInitializers): Ditto.
9430 (MemberAccess.ctor): Ditto.
9431 (GetIndexersForType): Ditto.
9433 * flowanalysis.cs: (MergeFinally): Removed unused argument.
9435 * iterators.cs: Updated after MemberAccess clean up.
9437 * location.cs: Uses Length for empty string test.
9439 * namespace.cs: Uses Length for empty string test.
9441 * report.cs (CheckWarningCode): Made static.
9443 * statement.cs (LabeledStatement): Removed unused argument.
9445 * typemanager.cs (FilterNone): Removed.
9447 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9449 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9452 * class.cs: Updated.
9454 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9456 * cs-parser.jay.cs: __arglist is not allowed for delegates.
9458 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9462 * expression.cs (VerifyArgumentsCompat): Reverted to double error
9463 reporting, it's more tricky than I thought.
9465 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9469 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
9471 (AnonymousMethod.ImplicitStandardConversionExists): New method.
9472 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9473 Add more error reporting; Fixed issue with params.
9475 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9477 * cs-parser.jay: AnonymousMethod requires host container.
9479 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9481 2006-03-18 Raja R Harinath <harinath@gmail.com>
9483 * class.cs: Change 'TypeContainer ds' constructor argument to
9484 'DeclSpace parent'. Some classes were missed below due to
9485 different naming convention.
9487 * class.cs (MemberCore.Parent): Delete. This makes the
9488 ParentContainer changes below enforceable by the compiler.
9490 Treat pointers to enclosing declaration space as 'DeclSpace', not
9492 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9493 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9495 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9497 (Block.AddThisVariable): Likewise.
9498 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9499 (AbstractPropertyEventMethod.Emit): Likewise.
9500 (AbstractPropertyEventMethod.EmitMethod): Likewise.
9501 (GetMethod.Define, SetMethod.Define): Likewise.
9502 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9503 (DelegateMethod.EmitMethod): Likewise.
9505 Fix regression test-partial-13.cs.
9506 Rationalize use of PartialContainer. Ensure that the partial
9507 class semantics can be tied to type-correctness, i.e., any
9508 violation will cause a compile error.
9509 * class.cs, const.cs: Access all fields that belong to class
9510 TypeContainer via ParentContainer. Arguments of EmitContexts and
9511 Resolve()-like functions still use 'Parent'.
9513 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9514 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9515 (PropertyMethod.CheckModifiers): Remove unused argument.
9516 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9519 2006-03-17 Raja R Harinath <harinath@gmail.com>
9521 Make semantics of PartialContainer simpler.
9522 * decl.cs (DeclSpace.IsPartial): Remove.
9523 * class.cs (TypeContainer.IsPartial): Likewise.
9524 (TypeContainer..ctor): Set PartialContainer to point to self.
9525 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9526 (TypeContainer.FindNestedType): Likewise.
9527 (MemberCore.ParentContainer): Simplify. Remove deprecation.
9529 2006-03-17 Marek Safar <marek.safar@seznam.cz>
9531 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9533 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9535 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9538 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9540 * class.cs (Operator.Define): An error for base conversion was not
9543 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
9545 * iterator.cs : yield break is allowed in try statement which has
9546 catch clauses. Fixed bug #77767.
9548 2006-03-13 Marek Safar <marek.safar@seznam.cz>
9550 A fix for #77593, #77574.
9552 * class.cs (MethodCore.CheckBase): Another if for operator.
9554 2006-03-09 Marek Safar <marek.safar@seznam.cz>
9556 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9559 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9560 (DelegateCreation.ImplicitStandardConversionExists): New method for just
9563 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9566 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9567 Updated after another emitcontext usage was clean up. It should help us to
9568 synchronize with gmcs easier.
9570 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9574 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9575 (Event.Define): ditto
9576 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9578 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9579 Removed redundant code and set NewSlot for Invoke method too.
9581 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9582 (Parameters.MergeGenerated): New method. Use this method when you merge
9583 compiler generated argument with user arguments.
9585 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9587 * attribute.cs (ResolveAsTypeTerminal): Removed.
9589 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9590 specialization for predefined types; 30% speed up.
9591 Finally placed obsolete check to right place.
9592 (Expression.ResolveType): Removed.
9594 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9595 Updated after ResolveType was removed.
9597 * expression.cs (Cast.ctor): Check void cast.
9598 (Binary.ResolveAsTypeTerminal): Is never type.
9599 (Conditional.ResolveAsTypeTerminal): Is never type.
9601 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9603 2006-03-01 Raja R Harinath <rharinath@novell.com>
9606 * expression.cs (ParameterReference.DoResolveBase): Change return
9608 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9612 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9615 * typemanager.cs (GetFullNameSignature): Don't nullref on
9616 protected accessors.
9618 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9620 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9621 these two separated members to simplify the code.
9622 (Attribute.Resolve): Refactored to use new fields and methods.
9623 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9624 implemented obsolete attribute checking.
9625 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9626 implemented obsolete checking again. It look line never ending quest ;-)
9627 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9629 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9631 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9633 *class.cs (Property.Define): Add RegisterProperty call.
9635 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9636 argument groups (only 2).
9638 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9639 encoding expression to arguments.
9640 (Expression.ExprClassToResolveFlags): Just turned to property.
9642 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9643 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9644 optimized as well as implemented support for zero-length attributes.
9646 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9647 Add caching of PropertyInfo's.
9649 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9651 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9652 error multiple times.
9654 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9656 New partial class implementation.
9657 A fix for #77027, #77029, #77403
9659 * attribute.cs (Attributable): Made attributes protected.
9661 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9662 the replacements of ClassPart and PartialContainer.
9663 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9664 (TypeContainer.AddInterface): Ditto.
9665 (TypeContainer.AddPartial): The main method for partial classes. It checks
9666 for errors and merges ModFlags and attributes. At the end class is added to
9668 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9670 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9671 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9672 from the rest of partial classes.
9673 (TypeContainer.GetClassBases): Simplified.
9674 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9676 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9677 (TypeContainer.HasExplicitLayout): Uses Flags now.
9678 (PartialContainer): Removed.
9679 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9680 (StaticClass): Was merged with Class.
9681 (Class.GetClassBases): class and static class bases are verified here.
9682 (Class.TypeAttr): Added static attributes when class is static.
9683 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9684 (MemberBase): In some cases we need to call parent container for partial
9685 class. It should be eliminated but it's not easy now.
9687 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9689 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9690 partial classed to accumulate class comments.
9691 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9693 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9695 * driver.cs (MainDriver): Tree.GetDecl was removed.
9697 * modifiers.cs (Modifiers): Add partial modifier.
9699 * tree.cs (Tree.decl): Removed.
9700 (RootTypes): Started to use this class more often for root types
9703 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9707 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9708 external interface does not have an attribute.
9710 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9712 Another prerequisites for new partial classs implementation.
9714 * attribute.cs (Attribute.Equal): Implemented.
9715 (Attribute.Emit): Changed as attributes can be applied more than twice.
9716 (Attributes.Emit): Check for duplicate attributes here.
9718 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9719 as a parameter, clean-up.
9721 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9725 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9726 contains obsolete attribute check which can in some cases look for base
9727 type of current class which is not initialized yet.
9728 (TypeContainer.BaseType): Replacement of ptype.
9730 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9732 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9734 First of prerequisites for new partial classs implemention.
9736 * attribute.cs (Attributable): Extended by ResolveContext;
9737 Attributes finally have correct context for resolving in all cases.
9738 (AttachTo): Attribute owner is assigned here.
9740 * codegen.cs (IResolveContext): Introduce new interface to hold
9741 all information needed in resolving phase.
9742 (EmitContext): Implements IResolveContext; more clean-up needed here.
9744 * decl.cs (MemberCore): Implemented IResolveContext.
9746 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9747 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9748 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9749 Refactored to use new IResolveContext instead of EmitContext; cleanup
9751 2006-02-06 Miguel de Icaza <miguel@novell.com>
9753 * codegen.cs (EmitScopeInitFromBlock): check here the
9754 capture_context, there is no need to make two calls to the
9757 * anonymous.cs: Add some debugging messages that might help me
9758 track other instances of this problem in the future (the
9759 regression of test 467).
9761 * cs-parser.jay: track the variable block, as we need to initalize
9762 any captured variables declared in this block for the "catch"
9763 portion of the "Try" statement.
9765 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9766 scope initialization for captured variables.
9768 Also, move the emit for the variables after the block location has
9771 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9773 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9775 2006-02-02 Miguel de Icaza <miguel@novell.com>
9777 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9778 commit yesterday, the initialization for the roots is necessary.
9779 What is not necessary is the scope activation.
9781 2006-02-02 Raja R Harinath <rharinath@novell.com>
9783 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9784 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9786 (Argument.Resolve): Remove CS0206 checks.
9788 2006-02-01 Miguel de Icaza <miguel@novell.com>
9790 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9791 scopes for all the roots, the scopes will now be emitted when the
9792 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9794 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9795 code. This reduces a lot of existing cruft.
9797 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9798 that the ScopeInfo is generated as we enter the scope, not at the
9799 time of use, which is what we used to do before.
9801 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9802 every time a Block is about to be emitted if we have a
9805 2006-02-01 Raja R Harinath <rharinath@novell.com>
9807 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9809 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9811 * typemanager.cs (cons_param_array_attribute): Make private.
9812 (Reset): Set it to null.
9813 (InitCoreHelpers): Don't initialize it.
9814 (ConsParamArrayAttribute): New. Initialize it as needed.
9815 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9817 2006-01-31 Miguel de Icaza <miguel@novell.com>
9819 * expression.cs: There might be errors reported during the
9820 selection of applicable methods. If there are errors, do not
9821 continue execution as it will lead the compiler to crash.
9823 2006-01-30 Miguel de Icaza <miguel@novell.com>
9825 * expression.cs: Member access is not allowed on anonymous
9826 methods. Fixes #77402.
9828 2006-01-30 Raja R Harinath <rharinath@novell.com>
9831 * cs-parser.jay (VariableDeclaration): Don't set
9832 current_array_type to null.
9833 (field_declaration, event_declaration, declaration_statement):
9834 Set it to null here.
9836 2006-01-28 Raja R Harinath <harinath@gmail.com>
9838 * typemanager.cs (GenericParameterPosition): New.
9841 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9843 * doc.cs : To process "include" elements, first we should create
9844 another list than XmlNodeList, because it could result in node
9845 removal, which could result in that the XmlNodeList gives up
9848 (Also made code identical to gmcs again.)
9850 2006-01-25 Miguel de Icaza <miguel@novell.com>
9852 * ecore.cs: Introduce an error report that we were not catching
9853 before, if not silent, we must report the error. Gonzalo ran into
9856 2006-01-23 Miguel de Icaza <miguel@novell.com>
9858 A fix for bug: #76957
9860 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9861 ComputeMethodHost before creating the method, this is a new
9864 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9865 that this method references (RegisterScope). The actual scope
9866 where the method is hosted is computed with the ComputeMethodHost
9867 before we create the method.
9869 Moved the Deepest routine here.
9871 (AnonymousContainer.ComputeMethodHost): New routine used to
9872 compute the proper ScopeInfo that will host the anonymous method.
9874 (ScopeInfo): Deal with multiple roots. The problem was that we
9875 did not have a unique root where all ScopeInfos could be hanged
9876 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9879 Remove AdjustMethodScope which is now computed at the end. Remove
9880 LinkScope which did a partial link, instead link all ScopeInfos
9881 before code generation from the new "LinkScopes" routine.
9883 Simplify all the Add* routines as they no longer need to maintain
9884 the tree, they just need to record that they are using variables
9887 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9888 routines to produce the forest of ScopeInfo trees.
9890 * class.cs (TypeContainer.AppendMethod): This is just like
9891 AddMethod, but ensures that an interface implementation method
9892 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9893 methods, but at the end.
9895 We use this functionality to ensure that the generated MoveNext
9896 method in the iterator class is resolved/emitted before the
9897 enumerator methods created.
9899 This is required because the MoveNext method computes the right
9900 ScopeInfo for the method. And the other methods will eventually
9901 need to resolve and fetch information computed from the anonymous
9904 2006-01-21 Raja R Harinath <harinath@gmail.com>
9905 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9908 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9910 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9911 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9913 2006-01-18 Raja R Harinath <rharinath@novell.com>
9915 Fix #76656, cs0231-2.cs.
9916 * cs-parser.jay (formal_parameter_list): Make error case catch
9918 (parenthesized_expression_0): Add CS1026 check.
9919 (invocation_expression): Remove unused { $$ = lexer.Location }.
9921 2006-01-17 Raja R Harinath <rharinath@novell.com>
9924 * cs-parser.jay (statement_expression): Don't list out the
9925 individual statement-expressions. Convert syntax error into
9928 2006-01-16 Raja R Harinath <rharinath@novell.com>
9931 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9932 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9933 CheckIntermediateModification.
9934 (FieldExpr.DoResolve): Add new two-argument version that
9935 allows us to resolve the InstanceExpression as an lvalue.
9936 The one-argument variant is now just a wrapper.
9937 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9938 Resolve the lhs as an lvalue if the it has a value type.
9939 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9940 from Assign.DoResolve.
9941 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9942 resolved as an lvalue.
9943 (PropertyExpr.DoResolve): Update.
9944 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9945 has a value type. Move CS1612 check here from
9946 CheckIntermediateModification.
9947 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9948 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9949 'right_side' of a ResolveLValue on an 'out' argument.
9950 (EmptyExpression.LValueMemberAccess): New. Used as the
9951 'right_side' of a propagated ResolveLValue on a value type.
9952 (LocalVariableReference.DoResolveBase): Recognize
9953 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9955 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9956 EmptyExpression.Null.
9958 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9960 * typemanager.cs : added IsGenericParameter(). In mcs it always
9962 * doc.cs : for generic parameters, use GenericParameterPosition,
9965 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9967 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9969 2006-01-12 Miguel de Icaza <miguel@novell.com>
9971 This fixes the problem where we used ldfld instead of ldflda to
9972 load the "THIS" pointer on captured parameters, when THIS is a
9973 value type. See bug #77205.
9975 * iterators.cs (CapturedThisReference.Emit): Pass false to
9976 EmitThis (we do not need the address).
9978 * codegen.cs (EmitThis): it needs to know whether we need the
9979 address of `this' or not. This is used by value types.
9981 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9982 every other call passes false.
9984 2006-01-12 Raja R Harinath <rharinath@novell.com>
9987 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9989 * expression.cs (Invocation.OverloadResolve): Update.
9990 (Invocation.DoResolve): Avoid double resolution of invocation.
9992 2006-01-11 Raja R Harinath <rharinath@novell.com>
9995 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9996 unary negation of floating point types as 0-expr; negation cannot
9997 overflow in floating point types.
10000 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10001 on operands of 'void' type.
10004 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10005 and ExclusiveOr for boolean constants too.
10007 2006-01-09 Raja R Harinath <rharinath@novell.com>
10010 * expression.cs (Invocation.OverloadResolve): Replace reflected
10011 override methods with their base virtual methods, rather than
10012 skipping over them.
10013 * typemanager.cs (TypeManager.GetOverride): New.
10015 2006-01-05 Jb Evain <jbevain@gmail.com>
10017 * class.cs (Property.Define, Indexer.Define): do not tag the
10018 properties as SpecialName | RTSpecialName.
10020 2006-01-04 Miguel de Icaza <miguel@novell.com>
10022 * class.cs (MethodCore.IsDuplicateImplementation): This method was
10023 doing a low-level comparission of parameter types. It was lacking
10024 a check for __argslist.
10026 2005-12-30 Miguel de Icaza <miguel@novell.com>
10028 * expression.cs (ParameterReference.DoResolveBase): Allow
10029 reference parameters if they are local to this block.
10031 This allows the ref and out parameters of a delegate to be used in
10032 an anonymous method, for example:
10034 delegate void set (out int x);
10036 set s = delegate (out int x){
10040 This is used by functionality introduced late in the C# language.
10042 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10043 method that take ref and out parameters.
10045 Fixes #77119 which was a late change in the spec.
10047 2005-12-23 Miguel de Icaza <miguel@novell.com>
10049 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10050 parent if its the same scope. Fixes #77060.
10052 2005-12-21 Miguel de Icaza <miguel@novell.com>
10054 * driver.cs: Report the case of no source files and no -out:
10057 2005-12-20 Raja R Harinath <rharinath@novell.com>
10060 * expression.cs (ComposedCast.GetSignatureForError): Define.
10062 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10066 * namespace.cs (NamespaceEntry): Add extern_aliases as a
10067 ListDictionary, to contain the ExternAliasEntry entries (in
10068 addition to the NamespaceEntry.aliases hashtable). This field is
10069 shared between the original entry and its doppelganger (bodyless
10071 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10072 extern_aliases field.
10073 (NamespaceEntry.Lookup): Move the IsImplicit check after the
10074 lookup in extern_aliases.
10076 2005-12-16 Raja R Harinath <rharinath@novell.com>
10079 * class.cs (TypeContainer.Mark_HasEquals): New.
10080 (TypeContainer.Mark_HasGetHashCode): New.
10081 (ClassPart): Override them.
10082 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10085 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10086 'parent' argument to the base constructor.
10088 Remove all mention of TypeContainer from decl.cs.
10089 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10090 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10091 (DeclSpace.DeclSpace): Likewise.
10092 (DeclSpace.DefineMembers): Remove unused argument.
10093 * cs-parser.jay (pop_current_class): Update to changes. Simplify
10094 debugging check -- we don't care if the debug code throws an
10095 InvalidCastException instead of an InternalErrorException.
10096 * class.cs (TypeContainer.DefineMembers): Update to changes.
10097 (TypeContainer.DoDefineMembers): Likewise.
10098 (TypeContainer.GetMethods): Likewise.
10099 (PropertyMember.Define): Likewise.
10100 (MemberBase.Parent): New property that forwards to
10101 MemberCore.Parent, but ensures that we get a TypeContainer.
10102 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10103 (RootContext.PopulateTypes): Likewise. Remove special case code
10104 for !RootContext.StdLib: DefineMembers is idempotent.
10106 2005-12-14 Miguel de Icaza <miguel@novell.com>
10108 * convert.cs (ExplicitConversionCore): Check the return value from
10109 ExplicitConversionCore which can return null on failure. Fixes #76914
10111 2005-12-13 Marek Safar <marek.safar@seznam.cz>
10113 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10115 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
10117 * doc.cs : The search for referenced namespace was insufficient to
10118 get global one as it used to do. Fixed bug #76965.
10120 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
10122 * doc.cs : check name in cref in the last phase that whether it is
10125 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10127 * cs-tokenizer.cs : reverted the latest change: it somehow broke
10130 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10132 * doc.cs : so it turned out that we cannot skip override check for
10133 interface members. Fixed bug #76954.
10135 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10137 * cs-tokenizer.cs : fixed bug #75984:
10138 - #warning and #error should not be handled when the source line
10140 - #line is not checked strictly when the source line is disabled.
10141 - #define and #undef is on the other hand checked strictly at any
10144 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
10146 * cs-tokenizer.cs : missing Location (actually, filename) in one of
10149 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10151 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10153 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10154 event initializers.
10155 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10156 (FieldBase.Initializer): Initializer is now optional.
10157 (EventField.Define): Only event field can have initializer.
10159 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10161 * const.cs (Const): Reuse initializer.
10163 * cs-parser.jay: Updated after FieldBase changes.
10164 Added current_array_type to simplify array initializers.
10166 * ecore.cs (NullCast.IsDefaultValue): Implemented.
10168 * expression.cs, iterators.cs: Updated.
10170 * namespace.cs (NamespaceEntry): Made UsingFound private.
10172 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10174 * parameterCollection.cs: Obsolete, removed.
10175 * parser.cs: Obsolete, removed.
10177 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10180 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10182 * enum.cs (Enum.Define): Set obsolete context here.
10184 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10187 - FindDocumentedMember() now expects 1) paramList as null
10188 when "we don't have to check the number of parameters" and
10189 2) Type.EmptyTypes when "there is no arguments".
10190 - Introduced FoundMember struct to hold the exact type which was
10191 used to find the documented member (the above change broke
10192 test-xml-044; it might be better just to use DeclaringType than
10193 what MS does, like this change does, but it depends on usage.)
10195 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10197 * doc.cs : documented member might be from DeclaringType for nested
10198 types. Fixed bug #76782.
10200 2005-12-03 Ben Maurer <bmaurer@ximian.com>
10202 * anonymous.cs: Have the param code handle leaving copies on the
10203 stack etc. Allows anonymous params to take part in the assignment
10204 code (++, +=, etc). Fixes bug #76550
10206 * expression.cs: Handle the prepare_for_load/leave_copy by passing
10207 it down to the anon code.
10209 * iterators.cs: Use dummy var here
10211 * codegen.cs: Handle new vars
10213 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10216 * class.cs (MethodData.Define): Set proper Obsolete context.
10218 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10220 (FieldExpr.DoResolve): Ditto.
10222 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10225 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10226 parent is not obsolete.
10228 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
10230 * doc.cs : (FindDocumentedMember) find parameterless members first
10231 and get CS0419 in the early stage. Fixed first case of bug #76727.
10233 2005-11-30 Marek Safar <marek.safar@seznam.cz>
10236 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10237 no error was reported.
10239 *expression.cs (Binary.DoResolve): left can be null.
10241 2005-11-22 Marek Safar <marek.safar@seznam.cz>
10244 * class.cs (MethodData.Emit): Parameters should be labeled first.
10246 2005-11-21 Marek Safar <marek.safar@seznam.cz>
10249 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10251 2005-11-18 Marek Safar <marek.safar@seznam.cz>
10253 * attribute.cs (AreParametersCompliant): Moved to Parameter.
10255 * class.cs (MethodCore): Parameter clean up.
10256 (IMethodData): Added ParameterInfo.
10257 (MethodData): Parameter clean up.
10258 (Indexer.Define): Parameter clean up.
10270 * typemanager.cs: Parameter clean up.
10272 * delegate.cs (Define): Get rid of duplicated code.
10274 * expression.cs (ParameterReference): Removed useless parameters
10276 (Invocation): Ditto.
10278 * parameter.cs (ParamsParameter): New class, params specialization.
10279 (ArglistParameter): Attemp to separate arglist.
10280 (Parameter): Refactored to be reusable and faster.
10281 (Parameter.Modifier): Made understandable.
10282 (Parameters): Changed to be used as a class for `this' assembly
10283 parameters. Refactored to use new specialized classes.
10285 * support.cs (ParameterData): Added Types property.
10286 (InternalParameters): Deleted.
10288 2005-08-20 Martin Baulig <martin@ximian.com>
10290 Merging this patch from GMCS to fix #75867.
10292 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10293 scope if we don't already have it.
10295 2005-11-17 Martin Baulig <martin@ximian.com>
10298 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10299 inherit the scope from our parent. Fixes #76653.
10301 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10303 * doc.cs : the previous patch does not actually fix the bug.
10304 PropertyInfo override check is now implemented and really fixed it.
10305 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10307 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10309 * doc.cs : apply "override filter" also to properties.
10312 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10314 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10315 no need to check overrides. For classes, omit those results from
10316 interfaces since they must exist in the class. Fixed bug #76726.
10318 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10320 * typemanager.cs : (GetFullNameSignature) differentiate indexers
10321 with different parameters. Fixed the second problem in #76685.
10323 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10325 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10326 get expected 'protected' access in CheckValidFamilyAccess()).
10329 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10331 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10332 Fixed bug #76705. CS1569 was incorrectly commented out.
10334 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10336 * doc.cs : use Invocation.IsOverride() to do real override check.
10337 * expression.cs : made Invocation.IsOverride() internal.
10339 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10341 * doc.cs : use TypeManager.FindMembers() instead of (possible)
10342 TypeBuilder.FindMembers() and filter overriden base members out.
10345 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10347 * doc.cs : ref/out parameters are represented as '@' (instead of
10348 '&' in type FullName). Fixed bug #76630 (additionally crefs).
10350 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10352 * doc.cs : when there was no '.' in cref to methods in doc comment,
10353 then parameters were missing in the output. Fixed bug #76691.
10355 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10357 * driver.cs : don't output docs when there is an error.
10360 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10363 Now it should detect indexers. Fixed primary concern in bug #76685.
10364 Fixed CS0419 message to not show the identical member signature in
10367 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10369 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10370 instead of Type.FindMembers() since it does not handle events.
10373 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
10375 * codegen.cs: Fixed typo (speficied -> specified).
10377 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10380 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10382 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10384 * attribute.cs: Changed error message.
10386 * cs-tokenizer.cs: One more check.
10388 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10390 * statement.cs (Block.Resolve): Ignore empty statement.
10392 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10394 * report.cs: Made error/warning methods more strict to avoid
10397 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10398 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10399 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10400 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10402 2005-11-08 Marek Safar <marek.safar@seznam.cz>
10404 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10405 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10407 * class.cs (TypeContainer.IsComImport): New property.
10408 (Constructor.Define): Create proper ctor for ComImport types.
10410 * expression.cs (New.CheckComImport): Fixed.
10412 2005-11-07 Miguel de Icaza <miguel@novell.com>
10414 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10415 that a parameter has been captured does not mean that we do not
10416 have to do the rest of the processing. This fixes the second part
10417 of #76592. If there was another anonymous method capturing
10418 values in the past, the Scope would never be set for the second
10419 method that captured the same parameter.
10421 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10422 properly manipulate the stack. Second part of fix for #76592.
10424 * expression.cs (New): Add support for invoking "new" on
10425 interfaces that have been flagged with the ComImport attribute and
10426 the CoClass. Fixes #76637
10428 * statement.cs (Try.DoEmit): When a variable is captured, do not
10429 try to emit the vi.LocalBuilder variable as it has been captured.
10430 Create a temporary variable and store the results on the
10431 FieldBuilder. Fixes #76642
10433 2005-11-07 Marek Safar <marek.safar@seznam.cz>
10435 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10437 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10439 * expression.cs (Binary.DoResolve): Added && optimalization.
10441 * typemanager.cs (AddUserType): Removed useless argument.
10443 2005-11-04 Marek Safar <marek.safar@seznam.cz>
10445 * statement.cs (Block.variables): Uses ListDictionary.
10447 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10450 * class.cs (PartialContainer.EmitType): Customized to emit
10451 security attributes.
10452 (ClassPart.ApplyAttributeBuilder): Transform security attribute
10453 for partial classes.
10455 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10458 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10459 access has to be fixed.
10461 * typemanager.cs (IsUnmanagedType): Wrong common field type.
10463 2005-11-01 Marek Safar <marek.safar@seznam.cz>
10466 * ecore.cs (NullCast.Reduce): Implemented.
10468 * expression.cs (ArrayCreation.CheckIndices): Correcly check
10471 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10473 (Foreach.Resolve): Catch null properly.
10475 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10477 * cs-tokenizer.cs: Warning text fix.
10479 * driver.cs: AllWarningNumbers exposed on public interface.
10481 * report.cs (): Reviewed warning numbers.
10482 (IsValidWarning): Use binary search.
10484 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10486 * driver.cs: Implemeted resource visibility.
10487 (Resources): New class for code sharing between /res: and
10490 2005-10-28 Marek Safar <marek.safar@seznam.cz>
10493 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10496 * convert (Convert.ImplicitReferenceConversion): NullCast holds
10499 * ecore.cs (NullCast): Child is contant only.
10501 * literal.cs (NullLiteral.Reduce): null can be converted to any
10504 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
10506 * driver.cs: Use Encoding.Default as default code page instead
10509 2005-10-27 Raja R Harinath <rharinath@novell.com>
10512 * expression.cs (Invocation.Error_InvalidArguments): Handle
10513 __arglist parameters.
10514 (Invocation.VerifyArgumentsCompat): Likewise.
10515 * support.cs (ReflectionParameters.GetSignatureForError): Print
10516 __arglist parameters.
10517 (InternalParamters.GetSignatureForError): Likewise.
10518 * parameter.cs (Parameters.GetSignatureForError): Likewise.
10520 2005-10-26 Marek Safar <marek.safar@seznam.cz>
10522 * attribute.cs (GetPropertyValue): Made public.
10524 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10526 Add new property WrapNonExceptionThrows to handle 2.0 assembly
10528 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10531 * driver.cs: Reflect method name change.
10533 * statement.cs (Try.Resolve): Warn when try has both general
10534 exception handlers.
10536 * typemanager.cs: runtime_compatibility_attr_type new predefined
10539 2005-10-26 Raja R Harinath <harinath@gmail.com>
10542 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10543 treat it as an empty parameter list.
10545 2005-10-26 Raja R Harinath <rharinath@novell.com>
10548 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
10549 ResolveAsTypeStep silent.
10550 * statement.cs (Block.AddConstant): Mark block as used.
10551 (Block.ResolveMeta): Avoid piling on error messages
10552 if a constant initializer resolution fails.
10554 2005-10-25 Raja R Harinath <rharinath@novell.com>
10556 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10558 (NamespaceEntry.VerifyAllUsing): New.
10559 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
10560 behaviour. Delegates actual resolution of alias to ...
10561 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
10562 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10564 * driver.cs (Driver.MainDriver): Update.
10566 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10567 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10569 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10571 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10572 RootNamespace.DefineNamespacesForAll.
10574 2005-10-24 Raja R Harinath <harinath@gmail.com>
10576 * typemanager.cs (assemblies, external_aliases, modules)
10577 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10578 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10579 overhead. Move resposibility ...
10580 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10581 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10583 2005-10-23 Raja R Harinath <harinath@gmail.com>
10585 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10586 cached_namespaces. Improve usage.
10587 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10588 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10589 Move from GlobalRootNamespace and simplify.
10590 (RootNamespace.Global): Make instance variable.
10591 (RootNamespace.RootNamespace): Add "alias name" parameter.
10592 (GlobalRootNamespace): Simplify drastically.
10593 (Namespace.Lookup): Don't use GetNamespace.
10594 * typemanager.cs (GetRootNamespace): Rename from
10595 ComputeNamespaceForAlias.
10596 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10598 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10600 * anonymous.cs (AnonymousContainer): Don't crash when container
10603 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10605 * expression.cs (Binary.DoResolve): Warn when comparing same
10608 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10611 * expression.cs (Binary.DoResolve): It looks like there are no
10612 convetsion rules in enum context.
10614 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10616 Add support for extern alias qualifiers.
10617 * typemanager.cs: Move some LookupTypeReflection code
10618 to namespace.cs, to have cleaner code. Added some methods
10619 to help us keep track of the extern aliased references.
10620 * driver.cs: Add suport for extern alias assemblies on command
10621 line and check for their warnings/errors. Also keep track of the
10622 extern aliased assemblies.
10623 * namespace.cs: Move the global functionality of Namespace
10624 to GlobalRootNamespace/RootNamespace. Now the global namespace
10625 is GlobalRootNamespace.Globa. Also the code moved from
10626 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10627 Finally added LocalAliasEntry (AliasEntry before) and
10628 ExternAliasEntry, to handle alias statements.
10629 * cs-parser.jay: Add support in the grammar for extern alias
10631 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10632 Update callings to Namespace (now in GlobalRootNamespace).
10634 2005-10-18 Raja R Harinath <rharinath@novell.com>
10637 * class.cs (TypeContainer.DefineType): Move updating of
10638 topological sort earlier in the code.
10639 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10641 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10644 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10646 * constant.cs (Constant.TryReduce): Moved from Cast class.
10647 (Reduce): Made little bit more OO and fixed missing conversions.
10649 * ecore.cs (Reduce): Implemented.
10650 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10652 * literal.cs (Reduce): Implemented.
10654 * class.cs: Reverted Miguel's wrong commit.
10656 2005-10-14 Miguel de Icaza <miguel@novell.com>
10658 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10660 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10662 * cs-parser.jay, expression.cs : CS0214 was missing error location
10663 for constants. Fixed bug #76404.
10665 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10668 * convert.cs (ExplicitConversionCore): Fixed object->enum
10671 2005-10-10 Raja R Harinath <rharinath@novell.com>
10673 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10674 InstanceExpression.
10675 (PropertyExpr.EmitCall): Likewise.
10676 * expression.cs (Invocation.EmitArguments): Handle case where
10678 (Invocation.EmitCall): Avoid allocating temporary variable if
10679 there are no arguments.
10681 2005-10-07 Raja R Harinath <rharinath@novell.com>
10684 * convert.cs (ImplicitConversionStandard): Move conversion of
10685 void* to arbitrary pointer types ...
10686 (ExplicitConversionStandard): .. here.
10687 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10688 error to always print typenames.
10690 2005-10-07 Raja R Harinath <rharinath@novell.com>
10692 * convert.cs (GetConversionOperator): Rename from
10693 GetConversionOperators. Move operator selection code from ...
10694 (UserDefinedConversion): ... here.
10696 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10698 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10701 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10703 * assign.cs (Assign.DoResolve): Error method changed.
10705 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10707 * const.cs (ResolveValue): Reset in_transit immediately.
10709 * constant.cs: Error method changed.
10711 * convert.cs: Removed useless location parameter.
10712 (ExplicitNumericConversion): Don't do double enum check.
10713 (ExplicitConversionCore): Renamed from ExplicitConversion.
10714 (ExplicitUnsafe): Extracted from ExplicitConversion.
10715 (ExplicitConversion): Uses for error reporting.
10717 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10719 (ResolveBoolean): Uses common error method.
10720 (CastToDecimal): Get rid of ec.
10721 (CastFromDecimal): Optimized.
10722 (ConvCast): Get rid of ec.
10724 * enum.cs (ResolveValue): Reset in_transit immediately.
10725 (Emit): Return after first error.
10727 * expression.cs: Convert changes.
10729 * literal.cs: Error method changed.
10731 * statement.cs: Error method changed.
10733 2005-10-03 Raja R Harinath <rharinath@novell.com>
10735 * support.cs (SeekableStreamReader.Position): Don't error out when
10736 the requested position is just beyond the end of the current
10739 2005-09-28 Raja R Harinath <rharinath@novell.com>
10741 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10742 try to keep in sync with the byte count of the underlying Stream.
10743 However, this limits us to a window size of 2048 characters: i.e.,
10744 the maximum lookahead of our lexer/parser can be 2048 characters.
10746 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10749 * driver.cs: Fix compilation files with full root path.
10751 2005-09-25 Miguel de Icaza <miguel@novell.com>
10753 * report.cs (SymbolRelatedToPreviousError): Format the output so
10754 it does not use an open parenthesis that is never closed.
10756 * driver.cs: Follow coding guidelines
10758 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10761 * const.cs (Const.ResolveValue): Check for assigning non-null
10762 value to reference type.
10764 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10766 * anonymous.cs: Implemented ExprClassName.
10768 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10771 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10774 * class.cs (StaticClass.DefineContainerMembers): Report protected
10777 * codegen.cs: if(ed) PRODUCTION.
10779 * convert.cs (Error_CannotImplicitConversion): Better error
10782 * cs-parser.jay: More error checks.
10784 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10786 * driver.cs (CSCParseOption): Enabled wrong option check.
10788 * ecore.cs (Expression.ExprClassName): Turned to property.
10789 (MemberExpr.CheckIntermediateModification): For checking boxed
10790 value types modification.
10792 * statement.cs (Fixed.Resolve): Expression type must be
10793 convertible to fixed type.
10794 (CollectionForeach.GetEnumeratorFilter,TryType):
10795 Small refactoring for easier error checking.
10797 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10799 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10802 * class.cs (GeneratedBaseInitializer): New class for customization
10803 compiler generated initializers.
10804 (MemberBase.DoDefine): Check Obsolete attribute here.
10805 (FieldMember.DoDefine): Ditto.
10807 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10810 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10811 (MemberCore.GetObsoleteAttribute): Removed argument.
10812 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10813 (MemberCore.CheckObsoleteType): New helper.
10817 * statement.cs: Updates after MemberCore changes.
10819 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10820 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10822 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10823 obsolete attribute for compiler construct.
10824 (As.DoResolve): Cache result.
10826 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10828 2005-09-26 Raja R Harinath <rharinath@novell.com>
10831 * expression.cs (This.VerifyFixed): In a value type T, the type of
10832 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10833 value type R, 'this' is treated as a value parameter.
10835 2005-09-22 Miguel de Icaza <miguel@novell.com>
10837 * statement.cs (Lock): Use the TemporaryVariable class instead of
10838 manually using local variables as those do not work when variables
10841 * ecore.cs: Moved the TemporaryVariable class from being a nested
10842 class inside Foreach to be a public class that can be employed in
10845 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10847 * cs-parser.jay: interface_accessors replaced by
10848 accessor_declarations.
10850 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10853 * statement.cs (GotoCase.Resolve): Convert null constant to
10855 (SwitchLabel.ResolveAndReduce): Ditto.
10856 (SwitchLabel.NullStringCase): Custom null stamp.
10857 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10859 typemanager.cs (CSharpSignature): Don't skip first argument
10862 2005-09-18 Miguel de Icaza <miguel@novell.com>
10864 * driver.cs: Set InEmacs based on the environment variable EMACS.
10866 * location.cs (InEmacs): in this mode, do not report column
10867 location as it confuses Emacs.
10869 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10871 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10872 expression.cs, iterators.cs, literal.cs: Store constants and
10875 * class.cs (MemberBase.ShortName): Pass location.
10877 * cs-parser.jay: Some location fixes.
10879 * ecore.cs (Expression.Location): Made virtual.
10881 2005-09-05 Miguel de Icaza <miguel@novell.com>
10883 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10884 if the underlying types are the same, otherwise we need to produce
10885 code that will do the proper cast.
10887 This was exposed by Marek's constant rewrite which produced
10888 invalid code for the call site:
10890 enum X : long { a }
10891 void Method (X v) {}
10895 This fixes test-49.cs
10897 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10899 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10900 Type/Object should be allowed as well. Fixed bug #75968.
10902 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10904 * expression.cs : (Binary.DoResolve): when one is enum constant and
10905 another is constant 0, then return enum one *as enum type*.
10908 2005-09-02 Raja R Harinath <rharinath@novell.com>
10910 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10914 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10915 flow-branching for LocalVariableReferences in case we were invoked
10916 from a MemberAccess.
10917 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10919 (LocalVariableReference.DoResolveBase): ... this.
10920 (MemberAccess.Resolve): Do the check that was disabled during
10923 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10926 (PartialContainer.Create): check abstract/sealed/static strictly
10927 but abstract/sealed can exist only at one side. Fixed bug #75883.
10929 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10932 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10933 specified, don't default to UnmanagedType.I4.
10935 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10937 * expression.cs : conditional operator should check possibly
10938 incorrect assign expression. Fixed bug #75946.
10940 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10942 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10943 Reverting the change. gmcs is much complex than mcs on this matter.
10945 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10947 * cs-tokenizer.cs : To read another token ahead of the actual
10948 consumption, use new SavedToken and cache token instead of moving
10949 back the stream with SeekableStreamReader (it seemed problematic).
10951 driver.cs : Thus use StreamReader directly.
10952 * support.cs : Thus removed SeekableStreamReader.
10954 2005-08-30 Raja R Harinath <rharinath@novell.com>
10957 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10958 (ScopeInfo.EmitScopeType): Use it to construct field names from
10959 names of captured locals.
10962 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10963 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10964 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10965 (ExplicitConversion): Remove enum cases already handled by
10966 implicit conversion. Move implicit conversion check to the beginning.
10967 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10968 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10969 Don't treat System.Enum as a struct.
10971 2005-08-30 Jb Evain <jbevain@gmail.com>
10973 * attribute.cs: handles as expression in parameters.
10975 2005-08-30 Raja R Harinath <rharinath@novell.com>
10978 * class.cs (TypeContainer.VerifyClsName): Don't use a
10979 PartialContainer when verifying CLS compliance.
10980 (AbstractPropertyEventMethod): Set Parent here, ...
10981 (PropertyMethod): ... not here.
10983 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10985 * attribute.cs : escaped attribute name should not be allowed to be
10986 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10988 2005-08-29 Raja R Harinath <rharinath@novell.com>
10991 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10992 when converting a long constant to unsigned long.
10993 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10994 detect where IsApplicable and VerifyArgumentsCompat disagree.
10996 2005-08-29 Raja R Harinath <rharinath@novell.com>
10997 and Carlos Alberto Cortez <carlos@unixmexico.org>
11000 * class.cs (TypeContainer.CanElideInitializer): New helper.
11001 (TypeContainer.EmitFieldInitializers): Use it to determine if we
11002 can safely emitting the initializer of a field.
11004 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11006 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11007 allowed inside a switch (without loop). Fixed bug #75433.
11009 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
11011 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11012 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11014 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11016 * driver.cs : kinda reverting the default encoding changes (not exact
11017 revert since I noticed that "codepage:reset" might not work fine).
11019 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11021 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11022 Location. Now getter and setter store location correctly.
11023 (errors/cs0111-12.cs now reports the expected location.)
11025 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11027 * driver.cs : Use default encoding on the environment.
11028 Removed (now that) extra parameter for SeekableStreamReader.
11029 * support.cs : (SeekableStreamReader) third .ctor() argument for
11030 StreamReader is not required (always true). preamble size could
11031 be acquired in simpler and safe way.
11033 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
11035 * cs-parser.jay: report CS0642 at warning level 3
11036 and report CS0642 for an if else statement also
11037 fixes bug #74745. Patch by John Luke (and a bit
11039 Removed extra CS0642 warning check for "while",
11041 * statement.cs: In Block.Resolve(), CS0642 check
11042 is reimplemented to check a sequence of an empty
11043 statement and a block.
11045 Both fix bug #66777.
11047 2005-08-24 Marek Safar <marek.safar@seznam.cz>
11049 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11050 detection until I fix it.
11052 * cs-tokenizer.cs: Changed error message.
11054 * cs-parser.jay: Fixed 2 error locations.
11056 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11057 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11060 * enum.cs (GetSignatureForError): Fixed.
11062 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11066 * typemanager.cs (RegisterProperty): Removed.
11068 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11070 2005-08-24 Raja R Harinath <rharinath@novell.com>
11073 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11074 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11076 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11078 * expression.cs : tiny fix is required for not warning positive ulong.
11081 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11083 * expression.cs : add CS0652 check for constant and integral
11084 expression. Fixed bug #53974.
11086 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11088 * expression.cs : in DoNumericPromotions(), check if there is implicit
11089 conversion overload for string (to check CS0034). Fixed bug #52492.
11091 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11093 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11095 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11097 * ecore.cs : report location when it is *not* Null.
11099 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11105 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11106 correctly. Fixed bug #75721.
11108 2005-08-23 Raja R Harinath <rharinath@novell.com>
11110 * support.cs (SeekableStreamReader.Position): Avoid an expensive
11111 loop that performs 'min (pos, char_count)'.
11114 * expression.cs (Unary.ResolveOperator): Don't discard implicit
11115 converted value in Operator.OnesComplement.
11117 2005-08-22 Ben Maurer <bmaurer@ximian.com>
11119 * anonymous.cs: If the anon method is pulled into a helper class,
11120 it needs to be `internal' not `private'. Fixes runtime behavior on
11123 2005-08-20 Martin Baulig <martin@ximian.com>
11125 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11126 scope if we don't already have it.
11128 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11129 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11132 2005-08-17 Marek Safar <marek.safar@seznam.cz>
11135 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11136 is a partial class.
11138 2005-08-16 Marek Safar <marek.safar@seznam.cz>
11140 The big constants rewrite
11141 Fix #75746, #75685 and more
11142 As a side effect saved 1MB for MWF ;-)
11144 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11145 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11146 enum based for corlib compilation.
11148 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11151 * class.cs (FixedField.Define): Use ResolveAsConstant.
11153 * const.cs (IConstant): Interface constants and enums.
11154 (Const.ResolveValue): New method for constant resolvning.
11155 (ExternalConstant): Constants from imported assemblies.
11157 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11158 conversion; like enums.
11159 (Constant.ToType): Converts this constant to different type.
11160 (Constant.Increment): Adds 1.
11162 * convert.cs (ImplicitConversionRequired): Simplified.
11164 * cs-parser.jay: Create EnumMember directly.
11166 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11168 * doc.cs (GenerateEnumDocComment): Removed.
11170 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11171 (ConvertIntLiteral): Removed.
11172 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11174 * enum.cs (EnumMember): Implement IConstant.
11175 (Enum.IsValidEnumConstant): Removed.
11176 (Enum.GetNextDefaultValue): Removed.
11177 (Enum.FindMembers): Updated.
11178 (Enum.GenerateDocComment): Iterate enum members.
11180 * expression.cs (Cast.TryReduce): Handle enums correctly.
11181 (New.Constantify): Made public.
11182 (MemberAccess.DoResolve): Removed contant specific if(s).
11184 * literal.cs (NullLiteral): Implement new abstract methods.
11186 * statement.cs (GotoCase.Resolve): Use new constant methods.
11187 (SwitchLabel.ResolveAndReduce): Use new constant methods.
11189 * typemanager.cs (LookupEnum): Removed.
11190 (IsEnumType): Fixed to work with corlib.
11191 (RegisterConstant): Removed.
11192 (LookupConstant): Removed.
11193 (GetConstant): Changed to work with IConstant.
11195 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
11197 * location.cs : Fixed overflown (>255) column number.
11199 2005-08-03 Raja R Harinath <rharinath@novell.com>
11201 First cut of the qualified-alias-member feature.
11202 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11204 * cs-parser.jay (DOUBLE_COLON): New token.
11205 (namespace_or_type_name): Add rule for recognizing
11206 qualified-alias-members.
11207 (primary_expression): Likewise.
11208 (element_access): Allow QualifiedAliasMember as a possible
11209 type-bearing expression.
11210 (local_variable_type, local_variable_pointer_type): Likewise.
11211 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
11212 aliases in the current and enclosing namespace declarations.
11213 (NamespaceEntry.UsingAlias): Add CS0440 warning.
11214 * decl.cs (MemberName.is_double_colon): New.
11215 (MemberName.MemberName): Add new constructor for alias-member.
11216 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11217 * expression.cs (QualifiedAliasMember): New expression type.
11219 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11221 * location.cs : it borked when no argument was specified.
11223 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11225 * location.cs : tiny ToString() format fix.
11227 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11229 * statement.cs : oops, it was missing.
11231 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11233 A set of fixes for precise line/column location.
11236 "token" field now holds a file/line "delta", a line number offset
11237 from the segment, and a column number. See also:
11238 http://lists.ximian.com/pipermail/mono-devel-list/2004-
11239 December/009508.html
11240 Removed static IsNull. Use instance IsNull property instead.
11241 * cs-tokenizer.cs :
11242 For some tokens it stores Location. For Identifier it stores
11243 LocatedToken which is a pair of string name and location.
11244 Column numbers are adjusted only at getChar().
11246 Use Location.ToString() for reporting (it now contains column).
11248 Largely modified to use LocatedToken instead of
11249 string (IDENTIFIER), and to acquire Location from some tokens.
11250 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11251 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11253 Now MemberName holds Location. DeclSpace.ctor() receives Location
11254 as a parameter. Removed extra parameters to all derived classes.
11255 Replaced Location.IsNull() with instance property.
11256 * assign.cs, expression.cs :
11257 Added .ctor() overload that omits Location.
11259 Added "nameEscaped" flag that indicates the identifier was escaped
11260 in the source file. This fixes bug #57047.
11262 2005-08-02 Marek Safar <marek.safar@seznam.cz>
11264 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11265 New method, looking for lo-case imported cls type.
11267 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11270 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11272 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11274 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11275 all_imported_types.
11276 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11278 Optimized to save 3.5 MB for SWF compilation.
11280 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11282 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11283 (PartialContainer.Create): Moved logic AddToContainer.
11284 (PartialContainer.MarkForDuplicationCheck): Shares name.
11286 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11289 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11291 (Namespace.GetSignatureForError): New method.
11293 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11294 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11296 2005-08-01 Raja R Harinath <rharinath@novell.com>
11299 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11300 member lookup rather than qualifier_type, since qualifier_type can
11303 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11305 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11308 2005-07-31 Miguel de Icaza <miguel@novell.com>
11310 * statement.cs: Copy the local exception into the exception
11311 captured local. Fixes 75674
11313 2005-07-31 Raja R Harinath <harinath@gmail.com>
11316 * expression.cs (Invocation.OverloadResolve): Don't report error
11317 CS1501 if error CS1502 has been reported.
11318 (New.DoResolve): Delegate CS1501 reporting to
11319 Invocation.OverloadResolve.
11322 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11323 invariant-meaning-in-block property in an enclosing block if
11326 2005-07-29 Marek Safar <marek.safar@seznam.cz>
11328 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11329 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11330 (Switch.CheckSwitch): Just save 50kb for SWF.
11332 2005-07-27 Martin Baulig <martin@ximian.com>
11334 * anonymous.cs (CaptureContext.AddField): Added
11335 `AnonymousContainer am' argument; compute its toplevel scope if
11336 it's not already computed. Fixes #75649.
11338 2005-07-26 Raja R Harinath <rharinath@novell.com>
11341 * class.cs (Constructor.Emit): Reset block to null if the block
11344 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11346 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11348 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11350 * class.cs (MethodData.Define): Check whether accessor implementing
11351 interface is public.
11353 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11355 2005-07-22 Marek Safar <marek.safar@seznam.cz>
11358 * namespace.cs (LookupType): Moved same type check to...
11360 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11361 with the same name.
11363 2005-07-21 Raja R Harinath <rharinath@novell.com>
11365 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11366 already found a typebuilder.
11367 * class.cs (MethodCore.IsDuplicateImplementation): Compare
11368 MemberNames, not strings.
11370 * const.cs (Error_ExpressionMustBeConst):
11371 Rename from Error_EpressionMustBeConst.
11372 * const.cs, class.cs, statement.cd: Update.
11374 2005-07-21 Marek Safar <marek.safar@seznam.cz>
11378 * const.cs (Const.LookupConstantValue): Report missing contant expression
11380 (Error_EpressionMustBeConstant): Only one error method.
11382 * class.cs, statement.c: Updated.
11384 2005-07-20 Raja R Harinath <rharinath@novell.com>
11386 * statement.cs (Block.Flags): Add back HasVarargs.
11387 (Block.flags): Make protected.
11388 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11390 * typemanager.cs (types, typecontainers, user_types): Remove.
11391 (UserTypes, TypeContainers): Likewise.
11392 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11393 (CleanUp, Reset): Update.
11394 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
11395 (GetNestedType): Use Type.GetNestedType.
11396 (CoreLookupType): Take two arguments, the namespace and the
11397 basename of the type. Update to use the Namespace.Lookup
11399 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11400 (RealMemberLookup): Use IsNestedChildOf instead of playing with
11401 string concatenation and substring matches.
11402 * class.cs, enum.cs, delegate.cs: Update to changes.
11404 2005-07-20 Marek Safar <marek.safar@seznam.cz>
11406 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11407 Expression and made virtual.
11409 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11410 (ImplicitStandardConversionExists): Fixed `byte' typo ?
11412 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11414 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11417 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11420 2005-07-18 Marek Safar <marek.safar@seznam.cz>
11423 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11424 AssemblyCultureAttribute is not used on executable.
11427 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11429 2005-07-16 Raja R Harinath <rharinath@novell.com>
11432 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11433 New. Reports CS0252/CS0253.
11434 Mostly taken from preliminary patch by Duncak Mak.
11435 (Binary.DoResolveOperator): Store results of operator lookup.
11436 Use them to detect if we need to warn about unintended reference
11439 2005-07-15 Raja R Harinath <rharinath@novell.com>
11442 * namespace.cs (Namespace.Lookup): Add back location parameter.
11443 (Namespace.LookupType): Add CS0436 report. Add location parameter.
11444 * delegate.cs, ecore.cs, expression.cs: Update to changes.
11446 * codegen.cs (EmitContext.DeclSpace): Make readonly.
11447 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11448 (Namespace.LookupType): ... this.
11449 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11451 * typemanager.cs (LookupTypeReflection): Remove buggy code that
11452 purported to handle pointers.
11453 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11456 2005-07-15 Marek Safar <marek.safar@seznam.cz>
11458 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11461 2005-07-15 Raja R Harinath <rharinath@novell.com>
11463 * namespace.cs (Namespace.Lookup): Drop location parameter.
11464 (NamespaceEntry.LookupAlias): Remove. Merge into ...
11465 (NamespaceEntry.Lookup): ... this.
11466 (NamespaceEntry.Error_AmbiguousTypeReference):
11467 Move here from DeclSpace.
11468 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11470 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11471 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11472 Move to NamespaceEntry.
11473 * delegate.cs, expression.cs: Update to changes.
11475 2005-07-14 Marek Safar <marek.safar@seznam.cz>
11477 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11478 CheckAttributeType and refactored.
11479 (Attribute.ResolvePossibleAttributeType): Changed to reuse
11480 ResolveAsTypeTerminal error handling.
11481 (ResolveAsTypeTerminal): Introduced because of global attributes extra
11483 (GetSignatureForError): Print errors in same way.
11486 * codegen.cs: Reflect attribute GetSignatureForError change.
11489 * expression.cs: Add silent parameter to ResolveAsTypeStep.
11491 * namespace.cs (UsingEntry): Refactored to make fields private.
11494 statement.cs: Error_UnexpectedKind has extra parameter.
11496 2005-07-14 Raja R Harinath <rharinath@novell.com>
11498 * ecore.cs (IAlias): Remove.
11499 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
11500 that implement the interface.
11501 * namespace.cs (Namespace): Likewise.
11502 (Namespace.declspaces): Renamed from 'defined_names'.
11503 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
11504 DeclSpace instead of an IAlias.
11505 * tree.cs (Tree.AddDecl): Update.
11507 2005-07-12 Raja R Harinath <rharinath@novell.com>
11509 * statement.cs (Block.Flags); Remove HasVarargs.
11510 (Block.HasVarargs): Move to ToplevelBlock.
11511 (Block.ThisVariable, Block.AddThisVariable): Likewise.
11512 (Block.Variables): Make protected. Initialize variable hashtable
11514 (Block.AddVariable): Update.
11515 (Block.Resolve): Update to changes.
11516 (ToplevelBlock.HasVarargs): New boolean.
11517 (ToplevelBlock.ThisVariable): Move here from Block.
11518 (ToplevelBlock.AddThisVariable): Likewise.
11519 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
11520 * expression.cs (This.ResolveBase): Update to changes.
11521 (ArglistAccess.DoResolve): Likewise.
11523 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11526 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11528 * class.cs (TypeContainer.VerifyMembers): Distinguish between
11529 not used and not used & assigned.
11530 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11532 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11535 * expression.cs (Is.DoResolve): null is never provided type.
11537 2005-07-08 Marek Safar <marek.safar@seznam.cz>
11540 * cs-parser.jay: Less strict event error rule to catch more errors.
11542 2005-07-08 Martin Baulig <martin@ximian.com>
11544 Fix test-iter-10.cs - distinguish whether we `yield' in a property
11545 gettter (allowed) or setter (not allowed).
11547 * class.cs (Accessor): Implement IIteratorContainer.
11548 (Accessor.Yields): New public field.
11549 (PropertyBase.PropertyMethod.Define): Handle iterators on a
11550 per-accessor basis.
11553 (get_accessor_declaration, set_accessor_declaration): Set the
11554 `yields' flag on the accessor, not the property.
11555 (property_declaration): Do the iterators check on a per-accessor
11556 basis and not for the whole property.
11558 2005-07-08 Martin Baulig <martin@ximian.com>
11560 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11561 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11563 2005-07-07 Marek Safar <marek.safar@seznam.cz>
11566 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11567 (ExtractSecurityPermissionSet): Cope with self referencing security
11568 attributes properly.
11570 * driver.cs (SetOutputFile): Made public property OutputFile.
11572 2005-07-07 Raja R Harinath <rharinath@novell.com>
11575 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11576 has_nonstatic_fields. Make into a FieldBase pointer.
11577 (TypeContainer.AddField): Add CS0282 check.
11578 (TypeContainer.EmitType): Update.
11580 2005-07-06 Miguel de Icaza <miguel@novell.com>
11582 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11583 compare if they start with __.
11585 2005-07-06 Raja R Harinath <rharinath@novell.com>
11587 * statement.cs (Switch.SwitchGoverningType): Only look at
11588 UserCasts that don't need implicit standard conversions to one of
11589 the allowed switch types (Fixes test-322.cs).
11590 (LocalInfo.Resolve): Re-enable sanity-test.
11592 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11594 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11596 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11598 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11600 2005-07-06 Raja R Harinath <rharinath@novell.com>
11603 * ecore.cs (SimpleName.GetSignatureForError): Add.
11604 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11605 (MemberAccess.GetSignatureForError): Add.
11607 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11609 The big error and warning messages review.
11639 * typemanager.cs: Updated.
11641 * class.cs: (MethodCore.SetYields): Moved here to share.
11642 (PropertyMethod.Define): Moved iterator setup here.
11644 * iterators.cs: Add orig_method to have full access to parent
11647 2005-07-05 Raja R Harinath <rharinath@novell.com>
11649 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11650 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11651 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11652 variable of struct type.
11653 * expression.cs (Unary.ResolveOperator): Update to change.
11654 (Indirection.VerifyFixed): Likewise.
11655 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11656 (ParameterReference.VerifyFixed): Value parameters are fixed.
11657 (This.VerifyFixed): Treat 'this' as a value parameter.
11658 * statement.cs (LocalInfo.IsFixed): Remove.
11660 2005-07-01 Martin Baulig <martin@ximian.com>
11662 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11663 `ec.EmitThis ()' to get the correct scope.
11665 2005-07-01 Martin Baulig <martin@ximian.com>
11667 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11668 instance is a ParameterReference; fixes #75299.
11670 2005-07-01 Martin Baulig <martin@ximian.com>
11672 Reverted Marek's latest patch (r46725):
11673 - it contains structural changes which are neither mentioned in
11674 the ChangeLog nor explained anywhere; for example the additional
11675 argument of EmitContext's and Iterator's .ctor's and the
11676 TypeContainer.DefineMembers() change.
11677 - structural changes like this should go in in seperate patches
11678 and not be hidden in a huge patch which just seems to affect
11679 warnings and errors.
11680 a big and hard to understand patch.
11681 - it breaks iterators and causes regressions, for instance in
11684 2005-06-30 Raja R Harinath <rharinath@novell.com>
11687 * expression.cs (Indexers.map): Remove.
11688 (Indexers.Append): Filter out inaccessible setters and getters.
11689 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11692 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11693 Refactored from ...
11694 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11695 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11696 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11697 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11699 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11702 * class.cs (FieldBase.GetInitializerExpression): One more field
11705 2005-06-28 Miguel de Icaza <miguel@novell.com>
11707 * pending.cs: Do not define a proxy if the base method is virtual,
11708 it will be picked up by the runtime (bug 75270).
11710 2005-06-08 Martin Baulig <martin@ximian.com>
11712 The big Iterators rewrite :-)
11714 * iterators.cs: Rewrite this to use the anonymous methods framework.
11716 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11717 before the TypeContainers; see 2test-21.cs.
11720 (TypeContainer.DefineType): Don't create a new EmitContext if we
11721 already have one (this only happens if we're an Iterator).
11722 (TypeContainer.Define): Also call Define() on all our iterators.
11723 (Method.CreateEmitContext): Added support for iterators.
11726 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11727 (AnonymousContainer.CreateMethodHost): Moved here from
11728 AnonymousMethod and made abstract.
11729 (AnonymousContainer.CreateScopeType): New abstract method.
11730 (AnonymousContainer.IsIterator): New public property.
11731 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11732 get the ScopeTypeBuilder rather than manually defining it here.
11733 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11736 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11737 before RootContext.DefineTypes().
11739 * codegen.cs (EmitContext.RemapToProxy): Removed.
11740 (EmitContext.CurrentAnonymousMethod): Changed type from
11741 AnonymousMethod -> AnonymousContainer.
11742 (EmitContext.ResolveTopBlock): Protect from being called twice.
11743 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11744 (EmitContext.EmitThis): Removed the iterators hacks; use the
11745 anonymous methods framework for that.
11748 (ToplevelBlock.Container): Make this a property, not a field.
11749 (ToplevelBlock.ReParent): New public method; move the
11750 ToplevelBlock into a new container.
11751 (Foreach.TemporaryVariable): Simplify.
11753 2005-06-05 Martin Baulig <martin@ximian.com>
11755 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11756 (Block.AddTemporaryVariable): New public method; creates a new
11757 `LocalInfo' for a temporary variable.
11758 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11760 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11761 non-iterator variables.
11763 2005-06-05 Martin Baulig <martin@ximian.com>
11765 * statement.cs (Foreach.TemporaryVariable): Create the
11766 LocalBuilder in the Emit phase and not in Resolve since in some
11767 situations, we don't have an ILGenerator during Resolve; see
11768 2test-19.cs for an example.
11770 2005-06-04 Martin Baulig <martin@ximian.com>
11772 **** Merged r45395 from GCS ****
11774 The big Foreach rewrite - Part II.
11776 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11777 with `PropertyInfo ienumerator_getcurrent'.
11779 * codegen.cs (VariableStorage): Removed.
11782 (Foreach): Derive from Statement, not ExceptionStatement.
11783 (Foreach.CollectionForeach): New nested class. Moved all the code
11784 dealing with collection foreach here.
11785 (Foreach.ForeachHelperMethods): Removed.
11786 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11788 2005-05-23 Martin Baulig <martin@ximian.com>
11790 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11791 don't need to. Fix #75014.
11793 2005-05-20 Martin Baulig <martin@ximian.com>
11795 Merged r44808 from GMCS.
11797 * class.cs (TypeContainer.CircularDepException): Removed.
11798 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11799 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11800 (CS0146) and interface (CS0529) dependencies here.
11802 2005-06-21 Raja R Harinath <rharinath@novell.com>
11804 * expression.cs (Invocation.EmitCall): Fix initialization
11805 'this_call' to reflect current behaviour. Fix indentation.
11807 * convert.cs (FindMostEncompassedType): Add two trivial special
11808 cases (number_of_types == 0 || number_of_types == 1).
11809 (FindMostEncompasingType): Likewise.
11811 2005-06-17 Raja R Harinath <rharinath@novell.com>
11813 Some cleanups preparing for the fix of #75283.
11814 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11816 (EventExpr.InstanceResolve): Likewise.
11817 (EventExpr.DoResolve): Remove redundant checks.
11819 2005-06-10 Duncan Mak <duncan@novell.com>
11821 * cs-tokenizer.cs (process_directives): New flag for controlling
11822 the processing of preprocessor directives.
11823 (x_token): After seeing a '#', return Token.NONE instead of going
11824 to handle_preprocessing_directive() when not processing
11825 directives. This avoids unnecessary processing during the token peek in
11830 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11831 the existing error reporting methods instead of Report.Error.
11833 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11834 after Raja's rewrite.
11836 2005-06-08 Miguel de Icaza <miguel@novell.com>
11838 * class.cs: Small fix.
11840 2005-06-08 Raja R Harinath <rharinath@novell.com>
11843 * class.cs (GetPartialBases): Fix return value check of
11844 part.GetClassBases.
11846 2005-06-07 Raja R Harinath <rharinath@novell.com>
11848 Ensure that partial classes are registered in their enclosing
11849 namespace. Initial part of fix of #75160.
11850 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11851 Register declspace with namespace here, not in
11852 DeclSpace.RecordDecl.
11853 * cs-parser.jay: Pass namespace to RecordDecl.
11854 * class.cs (PartialContainer.Create): Likewise.
11855 (ClassPart.DefineType): New sanity-check. Throws an exception if
11857 * decl.cs (Declspace.RecordDecl): Remove.
11858 * namespace.cs (NamespaceEntry.DefineName): Remove.
11860 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11862 * rootcontext.cs: Reset TargetExt as well.
11864 2005-06-03 Raja R Harinath <rharinath@novell.com>
11866 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11867 -langversion:ISO-1.
11869 2005-06-02 Raja R Harinath <rharinath@novell.com>
11871 Fix #75080, cs0119.cs.
11872 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11874 (Expression.Resolve): ... this. Use it. Remove bogus code
11875 allowing ExprClass.Type and ExprClass.Namespace for
11876 ResolveFlags.VariableOrValue.
11877 (Expression.Resolve) [1-argument variant]: Change default resolve
11878 flags based on language version.
11879 (Expression.Error_UnexpectedKind): Use a simple string array
11880 rather than an ArrayList.
11881 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11882 not ExprClass.Type.
11883 (TypeOfVoid.DoResolve): Likewise.
11884 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11885 flags argument -- it always has the same value.
11887 2005-05-31 Raja R Harinath <rharinath@novell.com>
11890 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11891 Use it in the error message.
11892 * assign.cs, expression.cs, statement.cs: Update.
11894 2005-05-30 Raja R Harinath <rharinath@novell.com>
11897 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11898 the "almostMatchedMember" case too.
11899 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11900 that failed the accessibility checks to 'almost_match'.
11902 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11904 * attribute.cs: Use internal MethodBuilder methods to set
11905 ExactSpelling and SetLastError on PInvoke methods, instead
11906 of passing them via charset. Fixes #75060.
11908 2005-05-27 Raja R Harinath <rharinath@novell.com>
11910 * parameter.cs (Parameter): Remove TODO comment.
11911 (Parameter.DefineParameter): Remove Location parameter.
11912 (Parameters.LabelParameters): Likewise.
11913 * class.cs (Constructor.Emit): Update to change.
11914 (MethodData.Emit): Likewise.
11915 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11916 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11918 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11921 Removed Parameters.Location and added Parameter.Location instead.
11922 Removed Location parameter from Emit() and GetSignature().
11929 Modified all related calls.
11931 2005-05-26 Raja R Harinath <rharinath@novell.com>
11933 Improve user-defined conversion handling.
11934 * convert.cs (GetConversionOperators): Rewrite. Return only the
11935 applicable operators.
11936 (AddConversionOperators): New. Helper for GetConversionOperators.
11937 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11938 there is only one most encompassed/encompassing type.
11939 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11940 "applicable operator" handling.
11941 (UserConversion): Move cache here from GetConversionOperators.
11942 Directly cache the chosen operator, rather than the whole
11944 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11945 case. Allow conversion of decimal to sbyte and byte too.
11946 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11947 New static methods. Used to avoid allocating EmptyExpressions in
11950 2005-05-24 Duncan Mak <duncan@novell.com>
11952 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11953 another class, used in Convert.ExplicitNumericConversion.
11954 (CastToDecimal): New class, similar to above, but casts to
11955 System.Decimal, used in Convert.ImplicitNumericConversion and also
11956 in explicit convesion from double/float to decimal.
11958 * convert.cs (ImplicitNumericConversion): Handle implicit
11959 conversions to System.Decimal.
11960 (ExplicitNumericConversion): handle explicit conversions to
11965 2005-05-20 Miguel de Icaza <miguel@novell.com>
11967 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11968 know the type at this stage, just break through. Fixes #75008
11970 2005-05-19 Martin Baulig <martin@ximian.com>
11973 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11974 to disable error reporting.
11976 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11977 here since we don't want to report an error; see the new test-336.cs.
11979 2005-05-19 Raja R Harinath <rharinath@novell.com>
11981 * statement.cs (ToplevelBlock.GetParameterReference)
11982 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11983 Move here from class Block.
11984 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11985 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11987 2005-05-18 Martin Baulig <martin@ximian.com>
11992 (FlowBranching.Reachability): Add non-static public And() and Or()
11994 (FlowBranchingSwitch): New class; do the `break_origins' thing
11995 like in FlowBranchingLoop.
11996 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11997 reachability, not just locals and parameters.
11998 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11999 switch; MergeBreakOrigins() now takes care of that.
12001 2005-05-18 Martin Baulig <martin@ximian.com>
12003 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12004 a loop and may leave it, reset the barrier; fixes #74974.
12006 2005-05-17 Marek Safar <marek.safar@seznam.cz>
12008 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12011 * cs-parser.jay: Catch more lexical errors.
12013 * report.cs: Add one more Error method.
12016 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12018 2005-05-17 Martin Baulig <martin@ximian.com>
12020 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12023 2005-05-16 Raja R Harinath <rharinath@novell.com>
12025 Fix test-382.cs. Emit values of decimal constants.
12026 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12028 (TypeContainer.AddField): ... this.
12029 (TypeContainer.EmitFieldInitializers): Allow the list of fields
12030 with initializers to include 'Const's.
12031 (ClassPart.RegisterFieldForInitialization): Forward to
12033 * const.cs (Const.Const): Pass initializer to base class.
12034 (Const.Define): In case of decimal constants, register them for
12035 initialization in a static constructor.
12037 2005-05-14 Martin Baulig <martin@ximian.com>
12039 * statement.cs (Block.Resolve): Correctly handle unreachable code;
12040 do not call ResolveUnreachable() on unreachable statements in
12041 here, see the comment in the source code.
12043 2005-05-13 Raja R Harinath <rharinath@novell.com>
12046 * expression.cs (BinaryResolveOperator): If one of the operands of
12047 an equality comparison is 'null' and the other is a pointer type,
12048 convert the null to a NullPointer.
12049 * convert.cs (ImplicitReferenceConversion): If the expression is a
12050 NullLiteral and the target type is a pointer type, return a
12051 NullPointer instead.
12052 (ImplicitConversionStandard): Likewise.
12054 2005-05-13 Marek Safar <marek.safar@seznam.cz>
12056 * cs-parser.jay: Set readonly context based on special constructs.
12058 * expression.cs (LocalVariableReference.DoResolveBase): Improved
12059 readonly variable error handling.
12061 * rootcontext.cs (EmitCode): Don't verify members when error
12064 * statement.cs (LocalInfo): Add reaodnly context information.
12065 (SetReadOnlyContext, GetReadOnlyContext): New methods.
12067 2005-05-13 Raja R Harinath <rharinath@novell.com>
12069 * statement.cs (Block.Resolve): Revert change below. Modify fix
12070 for #74041 to initialize 'resolved' to false only for explicit
12071 blocks. Fixes #74873.
12073 2005-05-12 Raja R Harinath <harinath@gmail.com>
12076 * typemanager.cs (unmanaged_enclosing_types): New.
12077 (IsUnmanagedType): Avoid infloops by using
12078 'unmanaged_enclosing_types' to talk with recursive invocations.
12080 2005-05-13 Martin Baulig <martin@ximian.com>
12082 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12083 instance variable, not a local. Fix #74873.
12084 (Block.ResolveUnreachable): Set it to true here.
12086 2005-05-11 Duncan Mak <duncan@novell.com>
12088 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12089 continuing to process for 'arg'.
12090 (handle_preprocessing_directive): Check the argument of the #endif
12091 directive and report error CS1025 if there are any trailing
12094 According to the C# spec, having even whitespace after the #endif
12095 directive is illegal; however, because we call arg.TrimEnd ()
12096 beforehand, we have the same behavior as csc, allowing whitespace
12097 after the directive.
12101 2005-05-11 Marek Safar <marek.safar@seznam.cz>
12105 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12106 (Constructor.GetObsoleteAttribute): Implemented correctly.
12108 2005-05-10 Martin Baulig <martin@ximian.com>
12110 * support.cs (ReflectionParameters.ParameterModifier): Use
12111 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12112 and `ParameterAttributes.In'. Fixes #74884.
12114 2005-05-10 Marek Safar <marek.safar@seznam.cz>
12116 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12118 * expression.cs (Argument.GetParameterModifier): Turned to property.
12119 (Invocation.Error_InvalidArguments): Add more descriptive errors.
12121 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12124 2005-05-09 Raja R Harinath <rharinath@novell.com>
12127 * decl.cs (MemberCache.AddMethods): Register override methods,
12128 rather than non-override methods.
12129 * typemanager.cs (RegisterOverride): New.
12130 (IsOverride): Update.
12132 2005-05-09 Marek Safar <marek.safar@seznam.cz>
12136 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12137 recursive declaration.
12139 * statement.cs (Block.ResolveMeta): Report any error in resolving.
12141 2005-05-06 Marek Safar <marek.safar@seznam.cz>
12143 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12145 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12147 2005-05-05 Raja R Harinath <rharinath@novell.com>
12150 * decl.cs (DeclSpace.FamilyAccessible):
12151 Use TypeManager.IsNestedFamilyAccessible.
12153 Fix reopened #64812.
12154 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12157 2005-05-04 Raja R Harinath <rharinath@novell.com>
12158 Abin Thomas <projectmonokochi@rediffmail.com>
12159 Anoob V E <projectmonokochi@rediffmail.com>
12160 Harilal P R <projectmonokochi@rediffmail.com>
12163 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12164 allow access to all static members.
12166 2005-05-04 Martin Baulig <martin@ximian.com>
12168 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12170 2005-05-04 Martin Baulig <martin@ximian.com>
12174 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12175 section at the end; make things work if `default' is not the last
12178 2005-05-04 Martin Baulig <martin@ximian.com>
12182 * statement.cs (Switch): Replaced the `got_default' field with a
12183 `default_section' one.
12184 (Switch.CheckSwitch): Set `default_section' here.
12185 (Switch.Resolve): If we're a constant switch and the constant is
12186 not found, use the default section.
12188 2005-05-03 Martin Baulig <martin@ximian.com>
12190 * expression.cs (ArrayAccess.EmitGetLength): New public method.
12192 * statement.cs (Foreach.ArrayForeach): New nested class.
12193 (Foreach.TemporaryVariable): New nested class.
12194 (Foreach.EmitArrayForeach): Removed; this is now in the new
12195 ArrayForeach class.
12197 2005-05-03 Raja R Harinath <rharinath@novell.com>
12199 * pending.cs (BaseImplements): Move the #74773 fix here. This is
12201 (VerifyPendingMethods): Revert change below.
12203 * typemanager.cs (IsOverride, RegisterNonOverride): New.
12204 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12205 that used to trigger warning -28. Remove warning -28.
12206 * expression.cs (Invocation.OverloadResolve): Use
12207 TypeManager.IsOverride to distinguish override methods.
12210 * pending.cs (VerifyPendingMethods): If a base type implements the
12211 requested interface, don't bother checking individual methods of
12212 the base type. As a side-effect, this prevents the creation of
12213 unnecessary proxies.
12215 2005-05-02 Martin Baulig <martin@ximian.com>
12219 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12220 Also `And' the locals if the old vector is null.
12221 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12222 null; in this case we basically reset all the variables.
12224 2005-05-02 Martin Baulig <martin@ximian.com>
12228 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12229 Added `FlowBranching branching' argument; always `and' the
12230 variables instead of `or'ing them unless we're an infinite loop.
12232 * statement.cs (While.Resolve): Create a new sibling unless we're
12235 2005-05-02 Martin Baulig <martin@ximian.com>
12239 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12240 arguments; use it instead of creating a new TopLevelBlock.
12241 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12242 our ConstructorInitializer.
12245 (TopLevelBlock.TopLevelBranching): New public property.
12246 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12247 and create our `TopLevelBranching'.
12249 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12250 anonymous method host, use `block.TopLevelBranching' rather than
12251 creating a new branching.
12253 2005-04-20 Miguel de Icaza <miguel@novell.com>
12255 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12256 a ScopeInfo, if any of the current children is a child of the new
12257 entry, move those children there.
12259 2005-04-30 Martin Baulig <martin@ximian.com>
12261 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12262 at the beginning of a SwitchSection. Fix #73335.
12264 2005-04-27 Marek Safar <marek.safar@seznam.cz>
12267 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12269 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12270 (FieldExpr.DoResolve): Obsolete members are ignored for field
12273 2005-04-26 Marek Safar <marek.safar@seznam.cz>
12275 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12276 of arrays detection.
12278 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12280 (Field.VerifyClsCompliance): Volatile fields are not compliant.
12282 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12285 2005-04-25 Ben Maurer <bmaurer@ximian.com>
12287 * cs-parser.jay: Use the prefered version of -unsafe in error
12290 2005-04-22 Marek Safar <marek.safar@seznam.cz>
12292 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12295 2005-04-20 John Luke <john.luke@gmail.com>
12297 * driver.cs: fix typo in error message, --outout to --output
12299 2005-04-20 Marek Safar <marek.safar@seznam.cz>
12301 * codegen.cs (InRefOutArgumentResolving): New field.
12303 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12304 fields outside contructor.
12306 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12308 2005-04-19 Miguel de Icaza <miguel@novell.com>
12310 * anonymous.cs (CaptureContext.EmitParameterInstance): The
12311 parameter code was not completed ever, so it was not as up-to-date
12312 as local variables. Must finish it.
12314 The bug fix was to compare the Toplevel of the block, not the
12315 current block. Thanks for Ben for pointing this out.
12317 2005-04-19 Raja R Harinath <rharinath@novell.com>
12319 * decl.cs (AddMethods): Use the declaring type of the problem
12320 method to determine if we want to squash a warning.
12322 2005-04-19 Marek Safar <marek.safar@seznam.cz>
12324 * attribute.cs: Removed debug output.
12326 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12328 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12331 2005-04-18 Raja R Harinath <rharinath@novell.com>
12334 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12335 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12336 all null comparisons against reference types.
12338 2005-04-18 Marek Safar <marek.safar@seznam.cz>
12341 * class.cs (TypeContainer.CircularDepException) New nested
12343 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12344 (TypeContainer.DefineType): Removed error, reset InTransit before
12346 (Class.DefineType): Throw exception when is in Transit.
12347 Catch exception and report error.
12348 (Struct.DefineType): Throw exception when is in Transit.
12349 Catch exception and report error.
12350 (Interface.DefineType): Throw exception when is in Transit.
12351 Catch exception and report error.
12353 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12354 handle nested exception handlers.
12356 * flowanalysis.cs (InTryWithCatch): New method, search for try with
12359 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12360 InFinally and InCatch storage.
12362 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12363 (Catch.Resolve): Set and Restore ec.InCatch.
12364 (Try.Resolve): Set and Restore ec.InFinally.
12365 (Try.HasCatch): True when try has catch.
12367 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
12369 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12370 for the same event member, so exclude such cases from warning 419.
12373 2005-04-16 Miguel de Icaza <miguel@novell.com>
12375 * expression.cs (Binary.ResolveOperator): Apply patch from John
12376 Luke to fix bug 59864: operators &, | and ^ on enumerations
12377 require that the same enum type on both sides.
12379 * driver.cs: Add warnings to old flag usage, this is to assist
12380 people who produce Makefiles and hope that the Makefiles will be
12383 * class.cs (TypeContainer.EmitType): Moved the definition of the
12384 special $PRIVATE$ field from the resolve phase to the Emit phase.
12385 During resolve we do not know if we are a struct with
12386 HasExplicitLayout, we know this only after the attributes for the
12389 Set the FieldOffset to zero on the dummy field that we create for
12390 the class. Fixes 74590.
12392 2005-04-16 Raja R Harinath <rharinath@novell.com>
12395 * ecore.cs (PropertyExpr.resolved): New.
12396 (DoResolve): Use it to handle a case of double resolution here.
12397 Handle a case of identical-name-and-type-name.
12398 * expression.cs (ArrayCreation.CheckIndices): Avoid double
12399 resolution by storing the results of expression resolution back
12400 into the "probes" array.
12402 2005-04-15 Raja R Harinath <rharinath@novell.com>
12404 Fix cs0208-7.cs and cs0208-8.cs.
12405 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12406 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
12407 error reporting to point out the reason a struct is not unmanaged.
12409 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12411 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
12412 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12414 2005-04-13 Raja R Harinath <rharinath@novell.com>
12417 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12418 IdenticalNameAndTypeName here.
12419 (EventExpr.InstanceResolve): Likewise.
12421 2005-04-13 Marek Safar <marek.safar@seznam.cz>
12423 C# 2.0 DefaultCharSetAttribute implementation
12425 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12426 which allows us to set GlobalNamespace for every resolve.
12427 (Attribute.ResolveArguments): Cut from Resolve.
12428 (Attribute.GetCharSetValue): Returns CharSet named argument.
12429 (Attribute.DefinePInvokeMethod): Gets default charset from
12431 (GlobalAttribute.ResolveAsTypeStep): Override.
12432 (GlobalAttribute.ResolveArguments): Override.
12434 * class.cs (TypeAttr): Is protected.
12436 * codegen.cs (ModuleClass.DefaultCharSet): New member.
12437 (ModuleClass.DefaultCharSetType): New memeber.
12438 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12440 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12441 charset from module.
12443 * delegate.cs (TypeAttr): Override.
12444 (Delegate.DefineType): Use this TypeAttr.
12446 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12447 at very early stage (before types are defined) to resolve model
12448 module attributes. It will probably not work with corlib but it
12451 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12452 charset from module.
12454 * typemanager.cs (default_charset_type): New type.
12456 2005-04-13 Raja R Harinath <rharinath@novell.com>
12458 * decl.cs (MemberCache.AddMethods): Don't warn if
12459 System.Object.Finalize has buggy MethodAttributes.
12461 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12464 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12466 * doc.cs : detect ambiguous reference to overloaded members.
12467 Fixed bug #71603. MS 1.1 csc does not detect it.
12469 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12471 * doc.cs : delegates must not be referenced with parameters.
12474 2005-04-12 Miguel de Icaza <miguel@novell.com>
12476 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12478 2005-04-10 Miguel de Icaza <miguel@novell.com>
12480 * driver.cs (MainDriver): Stop processing if the CLS stage found
12483 (CompilerCallableEntryPoint.InvokeCompiler): Always
12484 reset after execution; Take a TextWriter argument for the
12487 * report.cs: Use the error stream instead of hardcoding stderr.
12489 2005-04-09 Miguel de Icaza <miguel@novell.com>
12491 * class.cs: Reduce code paths to test, too small of an
12492 optimization to make it worth the extra testing. Always perform
12495 2005-04-08 Raja R Harinath <rharinath@novell.com>
12498 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12499 operators that had errors reported on them.
12501 2005-04-08 Marek Safar <marek.safar@seznam.cz>
12503 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12505 (Attribute.Resolve): Add named argument type checking.
12507 * class.cs (FixedField.Define): Use IsPrimitiveType
12509 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12511 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12512 unsafe parameter types.
12514 * statement.cs (Using.ResolveExpression): Add better error description.
12516 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12518 2005-04-08 Raja R Harinath <rharinath@novell.com>
12521 * attribute.cs (Attribute.GetAttributeUsage): Resolve
12522 AttributeUsageAttribute in the emitcontext of the attribute class,
12523 not in the emitcontext of the attributable entity it was attached to.
12524 * cs-parser.jay: Use 'current_class', not 'current_container',
12525 when creating a GlobalAttribute.
12527 2005-04-08 Alp Toker <alp@atoker.com>
12529 * pending.cs: The fix to #58413 failed to compile methods implementing
12530 interfaces with/without params modifiers and vice versa, even though
12531 params modifiers aren't part of the signature. Make the modifier check
12532 less strict as in csc.
12534 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
12535 Anoob V E <projectmonokochi@rediffmail.com>
12536 Harilal P R <projectmonokochi@rediffmail.com>
12539 * pending.cs (TypeAndMethods.mods): New. Store the parameter
12540 modifiers of pending methods.
12541 (PendingImplementation.PendingImplementation): Initialize it.
12542 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12543 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12544 with ParameterData. Add check for modifiers.
12545 * class.cs (MethodData.Define): Update to changes.
12547 2005-04-07 Raja R Harinath <rharinath@novell.com>
12549 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12551 2005-04-07 Marek Safar <marek.safar@seznam.cz>
12553 * class.cs (PropertyMethod.Define): Check private accessor in abstract
12556 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12559 * typemanager.cs: Registered RequiredAttributeAttribute.
12561 2005-04-06 Marek Safar <marek.safar@seznam.cz>
12563 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12564 Warning CS0169 is back at level 3.
12565 (IMethodData.SetMemberIsUsed): New method.
12567 * decl.cs (IsUsed): New value; moved from FieldBase.Status
12568 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12570 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12572 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12574 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12577 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12580 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12581 to avoid the problems with nested types.
12583 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12584 Anoob V.E <projectmonokochi@rediffmail.com>
12585 Harilal P.R <projectmonokochi@rediffmail.com>
12586 Raja R Harinath <rharinath@novell.com>
12589 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12591 * typemanager (GetConstructor): Make public.
12593 2005-04-05 John Luke <john.luke@gmail.com>
12594 Raja R Harinath <rharinath@novell.com>
12597 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12598 struct too. Return false quicker in a few cases.
12599 (VerifyUnManaged): Use it.
12601 2005-04-05 Raja R Harinath <rharinath@novell.com>
12604 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12605 not 'unreachable_seen'.
12607 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12609 * attribute.cs (Attribute.GetValue): Removed unused.
12611 * codegen.cs (CodeGen.TrimExt): Removed unused.
12613 * cs-parser.jay (output): Removed unused.
12615 * cs-tokenizer.cs (hex_digits): Removed unused.
12617 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12619 * expression.cs (Indirection.LoadExprValue): Removed unused.
12620 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12622 * iterators.cs (Iterator.param_types): Removed unused.
12624 * statement.cs (Goto.block): Removed unused.
12625 (ToplevelBlock.did): Removed unused.
12626 (Switch.ResolveConstantSwitch): Removed unused.
12628 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12630 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12633 2005-04-01 Raja R Harinath <rharinath@novell.com>
12635 Fix #74232 and cs0208-3.cs.
12636 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12637 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12638 unmanaged type. Don't use FieldBuilders when 't' is a
12639 TypeBuilder. Use ModFlags and MemberType fields.
12640 * class.cs (MemberBase.member_type): Rename from MemberType.
12641 (MemberBase.MemberType): New property. Determines member_type on
12643 (MemberBase.DoDefine): Don't initialize MemberType here.
12644 (FieldMember.Define): Likewise.
12646 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12649 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12650 Attributes are emitted there.
12652 2005-04-01 Raja R Harinath <rharinath@novell.com>
12654 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12655 keyword in 'partial enum' too.
12656 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12658 Report from Kamil Skalski <nazgul@omega.pl>.
12661 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12662 have partial containers too.
12664 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12665 in block' checks to Block.CheckInvariantMeaningInBlock.
12666 * statement.cs (Block.GetKnownVariableInfo): Make private.
12667 (Block.IsVariableUsedInChildBlock): Remove.
12668 (Block.IsVariableUsedInBlock): Likewise.
12669 (Block.CheckInvariantMeaningInBlock): New. Show location of
12670 conflicting declaration.
12671 (Block.AddVariable): Make error messages less long-winded and more
12672 specific. Show location of conflicting declaration.
12673 * parameter.cs (Parameters.Location): New readonly property.
12675 2005-03-31 Raja R Harinath <rharinath@novell.com>
12677 Clean up semantics of invoking ResolveMemberAccess.
12678 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12679 can have an instance, ensure that we pass in a non-TypeExpression
12680 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12681 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12682 argument. Update to changes and simplify.
12683 (FieldExpr.Emitinstance): Remove CS0120 check.
12684 (PropertyExpr.EmitInstance): Likewise.
12685 * expression.cs (Argument.Resolve): Likewise.
12686 (Invocation.DoResolve): Update to changes in semantics of
12687 InstanceExpression.
12689 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12692 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12695 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12697 2005-03-31 Raja R Harinath <rharinath@novell.com>
12699 Fix difference in behaviour with commandline invocation.
12700 * driver.cs (Driver.Reset): New.
12701 (CompilerCallableEntryPoint): Call it.
12703 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12704 variable" warnings if the boolean expression failed to resolve.
12706 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12708 * attribute.cs: Fix the union of several permissions when some of them
12709 are unrestricted (so the result isn't an unrestricted permission set).
12712 2005-03-30 Raja R Harinath <rharinath@novell.com>
12714 * ecore.cs (MemberExpr): New class. Convert from interface
12716 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12717 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12719 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12720 (MethodGroupExpr.IsExplicitImpl): Remove.
12721 (Expression.GetFieldFromEvent): Remove.
12722 (SimpleName.MemberStaticCheck): Remove.
12723 (SimpleName.DoSimpleNameResolve): Update to changes.
12724 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12725 (MemberAccess.IdenticalNameAndTypeName): Remove.
12726 (MemberAccess.error176): Move to MemberExpr.
12727 (MemberAccess.DoResolve): Update to changes.
12728 (BaseAccess.DoResolve): Likewise.
12730 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12732 C# 2.0 Conditional attribute class implementation
12734 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12735 Analyzes class whether it has attribute which has ConditionalAttribute
12736 and its condition is not defined.
12738 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12739 (Class.IsExcluded): New method. Search for at least one defined
12740 condition in ConditionalAttribute of attribute class.
12742 2005-03-30 Raja R Harinath <rharinath@novell.com>
12744 * ecore.cs (PropertyExpr): Derive from Expression, not
12745 ExpressionStatement.
12746 (PropertyExpr.EmitStatement): Remove.
12748 2005-03-29 Raja R Harinath <rharinath@novell.com>
12751 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12752 internal field "value__" of an enum be private. The examples for
12753 "value__" that I found on MSDN all used FieldAttributes.Private.
12755 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12756 Don't mention IL method attribute names.
12758 Fix #47991. Remove a TODO.
12759 * statement.cs (Block.Toplevel): Make into a field.
12760 (Block.Parameters): Move into ToplevelBlock.
12761 (Block.known_variables): Rename from child_variable_names.
12762 (Block.Block): Remove variants that take Parameters. Initialize
12763 'Toplevel' with the immediately surrounding toplevel block.
12764 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12765 LocalInfo parameter.
12766 (Block.GetKnownVariableInfo): New.
12767 (Block.IsVariableNameUsedInChildBlock): Update.
12768 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12769 the block, even though it may not be in scope.
12770 (Block.AddVariable): Remove Parameters parameter. Use
12771 Toplevel.Parameters instead.
12772 (Block.AddConstant): Remove Parameters parameter.
12773 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12774 (Block.IsParamaterReference): Likewise.
12775 (Block.IsLocalParameter): Likewise. Simplify a lot.
12776 (ToplevelBlock.Parameters): New. Moved from Block.
12777 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12778 initialize Parameters to a non-null value.
12779 * cs-parser.jay: Update to changes.
12780 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12781 simple names that mean different things in the same block. Use
12782 Block.IsVariableNameUsedInBlock.
12784 2005-03-28 Raja R Harinath <rharinath@novell.com>
12786 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12787 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12788 GetTypeHandle. It is possible for a reflected type to derive from
12789 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12790 System.Array during mscorlib compilation).
12791 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12792 contain a method_hash, don't create one either. Don't create a
12793 deep copy of the base cache's method_hash.
12794 (MemberCache.SetupCache): Rename back from DeepCopy.
12795 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12796 already initialized. If we see an override function, add its
12797 underlying base virtual function to the member_hash too.
12799 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12801 2005-03-26 Raja R Harinath <harinath@acm.org>
12804 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12805 fails to resolve, ensure that the LHS is still resolved as an
12808 2005-03-25 Raja R Harinath <harinath@acm.org>
12810 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12812 (Enum.current_ec): Remove.
12813 (Enum.LookupEnumValue): Remove EmitContext argument.
12814 Just uses the one created during DefineType.
12815 (Enum.FindMembers): Update.
12816 * expression.cs (MemberAccess.DoResolve): Update.
12818 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12820 * assign.cs (Assign.DoResolve): Check for CS1717 when
12821 source and target are same (uses Equals).
12823 * expression.cs (LocalVariableReference, ParameterReference,
12824 This): Implemented Equals, GetHashCode.
12826 * statement.cs (Block.GetParameterReference): Removed useless
12829 2005-03-22 Raja R Harinath <rharinath@novell.com>
12832 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12833 blocks before deciding whether the error is cs0136 or cs0128.
12835 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12836 (using_alias_directive, using_namespace_directive): Pass
12837 MemberName, not an expression to Namespace.UsingAlias and
12839 (MakeName): Use the MemberName of the namespace.
12840 * namespace.cs (Namespace.MemberName): New.
12841 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12842 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12844 * decl.cs (MemberName.Name): Make readonly.
12845 (MemberName.FromDotted): New "constructor".
12846 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12847 (MemberCore.Name): Compute from MemberName on demand.
12848 (MemberCore.SetMemberName): Provide a way to change the
12850 (MemberCore.AddToContainer): Don't take a fullname parameter.
12851 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12852 fully qualified name of the container to the member name.
12853 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12854 only if the type is a member of the root container.
12855 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12856 MemberName.Left rather than searching for an embedded ".".
12857 (PartialContainer.CreatePart): Update to changes in RootContext.
12858 (MemberBase.ShortName): Turn into a property. Use
12859 MemberCore.SetMemberName.
12860 (MemberBase.ExplicitInterfaceName): Remove.
12861 (MemberBase.UpdateMemberName): Remove.
12862 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12863 (PropertyBase.SetMemberName): New override.
12864 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12865 (Tree.GetDecl): New.
12866 (Tree.AllDecls): Rename from Decls.
12867 * attribute.cs, enum.cs, report.cs: Update to changes.
12868 * driver.cs (MainDriver): Use MemberName.FromDotted on
12869 RootContext.MainClass.
12871 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12873 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12876 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12878 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12880 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12881 property accessor modifiers.
12883 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12884 fixed buffer attribute (CS1716).
12885 (PropertyMethod.HasCustomAccessModifier): When property accessor
12886 has custom modifier.
12888 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12890 (PropertyExpr.DoResolveLValue): Add CS0272.
12892 2005-03-17 Miguel de Icaza <miguel@novell.com>
12894 * convert.cs: When converting to a pointer, use the proper Conv.U
12895 or Conv.I depending on the source data type.
12897 * cs-tokenizer.cs: Make the size for large decimal constants,
12900 2005-03-17 Martin Baulig <martin@ximian.com>
12902 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12903 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12905 2005-03-17 Martin Baulig <martin@ximian.com>
12907 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12908 to bool so we can return an error condition.
12909 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12912 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12914 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12917 2005-03-16 Raja R Harinath <rharinath@novell.com>
12919 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12920 Refactor to avoid traversing the list of assemblies, and to avoid
12921 string concatenation.
12922 * typemanager.cs (guid_attr_type): Remove.
12923 (negative_hits, pointers, references): Remove hashes.
12925 (GetConstructedType): New. Uses type_hash to handle constructed
12926 types (arrays, references, pointers).
12927 (GetReferenceType, GetPointerType): Use it.
12928 (GetNestedType): New. Uses type_hash to handle nested types of
12930 (LookupType, LookupTypeDirect): Remove.
12931 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12932 'types' hash and LookupTypeReflection directly.
12933 (params_string, params_object): Use GetConstructedType.
12934 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12936 (Namespace.Lookup): Use cached_types.
12937 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12938 provided by old TypeManager.LookupType.
12939 * rootcontext.cs (MakeFQN): Remove.
12940 * decl.cs (DeclSpace.MakeFQN): Likewise.
12941 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12942 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12943 TypeManager.GetConstructedType.
12944 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12946 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12948 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12951 * cs-parser.jay: Reports CS1527 for any namespace element.
12953 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12956 * expression.cs (ParameterReference.IsAssigned): Changed error to
12958 (Error_WrongNumArguments): Moved CS0245 detection here.
12960 * statement.cs (Return.Resolve): Add CS1622 report.
12962 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12964 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12966 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12968 * attribute.cs expression.cs: Get rid of some allocations.
12970 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12972 * doc.cs : just eliminate the latest change.
12974 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12976 * doc.cs : commented out the latest change. It breaks xml-030.cs
12978 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12980 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12981 fail. So invoke CreateType() in FindDocumentedType().
12983 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12985 * cs-tokenizer.cs : added IsKeyword().
12986 * doc.cs : Detect keyword incorrectly used as identifier.
12987 Allow identifiers prefixed by @.
12989 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12991 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12992 It caused exception in namespace resolving (again!).
12994 * class.cs (Class.ctor): Removed exit.
12995 (PropertyMethod.ctor): ditto.
12997 * codegen.cs (Codegen.Reset): Reset static data.
12998 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13000 * cs-tokenizer.cs (Cleanup): Removed.
13002 * driver.cs (GetSystemDir): Rewrote to one line command.
13003 It caused problem with unloaded dynamic modules.
13004 (UnixParseOption): Removed Exit.
13005 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13006 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13007 Now can be mcs used as library.
13009 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13012 * location.cs (Reset): Reset static data.
13014 * namespace.cs (Reset): Reset static data.
13016 * report.cs (Report.Reset): Reset static data.
13018 * rootcontext.cs (RootContext.Reset): Reset static data.
13020 * tree.cs (RootTypes.ctor): Use Location.Null
13022 * typemanager.cs (TypeManager.Reset): Reset static data.
13023 (CoreLookupType): Removed Exit.
13024 (TypeHandle.Reset): Reset static data.
13026 2005-03-10 Raja R Harinath <rharinath@novell.com>
13029 * typemanager.cs (ComputeNamespaces): Import namespaces from
13030 referenced modules too.
13032 2005-03-09 Raja R Harinath <rharinath@novell.com>
13034 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13037 2005-03-09 Raja R Harinath <rharinath@novell.com>
13039 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13040 enclosing DeclSpace. This ensures that a name-lookup populates
13041 more caches and there are fewer 'TypeExpression's. Carve out
13042 nested type lookup into ...
13043 (LookupNestedTypeInHierarchy): ... this.
13045 2005-03-09 Raja R Harinath <rharinath@novell.com>
13047 Clean up a few partial-class semantics.
13048 Fixes test-357.cs and cs1618-2.cs.
13049 * cs-parser.jay (struct_declaration): Use 'current_class' as
13050 parent of newly-created struct. Remove call to Register ().
13051 Use 'pop_current_class' to complete handing the current struct.
13052 (interface_declaration): Likewise.
13053 (class_declaration): Likewise.
13054 (enum_declaration): Use 'current_class' as parent of newly created
13056 (delegate_declaration): Likewise.
13057 (pop_current_class): New function. This is used to handle closing
13058 up the 'current_class' and 'current_container', and pointing them
13059 to the enclosing class/container.
13060 (CSharpParser): Initialize 'current_class' too.
13061 * decl.cs (MemberCore): Add check for invariant: a partial
13062 container is not a parsed entity, and thus does not enclose any
13064 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13065 (DeclSpace.BaseTypeExpr): Use it.
13066 (DeclSpace.LookupType): Add check for invariant.
13067 * class.cs (TypeContainer): Add check for invariant: a nested
13068 class should have the same NamespaceEntry as its enclosing class.
13069 (TypeContainer.EmitFieldInitializers): Make virtual.
13070 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13072 (TypeContainer.Register): Remove.
13073 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13074 null. Use TypeResolveEmitContext for resolving base types and
13075 interfaces. Move initialization of Parts.TypeBuilder here from
13077 (TypeContainer.DefineNestedTypes): ... here.
13078 (PartialContainer): Take a Namespace not a NamespaceEntry.
13079 (PartialContainer.Create): Don't use Register. Call the
13080 appropriate Add... function directly.
13081 (ClassPart): Take both the PartialContainer and the enclosing
13082 class as constructor arguments.
13083 (ClassPart.EmitFieldInitializers): Override.
13084 (ClassPart.PartFindNestedTypes): Remove.
13085 (FieldBase.GetInitializerExpression): Resolve the initializer
13086 expression in the emit context of the enclosing class.
13087 * tree.cs (RootTypes): Remove Register ().
13089 2005-03-08 Marek Safar <marek.safar@seznam.cz>
13091 * cs-parser.jay: Removed CS0134.
13093 * driver.cs: Removed CS1901.
13095 * expression.cs (SizeOf.DoResolve): Don't report CS0233
13096 for predefined types.
13098 2005-03-07 Duncan Mak <duncan@novell.com>
13100 * codegen.cs (Save): Catch UnauthorizedAccessException as
13101 well. Fixes bug #73454.
13103 2005-03-07 Marek Safar <marek.safar@seznam.cz>
13105 * cs-tokenizer.cs (xtoken): Add CS1035.
13107 * class.cs (MethodData.Define): Add CS0683.
13108 (FieldMember.ctor): Add CS0681.
13110 2005-03-07 Raja R Harinath <rharinath@novell.com>
13112 * ecore.cs (SimpleName.DoResolve): Rename from
13113 SimpleName.DoResolveAllowStatic.
13114 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13115 Pass 'intermediate' flag to MemberStaticCheck.
13116 (SimpleName.MemberStaticCheck): Skip "static check" only in case
13117 of "intermediate" lookups via MemberAccess.
13118 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
13119 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13121 2005-03-07 Raja R Harinath <rharinath@novell.com>
13124 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13125 slipped in because of variable names that are identical to a
13126 builtin type's BCL equivalent ('string String;', 'int Int32;').
13127 (PropertyExpr.EmitInstance): Likewise.
13129 2005-03-04 Marek Safar <marek.safar@seznam.cz>
13131 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13133 * report.cs (warning_ignore_table): Made public.
13135 2005-03-04 Raja R Harinath <rharinath@novell.com>
13138 * class.cs (MethodData.Emit): Pass 'container' to
13139 container.GetObsoleteAttribute instead of 'container.Parent'.
13141 2005-03-03 Marek Safar <marek.safar@seznam.cz>
13143 * cs-parser.jay: Add 1534 error test.
13145 * iterators.cs (Yield.CheckContext): Add error 1629.
13146 (Iterator.ctor): Save unsafe modifier.
13147 (MoveNextMethod.DoEmit): Restore unsafe context.
13149 * namespace.cs (UsingAlias): Better error message.
13151 2005-03-03 Dan Winship <danw@novell.com>
13153 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13154 the warning message [#73219]
13156 2005-03-03 Raja R Harinath <rharinath@novell.com>
13158 Fix compile with MCS 1.0.0.0.
13159 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13160 w_restore to not depend on string constant folding.
13162 2005-03-03 Raja R Harinath <rharinath@novell.com>
13164 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
13165 CS0246 check to users who passed 'silent = false'.
13166 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13168 (SimpleName.SimpleNameResolve): Update.
13169 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13170 (MemberAccess.IdenticalNameAndTypeName): Update.
13171 * doc.cs (FindDocumentedTypeNonArray): Update.
13173 2005-03-03 Raja R Harinath <rharinath@novell.com>
13175 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13176 * parameters.cs (ComputeAndDefineParameters): Remove.
13177 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13178 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13179 Use GetParameterInfo.
13181 2005-03-02 Marek Safar <marek.safar@seznam.cz>
13183 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13185 2005-03-02 Raja R Harinath <rharinath@novell.com>
13187 Unify DeclSpace.LookupType and DeclSpace.FindType.
13188 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
13189 is in charge of defining nested types on demand.
13190 (DeclSpace.LookupType): Use it when the current_type is a
13191 TypeBuilder. Use LookupTypeDirect for reflected types.
13192 (DeclSpace.FindType): Remove.
13193 (DeclSpace.LookupInterfaceOrClass): Likewise.
13194 (DeclSpace.DefineTypeAndParents): Likewise.
13195 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13196 DeclSpace.LookupType.
13197 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13198 * typemanager.cs (LookupType): Simplify.
13199 (AddUserType): Remove type from negative_hits.
13200 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13201 * class.cs (TypeContainer.FindMembers): Move handling of nested
13203 (TypeContainer.FindMembers_NestedTypes): ... here.
13204 (TypeContainer.FindNestedType): Implement override.
13205 (ClassPart.FindNestedType): Delegate to PartialContainer.
13206 (ClassPart.PartFindNestedType): Looks up the nested types of the
13209 2005-03-02 Martin Baulig <martin@ximian.com>
13211 * class.cs (TypeContainer.DoDefineMembers): We also need a default
13212 static constructor in static classes.
13214 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
13216 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13217 sizeParamIndex is not specified.
13219 2005-03-01 Marek Safar <marek.safar@seznam.cz>
13222 * report.cs (WarningMessage.IsEnabled): Missing null check.
13224 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13226 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13227 in the fields and not in the properties.
13229 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
13231 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
13234 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13236 * attribute.cs: Small refactoring (improved robustness).
13237 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13238 (ValidateGuid): Removed.
13239 (Resolve): Removed referenced to above mentioned.
13240 (GetAttributeUsage): Made private and changed to work without
13242 (GetIndexerAttributeValue): Don't crash.
13243 (GetConditionalAttributeValue): Ditto.
13244 (GetClsCompliantAttributeValue): Ditto.
13245 (ExtractSecurityPermissionSet): All attributes exceptions are
13247 (GetPropertyValue): New helper.
13248 (GetMethodImplOptions): New method.
13249 (DefinePInvokeMethod): Reuse common code. Implemented handling of
13250 some missing properties.
13252 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13253 (Method.ApplyAttributeBuilder): Updated.
13255 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13258 2005-02-28 Raja R Harinath <rharinath@novell.com>
13261 * report.cs (Report.SymbolRelatedToPreviousError): Handle
13262 non-simple types (array, pointer, reference).
13264 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13266 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13268 * class.cs (MethodCore.IsDuplicateImplementation): Special error
13270 (Method.CheckBase): Catch wrong destructor here.
13271 (MethodData.Define): Add errors 550, 668.
13273 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13275 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13277 * pending.cs (VerifyPendingMethods): Add error 551.
13279 * typemanager.cs (CSharpName): Next error report helper.
13281 2005-02-25 Marek Safar <marek.safar@seznam.cz>
13283 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13284 attributes. Removed useless attribute double check.
13285 It saves almost 2MBs for corlib.
13287 2005-02-25 Raja R Harinath <rharinath@novell.com>
13290 * statement.cs (ExpressionStatement.Resolve): Make robust to being
13291 called twice in case of error.
13293 2005-02-23 Chris Toshok <toshok@ximian.com>
13295 Fix compiler portions of #72827.
13296 * statement.cs (Block.Emit): call Begin/EndScope on the
13297 EmitContext instead of the ILGenerator.
13299 * codegen.cs (EmitContext.BeginScope): new method, call
13300 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13302 (EmitContext.BeginScope): same, but EndScope and CloseScope
13304 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13305 offset and call the superclass's OpenScope(int) with it.
13306 (SymbolWriter.CloseScope): get the current il
13307 offset and call superclass's CloseScope(int) with it.
13309 2005-02-23 Marek Safar <marek.safar@seznam.cz>
13311 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13312 CS1677 for out and ref as well.
13314 * class.cs (Method.Define): Add error CS1599 detection.
13316 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13318 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13320 * delegate.cs (Delegate.Define): Add error CS1599 detection.
13322 * support.cs.cs (ModifierDesc): New helper method.
13324 2005-02-23 Raja R Harinath <rharinath@novell.com>
13325 Abin Thomas <projectmonokochi@rediffmail.com>
13326 Anoob V E <projectmonokochi@rediffmail.com>
13327 Harilal P R <projectmonokochi@rediffmail.com>
13329 Fix #57851, #72718.
13330 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13331 MemberLookup (used for error reporting) actually returns a result.
13332 Fix error report number (122, not 112).
13334 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
13335 Anoob V E <projectmonokochi@rediffmail.com>
13336 Harilal P R <projectmonokochi@rediffmail.com>
13339 * pending.cs (PendingImplementation.GetAbstractMethods):
13340 Find NonPublic members too.
13342 2005-02-22 Marek Safar <marek.safar@seznam.cz>
13344 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13347 * class.cs (MethodCore.CheckMethodAgainstBase):
13348 Add error 239 report.
13350 2005-02-21 Raja R Harinath <rharinath@novell.com>
13353 * expression.cs (Invocation.IsApplicable): Make public.
13354 (Invocation.IsParamsMethodApplicable): Likewise.
13355 * delegate.cs (Delegate.VerifyApplicability): Don't use
13356 Invocation.VerifyArgumentCompat for parameter applicability
13357 testing. Use Invocation.IsApplicable and
13358 Invocation.IsParamsMethodApplicable.
13360 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13362 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13364 * class.cs (Operator.Define): Add error 217 report.
13366 2005-02-21 Raja R Harinath <rharinath@novell.com>
13368 * namespace.cs (UsingEntry.Resolve): Undo change below.
13370 2005-02-21 Raja R Harinath <rharinath@novell.com>
13373 * ecore.cs (Expression.MemberLookupFailed): Add argument to
13374 disable the error message when the extended MemberLookup also
13376 (Expression.MemberLookupFinal): Update.
13377 (SimpleName.DoSimpleNameResolve): Update.
13378 * expression.cs (MemberAccess.ResolveNamespaceOrType):
13379 Don't use MemberLookupFinal.
13380 (New.DoResolve): Update.
13381 (BaseAccess.CommonResolve): Update.
13383 2005-02-21 Raja R Harinath <rharinath@novell.com>
13386 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13387 occured previously, don't resolve again.
13389 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13392 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13393 argument. Call ResolveAttributeUsage for unresolved.
13394 when types doesn't match ctor arguments.
13396 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13397 for nested attribute classes.
13398 (Class.attribute_usage): Removed.
13399 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13400 for attribute class.
13402 * ecore.cs (IsAttribute): Removed.
13404 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13406 * rootcontext.cs (RegisterAttribute): Removed, attributes are
13408 (attribute_types): Removed.
13409 (EmitCode): Global attributes are emited as the latest.
13411 2005-02-18 Marek Safar <marek.safar@seznam.cz>
13413 * class.cs (EmitFieldInitializers): Don't emit field initializer
13414 for default values when optimilization is on.
13416 * constant.cs (Constant.IsDefaultValue): New property.
13418 * driver.cs: Add /optimize handling.
13422 * literal.cs: Implement new IsDefaultValue property.
13424 * rootcontext.cs (Optimize): New field, holds /optimize option.
13426 2005-02-18 Raja R Harinath <rharinath@novell.com>
13428 Fix crasher in re-opened #72347.
13429 * namespace.cs (Namespace.Lookup): Return null if
13430 DeclSpace.DefineType returns null.
13433 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13435 2005-02-18 Raja R Harinath <rharinath@novell.com>
13437 Fix remainder of #63202. Change semantics of DoResolveLValue: it
13438 now returns null if it cannot resolve to an lvalue.
13439 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13440 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13441 returned null. Remove check for SimpleName.
13442 (EventExpr.DoResolveLValue): New.
13443 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13444 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
13446 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
13447 avoid CS0131 error.
13448 (Unary.ResolveOperator): Move CS0211 check ...
13449 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
13451 (Unary.DoResolveLValue): Simplify.
13452 (AddressOf.DoResolveLValue): New.
13453 (ArrayAccess.DoResolveLValue): New.
13455 2005-02-16 Marek Safar <marek.safar@seznam.cz>
13457 * attribute.cs (Attribute.Resolve): Add arguments casting for
13458 when types doesn't match ctor arguments.
13460 2005-02-16 Raja R Harinath <rharinath@novell.com>
13462 Fix parts of #63202.
13463 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13464 lookup of operator in base type. Ensure that all checks happen
13465 when the operator resolves to an "op_..." method.
13467 2005-02-15 Raja R Harinath <rharinath@novell.com>
13470 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13471 'ignore_cs0104' parameter. Pass it to ...
13472 (NamespaceEntry.Lookup): ... this.
13473 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13474 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13475 (TypeLookupExpression.DoResolveAsTypeStep): Update.
13476 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13477 Update. Request that cs0104 errors be ignored.
13478 (ComposedCast.ResolveAsTypeStep): Update.
13480 2005-02-14 Raja R Harinath <rharinath@novell.com>
13483 * expression.cs (Invocation.BetterFunction): Remove support for
13484 comparing virtual functions and their overrides.
13485 (Invocation.IsOverride): New.
13486 (Invocation.OverloadResolve): Don't consider 'override' functions
13487 during candidate selection. Store them in a lookaside list.
13488 If the selected method is a 'virtual' function, use the list to
13489 find any overrides that are closer to the LHS type.
13491 2005-02-14 Marek Safar <marek.safar@seznam.cz>
13493 * expression.cs (New.DoResolve): Add complex core type reduction.
13494 (New.Constantify): Converts complex core type syntax like 'new int ()'
13495 to simple constant.
13497 2005-02-14 Raja R Harinath <rharinath@novell.com>
13499 * decl.cs (EntryType.EntryType): New constructor to create an
13500 updated copy of a cache entry.
13501 (MemberCache.AddMethods): Use it.
13502 (MemberCache.ClearDeclaredOnly): Remove.
13503 (MemberCache.MemberCache): Update.
13505 2005-02-11 Miguel de Icaza <miguel@novell.com>
13507 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13508 variable. This one is represents the actual low-level declaration
13509 of the method, as opposed to the semantic level `IsStatic'.
13511 An anonymous method which is hosted into a static method might be
13512 actually an instance method. IsStatic would reflect the
13513 container, while MethodIsStatic represents the actual code
13516 * expression.cs (ParameterReference): Use the new MethodIsStatic
13517 instead of IsStatic.
13519 * anonymous.cs (AnonymousMethod.Compatible): Pass the
13520 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13521 set on the current EmitContext.
13523 * expression.cs (Cast): Overload DoResolveLValue so we can pass
13524 resolve our casted expression as an LValue. This triggers the
13525 proper LValue processing that is later required by Assign.
13529 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13531 2005-02-11 Marek Safar <marek.safar@seznam.cz>
13533 C# 2.0 Fixed buffer implementation
13535 * anonymous.cs: Update after RegisterHelperClass renaming.
13537 * attribute.cs (AttributeTester.fixed_buffer_cache):
13538 Cache of external fixed buffers.
13539 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13540 implementation if field is fixed buffer else null.
13543 (TypeContainer.AddField): Accept FieldMember instead of Field.
13544 (FieldBase.IsFieldClsCompliant): Extracted code from
13545 VerifyClsCompliance descendant customization.
13546 (FixedField): New class handles fixed buffer fields.
13547 (FixedFieldExternal): Keeps information about imported fixed
13549 (IFixedField): Make access to internal or external fixed buffer
13552 * cs-parser.jay: Add fixed buffer parsing.
13554 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13557 * expression.cs (Indirection): Extended implementation to accept
13558 fixed buffer field.
13559 (PointerArithmetic.Emit): Get element from fixed buffer as well.
13560 (ElementAccess.MakePointerAccess): Get type as parameter.
13561 (DoResolve): Add fixed buffer field expression conversion.
13562 (DoResolveLValue): Ditto.
13563 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13564 (ArrayPtr): Derives from FixedBufferPtr.
13565 (ArrayPtr.Emit): Add extra emit for array elements.
13567 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13569 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13570 for compiler generated types.
13571 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13573 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13574 and consume less memory.
13575 (Fixed.Resolve): Add fixed buffer case.
13577 * typemanager.cs (compiler_generated_attr_ctor,
13578 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13579 (HasElementType): Add our own implementation to work on every
13582 2005-02-11 Miguel de Icaza <miguel@novell.com>
13584 * anonymous.cs (CaptureContext): Track whether `this' has been
13587 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13588 only captured `this' if it was implicitly done (instance
13589 methods/variables were used).
13591 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13592 `this' must be captured.
13594 2005-01-30 Miguel de Icaza <miguel@novell.com>
13596 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13597 is null it means that there has been no need to capture anything,
13598 so we just create a sibling.
13600 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13602 Just a partial fix. The other half is fairly elusive.
13604 2005-02-10 Raja R Harinath <rharinath@novell.com>
13606 Fix #52586, cs0121-4.cs.
13607 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13608 and return a hashtable.
13609 (MemberCache.ClearDeclaredOnly): New.
13610 (MemberCache.MemberCache): Update to change. Make a deep copy of
13611 the method_hash of a base type too.
13612 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13613 type methods. Overwrite entries with the same MethodHandle so
13614 that the ReflectedType is correct. The process leaves in base
13615 virtual functions and their overrides as distinct entries.
13616 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13617 matters since it was boxed in a ArrayList before.
13618 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13620 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13621 case of a virtual function and its override (choose the overload
13623 (Invocation.OverloadResolve): Avoid 'override' members during
13624 'applicable_type' calculation.
13626 2005-02-09 Raja R Harinath <rharinath@novell.com>
13628 Combine two near-redundant caches.
13629 * typemanager.cs (method_params): Rename from method_internal_params.
13630 (TypeManager.GetParameterData): New. Replace
13631 Invocation.GetParameterData.
13632 (TypeManager.LookupParametersByBuilder): Remove.
13633 * expression.cs (Invocation.method_parameter_cache): Remove.
13634 (Invocation.GetParameterData): Remove.
13636 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13639 2005-02-08 Raja R Harinath <rharinath@novell.com>
13642 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13643 TypeManager.multicast_delegate_type is null, resolve it by looking
13644 up "System.MulticastDelegate".
13645 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13647 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13648 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13649 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13652 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13653 (LabeledStatement.AddReference): New. Set 'referenced'.
13654 (Goto.Resolve): Use it.
13656 2005-02-05 John Luke <john.luke@gmail.com>
13658 * driver.cs: remove duplicate -doc line in Usage ()
13660 2005-02-04 Raja R Harinath <rharinath@novell.com>
13662 * location.cs (Location.AddFile): Fix CS2002 error report.
13664 2005-02-02 Martin Baulig <martin@ximian.com>
13666 * delegate.cs (Delegate.DefineType): Report an internal error if
13667 TypeManager.multicast_delegate_type is null. See bug #72015 for
13670 2005-02-02 Raja R Harinath <rharinath@novell.com>
13672 Fix a crasher in a variant of #31984.
13673 * const.cs (Constant.CheckBase): New override that defers the
13674 new-or-override check in case the base type hasn't been populated
13676 (Constant.Define): Ensure the new-or-override check is performed.
13678 2005-02-01 Duncan Mak <duncan@ximian.com>
13680 * const.cs (LookupConstantValue): Check that `ce' is not null
13681 before calling GetValue ().
13683 2005-02-01 Raja R Harinath <rharinath@novell.com>
13685 Fix test-334.cs (#69519).
13686 * cs-parser.jay (using_alias_directive): Pass in an expression to
13687 NamespaceEntry.UsingAlias.
13688 (using_namespace_directive): Pass in an expression to
13689 NamespaceEntry.Using.
13690 (namespace_name): Don't flatten to a string.
13691 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13692 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13694 (NamespaceEntry.UsingEntry): Likewise.
13695 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13697 (NamespaceEntry.LookupForUsing): Remove.
13698 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13700 (NamespaceEntry.Lookup): Remove support for dotted names.
13702 2005-02-01 Raja R Harinath <rharinath@novell.com>
13704 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13706 (NamespaceEntry.ImplicitParent): Compute on demand.
13707 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13708 parallels the current.
13709 (NamespaceEntry.LookupForUsing): Use it.
13710 (NamespaceEntry.Lookup): If the current namespace-entry is
13711 implicit, don't search aliases and using tables.
13713 2005-02-01 Raja R Harinath <rharinath@novell.com>
13716 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13718 (TypeContainer.BaseCache): Compute on demand.
13719 (TypeContainer.FindMembers): Define constants and types if they're
13720 not already created.
13721 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13723 * const.cs (Constant.Define): Make idempotent.
13725 2005-01-29 Miguel de Icaza <miguel@novell.com>
13727 * pending.cs: Produce better code (no nops produced by using Ldarg
13730 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13731 i - 1' it should be arg + 1.
13735 2005-01-28 Raja R Harinath <rharinath@novell.com>
13737 * attribute.cs (Attribute.CheckAttributeType): Make private
13739 (Attribute.ResolveType): Make virtual.
13740 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13741 handling of RootContext.Tree.Types.
13743 2005-01-27 Raja R Harinath <rharinath@novell.com>
13745 Update attribute-handling to use the SimpleName/MemberAccess
13747 * cs-parser.jay (attribute): Pass in an expression to the
13748 constructors of Attribute and GlobalAttribute.
13749 * attribute.cs (Attribute): Take an expression for the name.
13750 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13751 passed in attribute name expression.
13752 (Attribute.CheckAttributeType): Use it.
13753 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13754 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13755 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13756 argument to prevent error messages if the lookup fails.
13758 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13760 * expression.cs (Indirection): Implemented IVariable interface
13761 to support indirection in AddressOf operator.
13762 (PointerArithmetic.Emit): Add optimalization for case where
13763 result can be precomputed.
13765 2005-01-26 Martin Baulig <martin@ximian.com>
13767 * class.cs (TypeContainer.AttributeTargets): Return the correct
13768 AttributeTargets depending on our `Kind' instead of throwing an
13769 exception; fixes #71632.
13771 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13774 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13777 2005-01-25 Raja R Harinath <rharinath@novell.com>
13780 * expression.cs (MemberAccess.DoResolve): Don't complain with
13781 cs0572 when the LHS of a member access has identical name and type
13784 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13787 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13789 Create custom PermissionSet only for PermissionSetAttribute.
13791 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13794 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13795 delegates in static class.
13797 2005-01-24 Martin Baulig <martin@ximian.com>
13799 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13800 merging an implicit block, just use its reachability.
13802 * statement.cs (Block.Resolve): Make the unreachable code check
13803 work wrt. implicit blocks; see test-337 from #63842.
13805 2005-01-21 Alp Toker <alp@atoker.com>
13807 * cs-parser.jay: destructor_declaration's container is PartialContainer
13808 not Class when partial types are used, so use Kind prop instead of
13811 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13813 * cs-parser.jay: Improve error reporting when an interface
13814 declares new types.
13816 2005-01-20 Dick Porter <dick@ximian.com>
13818 * support.cs: SeekableStreamReader fix from Sandor Dobos
13819 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13820 chars are read. Fixes bug 70369.
13822 2005-01-20 Raja R Harinath <rharinath@novell.com>
13824 * cs-parser.jay (catch_clause): Simplify current_block handling
13827 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13829 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13830 code with ImplicitStandardConversion to handle the implicit
13831 conversion of method groups into valid delegate invocations.
13833 The problem is that in parameter handling we were using this code
13834 path. Fixes bug #64698
13836 2005-01-19 Raja R Harinath <rharinath@novell.com>
13838 * cs-parser.jay: Fix several infelicities.
13839 - Avoid assigning to the parser value stack. Code like
13840 '$3 = null' is unclean. Synthesize a value for the code block
13842 - Avoid using oob_stack for storing location information. Use ...
13843 (_mark_): ... this. New (empty) rule. Saves the current location
13845 (foreach_statement): Avoid using oob_stack for current_block
13846 handling. Use technique used in for_statement and
13847 using_statement. Synthesize a value for the code block to store
13848 additional intermediate information.
13850 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13852 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13853 of a different type is only allowed to private fields of a
13854 containing type, not on fields of a base class.
13856 See test-174.cs and error cs0122-9.cs
13858 2005-01-13 Raja R Harinath <rharinath@novell.com>
13860 Fix test-335.cs (bug #58126).
13861 * cs-parser.jay (argument): Split out non-expression parts of the
13862 rule into 'non_simple_argument'.
13863 (invocation_expression): Support parenthesized invocations with
13864 multiple arguments, and with single non-simple arguments.
13866 2005-01-13 Raja R Harinath <rharinath@novell.com>
13868 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13871 2005-01-12 Raja R Harinath <rharinath@novell.com>
13873 Fix cs0038-1.cs, cs1640-6.cs.
13874 * ecore.cs (Expression.Resolve): Remove special-case for
13875 SimpleName in error-handling.
13876 (Expression.almostMatchedMembers): Relax access permission to
13878 (Expression.MemberLookupFailed): Handle duplicates in
13879 almostMatchedMembers list.
13880 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13881 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13882 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13883 overload if the passed in MemberInfo is a MethodBase.
13885 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13888 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13889 for non-CAS & merge permission sets properly.
13891 2005-01-11 Raja R Harinath <rharinath@novell.com>
13893 Improve standard-compliance of simple name and member access
13894 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13895 * ecore.cs (FullNamedExpression): New abstract base class
13896 for Namespaces and TypeExpressions.
13897 (ResolveFlags.SimpleName): Remove.
13898 (SimpleName): Remove support for dotted names.
13899 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13900 DeclSpace.FindType and DeclSpace.LookupType.
13901 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13902 (Expression.ExprClassName): Make member function.
13903 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13904 a namespace. Remove creation of dotted "SimpleName"s.
13905 (MemberAccess.DoResolve): Likewise.
13906 * decl.cs (DeclSpace.Cache): Make private.
13907 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13908 (DeclSpace.FindType): Update.
13909 (DeclSpace.LookupType): Move here from RootContext. Return a
13910 FullNamedExpression.
13911 * namespace.cs (Namespace): Derive from FullNamedExpression
13912 so that it can be part of expression resolution.
13913 (Namespace.Lookup): Return an FullNamedExpression.
13914 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13916 * rootcontext.cs (NamespaceLookup): Remove.
13917 (LookupType): Move to DeclSpace.
13918 * attribute.cs (CheckAttributeType): Update.
13919 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13920 (FindDocumentedTypeNonArray): Likewise.
13922 2005-01-11 Raja R Harinath <rharinath@novell.com>
13924 Fix cs0509.cs, cs1632.cs.
13925 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13926 is the same as IsInterface.
13927 (TypeContainer.GetClassBases): Likewise.
13928 * statement.cs (LabeledStatement.ig): New field.
13929 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13931 (LabeledStatement.DoEmit): Check that the label was created with
13932 the same ILGenerator.
13934 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13937 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13938 accessors to its properties.
13940 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13941 from accessors to property.
13943 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13946 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13947 only for overrides.
13949 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13951 * attribute.cs: Check for null and empty strings.
13953 I have lost another battle to Paolo.
13955 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13958 * class.cs (PropertyMethod): Set Parent field in ctors.
13959 (SetMethod.InternalParameters): Add unsafe switch hack.
13960 Override MarkForDuplicationCheck where it is appropriate.
13962 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13963 It says whether container allows members with the same name.
13964 Base default is no.
13965 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13966 Removed is_method parameter.
13968 2005-01-06 Duncan Mak <duncan@ximian.com>
13970 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13971 because the previous change led to incorrect reporting of CS1032
13972 ("Cannot define/undefine preprocessor symbols after first token in
13973 file"). Instead of using `tokens_seen' as the only flag that
13974 triggers CS1040, introduce `comments_seen'. This new flag is used
13975 to signify having seen comments on the current line, so it is
13976 unset after a newline.
13978 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13980 * doc.cs : When searching for a type, find nested type too.
13981 This fixes bug #71040.
13983 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13986 - Warn missing member comment on those classes which also does not
13987 have doc comments. Fixed bug #71041.
13988 - Don't warn missing doc comment on default constructor.
13991 2005-01-06 Duncan Mak <duncan@ximian.com>
13993 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13994 comments, set `tokens_seen' to true. This allows us to detect
13995 misplaced preprocessor directives (i.e. not at the beginning of
13996 the a line, nor after whitespaces). In that case, report error
13997 CS1040. This fixes bug #56460.
13999 * cs-parser.jay (interface_member_declaration): Add checks for
14000 IsExplicitImpl, and report CS0541 error if an interface member is
14001 defined as an explicit interface declaration.
14003 2005-01-06 Marek Safar <marek.safar@seznam.cz>
14006 * class.cs (PropertyMethod): Set Parent field in ctors.
14007 (SetMethod.InternalParameters): Add unsafe switch hack.
14009 * decl.cs (MemberCore.Parent): Cannot be readonly.
14011 2005-01-06 Raja R Harinath <rharinath@novell.com>
14013 * decl.cs (DeclSpace.ResolveType): Remove.
14014 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14015 Merge in code from ...
14016 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
14017 * class.cs, enum.cs: Update to changes.
14019 2005-01-06 Miguel de Icaza <miguel@ximian.com>
14021 * anonymous.cs: Ensure that we init the scope of our parent if it
14022 has not been initialized yet.
14024 2004-12-30 Duncan Mak <duncan@ximian.com>
14026 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14027 if field.FieldBuilder is null. Fixes #70758.
14029 * convert.cs: Fixed some typos and updated some of the comments.
14030 (ImplicitStandardConversionExists):
14031 (TryImplicitIntConversion): If `target_type' is an interface and
14032 the type of `ic' implements this interface, return true or a new
14033 BoxedCast instead of null. This fixes #70468.
14035 2004-12-29 Duncan Mak <duncan@ximian.com>
14037 * expression.cs (Argument.Emit): Check that Expr is
14038 IMemoryLocation before casting to it, and report CS1510 otherwise.
14042 2004-12-21 Ben Maurer <bmaurer@ximian.com>
14044 * statement.cs (Block.ThisVariable): remove the recursion here, to
14045 make the --profile more sane.
14047 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
14049 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14050 assembly, by JB Evain.
14052 2004-12-17 Raja R Harinath <rharinath@novell.com>
14054 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
14055 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14056 "parent" refers to enclosing type/class. "base" refers to superclass.
14058 2004-12-17 Raja R Harinath <rharinath@novell.com>
14060 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14061 Ensure that we only have GlobalAttributes.
14062 * attribute.cs (Attribute.Emit): Make non-virtual.
14063 (GlobalAttribute.Emit): Remove.
14064 (Attribute.Resolve): Make virtual.
14065 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
14066 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14067 the argument. Don't create one.
14068 (Attribute.GetObsoleteAttribute): Likewise.
14069 (Attribute.GetClsCompliantAttributeValue): Likewise.
14070 * class.cs, decl.cs: Update to changes.
14072 2004-12-17 Marek Safar <marek.safar@seznam.cz>
14074 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14076 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14078 * statement.cs (Foreach.Resolve): Add error 186 report.
14080 2004-12-16 Marek Safar <marek.safar@seznam.cz>
14082 * expression.cs (Conditional.DoResolve): Add warning 429.
14084 * statement.cs (If.Resolve): Add warning 665.
14086 2004-12-16 Raja R Harinath <rharinath@novell.com>
14088 New invariant: RootContext.Tree.Types.NamespaceEntry == null
14089 except when in the parser, and in GlobalAttribute.
14090 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14091 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14092 RootContext.Tree.Types.NamespaceEntry once work is done.
14093 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
14094 and resets RootContext.Tree.Types.NamespaceEntry.
14096 2004-12-15 Marek Safar <marek.safar@seznam.cz>
14098 * cs-parser.jay: Don't create a block for every variable.
14100 2004-12-14 Miguel de Icaza <miguel@ximian.com>
14102 * location.cs: Provide extra information.
14104 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14105 variables from the captured environment, it is the ldarg_0.
14107 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14109 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14112 * class.cs: Changed warning level for 169 to avoid developer
14113 displeasure from warning flooding. It will be changed back when they
14114 fix most of current BCL warnings.
14116 * RootContext.cs: Pushed default WarningLevel to 3.
14118 * statement.cs: Removed unused variable.
14120 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14122 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14123 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14124 Add error 502 report.
14125 (StaticClass.DefineType): Add error 441 report.
14126 (Class.AllowedModifiersProp): New virtual property as temporary
14127 extension to AllowedModifiers.
14128 (Class.DefineType): Add error 418 report. Moved ModFlags check here
14129 to share implementation with StaticClass and don't call virtual
14132 * driver.cs (MainDriver): Add error 1558 test.
14134 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14135 report. Moved error 36 test here.
14137 * statement.cs (Throw.Resolve): Add error 724 report.
14139 * typemanager.cs: Add out_attribute_type core type.
14141 2004-12-13 Marek Safar <marek.safar@seznam.cz>
14143 * class.cs (TypeContainer.VerifyClsCompliance): Add error
14145 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14147 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14150 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14152 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
14153 Add error 3023 report.
14154 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14156 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14159 2004-12-12 John Luke <john.luke@gmail.com>
14161 * driver.cs (AddArgs): take -- into account when
14162 adding arguments, fixes bug 65710
14164 2004-12-12 Martin Baulig <martin@ximian.com>
14166 * expression.cs (Unary.TryReduceNegative): Added support for
14167 SByteConstant and ByteConstant.
14168 (Unary.Reduce): Check error values from TryReduceNegative().
14170 2004-12-10 Marek Safar <marek.safar@seznam.cz>
14172 * attributes.cs (Attribute.Resolve): Avoid multiple error report
14173 and report exception as error 182.
14175 2004-12-10 Raja R Harinath <rharinath@novell.com>
14177 * driver.cs (Main): Fix message when there are warnings.
14179 2004-12-09 Miguel de Icaza <miguel@ximian.com>
14181 * delegate.cs: Fixed my fix from yesterday, sorry about that.
14183 2004-12-09 Marek Safar <marek.safar@seznam.cz>
14185 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
14186 Reduced number of warnings.
14188 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14190 2004-12-08 Miguel de Icaza <miguel@ximian.com>
14192 * driver.cs: Removed message.
14194 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14196 2004-12-08 <vargaz@freemail.hu>
14198 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14200 2004-12-08 Martin Baulig <martin@ximian.com>
14202 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14203 instead of a CS3002 for properties and indexer.
14205 2004-12-08 Martin Baulig <martin@ximian.com>
14207 * decl.cs (MemberName.ToString): Make this work again.
14209 2004-12-08 Marek Safar <marek.safar@seznam.cz>
14211 * attribute.cs (Resolve): Add error 591 detection.
14213 * class.cs (FieldMember.Define): Add error 1547 detection.
14214 (Indexer.Define): Add error 620 detection.
14215 (Operator.Define): Add error 590 detection.
14217 * ecore.cs: Missing argument for error 79.
14219 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14222 2004-12-07 Marek Safar <marek.safar@seznam.cz>
14225 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14228 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
14230 * cs-parser.jay : handle doc comments on implicit/explicit operators.
14231 Some operator comments were suppressed.
14232 * doc.cs : Implicit/explicit operator name in doc comments are like
14233 "op_Explicit(type)~returnType", so added suffix handling.
14235 2004-12-07 Martin Baulig <martin@ximian.com>
14238 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14239 (MemberCore.GetClsCompliantAttributeValue): Likewise.
14240 (DeclSpace.ec): New protected field; store the EmitContext here.
14241 (DeclSpace.EmitContext): New public property; moved here from
14243 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14246 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14247 (Enum.Emit): Don't create a new EmitContext.
14249 * delegate.cs (Delegate.DefineType): Always create the
14252 * iterators.cs (Iterators.DefineIterator): Create a new
14253 EmitContext and store it in `ec'.
14255 2004-08-24 Martin Baulig <martin@ximian.com>
14258 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14259 this for accessibility checks.
14260 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14261 IsNestedFamilyAccessible.
14262 (TypeManager.IsSubclassOf): New method, do what the name actually
14265 2004-12-06 Raja R Harinath <rharinath@novell.com>
14267 Fix crash on cs0657-17.cs.
14268 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14269 Use RootContext.Tree.Types, not 'new RootTypes ()'.
14270 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14271 the case where the NamespaceEntry gets overwritten.
14273 2004-12-06 Marek Safar <marek.safar@seznam.cz>
14275 Fixed #69195, #56821
14276 * ecore.cs (ResolveBoolean): Tiny refactoring.
14278 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14279 of right expression resolving when left is false constant and
14280 operator is LogicalAnd OR true constant and operator is LogicalOr.
14282 * statement.cs (ResolveUnreachable): Always reports warning.
14284 2004-12-05 Miguel de Icaza <miguel@ximian.com>
14286 * class.cs: Distinguish between 1721 and 1722 (just a little help
14287 for the programmer).
14289 2004-12-03 Miguel de Icaza <miguel@ximian.com>
14291 * delegate.cs: Only allow this on new versions of the language.
14293 2004-12-02 Duncan Mak <duncan@ximian.com>
14295 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14297 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14298 here as a static method. Take an additional bool out parameter
14299 `must_do_cs1540_check' for signaling to InstanceResolve.
14300 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14301 member field from PropertyExpr class and made it an argument of
14302 the method instead.
14303 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14304 check for MarshalByRefObject, and report CS0122 instead of CS1540.
14305 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14306 and `remove_accessor' as well as InstanceResolve: report CS0122
14311 2004-12-03 Raja R Harinath <rharinath@novell.com>
14313 Fix test-327.cs, test-328.cs, and put in early infrastructure
14314 for eventually fixing #52697.
14315 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14316 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14317 from other methods.
14318 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14319 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14320 (VerifyUsing, error246): Update.
14321 * rootcontext.cs (RootContext.NamespaceLookup): Just use
14322 'NamespaceEntry.LookupNamespaceOrType'.
14324 2004-12-03 Martin Baulig <martin@ximian.com>
14326 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14327 method as our child, call AnonymousMethod.Compatible() on it.
14329 2004-12-03 Raja R Harinath <rharinath@novell.com>
14331 Disable XML documentation support in 'basic' profile.
14332 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14333 Redirect XmlElement to System.Object.
14334 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14335 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14336 * mcs.exe.sources: Add doc-bootstrap.cs.
14337 * doc-bootstrap.cs: New file. Contains empty stub implementation
14340 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
14342 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14343 comments are allowed.
14345 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14347 * delegate.cs: Add checks for subtypes in paramaters and return values
14348 in VerifyMethod () to add support for Covariance/Contravariance
14351 2004-12-02 Miguel de Icaza <miguel@ximian.com>
14353 * report.cs: Remove extra closing parenthesis.
14355 * convert.cs (Error_CannotImplicitConversion): If the name of the
14356 types are the same, provide some extra information.
14358 * class.cs (FieldBase): Use an unused bit field from the field to
14359 encode the `has_offset' property from the FieldMember. This saves
14360 a couple of Ks on bootstrap compilation.
14362 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14363 method as our child, return the AnonymousMethod resolved
14366 * expression.cs (New.DoResolve): Allow return values from
14367 NewDelegate to also include AnonymousMethods.
14371 2004-12-02 Marek Safar <marek.safar@seznam.cz>
14374 * attribute.cs (Resolve): Improved implementation of params
14375 attribute arguments.
14377 * support.cs (ParameterData): Add HasParams to be faster.
14379 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
14381 all things are for /doc support:
14383 * doc.cs: new file that supports XML documentation generation.
14384 * mcs.exe.sources: added doc.cs.
14386 Handle /doc command line option.
14387 Report error 2006 instead of 5 for missing file name for /doc.
14388 Generate XML documentation when required, after type resolution.
14390 Added support for picking up documentation (/// and /** ... */),
14391 including a new XmlCommentState enumeration.
14393 Added lines to fill Documentation element for field, constant,
14394 property, indexer, method, constructor, destructor, operator, event
14395 and class, struct, interface, delegate, enum.
14396 Added lines to warn incorrect comment.
14398 Added Documentation field (passed only when /doc was specified).
14400 Added DocComment, DocCommentHeader, GenerateDocComment() and
14401 OnGenerateDocComment() and some supporting private members for
14402 /doc feature to MemberCore.
14404 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14406 Added overriden DocCommentHeader.
14408 Added overriden DocCommentHeader and GenerateDocComment().
14410 2004-12-01 Miguel de Icaza <miguel@ximian.com>
14412 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14413 unwrapping the enumeration values, chain to
14414 DoConstantNumericPromotions again, so we can promote things to the
14415 fundamental types (takes care of enums that are bytes, sbytes).
14419 2004-12-01 Raja R Harinath <rharinath@novell.com>
14421 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14422 Fix long-standing bug in type-lookup. Use FindType instead of
14423 LookupType when ec.ResolvingTypeTree.
14424 (Attribute.ResolveType, Attribute.Resolve)
14425 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14427 (Attributes.Search): Remove internal version. Update.
14428 (Attributes.SearchMulti): Update.
14429 (Attributes.GetClsCompliantAttribute): Remove.
14430 (Attributes.GetIndexerNameAttribute): Remove.
14431 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14432 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14433 * class.cs (Indexer.Define): Likewise.
14435 2004-12-01 Marek Safar <marek.safar@seznam.cz>
14438 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14439 MarshallByReference members access.
14441 * expression.cs: Use CheckMarshallByRefAccess;
14442 Better error CS0197 message.
14444 * report.cs: Print whole related error message.
14446 2004-11-30 Raja R Harinath <rharinath@novell.com>
14448 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14449 the current directory to help debugging.
14451 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14453 * class (GetClassBases): Better error 60 report.
14454 (EventProperty): Disabled warning 67 detection.
14456 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14459 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14461 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14464 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14467 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14469 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14471 2004-11-26 Miguel de Icaza <miguel@ximian.com>
14473 * attribute.cs (Attribute.Resolve): Refine error reporting and
14474 report a cs0117 if the identifier does not exist, to distinguish
14475 from 0617 which is a miss-use of the actual identifier.
14477 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14478 between cs0070 and cs0079.
14480 * class.cs (MemberBase.DoDefine): When reporting a wrong
14481 accessibility level, we use MethodCore to compare instead of
14482 Method (this was a regression in some refactoring effort).
14484 So now we correctly report cs0056 again.
14486 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14487 testing the target_type (which was known to be object_type) and
14488 not the source type (which is anonymous_method).
14490 Fixed reporting of error cs1660.
14492 * expression.cs (UserCast.Source): Expose the underlying cast.
14494 * statement.cs (Switch.SwitchGoverningType): Sort the list of
14495 allowed types to find a match to int32 first (most common).
14497 In addition, it ignores any ImplicitUserConversions that did an
14498 internal implicit conversion (as the switch statement allows only
14499 one integral conversion to exist).
14501 * class.cs (PartialContainer.Create): rename `name' to
14502 `member_name' for clarity. Then replace the string calls with a
14503 call to MemberName.GetPartialName, as now using
14504 MemberName.ToString is an error (this is due to the side effects
14505 it had, that were fixed in the past).
14507 This will restore the error reporting on a number of partial class
14508 errors that were missusing this (and getting an exception as a
14509 results, which is now just a plain textual warning, because
14510 yyparse debug output would crash otherwise).
14512 2004-11-26 Raja R Harinath <rharinath@novell.com>
14514 * Makefile (PROGRAM_INSTALL_DIR): Remove.
14516 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14518 * rootcontext.cs (LookupType): Make sure to cache lookups that
14519 don't give us a negative result. This saves about 5% of corlib
14522 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14524 * report.cs (AbstractMessage.Print): messages are sent to stderr
14526 * class.cs (TypeContainer.GetClassBases): It is an error to have a
14527 non-interface in the list of interfaces (at this point, either
14528 parent was properly set, or a base class is being listed in the
14529 interfaces section).
14531 This flags error 1722, and resolves the crash from bug 69259.
14533 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14535 * statement.cs (Using.EmitExpressionFinally): make this work right
14536 for valuetypes. Fixes 69926.
14538 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14540 * const.cs (Const.ChangeType): Cope with the "0 literal can be
14541 converted to an enum" here, before we try to change the underlying
14542 type. This code exists, but it is a different code path than the
14543 one used while encoding constants.
14545 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14546 old bug: when converting from the null literal to a pointer,
14547 return an EmptyCast, not the NullLiteral.
14549 This fixes #69921, the recent null_type changes probably made this
14550 bug more prominent.
14552 (ImplicitReferenceConversionExists): In addition, resynchronized
14553 the code here, so it matches the same code in
14554 ImplicitReferenceConversionExists for the `from any class-type S
14555 to any interface-type T'.
14558 2004-11-25 Marek Safar <marek.safar@seznam.cz>
14560 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14562 2004-11-24 Miguel de Icaza <miguel@ximian.com>
14564 * cs-parser.jay: Use verbosity accordingly.
14566 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14568 * expression.cs (Unary.ResolveOperator): Do not report warning;
14569 AddressOf reads from variable.
14571 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14573 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14577 * attribute.cs (Attributable): Removed CheckTargets.
14578 (Attributes.Emit): Explicit attribute targets are tested here.
14580 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14581 not enabled for interfaces.
14583 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14584 (GetAssemblyName): Ouch next bug there.
14586 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14588 * expression.cs: Error 275 added.
14590 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14592 Fix bug #69177 (Implemented decimal constant support)
14594 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14595 (BinaryFold): Add DecimalConstant.
14597 * const.cs (Define): Decimal constant
14599 (ChangeType): Add decimal type handling.
14600 (LookupConstantValue): Don't set value for decimal type but
14601 emit DecimalConstantAttribute. Needed for constant optimization.
14603 * constant.cs (ToDecimal): New method.
14604 (ConvertToDecimal): New method.
14605 (IntConstant): Implemented ConvertToDecimal.
14606 (DecimalConstant.Emit): Emit optimized version for decimals in
14609 * expression.cs (ResolveOperator): Changed order of constant
14610 reduction to work correctly with native types which have
14611 overloaded operators.
14612 (ResolveMemberAccess): Extract constant value from attribute
14615 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14617 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14618 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14619 (ChangeType): Decimal is special.
14620 (TypeToCoreType): Add decimal type.
14622 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14624 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14627 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14629 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14632 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14634 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14636 * pending.cs (PendingImplementation): Grab only interfaces.
14638 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14640 * statement.cs (ForeachHelperMethods): Add location member and
14641 error 202 detection.
14643 2004-11-19 Raja R Harinath <rharinath@novell.com>
14645 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14646 automatically handled by executable.make.
14647 (PROGRAM): Make profile-specific.
14649 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14651 * expression.cs (DoResolveBase): Fixed wrong warning for out
14654 2004-11-18 Martin Baulig <martin@ximian.com>
14656 Merged latest changes into gmcs. Please keep this comment in
14657 here, it makes it easier for me to see what changed in MCS since
14658 the last time I merged.
14660 2004-11-17 Raja R Harinath <rharinath@novell.com>
14662 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14663 (TypeHandle.GetMemberCache): New.
14664 (TypeHandle.TypeHandle): Update.
14665 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14666 (TypeManager.LookupParentInterfacesCache):
14667 Rename from LookupInterfaceCache. Optimize slightly.
14668 (TypeManager.MemberLookup_FindMembers): Update.
14669 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14670 multi-type variant.
14671 (AddCacheContents): Rename from AddHashtable.
14672 * class.cs (TypeContainer.parent_container): Remove.
14673 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14674 (TypeContainer.DoDefineMembers): Don't initialize it.
14675 Update to name changes.
14677 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14679 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14680 that factors the code to check access modifiers on override.
14682 (PropertyBase): Use the code here.
14684 Patch from Lluis S'anchez, fixes bug #69361.
14686 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14688 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14689 routine that is used to report the use of a captured variable
14690 whose address has been taken.
14692 There are two checks: one when variables are being captured and
14693 the other check is when the address of a variable is taken.
14695 (because an anonymous methods might be resolved before *or* after
14696 the address has been taken) and
14698 * expression.cs (Conditional.DoResolve): Remove the special
14699 casing that Martin added to trueExpr and falseExpr being both
14700 NullLiteral. We get the right behavior now just by introducing
14701 the null_type into the compiler.
14703 * convert.cs (ExplicitConversion): Change the code to use
14704 null_type instead of testing `expr is NullLiteral'.
14705 (ImplicitConversionStandard): use null_type too.
14706 (ImplicitReferenceConversionExists): use null_type too.
14707 (ImplicitReferenceConversion): use null_type too.
14709 * literal.cs: The type of `NullLiteral' is now null_type instead
14711 (Resolve): Set the type here.
14713 * typemanager.cs: Introduce null_type.
14715 2004-11-17 Martin Baulig <martin@ximian.com>
14717 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14718 direction, like FindMembers() does. Fixes #69546, testcase is in
14721 2004-11-16 Martin Baulig <martin@ximian.com>
14723 This is based on a patch from Marek Safar, see bug #69082.
14724 Fixes bugs #63705 and #67130.
14726 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14727 method; create a MemberCache for an interface type and cache the
14730 * decl.cs (IMemberContainer.ParentContainer): Removed.
14731 (IMemberContainer.ParentCache): New property.
14732 (MemberCache.SetupCacheForInterface): Removed.
14733 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14734 to create a cache for an interface's "parent".
14736 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14739 2004-11-16 Martin Baulig <martin@ximian.com>
14741 Merged back from gmcs; these changes already went into gmcs a
14742 couple of weeks ago.
14745 (TypeManager.AddUserType): Removed the `ifaces' argument.
14746 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14748 (TypeManager.AddUserInterface): Removed.
14749 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14751 (TypeManager.GetInterfaces): Likewise.
14752 (TypeManager.GetExplicitInterfaces): Likewise.
14754 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14756 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14757 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14759 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14761 * statement.cs: Avoid adding bools to a hashtable.
14763 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14765 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14766 calling an unsafe method from a safe location.
14768 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14771 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14773 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14775 * namespace.cs (VerifyUsing): use GetPartialName instead of
14778 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14780 * statement.cs (Return.Resolve): Fix regression in typo: if
14781 `in_exc', we have to request a NeedReturnLabel, this was a typo
14782 introduced in the anonymous method check-in. Fixes #69131.
14784 * Indexers were using the ShortName when defining themselves,
14785 causing a regression in the compiler bootstrap when applying the
14786 patch from 2004-11-02 (first part), now they use their full name
14787 and the bug is gone.
14789 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14791 * driver.cs: Strip the path from the names of embedded resources. Fixes
14794 2004-11-04 Raja R Harinath <rharinath@novell.com>
14796 Fix error message regression: cs0104-2.cs.
14797 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14798 (AliasEntry.Resolve): Update.
14799 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14801 (RootContext.LookupType): Update.
14803 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14805 * cs-parser.jay: Add support for handling accessor modifiers
14806 * class: Add support port accessor modifiers and error checking,
14807 define PropertyMethod.Define as virtual (not abstract anymore)
14808 * ecore.cs: Add checking for proeprties access with access modifiers
14809 * iterators.cs: Modify Accessor constructor call based in the modified
14811 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14813 * expression.cs (StringConcat): Handle being called twice,
14814 as when we have a concat in a field init with more than two
14817 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14819 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14820 special case explicit implementations, we should always produce
14821 the .property or .event declaration.
14823 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14824 since it will not return correct data if people use this
14825 unresolved in the presence of using statements (see test-313).
14827 * class.cs (MethodData.Define): If we are an explicit interface
14828 implementation, set the method name to the full name of the
14829 interface plus the name of the method.
14831 Notice that using the method.MethodName.GetFullName() does not
14832 work, as it will only contain the name as declared on the source
14833 file (it can be a shorthand in the presence of using statements)
14834 and not the fully qualifed type name, for example:
14838 class D : ICloneable {
14839 object ICloneable.Clone () {
14843 Would produce a method called `ICloneable.Clone' instead of
14844 `System.ICloneable.Clone'.
14846 * namespace.cs (Alias.Resolve): Use GetPartialName.
14848 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14850 * cs-parser.jay: Add error 1055 report.
14852 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14854 * assign.cs (Assign.DoResolve): Only do the transform of
14855 assignment into a New if the types are compatible, if not, fall
14856 through and let the implicit code deal with the errors and with
14857 the necessary conversions.
14859 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14861 * cs-parser.jay: Add error 1031 report.
14863 * cs-tokenizer.cs: Add location for error 1038.
14865 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14867 * cs-parser.jay: Add error 1016 report.
14869 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14871 * cs-parser.jay: Add errors 1575,1611 report.
14873 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14875 * cs-parser.jay: Add error 1001 report.
14877 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14880 * attribute.cs (GetMarshal): Add method argument for
14881 caller identification.
14883 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14884 agument for GetMarshal and RuntimeMissingSupport.
14886 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14888 * attribute.cs (ExtractSecurityPermissionSet): Removed
14889 TypeManager.code_access_permission_type.
14891 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14893 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14895 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14896 for obsolete use of a variable here. Fixes regression on errors
14897 cs0619-25 and cs0619-26.
14899 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14901 Fix #62358, implemented security attribute encoding.
14903 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14904 Tests permitted SecurityAction for assembly or other types.
14905 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14906 data from SecurityPermissionAttribute to PermisionSet class.
14908 * class.cs (ApplyAttributeBuilder): Added special handling
14909 for System.Security.Permissions.SecurityAttribute based types.
14911 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14912 special handling for System.Security.Permissions.SecurityAttribute
14915 * enum.cs (ApplyAttributeBuilder): Added special handling
14916 for System.Security.Permissions.SecurityAttribute based types.
14918 * parameter.cs (ApplyAttributeBuilder): Added special handling
14919 for System.Security.Permissions.SecurityAttribute based types.
14921 * rootcontext.cs: Next 2 core types.
14923 * typemanager.cs (TypeManager.security_permission_attr_type):
14924 Built in type for the SecurityPermission Attribute.
14925 (code_access_permission_type): Build in type.
14927 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14929 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14930 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14931 all of this information into
14932 EmitContext.EmitCapturedVariableInstance.
14934 * codegen.cs (EmitCapturedVariableInstance): move here the
14935 funcionality of emitting an ldarg.0 in the presence of a
14936 remapping. This centralizes the instance emit code.
14938 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14939 then emit a load of this: it means that we have reached the
14940 topmost ScopeInfo: the one that contains the pointer to the
14941 instance of the class hosting the anonymous method.
14943 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14944 captures to the topmost CaptureContext.
14946 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14948 * expression.cs (LocalVariableReference): Move the knowledge about
14949 the iterators into codegen's EmitCapturedVariableInstance.
14951 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14953 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14954 all code paths return a value from an anonymous method (it is the
14955 same as the 161 error, but for anonymous methods).
14957 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14959 The introduction of anonymous methods in the compiler changed
14960 various ways of doing things in the compiler. The most
14961 significant one is the hard split between the resolution phase
14962 and the emission phases of the compiler.
14964 For instance, routines that referenced local variables no
14965 longer can safely create temporary variables during the
14966 resolution phase: they must do so from the emission phase,
14967 since the variable might have been "captured", hence access to
14968 it can not be done with the local-variable operations from the runtime.
14972 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14973 is a toplevel block.
14975 (ToplevelBlock): A new kind of Block, these are the blocks that
14976 are created by the parser for all toplevel method bodies. These
14977 include methods, accessors and anonymous methods.
14979 These contain some extra information not found in regular blocks:
14980 A pointer to an optional CaptureContext (for tracking captured
14981 local variables and parameters). A pointer to the parent
14984 (Return.Resolve): Catch missmatches when returning a value from an
14985 anonymous method (error 1662).
14986 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14989 (Break.Resolve): ditto.
14991 (SwitchLabel): instead of defining the labels during the
14992 resolution phase, we now turned the public ILLabel and ILLabelCode
14993 labels into methods called GetILLabelCode() and GetILLabel() that
14994 only define the label during the Emit phase.
14996 (GotoCase): Track the SwitchLabel instead of the computed label
14997 (its contained therein). Emit the code by using
14998 SwitchLabel.GetILLabelCode ().
15000 (LocalInfo.Flags.Captured): A new flag has been introduce to track
15001 whether the Local has been captured or not.
15003 (LocalInfo.IsCaptured): New property, used to tell whether the
15004 local has been captured.
15006 * anonymous.cs: Vastly updated to contain the anonymous method
15009 The main classes here are: CaptureContext which tracks any
15010 captured information for a toplevel block and ScopeInfo used to
15011 track the activation frames for various local variables.
15013 Each toplevel block has an optional capture context associated
15014 with it. When a method contains an anonymous method both the
15015 toplevel method and the anonymous method will create a capture
15016 context. When variables or parameters are captured, they are
15017 recorded on the CaptureContext that owns them, for example:
15021 MyDelegate d = delegate {
15026 Here `a' will be recorded as captured on the toplevel
15027 CapturedContext, the inner captured context will not have anything
15028 (it will only have data if local variables or parameters from it
15029 are captured in a nested anonymous method.
15031 The ScopeInfo is used to track the activation frames for local
15032 variables, for example:
15034 for (int i = 0; i < 10; i++)
15035 for (int j = 0; j < 10; j++){
15036 MyDelegate d = delegate {
15041 At runtime this captures a single captured variable `i', but it
15042 captures 10 different versions of the variable `j'. The variable
15043 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15044 recorded on a child.
15046 The toplevel ScopeInfo will also track information like the `this'
15047 pointer if instance variables were referenced (this is necessary
15048 as the anonymous method lives inside a nested class in the host
15049 type of the method).
15051 (AnonymousMethod): Expanded to track the Toplevel, implement
15052 `AnonymousMethod.Compatible' to tell whether an anonymous method
15053 can be converted to a target delegate type.
15055 The routine now also produces the anonymous method content
15057 (AnonymousDelegate): A helper class that derives from
15058 DelegateCreation, this is used to generate the code necessary to
15059 produce the delegate for the anonymous method that was created.
15061 * assign.cs: API adjustments for new changes in
15062 Convert.ImplicitStandardConversionExists.
15064 * class.cs: Adjustments to cope with the fact that now toplevel
15065 blocks are of type `ToplevelBlock'.
15067 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15068 insteda of standard blocks.
15070 Flag errors if params arguments are passed to anonymous methods.
15072 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15073 `CurrentAnonymousMethod' which points to the current Anonymous
15074 Method. The variable points to the AnonymousMethod class that
15075 holds the code being compiled. It is set in the new EmitContext
15076 created for the anonymous method.
15078 (EmitContext.Phase): Introduce a variable and an enumeration to
15079 assist in enforcing some rules about when and where we are allowed
15080 to invoke certain methods (EmitContext.NeedsReturnLabel is the
15081 only one that enfonces this right now).
15083 (EmitContext.HaveCaptureInfo): new helper method that returns
15084 whether we have a CapturedContext initialized.
15086 (EmitContext.CaptureVariable): New method used to register that a
15087 LocalInfo must be flagged for capturing.
15089 (EmitContext.CapturedParameter): New method used to register that a
15090 parameters must be flagged for capturing.
15092 (EmitContext.CapturedField): New method used to register that a
15093 field must be flagged for capturing.
15095 (EmitContext.HaveCapturedVariables,
15096 EmitContext.HaveCapturedFields): Return whether there are captured
15097 variables or fields.
15099 (EmitContext.EmitMethodHostInstance): This is used to emit the
15100 instance for the anonymous method. The instance might be null
15101 (static methods), this (for anonymous methods that capture nothing
15102 and happen to live side-by-side with the current method body) or a
15103 more complicated expression if the method has a CaptureContext.
15105 (EmitContext.EmitTopBlock): Routine that drives the emission of
15106 code: it will first resolve the top block, then emit any metadata
15107 and then emit the code. The split is done so that we can extract
15108 any anonymous methods and flag any captured variables/parameters.
15110 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15111 during this phase, the ILGenerator should not be used as labels
15112 and local variables declared here might not be accessible to any
15113 code that is part of an anonymous method.
15115 Exceptions to this include the temporary variables that are
15116 created by some statements internally for holding temporary
15119 (EmitContext.EmitMeta): New routine, in charge of emitting all the
15122 (EmitContext.TemporaryReturn): This method is typically called
15123 from the Emit phase, and its the only place where we allow the
15124 ReturnLabel to be defined other than the EmitMeta. The reason is
15125 that otherwise we would have to duplicate a lot of logic in the
15126 Resolve phases of various methods that today is on the Emit
15129 (EmitContext.NeedReturnLabel): This no longer creates the label,
15130 as the ILGenerator is not valid during the resolve phase.
15132 (EmitContext.EmitThis): Extended the knowledge in this class to
15133 work in anonymous methods in addition to iterators.
15135 (EmitContext.EmitCapturedVariableInstance): This emits whatever
15136 code is necessary on the stack to access the instance to a local
15137 variable (the variable will be accessed as a field).
15139 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15140 EmitContext.EmitAddressOfParameter): Routines to support
15141 parameters (not completed at this point).
15143 Removals: Removed RemapLocal and RemapLocalLValue. We probably
15144 will also remove the parameters.
15146 * convert.cs (Convert): Define a `ConstantEC' which points to a
15147 null. This is just to prefity some code that uses
15148 ImplicitStandardConversion code and do not have an EmitContext
15151 The idea is to flag explicitly that at that point in time, it is
15152 known that the conversion will not trigger the delegate checking
15153 code in implicit conversions (which requires a valid
15156 Everywhere: pass new EmitContext parameter since
15157 ImplicitStandardConversionExists now requires it to check for
15158 anonymous method conversions.
15160 (Convert.ImplicitStandardConversionExists): If the type of an
15161 expression is the anonymous_method_type, and the type is a
15162 delegate, we invoke the AnonymousMethod.Compatible method to check
15163 whether an implicit conversion is possible.
15165 (Convert.ImplicitConversionStandard): Only do implicit method
15166 group conversions if the language level is not ISO_1.
15168 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15169 MethodInfo for the Invoke method. used by Delegate and
15172 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15173 method conversions if the target type is a delegate.
15175 Removed extra debugging nops.
15177 (LocalVariableReference): Turn the `local_info' into a public
15180 Add `prepared' field, the same hack used for FieldExprs to cope
15181 with composed assignments, as Local variables do not necessarily
15182 operate purely on the stack as they used to: they can be captured
15185 Add `temp' for a temporary result, like fields.
15187 Refactor DoResolve and DoResolveLValue into DoResolveBase.
15189 It now copes with Local variables that are captured and emits the
15190 proper instance variable to load it from a field in the captured
15193 (ParameterReference.DoResolveBase): During the resolve phase,
15194 capture parameters if we are in an anonymous method.
15196 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15197 anonymous method, use the EmitContext helper routines to emit the
15198 parameter reference.
15200 * iterators.cs: Set RemapToProxy to true/false during the
15203 * parameters.cs (GetParameterByName): New helper method.
15205 * typemanager.cs (anonymous_method_type) a new type that
15206 represents an anonyous method. This is always an internal type,
15207 used as a fencepost to test against the anonymous-methodness of an
15210 2004-10-20 Marek Safar <marek.safar@seznam.cz>
15212 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15214 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15216 2004-10-18 Martin Baulig <martin@ximian.com>
15218 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15219 `Type' directly, but call ResolveType() on it.
15220 (Catch.Resolve): Likewise.
15221 (Foreach.Resolve): Likewise.
15223 2004-10-18 Martin Baulig <martin@ximian.com>
15225 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15226 `Type' directly, but call ResolveType() on it.
15227 (Probe.DoResolve): Likewise.
15228 (ArrayCreation.LookupType): Likewise.
15229 (TypeOf.DoResolve): Likewise.
15230 (SizeOf.DoResolve): Likewise.
15232 2004-10-18 Martin Baulig <martin@ximian.com>
15234 * expression.cs (Invocation.BetterFunction): Put back
15235 TypeManager.TypeToCoreType().
15237 2004-10-18 Raja R Harinath <rharinath@novell.com>
15239 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15242 2004-10-18 Martin Baulig <martin@ximian.com>
15244 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
15245 `Type' directly, but call ResolveType() on it.
15247 2004-10-18 Martin Baulig <martin@ximian.com>
15249 * class.cs (FieldMember.Define): Don't access the TypeExpr's
15250 `Type' directly, but call ResolveType() on it.
15251 (MemberBase.DoDefine): Likewise.
15253 * expression.cs (New.DoResolve): Don't access the TypeExpr's
15254 `Type' directly, but call ResolveType() on it.
15255 (ComposedCast.DoResolveAsTypeStep): Likewise.
15257 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15258 `Type' directly, but call ResolveType() on it.
15260 2004-10-17 John Luke <john.luke@gmail.com>
15262 * class.cs (Operator.GetSignatureForError): use CSharpName
15264 * parameter.cs (Parameter.GetSignatureForError): Returns
15265 correct name even if was not defined.
15267 2004-10-13 Raja R Harinath <rharinath@novell.com>
15270 * class.cs (TypeContainer.EmitContext): New property.
15271 (DefineNestedTypes): Create an emitcontext for each part.
15272 (MethodCore.DoDefineParameters): Use container's emitcontext.
15273 Pass type array to InternalParameters.
15274 (MemberBase.DoDefine): Use container's emitcontext.
15275 (FieldMember.Define): Likewise.
15276 (Event.Define): Likewise.
15277 (SetMethod.GetParameterInfo): Change argument to EmitContext.
15278 Pass type array to InternalParameters.
15279 (SetIndexerMethod.GetParameterInfo): Likewise.
15280 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15281 * delegate.cs (Define): Pass emitcontext to
15282 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
15283 array to InternalParameters.
15284 * expression.cs (ParameterReference.DoResolveBase): Pass
15285 emitcontext to GetParameterInfo.
15286 (ComposedCast.DoResolveAsTypeStep): Remove check on
15287 ec.ResolvingTypeTree.
15288 * parameter.cs (Parameter.Resolve): Change argument to
15289 EmitContext. Use ResolveAsTypeTerminal.
15290 (Parameter.GetSignature): Change argument to EmitContext.
15291 (Parameters.ComputeSignature): Likewise.
15292 (Parameters.ComputeParameterTypes): Likewise.
15293 (Parameters.GetParameterInfo): Likewise.
15294 (Parameters.ComputeAndDefineParameterTypes): Likewise.
15295 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
15296 * support.cs (InternalParameters..ctor): Remove variant that takes
15298 * typemanager.cs (system_intptr_expr): New.
15299 (InitExpressionTypes): Initialize it.
15301 2004-10-12 Chris Toshok <toshok@ximian.com>
15303 * cs-parser.jay: fix location for try_statement and catch_clause.
15305 2004-10-11 Martin Baulig <martin@ximian.com>
15307 * report.cs: Don't make --fatal abort on warnings, we have
15308 -warnaserror for that.
15310 2004-10-07 Raja R Harinath <rharinath@novell.com>
15312 More DeclSpace.ResolveType avoidance.
15313 * decl.cs (MemberCore.InUnsafe): New property.
15314 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
15315 with newly created EmitContext.
15316 (FieldMember.Define): Likewise.
15317 * delegate.cs (Delegate.Define): Likewise.
15318 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15319 only if normal name-lookup fails.
15320 (TypeExpr.DoResolve): Enable error-checking.
15321 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15322 (SizeOf.DoResolve): Likewise.
15323 (ComposedCast.DoResolveAsTypeStep): Likewise.
15324 (StackAlloc.DoResolve): Likewise.
15325 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15326 (Block.Unsafe): New property.
15327 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15328 (Unsafe): Set 'unsafe' flag of contained block.
15329 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15330 (Fixed.Resolve): Likewise.
15331 (Catch.Resolve): Likewise.
15332 (Using.ResolveLocalVariableDecls): Likewise.
15333 (Foreach.Resolve): Likewise.
15335 2004-10-05 John Luke <john.luke@gmail.com>
15337 * cs-parser.jay: add location to error CS0175
15339 2004-10-04 Miguel de Icaza <miguel@ximian.com>
15341 * ecore.cs (Expression.Constantity): Add support for turning null
15344 * const.cs (Const.Define): Allow constants to be reference types
15345 as long as the value is Null.
15347 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
15349 * namespace.cs (NamespaceEntry.Using): No matter which warning
15350 level is set, check if this namespace name has already been added.
15352 2004-10-03 Ben Maurer <bmaurer@ximian.com>
15354 * expression.cs: reftype [!=]= null should always use br[true,false].
15357 2004-10-03 Marek Safar <marek.safar@seznam.cz>
15360 * attribute.cs: Enum conversion moved to
15361 GetAttributeArgumentExpression to be applied to the all
15364 2004-10-01 Raja R Harinath <rharinath@novell.com>
15366 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15367 * class.c (TypeContainer.DefineType): Flag error if
15368 base types aren't accessible due to access permissions.
15369 * decl.cs (DeclSpace.ResolveType): Move logic to
15370 Expression.ResolveAsTypeTerminal.
15371 (DeclSpace.ResolveTypeExpr): Thin layer over
15372 Expression.ResolveAsTypeTerminal.
15373 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15374 Refactor code into NestedAccess. Use it.
15375 (DeclSpace.NestedAccess): New.
15376 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15377 argument to silence errors. Check access permissions.
15378 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15379 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15380 (Cast.DoResolve): Likewise.
15381 (New.DoResolve): Likewise.
15382 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15383 (TypeOf.DoResolve): Likewise.
15385 * expression.cs (Invocation.BetterConversion): Return the Type of
15386 the better conversion. Implement section 14.4.2.3 more faithfully.
15387 (Invocation.BetterFunction): Make boolean. Make correspondence to
15388 section 14.4.2.2 explicit.
15389 (Invocation.OverloadResolve): Update.
15390 (Invocation): Remove is_base field.
15391 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
15392 (Invocation.Emit): Likewise.
15394 2004-09-27 Raja R Harinath <rharinath@novell.com>
15396 * README: Update to changes.
15398 2004-09-24 Marek Safar <marek.safar@seznam.cz>
15400 * cs-parser.jay: Reverted 642 warning fix.
15402 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15405 * decl.cs (FindMemberWithSameName): Indexer can have more than
15408 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15410 * expression.cs (LocalVariableReference.DoResolveLValue):
15411 Do not report warning 219 for out values.
15412 (EmptyExpression.Null): New member to avoid extra allocations.
15414 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15416 * cs-parser.jay: Fix wrong warning 642 report.
15418 * cs-tokenizer.cs (CheckNextToken): New helper;
15419 Inspect next character if is same as expected.
15421 2004-09-23 Martin Baulig <martin@ximian.com>
15423 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15424 (Convert.ImplicitReferenceConversionExists): Likewise.
15426 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15428 * class.cs (Operator.Define): Add error 448 and 559 report.
15430 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15432 * class.cs (MemberBase.IsTypePermitted): New protected
15433 method for checking error CS0610.
15435 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15437 * class.cs (TypeContainer.HasExplicitLayout): New property
15438 Returns whether container has StructLayout attribute set Explicit.
15439 (FieldMember): New abstract class for consts and fields.
15440 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15441 (Field): Reuse FieldMember.
15443 * const.cs (Const): Reuse FieldMember.
15445 * rootcontext.cs: EmitConstants call moved to class.
15447 2004-09-22 Martin Baulig <martin@ximian.com>
15449 Thanks to Peter Sestoft for this bug report.
15451 * expression.cs (Conditional): If both the `trueExpr' and the
15452 `falseExpr' is a NullLiteral, return a NullLiteral.
15454 2004-09-22 Martin Baulig <martin@ximian.com>
15456 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15457 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15458 for the "get_Current" call.
15460 2004-09-22 Martin Baulig <martin@ximian.com>
15462 Marek and me just fixed one of our oldest bugs: #28562 :-)
15464 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15466 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15467 we're an EnumConstant, just return that.
15468 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15469 an EnumConstant. In this case, we need to use GetValueAsEnumType()
15470 to get the value which'll actually be written into the attribute.
15471 However, we have to use GetValue() to access the attribute's value
15474 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15476 * constant.cs (Constant.IsNegative): New abstract property
15479 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15480 (StackAlloc.DoResolve): Reused IsNegative.
15482 2004-09-21 Martin Baulig <martin@ximian.com>
15484 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15485 if we're used in an iterator, we may be called from different
15488 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15489 we actually have an exception block.
15491 2004-09-20 John Luke <jluke@cfl.rr.com>
15493 * class.cs, cs-parser.jay: Improve the error report for 1520:
15494 report the actual line where the error happens, not where the
15495 class was declared.
15497 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15498 Pass location information that was available elsewhere.
15500 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
15502 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15503 runtime to delay sign assemblies.
15505 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15507 * cs-parser.jay: Do not report the stack trace, this is barely
15510 2004-08-22 John Luke <john.luke@gmail.com>
15512 * driver.cs : check that a resource id is not already used
15513 before adding it, report CS1508 if it is, bug #63637
15515 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15517 * ecore.cs: Removed dead code.
15519 2004-09-18 Marek Safar <marek.safar@seznam.cz>
15521 * class.cs: Do not report warning CS0067 on the interfaces.
15523 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15525 * cs-parser.jay: Add error 504 report.
15527 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15529 * rootcontext.cs: WarningLevel is 4 by default now.
15531 * statement.cs (Fixed.Resolve): Do not null
15534 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15537 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15538 deep search when property is not virtual.
15539 (PropertyExpr.ResolveAccessors): Make one call for both
15542 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15545 * statement.cs: Error 152 report constains also location.
15547 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15550 * const.cs: Explicitly set constant as static.
15552 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15555 * cs-parser.jay: Add error 1017 report.
15557 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15559 Fixed bug #59980, #64224
15560 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15562 * typemanager.cs (IsSpecialMethod): Simplified
15564 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15566 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15567 condition with better params.
15569 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15572 * attribute.cs (Resolve): Property has to have both
15575 2004-09-14 Martin Baulig <martin@ximian.com>
15577 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15579 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15582 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15583 called and is obsolete then this member suppress message
15584 when call is inside next [Obsolete] method or type.
15586 * expression.cs: Use TestObsoleteMethodUsage member.
15588 2004-09-14 Martin Baulig <martin@ximian.com>
15590 * cs-parser.jay: Sync a bit with the GMCS version.
15592 2004-09-14 Martin Baulig <martin@ximian.com>
15594 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15595 (CSharpParser.yacc_verbose_flag): New public field.
15597 * genericparser.cs: Removed.
15599 2004-09-14 Raja R Harinath <rharinath@novell.com>
15601 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15603 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15605 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15607 2004-09-10 Martin Baulig <martin@ximian.com>
15609 Backported my MemberName changes from GMCS into MCS.
15611 - we are now using a special `MemberName' class instead of using
15612 strings; in GMCS, the `MemberName' also contains the type
15615 - changed the grammar rules a bit:
15616 * the old `member_name' is now a `namespace_or_type_name':
15617 The rule is that we use `namespace_or_type_name' everywhere
15618 where we expect either a "member name" (GetEnumerator) or a
15619 "member name" with an explicit interface name
15620 (IEnumerable.GetEnumerator).
15621 In GMCS, the explicit interface name may include type arguments
15622 (IEnumerable<T>.GetEnumerator).
15623 * we use `member_name' instead of just `IDENTIFIER' for
15625 The rule is that we use `member_name' wherever a member may
15626 have type parameters in GMCS.
15628 * decl.cs (MemberName): New public class.
15629 (MemberCore.MemberName): New public readonly field.
15630 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15631 (DeclSpace): Likewise.
15633 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15634 * enum.cs (Enum.ctor): Likewise.
15636 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15638 (AliasEntry.ctor): Take a MemberName, not an Expression.
15639 (AliasEntry.UsingAlias): Likewise.
15641 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15642 (IMethodData.MemberName): Changed type from string to MemberName.
15643 (MemberBase.ExplicitInterfaceName): Likewise.
15644 (AbstractPropertyEventMethod.SetupName): Make this private.
15645 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15646 argument; compute the member name here.
15647 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15648 on the `member.MemberName' and the `prefix'.
15650 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15652 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15653 thus, we get a `MemberName' instead of a `string'. These
15654 declarations may have type parameters in GMCS.
15655 (interface_method_declaration, delegate_declaration): Likewise.
15656 (class_declaration, interface_declaration): Likewise.
15657 (method_header): Use `namespace_or_type_name' instead of
15658 `member_name'. We may be an explicit interface implementation.
15659 (property_declaration, event_declaration): Likewise.
15660 (member_name): This is now just an `IDENTIFIER', not a
15661 `namespace_or_type_name'.
15662 (type_name, interface_type): Removed.
15663 (namespace_or_type_name): Return a MemberName, not an Expression.
15664 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15665 call GetTypeExpression() on the MemberName to get an expression.
15666 (IndexerDeclaration.interface_type): Changed type from string to
15668 (MakeName): Operate on MemberName's instead of string's.
15670 2004-09-13 Raja R Harinath <rharinath@novell.com>
15673 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15674 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15675 lookup to avoid symbols introduced by 'using'.
15676 * rootcontext.cs (NamespaceLookup): Update.
15678 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15680 * class.cs (TypeContainer.DoDefineMembers): Do not call
15681 DefineDefaultConstructor for static classes.
15683 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15685 * attribute.cs (Attribute.Resolve): Add error 653 report.
15687 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15689 (Method.ApplyAttributeBuilder): Add error 685 report.
15690 (Operator.Define): Add error 564 report.
15692 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15694 * expression.cs (Invocation.DoResolve): Add error
15695 245 and 250 report.
15697 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15700 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15702 * class.cs (ConstructorInitializer.Resolve):
15703 Wrong error number (515->516).
15705 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15707 * class.cs (Indexer.Define): Add error 631 report.
15709 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15711 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15713 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15715 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15717 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15719 * cs-parser.jay: Added error CS0241 report.
15721 2004-09-10 Raja R Harinath <rharinath@novell.com>
15723 * cs-parser.jay (fixed_statement): Introduce a scope for the
15724 declaration in the 'fixed' statement.
15726 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15728 * cs-parser.jay: Added CS0230 error report.
15730 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15732 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15734 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15736 * expression.cs (Argument.Resolve): Added error CS0192 and
15739 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15741 C# 2.0 #pragma warning feature
15743 * cs-tokenizer.cs (PreProcessPragma): New method;
15744 Handles #pragma directive.
15746 * report.cs (WarningRegions): New class; Support
15747 class for #pragma warning directive. It tests whether
15748 warning is enabled for a given line.
15750 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15752 * const.cs: Add more descriptive error report, tahnks to
15755 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15757 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15759 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15761 * expression.cs: Apply patch from Ben: Remove dead code from
15762 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15763 as that code just threw an exception anwyays.
15765 * const.cs: Remove the call to the turnintoconstant, for details
15768 * literal.cs: The type of the null-literal is the null type; So
15769 we use a placeholder type (literal.cs:System.Null, defined here)
15772 * expression.cs (Conditional.DoResolve): Remove some old code that
15773 is no longer needed, conversions have been fixed.
15775 (ArrayCreationExpression.DoResolve): Return false if we fail to
15776 resolve the inner expression.
15778 2004-09-07 Raja R Harinath <rharinath@novell.com>
15781 * cs-parser.jay (delegate_declaration): Record a delegate
15782 declaration as a type declaration.
15783 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15785 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15787 * parameter.cs: Do not crash if the type can not be resolved.
15789 * expression.cs: Report errors with unsafe pointers, fixes #64896
15791 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15793 * expression.cs: Pointer arith always needs to do a conv.i
15794 if the operand is a long. fix 65320
15796 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15798 Fixed cs0619-37.cs, cs0619-38.cs
15800 * enum.cs (GetObsoleteAttribute): Removed.
15802 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15803 on Enum member is double staged. The first is tested member
15806 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15808 Fixed #56986, #63631, #65231
15810 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15811 adds member to name container.
15812 (TypeContainer.AddToTypeContainer): New method, adds type to
15814 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15815 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15816 AddOperator): Simplified by reusing AddToMemberContainer.
15817 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15819 (Method.CheckForDuplications): Fixed implementation to test all
15821 (MemberBase): Detection whether member is explicit interface
15822 implementation is now in constructor.
15823 (MemberBase.UpdateMemberName): Handles IndexerName.
15824 (Accessor): Changed to keep also location information.
15825 (AbstractPropertyEventMethod): Is derived from MemberCore.
15826 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15827 will be emited or not.
15828 (PropertyBase.AreAccessorsDuplicateImplementation):
15829 Tests whether accessors are not in collision with some method.
15830 (Operator): Is derived from MethodCore to simplify common
15833 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15835 (DeclSpace.AddToContainer): Adds the member to defined_names
15836 table. It tests for duplications and enclosing name conflicts.
15838 * enum.cs (EnumMember): Clean up to reuse the base structures
15840 2004-09-03 Martin Baulig <martin@ximian.com>
15842 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15843 into TypeContainer, to make partial classes work again.
15845 2004-09-03 Martin Baulig <martin@ximian.com>
15847 * rootcontext.cs (RootContext.V2): Removed.
15849 2004-03-23 Martin Baulig <martin@ximian.com>
15851 * expression.cs (Invocation.OverloadResolve): Added `bool
15852 may_fail' argument and use it instead of the Location.IsNull() hack.
15854 2004-09-03 Martin Baulig <martin@ximian.com>
15856 Merged latest changes into gmcs. Please keep this comment in
15857 here, it makes it easier for me to see what changed in MCS since
15858 the last time I merged.
15860 2004-09-03 Raja R Harinath <rharinath@novell.com>
15863 * expression.cs (BetterConversion): Don't allow either conversion
15864 to be null. Remove redundant implicit conversion test when 'q ==
15865 null' -- when this function is invoked, we already know that the
15866 implicit conversion exists.
15867 (BetterFunction): Assume that 'best' is non-null. Remove
15868 redundant reimplementation of IsApplicable when 'best' is null.
15869 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15870 number of arguments.
15871 (IsAncestralType): Extract from OverloadResolve.
15872 (OverloadResolve): Make robust to the MethodGroupExpr being
15873 unsorted. Implement all the logic of Section 14.5.5.1, and
15874 support overloading of methods from multiple applicable types.
15875 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15877 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15878 (RealError, Warning): Append type of report to related symbol.
15880 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15882 * enum.cs: Fixed CLS-Compliance checks for enum members.
15883 Error tests cs3008-8.cs, cs3014-8.cs
15885 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15887 Fixed bug #62342, #63102
15888 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15889 like ImplementMethod.
15891 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15893 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15896 2004-09-02 Martin Baulig <martin@ximian.com>
15898 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15899 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15902 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15904 C# 2.0 Static classes implemented
15906 * class.cs (TypeContainer): instance_constructors,
15907 initialized_fields, initialized_static_fields,
15908 default_constructor, base_inteface_types are protected to be
15909 accessible from StaticClass.
15910 (TypeContainer.DefineDefaultConstructor): New virtual method
15911 for custom default constructor generating
15912 (StaticClass): New class to handle "Static classes" feature.
15914 * cs-parser.jay: Handle static keyword on class like instance
15917 * driver.cs: Added "/langversion" command line switch with two
15918 options (iso-1, default).
15920 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15922 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15924 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15926 * delegate.cs: Style.
15928 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15930 * delegate.cs: Add seperate instance expr field for miguel.
15932 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15934 * PointerArithmetic (Resolve): make sure we are not doing
15935 pointer arith on void*. Also, make sure we are resolved
15936 by not setting eclass until resolve.
15938 All callers: Make sure that PointerArithmetic gets resolved.
15940 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15942 * ArrayCreation (LookupType): If the type does not resolve
15943 to an array, give an error.
15945 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15947 * statement.cs (Try.Resolve): Fixed bug #64222
15949 2004-08-27 Martin Baulig <martin@ximian.com>
15952 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15955 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15957 * ecore.cs (Constantify): Get underlying type via
15958 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15959 Windows in special cases.
15961 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15963 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15964 for obtaining also private methods.
15965 (GetRemoveMethod): Used GetRemoveMethod (true)
15966 for obtaining also private methods.
15968 2004-08-24 Martin Baulig <martin@ximian.com>
15970 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15971 MethodAttributes.HideBySig for operators.
15973 2004-08-23 Martin Baulig <martin@ximian.com>
15975 Back to the old error reporting system :-)
15977 * report.cs (Message): Removed.
15978 (Report.MessageData, ErrorData, WarningData): Removed.
15979 (Report.Error, Warning): Back to the old system.
15981 2004-08-23 Martin Baulig <martin@ximian.com>
15983 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15985 * class.cs (TypeContainer.ParentContainer): New public virtual
15986 method; replaces the explicit interface implementation.
15987 (ClassPart.ParentContainer): Override.
15989 2004-08-23 Martin Baulig <martin@ximian.com>
15991 * statement.cs (Switch): Added support for constant switches; see
15992 #59428 or test-285.cs.
15994 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15997 * statement.cs (GetEnumeratorFilter): Removed useless
15998 logic because C# specs is strict. GetEnumerator must be
16001 2004-08-22 Martin Baulig <martin@ximian.com>
16003 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16004 a switch and may break, reset the barrier. Fixes #59867.
16006 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16008 CLS-Compliance speed up (~5% for corlib)
16010 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16011 New method. Tests container for CLS-Compliant names
16013 * class.cs (TypeContainer.VerifyClsName): New method.
16014 Checks whether container name is CLS Compliant.
16015 (Constructor): Implements IMethodData.
16017 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16018 low-case table for CLS Compliance test.
16019 (MemberCache.VerifyClsParameterConflict): New method.
16020 Checks method parameters for CS3006 error.
16022 * enum.cs (EnumMember): Is derived from MemberCore.
16023 (Enum.VerifyClsName): Optimized for better performance.
16025 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16027 * report.cs: Renamed Error_T to Error and changed all
16030 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16032 * class.cs (TypeContainer.IndexerArrayList): New inner class
16033 container for indexers.
16034 (TypeContainer.DefaultIndexerName): New constant for default
16035 indexer name. Replaced all "Item" with this constant.
16036 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16038 * typemanager.cs (TypeManager.default_member_ctor): Cache here
16039 DefaultMemberAttribute constructor.
16041 2004-08-05 Martin Baulig <martin@ximian.com>
16043 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16046 2004-08-05 Marek Safar <marek.safar@seznam.cz>
16048 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16049 multi platforms problem.
16051 * compiler.csproj: Included shared files.
16053 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16055 Fix bug 60333, 55971 in the more general way
16056 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16057 Added arg_type argument for constant conversion.
16058 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16060 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16063 * class.cs (TypeContainer ): New inner classes MethodArrayList,
16064 OperatorArrayList, MethodCoreArrayList for typecontainer
16065 containers. Changed class member types to these new types.
16066 (MethodArrayList.DefineMembers): Added test for CS0659.
16068 2004-08-04 Miguel de Icaza <miguel@ximian.com>
16070 * cfold.cs: Synchronize the folding with the code in expression.cs
16071 Binary.DoNumericPromotions for uint operands.
16073 * attribute.cs: Revert patch from Raja, it introduced a regression
16074 while building Blam-1.2.1 (hard to isolate a test case).
16076 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16080 (TypeContainer.Define): Renamed to DefineContainerMembers because of
16082 (MethodCore.parent_method): New member. The method we're overriding
16083 if this is an override method.
16084 (MethodCore.CheckBase): Moved from Method class and made common.
16085 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16087 (MethodCore.CheckForDuplications): New abstract method. For custom
16088 member duplication search in a container
16089 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16090 method and its return type.
16091 (Event.conflict_symbol): New member. Symbol with same name in the
16095 (MemberCache.FindMemberWithSameName): New method. The method
16096 is looking for conflict with inherited symbols.
16098 2004-08-04 Martin Baulig <martin@ximian.com>
16100 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16102 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16104 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16106 * report.cs (Message): New enum for better error, warning reference in
16108 (MessageData): New inner abstract class. It generally handles printing of
16109 error and warning messages.
16110 Removed unused Error, Warning, Message methods.
16112 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16114 Fix for cs0592-8.cs test
16116 (Attributable.ValidAttributeTargets): Made public.
16117 (Attribute.ExplicitTarget): New member for explicit target value.
16118 (Attribute.CheckTargets): Now we translate explicit attribute
16119 target to Target here.
16121 2004-08-03 Ben Maurer <bmaurer@ximian.com>
16123 * ecore.cs (MethodGroupExpr): new IsBase property.
16125 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16127 * delegate.cs (DelegateCreation): store a MethodGroupExpr
16128 rather than an instance expr.
16130 (DelegateCreation.Emit): Use the method group rather than
16131 the instance expression. Also, if you have base.Foo as the
16132 method for a delegate, make sure to emit ldftn, not ldftnvirt.
16134 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
16136 (NewDelegate.DoResolve): Only check for the existance of Invoke
16137 if the method is going to be needed. Use MethodGroupExpr.
16139 (NewDelegate.Emit): Remove, DelegateCreation implements this.
16141 * expression.cs: For pointer arith., make sure to use
16142 the size of the type, not the size of the pointer to
16145 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16148 * class.cs (Class): Added error CS0502 test.
16150 2004-08-03 John Luke <jluke@cfl.rr.com>
16151 Raja R Harinath <rharinath@novell.com>
16154 * attribute.cs (Attribute.complained_before): New flag.
16155 (Attribute.ResolveType, Attribute.Resolve),
16156 (Attribute.DefinePInvokeMethod): Set it.
16157 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16159 2004-08-03 Martin Baulig <martin@ximian.com>
16161 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16162 use a user-defined operator; we still need to do numeric
16163 promotions in case one argument is a builtin type and the other
16164 one has an implicit conversion to that type. Fixes #62322.
16166 2004-08-02 Martin Baulig <martin@ximian.com>
16168 * statement.cs (LocalInfo.Flags): Added `IsThis'.
16169 (LocalInfo.IsThis): New public property.
16170 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16172 2004-08-01 Martin Baulig <martin@ximian.com>
16174 * class.cs (TypeContainer.GetClassBases): Don't set the default
16175 here since we may get called from GetPartialBases().
16176 (TypeContainer.DefineType): If GetClassBases() didn't return a
16177 parent, use the default one.
16179 2004-07-30 Duncan Mak <duncan@ximian.com>
16181 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16183 2004-07-30 Martin Baulig <martin@ximian.com>
16185 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16187 * class.cs (SourceMethod): New public class, derive from the
16188 symbol writer's ISourceMethod.
16189 (Method): Use the new symbol writer API.
16191 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16192 as argument and use the new symbol writer.
16195 (SourceFile): Implement the symbol writer's ISourceFile.
16196 (Location.SymbolDocument): Removed.
16197 (Location.SourceFile): New public property.
16199 * symbolwriter.cs: Use the new symbol writer API.
16201 2004-07-30 Raja R Harinath <rharinath@novell.com>
16203 * Makefile (install-local): Remove. Functionality moved to
16206 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
16208 * Makefile: Install mcs.exe.config file together with mcs.exe.
16209 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16210 correct runtime version.
16212 2004-07-25 Martin Baulig <martin@ximian.com>
16215 (TypeContainer.RegisterOrder): Removed, this was unused.
16216 (TypeContainer, interface_order): Removed.
16217 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16218 TypeContainer as argument since we can also be called with a
16219 `PartialContainer' for a partial class/struct/interface.
16220 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16221 of checking whether we're an `Interface' - we could be a
16222 `PartialContainer'.
16223 (PartialContainer.Register): Override; call
16224 AddClass()/AddStruct()/AddInterface() on our parent.
16226 * cs-parser.jay (interface_member_declaration): Add things to the
16227 `current_container', not the `current_class'.
16229 * rootcontext.cs (RegisterOrder): The overloaded version which
16230 takes an `Interface' was unused, removed.
16232 * typemanager.cs (TypeManager.LookupInterface): Return a
16233 `TypeContainer', not an `Interface'.
16234 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16235 contain a `PartialContainer' for an interface, so check it's
16236 `Kind' to figure out what it is.
16238 2004-07-25 Martin Baulig <martin@ximian.com>
16240 * class.cs (Class.DefaultTypeAttributes): New public constant.
16241 (Struct.DefaultTypeAttributes): Likewise.
16242 (Interface.DefaultTypeAttributes): Likewise.
16243 (PartialContainer.TypeAttr): Override this and add the
16244 DefaultTypeAttributes.
16246 2004-07-25 Martin Baulig <martin@ximian.com>
16248 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16249 we can just use the `Parent' field instead.
16251 2004-07-25 Martin Baulig <martin@ximian.com>
16253 * class.cs (TypeContainer.Emit): Renamed to EmitType().
16255 2004-07-25 Martin Baulig <martin@ximian.com>
16257 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16258 our parts before defining any methods.
16259 (TypeContainer.VerifyImplements): Make this virtual.
16260 (ClassPart.VerifyImplements): Override and call VerifyImplements()
16261 on our PartialContainer.
16263 2004-07-25 Martin Baulig <martin@ximian.com>
16265 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16267 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16268 argument, we can just use the `Parent' field instead.
16271 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
16272 (MemberBase.DoDefine): Likewise.
16274 2004-07-24 Martin Baulig <martin@ximian.com>
16276 * decl.cs (MemberCore.Parent): New public field.
16277 (DeclSpace.Parent): Moved to MemberCore.
16279 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16280 (MemberBase.ctor): Added TypeContainer argument, pass it to our
16282 (FieldBase, Field, Operator): Likewise.
16283 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16284 (EventField, Event): Likewise.
16286 2004-07-23 Martin Baulig <martin@ximian.com>
16288 * class.cs (PartialContainer): New public class.
16289 (ClassPart): New public class.
16290 (TypeContainer): Added support for partial classes.
16291 (TypeContainer.GetClassBases): Splitted some of the functionality
16292 out into GetNormalBases() and GetPartialBases().
16294 * cs-tokenizer.cs (Token.PARTIAL): New token.
16295 (Tokenizer.consume_identifier): Added some hacks to recognize
16296 `partial', but only if it's immediately followed by `class',
16297 `struct' or `interface'.
16299 * cs-parser.jay: Added support for partial clases.
16301 2004-07-23 Martin Baulig <martin@ximian.com>
16303 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16304 a `DeclSpace' and also made it readonly.
16305 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16306 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16307 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16309 * cs-parser.jay: Pass the `current_class', not the
16310 `current_container' (at the moment, this is still the same thing)
16311 to a new Method, Property, Event, Indexer or Constructor.
16313 2004-07-23 Martin Baulig <martin@ximian.com>
16315 * cs-parser.jay (CSharpParser): Added a new `current_class' field
16316 and removed the `current_interface' one.
16317 (struct_declaration, class_declaration, interface_declaration):
16318 Set `current_class' to the newly created class/struct/interface;
16319 set their `Bases' and call Register() before parsing their body.
16321 2004-07-23 Martin Baulig <martin@ximian.com>
16323 * class.cs (Kind): New public enum.
16324 (TypeContainer): Made this class abstract.
16325 (TypeContainer.Kind): New public readonly field.
16326 (TypeContainer.CheckDef): New public method; moved here from
16328 (TypeContainer.Register): New public abstract method.
16329 (TypeContainer.GetPendingImplementations): New public abstract
16331 (TypeContainer.GetClassBases): Removed the `is_class' and
16332 `is_iface' parameters.
16333 (TypeContainer.DefineNestedTypes): Formerly known as
16335 (ClassOrStruct): Made this class abstract.
16337 * tree.cs (RootTypes): New public type.
16339 2004-07-20 Martin Baulig <martin@ximian.com>
16341 * tree.cs (Tree.RecordNamespace): Removed.
16342 (Tree.Namespaces): Removed.
16344 * rootcontext.cs (RootContext.IsNamespace): Removed.
16346 * cs-parser.jay (namespace_declaration): Just create a new
16347 NamespaceEntry here.
16349 2004-07-20 Martin Baulig <martin@ximian.com>
16351 * statement.cs (ExceptionStatement): New abstract class. This is
16352 now used as a base class for everyone who's using `finally'.
16353 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16354 our local variables before using them.
16356 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16357 virtual method. This is used by Yield.Resolve() to "steal" an
16358 outer block's `finally' clauses.
16359 (FlowBranchingException): The .ctor now takes an ExceptionStatement
16362 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16363 version which takes an ExceptionStatement. This version must be
16364 used to create exception branchings.
16367 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16368 (Iterator.EmitMoveNext): Added exception support; protect the
16369 block with a `fault' clause, properly handle 'finally' clauses.
16370 (Iterator.EmitDispose): Run all the `finally' clauses here.
16372 2004-07-20 Martin Baulig <martin@ximian.com>
16374 * iterator.cs: This is the first of a set of changes in the
16375 iterator code. Match the spec more closely: if we're an
16376 IEnumerable, then GetEnumerator() must be called. The first time
16377 GetEnumerator() is called, it returns the current instance; all
16378 subsequent invocations (if any) must create a copy.
16380 2004-07-19 Miguel de Icaza <miguel@ximian.com>
16382 * expression.cs: Resolve the constant expression before returning
16385 2004-07-19 Martin Baulig <martin@ximian.com>
16387 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16388 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16389 the return type of the new EmitContext.
16391 2004-07-18 Martin Baulig <martin@ximian.com>
16393 * class.cs (Property.Define): Fix iterators.
16395 * iterators.cs (Iterator.Define): Moved the
16396 `container.AddInterator (this)' call here from the .ctor; only do
16397 it if we resolved successfully.
16399 2004-07-17 Miguel de Icaza <miguel@ximian.com>
16401 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16402 `true' for preprocessing directives that we parse. The return
16403 value indicates whether we should return to regular tokenizing or
16404 not, not whether it was parsed successfully.
16406 In the past if we were in: #if false ... #line #endif, we would
16407 resume parsing after `#line'. See bug 61604.
16409 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16410 building: IsEnumType should return true only for enums, not for
16411 enums or System.Enum itself. This fixes #61593.
16413 Likely what happened is that corlib was wrong: mcs depended on
16414 this bug in some places. The bug got fixed, we had to add the
16415 hack, which caused bug 61593.
16417 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16418 that was a workaround for the older conditions.
16420 2004-07-16 Ben Maurer <bmaurer@ximian.com>
16422 * assign.cs: IAssignMethod has a new interface, as documented
16423 inline. All assignment code now uses this new api.
16425 * ecore.cs, expression.cs: All classes which implement
16426 IAssignMethod now use the new interface.
16428 * expression.cs (Invocation): add a hack to EmitCall so that
16429 IndexerAccess can be the target of a compound assignment without
16430 evaluating its arguments twice.
16432 * statement.cs: Handle changes in Invocation api.
16434 2004-07-16 Martin Baulig <martin@ximian.com>
16436 * iterators.cs: Rewrote this. We're now using one single Proxy
16437 class for both the IEnumerable and the IEnumerator interface and
16438 `Iterator' derives from Class so we can use the high-level API.
16440 * class.cs (TypeContainer.AddIterator): New method.
16441 (TypeContainer.DoDefineType): New protected virtual method, which
16442 is called from DefineType().
16443 (TypeContainer.DoDefineMembers): Call DefineType() and
16444 DefineMembers() on all our iterators.
16445 (TypeContainer.Emit): Call Emit() on all our iterators.
16446 (TypeContainer.CloseType): Call CloseType() on all our iterators.
16448 * codegen.cs (EmitContext.CurrentIterator): New public field.
16450 2004-07-15 Martin Baulig <martin@ximian.com>
16453 (TypeManager.not_supported_exception_type): New type.
16455 2004-07-14 Martin Baulig <martin@ximian.com>
16457 * iterators.cs: Use real error numbers.
16459 2004-07-14 Martin Baulig <martin@ximian.com>
16461 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16462 requires this to be a System.Collection.IEnumerable and not a
16463 class implementing that interface.
16464 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
16466 2004-07-13 Marek Safar <marek.safar@seznam.cz>
16468 * class.cs: Fixed previous fix, it broke some error tests.
16470 2004-07-12 Martin Baulig <martin@ximian.com>
16472 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16475 2004-07-09 Miguel de Icaza <miguel@ximian.com>
16477 * assign.cs (LocalTemporary): Add new argument: is_address,If
16478 `is_address' is true, then the value that we store is the address
16479 to the real value, and not the value itself.
16481 * ecore.cs (PropertyExpr): use the new local temporary
16482 stuff to allow us to handle X.Y += z (where X is a struct)
16484 2004-07-08 Martin Baulig <martin@ximian.com>
16486 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16487 not always return, just like we're doing in Using.Resolve().
16489 2004-07-07 Miguel de Icaza <miguel@ximian.com>
16491 * cs-parser.jay (fixed_statement): flag this as Pinned.
16493 2004-07-06 Miguel de Icaza <miguel@ximian.com>
16495 * typemanager.cs (TypeManager): Removed MakePinned method, this
16496 mechanism is replaced with the .NET 2.x compatible mechanism of
16497 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16499 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
16500 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16501 `IsFixed' property which has a different meaning.
16503 2004-07-02 Raja R Harinath <rharinath@novell.com>
16505 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16506 visible from inside a nested class, not just the names of the
16507 immediately enclosing class.
16508 Fix for bug #60730.
16510 2004-06-24 Raja R Harinath <rharinath@novell.com>
16512 * expression.cs (BetterConversion): Remove buggy special-case
16513 handling of "implicit constant expression conversions". At this
16514 point, we already know that the conversion is possible -- we're
16515 only checking to see which is better.
16517 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16519 * cs-parser.jay: Added error CS0210 test.
16521 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16523 * cs-parser.jay: Added error CS0134 test.
16525 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16528 * cs-parser.jay: Added error CS0145 test.
16530 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16532 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16534 2004-06-23 Ben Maurer <bmaurer@ximian.com>
16536 * expression.cs (StackAlloc.Resolve): The argument may not
16537 be a constant; deal with this case.
16539 2004-06-23 Marek Safar <marek.safar@seznam.cz>
16541 * attribute.cs (IndexerName_GetIndexerName): Renamed to
16542 GetIndexerAttributeValue.
16543 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16545 * class.cs (Indexer.Define): Added error tests for CS0415,
16548 2004-06-23 Miguel de Icaza <miguel@ximian.com>
16550 * attribute.cs (Attribute.Resolve): Keep field code in sync with
16553 2004-06-23 Martin Baulig <martin@ximian.com>
16555 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16556 neither return nor throw, reset the barrier as well. Fixes #60457.
16558 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
16560 * class.cs : EventAttributes is now set to None by default.
16561 This fixes bug #60459.
16563 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16566 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16567 Don't throw exception but return null (it's sufficient now).
16569 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16571 * typemanager.cs (GetArgumentTypes): Faster implementation.
16573 2004-06-18 Martin Baulig <martin@ximian.com>
16575 * attribute.cs (Attribute.Resolve): Check whether we're an
16576 EmptyCast which a Constant child. Fixes #60333.
16578 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16580 * statement.cs (EmitCollectionForeach): Account for the fact that
16581 not all valuetypes are in areas which we can take the address of.
16582 For these variables, we store to a temporary variable. Also, make
16583 sure that we dont emit a `callvirt' on a valuetype method.
16585 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16587 * expression.cs (StackAlloc.DoReSolve): Added test for
16588 negative parameter (CS0247).
16590 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16593 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16595 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16598 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16601 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16603 Fix bug #58254 & cs1555.cs, cs1556.cs
16604 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16606 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16608 * cs-parser.jay: Added error CS1669 test for indexers.
16610 2004-06-11 Martin Baulig <martin@ximian.com>
16612 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16613 call this twice: for params and varargs methods.
16615 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16618 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16620 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16622 * attribute.cs (Attribute.GetValidTargets): Made public.
16625 (AbstractPropertyEventMethod): New class for better code sharing.
16626 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16628 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16630 2004-06-11 Raja R Harinath <rharinath@novell.com>
16633 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16634 that the call to Resolve is part of a MemberAccess.
16635 (Expression.Resolve): Use it for SimpleName resolution.
16636 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16637 Add 'intermediate' boolean argument.
16638 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16639 error message when the SimpleName can be resolved ambiguously
16640 between an expression and a type.
16641 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16643 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16644 call on the left-side.
16646 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16649 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16651 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16653 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16655 2004-06-11 Martin Baulig <martin@ximian.com>
16657 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16658 varargs methods if applicable.
16660 2004-06-11 Martin Baulig <martin@ximian.com>
16662 * expression.cs (Invocation.EmitCall): Don't use
16663 `method.CallingConvention == CallingConventions.VarArgs' since the
16664 method could also have `CallingConventions.HasThis'.
16666 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16668 * class.cs (Event.GetSignatureForError): Implemented.
16669 Fixed crash in error test cs3010.cs
16671 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16673 * cs-tokenizer.cs: Change the way we track __arglist to be
16674 consistent with the other keywords.
16676 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16678 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16681 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16683 * codegen.cs: Check that all referenced assemblies have a strongname
16684 before strongnaming the compiled assembly. If not report error CS1577.
16685 Fix bug #56563. Patch by Jackson Harper.
16686 * typemanager.cs: Added a method to return all referenced assemblies.
16687 Fix bug #56563. Patch by Jackson Harper.
16689 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16692 (Method.ApplyAttributeBuilder): Moved and added conditional
16693 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16696 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16698 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16701 * class.cs: (EventField.attribute_targets): Changed default target.
16703 2004-06-08 Martin Baulig <martin@ximian.com>
16705 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16707 2004-06-08 Martin Baulig <martin@ximian.com>
16709 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16711 2004-06-07 Martin Baulig <martin@ximian.com>
16713 Added support for varargs methods.
16715 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16718 * cs-parser.jay: Added support for `__arglist'.
16720 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16722 * expression.cs (Argument.AType): Added `ArgList'.
16723 (Invocation): Added support for varargs methods.
16724 (ArglistAccess): New public class.
16725 (Arglist): New public class.
16727 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16729 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16730 a method's top-level block if the method has varargs.
16732 * support.cs (ReflectionParameters, InternalParameters): Added
16733 support for varargs methods.
16735 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16737 * class.cs: Provide location in indexer error report.
16739 * driver.cs: Use standard names.
16741 * namespace.cs: Catch the use of using after a namespace has been
16742 declared also on using aliases.
16744 2004-06-03 Raja R Harinath <rharinath@novell.com>
16747 * typemanager.cs (closure_private_ok, closure_invocation_type)
16748 (closure_qualifier_type, closure_invocation_assembly)
16749 (FilterWithClosure): Move to ...
16750 (Closure): New internal nested class.
16751 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16752 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16753 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16754 (MemberLookup, MemberLookupFailed): Use it.
16755 * expression.cs (New.DoResolve): Treat the lookup for the
16756 constructor as being qualified by the 'new'ed type.
16757 (Indexers.GetIndexersForTypeOrInterface): Update.
16759 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16762 (GetConditionalAttributeValue): New method. Returns
16763 condition of ConditionalAttribute.
16764 (SearchMulti): New method. Returns all attributes of type 't'.
16765 Use it when attribute is AllowMultiple = true.
16766 (IsConditionalMethodExcluded): New method.
16769 (Method.IsExcluded): Implemented. Returns true if method has conditional
16770 attribute and the conditions is not defined (method is excluded).
16771 (IMethodData): Extended interface for ConditionalAttribute support.
16772 (PropertyMethod.IsExcluded): Implemented.
16775 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16778 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16781 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16783 * expression.cs (ArrayCreationExpression): Make this just an
16784 `expression'. It can't be a statement, so the code here was
16787 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16790 * typemanager.cs (GetFullNameSignature): New method for
16793 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16796 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16797 Use this method when MethodBuilder is null.
16798 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16799 Added test for error CS0626 (MONO reports error for this situation).
16800 (IMethodData.GetSignatureForError): Extended interface.
16802 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16805 (AttributeTester.GetObsoleteAttribute): Returns instance of
16806 ObsoleteAttribute when type is obsolete.
16809 (TypeContainer.VerifyObsoleteAttribute): Override.
16810 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16811 (MethodCode.VerifyObsoleteAttribute): Override.
16812 (MemberBase.VerifyObsoleteAttribute): Override.
16815 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16816 and report proper error.
16819 Delegate.VerifyObsoleteAttribute): Override.
16822 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16823 and report proper error.
16824 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16827 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16831 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16832 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16833 Added test for ObsoleteAttribute.
16836 (Catch): Derived from Statement.
16838 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16840 Fixed bug #59071 & cs0160.cs
16842 * statement.cs (Try.Resolve): Check here whether order of catch
16843 clauses matches their dependencies.
16845 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16847 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16848 caused a regression: #59343. Referencing nested classes from an
16849 assembly stopped working.
16851 2004-05-31 Martin Baulig <martin@ximian.com>
16853 MCS is now frozen for beta 2.
16855 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16857 * convert.cs: add a trivial cache for overload operator resolution.
16859 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16861 * decl.cs: If possible, use lookuptypedirect here. We can only do
16862 this if there is no `.' after the namespace. Avoids using
16863 LookupType, which does lots of slow processing.
16864 (FindNestedType) New method, does what it says :-).
16865 * namespace.cs: use LookupTypeDirect.
16866 * rootcontext.cs: use membercache, if possible.
16867 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16869 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16872 According to the spec,
16874 In a member access of the form E.I, if E is a single identifier,
16875 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16876 field, property, localvariable, or parameter with the same type as
16877 the meaning of E as a type-name (§3.8), then both possible
16878 meanings of E are permitted.
16880 We did not check that E as a simple-name had the same type as E as
16883 This trivial check gives us 5-7% on bootstrap time.
16885 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16887 * expression.cs (Invocation.OverloadResolve): Avoid the
16888 use of hashtables and boxing here by allocating on demand.
16890 2004-05-30 Martin Baulig <martin@ximian.com>
16892 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16893 we're doing a silent lookup. Don't try to lookup nested types in
16894 TypeManager.object_type (thanks to Ben Maurer).
16896 2004-05-30 Martin Baulig <martin@ximian.com>
16898 Committing a patch from Ben Maurer.
16900 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16902 2004-05-29 Martin Baulig <martin@ximian.com>
16904 * class.cs (IMethodData.ShouldIgnore): New method.
16906 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16907 `Location' argument, we don't need it anywhere. Use
16908 `IMethodData.ShouldIgnore ()' instead of
16909 `MethodData.GetMethodFlags ()'.
16910 (TypeManager.AddMethod): Removed.
16911 (TypeManager.AddMethod2): Renamed to AddMethod.
16913 2004-05-29 Martin Baulig <martin@ximian.com>
16915 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16917 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16918 converting from a class type S to an interface type and we already
16919 have an object on the stack, don't box it again. Fixes #52578.
16921 2004-05-29 Martin Baulig <martin@ximian.com>
16923 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16924 Added support for `params' parameters. Fixes #59267.
16926 2004-05-29 Martin Baulig <martin@ximian.com>
16928 * literal.cs (NullPointer): Provide a private .ctor which sets
16929 `type' to TypeManager.object_type. Fixes #59048.
16931 2004-05-29 Martin Baulig <martin@ximian.com>
16933 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16934 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16936 * ecore.cs (EventExpr.instance_expr): Make the field private.
16938 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16940 Fixed bug #50080 & cs0214-2.cs
16941 * expression.cs (Cast.DoResolve): Check unsafe context here.
16943 * statement.cs (Resolve.DoResolve): Likewise.
16945 2004-05-26 Martin Baulig <martin@ximian.com>
16947 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16949 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16950 (RootContext.LookupType): Pass down the `silent' flag.
16952 2004-05-25 Martin Baulig <martin@ximian.com>
16955 (MethodGroupExpr.IdenticalTypeName): New public property.
16956 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16957 expression actually refers to a type.
16959 2004-05-25 Martin Baulig <martin@ximian.com>
16961 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16962 for #56176 and made it actually work.
16964 2004-05-25 Martin Baulig <martin@ximian.com>
16966 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16967 (FieldExpr, PropertyExpr): Override and implement
16968 CacheTemporaries. Fixes #52279.
16970 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16972 * location.cs: In the new compiler listing a file twice is a
16973 warning, not an error.
16975 2004-05-24 Martin Baulig <martin@ximian.com>
16977 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16978 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16980 2004-05-24 Martin Baulig <martin@ximian.com>
16982 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16983 walking the `using' list. Fixes #53921.
16985 2004-05-24 Martin Baulig <martin@ximian.com>
16987 * const.cs (Const.LookupConstantValue): Added support for
16988 EmptyCast's; fixes #55251.
16990 2004-05-24 Martin Baulig <martin@ximian.com>
16992 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16993 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16994 which does the CS0135 check. The reason is that we first need to
16995 check whether the variable actually exists.
16997 2004-05-24 Martin Baulig <martin@ximian.com>
16999 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17000 than RootContext.LookupType() to find the explicit interface
17001 type. Fixes #58584.
17003 2004-05-24 Raja R Harinath <rharinath@novell.com>
17005 * Makefile: Simplify. Use executable.make.
17006 * mcs.exe.sources: New file. List of sources of mcs.exe.
17008 2004-05-24 Anders Carlsson <andersca@gnome.org>
17012 Use the invariant culture when doing String.Compare for CLS case
17015 2004-05-23 Martin Baulig <martin@ximian.com>
17017 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17018 don't have any dots. Fixes #52622, added cs0246-8.cs.
17020 * namespace.cs (NamespaceEntry.Lookup): Likewise.
17022 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17024 * class.cs (MemberBase.Define): Reuse MemberType member for
17025 resolved type. Other methods can use it too.
17027 2004-05-23 Martin Baulig <martin@ximian.com>
17029 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17030 the variable also exists in the current block (otherwise, we need
17031 to report a CS0103). Fixes #58670.
17033 2004-05-23 Martin Baulig <martin@ximian.com>
17035 * flowanalysis.cs (Reachability.Reachable): Compute this
17036 on-the-fly rather than storing it as a field.
17038 2004-05-23 Martin Baulig <martin@ximian.com>
17040 * flowanalysis.cs (Reachability.And): Manually compute the
17041 resulting `barrier' from the reachability.
17043 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17046 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17047 instance of ObsoleteAttribute when symbol is obsolete.
17050 (IMethodData): Extended interface for ObsoleteAttribute support.
17052 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17054 * attribute.cs: Fix bug #55970
17056 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17060 (GetObsoleteAttribute): New method. Creates the instance of
17062 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17063 ObsoleteAttribute when member is obsolete.
17064 (AttributeTester.Report_ObsoleteMessage): Common method for
17065 Obsolete error/warning reporting.
17068 (TypeContainer.base_classs_type): New member for storing parent type.
17071 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17072 for this MemberCore.
17074 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17076 * attribute.cs, const.cs: Fix bug #58590
17078 2004-05-21 Martin Baulig <martin@ximian.com>
17080 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17081 out parameters if the end of the method is unreachable. Fixes
17084 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17086 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17087 Hari was right, why extra method.
17089 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17091 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17093 2004-05-20 Martin Baulig <martin@ximian.com>
17095 Merged this back from gmcs to keep the differences to a minumum.
17097 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17098 instead of a Declspace.
17099 (Attribute.ResolveType): Likewise.
17100 (Attributes.Search): Likewise.
17101 (Attributes.Contains): Likewise.
17102 (Attributes.GetClsCompliantAttribute): Likewise.
17104 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17106 (MethodData.ApplyAttributes): Take an EmitContext instead of a
17109 2004-05-19 Marek Safar <marek.safar@seznam.cz>
17111 Fix bug #58688 (MCS does not report error when the same attribute
17114 * attribute.cs (Attribute.Emit): Distinction between null and default.
17116 2004-05-19 Raja R Harinath <rharinath@novell.com>
17118 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17119 of a top-level attribute without an attribute target.
17120 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
17122 (Attribute.Conditional_GetConditionName),
17123 (Attribute.Obsolete_GetObsoleteMessage): Update.
17124 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
17125 part of ScanForIndexerName.
17126 (Attribute.CanIgnoreInvalidAttribute): New function.
17127 (Attribute.ScanForIndexerName): Move to ...
17128 (Attributes.ScanForIndexerName): ... here.
17129 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17130 (Attributes.Search): New internal variant that can choose not to
17131 complain if types aren't resolved. The original signature now
17133 (Attributes.GetClsCompliantAttribute): Use internal variant, with
17134 complaints suppressed.
17135 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17136 only if it not useful.
17137 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17138 top-level for attributes that are shared between the assembly
17139 and a top-level class.
17140 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17141 * class.cs: Update to reflect changes.
17142 (DefineIndexers): Fuse loops.
17143 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
17144 a couple more variants of attribute names.
17146 2004-05-18 Marek Safar <marek.safar@seznam.cz>
17148 Fix bug #52585 (Implemented explicit attribute declaration)
17151 (Attributable.ValidAttributeTargets): New abstract method. It gets
17152 list of valid attribute targets for explicit target declaration.
17153 (Attribute.Target): It holds target itself.
17154 (AttributeSection): Removed.
17155 (Attribute.CheckTargets): New method. It checks whether attribute
17156 target is valid for the current element.
17159 (EventProperty): New class. For events that are declared like
17160 property (with add and remove accessors).
17161 (EventField): New class. For events that are declared like field.
17164 * cs-parser.jay: Implemented explicit attribute target declaration.
17166 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
17167 Override ValidAttributeTargets.
17170 (ReturnParameter): Class for applying custom attributes on
17172 (ParameterAtribute): New class. Class for applying custom
17173 attributes on the parameter type.
17175 2004-05-17 Miguel de Icaza <miguel@ximian.com>
17177 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17180 (Method): Allow UNSAFE here.
17182 * modifiers.cs: Support unsafe reporting.
17184 2004-05-17 Marek Safar <marek.safar@seznam.cz>
17186 * decl.cs: Fix bug #58478.
17188 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17190 * statement.cs: When checking for unreachable code on an EmptyStatement,
17191 set the location. Fixes bug #58488.
17193 2004-05-13 Miguel de Icaza <miguel@ximian.com>
17195 * driver.cs: Add -pkg handling.
17197 From Gonzalo: UseShelLExecute=false
17199 2004-05-12 Marek Safar <marek.safar@seznam.cz>
17202 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17204 (Attribute.IsClsCompliaceRequired): Moved to base for better
17206 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17207 when attribute is AttributeUsageAttribute.
17208 (Attribute.GetValidTargets): Simplified.
17209 (Attribute.GetAttributeUsage): New method returns AttributeUsage
17210 attribute for this type.
17211 (Attribute.ApplyAttributes): Method renamed to Emit and make
17213 (GlobalAttributeSection): New class for special handling of global
17214 attributes (assembly, module).
17215 (AttributeSection.Emit): New method.
17217 * class.cs: Implemented Attributable abstract methods.
17218 (MethodCore.LabelParameters): Moved to Parameter class.
17219 (Accessor): Is back simple class.
17220 (PropertyMethod): Implemented Attributable abstract class.
17221 (DelegateMethod): Implemented Attributable abstract class.
17222 (Event): New constructor for disctintion between normal Event
17223 and Event with accessors.
17225 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17227 * codegen.cs, const.cs, decl.cs, delegate.cs:
17228 (CommonAssemblyModulClass): Implemented Attributable abstract class
17231 * enum.cs: Implement IAttributeSupport interface.
17232 (EnumMember): New class for emum members. Implemented Attributable
17236 (ParameterBase): Is abstract.
17237 (ReturnParameter): New class for easier [return:] attribute handling.
17239 * typemanager.cs: Removed builder_to_attr.
17241 2004-05-11 Raja R Harinath <rharinath@novell.com>
17244 * attribute.cs (Attribute.GetPositionalValue): New function.
17245 * class.cs (TypeContainer.VerifyMembers): New function.
17246 (TypeContainer.Emit): Use it.
17247 (ClassOrStruct): New base class for Class and Struct.
17248 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
17249 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17251 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17252 then each non-static field should have a FieldOffset attribute.
17253 Otherwise, none of the fields should have a FieldOffset attribute.
17254 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
17255 and FieldOffset attributes.
17256 * typemanager.cs (TypeManager.struct_layout_attribute_type)
17257 (TypeManager.field_offset_attribute_type): New core types.
17258 (TypeManager.InitCoreTypes): Initialize them.
17260 2004-05-11 Michal Moskal <malekith@pld-linux.org>
17262 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17263 Return correct type.
17266 2004-05-09 Miguel de Icaza <miguel@ximian.com>
17268 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17269 be implicitly converted to ulong.
17271 * expression.cs: The logic for allowing operator &, | and ^ worked
17272 was wrong, it worked before because we did not report an error in
17273 an else branch. Fixes 57895.
17275 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17276 allow volatile fields to be reference types.
17278 2004-05-07 Miguel de Icaza <miguel@ximian.com>
17280 * driver.cs: Add support for /debug-
17282 2004-05-07 Raja R Harinath <rharinath@novell.com>
17284 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
17285 Add a 'complain' parameter to silence errors.
17286 (Attribute.Resolve): Update to changes. Put in sanity check to catch
17287 silently overlooked type-resolutions.
17288 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17289 to reflect changes.
17290 (Attributes.Search): New function.
17291 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17292 (Attributes.GetAttributeFullName): Remove hack.
17293 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
17294 Update to reflect changes.
17295 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17296 Use Attributes.Search instead of nested loops.
17298 2004-05-07 Marek Safar <marek.safar@seznam.cz>
17301 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17302 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17303 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17305 * report.cs: (Report.Warning): Renamed to Warning_T because of
17306 parameter collision.
17308 2004-05-05 Raja R Harinath <rharinath@novell.com>
17310 * expression.cs (MemberAccess.ResolveMemberAccess):
17311 Exit with non-zero status after Report.Error.
17312 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17314 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17316 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17318 * support.cs: Don't hang when the file is empty.
17320 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17322 * support.cs: In SeekableStreamReader, compute the preamble size of the
17323 underlying stream. Position changes should take into account that initial
17326 2004-05-03 Todd Berman <tberman@sevenl.net>
17328 * driver.cs: remove unused GetSysVersion function.
17330 2004-05-03 Todd Berman <tberman@sevenl.net>
17332 * driver.cs: Remove the hack from saturday, as well as the hack
17333 from jackson (LoadAssemblyFromGac), also adds the CWD to the
17334 link_paths to get that bit proper.
17336 2004-05-01 Todd Berman <tberman@sevenl.net>
17338 * driver.cs: Try a LoadFrom before a Load, this checks the current
17339 path. This is currently a bug in mono that is be fixed, however, this
17340 provides a workaround for now. This will be removed when the bug
17343 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
17345 * CryptoConvert.cs: Updated to latest version. Fix issue with
17346 incomplete key pairs (#57941).
17348 2004-05-01 Todd Berman <tberman@sevenl.net>
17350 * driver.cs: Remove '.' from path_chars, now System.* loads properly
17353 2004-04-30 Jackson Harper <jackson@ximian.com>
17355 * codegen.cs: Open keys readonly.
17357 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17359 * typemanager.cs: don't report cyclic struct layout when a struct
17360 contains 2 or more fields of the same type. Failed for Pango.AttrShape
17361 which has 2 Pango.Rectangle fields.
17363 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
17365 * expression.cs: Handle IntPtr comparisons with IL code
17366 rather than a method call.
17368 2004-04-29 Martin Baulig <martin@ximian.com>
17370 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
17371 the list of PropertyInfo's in class hierarchy and find the
17372 accessor. Fixes #56013.
17374 2004-04-29 Martin Baulig <martin@ximian.com>
17376 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17378 2004-04-29 Martin Baulig <martin@ximian.com>
17380 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17382 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17384 2004-04-29 Martin Baulig <martin@ximian.com>
17386 * class.cs (ConstructorInitializer.Resolve): Check whether the
17387 parent .ctor is accessible. Fixes #52146.
17389 2004-04-29 Martin Baulig <martin@ximian.com>
17391 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17393 * statement.cs (Using.EmitLocalVariableDecls): Use
17394 TypeManager.idisposable_type, not typeof (IDisposable).
17395 (Foreach.EmitCollectionForeach): Added support for valuetypes.
17397 2004-04-29 Martin Baulig <martin@ximian.com>
17399 * class.cs (Event.Define): Don't emit the field and don't set
17400 RTSpecialName and SpecialName for events on interfaces. Fixes
17403 2004-04-29 Raja R Harinath <rharinath@novell.com>
17405 Refactor Attribute.ApplyAttributes.
17406 * attribute.cs (Attributable): New base class for objects that can
17407 have Attributes applied on them.
17408 (Attribute): Make AttributeUsage fields public.
17409 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17410 (Attribute.IsInternalCall): New property.
17411 (Attribute.UsageAttr): Convert to a public read-only property.
17412 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17413 (Attribute.ResolveType, Attribute.Resolve)
17414 (Attribute.ScanForIndexerName): Update to reflect changes.
17415 (Attribute.CheckAttributeTarget): Re-format.
17416 (Attribute.ApplyAttributes): Refactor, to various
17417 Attributable.ApplyAttributeBuilder methods.
17418 * decl.cs (MemberCore): Make Attributable.
17419 * class.cs (Accessor): Make Attributable.
17420 (MethodData.ApplyAttributes): Use proper attribute types, not
17422 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17423 (TypeContainer.ApplyAttributeBuilder)
17424 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17425 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
17426 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17427 (Operator.ApplyAttributeBuilder): New factored-out methods.
17428 * const.cs (Const.ApplyAttributeBuilder): Likewise.
17429 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17430 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17431 * parameter.cs (ParameterBase): New Attributable base class
17432 that can also represent Return types.
17433 (Parameter): Update to the changes.
17435 2004-04-29 Jackson Harper <jackson@ximian.com>
17437 * driver.cs: Prefer the corlib system version when looking for
17438 assemblies in the GAC. This is still a hack, but its a better hack
17441 2004-04-29 Marek Safar <marek.safar@seznam.cz>
17443 * decl.cs, enum.cs: Improved error 3005 reporting.
17445 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17446 (related_symbols): New private member for list of symbols
17447 related to reported error/warning.
17449 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17451 2004-04-29 Martin Baulig <martin@ximian.com>
17453 * ecore.cs (Expression.Constantify): If we're an enum and
17454 TypeManager.TypeToCoreType() doesn't give us another type, use
17455 t.UnderlyingSystemType. Fixes #56178.
17457 2004-04-29 Martin Baulig <martin@ximian.com>
17459 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17460 interfaces and for each interface, only add members directly
17461 declared in that interface. Fixes #53255.
17463 2004-04-28 Martin Baulig <martin@ximian.com>
17465 * expression.cs (ConditionalLogicalOperator): Use a temporary
17466 variable for `left' to avoid that we evaluate it more than once;
17469 2004-04-28 Martin Baulig <martin@ximian.com>
17471 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17474 2004-04-28 Martin Baulig <martin@ximian.com>
17476 * statement.cs (LocalInfo.Resolve): Check whether the type is not
17479 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17480 whether the type is not void (CS1547).
17482 2004-04-28 Martin Baulig <martin@ximian.com>
17484 * expression.cs (Unary.DoResolveLValue): Override this and report
17485 CS0131 for anything but Operator.Indirection.
17487 2004-04-28 Martin Baulig <martin@ximian.com>
17489 Committing a patch from Ben Maurer; see bug #50820.
17491 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17494 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17497 2004-04-28 Martin Baulig <martin@ximian.com>
17499 Committing a patch from Ben Maurer; see bug #50820.
17501 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17504 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17507 2004-04-28 Martin Baulig <martin@ximian.com>
17509 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17510 (Block.AddLabel): Call DoLookupLabel() to only search in the
17513 2004-04-28 Martin Baulig <martin@ximian.com>
17515 * cfold.cs (ConstantFold.BinaryFold): Added special support for
17516 comparing StringConstants and NullLiterals in Equality and Inequality.
17518 2004-04-28 Jackson Harper <jackson@ximian.com>
17520 * driver.cs: Attempt to load referenced assemblies from the
17521 GAC. This is the quick and dirty version of this method that
17522 doesnt take into account versions and just takes the first
17523 canidate found. Will be good enough for now as we will not have more
17524 then one version installed into the GAC until I update this method.
17526 2004-04-28 Martin Baulig <martin@ximian.com>
17528 * typemanager.cs (TypeManager.CheckStructCycles): New public
17529 static method to check for cycles in the struct layout.
17531 * rootcontext.cs (RootContext.PopulateTypes): Call
17532 TypeManager.CheckStructCycles() for each TypeContainer.
17533 [Note: We only need to visit each type once.]
17535 2004-04-28 Martin Baulig <martin@ximian.com>
17537 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17539 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17540 success and added `out object value'. Use a `bool resolved' field
17541 to check whether we've already been called rather than
17542 `ConstantValue != null' since this breaks for NullLiterals.
17544 2004-04-28 Raja R Harinath <rharinath@novell.com>
17546 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17547 setting of this flag, since the 'set' method may be non-public.
17549 2004-04-28 Raja R Harinath <rharinath@novell.com>
17551 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17552 check on current_vector.Block.
17554 2004-04-27 Martin Baulig <martin@ximian.com>
17556 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17557 a field initializer. Fixes #56459.
17559 2004-04-27 Martin Baulig <martin@ximian.com>
17561 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17562 we're not attempting to use an indexer. Fixes #52154.
17564 2004-04-27 Martin Baulig <martin@ximian.com>
17566 * statement.cs (Return): Don't create a return label if we don't
17567 need it; reverts my change from January 20th. Thanks to Ben
17570 2004-04-27 Martin Baulig <martin@ximian.com>
17572 According to the spec, `goto' can only leave a nested scope, but
17575 * statement.cs (Block.LookupLabel): Only lookup in the current
17576 block, don't recurse into parent or child blocks.
17577 (Block.AddLabel): Check in parent and child blocks, report
17578 CS0140/CS0158 if we find a duplicate.
17579 (Block): Removed this indexer for label lookups.
17580 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17581 this already does the error reporting for us.
17584 (FlowBranching.UsageVector.Block): New public variable; may be null.
17585 (FlowBranching.CreateSibling): Added `Block' argument.
17586 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17587 label for the target of a `goto' and check whether we're not
17588 leaving a `finally'.
17590 2004-04-27 Martin Baulig <martin@ximian.com>
17592 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17593 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17596 2004-04-27 Martin Baulig <martin@ximian.com>
17598 * statement.cs (Block.AddLabel): Also check for implicit blocks
17599 and added a CS0158 check.
17601 2004-04-27 Martin Baulig <martin@ximian.com>
17603 * flowanalysis.cs (FlowBranchingLoop): New class.
17604 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17605 UsageVector's instead of an ArrayList.
17606 (FlowBranching.Label): Likewise.
17607 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17608 (FlowBranching.AddBreakVector): New method.
17610 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17612 * attribute.cs: Small regression fix: only convert the type if we
17613 the type is different, fixes System.Drawing build.
17615 2004-04-27 Martin Baulig <martin@ximian.com>
17617 * attribute.cs (Attribute.Resolve): If we have a constant value
17618 for a named field or property, implicity convert it to the correct
17621 2004-04-27 Raja R Harinath <rharinath@novell.com>
17623 * statement.cs (Block.Block): Implicit blocks share
17624 'child_variable_names' fields with parent blocks.
17625 (Block.AddChildVariableNames): Remove.
17626 (Block.AddVariable): Mark variable as "used by a child block" in
17627 every surrounding block.
17628 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17629 been used in a child block, complain about violation of "Invariant
17630 meaning in blocks" rule.
17631 * cs-parser.jay (declare_local_variables): Don't use
17632 AddChildVariableNames.
17633 (foreach_statement): Don't create an implicit block: 'foreach'
17634 introduces a scope.
17636 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17638 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17639 converting from 0L to ulong. Fixes 57522.
17641 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17643 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17644 derived class hides via 'new' keyword field from base class (test-242.cs).
17645 TODO: Handle this in the more general way.
17647 * class.cs (CheckBase): Ditto.
17649 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17651 * decl.cs (caching_flags): New member for storing cached values
17653 (MemberCore.Flags): New enum where bit flags for caching_flags
17655 (MemberCore.cls_compliance): Moved to caching_flags.
17656 (DeclSpace.Created): Moved to caching_flags.
17658 * class.cs: Use caching_flags instead of DeclSpace.Created
17660 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17662 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17663 if we are only a derived class, not a nested class.
17665 * typemanager.cs: Same as above, but do this at the MemberLookup
17666 level (used by field and methods, properties are handled in
17667 PropertyExpr). Allow for the qualified access if we are a nested
17670 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17672 * class.cs: Refactoring.
17673 (IMethodData): New inteface; Holds links to parent members
17674 to avoid member duplication (reduced memory allocation).
17675 (Method): Implemented IMethodData interface.
17676 (PropertyBase): New inner classes for get/set methods.
17677 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17678 (Event): New inner classes for add/remove methods.
17679 (Event.DelegateMethod): Implemented IMethodData interface.
17681 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17682 EmitContext (related to class.cs refactoring).
17684 2004-04-21 Raja R Harinath <rharinath@novell.com>
17686 * delegate.cs (Delegate.VerifyApplicability): If the number of
17687 arguments are the same as the number of parameters, first try to
17688 verify applicability ignoring any 'params' modifier on the last
17692 2004-04-16 Raja R Harinath <rharinath@novell.com>
17694 * class.cs (TypeContainer.AddIndexer): Use
17695 'ExplicitInterfaceName' to determine if interface name was
17696 explicitly specified. 'InterfaceType' is not initialized at this time.
17697 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17698 Indexers array is already in the required order. Initialize
17699 'IndexerName' only if there are normal indexers.
17700 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17701 (TypeContainer.Emit): Emit DefaultMember attribute only if
17702 IndexerName is initialized.
17705 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17707 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17710 2004-04-15 Raja R Harinath <rharinath@novell.com>
17712 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17716 * attribute.cs (Attribute.Resolve): Check for duplicate named
17720 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17722 * iterators.cs (MarkYield): track whether we are in an exception,
17723 and generate code accordingly. Use a temporary value to store the
17724 result for our state.
17726 I had ignored a bit the interaction of try/catch with iterators
17727 since their behavior was not entirely obvious, but now it is
17728 possible to verify that our behavior is the same as MS .NET 2.0
17732 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17734 * iterators.cs: Avoid creating temporaries if there is no work to
17737 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17738 Enumerations, use TypeManager.EnumToUnderlying and call
17741 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17744 (This.Emit): Use EmitContext.EmitThis to emit our
17747 (This.EmitAssign): Ditto.
17749 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17750 codepaths, we will move all the functionality into
17753 (FieldExpr.EmitAssign): Ditto.
17755 This fixes several hidden bugs that I uncovered while doing a code
17756 review of this today.
17758 * codegen.cs (EmitThis): reworked so the semantics are more clear
17759 and also support value types "this" instances.
17761 * iterators.cs: Changed so that for iterators in value types, we
17762 do not pass the value type as a parameter.
17764 Initialization of the enumerator helpers is now done in the caller
17765 instead of passing the parameters to the constructors and having
17766 the constructor set the fields.
17768 The fields have now `assembly' visibility instead of private.
17770 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17772 * expression.cs (Argument.Resolve): Check if fields passed as ref
17773 or out are contained in a MarshalByRefObject.
17775 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17776 another compiler type.
17778 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17780 * class.cs (Indexer.Define): use the new name checking method.
17781 Also, return false on an error.
17782 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17783 (is_identifier_[start/part]_character): make static.
17785 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17787 * expression.cs (Binary.ResolveOperator): Do no append strings
17788 twice: since we can be invoked more than once (array evaluation)
17789 on the same concatenation, take care of this here. Based on a fix
17790 from Ben (bug #56454)
17792 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17794 * codegen.cs: Fix another case where CS1548 must be reported (when
17795 delay-sign isn't specified and no private is available #56564). Fix
17796 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17797 error when MCS is used on the MS runtime and we need to delay-sign
17798 (which seems unsupported by AssemblyBuilder - see #56621).
17800 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17802 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17803 (TypeManager.ComputeNamespaces): Faster implementation for
17806 * compiler.csproj: Updated AssemblyName to mcs.
17808 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17810 * rootcontext.cs: Add new types to the boot resolution.
17812 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17813 MulticastDelegate is not allowed.
17815 * typemanager.cs: Add new types to lookup: System.TypedReference
17818 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17819 check for TypedReference or ArgIterator, they are not allowed.
17821 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17822 makes us properly catch 1510 in some conditions (see bug 56016 for
17825 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17827 * CryptoConvert.cs: update from corlib version
17830 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17832 * class.cs (Indexer.Define): Check indexername declaration
17834 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17836 * attribute.cs (IsClsCompliant): Fixed problem with handling
17837 all three states (compliant, not-compliant, undetected).
17839 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17841 * attribute.cs (Attribute): Location is now public.
17842 (Resolve): Store resolved arguments (pos_values) in attribute class.
17843 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17844 (GetClsCompliantAttributeValue): New method that gets
17845 CLSCompliantAttribute value.
17846 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17847 if exists else null.
17848 (AttributeTester): New class for CLS-Compliant verification routines.
17850 * class.cs (Emit): Add CLS-Compliant verification.
17851 (Method.GetSignatureForError): Implemented.
17852 (Constructor.GetSignatureForError): Implemented
17853 (Constructor.HasCompliantArgs): Returns if constructor has
17854 CLS-Compliant arguments.
17855 (Constructor.Emit): Override.
17856 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17857 is needed to test only parameters.
17858 (FieldBase.GetSignatureForError): Implemented.
17859 (TypeContainer): New member for storing base interfaces.
17860 (TypeContainer.FindMembers): Search in base interfaces too.
17862 * codegen.cs (GetClsComplianceAttribute): New method that gets
17863 assembly or module CLSCompliantAttribute value.
17864 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17866 (ModuleClass.Emit): Add error 3012 test.
17868 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17870 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17871 state for all decl types.
17872 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17873 if CLS-Compliant tests are required.
17874 (IsClsCompliaceRequired): New method. Analyze whether code
17875 must be CLS-Compliant.
17876 (IsExposedFromAssembly): New method. Returns true when MemberCore
17877 is exposed from assembly.
17878 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17879 value or gets cached value.
17880 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17881 is explicitly marked with CLSCompliantAttribute.
17882 (IsIdentifierClsCompliant): New abstract method. This method is
17883 used to testing error 3005.
17884 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17885 for identifier and parameters CLS-Compliant testing.
17886 (VerifyClsCompliance): New method. The main virtual method for
17887 CLS-Compliant verifications.
17888 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17889 null. I don't know why is null (too many public members !).
17890 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17891 and get value of first CLSCompliantAttribute that found.
17893 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17894 (VerifyClsCompliance): Override and add extra tests.
17896 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17897 clscheck- disable CLS-Compliant verification event if assembly is has
17898 CLSCompliantAttribute(true).
17900 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17901 ApllyAttribute is now called in emit section as in the other cases.
17902 Possible future Emit integration.
17903 (IsIdentifierClsCompliant): New override.
17904 (VerifyClsCompliance): New override.
17905 (GetEnumeratorName): Returns full enum name.
17907 * parameter.cs (GetSignatureForError): Implemented.
17909 * report.cs (WarningData): New struct for Warning message information.
17910 (LocationOfPreviousError): New method.
17911 (Warning): New method. Reports warning based on the warning table.
17912 (Error_T): New method. Reports error based on the error table.
17914 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17915 verifications are done here.
17917 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17919 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17920 CLSCompliantAttribute.
17921 (all_imported_types): New member holds all imported types from other
17923 (LoadAllImportedTypes): New method fills static table with exported types
17924 from all referenced assemblies.
17925 (Modules): New property returns all assembly modules.
17927 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17929 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17930 throwing a parser error.
17932 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17933 which removes the hardcoded get_/set_ prefixes for properties, as
17934 IL allows for the properties to be named something else.
17938 * expression.cs: Do not override operand before we know if it is
17939 non-null. Fix 56207
17941 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17943 * typemanager.cs: support for pinned variables.
17945 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17947 * decl.cs, typemanager.cs: Avoid using an arraylist
17948 as a buffer if there is only one result set.
17950 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17952 * expression.cs: Make sure you cant call a static method
17953 with an instance expression, bug #56174.
17955 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17957 * class.cs (IsDuplicateImplementation): Improve error reporting to
17958 flag 663 (method only differs in parameter modifier).
17960 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17961 in preprocessor directives.
17963 * location.cs (LookupFile): Allow for the empty path.
17965 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17966 better approach for some of that patch, but its failing with the
17967 CharSet enumeration. For now try/catch will do.
17969 * typemanager.cs: Do not crash if a struct does not have fields.
17972 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17974 * expression.cs: cs0213, cant fix a fixed expression.
17977 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17979 * cs-parser.jay: detect invalid embeded statements gracefully.
17982 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17984 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17987 the invocation type may not be a subclass of the tye of the item/
17988 The type of the item must be a subclass of the invocation item.
17993 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17995 * attribute.cs: Added methods to get a string and a bool from an
17996 attribute. Required to information from AssemblyKeyFileAttribute,
17997 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17998 * codegen.cs: Modified AssemblyName creation to include support for
17999 strongnames. Catch additional exceptions to report them as CS1548.
18000 * compiler.csproj: Updated include CryptoConvert.cs.
18001 * compiler.csproj.user: Removed file - user specific configuration.
18002 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
18003 Mono.Security assembly. The original class is maintained and tested in
18004 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18005 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18006 like CSC 8.0 (C# v2) supports.
18007 * Makefile: Added CryptoConvert.cs to mcs sources.
18008 * rootcontext.cs: Added new options for strongnames.
18010 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
18012 * driver.cs: For --expect-error, report error code `2'
18013 if the program compiled with no errors, error code `1' if
18014 it compiled with an error other than the one expected.
18016 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
18018 * compiler.csproj: Updated for Visual Studio .NET 2003.
18019 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18020 * compiler.sln: Updated for Visual Studio .NET 2003.
18022 2004-03-24 Ravi Pratap M <ravi@ximian.com>
18024 * expression.cs: Fix bug #47234. We basically need to apply the
18025 rule that we prefer the conversion of null to a reference type
18026 when faced with a conversion to 'object' (csc behaviour).
18028 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18030 * statement.cs: Shorter form for foreach, eliminates
18031 a local variable. r=Martin.
18033 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18035 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18036 checks if we can use brtrue/brfalse to test for 0.
18037 * expression.cs: use the above in the test for using brtrue/brfalse.
18038 cleanup code a bit.
18040 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18042 * expression.cs: Rewrite string concat stuff. Benefits:
18044 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18045 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18046 rather than a concat chain.
18048 * typemanager.cs: Add lookups for more concat overloads.
18050 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18052 * expression.cs: Emit shorter il code for array init.
18069 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
18071 * statement.cs: Before, two switch blocks would be merged if the
18072 total size of the blocks (end_item - begin_item + 1) was less than
18073 two times the combined sizes of the blocks.
18075 Now, it will only merge if after the merge at least half of the
18080 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
18082 * class.cs : csc build fix for GetMethods(). See bug #52503.
18084 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
18086 * expression.cs: Make sure fp comparisons work with NaN.
18087 This fixes bug #54303. Mig approved this patch a long
18088 time ago, but we were not able to test b/c the runtime
18091 2004-03-19 Miguel de Icaza <miguel@ximian.com>
18093 * ecore.cs (TypExpr.GetHashCode): implement this overload.
18095 2004-03-19 Martin Baulig <martin@ximian.com>
18097 * class.cs (MemberCore.IsDuplicateImplementation): Report the
18098 error here and not in our caller.
18100 2004-03-19 Martin Baulig <martin@ximian.com>
18102 * interface.cs: Completely killed this file.
18103 (Interface): We're now a TypeContainer and live in class.cs.
18105 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18106 argument; we're now also called for interfaces.
18107 (TypeContainer.DefineMembers): Allow this method being called
18109 (TypeContainer.GetMethods): New public method; formerly known as
18110 Interface.GetMethod(). This is used by PendingImplementation.
18111 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18112 it's now private and non-static.
18113 (Interface): Moved this here; it's now implemented similar to
18115 (Method, Property, Event, Indexer): Added `bool is_interface'
18116 argument to their .ctor's.
18117 (MemberBase.IsInterface): New public field.
18119 * cs-parser.jay: Create normal Method, Property, Event, Indexer
18120 instances instead of InterfaceMethod, InterfaceProperty, etc.
18121 (opt_interface_base): Removed; we now use `opt_class_base' instead.
18122 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18124 2004-03-19 Martin Baulig <martin@ximian.com>
18126 * class.cs (MethodCore.IsDuplicateImplementation): New private
18127 method which does the CS0111 checking.
18128 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18129 Use IsDuplicateImplementation().
18131 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
18133 * decl.cs (FindMemberToOverride): New method to find the correct
18134 method or property to override in the base class.
18136 - Make Method/Property use the above method to find the
18137 version in the base class.
18138 - Remove the InheritableMemberSignatureCompare as it is now
18141 This patch makes large code bases much faster to compile, as it is
18142 O(n) rather than O(n^2) to do this validation.
18144 Also, it fixes bug 52458 which is that nested classes are not
18145 taken into account when finding the base class member.
18147 Reviewed/Approved by Martin.
18149 2004-03-17 Marek Safar <marek.safar@seznam.cz>
18151 * interface.cs: In all interface classes removed redundant
18152 member initialization.
18154 2004-03-16 Martin Baulig <martin@ximian.com>
18156 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18158 2004-03-15 Miguel de Icaza <miguel@ximian.com>
18160 * decl.cs (DefineTypeAndParents): New helper method to define a
18161 type's containers before the type itself is defined; This is a
18162 bug exposed by the recent changes to Windows.Forms when an
18163 implemented interface was defined inside a class that had not been
18166 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18168 (Check): Loop correctly to report errors modifiers
18169 (UNSAFE was not in the loop, since it was the same as TOP).
18171 * interface.cs: Every interface member now takes a ModFlags,
18172 instead of a "is_new" bool, which we set on the base MemberCore.
18174 Every place where we called "UnsafeOk" in the interface, now we
18175 call the proper member (InterfaceMethod.UnsafeOK) instead to get
18176 the unsafe settings from the member declaration instead of the
18177 container interface.
18179 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
18181 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18182 `set_indexer_name' to the pending bits (one per type).
18184 We fixed a bug today that was picking the wrong method to
18185 override, since for properties the existing InterfaceMethod code
18186 basically ignored the method name. Now we make sure that the
18187 method name is one of the valid indexer names.
18189 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
18191 * support.cs (SeekableStreamReader): Keep track of stream byte
18192 positions and don't mix them with character offsets to the buffer.
18194 Patch from Gustavo Giráldez
18196 2004-03-15 Marek Safar <marek.safar@seznam.cz>
18198 * interface.cs (InterfaceSetGetBase): Removed double member
18199 initialization, base class does it as well.
18201 2004-03-13 Martin Baulig <martin@ximian.com>
18203 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18204 when compiling corlib.
18206 2004-03-13 Miguel de Icaza <miguel@ximian.com>
18208 * convert.cs (ExplicitConversion): We were reporting an error on
18209 certain conversions (object_type source to a value type, when the
18210 expression was `null') before we had a chance to pass it through
18211 the user defined conversions.
18213 * driver.cs: Replace / and \ in resource specifications to dots.
18216 * class.cs: Add check for duplicate operators. Fixes 52477
18218 2004-03-11 Miguel de Icaza <miguel@ximian.com>
18220 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18221 that are in the middle of the statements, not only at the end.
18224 * class.cs (TypeContainer.AddField): No longer set the
18225 `HaveStaticConstructor' flag, now we call it
18226 `UserDefineStaticConstructor' to diferentiate the slightly
18227 semantic difference.
18229 The situation is that we were not adding BeforeFieldInit (from
18230 Modifiers.TypeAttr) to classes that could have it.
18231 BeforeFieldInit should be set to classes that have no static
18236 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18238 And most importantly Zoltan's comment:
18240 http://bugzilla.ximian.com/show_bug.cgi?id=44229
18242 "I think beforefieldinit means 'it's ok to initialize the type sometime
18243 before its static fields are used', i.e. initialization does not need
18244 to be triggered by the first access to the type. Setting this flag
18245 helps the JIT to compile better code, since it can run the static
18246 constructor at JIT time, and does not need to generate code to call it
18247 (possibly lots of times) at runtime. Unfortunately, mcs does not set
18248 this flag for lots of classes like String.
18250 csc sets this flag if the type does not have an explicit static
18251 constructor. The reasoning seems to be that if there are only static
18252 initalizers for a type, and no static constructor, then the programmer
18253 does not care when this initialization happens, so beforefieldinit
18256 This bug prevents the AOT compiler from being usable, since it
18257 generates so many calls to mono_runtime_class_init that the AOT code
18258 is much slower than the JITted code. The JITted code is faster,
18259 because it does not generate these calls if the vtable is type is
18260 already initialized, which is true in the majority of cases. But the
18261 AOT compiler can't do this."
18263 2004-03-10 Miguel de Icaza <miguel@ximian.com>
18265 * class.cs (MethodData.Emit): Refactor the code so symbolic
18266 information is generated for destructors; For some reasons we
18267 were taking a code path that did not generate symbolic information
18270 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
18272 * class.cs: Create a Constructor.CheckBase method that
18273 takes care of all validation type code. The method
18274 contains some code that was moved from Define.
18276 It also includes new code that checks for duplicate ctors.
18277 This fixes bug #55148.
18279 2004-03-09 Joshua Tauberer <tauberer@for.net>
18281 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18282 a { ... }-style array creation invokes EmitStaticInitializers
18283 which is not good for reference-type arrays. String, decimal
18284 and now null constants (NullCast) are not counted toward
18285 static initializers.
18287 2004-03-05 Martin Baulig <martin@ximian.com>
18289 * location.cs (SourceFile.HasLineDirective): New public field;
18290 specifies whether the file contains or is referenced by a "#line"
18292 (Location.DefineSymbolDocuments): Ignore source files which
18293 either contain or are referenced by a "#line" directive.
18295 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
18297 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18298 direct access to our parent, so check the method inline there.
18300 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
18302 * expression.cs (Invocation.EmitCall): Miguel's last commit
18303 caused a regression. If you had:
18308 In Foo the implict this would be null.
18310 2004-02-27 Miguel de Icaza <miguel@ximian.com>
18312 * expression.cs (Invocation.EmitCall): If the method is not
18313 virtual, do not emit a CallVirt to it, use Call.
18315 * typemanager.cs (GetFullNameSignature): Improve the method to
18316 cope with ".ctor" and replace it with the type name.
18318 * class.cs (ConstructorInitializer.Resolve): Now the method takes
18319 as an argument the ConstructorBuilder where it is being defined,
18320 to catch the recursive constructor invocations.
18322 2004-02-26 Miguel de Icaza <miguel@ximian.com>
18324 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18325 routines to check if a type is an enumerable/enumerator allow
18326 classes that implement the IEnumerable or IEnumerator interfaces.
18328 * class.cs (Property, Operator): Implement IIteratorContainer, and
18329 implement SetYields.
18331 (Property.Define): Do the block swapping for get_methods in the
18332 context of iterators. We need to check if Properties also
18333 include indexers or not.
18335 (Operator): Assign the Block before invoking the
18336 OperatorMethod.Define, so we can trigger the Iterator code
18339 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
18340 Property and Operator classes are not created when we parse the
18341 declarator but until we have the block completed, so we use a
18342 singleton SimpleIteratorContainer.Simple to flag whether the
18343 SetYields has been invoked.
18345 We propagate this setting then to the Property or the Operator to
18346 allow the `yield' to function.
18348 2004-02-25 Marek Safar <marek.safar@seznam.cz>
18350 * codegen.cs: Implemented attribute support for modules.
18351 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18352 Assembly/Module functionality.
18354 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18355 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18356 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18358 2004-02-16 Marek Safar <marek.safar@seznam.cz>
18360 * interface.cs (FindMembers): The operation is performed on all base
18361 interfaces and not only on the first. It is required for future CLS Compliance patch.
18363 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
18365 * statement.cs, codegen.cs:
18366 This patch deals with patterns such as:
18368 public class List : IEnumerable {
18370 public MyEnumerator GetEnumerator () {
18371 return new MyEnumerator(this);
18374 IEnumerator IEnumerable.GetEnumerator () {
18378 public struct MyEnumerator : IEnumerator {
18383 Before, there were a few things we did wrong:
18384 1) we would emit callvirt on a struct, which is illegal
18385 2) we emited ldarg when we needed to emit ldarga
18386 3) we would mistakenly call the interface methods on an enumerator
18387 type that derived from IEnumerator and was in another assembly. For example:
18389 public class MyEnumerator : IEnumerator
18391 Would have the interface methods called, even if there were public impls of the
18392 method. In a struct, this lead to invalid IL code.
18394 2004-02-11 Marek Safar <marek.safar@seznam.cz>
18396 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18399 * delegate.cs (Define): Fixed crash when delegate type is undefined.
18401 2004-02-11 Miguel de Icaza <miguel@ximian.com>
18403 * cs-parser.jay: Fix small regression: we were not testing V2
18404 compiler features correctly.
18406 * interface.cs: If the emit context is null, then create one
18408 2004-02-09 Marek Safar <marek.safar@seznam.cz>
18410 * decl.cs (GetSignatureForError): New virtual method to get full name
18411 for error messages.
18413 * attribute.cs (IAttributeSupport): New interface for attribute setting.
18414 Now it is possible to rewrite ApplyAttributes method to be less if/else.
18416 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18417 Duplicated members and code in these classes has been removed.
18418 Better encapsulation in these classes.
18420 2004-02-07 Miguel de Icaza <miguel@ximian.com>
18422 * assign.cs (Assign.DoResolve): When dealing with compound
18423 assignments, there is a new rule in ECMA C# 2.4 (might have been
18424 there before, but it is documented here) that states that in:
18428 If b is of type int, and the `op' is a shift-operator, then the
18429 above is evaluated as:
18433 * expression.cs (Binary.ResolveOperator): Instead of testing for
18434 int/uint/long/ulong, try to implicitly convert to any of those
18435 types and use that in pointer arithmetic.
18437 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18438 method to print information for from the type, not from the
18439 null-method we were given.
18441 2004-02-01 Duncan Mak <duncan@ximian.com>
18443 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18444 parsing for cmd, fixes bug #53694.
18446 2004-02-04 Marek Safar <marek.safar@seznam.cz>
18448 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18449 in the member name duplication tests. Property and operator name duplication
18450 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18452 2004-02-03 Marek Safar <marek.safar@seznam.cz>
18454 * interface.cs (PopulateMethod): Fixed crash when interface method
18455 returns not existing type (error test cs0246-3.cs).
18457 2004-02-02 Ravi Pratap M <ravi@ximian.com>
18459 * cs-parser.jay (interface_accessors): Re-write actions to also
18460 store attributes attached to get and set methods. Fix spelling
18463 (inteface_property_declaration): Modify accordingly.
18465 (InterfaceAccessorInfo): New helper class to store information to pass
18466 around between rules that use interface_accessors.
18468 * interface.cs (Emit): Apply attributes on the get and set
18469 accessors of properties and indexers too.
18471 * attribute.cs (ApplyAttributes): Modify accordingly to use the
18472 right MethodBuilder when applying attributes to the get and set accessors.
18474 2004-01-31 Miguel de Icaza <miguel@ximian.com>
18476 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18478 2004-01-26 Miguel de Icaza <miguel@ximian.com>
18480 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18482 2004-01-25 Miguel de Icaza <miguel@ximian.com>
18484 * cs-parser.jay: Remove YIELD token, instead use the new grammar
18485 changes that treat `yield' specially when present before `break'
18486 or `return' tokens.
18488 * cs-tokenizer.cs: yield is no longer a keyword.
18490 2004-01-23 Marek Safar <marek.safar@seznam.cz>
18492 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18493 setting for default constructors.
18494 For default constructors are almost every time set wrong Modifier. The
18495 generated IL code has been alright. But inside mcs this values was
18496 wrong and this was reason why several of my CLS Compliance tests
18499 2004-01-22 Martin Baulig <martin@ximian.com>
18501 * cs-parser.jay (namespace_or_type_name): Return an Expression,
18502 not a QualifiedIdentifier. This is what `type_name_expression'
18503 was previously doing.
18504 (type_name_expression): Removed; the code is now in
18505 `namespace_or_type_name'.
18506 (qualified_identifier): Removed, use `namespace_or_type_name'
18508 (QualifiedIdentifier): Removed this class.
18510 2004-01-22 Martin Baulig <martin@ximian.com>
18512 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18513 not a string as alias name.
18515 2004-01-21 Miguel de Icaza <miguel@ximian.com>
18517 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18518 #52730 bug, and instead compute correctly the need to use a
18519 temporary variable when requesting an address based on the
18520 static/instace modified of the field and the constructor.
18522 2004-01-21 Martin Baulig <martin@ximian.com>
18524 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18525 class and namespace before looking up aliases. Fixes #52517.
18527 2004-01-21 Martin Baulig <martin@ximian.com>
18529 * flowanalysis.cs (UsageVector.Merge): Allow variables being
18530 assinged in a 'try'; fixes exception4.cs.
18532 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18533 * class.cs : Implemented parameter-less constructor for TypeContainer
18535 * decl.cs: Attributes are now stored here. New property OptAttributes
18537 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18539 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18541 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18543 * typemanager.cs (CSharpSignature): Now reports also inner class name.
18544 (CSharpSignature): New method for indexer and property signature.
18546 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18548 * pending.cs (IsVirtualFilter): Faster implementation.
18550 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18552 * typemanager.cs: Avoid inclusion of same assembly more than once.
18554 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18556 * cs-parser.jay: Fixed problem where the last assembly attribute
18557 has been applied also to following declaration (class, struct, etc.)
18559 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18561 * class.cs: Added error CS0538, CS0539 reporting.
18562 Fixed crash on Microsoft runtime when field type is void.
18564 * cs-parser.jay: Added error CS0537 reporting.
18566 * pending.cs: Added error CS0535 reporting.
18567 Improved error report for errors CS0536, CS0534.
18569 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18571 Merge a few bits from the Anonymous Method MCS tree.
18573 * statement.cs (ToplevelBlock): New class for toplevel methods,
18574 will hold anonymous methods, lifted variables.
18576 * cs-parser.jay: Create toplevel blocks for delegates and for
18577 regular blocks of code.
18579 2004-01-20 Martin Baulig <martin@ximian.com>
18581 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18582 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18583 and `NeedExplicitReturn'; added `IsLastStatement'.
18584 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18585 have a `ReturnLabel' or we're not unreachable.
18587 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18588 child's reachability; don't just override ours with it. Fixes
18589 #58058 (lluis's example).
18590 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18591 InFinally(), InLoop(), InSwitch() and
18592 BreakCrossesTryCatchBoundary() methods.
18594 * statement.cs (Return): Do all error checking in Resolve().
18595 Unless we are the last statement in a top-level block, always
18596 create a return label and jump to it.
18597 (Break, Continue): Do all error checking in Resolve(); also make
18598 sure we aren't leaving a `finally'.
18599 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18600 statement in a top-level block.
18601 (Block.Flags): Added `IsDestructor'.
18602 (Block.IsDestructor): New public property.
18604 2004-01-20 Martin Baulig <martin@ximian.com>
18606 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18608 2004-01-20 Martin Baulig <martin@ximian.com>
18610 * statement.cs (Statement.ResolveUnreachable): New public method.
18611 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18612 (Block.Resolve): Resolve unreachable statements.
18614 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18616 * expression.cs: We need to fix the case where we do
18617 not have a temp variable here.
18619 * assign.cs: Only expression compound assignments need
18620 temporary variables.
18622 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18624 * flowanalysis.cs: Reduce memory allocation in a few ways:
18625 - A block with no variables should not allocate a bit
18627 - A method with no out parameters does not need any tracking
18628 for assignment of the parameters, so we need not allocate
18631 public readonly Type[] VariableTypes;
18632 public readonly string[] VariableNames;
18633 Are redundant. The data is already stored in the variable
18634 map, so we need not allocate another array for it.
18635 - We need to add alot of checks for if (params | locals) == null
18636 due to the first two changes.
18638 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18640 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18641 implement IMemoryLocation, we store a copy on a local variable and
18642 take the address of it. Patch from Benjamin Jemlich
18644 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18645 to use a special "type_name_expression" rule which reduces the
18646 number of "QualifiedIdentifier" classes created, and instead
18647 directly creates MemberAccess expressions.
18649 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18651 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18652 that fixes #52853. Null literal assignment to ValueType
18654 * class.cs (MethodData.Emit): Instead of checking the name of the
18655 method to determine if its a destructor, create a new derived
18656 class from Method called Destructor, and test for that.
18658 * cs-parser.jay: Create a Destructor object instead of a Method.
18660 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18664 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18666 * expression.cs (Binary.ResolveOperator): Perform an implicit
18667 conversion from MethodGroups to their delegate types on the
18668 Addition operation.
18670 * delegate.cs: Introduce a new class DelegateCreation that is the
18671 base class for `NewDelegate' and `ImplicitDelegateCreation',
18672 factor some code in here.
18674 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18675 conversion from MethodGroups to compatible delegate types.
18677 * ecore.cs (Expression.Resolve): Do not flag error 654
18678 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18679 we allow conversions from MethodGroups to delegate types now.
18681 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18682 assignments in v2 either.
18684 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18686 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18687 static read-only fields in ctors.
18689 Applied patch from Benjamin Jemlich
18691 * expression.cs (UnaryMutator): Avoid leaking local variables.
18693 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18695 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18696 here to return true, as they can be used like this:
18698 (XXX) int.MEMBER ()
18700 Fixed 49836 and all the other dups
18702 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18704 * driver.cs: Implement /win32res and /win32icon.
18706 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18708 * cs-parser.jay: Add a rule to improve error handling for the
18709 common mistake of placing modifiers after the type.
18711 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18713 * cs-parser.jay (interface_event_declaration): Catch
18714 initialization of events on interfaces, and report cs0068
18716 * cs-parser.jay (interface_event_declaration): Catch
18717 initialization of events.
18719 * ecore.cs: Better report missing constructors.
18721 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18722 the error reporting done in the wrong place. Fix.
18724 * expression.cs (Binary.ResolveOperator): Catch the
18725 operator + (E x, E y) error earlier, and later allow for implicit
18726 conversions in operator +/- (E e, U x) from U to the underlying
18729 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18730 52596, if the container class is abstract, the default constructor
18731 is protected otherwise its public (before, we were always public).
18733 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18736 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18737 Jemlich that fixes bug #52597, MCS was generating invalid code for
18738 idisposable structs. Thanks to Ben for following up with this
18741 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18743 * driver.cs: Allow assemblies without code to be generated, fixes
18746 2004-01-07 Nick Drochak <ndrochak@gol.com>
18748 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18750 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18752 * cs-parser.jay: Add rules to improve error reporting if fields or
18753 methods are declared at the namespace level (error 116)
18755 * Add rules to catch event add/remove
18757 2004-01-04 David Sheldon <dave-mono@earth.li>
18759 * expression.cs: Added matching ")" to error message for
18762 2004-01-03 Todd Berman <tberman@gentoo.org>
18764 * ecore.cs, attribute.cs:
18765 Applying fix from #52429.
18767 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18769 * ecore.cs, expression.cs, statement.cs:
18770 Total rewrite of how we handle branching. We
18771 now handle complex boolean expressions with fewer
18772 jumps. As well if (x == 0) no longer emits a ceq.
18774 if (x is Foo) is much faster now, because we generate
18777 Overall, we get a pretty big improvement on our benchmark
18778 tests. The code we generate is smaller and more readable.
18780 I did a full two-stage bootstrap. The patch was reviewed
18781 by Martin and Miguel.
18783 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18785 * cs-parser.jay: Make primary_expression not take a QI.
18786 we dont need this because the member_access rule covers
18787 us here. So we replace the rule with just IDENTIFIER.
18789 This has two good effects. First, we remove a s/r conflict.
18790 Second, we allocate many fewer QualifiedIdentifier objects.
18792 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18794 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18795 set the correct information via SRE. This prevents
18796 hanging on the MS runtime. Fixes #29374.
18798 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18800 * convert.cs: correctly handle conversions to value types
18801 from Enum and ValueType as unboxing conversions.
18803 Fixes bug #52569. Patch by Benjamin Jemlich.
18805 2004-01-02 Ravi Pratap <ravi@ximian.com>
18807 * expression.cs (BetterConversion): Prefer int -> uint
18808 over int -> ulong (csc's behaviour). This fixed bug #52046.
18810 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18812 * decl.cs (MemberCache.FindMembers): now returns a
18815 * typemanager.cs: In general, go with with ^^.
18816 (CopyNewMethods): take an IList.
18817 (RealMemberLookup): Only allocate an arraylist
18818 if we copy from two sets of methods.
18820 This change basically does two things:
18821 1) Fewer array lists allocated due to CopyNewMethods.
18822 2) the explicit cast in MemberList costed ALOT.
18824 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18826 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18827 a hashtable to avoid needless string allocations when an identifier is
18828 used more than once (the common case).
18830 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18832 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18833 is broken, it will not return anything. So, we
18834 have to use the information we have in mcs to
18837 * typemanager.cs: Add a cache for GetInterfaces,
18838 since this will now be used more often (due to ^^)
18840 (GetExplicitInterfaces) New method that gets the
18841 declared, not effective, interfaces on a type
18842 builder (eg, if you have interface IFoo, interface
18843 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18846 This patch makes MCS able to bootstrap itself on
18849 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18851 * expression.cs: Remove the Nop's that Miguel put
18854 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18856 * report.cs, codegen.cs: Give the real stack trace to
18857 the error when an exception is thrown.
18859 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18861 * decl.cs: only allocate hashtables for ifaces if
18864 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18866 * expression.cs: fix the error from cs0121-2.cs
18867 (a parent interface has two child interfaces that
18868 have a function with the same name and 0 params
18869 and the function is called through the parent).
18871 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18873 * class.cs, rootcontext.cs, typmanager.cs: do not
18876 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18878 * codegen.cs: remove stack for the ec flow branching.
18879 It is already a linked list, so no need.
18881 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18883 * Makefile: Allow custom profiler here.
18885 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18887 * typemanager.cs (LookupType):
18888 - Use a static char [], because split takes
18889 a param array for args, so it was allocating
18891 - Do not store true in a hashtable, it boxes.
18893 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18895 * flowanalysis.cs: bytify common enums.
18897 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18899 * modifiers.cs: Add a new set of flags for the
18900 flags allowed on explicit interface impls.
18901 * cs-parser.jay: catch the use of modifiers in
18902 interfaces correctly.
18903 * class.cs: catch private void IFoo.Blah ().
18905 All related to bug #50572.
18907 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18909 * decl.cs: Rewrite the consistant accessability checking.
18910 Accessability is not linear, it must be implemented in
18911 a tableish way. Fixes #49704.
18913 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18915 * expression.cs: Handle negation in a checked context.
18916 We must use subtraction from zero. Fixes #38674.
18918 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18920 * class.cs: Ignore static void main in DLLs.
18921 * rootcontext.cs: Handle the target type here,
18922 since we are have to access it from class.cs
18923 * driver.cs: account for the above.
18925 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18927 * report.cs: Give line numbers and files if available.
18929 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18931 * driver.cs: Implement /addmodule.
18933 * typemanager.cs: Change 'modules' field so it now contains Modules not
18936 2003-12-20 Martin Baulig <martin@ximian.com>
18938 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18939 (FieldBase.IsAssigned): Removed this field.
18940 (FieldBase.SetAssigned): New public method.
18941 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18943 2003-12-20 Martin Baulig <martin@ximian.com>
18945 * expression.cs (LocalVariableReference.DoResolve): Don't set
18946 `vi.Used' if we're called from DoResolveLValue().
18948 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18949 returns the usage vector it just merged into the current one -
18950 pass this one to UsageWarning().
18951 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18952 of the `EmitContext', don't call this recursively on our children.
18954 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18956 * driver.cs: Implement /target:module.
18958 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18960 * support.cs (CharArrayHashtable): New helper class.
18962 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18963 char arrays, not strings, so we can avoid creating a string in
18964 consume_identifier if the identifier is a keyword.
18966 2003-12-16 Martin Baulig <martin@ximian.com>
18968 * statement.cs (LocalInfo.Assigned): Removed this property.
18969 (LocalInfo.Flags): Removed `Assigned'.
18970 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18971 and uses flow analysis.
18972 (Block.UsageWarning): Made this method private.
18973 (Block.Resolve): Call UsageWarning() if appropriate.
18975 * expression.cs (LocalVariableReference.DoResolve): Always set
18976 LocalInfo.Used here.
18978 2003-12-13 Martin Baulig <martin@ximian.com>
18980 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18981 any value here; we're now using flow analysis to figure out
18982 whether a statement/block returns a value.
18984 2003-12-13 Martin Baulig <martin@ximian.com>
18986 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18988 (FlowBranching.MergeFinally): Don't call
18989 `branching.CheckOutParameters()' here, this is called in
18991 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18992 when adding the `finally' vector.
18994 2003-12-13 Martin Baulig <martin@ximian.com>
18997 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18998 actually work and also fix #48962.
19000 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
19002 * decl.cs: Do not check System.Object for nested types,
19003 since we know it does not have any. Big bang for buck:
19006 Run 1: 8.35 seconds
19007 Run 2: 8.32 seconds
19008 corlib: 17.99 seconds
19010 Run 1: 8.17 seconds
19011 Run 2: 8.17 seconds
19012 corlib: 17.39 seconds
19014 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
19016 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19017 time we are returning 0 members, so we save alot here.
19019 2003-12-11 Martin Baulig <martin@ximian.com>
19021 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19022 `MergeChild()', also just take the `FlowBranching' as argument;
19023 call Merge() on it and return the result.
19024 (FlowBranching.Merge): We don't need to do anything if we just
19027 2003-12-11 Martin Baulig <martin@ximian.com>
19029 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19030 them in an `ArrayList' to reduce memory usage. Thanks to Ben
19031 Maurer for this idea.
19033 2003-12-11 Martin Baulig <martin@ximian.com>
19035 * flowanalysis.cs (MergeResult): This class is now gone; we now
19036 use the `UsageVector' for this. The reason for this is that if a
19037 branching just has one sibling, we don't need to "merge" them at
19038 all - that's the next step to do.
19039 (FlowBranching.Merge): We now return a `UsageVector' instead of a
19042 2003-12-11 Martin Baulig <martin@ximian.com>
19044 Reworked flow analyis and made it more precise and bug-free. The
19045 most important change is that we're now using a special `Reachability'
19046 class instead of having "magic" meanings of `FlowReturns'. I'll
19047 do some more cleanups and optimizations and also add some more
19048 documentation this week.
19050 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19051 largely reworked this class.
19052 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19053 the new `Reachability' class instead of having "magic" values here.
19054 (FlowBranching): We're now using an instance of `Reachability'
19055 instead of having separate `Returns', `Breaks' etc. fields.
19057 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19058 based on flow analysis; ignore the return value of block.Emit ().
19060 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
19062 * driver.cs typemanager.cs: Find the mono extensions to corlib even
19063 if they are private.
19065 2003-12-09 Martin Baulig <martin@ximian.com>
19067 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19068 call them directly on the UsageVector.
19070 2003-12-09 Martin Baulig <martin@ximian.com>
19072 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19073 Changed return type from `FlowReturns' to `Reachability'.
19075 2003-12-09 Martin Baulig <martin@ximian.com>
19077 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19078 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19079 `Reachable' fields with a single `Reachability' one.
19081 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19083 * class.cs (FindMembers): Remove foreach's.
19088 Run 1: 8.74 seconds
19089 Run 2: 8.71 seconds
19092 Run 1: 8.64 seconds
19093 Run 2: 8.58 seconds
19096 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19101 This patch does a few things:
19102 1. EmptyStatement is now a singleton, so it is never reallocated.
19103 2. All blah is EmptyStatement constructs have been changed to
19104 blah == EmptyStatement.Value, which is much faster and valid
19105 now that EmptyStatement is a singleton.
19106 3. When resolving a block, rather than allocating a new array for
19107 the non-empty statements, empty statements are replaced with
19108 EmptyStatement.Value
19109 4. Some recursive functions have been made non-recursive.
19110 Mainly the performance impact is from (3), however (1) and (2) are needed for
19111 this to work. (4) does not make a big difference in normal situations, however
19112 it makes the profile look saner.
19117 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19118 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19119 Total memory allocated: 56397 KB
19122 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19123 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19124 Total memory allocated: 55666 KB
19126 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19128 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19129 than the hashtable in a hashtable version
19131 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19132 we always end up concating a string. This results in a huge perf
19133 loss, because many strings have to be tracked by the GC. In this
19134 patch, we first use a hashtable that works with two keys, so that
19135 the strings do not need to be concat'ed.
19139 Run 1: 8.74 seconds
19140 Run 2: 8.71 seconds
19143 Run 1: 8.65 seconds
19144 Run 2: 8.56 seconds
19146 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19148 * Makefile: Add a new target `do-time' that does a quick and simple
19149 profile, leaving easy to parse output.
19151 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
19153 * codegen.cs (Init): Create the dynamic assembly with
19154 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19156 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
19158 * support.cs: Make the PtrHashtable use only one
19159 instance of its comparer.
19161 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
19163 * typemanager.cs: Fix lookup of GetNamespaces.
19165 2003-11-29 Miguel de Icaza <miguel@ximian.com>
19167 * expression.cs: Removed redundant line.
19169 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19170 ArrayLists, use for loops with bounds.
19172 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19175 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19176 arraylists, use for loop with bounds.
19178 The above three changes give us a 0.071 second performance
19179 improvement out of 3.294 seconds down to 3.223. On my machine
19180 the above changes reduced the memory usage by 1,387 KB during
19181 compiler bootstrap.
19183 * cs-parser.jay (QualifiedIdentifier): New class used to represent
19184 QualifiedIdentifiers. Before we created a new string through
19185 concatenation, and mostly later on, the result would be
19186 manipulated by DecomposeQI through string manipulation.
19188 This reduced the compiler memory usage for bootstrapping from
19189 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19190 compile times in 0.05 seconds.
19192 2003-11-28 Dick Porter <dick@ximian.com>
19194 * support.cs: Do string compares with the Invariant culture.
19202 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19203 the comparison is done with the Invariant culture.
19205 2003-11-27 Miguel de Icaza <miguel@ximian.com>
19207 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19208 GetEnumerator method.
19210 (ProbeCollectionType): Iterate starting at the most specific type
19211 upwards looking for a GetEnumerator
19213 * expression.cs: Shift count can be up to 31 for int/uint and 63
19216 2003-11-26 Miguel de Icaza <miguel@ximian.com>
19218 * statement.cs (Block.LookupLabel): Also look for the label on the
19219 children blocks. Use a hash table to keep track of visited
19222 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19223 we actually did transform the other operand, otherwise fall back
19224 to the common codepath that casts to long.
19226 * cs-tokenizer.cs: Use the same code pattern as the int case.
19227 Maybe I should do the parsing myself, and avoid depending on the
19228 Parse routines to get this done.
19230 2003-11-25 Miguel de Icaza <miguel@ximian.com>
19232 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19233 which fixes bug 51347. This time test it.
19235 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19236 attributes for example can not tell the difference between these.
19237 The difference was only a syntax feature of the language.
19239 * attribute.cs: Apply attributes to delegates.
19241 * delegate.cs: Call the apply attributes method.
19243 2003-11-24 Miguel de Icaza <miguel@ximian.com>
19245 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19246 comparing 0 vs Byte.MinValue, not the value
19248 (ImplicitConversionRequired): When reporting a conversion error,
19249 use error 31 to print out the constant error instead of the
19252 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19253 which fixes bug 51347.
19255 2003-11-22 Miguel de Icaza <miguel@ximian.com>
19257 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
19258 which fixes the -warnaserror command line option.
19260 2003-11-21 Miguel de Icaza <miguel@ximian.com>
19262 * cfold.cs (DoNumericPromotions): During constant folding of
19263 additions on UIntConstant, special case intconstants with
19264 IntConstants like we do on the expression binary operator.
19266 2003-11-12 Miguel de Icaza <miguel@ximian.com>
19268 * convert.cs (ImplicitReferenceConversion): We were missing a case
19269 (System.Enum are not value types or class types, so we need to
19270 classify them separatedly).
19272 * driver.cs: We do not support error 2007.
19274 2003-11-12 Jackson Harper <jackson@ximian.com>
19276 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19277 system directory. Also use the full file name so users can
19278 libraries names mscorlib-o-tron.dll in a non system dir.
19280 2003-11-10 Martin Baulig <martin@ximian.com>
19282 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19283 (TypeManager.InitCoreTypes): Initialize them here, but instead of
19284 calling `ResolveType()' on them, directly assign their `Type'.
19286 2003-11-08 Martin Baulig <martin@ximian.com>
19288 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19289 return value and the `out parent' parameter.
19290 (TypeContainer.DefineType): Moved the CS0644 check into
19291 GetClassBases(). Don't pass the interface types to the
19292 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19293 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19295 * ecore.cs (TypeExpr.IsAttribute): New property.
19296 (TypeExpr.GetInterfaces): New method.
19298 * interface.cs (Interface.GetInterfaceTypeByName): Return a
19299 TypeExpr instead of a Type.
19300 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19301 (Interface.DefineType): Don't pass the interface types to the
19302 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19303 them later and then call `TypeBulider.AddInterfaceImplementation()'.
19305 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19306 instead of a `Type[]'.
19307 (TypeManager.RegisterBuilder): Likewise.
19308 (TypeManager.AddUserInterface): Likewise.
19309 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19310 `Type[]' and also return a `TypeExpr[]'.
19311 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19313 2003-11-08 Martin Baulig <martin@ximian.com>
19315 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19318 2003-11-08 Martin Baulig <martin@ximian.com>
19320 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19321 TypeManager.ResolveExpressionTypes().
19323 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19324 instead of an Expression.
19325 (TypeExpr): This is now an abstract base class for `TypeExpression'.
19326 (TypeExpression): New public class; formerly known as `TypeExpr'.
19328 * expression.cs (ComposedCast): Derive from TypeExpr.
19330 * typemanager.cs (TypeManager.system_*_expr): These are now
19331 TypExpr's instead of Expression's.
19332 (TypeManager.ResolveExpressionTypes): New public static function;
19333 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19336 2003-11-06 Miguel de Icaza <miguel@ximian.com>
19338 * expression.cs (New.DoResolve): Do not dereference value that
19339 might be a null return.
19341 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19342 sure that the constant value has the right type. Fixes an
19343 unreported bug, similar to 50425.
19345 * const.cs (Const.LookupConstantValue): Call
19346 ImplicitStandardConversionExists before doing a conversion to
19347 avoid havng the TypeManager.ChangeType do conversions.
19349 Reduced the number of casts used
19351 (Const.ChangeType): New routine to enable reuse of the constant
19352 type changing code from statement.
19354 * typemanager.cs (ChangeType): Move common initialization to
19355 static global variables.
19359 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19360 every value type to go through, even if it was void. Fix that.
19362 * cs-tokenizer.cs: Use is_identifier_start_character on the start
19363 character of the define, and the is_identifier_part_character for
19364 the rest of the string.
19366 2003-11-05 Miguel de Icaza <miguel@ximian.com>
19368 * expression.cs (UnaryMutator.EmitCode): When I updated
19369 LocalVariableReference.DoResolve, I overdid it, and dropped an
19370 optimization done on local variable references.
19372 2003-11-04 Miguel de Icaza <miguel@ximian.com>
19374 * ecore.cs: Convert the return from Ldlen into an int.
19376 2003-10-20 Miguel de Icaza <miguel@ximian.com>
19378 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19379 the accessibility, this is a special case for toplevel non-public
19380 classes (internal for instance).
19382 2003-10-20 Nick Drochak <ndrochak@gol.com>
19384 * ecore.cs: Fix typo and build. Needed another right paren.
19386 2003-10-19 Miguel de Icaza <miguel@ximian.com>
19388 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
19389 `internal' case regular and protected, but not allowing protected
19390 to be evaluated later. Bug 49840
19392 2003-10-15 Miguel de Icaza <miguel@ximian.com>
19394 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19395 to kb.Nlast, and not the kb.nFirst to isolate the switch
19398 Extract the underlying type, so enumerations of long/ulong are
19399 treated like long/ulong.
19401 2003-10-14 Miguel de Icaza <miguel@ximian.com>
19403 * expression.cs (New): Overload the meaning of RequestedType to
19404 track the possible creation of the NewDelegate type, since
19405 DoResolve is invoked more than once for new constructors on field
19408 See bugs: #48800 and #37014
19410 * cs-parser.jay (declare_local_constants): Take an arraylist
19411 instead of a single constant.
19413 (local_constant_declaration): It should take a
19414 constant_declarators, not a constant_declarator. Fixes 49487
19416 * convert.cs: Fix error report.
19418 2003-10-13 Jackson Harper <jackson@ximian.com>
19420 * typemanager.cs (TypeToCoreType): Add float and double this fixes
19423 2003-10-09 Martin Baulig <martin@ximian.com>
19425 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19427 (MethodCore.DoDefineParameters): Removed the TypeContainer
19428 argument; use the DeclSpace which was passed to the .ctor instead.
19429 (MethodCore.CheckParameter): Take a DeclSpace instead of a
19430 TypeContainer; we only need a DeclSpace here.
19432 2003-10-09 Martin Baulig <martin@ximian.com>
19434 * class.cs (MethodData): Added additional `DeclSpace ds' argument
19436 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19437 EmitContext's .ctor.
19439 2003-10-09 Martin Baulig <martin@ximian.com>
19441 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19442 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19443 AsAccessible(), moved them as well.
19445 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19447 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19449 * cs-parser.jay : Renamed yyName to yyNames related to jay.
19451 2003-10-07 Miguel de Icaza <miguel@ximian.com>
19453 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19454 generation for >=, as spotted by Paolo, bug 48679.
19455 Patch from David Waite.
19457 * cs-tokenizer.cs: Add handling for #pragma.
19459 * cs-parser.jay: Allow for both yield and yield return in the
19460 syntax. The anti-cobolization of C# fight will go on!
19462 * class.cs (TypeBuilder.DefineType): Catch error condition here
19463 (Parent.DefineType erroring out and returning null).
19465 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19466 coping with enumerations variables, we were mistakenly processing
19467 them as a regular value type instead of built-in types. Fixes the
19470 * typemanager.cs (IsBuiltinOrEnum): New method.
19472 2003-09-30 Miguel de Icaza <miguel@ximian.com>
19474 * cs-parser.jay: Upgrade: yield now needs the return clause.
19476 2003-09-19 Martin Baulig <martin@ximian.com>
19478 * decl.cs (MemberCache.SetupCacheForInterface): Take a
19479 `MemberCache parent' argument. Normally, an interface doesn't
19480 have a parent type except System.Object, but we use this in gmcs
19481 for generic type parameters.
19483 2003-09-18 Martin Baulig <martin@ximian.com>
19485 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19486 on `type.IsInterface'; don't check whether the type has a parent
19487 to determine whether it's an interface.
19489 2003-09-15 Martin Baulig <martin@ximian.com>
19491 * class.cs (TypeContainer.DefineType): Added an error flag to
19492 avoid reporting duplicate CS0146's ("class definition is
19495 * driver.cs (Driver.MainDriver): Abort if
19496 RootContext.ResolveTree() reported any errors.
19498 2003-09-07 Martin Baulig <martin@ximian.com>
19500 * report.cs (Error, Warning): Added overloaded versions which take
19501 a `params object[] args' and call String.Format().
19503 2003-09-07 Martin Baulig <martin@ximian.com>
19505 * decl.cs (DeclSpace..ctor): Don't call
19506 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19507 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
19508 (DeclSpace.RecordDecl): New method.
19510 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19512 2003-09-02 Ravi Pratap <ravi@ximian.com>
19514 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19515 value attributes to be applied to ParameterBuilders.
19517 * class.cs (MethodCore.LabelParameters): Make static and more
19518 generic so that it can be used from other places - like interface
19519 methods, for instance.
19521 * interface.cs (Interface.Emit): Call LabelParameters before
19522 emitting attributes on the InterfaceMethod.
19524 2003-08-26 Martin Baulig <martin@ximian.com>
19526 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19527 resolving aliases; fixes #47927.
19529 2003-08-26 Martin Baulig <martin@ximian.com>
19531 * statement.cs (Using.DoResolve): This is internally emitting a
19532 try/finally clause, so we need to set ec.NeedExplicitReturn if we
19533 do not always return. Fixes #47681.
19535 2003-08-26 Martin Baulig <martin@ximian.com>
19537 * decl.cs (MemberCore): Moved WarningNotHiding(),
19538 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19540 (AdditionResult): Make this nested in DeclSpace.
19541 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19542 argument; call NamespaceEntry.Define() unless we're nested in a
19545 * namespace.cs (Namespace.DefineName): New public function. This
19546 is called from DeclSpace's .ctor to add
19547 (Namespace.Lookup): Include DeclSpaces in the lookup.
19549 * class.cs (Operator): Derive from MemberBase, not MemberCore.
19551 * const.cs (Const): Derive from MemberBase, not MemberCore.
19553 2003-08-25 Martin Baulig <martin@ximian.com>
19555 * convert.cs (Convert.ExplicitReferenceConversion): When
19556 converting from an interface type to a class, unbox if the target
19557 type is a struct type. Fixes #47822.
19559 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19561 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19564 2003-08-22 Martin Baulig <martin@ximian.com>
19566 * class.cs (TypeManager.DefineType): When defining a nested type,
19567 call DefineType() on our parent; fixes #47801.
19569 2003-08-22 Martin Baulig <martin@ximian.com>
19571 * class.cs (MethodData.Define): While checking if a method is an
19572 interface implementation, improve the test a bit more to fix #47654.
19574 2003-08-22 Martin Baulig <martin@ximian.com>
19576 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19577 correctly; fixes #47722.
19579 2003-08-22 Martin Baulig <martin@ximian.com>
19581 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19582 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19584 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19586 2003-08-22 Martin Baulig <martin@ximian.com>
19588 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19589 can only be assigned in static constructors. Fixes #47161.
19591 2003-08-22 Martin Baulig <martin@ximian.com>
19593 Rewrote and improved the flow analysis code.
19595 * flowbranching.cs (FlowBranching): Make this class abstract.
19596 (FlowBranching.CreateBranching): New static function to create a
19597 new flow branching.
19598 (FlowBranchingBlock, FlowBranchingException): New classes.
19599 (FlowBranching.UsageVector.Type): New public readonly field.
19600 (FlowBranching.UsageVector.Breaks): Removed the setter.
19601 (FlowBranching.UsageVector.Returns): Removed the setter.
19602 (FlowBranching.UsageVector): Added Break(), Return(),
19603 NeverReachable() and Throw() methods to modify the reachability.
19604 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19605 done by FlowBranching.Merge().
19606 (FlowBranching.UsageVector.MergeChild): New method; merges the
19607 merge result into the current vector.
19608 (FlowBranching.Merge): New abstract method to merge a branching.
19610 2003-08-12 Martin Baulig <martin@ximian.com>
19612 * expression.cs (Indirection.CacheTemporaries): Create the
19613 LocalTemporary with the pointer type, not its element type.
19615 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19617 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19618 token was a keyword or not.
19620 Add `error' options where an IDENTIFIER was expected; Provide
19621 CheckToken and CheckIdentifierToken convenience error reporting
19624 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19626 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19627 NameSpaceEntry NameSpaceEntry.
19629 (LookupInterfaceOrClass): Avoid creating a full qualified name
19630 from namespace and name: avoid doing lookups when we know the
19631 namespace is non-existant. Use new Tree.LookupByNamespace which
19632 looks up DeclSpaces based on their namespace, name pair.
19634 * driver.cs: Provide a new `parser verbose' to display the
19635 exception thrown during parsing. This is turned off by default
19636 now, so the output of a failure from mcs is more graceful.
19638 * namespace.cs: Track all the namespaces defined in a hashtable
19641 (IsNamespace): New method
19643 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19645 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19646 we know that we need to concatenate (full typename can never be
19651 * statement.cs: Use a bitfield; Do not initialize to null things
19652 which are done by the constructor by default.
19654 * cs-parser.jay: bug fix, parameter was 4, not 3.
19656 * expression.cs: Just use the property;
19658 * statement.cs: No need for GetVariableInfo method.
19660 2003-08-08 Martin Baulig <martin@ximian.com>
19662 * flowanalysis.cs (FlowReturns): This is now nested in the
19663 `FlowBranching' class.
19664 (MyBitVector): Moved this here from statement.cs.
19665 (FlowBranching.SiblingType): New enum type.
19666 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19668 2003-08-07 Martin Baulig <martin@ximian.com>
19670 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19671 `FlowBranching' class and called `BranchingType'.
19673 2003-08-07 Martin Baulig <martin@ximian.com>
19675 * flowanalysis.cs: Moved all the control flow analysis code into
19678 2003-08-07 Martin Baulig <martin@ximian.com>
19680 * assign.cs (Assign.DoResolve): `target' must either be an
19681 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19684 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19686 * expression.cs (BinaryMethod): This kind of expression is created by the
19687 Binary class if it determines that the operator has to be handled
19690 (BinaryDelegate): This kind of expression is created if we are
19691 dealing with a + or - operator on delegates.
19693 (Binary): remove method, argumetns, and DelegateOperator: when
19694 dealing with methods,
19696 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19698 * statement.cs (Block): use bitfields for the three extra booleans
19699 we had in use. Remove unused topblock parameter.
19701 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19703 * assign.cs: Drop extra unneeded tests.
19705 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19707 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19709 * statement.cs (Foreach): Use VariableStorage instead of
19712 * codegen.cs (VariableStorage): New class used by clients that
19713 require a variable stored: locals or fields for variables that
19714 need to live across yield.
19716 Maybe provide a convenience api for EmitThis+EmitLoad?
19718 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19721 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19723 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19724 RemapParameterLValue): New methods that are used to turn a
19725 precomputed FieldInfo into an expression like this:
19729 The idea is to use this instead of making LocalVariableReference
19730 have more than one meaning.
19732 * cs-parser.jay: Add error production to BASE.
19734 * ecore.cs: Deal with TypeManager.GetField returning null, which
19735 is now a valid return value.
19737 (FieldExprNoAddress): New expression for Fields whose address can
19740 * expression.cs (LocalVariableReference): During the resolve
19741 phases, create new expressions if we are in a remapping context.
19742 Remove code that dealt with remapping here.
19744 (ParameterReference): same.
19746 (ProxyInstance): New expression, like the `This' expression, but
19747 it is born fully resolved. We know what we are doing, so remove
19748 the errors that are targeted to user-provided uses of `this'.
19750 * statement.cs (Foreach): our variable is now stored as an
19751 Expression; During resolution, follow the protocol, dont just
19752 assume it will return this.
19754 2003-08-06 Martin Baulig <martin@ximian.com>
19756 * support.cs (SeekableStreamReader.cs): New public class.
19758 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19759 SeekableStreamReader instead of the normal StreamReader.
19761 2003-08-04 Martin Baulig <martin@ximian.com>
19763 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19764 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19765 deambiguate casts and delegate invocations.
19766 (parenthesized_expression): Use the new tokens to ensure this is
19767 not a cast of method invocation.
19769 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19770 when reading a `)' and Deambiguate_CloseParens () was previously
19773 * expression.cs (ParenthesizedExpression): New class. This is
19774 just used for the CS0075 test.
19775 (Binary.DoResolve): Check for CS0075.
19777 2003-07-29 Ravi Pratap <ravi@ximian.com>
19779 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19780 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19781 reference comparison.
19783 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19784 examine the ReturnType for equality - this is necessary in the
19785 cases of implicit and explicit operators whose signature also
19786 includes the return type.
19788 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19790 * namespace.cs: Cache the result of the namespace computation,
19791 instead of computing it every time.
19793 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19795 * decl.cs: Use a global arraylist that we reuse over invocations
19796 to avoid excesive memory consumption. Reduces memory usage on an
19797 mcs compile by one meg (45 average).
19799 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19800 private, work around that.
19802 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19804 * literal.cs (IntLiteral): Define Zero and One static literals.
19806 * cs-parser.jay (integer_literal): use static literals to reduce
19807 memory usage for the most used literals (0, 1 and -1). 211kb
19808 reduced in memory usage.
19810 Replace all calls to `new ArrayList' with `new
19811 ArrayList(4)' which is a good average number for most allocations,
19812 and also requires only 16 bytes of memory for its buffer by
19815 This reduced MCS memory usage in seven megabytes for the RSS after
19818 2003-07-28 Ravi Pratap <ravi@ximian.com>
19820 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19821 handle params methods the correct way by forming only one
19822 applicable set with params and normal methods in them. Earlier we
19823 were looking at params methods only if we found no normal methods
19824 which was not the correct thing to do.
19826 (Invocation.BetterFunction): Take separate arguments indicating
19827 when candidate and the best method are params methods in their
19830 This fixes bugs #43367 and #46199.
19832 * attribute.cs: Documentation updates.
19834 (CheckAttribute): Rename to CheckAttributeTarget.
19835 (GetValidPlaces): Rename to GetValidTargets.
19837 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19838 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19842 2003-07-28 Martin Baulig <martin@ximian.com>
19844 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19845 name when looking up the base class of a nested class. Fixes #46977.
19847 2003-07-26 Martin Baulig <martin@ximian.com>
19849 * expression.cs (Indexers.Indexer): New nested struct; contains
19850 getter, setter and the indexer's type.
19851 (Indexers.Properties): This is now an ArrayList of
19852 Indexers.Indexer's.
19853 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19854 indexer doesn't have any getters.
19856 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19857 for embedded property and indexer assignments.
19859 2003-07-26 Martin Baulig <martin@ximian.com>
19861 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19862 preprocessor directive is not the first non-whitespace character
19865 2003-07-26 Martin Baulig <martin@ximian.com>
19867 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19868 namespace parsing, follow the spec more closely.
19870 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19871 NamespaceEntry.Lookup().
19873 2003-07-25 Martin Baulig <martin@ximian.com>
19875 * MethodCore.cs (OverridesSomething): New public field; it's set
19876 from TypeContainer.DefineMembers if this method overrides
19877 something (which doesn't need to be a method). Fix #39462.
19879 2003-07-25 Ravi Pratap <ravi@ximian.com>
19881 * typemanager.cs (GetMembers): Ensure that the list of members is
19882 reversed. This keeps things in sync.
19884 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19885 find an AttributeUsage attribute.
19887 * expression.cs (Invocation.OverloadResolve): Perform the check
19888 which disallows Invoke to be directly called on a Delegate.
19890 (Error_InvokeOnDelegate): Report error cs1533.
19892 2003-07-25 Martin Baulig <martin@ximian.com>
19894 * expression.cs (Indexers.GetIndexersForType): Only look in the
19895 interface hierarchy if the requested type is already an
19896 interface. Fixes #46788 while keeping #46502 fixed.
19898 2003-07-25 Martin Baulig <martin@ximian.com>
19900 * class.cs (TypeContainer.DefineMembers): Check whether all
19901 readonly fields have been assigned and report warning CS0649 if
19904 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19907 2003-07-24 Ravi Pratap <ravi@ximian.com>
19909 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19910 returned from GetMethods to make things consistent with the
19911 assumptions MCS makes about ordering of methods.
19913 This should comprehensively fix bug #45127 and it does :-)
19915 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19916 ordering is actually reverse.
19918 * Clean up some debug messages I left lying around.
19920 * interface.cs (Populate*): Get rid of code which emits attributes
19921 since the stage in which we emit attributes is the 'Emit' stage,
19922 not the define stage.
19924 (Emit): Move attribute emission for interface members here.
19926 2003-07-22 Ravi Pratap <ravi@ximian.com>
19928 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19929 closely: we eliminate methods in base types when we have an
19930 applicable method in a top-level type.
19932 Please see section 14.5.5.1 for an exact description of what goes
19935 This fixes bug #45127 and a host of other related to corlib compilation.
19937 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19938 array is the method corresponding to the top-level type (this is
19939 because of the changes made to icall.c) so we change this
19942 (MethodGroupExpr.Name): This too.
19944 * typemanager.cs (GetElementType): New method which does the right
19945 thing when compiling corlib.
19947 * everywhere: Make use of the above in the relevant places.
19949 2003-07-22 Martin Baulig <martin@ximian.com>
19951 * cs-parser.jay (invocation_expression): Moved
19952 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19953 `cast_expression', but create a InvocationOrCast which later
19954 resolves to either an Invocation or a Cast.
19956 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19957 method; call this before EmitStatement() to make sure that this
19958 expression can be used as a statement.
19960 * expression.cs (InvocationOrCast): New class; resolves to either
19961 an Invocation or a Cast.
19963 * statement.cs (StatementExpression): Call ResolveStatement() on
19964 the ExpressionStatement before emitting it.
19966 2003-07-21 Martin Baulig <martin@ximian.com>
19968 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19969 `ref' and `out' attributes match; fixes #46220.
19970 (MemberAccess.ResolveMemberAccess): You can't reference a type
19971 through an expression; fixes #33180.
19972 (Indexers.GetIndexersForType): Don't return the indexers from
19973 interfaces the class implements; fixes #46502.
19975 2003-07-21 Martin Baulig <martin@ximian.com>
19977 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19978 CS0661 checks; fixes bug #30442.
19980 2003-07-21 Martin Baulig <martin@ximian.com>
19982 * decl.cs (AdditionResult): Added `Error'.
19984 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19986 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19987 makes cs0031.cs actually work.
19989 2003-07-20 Martin Baulig <martin@ximian.com>
19991 * namespace.cs: Fixed that bug which caused a crash when compiling
19992 the debugger's GUI.
19994 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19996 * typemanager.cs (LookupTypeReflection): Never expose types which
19997 are NotPublic, NestedPrivate, NestedAssembly, or
19998 NestedFamANDAssem. We used to return these, and later do a check
19999 that would report a meaningful error, but the problem is that we
20000 would not get the real match, if there was a name override.
20002 2003-07-18 Miguel de Icaza <miguel@ximian.com>
20004 * namespace.cs (Namespace, Name): Do not compute the namespace
20005 name dynamically, compute it in the constructor. This reduced
20006 memory usage by 1697 KB.
20008 * driver.cs: Use --pause to pause at the end.
20010 2003-07-17 Peter Williams <peter@newton.cx>
20012 * Makefile: Change the name of the test target so that it doesn't
20013 conflict with the recursive test target.
20015 2003-07-17 Miguel de Icaza <miguel@ximian.com>
20017 * expression.cs (LocalVariableReference.Emit, EmitAssign,
20018 AddressOf): Do not use EmitThis, that was wrong, use the actual
20021 2003-07-15 Miguel de Icaza <miguel@ximian.com>
20023 * class.cs (MethodData.Define): While checking if a method is an
20024 interface implementation, improve the test: If we are not public
20025 (use new test here: use the computed MethodAttributes directly,
20026 instead of the parsed modifier flags) check if the `implementing'
20027 method comes from an interface or not.
20029 * pending.cs (VerifyPendingMethods): Slightly better error
20032 * makefile: add test target that does the mcs bootstrap.
20034 2003-07-16 Ravi Pratap <ravi@ximian.com>
20036 * interface.cs (Define): Do nothing here since there are no
20037 members to populate etc. Move the attribute emission out of here
20038 since this was just totally the wrong place to put it. Attribute
20039 application happens during the 'Emit' phase, not in the 'Define'
20042 (Emit): Add this method and move the attribute emission here
20044 * rootcontext.cs (EmitCode): Call the Emit method on interface
20047 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20049 * expression.cs (OverloadResolve): Report error only if Location
20050 is not 'Null' which means that there was a probe going on.
20052 2003-07-14 Martin Baulig <martin@ximian.com>
20054 * expression.cs (ConditionalLogicalOperator): New public class to
20055 implement user defined conditional logical operators.
20056 This is section 14.11.2 in the spec and bug #40505.
20058 2003-07-14 Martin Baulig <martin@ximian.com>
20060 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20062 2003-07-14 Martin Baulig <martin@ximian.com>
20064 * codegen.cs (EmitContext.InFixedInitializer): New public field.
20066 * ecore.cs (IVariable.VerifyFixed): New interface method.
20068 * expression.cs (Unary.ResolveOperator): When resolving the `&'
20069 operator, check whether the variable is actually fixed. Fixes bug
20070 #36055. Set a variable definitely assigned when taking its
20071 address as required by the spec.
20073 * statement.cs (LocalInfo.IsFixed): New field.
20074 (LocalInfo.MakePinned): Set `IsFixed' to true.
20076 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20078 * attribute.cs (Attribute.Resolve): While doing a Member lookup
20079 for .ctors, ensure that we only ask for members declared in the
20080 attribute type (BindingFlags.DeclaredOnly).
20084 * expression.cs (Error_WrongNumArguments): Report error 1501
20085 correctly the way CSC does.
20087 2003-07-13 Martin Baulig <martin@ximian.com>
20089 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20090 lookup on the fully qualified name, to make things like "X.X" work
20091 where "X.X" is a fully qualified type name, but we also have a
20092 namespace "X" in the using list. Fixes #41975.
20094 2003-07-13 Martin Baulig <martin@ximian.com>
20096 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20097 function. If we're a CompoundAssign, we need to create an embedded
20098 CompoundAssign, not an embedded Assign.
20099 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20102 2003-07-13 Martin Baulig <martin@ximian.com>
20104 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20105 work to fix bug #46088.
20107 2003-07-13 Ravi Pratap <ravi@ximian.com>
20109 * class.cs (Operator.Emit): Do not emit attributes here - it is
20110 taken care of by the Method class that we delegate too. This takes
20111 care of bug #45876.
20113 2003-07-10 Martin Baulig <martin@ximian.com>
20115 * expression.cs (TypeOfVoid): New class.
20116 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
20118 2003-07-10 Martin Baulig <martin@ximian.com>
20120 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20123 2003-07-10 Martin Baulig <martin@ximian.com>
20125 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20126 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20128 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20130 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20132 2003-07-10 Martin Baulig <martin@ximian.com>
20134 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20135 of decimal. Fixes #42850.
20137 NOTE: I also fixed the created byte blob, but this doesn't work on
20138 the MS runtime and csc never produces any byte blobs for decimal
20141 2003-07-10 Martin Baulig <martin@ximian.com>
20143 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20144 structs; fixes #32068.
20145 (Block.AddChildVariableNames): Fixed #44302.
20147 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20149 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20151 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20153 * attribute.cs: And this test is onger needed.
20155 2003-07-08 Martin Baulig <martin@ximian.com>
20157 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20158 inaccessible types. Fixes #36313.
20160 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20162 * namespace.cs (NamespaceEntry): Create implicit entries for all
20163 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20164 implicit entries for N1.N2 and N1.
20166 2003-07-08 Martin Baulig <martin@ximian.com>
20168 Rewrote the handling of namespaces to fix a lot of the issues
20169 wrt. `using' aliases etc.
20171 * namespace.cs (Namespace): Splitted this class into a
20172 per-assembly `Namespace' and a per-file `NamespaceEntry'.
20174 * typemanager.cs (TypeManager.IsNamespace): Removed.
20175 (TypeManager.ComputeNamespaces): Only compute namespaces from
20176 loaded assemblies here, not the namespaces from the assembly we're
20177 currently compiling.
20179 2003-07-08 Martin Baulig <martin@ximian.com>
20181 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20183 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20185 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20188 I thought about the memory savings here, but LookupTypeReflection
20189 is used under already very constrained scenarios. Compiling
20190 corlib or mcs only exposes one hit, so it would not really reduce
20191 any memory consumption.
20193 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20195 * typemanager.cs: fixes bug #45889 by only adding public types from
20196 other assemblies to the list of known types.
20198 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20200 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20201 on the type we resolved.
20203 2003-07-05 Martin Baulig <martin@ximian.com>
20205 * pending.cs (PendingImplementation.ParentImplements): Don't
20206 create the proxy if the parent is abstract.
20208 * class.cs (TypeContainer.DefineIndexers): Process explicit
20209 interface implementations first. Fixes #37714.
20211 2003-07-04 Miguel de Icaza <miguel@ximian.com>
20213 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20214 defined recursively; but since we modify the input parameters
20215 (left is set to `this' temporarily), we reset this value if the
20216 left_is_explicit is false, which gives the original semantics to
20219 * literal.cs (NullPointer): new class used to represent a null
20220 literal in a pointer context.
20222 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20223 type is a pointer, use a NullPointer object instead of a
20224 NullLiteral. Closes 43687
20226 (ExplicitConversion): Convert pointer values using
20227 the conv opcode to the proper type.
20229 * ecore.cs (New): change ValueTypeVariable property into a method,
20230 that returns whether the valuetype is suitable for being used.
20232 * expression.cs (Binary.DoNumericPromotions): Only return if we
20233 the int constant was a valid uint, and we can return both left and
20234 right as uints. If not, we continue processing, to trigger the
20235 type conversion. This fixes 39018.
20237 * statement.cs (Block.EmitMeta): During constant resolution, set
20238 the CurrentBlock property on the emitcontext, so that we resolve
20239 constants propertly.
20241 2003-07-02 Martin Baulig <martin@ximian.com>
20243 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20244 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20246 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20247 than emitting it here.
20249 * statement.cs: Fixed some more flow analysis bugs.
20251 2003-07-02 Martin Baulig <martin@ximian.com>
20253 * class.cs (MethodData.Define): When implementing interface
20254 methods, set Final unless we're Virtual.
20256 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20257 check work for interface methods.
20259 2003-07-01 Martin Baulig <martin@ximian.com>
20261 * ecore.cs (EmitContext.This): Replaced this property with a
20262 GetThis() method which takes a Location argument. This ensures
20263 that we get the correct error location for a CS0188.
20265 2003-07-01 Miguel de Icaza <miguel@ximian.com>
20267 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20268 ImplicitStandardConversion.
20270 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20272 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
20274 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20277 2003-06-30 Miguel de Icaza <miguel@ximian.com>
20279 * class.cs (Constructor.Define): Turn off initlocals for unsafe
20282 (MethodData.Define): Turn off initlocals for unsafe methods.
20284 2003-06-29 Miguel de Icaza <miguel@ximian.com>
20286 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20287 complete; Fixes #37521.
20289 * delegate.cs: Use Modifiers.TypeAttr to compute the
20290 TypeAttributes, instead of rolling our own. This makes the flags
20291 correct for the delegates.
20293 2003-06-28 Miguel de Icaza <miguel@ximian.com>
20295 * class.cs (Constructor.Define): Set the private flag for static
20296 constructors as well.
20298 * cs-parser.jay (statement_expression): Set the return value to
20299 null, to avoid a crash when we catch an error.
20301 2003-06-24 Miguel de Icaza <miguel@ximian.com>
20303 * cs-parser.jay: Applied patch from Jackson that adds support for
20304 extern and unsafe modifiers to destructor declarations.
20306 * expression.cs: Report error 21 if the user is trying to index a
20309 * driver.cs: Add an error message, suggested by the bug report.
20311 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20312 if we do not have a ": this ()" constructor initializer. Fixes 45149
20314 2003-06-14 Miguel de Icaza <miguel@ximian.com>
20316 * namespace.cs: Add some information to reduce FAQs.
20318 2003-06-13 Miguel de Icaza <miguel@ximian.com>
20320 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20321 underlying enumeration types. Fixes #43915.
20323 * expression.cs: Treat ushort/short as legal values to be used in
20324 bitwise operations.
20326 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20328 * delegate.cs: transfer custom attributes for paramenters from
20329 the delegate declaration to Invoke and BeginInvoke.
20331 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20333 * attribute.cs: handle custom marshalers and emit marshal info
20336 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
20338 * makefile.gnu: Added anonymous.cs to the compiler sources.
20340 2003-05-28 Miguel de Icaza <miguel@ximian.com>
20342 * iterators.cs: Change the name of the proxy class to include two
20345 * cs-parser.jay: Update grammar to include anonymous methods.
20347 * anonymous.cs: new file.
20349 2003-05-27 Miguel de Icaza <miguel@ximian.com>
20351 * class.cs (Field.Define): Add missing test for pointers and
20354 2003-05-27 Ravi Pratap <ravi@ximian.com>
20356 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20357 we use the stobj opcode.
20359 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20360 since it wasn't the correct fix.
20362 It still is puzzling that we are required to use stobj for IntPtr
20363 which seems to be a ValueType.
20365 2003-05-26 Miguel de Icaza <miguel@ximian.com>
20367 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20368 during regular simple name resolution. Now, the trick is that
20369 instead of returning for processing the simplename, we do a
20370 TypeManager.LookupType (ie, a rooted lookup as opposed to a
20371 contextual lookup type). If a match is found, return that, if
20372 not, return for further composition.
20374 This fixes long-standing 30485.
20376 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20377 using the address to initialize an object, do an Stobj instead of
20378 using the regular Stelem.
20380 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20381 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20382 Because if we are a BaseIndexerAccess that value will be true.
20385 * statement.cs (GotoCase.Resolve): Return after reporting an
20386 error, do not attempt to continue.
20388 * expression.cs (PointerArithmetic.Emit): If our operand is a
20389 long, convert our constants to match the operand before
20390 multiplying. Convert to I type before adding. Fixes 43670.
20392 2003-05-14 Ravi Pratap <ravi@ximian.com>
20394 * enum.cs (ImplicitConversionExists) : Rename to
20395 ImplicitEnumConversionExists to remove ambiguity.
20397 * ecore.cs (NullCast): New type of cast expression class which
20398 basically is very similar to EmptyCast with the difference being
20399 it still is a constant since it is used only to cast a null to
20401 (eg. (string) null)
20403 * convert.cs (ImplicitReferenceConversion): When casting a null
20404 literal, we return a NullCast.
20406 * literal.cs (NullLiteralTyped): Remove - I don't see why this
20407 should be around anymore.
20409 The renaming (reported was slightly wrong). Corrections:
20411 ConvertImplicitStandard -> ImplicitConversionStandard
20412 ConvertExplicitStandard -> ExplicitConversionStandard
20414 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20415 before passing them in !
20417 * convert.cs (ImplicitConversionStandard): When comparing for
20418 equal expr and target types, ensure that expr is not a
20421 In general, we must not be checking (expr_type ==
20422 target_type) in the top level conversion methods
20423 (ImplicitConversion, ExplicitConversion etc). This checking is
20424 done in the methods that they delegate to.
20426 2003-05-20 Miguel de Icaza <miguel@ximian.com>
20428 * convert.cs: Move Error_CannotConvertType,
20429 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20430 ImplicitNumericConversion, ImplicitConversionExists,
20431 ImplicitUserConversionExists, StandardConversionExists,
20432 FindMostEncompassedType, FindMostSpecificSource,
20433 FindMostSpecificTarget, ImplicitUserConversion,
20434 ExplicitUserConversion, GetConversionOperators,
20435 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20436 TryImplicitIntConversion, Error_CannotConvertImplicit,
20437 ConvertImplicitRequired, ConvertNumericExplicit,
20438 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20439 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20442 Perform the following renames:
20444 StandardConversionExists -> ImplicitStandardConversionExists
20445 ConvertImplicit -> ImplicitConversion
20446 ConvertImplicitStandard -> ImplicitStandardConversion
20447 TryImplicitIntConversion -> ImplicitIntConversion
20448 ConvertImplicitRequired -> ImplicitConversionRequired
20449 ConvertNumericExplicit -> ExplicitNumericConversion
20450 ConvertReferenceExplicit -> ExplicitReferenceConversion
20451 ConvertExplicit -> ExplicitConversion
20452 ConvertExplicitStandard -> ExplicitStandardConversion
20454 2003-05-19 Martin Baulig <martin@ximian.com>
20456 * statement.cs (TypeInfo.StructInfo): Made this type protected.
20457 (TypeInfo): Added support for structs having structs as fields.
20459 * ecore.cs (FieldExpr): Implement IVariable.
20460 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20461 VariableInfo for the field.
20463 2003-05-18 Martin Baulig <martin@ximian.com>
20465 * expression.cs (This.DoResolve): Report a CS0027 if we're
20466 emitting a field initializer.
20468 2003-05-18 Martin Baulig <martin@ximian.com>
20470 * expression.cs (This.ResolveBase): New public function.
20471 (This.DoResolve): Check for CS0188.
20473 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20476 * ecore.cs (MethodGroupExpr.DoResolve): Set the
20477 `instance_expression' to null if we don't have any non-static
20480 2003-05-18 Martin Baulig <martin@ximian.com>
20482 Reworked the way how local variables and parameters are handled by
20483 the flow analysis code.
20485 * statement.cs (TypeInfo, VariableMap): New public classes.
20486 (VariableInfo): New public class. This is now responsible for
20487 checking whether a variable has been assigned. It is used for
20488 parameters and local variables.
20489 (Block.EmitMeta): Take the InternalParameters as argument; compute
20490 the layout of the flow vectors here.
20491 (Block.LocalMap, Block.ParameterMap): New public properties.
20492 (FlowBranching): The .ctor doesn't get the InternalParameters
20493 anymore since Block.EmitMeta() now computes the layout of the flow
20495 (MyStructInfo): This class is now known as `StructInfo' and nested
20496 in `TypeInfo'; we don't access this directly anymore.
20498 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20499 property and removed IsAssigned(), IsFieldAssigned(),
20500 SetAssigned() and SetFieldAssigned(); we now call them on the
20501 VariableInfo so we don't need to duplicate this code everywhere.
20503 * expression.cs (ParameterReference): Added `Block block' argument
20505 (LocalVariableReference, ParameterReference, This): The new
20506 VariableInfo class is now responsible for all the definite
20509 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20510 IsParameterAssigned, SetParameterAssigned): Removed.
20512 2003-05-18 Martin Baulig <martin@ximian.com>
20514 * typemanager.cs (InitCoreTypes): Try calling
20515 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20516 the 3-args-version. Corlib now also needs our `void_type'.
20517 (GetMethod): Added overloaded version which takes an optional
20518 `bool report_errors' to allow lookups of optional methods.
20520 2003-05-12 Martin Baulig <martin@ximian.com>
20522 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20523 only used for locals and not for parameters.
20525 2003-05-12 Miguel de Icaza <miguel@ximian.com>
20527 * support.cs (InternalParameters.ParameterType): Return the
20528 ExternalType of the parameter.
20530 * parameter.cs (Parameter.ExternalType): drop the two arguments,
20533 2003-05-11 Miguel de Icaza <miguel@ximian.com>
20535 * class.cs (MethodData.Define): Do not set the `newslot' on
20536 interface members, if they are also flagged as "override".
20538 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20539 better code for ++i and i++. This only works for static fields
20540 and local variables.
20542 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20543 want to pull the DeclSpace out of the builder_to_declspace instead
20544 of the TypeBuilder (like in TypeContainer.FindMembers).
20546 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20547 instead of LookupTypeContainer. Fixes the crash on .NET for
20548 looking up interface members.
20550 * const.cs: Create our own emit context during the Definition
20551 stage, so that constants are evaluated in the proper context, when
20552 a recursive definition happens.
20554 2003-05-11 Martin Baulig <martin@ximian.com>
20556 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
20557 new block for a switch section.
20558 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20559 the adding/lookup in the switch block. Fixes #39828.
20561 2003-05-09 Miguel de Icaza <miguel@ximian.com>
20563 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20564 functionality: I needed to convert the data after I had performed
20565 the add/sub operation into the operands type size.
20567 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20568 pass the type for the box operation, otherwise the resulting
20569 object would have been of type object.
20571 (BoxedCast): Add constructor to specify the type to box as.
20573 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20575 * iterators.cs: I was reusing the `count' variable inadvertently,
20576 take steps to not allow this to happen.
20578 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20580 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20581 by creating an array at the point where the params starts and
20582 putting all those arguments there, then adjusting the size of the
20585 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20587 * expression.cs (New.AddressOf): Implement interface
20588 IMemoryLocation. This is used when the `new' operator is used in
20589 the context of an invocation to a method on a value type.
20591 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20594 * namespace.cs: Also check the using aliases here.
20596 * driver.cs: Move the test for using validity after the types have
20597 been entered, so we do a single pass that also includes the using
20600 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20601 in the regular case. CreateSiblingForFinally is doing extra
20604 * attribute.cs (GetAttributeArgumentExpression): Store the result
20605 on an out value, and use the return value to indicate failure
20606 instead of using null (which is a valid return for Constant.GetValue).
20608 * statement.cs: Perform the analysis flow for the increment
20609 portion after the statement, because this will be the real flow of
20610 execution. Fixes #42385
20612 * codegen.cs (EmitContext.EmitArgument,
20613 EmitContext.EmitStoreArgument): New helper functions when the
20614 RemapToProxy flag is set.
20616 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20619 Add support for remapping parameters.
20621 * iterators.cs: Propagate parameter values; Store parameter
20622 values in the proxy classes.
20624 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20626 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20627 need a proxy reference; I do not know what I was thinking
20629 * cs-parser.jay (constructor_initializer): catch another error,
20630 and display nice message.
20632 (field_declaration): catch void field declaration
20633 to flag a better error.
20635 * class.cs (MemberBase.CheckBase): Report an error instead of a
20636 warning if a new protected member is declared in a struct.
20637 (Field.Define): catch the error of readonly/volatile.
20639 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20641 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20642 volatile variable is taken
20644 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20646 * statement.cs (Fixed.Resolve): Report an error if we are not in
20649 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20651 * typemanager.cs: reuse the code that handles type clashes for
20652 delegates and enumerations.
20654 * class.cs (Report28): Always report.
20656 * expression.cs (EncodeAsAttribute): Allow nulls here.
20658 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20660 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20661 the functionality for testing whether an expression is valid for
20662 an attribute here. Also handle the case of arrays of elements
20665 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20666 encoding a linear array into an array of objects that are suitable
20667 to be passed to an CustomAttributeBuilder.
20669 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20671 * ecore.cs: (FieldExpr): Handle field remapping here.
20673 * iteratators.cs: Pass the instance variable (if the method is an
20674 instance method) to the constructors, so we can access the field
20675 variables on the class.
20677 TODO: Test this with structs. I think the THIS variable on
20678 structs might have to be a pointer, and not a refenrece
20680 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20682 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20683 local variables to fields in a proxy class.
20685 * iterators.cs (PopulateProxy): Rename our internal fields to
20687 Create a <THIS> field if we are an instance method, so we can
20688 reference our parent container variables.
20689 (MapVariable): Called back from the EmitContext code to enter a
20690 new variable to field mapping into the proxy class (we just create
20694 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20695 for using the remapped locals to fields.
20697 I placed the code here, because that gives the same semantics to
20698 local variables, and only changes the Emit code.
20700 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20701 statements inside iterators.
20702 (VariableInfo): Add a FieldBuilder for the cases when we are
20703 remapping local variables to fields in a proxy class
20705 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20706 current_block != null.
20708 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20709 not cope with strings, as it has been moved to the
20710 TableSwitchEmit. Fixed bug in switch generation.
20712 * expression.cs (New.DoResolve): Provide more context for the user
20713 when reporting an error.
20715 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20718 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20719 check the permissions for it. Note than in a type-resolution
20720 context the check was already present in DeclSpace.ResolveType,
20721 but was missing from the MemberAccess.
20723 (ArrayCreation.CheckIndices): warn if the user has
20724 more nested levels of expressions, but there are no more
20725 dimensions specified. Avoids crash on bug 41906.
20727 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20729 * statement.cs (Block): replace Implicit bool, for a generic
20731 New flag: `Unchecked'. This is used during the EmitMeta phase
20732 (which is out-of-line with the regular Resolve/Emit process for a
20733 statement, as this is done ahead of time, but still gets a chance
20734 to call constant resolve).
20736 (Block.Flags): new enum for adding a new flag.
20738 (Block.EmitMeta): track the state of unchecked.
20740 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20741 to enable constant resolution to work there as well.
20743 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20745 * typemanager.cs (ienumerable_type): Also look up
20746 System.Collections.IEnumerable.
20748 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20750 TODO: Test more than one conditional per method.
20752 * class.cs (Indexer.Define): Report the location where the user is
20753 referencing the unsupported feature.
20755 (MethodData): Overload the use of `conditionals' to
20756 minimize the creation of needless ArrayLists. This saves roughly
20757 212kb on my machine.
20759 (Method): Implement the new IIteratorContainer interface.
20760 (Method.SetYields): Implement the method by setting the ModFlags
20761 to contain METHOD_YIELDS.
20763 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20764 which just got set to null.
20766 * iterators.cs: New file.
20768 (Yield, YieldBreak): New statements.
20770 * statement.cs (Return.Resolve): Flag an error if we are used in
20771 an iterator method.
20773 * codegen.cs (InIterator): New flag set if the code is being
20774 compiled in an iterator method.
20776 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20777 internal modifier, and we just use it to avoid adding extra
20778 fields, as this is seldom used.
20780 * cs-parser.jay: Add yield_statement (yield and yield break).
20782 * driver.cs: New flag -v2 to turn on version 2 features.
20784 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20785 hashtable when v2 is enabled.
20787 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20789 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20790 there is already a namespace defined with this name.
20792 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20793 people upgraded their corlibs.
20795 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20796 always use fully qualified types, no need to use the compiler
20799 (TypeManager.IsNamespace): Use binarysearch.
20801 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20802 AddDelegate): I did not quite use the new IsValid API properly: I
20803 have to pass the short-name and the fullname. I was passing only
20804 the basename instead of the fullname sometimes.
20806 (TypeContainer.DefineType): call NamespaceClash.
20808 * interface.cs (Interface.DefineType): use NamespaceClash before
20811 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20814 * enum.cs: (Enum.DefineType): use NamespaceClash before
20817 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20818 speed increase. First, use the negative_hits cache when we get a
20819 negative. Second, add the type with its full original name
20820 instead of the new . and + encoded name (reflection uses + to
20821 separate type from a nested type). Use LookupTypeReflection
20822 directly which bypasses the type->name hashtable (that we already
20823 know does not contain the type.
20825 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20826 location/container type.
20828 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20830 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20832 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20834 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20835 method is being referenced in the method group from a static
20836 context, and report error 120 if so.
20838 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20841 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20842 is created, we create the A namespace).
20844 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20847 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20849 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20850 invocation to ModuleBuilder.GetType with the same values will
20851 return a new type instance, so we need to cache its return
20854 * expression.cs (Binary.ResolveOperator): Only allow the compare
20855 operators on enums if they are of the same type.
20857 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20858 types of ValueType on their own case. Before we were giving them
20859 the same treatment as objects.
20861 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20862 fullname. Short name is used to compare against container name.
20863 Fullname is used to check against defined namespace names.
20865 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20866 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20868 (Method.CheckBase): Call parent.
20869 (MemberBase.CheckBase): Check for protected members on sealed
20871 (PropertyBase.CheckBase): Call parent.
20872 (Field.Define): Call parent.
20874 * report.cs: Negative error codes are now mapped to 8000 - code,
20875 so that the display is render more nicely.
20877 * typemanager.cs: Do not use try/catch, instead report a regular
20880 (GetPointerType, GetReferenceType): These methods provide
20881 mechanisms to obtain the T* and T& from a T. We had the code
20882 previously scattered around the code base, and it also used
20883 TypeManager.LookupType that would go through plenty of caches.
20884 This one goes directly to the type source.
20886 In some places we did the Type.GetType followed by
20887 ModuleBuilder.GetType, but not in others, so this unifies the
20888 processing as well.
20890 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20891 statements now that we have namespace information.
20893 * typemanager.cs (IsNamespace): New method, returns whether the
20894 string presented is a namespace or not.
20896 (ComputeNamespaces): New public entry point, computes the list of
20897 available namespaces, using the GetNamespaces API call in Mono, or
20898 the slower version in MS.NET.
20900 Now before we start the semantic analysis phase, we have a
20901 complete list of namespaces including everything that the user has
20904 Deleted old code to cache namespaces in .nsc files.
20906 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20908 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20909 class/struct location definition Location for the implicit
20910 constructor location.
20912 (Operator.Define): Use the location of the operator for the
20913 implicit Method definition.
20915 (Constructor.Emit): use the constructor location for the implicit
20916 base initializer constructor.
20918 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20919 and the Expression class now contains two new methods:
20921 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20922 isolate type lookup from the rest of the resolution process.
20924 Since we use Expressions to hold type definitions due to the way
20925 we parse the input we have historically overloaded Resolve to
20926 perform the Type lookups if a special flag is passed. Now this is
20927 eliminated and two methods take their place.
20929 The differences in the two methods between xStep and xTerminal is
20930 that xStep is involved in our current lookup system that uses
20931 SimpleNames to compose a name, while xTerminal is used just to
20932 catch the case where the simplename lookup failed.
20934 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20936 * expression.cs (ResolveMemberAccess): Remove redundant code.
20937 TypeExpr expressions are always born fully resolved.
20939 * interface.cs (PopulateMethod): Do not lookup the types twice.
20940 We were doing it once during SemanticAnalysis and once during
20943 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20944 in local variable type definitions, were being returned as a
20945 SimpleName (we decomposed everything into a string), that is
20946 because primary_expression was being used instead of a type in the
20947 grammar (reduce/reduce conflicts).
20949 The part that was wrong is that we converted the expression into a
20950 string (an oversimplification in one hand, compounded with primary
20951 expressions doing string concatenation).
20957 Would return "A.B.C[]" as a SimpleName. This stopped things like
20958 using clauses from working on this particular context. And a type
20959 was being matched directly against "A.B.C[]".
20961 We now use the correct approach, and allow for ComposedCast to be
20962 part of the unary expression. So the "A.B.C []" become a composed
20963 cast of "A.B.C" (as a nested group of MemberAccess with a
20964 SimpleName at the end) plus the rank composition "[]".
20968 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20970 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20971 for the access level checking.
20973 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20974 `TypeContainer container', because I kept getting confused when I
20975 was debugging this code.
20977 * expression.cs (Indexers): Instead of tracking getters/setters,
20978 we now track them in parallel. We create one arraylist less, but
20979 most importantly it is possible now for the LValue code to find a
20980 matching get for a set.
20982 (IndexerAccess.DoResolveLValue): Update the code.
20983 GetIndexersForType has been modified already to extract all the
20984 indexers from a type. The code assumed it did not.
20986 Also make the code set the correct return type for the indexer.
20987 This was fixed a long time ago for properties, but was missing for
20988 indexers. It used to be void_type.
20990 (Binary.Emit): Test first for doubles instead of
20991 floats, as they are more common.
20993 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20994 when dealing with floats and the <=, >= operators. This fixes bug
20997 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20998 to load the array value by emitting a load on the foreach variable
20999 type. This was incorrect.
21001 We now emit the code to load an element using the the array
21002 variable type, and then we emit the conversion operator.
21006 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
21008 * attribute.cs: Avoid allocation of ArrayLists in the common case.
21010 2003-04-09 Miguel de Icaza <miguel@ximian.com>
21012 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21013 test for protection before we test for signatures.
21015 (MethodSignature.ToString): implement.
21017 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21018 to the case where we reduced into a LongConstant.
21020 * decl.cs (CheckAccessLevel): If the type is an array, we can not
21021 depend on whether the information is acurrate, because the
21022 Microsoft runtime will always claim that the array type is public,
21023 regardless of the real state.
21025 If the type is a pointer, another problem happens: the type is
21026 reported as non-public in Microsoft.
21028 In both cases we have to call CheckAccessLevel recursively with
21029 the underlying type as the argument to be tested.
21031 2003-04-08 Miguel de Icaza <miguel@ximian.com>
21033 * assign.cs (Assign.Emit): If we are dealing with a compound
21034 assignment expression, we should use the code path that stores the
21035 intermediate result in a temporary value. This fixes #40903.
21037 *expression.cs (Indirection.ToString): Provide ToString method for
21040 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
21042 * class.cs: Null out fields holding references to Block objects so
21043 they can be garbage collected.
21045 * expression.cs (OverloadResolve): Remove unused local.
21047 2003-04-07 Martin Baulig <martin@ximian.com>
21049 * codegen.cs (EmitContext.CurrentFile): New public field.
21050 (EmitContext.Mark): Use the CurrentFile to check whether the
21051 location is in the correct file.
21052 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21054 2003-04-07 Martin Baulig <martin@ximian.com>
21056 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21058 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21059 location. [FIXME: The location argument which gets passed to this
21060 method is sometimes wrong!]
21062 2003-04-07 Nick Drochak <ndrochak@gol.com>
21064 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21066 2003-04-07 Miguel de Icaza <miguel@ximian.com>
21068 * expression.cs (Indirection.EmitAssign): We were using the
21069 temporary, but returning immediately instead of continuing the
21072 2003-04-06 Martin Baulig <martin@ximian.com>
21074 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21075 if it's a nested child, but also deriving from the outer class.
21078 * typemanager.cs (IsNestedChildOf): Make this work if it's a
21079 nested child, but also deriving from the outer class. See
21081 (FilterWithClosure): We may access private members of the outer
21082 class if we're a nested child and deriving from the outer class.
21083 (RealMemberLookup): Only set `closure_private_ok' if the
21084 `original_bf' contained BindingFlags.NonPublic.
21086 2003-04-05 Martin Baulig <martin@ximian.com>
21088 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21090 2003-04-02 Miguel de Icaza <miguel@ximian.com>
21092 * class.cs (Event.Define): Do not allow abstract events to have
21095 2003-04-01 Miguel de Icaza <miguel@ximian.com>
21097 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21098 block in event declarations.
21100 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21101 value type, get its address.
21103 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21104 leaving a class on the stack instead of a boolean value (int
21105 0/1). Change the code so we compare against null, and then the
21106 result against zero.
21108 * class.cs (TypeContainer.GetClassBases): We were checking for the
21109 parent class being sealed too late.
21111 * expression.cs (Binary.Emit): For <= and >= when dealing with
21112 floating point values, use cgt.un and clt.un instead of cgt and
21115 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
21117 * statement.cs: Apply the same optimization as MS: skip the
21118 GetEnumerator returning an IEnumerator, and use the one returning a
21119 CharEnumerator instead. This allows us to avoid the try-finally block
21122 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
21124 * cs-parser.jay: Attributes cannot be applied to
21125 namespaces. Fixes #40473
21127 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21130 (Add*): check if the name is valid using the full name for constants,
21131 fields, properties and events.
21133 2003-03-28 Miguel de Icaza <miguel@ximian.com>
21135 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21136 char constants to be part of the enumeration.
21138 * expression.cs (Conditional.DoResolve): Add support for operator
21139 true. Implements the missing functionality from 14.12
21141 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21142 operator true/false as required by the spec.
21144 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21145 implicit conversion to boolean.
21147 * statement.cs (Statement.ResolveBoolean): A boolean expression is
21148 also one where the type implements `operator true'.
21150 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21151 get an expression that will invoke operator true based on an
21154 (GetConversionOperators): Removed the hack that called op_True
21157 (Expression.ResolveBoolean): Move this from Statement.
21159 2003-03-17 Miguel de Icaza <miguel@ximian.com>
21161 * ecore.cs (FieldExpr): do not allow initialization of initonly
21162 fields on derived classes
21164 2003-03-13 Martin Baulig <martin@ximian.com>
21166 * statement.cs (Block.Emit): Call ig.BeginScope() and
21167 ig.EndScope() when compiling with debugging info; call
21168 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21170 2003-03-08 Miguel de Icaza <miguel@ximian.com>
21172 * expression.cs (Indexers): Do not construct immediately, allow
21173 for new members to be appended as we go. Fixes 38143
21175 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21177 * expression.cs: save/restore context when resolving an unchecked
21180 2003-03-05 Miguel de Icaza <miguel@ximian.com>
21182 * cfold.cs: Catch division by zero in modulus operator during
21185 2003-03-03 Miguel de Icaza <miguel@ximian.com>
21187 * interface.cs (Interface.DefineMembers): Avoid defining members
21190 2003-02-27 Miguel de Icaza <miguel@ximian.com>
21192 * driver.cs: handle the +/- options for -noconfig
21194 * statement.cs (Unckeched.Resolve): Also track the state of
21195 unchecked in the Resolve phase.
21197 2003-02-27 Martin Baulig <martin@ximian.com>
21199 * ecore.cs (Expression.MemberLookup): Don't create a
21200 MethodGroupExpr for something which is not a method. Fixes #38291.
21202 2003-02-25 Miguel de Icaza <miguel@ximian.com>
21204 * class.cs (MemberBase.CheckParameters): Also check that the type
21205 is unmanaged if it is a pointer.
21207 * expression.cs (SizeOf.Resolve): Add location information.
21209 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21210 a managed type is declared.
21212 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21213 parameter modifiers as well. Fixes bug 38606
21215 * class.cs: Very sad. Am backing out the speed up changes
21216 introduced by the ArrayList -> Array in the TypeContainer, as they
21217 were not actually that much faster, and introduced a bug (no error
21218 reports on duplicated methods).
21220 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21221 source first, this will guarantee that we have a valid expression
21222 before calling in lower levels functions that will require a
21223 resolved object. Then use this original_source in the
21224 target.ResolveLValue instead of the original source that was
21227 Another change. Use target.Resolve instead of LValueResolve.
21228 Although we are resolving for LValues, we will let the Assign code
21229 take care of that (it will be called again from Resolve). This
21230 basically allows code like this:
21232 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21233 class Y { void A (X x) { x [0] += o; }
21235 The problem was that the indexer was trying to resolve for
21236 set_Item (idx, object o) and never finding one. The real set_Item
21237 was set_Item (idx, X). By delaying the process we get the right
21242 2003-02-23 Martin Baulig <martin@ximian.com>
21244 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21245 while calling DoEmit ().
21247 * codegen.cs (EmitContext.Mark): Don't mark locations in other
21248 source files; if you use the #line directive inside a method, the
21249 compiler stops emitting line numbers for the debugger until it
21250 reaches the end of the method or another #line directive which
21251 restores the original file.
21253 2003-02-23 Martin Baulig <martin@ximian.com>
21255 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21257 2003-02-23 Martin Baulig <martin@ximian.com>
21259 * statement.cs (Block.AddChildVariableNames): We need to call this
21260 recursively, not just for our immediate children.
21262 2003-02-23 Martin Baulig <martin@ximian.com>
21264 * class.cs (Event.Define): Always make the field private, like csc does.
21266 * typemanager.cs (TypeManager.RealMemberLookup): Make events
21267 actually work, fixes bug #37521.
21269 2003-02-23 Miguel de Icaza <miguel@ximian.com>
21271 * delegate.cs: When creating the various temporary "Parameters"
21272 classes, make sure that we call the ComputeAndDefineParameterTypes
21273 on those new parameters (just like we do with the formal ones), to
21274 allow them to be resolved in the context of the DeclSpace.
21276 This fixes the bug that Dick observed in Bugzilla #38530.
21278 2003-02-22 Miguel de Icaza <miguel@ximian.com>
21280 * expression.cs (ResolveMemberAccess): When resolving a constant,
21281 do not attempt to pull a constant if the value was not able to
21282 generate a valid constant.
21284 * const.cs (LookupConstantValue): Do not report more errors than required.
21286 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21288 * expression.cs: fixes bug #38328.
21290 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21292 * class.cs: Changed all the various members that can be part of a
21293 class from being an ArrayList to be an Array of the right type.
21294 During the DefineType type_list, interface_list, delegate_list and
21295 enum_list are turned into types, interfaces, delegates and enums
21298 And during the member population, indexer_list, event_list,
21299 constant_list, field_list, instance_constructor_list, method_list,
21300 operator_list and property_list are turned into their real arrays.
21302 Although we could probably perform this operation earlier, for
21303 good error reporting we need to keep the lists and remove the
21304 lists for longer than required.
21306 This optimization was triggered by Paolo profiling the compiler
21307 speed on the output of `gen-sample-program.pl' perl script.
21309 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21310 not crash in methods like MemberLookupFailed that use this field.
21312 This problem arises when the compiler fails to resolve a type
21313 during interface type definition for example.
21315 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21317 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21318 inherit from System.Object, so we have to stop at null, not only
21319 when reaching System.Object.
21321 2003-02-17 Miguel de Icaza <miguel@ximian.com>
21323 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21324 DeclaredOnly because the parent indexer might have had a different
21325 name, but did not loop until the top of the hierarchy was reached.
21327 The problem this one fixes is 35492: when a class implemented an
21328 indexer from an interface, we were getting the interface method
21329 (which was abstract) and we were flagging an error (can not invoke
21332 This also keeps bug 33089 functioning, and test-148 functioning.
21334 * typemanager.cs (IsSpecialMethod): The correct way of figuring
21335 out if a method is special is to see if it is declared in a
21336 property or event, or whether it is one of the predefined operator
21337 names. This should fix correctly #36804.
21339 2003-02-15 Miguel de Icaza <miguel@ximian.com>
21341 The goal here is to remove the dependency on EmptyCast.Peel ().
21342 Killing it completely.
21344 The problem is that currently in a number of places where
21345 constants are expected, we have to "probe" for an EmptyCast, and
21346 Peel, which is not the correct thing to do, as this will be
21347 repetitive and will likely lead to errors.
21349 The idea is to remove any EmptyCasts that are used in casts that
21350 can be reduced to constants, so we only have to cope with
21353 This bug hunt was triggered by Bug 37363 and the desire to remove
21354 the duplicate pattern where we were "peeling" emptycasts to check
21355 whether they were constants. Now constants will always be
21358 * ecore.cs: Use an enumconstant here instead of wrapping with
21361 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21362 throwing me off. By handling this we can get rid of a few hacks.
21364 * statement.cs (Switch): Removed Peel() code.
21366 2003-02-14 Miguel de Icaza <miguel@ximian.com>
21368 * class.cs: Location information for error 508
21370 * expression.cs (New.DoResolve): Add a guard against double
21371 resolution of an expression.
21373 The New DoResolve might be called twice when initializing field
21374 expressions (see EmitFieldInitializers, the call to
21375 GetInitializerExpression will perform a resolve on the expression,
21376 and later the assign will trigger another resolution
21378 This leads to bugs (#37014)
21380 * delegate.cs: The signature for EndInvoke should contain any ref
21381 or out parameters as well. We were not doing this in the past.
21383 * class.cs (Field.Define): Do not overwrite the type definition
21384 inside the `volatile' group. Turns out that volatile enumerations
21385 were changing the type here to perform a validity test, which
21388 2003-02-12 Miguel de Icaza <miguel@ximian.com>
21390 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21391 and structs, we do not want to load the instance variable
21393 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21394 enum_type has to be handled like an object reference (implicit
21395 conversions exists from this to object), but the regular IsClass
21396 and IsValueType tests will never return true for this one.
21398 Also we use TypeManager.IsValueType instead of type.IsValueType,
21399 just for consistency with the rest of the code (this is only
21400 needed if we ever use the construct exposed by test-180.cs inside
21401 corlib, which we dont today).
21403 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
21405 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21408 2003-02-09 Martin Baulig <martin@ximian.com>
21410 * namespace.cs (Namespace..ctor): Added SourceFile argument.
21411 (Namespace.DefineNamespaces): New static public method; this is
21412 called when we're compiling with debugging to add all namespaces
21413 to the symbol file.
21415 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21416 pass it to the Namespace's .ctor.
21418 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21419 and MethodBase arguments; pass the namespace ID to the symwriter;
21420 pass the MethodBase instead of the token to the symwriter.
21421 (SymbolWriter.DefineNamespace): New method to add a namespace to
21424 2003-02-09 Martin Baulig <martin@ximian.com>
21426 * symbolwriter.cs: New file. This is a wrapper around
21427 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
21428 methods here in near future.
21430 2003-02-09 Martin Baulig <martin@ximian.com>
21432 * codegen.cs (EmitContext.Mark): Just pass the arguments to
21433 ILGenerator.MarkSequencePoint() which are actually used by the
21436 2003-02-09 Martin Baulig <martin@ximian.com>
21438 * location.cs (SourceFile): New public sealed class. This
21439 contains the name and an index which is used in the location's token.
21440 (Location): Reserve an appropriate number of bits in the token for
21441 the source file instead of walking over that list, this gives us a
21442 really huge performance improvement when compiling with debugging.
21444 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21445 `SourceFile' argument instead of a string.
21446 (Driver.ProcessFile): Add all the files via Location.AddFile(),
21447 but don't parse/tokenize here, we need to generate the list of all
21448 source files before we do that.
21449 (Driver.ProcessFiles): New static function. Parses/tokenizes all
21452 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21453 instead of a string.
21455 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21458 2003-02-09 Martin Baulig <martin@ximian.com>
21460 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21461 filename on `#line default'.
21463 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21465 * statement.cs: don't clear the pinned var when the fixed statement
21466 returns from the method (fixes bug#37752).
21468 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21470 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
21473 2003-02-07 Martin Baulig <martin@ximian.com>
21475 * driver.cs: Removed the `--debug-args' command line argument.
21477 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21478 automatically by the AsssemblyBuilder.
21479 (CodeGen.InitializeSymbolWriter): We don't need to call any
21480 initialization function on the symbol writer anymore. This method
21481 doesn't take any arguments.
21483 2003-02-03 Miguel de Icaza <miguel@ximian.com>
21485 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21486 from referenced assemblies as well.
21488 2003-02-02 Martin Baulig <martin@ximian.com>
21490 * class.cs (MethodData.Emit): Generate debugging info for external methods.
21492 2003-02-02 Martin Baulig <martin@ximian.com>
21494 * class.cs (Constructor.Emit): Open the symbol writer before
21495 emitting the constructor initializer.
21496 (ConstructorInitializer.Emit): Call ec.Mark() to allow
21497 single-stepping through constructor initializers.
21499 2003-01-30 Miguel de Icaza <miguel@ximian.com>
21501 * class.cs: Handle error 549: do not allow virtual methods in
21504 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21506 * decl.cs: Check access levels when resolving types
21508 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21510 * statement.cs: Add parameters and locals set in catch blocks that might
21511 return to set vector
21513 2003-01-29 Miguel de Icaza <miguel@ximian.com>
21515 * class.cs (Operator): Set the SpecialName flags for operators.
21517 * expression.cs (Invocation.DoResolve): Only block calls to
21518 accessors and operators on SpecialName methods.
21520 (Cast.TryReduce): Handle conversions from char constants.
21523 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21525 * statement.cs: small memory and time optimization in FlowBranching.
21527 2003-01-28 Pedro Mart <yoros@wanadoo.es>
21529 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21530 problem that the last fix but in the other sid (Set).
21532 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21533 access when there is no indexer in the hierarchy.
21535 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21537 * class.cs: Combine some if statements.
21539 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21541 * driver.cs: fixed bug #37187.
21543 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
21545 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21546 any indexer, it's needed to build a list with all the indexers in the
21547 hierarchy (AllGetters), else we have problems. Fixes #35653.
21549 2003-01-23 Miguel de Icaza <miguel@ximian.com>
21551 * class.cs (MethodData.Define): It is wrong for an interface
21552 implementation to be static in both cases: explicit and implicit.
21553 We were only handling this in one case.
21555 Improve the if situation there to not have negations.
21557 * class.cs (Field.Define): Turns out that we do not need to check
21558 the unsafe bit on field definition, only on usage. Remove the test.
21560 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21562 * driver.cs: use assembly.Location instead of Codebase (the latest
21563 patch made mcs fail when using MS assemblies).
21565 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
21567 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21568 get the path to *corlib.dll.
21570 2003-01-21 Nick Drochak <ndrochak@gol.com>
21574 * typemanager.cs: Remove compiler warnings
21576 2003-01-20 Duncan Mak <duncan@ximian.com>
21578 * AssemblyInfo.cs: Bump the version number to 0.19.
21580 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21582 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21584 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21586 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21588 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21590 * cs-parser.jay: Small fix: we were not comparing the constructor
21591 name correctly. Thanks to Zoltan for the initial pointer.
21593 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21595 * cs-tokenizer.cs: Set file name when specified with #line
21597 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21599 * cs-parser.jay: Only perform the constructor checks here if we
21600 are named like the class; This will help provider a better
21601 error. The constructor path is taken when a type definition is
21602 not found, but most likely the user forgot to add the type, so
21603 report that rather than the constructor error.
21605 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21607 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21610 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21612 * cs-parser.jay: Add cleanup call.
21614 2003-01-13 Duncan Mak <duncan@ximian.com>
21616 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21617 consistent with other methods.
21619 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21621 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21623 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21625 * attribute.cs: only set GuidAttr to true when we have a
21628 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21632 * typemanager.cs: fixes to allow mcs compile corlib with the new
21633 Type.IsSubclassOf fix.
21635 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21637 * expression.cs (LocalVariableReference.DoResolve): Classify a
21638 constant as a value, not as a variable. Also, set the type for
21641 * cs-parser.jay (fixed_statement): take a type instead of a
21642 pointer_type, so we can produce a better error message later.
21644 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21647 (For.DoEmit): Make inifinite loops have a
21648 non-conditional branch back.
21650 (Fixed.DoEmit): First populate the pinned variables, then emit the
21651 statement, then clear the variables. Before I was emitting the
21652 code once for each fixed piece.
21655 2003-01-08 Martin Baulig <martin@ximian.com>
21657 * statement.cs (FlowBranching.MergeChild): A break in a
21658 SWITCH_SECTION does not leave a loop. Fixes #36155.
21660 2003-01-08 Martin Baulig <martin@ximian.com>
21662 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21663 lives in the same number space than `param_map'. Fixes #36154.
21665 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21667 * cs-parser.jay (constructor_declaration): Set the
21668 Constructor.ModFlags before probing for it. This makes the
21669 compiler report 514, 515 and 132 (the code was there, but got
21672 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21673 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21674 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21676 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21678 * enum.cs: create the enum static fields using the enum type.
21680 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21682 * class.cs: don't try to create the ParamBuilder for the return
21683 type if it's not needed (and handle it breaking for the ms runtime
21686 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21688 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21690 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21692 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21693 the command. This showed up while compiling the JANET source
21694 code, which used \r as its only newline separator.
21696 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21698 * class.cs (Method.Define): If we are an operator (because it
21699 reuses our code), then set the SpecialName and HideBySig. #36128
21701 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21703 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21704 exception, report error 120 `object reference required'.
21706 * driver.cs: Add --pause option, used during to measure the size
21707 of the process as it goes with --timestamp.
21709 * expression.cs (Invocation.DoResolve): Do not allow methods with
21710 SpecialName to be invoked.
21712 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21714 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21715 number before adding it.
21717 2002-12-21 Ravi Pratap <ravi@ximian.com>
21719 * ecore.cs (StandardImplicitConversion): When in an unsafe
21720 context, we allow conversion between void * to any other pointer
21721 type. This fixes bug #35973.
21723 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21725 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21726 is not thrown when extensionless outputs are used
21728 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21730 * rootcontext.cs: fixed compilation of corlib.
21732 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21734 * attribute.cs (Attributes.Contains): Add new method.
21736 * class.cs (MethodCore.LabelParameters): if the parameter is an
21737 `out' parameter, check that no attribute `[In]' has been passed.
21739 * enum.cs: Handle the `value__' name in an enumeration.
21741 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21743 * decl.cs: Added special case to allow overrides on "protected
21746 2002-12-18 Ravi Pratap <ravi@ximian.com>
21748 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21749 since it makes much more sense.
21751 (Attributes.ctor): Don't require a Location parameter.
21753 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21755 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21756 since we already have that information per attribute.
21758 * everywhere : make appropriate changes.
21760 * class.cs (LabelParameters): Write the code which actually
21761 applies attributes to the return type. We can't do this on the MS
21762 .NET runtime so we flag a warning in the case an exception is
21765 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21767 * const.cs: Handle implicit null conversions here too.
21769 2002-12-17 Ravi Pratap <ravi@ximian.com>
21771 * class.cs (MethodCore.LabelParameters): Remove the extra
21772 Type [] parameter since it is completely unnecessary. Instead
21773 pass in the method's attributes so that we can extract
21774 the "return" attribute.
21776 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21778 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21779 of ignoring it and letting the compile continue.
21781 * typemanager.cs (ChangeType): use an extra argument to return an
21782 error condition instead of throwing an exception.
21784 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21786 * expression.cs (Unary.TryReduce): mimic the code for the regular
21787 code path. Perform an implicit cast in the cases where we can
21788 implicitly convert to one of the integral types, and then reduce
21789 based on that constant. This fixes bug #35483.
21791 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21793 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21795 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21797 * namespace.cs: fixed bug #35489.
21799 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21801 * class.cs: Remove some dead code.
21803 * cs-parser.jay: Estimate the number of methods needed
21804 (RootContext.MethodCount);
21806 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21807 numbers instead of StringBuilders.
21809 * support.cs (PtrHashtable): Add constructor with initial size;
21810 We can now reduce reallocations of the method table.
21812 2002-12-10 Ravi Pratap <ravi@ximian.com>
21814 * attribute.cs (ApplyAttributes): Keep track of the emitted
21815 attributes on a per-target basis. This fixes bug #35413.
21817 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21819 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21820 default to the Windows 1252 encoding.
21822 (UnixParseOption): Support version, thanks to Alp for the missing
21825 * AssemblyInfo.cs: Add nice assembly information.
21827 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21830 * cs-parser.jay: Allow a trailing comma before the close bracked
21831 in the attribute_section production.
21833 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21834 address of the instance was being taken, I will take this out,
21835 because we take the address of the object immediately here.
21837 2002-12-09 Ravi Pratap <ravi@ximian.com>
21839 * typemanager.cs (AreMultipleAllowed): Take care of the most
21840 obvious case where attribute type is not in the current assembly -
21843 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21845 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21846 definitions, instead of doing that afterwards.
21848 Also we use a nice little hack, depending on the constructor, we
21849 know if we are a "composed" name or a simple name. Hence, we
21850 avoid the IndexOf test, and we avoid
21852 * codegen.cs: Add code to assist in a bug reporter to track down
21853 the source of a compiler crash.
21855 2002-12-07 Ravi Pratap <ravi@ximian.com>
21857 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21858 types have been emitted for a given element and flag an error
21859 if something which does not have AllowMultiple set is used more
21862 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21863 attribute types and their corresponding AllowMultiple properties
21865 (AreMultipleAllowed): Check the property for a given type.
21867 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21868 property in the case we have a TypeContainer.
21870 (Attributes.AddAttribute): Detect duplicates and just skip on
21871 adding them. This trivial fix catches a pretty gross error in our
21872 attribute emission - global attributes were being emitted twice!
21874 Bugzilla bug #33187 is now fixed.
21876 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21878 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21879 instead of pp_and).
21881 * expression.cs (Binary.ResolveOperator): I can only use the
21882 Concat (string, string, string) and Concat (string, string,
21883 string, string) if the child is actually a concatenation of
21886 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21888 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21889 context where we need a 2-character lookahead.
21891 * pending.cs (PendingImplementation): Rework so we can keep track
21892 of interface types all the time, and flag those which were
21893 implemented by parents as optional.
21895 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21897 * expression.cs (Binary.ResolveOperator): Use
21898 String.Concat(string,string,string) or
21899 String.Concat(string,string,string,string) when possible.
21901 * typemanager: More helper methods.
21904 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21906 * pending.cs: remove the bogus return from GetMissingInterfaces()
21907 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21909 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21911 * namespace.cs: avoid duplicated 'using xxx' being added to
21912 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21913 when we get more than one 'using' statement for the same namespace.
21914 Report a CS0105 warning for it.
21916 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21918 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21919 of calling getChar/putback, uses internal knowledge of it.
21921 (xtoken): Reorder tokenizer so most common patterns are checked
21922 first. This reduces the compilation time in another 5% (from 8.11s
21923 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21925 The parsing time is 22% of the compilation in mcs, and from that
21926 64% is spent on the tokenization process.
21928 I tried using a binary search for keywords, but this is slower
21929 than the hashtable. Another option would be to do a couple of
21932 * Not use a StringBuilder, instead use an array of chars,
21933 with a set value. Notice that this way we could catch
21934 the 645 error without having to do it *afterwards*.
21936 * We could write a hand-parser to avoid the hashtable
21937 compares altogether.
21939 The identifier consumption process takes 37% of the tokenization
21940 time. Another 15% is spent on is_number. 56% of the time spent
21941 on is_number is spent on Int64.Parse:
21943 * We could probably choose based on the string length to
21944 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21947 Another 3% is spend on wrapping `xtoken' in the `token' function.
21949 Handle 0xa0 as whitespace (#34752)
21951 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21953 * typemanager.cs (IsCLRType): New routine to tell whether a type
21954 is one of the builtin types.
21956 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21957 typecode in more places instead of doing pointer comparissions.
21958 We could leverage some knowledge about the way the typecodes are
21961 New code to cache namespaces in assemblies, it is currently not
21962 invoked, to be used soon.
21964 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21966 * expression.cs (Binary.ResolveOperator): specially handle
21967 strings, and do not perform user-defined operator overloading for
21970 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21972 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21973 internalcall as it is a pretty simple operation; Avoid whenever
21974 possible to call Char.IsLetter.
21976 (consume_identifier): Cut by half the number of
21977 hashtable calls by merging the is_keyword and GetKeyword behavior.
21979 Do not short-circuit, because if we do, we
21980 report errors (ie, #if false && true would produce an invalid
21984 2002-11-24 Martin Baulig <martin@ximian.com>
21986 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21987 check constant ranges and report a CS0221. Fixes #33186.
21989 2002-11-24 Martin Baulig <martin@ximian.com>
21991 * cs-parser.jay: Make this work for uninitialized variable
21992 declarations in the `for' initializer. Fixes #32416.
21994 2002-11-24 Martin Baulig <martin@ximian.com>
21996 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21997 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21999 2002-11-24 Martin Baulig <martin@ximian.com>
22001 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22002 argument; if true, we also check for user-defined conversions.
22003 This is only needed if both arguments are of a user-defined type.
22004 Fixes #30443, added test-175.cs.
22005 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22007 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22009 2002-11-24 Martin Baulig <martin@ximian.com>
22011 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22012 function to get the store opcode.
22013 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22014 only emit the Ldelema if the store opcode is Stobj. You must run
22015 both test-34 and test-167 to test this. Fixes #34529.
22017 2002-11-23 Martin Baulig <martin@ximian.com>
22019 * ecore.cs (Expression.MemberLookup): Added additional
22020 `qualifier_type' argument which is used when we're being called
22021 from MemberAccess.DoResolve() and null if we're called from a
22023 (Expression.MemberLookupFailed): New method to report errors; this
22024 does the CS1540 check and reports the correct error message.
22026 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22027 argument for the CS1540 check and redone the way how we're dealing
22028 with private members. See the comment in the source code for details.
22029 (FilterWithClosure): Reverted this back to revision 1.197; renamed
22030 `closure_start_type' to `closure_qualifier_type' and check whether
22031 it's not null. It was not this filter being broken, it was just
22032 being called with the wrong arguments.
22034 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22035 and pass it the correct `qualifier_type'; this also does the error
22038 2002-11-22 Miguel de Icaza <miguel@ximian.com>
22040 * expression.cs (Invocation.EmitParams): If the we are dealing
22041 with a non-built-in value type, load its address as well.
22043 (ArrayCreation): Use a a pretty constant instead
22044 of the hardcoded value 2. Use 6 instead of 2 for the number of
22045 static initializers.
22047 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22048 because they are not really value types, just glorified integers.
22050 * driver.cs: Do not append .exe, the CSC compiler does not do it.
22052 * ecore.cs: Remove redundant code for enumerations, make them use
22053 the same code path as everything else, fixes the casting issue
22054 with enumerations in Windows.Forms.
22056 * attribute.cs: Do only cast to string if it is a string, the
22057 validation happens later.
22059 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22060 people upgrade their corlibs.
22062 * ecore.cs: Oops, enumerations were not following the entire code path
22064 2002-11-21 Miguel de Icaza <miguel@ximian.com>
22066 * typemanager.cs (FilterWithClosure): Commented out the test for
22067 1540 in typemanager.cs, as it has problems when accessing
22068 protected methods from a parent class (see test-174.cs).
22070 * attribute.cs (Attribute.ValidateGuid): new method.
22071 (Attribute.Resolve): Use above.
22073 2002-11-19 Miguel de Icaza <miguel@ximian.com>
22075 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22077 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22078 handling for enumerations, as we only needed the TypeContainer
22079 functionality to begin with (this is required for the fix below to
22080 work for enums that reference constants in a container class for
22083 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22085 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22086 a valid TypeBuilder to perform lookups on.o
22088 * class.cs (InheritableMemberSignatureCompare): Use true in the
22089 call to GetGetMethod and GetSetMethod, because we are comparing
22090 the signature, and we need to get the methods *even* if they are
22093 (PropertyBase.CheckBase): ditto.
22095 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22096 GotoCase.Resolve): Use Peel on EmpytCasts.
22098 * ecore.cs (EmptyCast): drop child, add Peel method.
22100 2002-11-17 Martin Baulig <martin@ximian.com>
22102 * ecore.cs (EmptyCast.Child): New public property.
22104 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22105 label resolved to an EmptyCast. Fixes #34162.
22106 (GotoCase.Resolve): Likewise.
22107 (Block.EmitMeta): Likewise.
22109 2002-11-17 Martin Baulig <martin@ximian.com>
22111 * expression.cs (Invocation.BetterConversion): Prefer int over
22112 uint; short over ushort; long over ulong for integer literals.
22113 Use ImplicitConversionExists instead of StandardConversionExists
22114 since we also need to check for user-defined implicit conversions.
22115 Fixes #34165. Added test-173.cs.
22117 2002-11-16 Martin Baulig <martin@ximian.com>
22119 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22120 with the `true' and `false' literals. Fixes #33151.
22122 2002-11-16 Martin Baulig <martin@ximian.com>
22124 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22125 October 22nd; don't do the cs1540 check for static members.
22127 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22128 now using our own filter here and doing the cs1540 check again.
22130 2002-11-16 Martin Baulig <martin@ximian.com>
22132 * support.cs (InternalParameters): Don't crash if we don't have
22133 any fixed parameters. Fixes #33532.
22135 2002-11-16 Martin Baulig <martin@ximian.com>
22137 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22138 when looking up static methods to make this work on Windows.
22141 2002-11-16 Martin Baulig <martin@ximian.com>
22143 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22144 a setter rather than using PropertyInfo.CanWrite.
22146 2002-11-15 Nick Drochak <ndrochak@gol.com>
22148 * class.cs: Allow acces to block member by subclasses. Fixes build
22151 2002-11-14 Martin Baulig <martin@ximian.com>
22153 * class.cs (Constructor.Emit): Added the extern/block check.
22156 2002-11-14 Martin Baulig <martin@ximian.com>
22158 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22159 iteration while looking for indexers, this is needed because the
22160 indexer may have a different name in our base classes. Fixed the
22161 error reporting (no indexers at all, not get accessor, no
22162 overloaded match). Fixes bug #33089.
22163 (IndexerAccess.DoResolveLValue): Likewise.
22165 2002-11-14 Martin Baulig <martin@ximian.com>
22167 * class.cs (PropertyBase.CheckBase): Make this work for multiple
22168 indexers. Fixes the first part of bug #33089.
22169 (MethodSignature.InheritableMemberSignatureCompare): Added support
22172 2002-11-13 Ravi Pratap <ravi@ximian.com>
22174 * attribute.cs (Attribute.Resolve): Catch the
22175 NullReferenceException and report it since it isn't supposed to
22178 2002-11-12 Miguel de Icaza <miguel@ximian.com>
22180 * expression.cs (Binary.EmitBranchable): Also handle the cases for
22181 LogicalOr and LogicalAnd that can benefit from recursively
22182 handling EmitBranchable. The code now should be nice for Paolo.
22184 2002-11-08 Miguel de Icaza <miguel@ximian.com>
22186 * typemanager.cs (LookupType): Added a negative-hit hashtable for
22187 the Type lookups, as we perform quite a number of lookups on
22188 non-Types. This can be removed once we can deterministically tell
22189 whether we have a type or a namespace in advance.
22191 But this might require special hacks from our corlib.
22195 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22196 and double which avoids a conversion from an integer to a double.
22198 * expression.cs: tiny optimization, avoid calling IsConstant,
22199 because it effectively performs the lookup twice.
22201 2002-11-06 Miguel de Icaza <miguel@ximian.com>
22203 But a bogus return here to keep the semantics of the old code
22204 until the Mono runtime is fixed.
22206 * pending.cs (GetMissingInterfaces): New method used to remove all
22207 the interfaces that are already implemented by our parent
22208 classes from the list of pending methods.
22210 * interface.cs: Add checks for calls after ResolveTypeExpr.
22212 2002-11-05 Miguel de Icaza <miguel@ximian.com>
22214 * class.cs (Class.Emit): Report warning 67: event not used if the
22215 warning level is beyond 3.
22217 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22218 being a NullLiteral.
22220 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22223 * class.cs (TypeContainer.GetClassBases): Cover a missing code
22224 path that might fail if a type can not be resolved.
22226 * expression.cs (Binary.Emit): Emit unsigned versions of the
22229 * driver.cs: use error 5.
22231 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22233 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22235 2002-11-01 Miguel de Icaza <miguel@ximian.com>
22237 * cs-parser.jay (switch_section): A beautiful patch from Martin
22238 Baulig that fixed 33094.
22240 2002-10-31 Miguel de Icaza <miguel@ximian.com>
22242 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22243 Check whether the base is abstract and report an error if so.
22245 * expression.cs (IndexerAccess.DoResolveLValue,
22246 IndexerAccess.DoResolve): ditto.
22248 (Invocation.DoResolve): ditto.
22250 (Invocation.FullMethodDesc): Improve the report string.
22252 * statement.cs (Block): Eliminate IsVariableDefined as it is
22253 basically just a wrapper for GetVariableInfo.
22255 * ecore.cs (SimpleName): Use new
22257 * support.cs (ReflectionParamter.ParameterType): We unwrap the
22258 type, as we return the actual parameter ref/unref state on a
22261 2002-10-30 Miguel de Icaza <miguel@ximian.com>
22263 * support.cs: Return proper flags REF/OUT fixing the previous
22266 * expression.cs: Reverted last patch, that was wrong. Is_ref is
22267 not used to mean `ref' but `ref or out' in ParameterReference
22269 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22270 full type signature instead of calling TypeManger.CSharpName
22273 * support.cs (InternalParameters.ParameterDesc): Do not compare
22274 directly to the modflags, because REF/OUT will actually be bitsets
22277 * delegate.cs (VerifyMethod): Check also the modifiers.
22279 * cs-tokenizer.cs: Fix bug where floating point values with an
22280 exponent where a sign was missing was ignored.
22282 * driver.cs: Allow multiple assemblies to be specified in a single
22285 2002-10-28 Miguel de Icaza <miguel@ximian.com>
22287 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
22288 because identifiers after a parenthesis would end up in this kind
22289 of production, and we needed to desamiguate it for having casts
22292 (UserDefinedType *) xxx
22294 2002-10-24 Miguel de Icaza <miguel@ximian.com>
22296 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22297 we should set on the Bindingflags.NonPublic, but not turn on
22298 private_ok. private_ok controls whether a Private member is
22299 returned (this is chekced on the filter routine), while the
22300 BindingFlags.NonPublic just controls whether private/protected
22301 will be allowed. This fixes the problem part of the problem of
22302 private properties being allowed to be used in derived classes.
22304 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22305 so we can call the children DoResolveLValue method (this will
22306 properly signal errors on lvalue assignments to base properties)
22308 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22309 getter are null, and we have a property info, we know that this
22310 happened because the lookup failed, so we report an error 122 for
22311 protection level violation.
22313 We also silently return if setter and getter are null in the
22314 resolve functions, this condition only happens if we have flagged
22315 the error before. This is the other half of the problem.
22317 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22318 not have accessibility information, that is why we were returning
22319 true in the filter function in typemanager.cs.
22321 To properly report 122 (property is inaccessible because of its
22322 protection level) correctly, we report this error in ResolveAccess
22323 by failing if both the setter and the getter are lacking (ie, the
22326 DoResolve and DoLResolve have been modified to check for both
22327 setter/getter being null and returning silently, the reason being
22328 that I did not want to put the knowledge about this error in upper
22331 int old = Report.Errors;
22332 x = new PropertyExpr (...);
22333 if (old != Report.Errors)
22338 So the property expr is returned, but it is invalid, so the error
22339 will be flagged during the resolve process.
22341 * class.cs: Remove InheritablePropertySignatureCompare from the
22342 class, as we no longer depend on the property signature to compute
22343 whether it is possible to implement a method or not.
22345 The reason is that calling PropertyInfo.GetGetMethod will return
22346 null (in .NET, in Mono it works, and we should change this), in
22347 cases where the Get Method does not exist in that particular
22352 class X { public virtual int A { get { return 1; } } }
22354 class Z : Y { public override int A { get { return 2; } } }
22356 Would fail in Z because the parent (Y) would not have the property
22357 defined. So we avoid this completely now (because the alternative
22358 fix was ugly and slow), and we now depend exclusively on the
22361 (PropertyBase.CheckBase): Use a method-base mechanism to find our
22362 reference method, instead of using the property.
22364 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22365 routines are gone now.
22367 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22368 names, they were incorrectly named.
22370 * cs-tokenizer.cs: Return are more gentle token on failure.
22372 * pending.cs (PendingImplementation.InterfaceMethod): This routine
22373 had an out-of-sync index variable, which caused it to remove from
22374 the list of pending methods the wrong method sometimes.
22376 2002-10-22 Miguel de Icaza <miguel@ximian.com>
22378 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22379 CanWrite, because those refer to this particular instance of the
22380 property, and do not take into account the fact that we can
22381 override single members of a property.
22383 Constructor requires an EmitContext. The resolution process does
22384 not happen here, but we need to compute the accessors before,
22385 because the resolution does not always happen for properties.
22387 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22388 subclass, before we did not update this flag, but we did update
22391 (GetAccessors): Drop this routine, as it did not work in the
22392 presence of partially overwritten set/get methods.
22394 Notice that this broke the cs1540 detection, but that will require
22397 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22401 * driver.cs: issue a warning instead of an error if we don't support
22402 debugging for the platform. Also ignore a couple of errors that may
22403 arise when trying to write the symbols. Undo my previous patch.
22405 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22407 * driver.cs: ignore /debug switch except for Unix platforms.
22409 2002-10-23 Nick Drochak <ndrochak@gol.com>
22411 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22413 2002-10-21 Miguel de Icaza <miguel@ximian.com>
22415 * driver.cs: Do not make mcs-debug conditional, so we do not break
22416 builds that use it.
22418 * statement.cs (UsageVector.MergeChildren): I would like Martin to
22419 review this patch. But basically after all the children variables
22420 have been merged, the value of "Breaks" was not being set to
22421 new_breaks for Switch blocks. I think that it should be set after
22422 it has executed. Currently I set this to the value of new_breaks,
22423 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22424 conservative, but I do not understand this code very well.
22426 I did not break anything in the build, so that is good ;-)
22428 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22430 2002-10-20 Mark Crichton <crichton@gimp.org>
22432 * cfold.cs: Fixed compile blocker. Really fixed it this time.
22434 2002-10-20 Nick Drochak <ndrochak@gol.com>
22436 * cfold.cs: Fixed compile blocker.
22438 2002-10-20 Miguel de Icaza <miguel@ximian.com>
22440 * driver.cs: I was chekcing the key, not the file.
22442 2002-10-19 Ravi Pratap <ravi@ximian.com>
22444 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22445 message that we were generating - we just need to silently return
22448 2002-10-19 Miguel de Icaza <miguel@ximian.com>
22450 * class.cs (Event.Define): Change my previous commit, as this
22451 breaks the debugger. This is a temporary hack, as it seems like
22452 the compiler is generating events incorrectly to begin with.
22454 * expression.cs (Binary.ResolveOperator): Added support for
22455 "U operator - (E x, E y)"
22457 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22460 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22461 init-only variables, but this path did not take into account that
22462 there might be also instance readonly variables. Correct this
22465 This fixes bug 32253
22467 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22470 * driver.cs: Change the extension for modules to `netmodule'
22472 * cs-parser.jay: Improved slightly the location tracking for
22473 the debugger symbols.
22475 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22476 modifiers that were specified instead of the hardcoded value
22477 (FamAndAssem). This was basically ignoring the static modifier,
22478 and others. Fixes 32429.
22480 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22481 fixed a bug in the process (32476)
22483 * expression.cs (ArrayAccess.EmitAssign): Patch from
22484 hwang_rob@yahoo.ca that fixes bug 31834.3
22486 2002-10-18 Miguel de Icaza <miguel@ximian.com>
22488 * driver.cs: Make the module extension .netmodule.
22490 2002-10-16 Miguel de Icaza <miguel@ximian.com>
22492 * driver.cs: Report an error if the resource file is not found
22493 instead of crashing.
22495 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22496 false, like Emit does.
22498 2002-10-16 Nick Drochak <ndrochak@gol.com>
22500 * typemanager.cs: Remove unused private member. Also reported mcs
22501 bug to report this as a warning like csc.
22503 2002-10-15 Martin Baulig <martin@gnome.org>
22505 * statement.cs (Statement.Emit): Made this a virtual method; emits
22506 the line number info and calls DoEmit().
22507 (Statement.DoEmit): New protected abstract method, formerly knows
22508 as Statement.Emit().
22510 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22512 2002-10-11 Miguel de Icaza <miguel@ximian.com>
22514 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22515 have fixed a remaining problem: not every AddXXXX was adding a
22516 fully qualified name.
22518 Now everyone registers a fully qualified name in the DeclSpace as
22519 being defined instead of the partial name.
22521 Downsides: we are slower than we need to be due to the excess
22522 copies and the names being registered this way.
22524 The reason for this is that we currently depend (on the corlib
22525 bootstrap for instance) that types are fully qualified, because
22526 we dump all the types in the namespace, and we should really have
22527 types inserted into the proper namespace, so we can only store the
22528 basenames in the defined_names array.
22530 2002-10-10 Martin Baulig <martin@gnome.org>
22532 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22533 from bug #31834, see the bug report for a testcase which is
22536 2002-10-10 Martin Baulig <martin@gnome.org>
22538 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22539 flow analysis code for this.
22541 * statement.cs (Do, While, For): Tell the flow analysis code about
22543 (FlowBranching.UsageVector): Added support for infinite loops.
22544 (Block.Resolve): Moved the dead code elimination here and use flow
22547 2002-10-09 Miguel de Icaza <miguel@ximian.com>
22549 * class.cs (Field.Define): Catch cycles on struct type
22552 * typemanager.cs (IsUnmanagedtype): Do not recursively check
22553 fields if the fields are static. We only need to check instance
22556 * expression.cs (As.DoResolve): Test for reference type.
22558 * statement.cs (Using.ResolveExpression): Use
22559 ConvertImplicitRequired, not ConvertImplicit which reports an
22561 (Using.ResolveLocalVariableDecls): ditto.
22563 * expression.cs (Binary.ResolveOperator): Report errors in a few
22564 places where we had to.
22566 * typemanager.cs (IsUnmanagedtype): Finish implementation.
22568 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22570 * expression.cs: Use StoreFromPtr instead of extracting the type
22571 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22573 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22574 an enumeration value to a System.Enum, but System.Enum is not a
22575 value type, but an class type, so we need to box.
22577 (Expression.ConvertExplicit): One codepath could return
22578 errors but not flag them. Fix this. Fixes #31853
22580 * parameter.cs (Resolve): Do not allow void as a parameter type.
22582 2002-10-06 Martin Baulig <martin@gnome.org>
22584 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22585 if it's a class type and not a struct. Fixes #31815.
22587 2002-10-06 Martin Baulig <martin@gnome.org>
22589 * statement.cs: Reworked the flow analysis code a bit to make it
22590 usable for dead code elimination.
22592 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22594 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22596 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22598 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22599 to fix the test 165, will investigate deeper.
22601 2002-10-04 Martin Baulig <martin@gnome.org>
22603 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22604 finally blocks actually work.
22605 (Try.Resolve): We don't need to create a sibling for `finally' if
22606 there is no finally block.
22608 2002-10-04 Martin Baulig <martin@gnome.org>
22610 * class.cs (Constructor.Define): The default accessibility for a
22611 non-default constructor is private, not public.
22613 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22615 * class.cs (Constructor): Make AllowedModifiers public, add
22618 * cs-parser.jay: Perform the modifiers test here, as the
22619 constructor for the Constructor class usually receives a zero
22620 because of the way we create it (first we create, later we
22621 customize, and we were never checking the modifiers).
22623 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22624 is a version of LookupTypeReflection that includes the type-name
22625 cache. This can be used as a fast path for functions that know
22626 the fully qualified name and are only calling into *.GetType() to
22627 obtain a composed type.
22629 This is also used by TypeManager.LookupType during its type
22632 (LookupType): We now also track the real type name, as sometimes
22633 we can get a quey for the real type name from things like
22634 ComposedCast. This fixes bug 31422.
22636 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22637 complete type fullname, it does not have to go through the type
22638 resolution system to obtain the composed version of the type (for
22639 obtaining arrays or pointers).
22641 (Conditional.Emit): Use the EmitBoolExpression to
22642 generate nicer code, as requested by Paolo.
22644 (ArrayCreation.CheckIndices): Use the patch from
22645 hwang_rob@yahoo.ca to validate the array initializers.
22647 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22649 * class.cs (ConstructorInitializer.Emit): simplify code by using
22650 Invocation.EmitCall, and at the same time, fix the bugs in calling
22651 parent constructors that took variable arguments.
22653 * ecore.cs (Expression.ConvertNumericExplicit,
22654 Expression.ImplicitNumericConversion): Remove the code that
22655 manually wrapped decimal (InternalTypeConstructor call is now gone
22658 * expression.cs (Cast.TryReduce): Also handle decimal types when
22659 trying to perform a constant fold on the type.
22661 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22663 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22664 that only turned off an error report, and did nothing else.
22666 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22668 * driver.cs: Handle and ignore /fullpaths
22670 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22672 * expression.cs (Binary.ResolveOperator): Catch the case where
22673 DoNumericPromotions returns true,
22675 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22677 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22679 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22682 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22684 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22685 conversion exists, but it is also required that the conversion be
22686 performed. This manifested in "(Type64Enum) 2".
22688 * class.cs (TypeManager.AddMethod): The fix is not to change
22689 AddEnum, because that one was using a fully qualified name (every
22690 DeclSpace derivative does), but to change the AddMethod routine
22691 that was using an un-namespaced name. This now correctly reports
22692 the duplicated name.
22694 Revert patch until I can properly fix it. The issue
22695 is that we have a shared Type space across all namespaces
22696 currently, which is wrong.
22698 Options include making the Namespace a DeclSpace, and merge
22699 current_namespace/current_container in the parser.
22701 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22703 * cs-parser.jay: Improve error reporting when we get a different
22704 kind of expression in local_variable_type and
22705 local_variable_pointer_type.
22707 Propagate this to avoid missleading errors being reported.
22709 * ecore.cs (ImplicitReferenceConversion): treat
22710 TypeManager.value_type as a target just like object_type. As
22715 Is valid, and needs to result in the int 1 being boxed before it
22716 is assigned to the value type v.
22718 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22719 to validate the enumeration name.
22721 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22722 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22723 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22725 * ecore.cs (TryImplicitIntConversion): When doing an
22726 implicit-enumeration-conversion, check if the type is 64-bits and
22727 perform a conversion before passing to EnumConstant.
22729 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22731 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22732 report ambiguous type references. Unlike the MS version, we
22733 report what the ambiguity is. Innovation at work ;-)
22735 (DeclSpace.FindType): Require a location argument to
22736 display when we display an ambiguous error.
22738 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22740 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22742 * expression.cs (EmitDynamicInitializers): Apply patch from
22743 hwang_rob@yahoo.ca that fixes the order in which we emit our
22746 2002-09-21 Martin Baulig <martin@gnome.org>
22748 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22749 delegate takes no arguments.
22751 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22753 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22756 * expression.cs: Extract the underlying type.
22758 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22760 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22762 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22764 * class.cs (TypeContainer.DefineType): We can not use the nice
22765 PackingSize with the size set to 1 DefineType method, because it
22766 will not allow us to define the interfaces that the struct
22769 This completes the fixing of bug 27287
22771 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22772 means also structs. This fixes part of the problem.
22773 (Expresion.ImplicitReferenceConversionExists): ditto.
22775 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22776 error if there were no errors reported during the type lookup
22777 process, to avoid duplicates or redundant errors. Without this
22778 you would get an ambiguous errors plus a type not found. We have
22779 beaten the user enough with the first error.
22781 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22784 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22785 during the resolution process, stop the lookup, this avoids
22786 repeated error reports (same error twice).
22788 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22790 * typemanager.cs (LookupType): Redo the type lookup code to match
22791 the needs of System.Reflection.
22793 The issue is that System.Reflection requires references to nested
22794 types to begin with a "+" sign instead of a dot. So toplevel
22795 types look like: "NameSpace.TopLevelClass", and nested ones look
22796 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22799 2002-09-19 Martin Baulig <martin@gnome.org>
22801 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22802 says that a method always returns or always throws an exception,
22803 don't report the CS0161.
22805 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22806 set `Returns = new_returns'.
22808 2002-09-19 Martin Baulig <martin@gnome.org>
22810 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22811 to an enum constant, check for a CS0176.
22813 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22815 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22816 for operators that must be in pairs and report errors.
22818 * ecore.cs (SimpleName.DoResolveType): During the initial type
22819 resolution process, when we define types recursively, we must
22820 check first for types in our current scope before we perform
22821 lookups in the enclosing scopes.
22823 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22825 (Invocation.VerifyArgumentsCompat): Call
22826 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22827 I thought we were supposed to always call this, but there are a
22828 few places in the code where we dont do it.
22830 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22832 * driver.cs: Add support in -linkres and -resource to specify the
22833 name of the identifier.
22835 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22837 * ecore.cs (StandardConversionExists): Sync with the conversion
22838 code: allow anything-* to void* conversions.
22840 (FindMostSpecificSource): Use an Expression argument
22841 instead of a Type, because we might be handed over a Literal which
22842 gets a few more implicit conversions that plain types do not. So
22843 this information was being lost.
22845 Also, we drop the temporary type-holder expression when not
22848 2002-09-17 Martin Baulig <martin@gnome.org>
22850 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22851 this is an explicit interface implementation.
22853 2002-09-17 Martin Baulig <martin@gnome.org>
22855 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22856 different `IndexerName' attributes.
22858 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22859 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22860 virtual CommonResolve().
22862 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22864 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22865 and convert that to the UnderlyingType.
22867 * statement.cs (Foreach.Resolve): Indexers are just like variables
22868 or PropertyAccesses.
22870 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22871 inside quoted strings, we were not doing this before.
22873 2002-09-16 Martin Baulig <martin@gnome.org>
22875 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22876 resolve it. This is needed for the definite assignment check of the
22877 instance expression, fixes bug #29846.
22878 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22880 2002-09-16 Nick Drochak <ndrochak@gol.com>
22882 * parameter.cs: Fix compile error. Cannot reference static member
22883 from an instance object. Is this an mcs bug?
22885 2002-09-14 Martin Baulig <martin@gnome.org>
22887 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22888 multiple times. Fixes bug #30295, added test-166.cs.
22890 2002-09-14 Martin Baulig <martin@gnome.org>
22892 * statement.cs (Block.Emit): Don't emit unreachable code.
22893 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22894 `break' statements.
22895 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22897 2002-09-14 Martin Baulig <martin@gnome.org>
22899 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22902 2002-09-14 Martin Baulig <martin@gnome.org>
22904 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22905 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22906 be false on the ms runtime.
22908 2002-09-13 Martin Baulig <martin@gnome.org>
22910 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22911 the CS0038 error message.
22913 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22915 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22916 constant inside, return it.
22918 2002-09-12 Martin Baulig <martin@gnome.org>
22920 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22921 implicit conversion can be done between enum types.
22923 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22924 check whether an implicit conversion to the current enum's UnderlyingType
22925 exists and report an error if not.
22927 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22928 without debugging support.
22930 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22931 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22933 2002-09-12 Martin Baulig <martin@gnome.org>
22935 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22937 * ecore.cs (IMemberExpr.DeclaringType): New property.
22938 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22939 nonstatic member of an outer type (CS0038).
22941 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22943 * driver.cs: Activate the using-error detector at warning level
22944 4 (at least for MS-compatible APIs).
22946 * namespace.cs (VerifyUsing): Small buglett fix.
22948 * pending.cs (PendingImplementation): pass the container pointer.
22950 * interface.cs (GetMethods): Allow for recursive definition. Long
22951 term, I would like to move every type to support recursive
22952 definitions, not the current ordering mechanism that we have right
22955 The situation is this: Attributes are handled before interfaces,
22956 so we can apply attributes to interfaces. But some attributes
22957 implement interfaces, we will now handle the simple cases
22958 (recursive definitions will just get an error).
22960 * parameter.cs: Only invalidate types at the end if we fail to
22963 2002-09-09 Martin Baulig <martin@gnome.org>
22965 * ecore.cs (PropertyExpr.Emit): Also check for
22966 TypeManager.system_int_array_get_length so this'll also work when
22967 compiling corlib. Fixes #30003.
22969 2002-09-09 Martin Baulig <martin@gnome.org>
22971 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22972 and throw an exception if we can't get the type's size. Fixed #30040,
22975 2002-09-09 Martin Baulig <martin@gnome.org>
22977 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22979 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22980 context. Fixes bug #30027.
22982 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22983 virtual functions. Fixes bug #30043, added test-164.cs.
22985 2002-09-08 Ravi Pratap <ravi@ximian.com>
22987 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22989 2002-09-08 Nick Drochak <ndrochak@gol.com>
22991 * driver.cs: Use an object to get the windows codepage since it's not a
22994 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22996 * statement.cs (For.Emit): for infinite loops (test == null)
22997 return whether there is a break inside, not always "true".
22999 * namespace.cs (UsingEntry): New struct to hold the name of the
23000 using definition, the location where it is defined, and whether it
23001 has been used in a successful type lookup.
23003 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23008 2002-09-06 Ravi Pratap <ravi@ximian.com>
23010 * attribute.cs : Fix incorrect code which relied on catching
23011 a NullReferenceException to detect a null being passed in
23012 where an object was expected.
23014 2002-09-06 Miguel de Icaza <miguel@ximian.com>
23016 * statement.cs (Try): flag the catch variable as assigned
23018 * expression.cs (Cast): Simplified by using ResolveType instead of
23019 manually resolving.
23021 * statement.cs (Catch): Fix bug by using ResolveType.
23023 2002-09-06 Ravi Pratap <ravi@ximian.com>
23025 * expression.cs (BetterConversion): Special case for when we have
23026 a NullLiteral as the argument and we have to choose between string
23027 and object types - we choose string the way csc does.
23029 * attribute.cs (Attribute.Resolve): Catch the
23030 NullReferenceException and report error #182 since the Mono
23031 runtime no more has the bug and having this exception raised means
23032 we tried to select a constructor which takes an object and is
23035 2002-09-05 Ravi Pratap <ravi@ximian.com>
23037 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23038 message (1502, 1503) when we can't locate a method after overload
23039 resolution. This is much more informative and closes the bug
23042 * interface.cs (PopulateMethod): Return if there are no argument
23043 types. Fixes a NullReferenceException bug.
23045 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23046 expressions too. Previously we were checking only in one place for
23047 positional arguments leaving out named arguments.
23049 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23050 type to the enum type is not allowed. Remove code corresponding to
23053 (ConvertNumericExplicit): Allow explicit conversions from
23054 the underlying type to enum type. This precisely follows the spec
23055 and closes a bug filed by Gonzalo.
23057 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23060 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23062 2002-09-03 Miguel de Icaza <miguel@ximian.com>
23064 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23065 it was important that we stored the right value after the
23066 reduction in `converted'.
23068 2002-09-04 Martin Baulig <martin@gnome.org>
23070 * location.cs (Location.SymbolDocument): Use full pathnames for the
23073 2002-08-30 Miguel de Icaza <miguel@ximian.com>
23075 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23076 of the expression resolve mechanism, because that will catch the
23077 SimpleName error failures.
23079 (Conditional): If we can not resolve the
23080 expression, return, do not crash.
23082 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23085 (location): display token name instead of its number.
23087 2002-08-28 Martin Baulig <martin@gnome.org>
23089 * expression.cs (Binary.ResolveOperator): Don't silently return
23090 but return an error if an operator cannot be applied between two
23093 2002-08-28 Martin Baulig <martin@gnome.org>
23095 * class.cs (Constructor.Define): Set the permission attributes
23096 correctly instead of making all constructors public.
23098 2002-08-28 Martin Baulig <martin@gnome.org>
23100 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23101 for private members before reporting a CS0103; if we find anything,
23104 2002-08-28 Martin Baulig <martin@gnome.org>
23106 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23107 to check whether `closure_start_type == closure_invocation_type',
23108 we also need to check whether `m.DeclaringType == closure_invocation_type'
23109 before bypassing the permission checks. We might be accessing
23110 protected/private members from the base class.
23111 (TypeManager.RealMemberLookup): Only set private_ok if private
23112 members were requested via BindingFlags.NonPublic.
23114 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23116 * expression.cs (MemberAccess.ResolveMemberAccess): Set
23117 MethodGroupExpr.IsExplicitImpl if appropriate.
23118 (Invocation.DoResolve): Don't report the CS0120 for explicit
23119 interface implementations.
23121 2002-08-27 Martin Baulig <martin@gnome.org>
23123 * expression.cs (Invocation.DoResolve): If this is a static
23124 method and we don't have an InstanceExpression, we must report
23127 2002-08-25 Martin Baulig <martin@gnome.org>
23129 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23130 `==' between a valuetype and an object.
23132 2002-08-25 Miguel de Icaza <miguel@ximian.com>
23134 * ecore.cs (TypeExpr): Provide a ToString method.
23136 2002-08-24 Martin Baulig <martin@gnome.org>
23138 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23139 now called proggie.dbg and it's a binary file.
23141 2002-08-23 Martin Baulig <martin@gnome.org>
23143 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23145 2002-08-23 Martin Baulig <martin@gnome.org>
23147 * struct.cs (MyStructInfo.ctor): Make this work with empty
23148 structs; it's not allowed to use foreach() on null.
23150 2002-08-23 Martin Baulig <martin@gnome.org>
23152 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23153 writer the full pathname of the generated assembly.
23155 2002-08-23 Martin Baulig <martin@gnome.org>
23157 * statements.cs (FlowBranching.UsageVector.MergeChildren):
23158 A `finally' block never returns or breaks; improved handling of
23161 2002-08-23 Martin Baulig <martin@gnome.org>
23163 * statement.cs (Throw.Resolve): Allow `throw null'.
23165 2002-08-23 Martin Baulig <martin@gnome.org>
23167 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23168 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23169 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
23170 MemberLookup would return a wrong event if this is an explicit
23171 interface implementation and the class has an event with the same
23174 2002-08-23 Martin Baulig <martin@gnome.org>
23176 * statement.cs (Block.AddChildVariableNames): New public method.
23177 (Block.AddChildVariableName): Likewise.
23178 (Block.IsVariableNameUsedInChildBlock): Likewise.
23179 (Block.AddVariable): Check whether a variable name has already
23180 been used in a child block.
23182 * cs-parser.jay (declare_local_variables): Mark all variable names
23183 from the current block as being used in a child block in the
23186 2002-08-23 Martin Baulig <martin@gnome.org>
23188 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23189 find the symbol writer.
23191 * driver.cs: csc also allows the arguments to /define being
23192 separated by commas, not only by semicolons.
23194 2002-08-23 Martin Baulig <martin@gnome.org>
23196 * interface.cs (Interface.GetMembers): Added static check for events.
23198 2002-08-15 Martin Baulig <martin@gnome.org>
23200 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23201 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23203 * ecore.cs (Expression.MemberLookup): Added documentation and explained
23204 why the MethodData.EmitDestructor() change was necessary.
23206 2002-08-20 Martin Baulig <martin@gnome.org>
23208 * class.cs (TypeContainer.FindMembers): Added static check for events.
23210 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23212 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23213 use Type.GetEvents(), not Type.FindMembers().
23215 2002-08-20 Martin Baulig <martin@gnome.org>
23217 * decl.cs (MemberCache): Added a special method cache which will
23218 be used for method-only searched. This ensures that a method
23219 search will return a MethodInfo with the correct ReflectedType for
23222 2002-08-20 Martin Baulig <martin@gnome.org>
23224 * decl.cs (DeclSpace.FindMembers): Made this public.
23226 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23228 * delegate.cs: fixed build on windows.
23229 [FIXME: Filed as bug #29150: MCS must report these errors.]
23231 2002-08-19 Ravi Pratap <ravi@ximian.com>
23233 * ecore.cs (StandardConversionExists): Return a false
23234 if we are trying to convert the void type to anything else
23235 since that is not allowed.
23237 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23238 we flag error 70 in the event an event is trying to be accessed
23239 directly from outside the declaring type.
23241 2002-08-20 Martin Baulig <martin@gnome.org>
23243 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23244 MemberCache from typemanager.cs to decl.cs.
23246 2002-08-19 Martin Baulig <martin@gnome.org>
23248 * class.cs (TypeContainer): Implement IMemberContainer.
23249 (TypeContainer.DefineMembers): Create the MemberCache.
23250 (TypeContainer.FindMembers): Do better BindingFlags checking; only
23251 return public members if BindingFlags.Public was given, check
23252 whether members are static.
23254 2002-08-16 Martin Baulig <martin@gnome.org>
23256 * decl.cs (DeclSpace.Define): Splitted this in Define and
23257 DefineMembers. DefineMembers is called first and initializes the
23260 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
23261 DefineMembers() on all our DeclSpaces.
23263 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23264 but call DefineMembers() on all nested interfaces. We call their
23265 Define() in our new Define() function.
23267 * interface.cs (Interface): Implement IMemberContainer.
23268 (Interface.Define): Moved all code except the attribute stuf to
23270 (Interface.DefineMembers): Initialize the member cache.
23272 * typemanager.cs (IMemberFinder): Removed this interface, we don't
23273 need this anymore since we can use MemberCache.FindMembers directly.
23275 2002-08-19 Martin Baulig <martin@gnome.org>
23277 * typemanager.cs (MemberCache): When creating the cache for an
23278 interface type, add all inherited members.
23279 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23280 to `out bool used_cache' and documented it.
23281 (TypeManager.MemberLookup): If we already used the cache in the first
23282 iteration, we don't need to do the interfaces check.
23284 2002-08-19 Martin Baulig <martin@gnome.org>
23286 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
23287 here from IMemberFinder and don't implement this interface anymore.
23288 (DeclSpace.MemberCache): Moved here from IMemberFinder.
23290 * typemanager.cs (IMemberFinder): This interface is now only used by
23291 classes which actually support the member cache.
23292 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23293 since we only put DeclSpaces into this Hashtable.
23294 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23295 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23297 2002-08-16 Martin Baulig <martin@gnome.org>
23299 * typemanager.cs (ICachingMemberFinder): Removed.
23300 (IMemberFinder.MemberCache): New property.
23301 (TypeManager.FindMembers): Merged this with RealFindMembers().
23302 This function will never be called from TypeManager.MemberLookup()
23303 so we can't use the cache here, just the IMemberFinder.
23304 (TypeManager.MemberLookup_FindMembers): Check whether the
23305 IMemberFinder has a MemberCache and call the cache's FindMembers
23307 (MemberCache): Rewrote larger parts of this yet another time and
23308 cleaned it up a bit.
23310 2002-08-15 Miguel de Icaza <miguel@ximian.com>
23312 * driver.cs (LoadArgs): Support quoting.
23314 (Usage): Show the CSC-like command line arguments.
23316 Improved a few error messages.
23318 2002-08-15 Martin Baulig <martin@gnome.org>
23320 * typemanager.cs (IMemberContainer.Type): New property.
23321 (IMemberContainer.IsInterface): New property.
23323 The following changes are conditional to BROKEN_RUNTIME, which is
23324 defined at the top of the file.
23326 * typemanager.cs (MemberCache.MemberCache): Don't add the base
23327 class'es members, but add all members from TypeHandle.ObjectType
23328 if we're an interface.
23329 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23330 is the current type.
23331 (MemberCache.CacheEntry.Container): Removed this field.
23332 (TypeHandle.GetMembers): Include inherited members.
23334 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23336 * typemanager.cs: fixed compilation and added a comment on a field that
23339 2002-08-15 Martin Baulig <martin@gnome.org>
23341 * class.cs (ConstructorInitializer.Resolve): In the
23342 Expression.MemberLookup call, use the queried_type as
23345 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23346 declared' attribute, it's always true.
23347 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23348 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23349 temporary wrapper for FindMembers which tells MemberLookup whether
23350 members from the base classes are included in the return value.
23351 This will go away soon.
23352 (TypeManager.MemberLookup): Use this temporary hack here; once the
23353 new MemberCache is completed, we don't need to do the DeclaredOnly
23354 looping here anymore since the MemberCache will take care of this.
23355 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23356 (MemberCache): When creating the MemberCache for a class, get
23357 members from the current class and all its base classes.
23358 (MemberCache.CacheEntry.Container): New field. This is a
23359 temporary hack until the Mono runtime is fixed to distinguish
23360 between ReflectedType and DeclaringType. It allows us to use MCS
23361 with both the MS runtime and the unfixed Mono runtime without
23362 problems and without accecting performance.
23363 (MemberCache.SearchMembers): The DeclaredOnly looping from
23364 TypeManager.MemberLookup is now done here.
23366 2002-08-14 Martin Baulig <martin@gnome.org>
23368 * statement.cs (MyStructInfo.MyStructInfo): Don't call
23369 Type.GetFields on dynamic types but get the fields from the
23370 corresponding TypeContainer.
23371 (MyStructInfo.GetStructInfo): Added check for enum types.
23373 * typemanager.cs (MemberList.IsSynchronized): Implemented.
23374 (MemberList.SyncRoot): Implemented.
23375 (TypeManager.FilterWithClosure): No need to check permissions if
23376 closure_start_type == closure_invocation_type, don't crash if
23377 closure_invocation_type is null.
23379 2002-08-13 Martin Baulig <martin@gnome.org>
23381 Rewrote TypeContainer.FindMembers to use a member cache. This
23382 gives us a speed increase of about 35% for the self-hosting MCS
23383 build and of about 15-20% for the class libs (both on GNU/Linux).
23385 * report.cs (Timer): New class to get enhanced profiling. This
23386 whole class is "TIMER" conditional since it remarkably slows down
23389 * class.cs (MemberList): New class. This is an IList wrapper
23390 which we're now using instead of passing MemberInfo[]'s around to
23391 avoid copying this array unnecessarily.
23392 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23393 (ICachingMemberFinder, IMemberContainer): New interface.
23394 (TypeManager.FilterWithClosure): If `criteria' is null, the name
23395 has already been checked, otherwise use it for the name comparision.
23396 (TypeManager.FindMembers): Renamed to RealMemberFinder and
23397 provided wrapper which tries to use ICachingMemberFinder.FindMembers
23398 if possible. Returns a MemberList, not a MemberInfo [].
23399 (TypeHandle): New class, implements IMemberContainer. We create
23400 one instance of this class per type, it contains a MemberCache
23401 which is used to do the member lookups.
23402 (MemberCache): New class. Each instance of this class contains
23403 all members of a type and a name-based hash table.
23404 (MemberCache.FindMembers): This is our new member lookup
23405 function. First, it looks up all members of the requested name in
23406 the hash table. Then, it walks this list and sorts out all
23407 applicable members and returns them.
23409 2002-08-13 Martin Baulig <martin@gnome.org>
23411 In addition to a nice code cleanup, this gives us a performance
23412 increase of about 1.4% on GNU/Linux - not much, but it's already
23413 half a second for the self-hosting MCS compilation.
23415 * typemanager.cs (IMemberFinder): New interface. It is used by
23416 TypeManager.FindMembers to call FindMembers on a TypeContainer,
23417 Enum, Delegate or Interface.
23418 (TypeManager.finder_to_member_finder): New PtrHashtable.
23419 (TypeManager.finder_to_container): Removed.
23420 (TypeManager.finder_to_delegate): Removed.
23421 (TypeManager.finder_to_interface): Removed.
23422 (TypeManager.finder_to_enum): Removed.
23424 * interface.cs (Interface): Implement IMemberFinder.
23426 * delegate.cs (Delegate): Implement IMemberFinder.
23428 * enum.cs (Enum): Implement IMemberFinder.
23430 * class.cs (TypeContainer): Implement IMemberFinder.
23432 2002-08-12 Martin Baulig <martin@gnome.org>
23434 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23436 2002-08-12 Martin Baulig <martin@gnome.org>
23438 * ecore.cs (ITypeExpression): New interface for expressions which
23440 (TypeExpression): Renamed to TypeLookupExpression.
23441 (Expression.DoResolve): If we're doing a types-only lookup, the
23442 expression must implement the ITypeExpression interface and we
23443 call DoResolveType() on it.
23444 (SimpleName): Implement the new ITypeExpression interface.
23445 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23446 hack, the situation that we're only looking up types can't happen
23447 anymore when this method is called. Moved the type lookup code to
23448 DoResolveType() and call it.
23449 (SimpleName.DoResolveType): This ITypeExpression interface method
23450 is now doing the types-only lookup.
23451 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23452 (ResolveFlags): Added MaskExprClass.
23454 * expression.cs (MemberAccess): Implement the ITypeExpression
23456 (MemberAccess.DoResolve): Added support for a types-only lookup
23457 when we're called via ITypeExpression.DoResolveType().
23458 (ComposedCast): Implement the ITypeExpression interface.
23460 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
23461 Expression.Resolve() with ResolveFlags.Type instead.
23463 2002-08-12 Martin Baulig <martin@gnome.org>
23465 * interface.cs (Interface.Define): Apply attributes.
23467 * attribute.cs (Attribute.ApplyAttributes): Added support for
23468 interface attributes.
23470 2002-08-11 Martin Baulig <martin@gnome.org>
23472 * statement.cs (Block.Emit): Only check the "this" variable if we
23473 do not always throw an exception.
23475 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23476 whether the property has a set accessor.
23478 2002-08-11 Martin Baulig <martin@gnome.org>
23480 Added control flow analysis support for structs.
23482 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23483 with control flow analysis turned off.
23484 (IVariable): New interface.
23485 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23486 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23487 (FieldExpr.DoResolve): Resolve the instance expression with flow
23488 analysis turned off and do the definite assignment check after the
23489 resolving when we know what the expression will resolve to.
23491 * expression.cs (LocalVariableReference, ParameterReference):
23492 Implement the new IVariable interface, only call the flow analysis
23493 code if ec.DoFlowAnalysis is true.
23494 (This): Added constructor which takes a Block argument. Implement
23495 the new IVariable interface.
23496 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23497 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23498 This does the definite assignment checks for struct members.
23500 * class.cs (Constructor.Emit): If this is a non-static `struct'
23501 constructor which doesn't have any initializer, call
23502 Block.AddThisVariable() to tell the flow analysis code that all
23503 struct elements must be initialized before control returns from
23506 * statement.cs (MyStructInfo): New public class.
23507 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23508 argument to this indexer. If non-zero, check an individual struct
23509 member, not the whole struct.
23510 (FlowBranching.CheckOutParameters): Check struct members.
23511 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23512 overloaded versions of these methods which take an additional
23513 `int field_idx' argument to check struct members.
23514 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23515 overloaded versions of these methods which take an additional
23516 `string field_name' argument to check struct member.s
23517 (VariableInfo): Implement the IVariable interface.
23518 (VariableInfo.StructInfo): New public property. Returns the
23519 MyStructInfo instance of the variable if it's a struct or null.
23520 (Block.AddThisVariable): New public method. This is called from
23521 Constructor.Emit() for non-static `struct' constructor which do
23522 not have any initializer. It creates a special variable for the
23523 "this" instance variable which will be checked by the flow
23524 analysis code to ensure that all of the struct's fields are
23525 initialized before control returns from the constructor.
23526 (UsageVector): Added support for struct members. If a
23527 variable/parameter is a struct with N members, we reserve a slot
23528 in the usage vector for each member. A struct is considered fully
23529 initialized if either the struct itself (slot 0) or all its
23530 members are initialized.
23532 2002-08-08 Martin Baulig <martin@gnome.org>
23534 * driver.cs (Driver.MainDriver): Only report an error CS5001
23535 if there were no compilation errors.
23537 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23538 `UnsafeContext' property to determine whether the parent is in
23539 unsafe context rather than checking the parent's ModFlags:
23540 classes nested in an unsafe class are unsafe as well.
23542 2002-08-08 Martin Baulig <martin@gnome.org>
23544 * statement.cs (UsageVector.MergeChildren): Distinguish between
23545 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23546 we return. Added test17() and test18() to test-154.cs.
23548 2002-08-08 Martin Baulig <martin@gnome.org>
23550 * typemanager.cs (TypeManager.FilterWithClosure): If we have
23551 Family access, make sure the invoking type isn't a subclass of the
23552 queried type (that'd be a CS1540).
23554 * ecore.cs (Expression.MemberLookup): Added overloaded version of
23555 this method which takes an additional `Type invocation_type'.
23557 * expression.cs (BaseAccess.DoResolve): Use the base type as
23558 invocation and query type.
23559 (MemberAccess.DoResolve): If the lookup failed and we're about to
23560 report a CS0122, try a lookup with the ec.ContainerType - if this
23561 succeeds, we must report a CS1540.
23563 2002-08-08 Martin Baulig <martin@gnome.org>
23565 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23566 (MethodGroupExpr): Implement the IMemberExpr interface.
23568 * expression (MemberAccess.ResolveMemberAccess): No need to have
23569 any special code for MethodGroupExprs anymore, they're now
23572 2002-08-08 Martin Baulig <martin@gnome.org>
23574 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23575 Family, FamANDAssem and FamORAssem permissions.
23576 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23578 2002-08-08 Martin Baulig <martin@gnome.org>
23580 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23581 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23584 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23586 * driver.cs: implemented /resource option to embed managed resources.
23588 2002-08-07 Martin Baulig <martin@gnome.org>
23590 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23591 (FieldBase.HasFieldInitializer): New public property.
23592 (FieldBase.GetInitializerExpression): New public method. Resolves and
23593 returns the field initializer and makes sure it is only resolved once.
23594 (TypeContainer.EmitFieldInitializers): Call
23595 FieldBase.GetInitializerExpression to get the initializer, this ensures
23596 that it isn't resolved multiple times.
23598 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23599 the resolving process (SimpleName/MemberLookup) that we're currently
23600 emitting a field initializer (which must not access any instance members,
23601 this is an error CS0236).
23603 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23604 argument, if the `IsFieldInitializer' flag is set, we must report and
23605 error CS0236 and not an error CS0120.
23607 2002-08-07 Martin Baulig <martin@gnome.org>
23609 * ecore.cs (IMemberExpr): New public interface.
23610 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23611 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23612 if the expression is an IMemberExpr.
23614 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23615 to be null, implicitly default to `this' if we're non-static in
23616 this case. Simplified the code a lot by using the new IMemberExpr
23617 interface. Also fixed bug #28176 here.
23619 2002-08-06 Martin Baulig <martin@gnome.org>
23621 * cs-parser.jay (SimpleLookup): Removed. We need to create
23622 ParameterReferences during semantic analysis so that we can do a
23623 type-only search when resolving Cast, TypeOf and SizeOf.
23624 (block): Pass the `current_local_parameters' to the Block's
23627 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23628 argument to the constructor.
23629 (ConstructorInitializer.Resolve): Create a temporary implicit
23630 block with the parameters.
23632 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23633 references here if we aren't doing a type-only search.
23635 * statement.cs (Block): Added constructor which takes a
23636 `Parameters parameters' argument.
23637 (Block.Parameters): New public property.
23639 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23640 to `Parameters' and made it public readonly.
23642 2002-08-06 Martin Baulig <martin@gnome.org>
23644 * ecore.cs (Expression.Warning): Made this public as well.
23646 * report.cs (Report.Debug): Print the contents of collections.
23648 2002-08-06 Martin Baulig <martin@gnome.org>
23650 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23651 used to tell Resolve() which kinds of expressions it may return.
23652 (Expression.Resolve): Added overloaded version of this method which
23653 takes a `ResolveFlags flags' argument. This can be used to tell
23654 Resolve() which kinds of expressions it may return. Reports a
23656 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23657 ResolveFlags.SimpleName.
23658 (Expression.Error118): Added overloaded version of this method which
23659 takes a `ResolveFlags flags' argument. It uses the flags to determine
23660 which kinds of expressions are allowed.
23662 * expression.cs (Argument.ResolveMethodGroup): New public method.
23663 Resolves an argument, but allows a MethodGroup to be returned.
23664 This is used when invoking a delegate.
23666 * TODO: Updated a bit.
23668 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23670 Fixed compilation with csc.
23672 * ecore.cs: Expression.Error made public. Is this correct? Should
23673 Warning be made public too?
23675 * expression.cs: use ea.Location instead of ea.loc.
23676 [FIXME: Filed as bug #28607: MCS must report these errors.]
23678 2002-08-06 Martin Baulig <martin@gnome.org>
23680 * ecore.cs (Expression.loc): Moved the location here instead of
23681 duplicating it in all derived classes.
23682 (Expression.Location): New public property.
23683 (Expression.Error, Expression.Warning): Made them non-static and
23684 removed the location argument.
23685 (Expression.Warning): Added overloaded version which takes an
23686 `int level' argument.
23687 (Expression.Error118): Make this non-static and removed the
23688 expression and location arguments.
23689 (TypeExpr): Added location argument to the constructor.
23691 * expression.cs (StaticCallExpr): Added location argument to
23693 (Indirection, PointerArithmetic): Likewise.
23694 (CheckedExpr, UnCheckedExpr): Likewise.
23695 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23696 (StringPtr): Likewise.
23699 2002-08-05 Martin Baulig <martin@gnome.org>
23701 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23703 * assign.cs (Assign.DoResolve): Check whether the source
23704 expression is a value or variable.
23706 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23707 while resolving the corresponding blocks.
23709 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23710 an error, don't silently return null.
23712 * statement.cs (Block.AddVariable): Do the error reporting here
23713 and distinguish between CS0128 and CS0136.
23714 (Block.DoResolve): Report all unused labels (warning CS0164).
23715 (LabeledStatement): Pass the location to the constructor.
23716 (LabeledStatement.HasBeenReferenced): New property.
23717 (LabeledStatement.Resolve): Set it to true here.
23719 * statement.cs (Return.Emit): Return success even after reporting
23720 a type mismatch error (CS0126 or CS0127), this is what csc does and
23721 it avoids confusing the users with any consecutive errors.
23723 2002-08-05 Martin Baulig <martin@gnome.org>
23725 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23727 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23729 * expression.cs (MemberAccess.DoResolve): Silently return if an
23730 error has already been reported.
23732 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23733 error has already been reported.
23735 2002-08-05 Martin Baulig <martin@gnome.org>
23737 * statement.cs (UsageVector): Only initialize the `parameters'
23738 vector if we actually have any "out" parameters.
23740 2002-08-05 Martin Baulig <martin@gnome.org>
23742 * expression.cs (Binary.ResolveOperator): When combining delegates,
23743 they must have the same type.
23745 2002-08-05 Martin Baulig <martin@gnome.org>
23747 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23748 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23749 work with the ms runtime and we also don't need it: if we're a
23750 PropertyBuilder and not in the `indexer_arguments' hash, then we
23751 are a property and not an indexer.
23753 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23754 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23755 since the latter one doesn't work with the ms runtime.
23757 2002-08-03 Martin Baulig <martin@gnome.org>
23759 Fixed bugs #27998 and #22735.
23761 * class.cs (Method.IsOperator): New public field.
23762 (Method.CheckBase): Report CS0111 if there's already a method
23763 with the same parameters in the current class. Report CS0508 when
23764 attempting to change the return type of an inherited method.
23765 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23766 and it's not marked abstract or extern.
23767 (PropertyBase): New abstract base class for Property and Indexer.
23768 (PropertyBase.CheckBase): Moved here from Property and made it work
23770 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23771 the same so we can reuse it there.
23772 (Property, Indexer): Derive from PropertyBase.
23773 (MethodSignature.inheritable_property_signature_filter): New delegate
23774 to find properties and indexers.
23776 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23777 argument and improved error reporting.
23779 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23780 EmptyReadOnlyParameters and made it a property.
23782 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23783 version of this method which takes a `PropertyInfo indexer'.
23784 (TypeManager.RegisterIndexer): New method.
23786 * class.cs: Added myself as author of this file :-)
23788 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23790 * class.cs: fixed compilation on windoze.
23792 2002-08-03 Martin Baulig <martin@gnome.org>
23794 * interface.cs (Interface.GetInterfaceBases): Check whether all
23795 base interfaces are at least as accessible than the current one.
23797 * class.cs (TypeContainer.GetClassBases): Check whether base types
23798 are at least as accessible than the current type.
23799 (TypeContainer.AsAccessible): Implemented and made non-static.
23800 (MemberBase.CheckParameters): Report errors if the accessibility
23803 * delegate.cs (Delegate.Delegate): The default visibility is
23804 internal for top-level types and private for nested types.
23805 (Delegate.Define): Report errors if the accessibility checks fail.
23807 * enum.cs (Enum.Enum): The default visibility is internal for
23808 top-level types and private for nested types.
23809 (Enum.DefineType): Compute the correct visibility.
23811 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23812 function which takes a `bool is_toplevel' instead of a TypeContainer.
23814 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23817 2002-08-02 Martin Baulig <martin@gnome.org>
23819 * expression.cs (LocalVariableReferenc): Added constructor which
23820 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23821 (LocalVariableReference.IsReadOnly): New property.
23822 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23823 variable is readonly, use our own readonly flag to do this; you can
23824 use the new constructor to get a writable reference to a read-only
23827 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23828 reference to the local variable.
23830 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23832 * rootcontext.cs (ResolveCore): Also include System.Exception
23834 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23835 we reach an EmptyStatement.
23837 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23840 * expression.cs (Binary.ResolveOperator): Check error result in
23843 use brtrue/brfalse directly and avoid compares to null.
23845 2002-08-02 Martin Baulig <martin@gnome.org>
23847 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23848 Fixes bug #28407, added test-155.cs.
23850 2002-08-01 Martin Baulig <martin@gnome.org>
23852 * class.cs (Event.EmitDefaultMethod): Make this work with static
23853 events. Fixes #28311, added verify-3.cs.
23855 2002-08-01 Martin Baulig <martin@gnome.org>
23857 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23858 `is_disposable' fields.
23859 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23860 `hm.is_disposable' if we're using the collection pattern.
23861 (Foreach.EmitCollectionForeach): Use the correct type for the
23862 enumerator's local variable, only emit the try/finally block if
23863 necessary (fixes #27713).
23865 2002-08-01 Martin Baulig <martin@gnome.org>
23867 * ecore.cs (Expression.report118): Renamed to Error118 and made
23870 * statement.cs (Throw.Resolve): Check whether the expression is of
23871 the correct type (CS0118) and whether the type derives from
23872 System.Exception (CS0155).
23873 (Catch.Resolve): New method. Do the type lookup here and check
23874 whether it derives from System.Exception (CS0155).
23875 (Catch.CatchType, Catch.IsGeneral): New public properties.
23877 * typemanager.cs (TypeManager.exception_type): Added.
23879 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23881 * driver.cs: Updated About function.
23883 2002-07-31 Martin Baulig <martin@gnome.org>
23885 Implemented Control Flow Analysis.
23887 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23888 (EmitContext.CurrentBranching): Added.
23889 (EmitContext.StartFlowBranching): Added.
23890 (EmitContext.EndFlowBranching): Added.
23891 (EmitContext.KillFlowBranching): Added.
23892 (EmitContext.IsVariableAssigned): Added.
23893 (EmitContext.SetVariableAssigned): Added.
23894 (EmitContext.IsParameterAssigned): Added.
23895 (EmitContext.SetParameterAssigned): Added.
23896 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23897 Added control flow analysis stuff here.
23899 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23900 resolve the expression as lvalue.
23901 (LocalVariableReference.DoResolve): Check whether the variable has
23902 already been assigned.
23903 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23904 the parameter as assigned here.
23905 (ParameterReference.DoResolve): Check whether the parameter has already
23907 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23908 expression as lvalue.
23910 * statement.cs (FlowBranching): New class for the flow analysis code.
23911 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23912 (LabeledStatement.IsDefined): New public property.
23913 (LabeledStatement.AddUsageVector): New public method to tell flow
23914 analyis that the label may be reached via a forward jump.
23915 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23917 (VariableInfo.Number): New public field. This is used by flow analysis
23918 to number all locals of a block.
23919 (Block.CountVariables): New public property. This is the number of
23920 local variables in this block (including the locals from all parent
23922 (Block.EmitMeta): Number all the variables.
23924 * statement.cs: Added flow analysis support to all classes.
23926 2002-07-31 Martin Baulig <martin@gnome.org>
23928 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23929 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23930 then use this argument.
23932 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23934 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23935 use this to specify /define options.
23937 2002-07-29 Martin Baulig <martin@gnome.org>
23939 * statement.cs (Fixed): Moved all code that does variable lookups
23940 and resolvings from Emit to Resolve.
23942 * statement.cs (For): Moved all code that does variable lookups
23943 and resolvings from Emit to Resolve.
23945 * statement.cs (Using): Moved all code that does variable lookups
23946 and resolvings from Emit to Resolve.
23948 2002-07-29 Martin Baulig <martin@gnome.org>
23950 * attribute.cs (Attribute.Resolve): Explicitly catch a
23951 System.NullReferenceException when creating the
23952 CustromAttributeBuilder and report a different warning message.
23954 2002-07-29 Martin Baulig <martin@gnome.org>
23956 * support.cs (ParameterData.ParameterName): Added method to
23957 get the name of a parameter.
23959 * typemanager.cs (TypeManager.IsValueType): New public method.
23961 2002-07-29 Martin Baulig <martin@gnome.org>
23963 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23964 is a flag which specifies that it's either ref or out.
23965 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23966 the out parameter to `out Parameter.Modifier mod', also set the
23967 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23969 * support.cs (InternalParameters.ParameterModifier): Distinguish
23970 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23971 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23973 * expression.cs (Argument.GetParameterModifier): Distinguish
23974 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23975 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23977 2002-07-29 Martin Baulig <martin@gnome.org>
23979 * expression.cs (ParameterReference.ParameterReference): Added
23980 `Location loc' argument to the constructor.
23982 * cs-parser.jay: Pass location to ParameterReference.
23984 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23986 * statement.cs (Try): Initialize the location.
23988 * cs-parser.jay: pass location to Try.
23990 * expression.cs (Unary.Reduce): Change the prototype to return
23991 whether a constant fold could be performed or not. The result is
23992 returned in an out parameters. In the case of Indirection and
23993 AddressOf, we want to perform the full tests.
23995 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23997 * statement.cs (Statement.Emit): Flag dead code.
23999 2002-07-27 Andrew Birkett <andy@nobugs.org>
24001 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24003 2002-07-27 Martin Baulig <martin@gnome.org>
24005 * class.cs (MethodData.Define): Put back call to
24006 TypeManager.AddMethod(), accidentally commented this out.
24008 * report.cs (Debug): New public method to print debugging information,
24009 this is `[Conditional ("DEBUG")]'.
24011 2002-07-26 Martin Baulig <martin@gnome.org>
24013 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24014 (switch_statement): Push the current_block to the switch_stack and
24015 pop it again when we're done with the switch.
24016 (switch_section): The new block is a child of the current_block.
24017 Fixes bug #24007, added test-152.cs.
24019 2002-07-27 Martin Baulig <martin@gnome.org>
24021 * expression.cs (Invocation.EmitArguments): When calling a varargs
24022 function with only its fixed arguments, we need to pass an empty
24025 2002-07-27 Martin Baulig <martin@gnome.org>
24027 Mono 0.13 has been released.
24029 2002-07-25 Miguel de Icaza <miguel@ximian.com>
24031 * driver.cs: Rename --resource to --linkres, because that is what
24032 we do currently, we dont support --resource yet.
24034 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24036 2002-07-25 Martin Baulig <martin@gnome.org>
24038 * class.cs (MethodData): New public class. This is a `method builder'
24039 class for a method or one accessor of a Property/Indexer/Event.
24040 (MethodData.GetMethodFlags): Moved here from MemberBase.
24041 (MethodData.ApplyAttributes): Likewise.
24042 (MethodData.ApplyObsoleteAttribute): Likewise.
24043 (MethodData.ApplyConditionalAttribute): Likewise.
24044 (MethodData.ApplyDllImportAttribute): Likewise.
24045 (MethodData.CheckAbstractAndExternal): Likewise.
24046 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24047 (MethodData.Emit): Formerly known as Method.Emit().
24048 (MemberBase): Moved everything which was specific to a single
24049 accessor/method to MethodData.
24050 (Method): Create a new MethodData and call Define() and Emit() on it.
24051 (Property, Indexer, Event): Create a new MethodData objects for each
24052 accessor and call Define() and Emit() on them.
24054 2002-07-25 Martin Baulig <martin@gnome.org>
24056 Made MethodCore derive from MemberBase to reuse the code from there.
24057 MemberBase now also checks for attributes.
24059 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24060 (MemberBase.GetMethodFlags): Moved here from class Method and marked
24062 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24063 `CallingConventions cc' and `Attributes opt_attrs' arguments.
24064 (MemberBase.ApplyAttributes): New virtual method; applies the
24065 attributes to a method or accessor.
24066 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24067 (MemberBase.ApplyConditionalAttribute): Likewise.
24068 (MemberBase.ApplyDllImportAttribute): Likewise.
24069 (MemberBase.CheckAbstractAndExternal): Likewise.
24070 (MethodCore.ParameterTypes): This is now a property instead of a
24071 method, it's initialized from DoDefineParameters().
24072 (MethodCore.ParameterInfo): Removed the set accessor.
24073 (MethodCore.DoDefineParameters): New protected virtual method to
24074 initialize ParameterTypes and ParameterInfo.
24075 (Method.GetReturnType): We can now simply return the MemberType.
24076 (Method.GetMethodFlags): Override the MemberBase version and add
24077 the conditional flags.
24078 (Method.CheckBase): Moved some code from Define() here, call
24079 DoDefineParameters() here.
24080 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24081 here to avoid some larger code duplication.
24082 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24083 ensure that abstract and external accessors don't declare a body.
24085 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24086 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24087 lookup in the attribute's parent classes, so we need to abort as soon
24088 as we found the first match.
24089 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24090 the attribute has no arguments.
24092 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24095 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24097 * cs-parser.jay: reverted previous patch.
24099 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24101 * cs-parser.jay: fixed bug #22119.
24103 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24105 * attribute.cs: fixed compilation. The error was:
24106 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
24107 be assigned to before control leaves the current method."
24108 [FIXME: Filed as bug #28186: MCS must report this error.]
24110 2002-07-25 Martin Baulig <martin@gnome.org>
24112 * attribute.cs (Attribute.Conditional_GetConditionName): New static
24113 method to pull the condition name ouf of a Conditional attribute.
24114 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24115 the obsolete message and error flag out of an Obsolete attribute.
24117 * class.cs (Method.GetMethodFlags): New public method to get the
24118 TypeManager.MethodFlags for this method.
24119 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24121 (Method.Define): Get and apply the Obsolete and Conditional attributes;
24122 if we're overriding a virtual function, set the new private variable
24123 `parent_method'; call the new TypeManager.AddMethod().
24125 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
24126 the MethodBuilder and the Method in a PtrHashtable.
24127 (TypeManager.builder_to_method): Added for this purpose.
24128 (TypeManager.MethodFlags): Added IsObsoleteError.
24129 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
24130 Obsolete and Conditional arguments in MethodBuilders. If we discover
24131 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24132 the message from the attribute.
24134 2002-07-24 Martin Baulig <martin@gnome.org>
24136 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24137 preprocessor directives, ensure that the argument to #define/#undef is
24138 exactly one identifier and that it's actually an identifier.
24140 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24143 2002-07-24 Martin Baulig <martin@gnome.org>
24145 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24146 initialize it to TypeManager.object_type in the constructor.
24147 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24148 of the `hm.get_current' method if we're using the collection pattern.
24149 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24150 for the explicit conversion to make it work when we're using the collection
24151 pattern and the `Current' property has a different return type than `object'.
24154 2002-07-24 Martin Baulig <martin@gnome.org>
24156 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24157 does not match, but don't report any errors. This method is called in
24158 order for all methods in a MethodGroupExpr until a matching method is
24159 found, so we don't want to bail out if the first method doesn't match.
24160 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24161 matches, report the 123. Fixes #28070.
24163 2002-07-24 Martin Baulig <martin@gnome.org>
24165 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24166 TypeManager.TypeToCoreType() to the top of the method so the
24167 following equality checks will work. Fixes #28107.
24169 2002-07-24 Martin Baulig <martin@gnome.org>
24171 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24172 operand is of type uint, and the other operand is of type sbyte,
24173 short or int, the operands are converted to type long." -
24174 Actually do what this comment already told us. Fixes bug #28106,
24177 2002-07-24 Martin Baulig <martin@gnome.org>
24179 * class.cs (MethodBase): New abstract class. This is now a base
24180 class for Property, Indexer and Event to avoid some code duplication
24181 in their Define() and DefineMethods() methods.
24182 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24183 generic methods for Define() and DefineMethods().
24184 (FieldBase): Derive from MemberBase, not MemberCore.
24185 (Property): Derive from MemberBase, not MemberCore.
24186 (Property.DefineMethod): Moved all the code from this method to the
24187 new MethodBase.DefineAccessor(), just call it with appropriate
24189 (Property.Define): Call the new Property.DoDefine(), this does some
24190 sanity checks and we don't need to duplicate the code everywhere.
24191 (Event): Derive from MemberBase, not MemberCore.
24192 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24193 accessors, this will also make them work with interface events.
24194 (Indexer): Derive from MemberBase, not MemberCore.
24195 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24196 (Indexer.Define): Use the new MethodBase functions.
24198 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24199 argument to the constructor.
24200 (Interface.FindMembers): Added support for interface events.
24201 (Interface.PopluateEvent): Implemented.
24203 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
24205 2002-07-22 Miguel de Icaza <miguel@ximian.com>
24207 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24208 but this is required to check for a method name being the same as
24209 the containing class.
24213 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24215 * interface.cs: initialize variable.
24217 2002-07-23 Martin Baulig <martin@gnome.org>
24219 Implemented the IndexerName attribute in interfaces.
24221 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24222 name if this is an explicit interface implementation.
24223 (Indexer.InterfaceIndexerName): New public variable. If we're
24224 implementing an interface indexer, this is the IndexerName in that
24225 interface. Otherwise, it's the IndexerName.
24226 (Indexer.DefineMethod): If we're implementing interface indexer,
24227 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
24228 and Pending.ImplementIndexer methods.
24229 (Indexer.Define): Also define the PropertyBuilder if we're
24230 implementing an interface indexer and this is neither an explicit
24231 interface implementation nor do the IndexerName match the one in
24234 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24235 If a method is defined here, then we always need to create a proxy
24236 for it. This is used when implementing interface indexers.
24237 (Pending.IsInterfaceIndexer): New public method.
24238 (Pending.ImplementIndexer): New public method.
24239 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24240 This is used when implementing interface indexers to define a proxy
24242 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24243 define a proxy if necessary.
24245 * interface.cs (Interface.IndexerName): New public variable.
24246 (Interface.PopulateIndexer): Set the IndexerName.
24247 (Interface.DefineIndexers): New private method. Populate all the
24248 indexers and make sure their IndexerNames match.
24250 * typemanager.cs (IndexerPropertyName): Added support for interface
24253 2002-07-22 Martin Baulig <martin@gnome.org>
24255 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24256 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24257 ret if HasReturnLabel.
24258 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24261 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24262 and set the ec.LoopBeginTryCatchLevel.
24263 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24264 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24265 the current ec.TryCatchLevel, the branch goes out of an exception
24266 block. In this case, we need to use Leave and not Br.
24268 2002-07-22 Martin Baulig <martin@gnome.org>
24270 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24271 block unless the block does not always return or it is contained in
24272 another try { ... } catch { ... } block. Fixes bug #26506.
24273 Added verify-1.cs to the test suite.
24275 2002-07-22 Martin Baulig <martin@gnome.org>
24277 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24278 then we do not always return. Fixes bug #24985.
24280 2002-07-22 Martin Baulig <martin@gnome.org>
24282 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24283 lookup on a per-class level; ie. walk up the class hierarchy until we
24284 found at least one applicable method, then choose the best among them.
24285 Fixes bug #24463 and test-29.cs.
24287 2002-07-22 Martin Baulig <martin@gnome.org>
24289 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24290 return types of the methods. The return type is not part of the
24291 signature and we must not check it to make the `new' modifier work.
24292 Fixes bug #27999, also added test-147.cs.
24293 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24295 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24296 on the method's return type.
24298 2002-07-21 Martin Baulig <martin@gnome.org>
24300 * assign.cs: Make this work if the rightmost source is a constant and
24301 we need to do an implicit type conversion. Also adding a few more tests
24302 to test-38.cs which should have caught this.
24304 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24305 target in the makefile for this. The makefile.gnu is primarily intended
24306 for end-users who don't want to debug the compiler.
24308 2002-07-21 Martin Baulig <martin@gnome.org>
24310 * assign.cs: Improved the Assign class so it can now handle embedded
24311 assignments (X = Y = Z = something). As a side-effect this'll now also
24312 consume less local variables. test-38.cs now passes with MCS, added
24313 a few new test cases to that test.
24315 2002-07-20 Martin Baulig <martin@gnome.org>
24317 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24318 instructions. Fixes bug #27977, also added test-146.cs.
24320 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24322 * cs-tokenizer.cs: fixed getHex ().
24324 2002-07-19 Martin Baulig <martin@gnome.org>
24326 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24327 not Type.GetType() to lookup the array type. This is needed when
24328 we're constructing an array of a user-defined type.
24329 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24330 single-dimensional arrays, but also for single-dimensial arrays of
24333 2002-07-19 Martin Baulig <martin@gnome.org>
24335 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24336 this function is called, it's not allowed to share LocalBuilders
24337 among ILGenerators.
24339 2002-07-19 Martin Baulig <martin@gnome.org>
24341 * expression.cs (Argument.Resolve): Report an error 118 when trying
24342 to pass a type as argument.
24344 2002-07-18 Martin Baulig <martin@gnome.org>
24346 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24347 Conv_R_Un for the signed `long' type.
24349 2002-07-15 Miguel de Icaza <miguel@ximian.com>
24351 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24352 `expr' for the temporary result, as that will fail if we do
24353 multiple resolves on the same expression.
24355 2002-07-05 Miguel de Icaza <miguel@ximian.com>
24357 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24358 ec.TypeContainer for looking up aliases.
24360 * class.cs (TypeContainer): Remove LookupAlias from here.
24362 * decl.cs (DeclSpace); Move here.
24364 2002-07-01 Miguel de Icaza <miguel@ximian.com>
24366 * class.cs (FindMembers): Only call filter if the constructor
24367 bulider is not null.
24369 Also handle delegates in `NestedTypes' now. Now we will perform
24370 type lookups using the standard resolution process. This also
24373 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24374 This uses Expressions (the limited kind that can be parsed by the
24375 tree) instead of strings.
24377 * expression.cs (ComposedCast.ToString): Implement, used to flag
24378 errors since now we have to render expressions.
24380 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
24383 * ecore.cs (SimpleName.ToString): ditto.
24385 * cs-parser.jay: Instead of using strings to assemble types, use
24386 Expressions to assemble the type (using SimpleName, ComposedCast,
24387 MemberAccess). This should fix the type lookups in declarations,
24388 because we were using a different code path for this.
24390 * statement.cs (Block.Resolve): Continue processing statements
24391 even when there is an error.
24393 2002-07-17 Miguel de Icaza <miguel@ximian.com>
24395 * class.cs (Event.Define): Also remove the `remove' method from
24396 the list of pending items.
24398 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24399 generate more compact code.
24401 2002-07-17 Martin Baulig <martin@gnome.org>
24403 * const.cs (Const.LookupConstantValue): Add support for constant
24404 `unchecked' and `checked' expressions.
24405 Also adding test case test-140.cs for this.
24407 2002-07-17 Martin Baulig <martin@gnome.org>
24409 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24410 check whether mi.ReturnType implements the IEnumerator interface; the
24411 `==' and the IsAssignableFrom() will fail in this situation.
24413 2002-07-16 Ravi Pratap <ravi@ximian.com>
24415 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
24418 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24420 * expression.cs: fixed bug #27811.
24422 2002-07-14 Miguel de Icaza <miguel@ximian.com>
24424 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24425 Molaro: when we are a ref, the value already contains a pointer
24426 value, do not take the address of it.
24428 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24429 * removed mb-parser.jay and mb-tokenizer.cs
24431 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24433 * expression.cs: check against the building corlib void type.
24435 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24437 * ecore.cs: fix for valuetype static readonly fields: when
24438 initializing them, we need their address, not the address of a copy.
24440 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24442 * typemanager.cs: register also enum_type in corlib.
24444 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24446 * class.cs: allow calling this (but not base) initializers in structs.
24448 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24450 * ecore.cs: make sure we compare against the building base types
24453 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24455 * typemanager.cs: fix TypeToCoreType() to handle void and object
24456 (corlib gets no more typerefs after this change).
24458 2002-07-12 Miguel de Icaza <miguel@ximian.com>
24460 * expression.cs (ArrayCreation.EmitArrayArguments): use
24461 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24463 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24464 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
24465 array indexes, the runtime actually forbids them.
24467 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24468 for array arguments here.
24470 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24471 instead of the default for ValueTypes.
24473 (New.DoEmit): Use IsValueType instead of
24474 IsSubclassOf (value_type)
24475 (New.DoResolve): ditto.
24476 (Invocation.EmitCall): ditto.
24478 * assign.cs (Assign): ditto.
24480 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24481 Statements *are* currently doing part of their resolution during
24484 Expressions do always resolve during resolve, but statements are
24485 only required to propagate resolution to their children.
24487 2002-07-11 Miguel de Icaza <miguel@ximian.com>
24489 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24491 (LoadAssembly): Do not add the dll if it is already specified
24493 (MainDriver): Add the System directory to the link path at the end,
24494 after all the other -L arguments.
24496 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24497 wrong opcode for loading bytes and bools (ldelem.i1 instead of
24498 ldelem.u1) and using the opposite for sbytes.
24500 This fixes Digger, and we can finally run it.
24502 * driver.cs (UnixParseOption): Move the option parsing here.
24503 (CSCParseOption): Implement CSC-like parsing of options.
24505 We now support both modes of operation, the old Unix way, and the
24506 new CSC-like way. This should help those who wanted to make cross
24507 platform makefiles.
24509 The only thing broken is that /r:, /reference: and /lib: are not
24510 implemented, because I want to make those have the same semantics
24511 as the CSC compiler has, and kill once and for all the confussion
24512 around this. Will be doing this tomorrow.
24514 * statement.cs (Unsafe.Resolve): The state is checked during
24515 resolve, not emit, so we have to set the flags for IsUnsfe here.
24517 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24519 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24520 not catch the Error_ObjectRefRequired in SimpleName (as it is
24521 possible to have a class/instance variable name that later gets
24522 deambiguated), we have to check this here.
24524 2002-07-10 Ravi Pratap <ravi@ximian.com>
24526 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24527 make static and put into Expression.
24529 (Event.Define): Register the private field of the event with the
24530 TypeManager so that GetFieldFromEvent can get at it.
24532 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24533 keep track of the private field associated with an event which
24536 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24539 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24541 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24543 * expression.cs (Binary.EmitBranchable): this routine emits the
24544 Binary expression in a branchable context. This basically means:
24545 we need to branch somewhere, not just get the value on the stack.
24547 This works together with Statement.EmitBoolExpression.
24549 * statement.cs (Statement.EmitBoolExpression): Use
24552 2002-07-09 Miguel de Icaza <miguel@ximian.com>
24554 * statement.cs (For): Reduce the number of jumps in loops.
24556 (For): Implement loop inversion for the For statement.
24558 (Break): We can be breaking out of a Try/Catch controlled section
24559 (foreach might have an implicit try/catch clause), so we need to
24560 use Leave instead of Br.
24562 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24563 now). If the instace expression supports IMemoryLocation, we use
24564 the AddressOf method from the IMemoryLocation to extract the
24565 address instead of emitting the instance.
24567 This showed up with `This', as we were emitting the instance
24568 always (Emit) instead of the Address of This. Particularly
24569 interesting when This is a value type, as we dont want the Emit
24570 effect (which was to load the object).
24572 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24574 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24576 * statement.cs (Checked): Set the CheckedState during the resolve
24577 process too, as the ConvCast operations track the checked state on
24578 the resolve process, and not emit.
24580 * cs-parser.jay (namespace_member_declaration): Flag that we have
24581 found a declaration when we do. This is used to flag error 1529
24583 * driver.cs: Report ok when we display the help only.
24585 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24587 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24589 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24591 * cs-tokenizer.cs (define): We also have to track locally the
24592 defines. AllDefines is just used for the Conditional Attribute,
24593 but we also need the local defines for the current source code.
24595 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24597 * statement.cs (While, For, Do): These loops can exit through a
24598 Break statement, use this information to tell whether the
24599 statement is the last piece of code.
24601 (Break): Flag that we break.
24603 * codegen.cs (EmitContexts): New `Breaks' state variable.
24605 2002-07-03 Martin Baulig <martin@gnome.org>
24607 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24608 modifiers in method declarations in structs. Otherwise, you won't
24609 be able to override things like Object.Equals().
24611 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24613 * class.cs (Method, Property, Indexer): Do not allow the public
24614 modifier to be used in explicit interface implementations.
24616 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24617 override modifiers in method declarations in structs
24619 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24621 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24622 integer or real overflow, report an error
24624 2002-07-02 Martin Baulig <martin@gnome.org>
24626 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24627 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24628 to tell the runtime about our newly created System.Object and
24629 System.ValueType types.
24631 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24633 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24634 struct instead of Ldarg/Starg.
24636 2002-07-02 Martin Baulig <martin@gnome.org>
24638 * expression.cs (Indirection.Indirection): Call
24639 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24641 2002-07-02 Martin Baulig <martin@gnome.org>
24643 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24644 ValueType, call TypeManager.TypeToCoreType() on it.
24645 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24646 the OpCodes.Newarr argument.
24648 2002-07-02 Martin Baulig <martin@gnome.org>
24650 * expression.cs (Invocation.EmitCall): When compiling corlib,
24651 replace all calls to the system's System.Array type to calls to
24652 the newly created one.
24654 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24655 System.Array methods.
24656 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24657 from the system's System.Array type which must be replaced.
24659 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24661 * typemanager.cs: load unverifiable_code_ctor so we can build
24662 corlib using the correct type. Avoid using GetTypeCode() with
24664 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24665 TypeManager.object_type to allow building corlib.
24667 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24669 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24671 2002-07-01 Martin Baulig <martin@gnome.org>
24673 * class.cs: Make the last change actually work, we need to check
24674 whether `ifaces != null' to avoid a crash.
24676 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24678 * class.cs: when we build structs without fields that implement
24679 interfaces, we need to add the interfaces separately, since there is
24680 no API to both set the size and add the interfaces at type creation
24683 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24685 * expression.cs: the dimension arguments to the array constructors
24686 need to be converted if they are a long.
24688 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24690 * class.cs: don't emit ldarg.0 if there is no parent constructor
24691 (fixes showstopper for corlib).
24693 2002-06-29 Martin Baulig <martin@gnome.org>
24695 MCS now compiles corlib on GNU/Linux :-)
24697 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24698 ie. check for MethodImplOptions.InternalCall.
24700 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24701 and TypeManager.attribute_type are null, so we must explicitly check
24702 whether parent is not null to find out whether it's an attribute type.
24703 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24704 and SetBuilder, not only if the property is neither abstract nor external.
24705 This is necessary to set the MethodImplOptions on the accessor methods.
24706 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24707 SetBuilder, see Property.Emit().
24709 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24710 populate "System.Object", "System.ValueType" and "System.Attribute" since
24711 they've already been populated from BootCorlib_PopulateCoreTypes().
24713 2002-06-29 Martin Baulig <martin@gnome.org>
24715 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24716 is the NullLiteral, we also need to make sure that target_type is not
24719 2002-06-29 Martin Baulig <martin@gnome.org>
24721 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24722 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24723 before calling BootstrapCorlib_ResolveDelegate ().
24725 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24727 * statement.cs: fixed build-breaker. All tests passed ok.
24729 2002-06-27 Martin Baulig <martin@gnome.org>
24731 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24732 for System.Decimal when compiling corlib.
24734 2002-06-27 Martin Baulig <martin@gnome.org>
24736 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24737 switch blocks which contain nothing but a default clause.
24739 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24741 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24743 2002-06-27 Martin Baulig <martin@gnome.org>
24745 * ecore.cs (PropertyExpr.PropertyExpr): Call
24746 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24748 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24749 is already a TypeBuilder.
24751 2002-06-27 Martin Baulig <martin@gnome.org>
24753 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24754 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24755 the "from an array-type to System.Array" case. This makes it work
24756 when compiling corlib.
24758 2002-06-27 Martin Baulig <martin@gnome.org>
24760 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24761 non-static PropertyExpr, set its InstanceExpression. This makes
24762 the `ICollection.Count' property work in System/Array.cs.
24764 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24766 * driver.cs: Made error handling more consistent. Errors now
24767 tracked by Report class, so many methods which used to return int
24768 now return void. Main() now prints success/failure and
24769 errors/warnings message.
24771 Renamed '--probe' compiler argument to '--expect-error'. Removed
24772 the magic number return values (123 and 124). Now, if the
24773 expected error occurs, the compiler exits with success (exit value
24774 0). If the compilation completes without seeing that particular
24775 error, the compiler exits with failure (exit value 1). The
24776 makefile in mcs/errors has been changed to handle the new behaviour.
24778 * report.cs: Made 'expected error' number a property and renamed
24779 it from 'Probe' to 'ExpectedError'.
24781 * genericparser.cs: Removed error handling support, since it is
24782 now all done by Report class.
24784 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24785 class, so parse() no longer returns an int.
24787 * namespace.cs: Use Report.Error instead of GenericParser.error
24789 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24791 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24792 TypeContainer.AddOperator): At the front of the list put the
24793 explicit implementations, so they get resolved/defined first.
24795 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24797 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24798 interface type is implemented by this TypeContainer. Used during
24799 explicit interface implementation.
24801 (Property.Define, Indexer.Define, Method.Define): Validate that
24802 the given interface in the explicit implementation is one of the
24803 base classes for the containing type.
24805 Also if we are explicitly implementing an interface, but there is
24806 no match in the pending implementation table, report an error.
24808 (Property.Define): Only define the property if we are
24809 not explicitly implementing a property from an interface. Use the
24810 correct name also for those properties (the same CSC uses,
24811 although that is really not needed).
24813 (Property.Emit): Do not emit attributes for explicitly implemented
24814 properties, as there is no TypeBuilder.
24816 (Indexer.Emit): ditto.
24818 Hiding then means that we do not really *implement* a pending
24819 implementation, which makes code fail.
24821 2002-06-22 Martin Baulig <martin@gnome.org>
24823 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24824 the return value of Object.GetType(). [FIXME: we need to do this whenever
24825 we get a type back from the reflection library].
24827 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24829 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24831 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24833 * attribute.cs: Return null if we can not look up the type.
24835 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24836 the interface types found.
24838 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24839 interface types found.
24841 * typemanager.cs (GetInterfaces): Make this routine returns alll
24842 the interfaces and work around the lame differences between
24843 System.Type and System.Reflection.Emit.TypeBuilder in the results
24844 result for GetInterfaces.
24846 (ExpandInterfaces): Given an array of interface types, expand and
24847 eliminate repeated ocurrences of an interface. This expands in
24848 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24851 2002-06-21 Martin Baulig <martin@gnome.org>
24853 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24856 2002-06-21 Martin Baulig <martin@gnome.org>
24858 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24859 and called with one of the core types, return the corresponding typebuilder for
24862 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24865 2002-06-21 Martin Baulig <martin@gnome.org>
24867 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24868 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24869 (Expression.ConvertReferenceExplicit): Likewise.
24871 * expression.cs (ElementAccess.DoResolve): Likewise.
24872 (ElementAccess.DoResolveLValue): Likewise.
24874 2002-06-10 Martin Baulig <martin@gnome.org>
24876 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24877 add the "value" parameter to the parameter list.
24879 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24882 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24884 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24885 the argument to an int, uint, long or ulong, per the spec. Also
24886 catch negative constants in array creation.
24888 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24890 * class.cs: do not allow the same interface to appear twice in
24891 the definition list.
24893 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24895 * ecore.cs: don't use ldlen with System.Array.
24897 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24899 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24901 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24903 * modifiers.cs: produce correct field attributes for protected
24904 internal. Easy fix so miguel can work on ther harder stuff:-)
24906 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24908 * pending.cs: New file. Move the code from class.cs here.
24909 Support clearning the pending flag for all methods (when not doing
24910 explicit interface implementation).
24912 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24914 * rootcontext.cs: added a couple more types needed to bootstrap.
24916 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24918 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24919 constructor in the type, instead of any constructor in the type
24920 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24921 a bug in the Mono runtime when applying the params attribute).
24923 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24924 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24926 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24928 * expression.cs (Unary.ResolveOperator): Use TypeManager
24929 to resolve the type.
24931 2002-06-13 Ravi Pratap <ravi@ximian.com>
24933 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24936 * enum.cs (AddEnumMember): Add support to store the attributes associated
24937 with each member too.
24939 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24940 field builders too - this takes care of the enum member case.
24942 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24944 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24945 address-of operator on both value types and pointers.
24947 2002-06-10 Martin Baulig <martin@gnome.org>
24949 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24950 PropertyBuilder to the `property_builders' list.
24952 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24953 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24954 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24955 find any indexers which are inherited from an interface.
24957 2002-06-09 Martin Baulig <martin@gnome.org>
24959 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24960 the same type as the constant if necessary. There's also a test-130.cs
24963 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24965 * typemanager.cs (TypeManager.ChangeType): Previously known as
24966 Enum.ChangeEnumType().
24968 2002-06-09 Martin Baulig <martin@gnome.org>
24970 * expression.cs (Cast.TryReduce): Added support for consts.
24972 2002-06-08 Ravi Pratap <ravi@ximian.com>
24974 * class.cs (Accessor): Hold attributes information so we can pass
24977 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24978 Modify to pass in attributes attached to the methods.
24980 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24982 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24983 to handle the Accessor kind :-)
24985 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24987 2002-06-08 Martin Baulig <martin@gnome.org>
24989 * expression.cs (Unary.TryReduceNegative): Added support for
24992 2002-06-08 Martin Baulig <martin@gnome.org>
24994 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24995 name can't be found in the `defined_names' - the caller will do a
24996 MemberLookup in this case and thus find methods in System.Enum
24997 such as Enum.IsDefined().
24999 2002-06-08 Martin Baulig <martin@gnome.org>
25001 * enum.cs (Enum.ChangeEnumType): This is a custom version of
25002 Convert.ChangeType() which works with TypeBuilder created types.
25003 (Enum.LookupEnumValue, Enum.Define): Use it here.
25005 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25006 `TypeBuilder.BaseType != null' check.
25007 (TypeContainer.FindMembers): Only lookup parent members if we
25008 actually have a parent.
25009 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25010 (ConstructorInitializer.Resolve): Likewise.
25012 * interface.cs (Interface.FindMembers): Added
25013 `TypeBuilder.BaseType != null' check.
25015 * rootcontext.cs (RootContext.ResolveCore): Added
25016 "System.Runtime.CompilerServices.IndexerNameAttribute" to
25017 classes_second_stage.
25019 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25020 debug_type and trace_type when compiling with --nostdlib.
25022 2002-06-07 Martin Baulig <martin@gnome.org>
25024 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25025 (AddField): Set it to true when adding a non-static field.
25026 (DefineType): Use `have_nonstatic_fields' to find out whether we
25027 have non-static fields, not `Fields != null'.
25029 2002-06-02 Miguel de Icaza <miguel@ximian.com>
25031 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25032 dereferencing a null on the static-field code path)
25034 2002-05-30 Martin Baulig <martin@gnome.org>
25036 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25037 to take command line arguments. Use reflection to call the new
25038 custom `Initialize' function on the symbol writer and pass it the
25039 command line arguments.
25041 * driver.cs (--debug-args): New command line argument to pass command
25042 line arguments to the symbol writer.
25044 2002-05-28 Miguel de Icaza <miguel@ximian.com>
25046 * assign.cs (DoResolve): Forgot to do the implicit conversion to
25047 the target type for indexers and properties. Thanks to Joe for
25050 2002-05-27 Miguel de Icaza <miguel@ximian.com>
25052 * typemanager.cs (MethodFlags): returns the method flags
25053 (Obsolete/ShouldIgnore) that control warning emission and whether
25054 the invocation should be made, or ignored.
25056 * expression.cs (Invocation.Emit): Remove previous hack, we should
25057 not do this on matching a base type, we should do this based on an attribute
25059 Only emit calls to System.Diagnostics.Debug and
25060 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25061 on the command line.
25063 * rootcontext.cs: Global settings for tracing and debugging.
25065 * cs-tokenizer.cs (define): New utility function to track
25066 defines. Set the global settings for TRACE and DEBUG if found.
25068 2002-05-25 Ravi Pratap <ravi@ximian.com>
25070 * interface.cs (Populate*): Pass in the TypeContainer as well as
25071 the DeclSpace as parameters so that we can create EmitContexts and
25072 then use that to apply attributes etc.
25074 (PopulateMethod, PopulateEvent, PopulateProperty)
25075 (PopulateIndexer): Apply attributes everywhere.
25077 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25080 (ApplyAttributes): Update accordingly.
25082 We now apply interface attributes for all members too.
25084 2002-05-26 Miguel de Icaza <miguel@ximian.com>
25086 * class.cs (Indexer.Define); Correctly check if we are explicit
25087 implementation (instead of checking the Name for a ".", we
25088 directly look up if the InterfaceType was specified).
25090 Delay the creation of the PropertyBuilder.
25092 Only create the PropertyBuilder if we are not an explicit
25093 interface implementation. This means that explicit interface
25094 implementation members do not participate in regular function
25095 lookups, and hence fixes another major ambiguity problem in
25096 overload resolution (that was the visible effect).
25098 (DefineMethod): Return whether we are doing an interface
25101 * typemanager.cs: Temporary hack until we get attributes in
25102 interfaces (Ravi is working on that) and we get IndexerName
25103 support in interfaces.
25105 * interface.cs: Register the indexers as properties.
25107 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25108 warning, I have verified that this is a bug in the .NET runtime
25109 (JavaScript suffers of the same problem).
25111 * typemanager.cs (MemberLookup): When looking up members for
25112 interfaces, the parent of an interface is the implicit
25113 System.Object (so we succeed in searches of Object methods in an
25114 interface method invocation. Example: IEnumerable x; x.ToString
25117 2002-05-25 Miguel de Icaza <miguel@ximian.com>
25119 * class.cs (Event): Events should also register if they do
25120 implement the methods that an interface requires.
25122 * typemanager.cs (MemberLookup); use the new GetInterfaces
25125 (GetInterfaces): The code used to lookup interfaces for a type is
25126 used in more than one place, factor it here.
25128 * driver.cs: Track the errors at the bottom of the file, we kept
25131 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25132 instance if the method we are calling is static!
25134 2002-05-24 Miguel de Icaza <miguel@ximian.com>
25136 * attribute.cs (ApplyAttributes): Make this function filter out
25137 the IndexerName attribute (as that attribute in reality is never
25138 applied) and return the string constant for the IndexerName
25141 * class.cs (TypeContainer.Emit): Validate that all the indexers
25142 have the same IndexerName attribute, and if so, set the
25143 DefaultName attribute on the class.
25145 * typemanager.cs: The return value might contain other stuff (not
25146 only methods). For instance, consider a method with an "Item"
25147 property and an Item method.
25149 * class.cs: If there is a problem with the parameter types,
25152 2002-05-24 Ravi Pratap <ravi@ximian.com>
25154 * ecore.cs (ImplicitConversionExists): Wrapper function which also
25155 looks at user defined conversion after making a call to
25156 StandardConversionExists - we need this for overload resolution.
25158 * expression.cs : Update accordingly the various method calls.
25160 This fixes 2 bugs filed against implicit user defined conversions
25162 2002-05-22 Miguel de Icaza <miguel@ximian.com>
25164 * statement.cs: Track the result of the assignment.
25166 2002-05-21 Miguel de Icaza <miguel@ximian.com>
25168 * expression.cs (MemberAccess): Improved error reporting for
25169 inaccessible members.
25171 2002-05-22 Martin Baulig <martin@gnome.org>
25173 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
25174 itself with debugging support.
25176 2002-05-22 Martin Baulig <martin@gnome.org>
25178 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25179 Removed, this isn't needed anymore.
25181 2002-05-20 Martin Baulig <martin@gnome.org>
25183 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25184 be underlying type for an enum.
25186 2002-05-20 Miguel de Icaza <miguel@ximian.com>
25188 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25189 that splits out the loading of just the core types.
25191 * rootcontext.cs (ResolveCore): Split the struct resolution in
25192 two, so we can load the enumeration underlying types before any
25195 * expression.cs (Is): Bandaid until we fix properly Switch (see
25196 bug #24985 for details).
25198 * typemanager.cs (ImplementsInterface): The hashtable will contain
25199 a null if there are no interfaces implemented.
25201 2002-05-18 Miguel de Icaza <miguel@ximian.com>
25203 * cs-parser.jay (indexer_declarator): It is fine to have array
25206 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25208 * typemanager.cs: (RegisterBuilder): New function used to register
25209 TypeBuilders that implement interfaces. Since
25210 TypeBuilder.GetInterfaces (as usual) does not work with lame
25212 (AddUserType): register interfaces.
25214 (ImplementsInterface): Use the builder_to_ifaces hash if we are
25215 dealing with TypeBuilder. Also, arrays are showing up as
25216 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25217 methods can not be invoked on them!
25219 * ecore.cs (ExplicitReferenceConversionExists): Made public.
25220 (ImplicitReferenceConversionExists): Split out from
25221 StandardConversionExists.
25223 * expression.cs (As): We were only implementing one of the three
25224 cases for the as operator. We now implement them all.
25225 (Is): Implement the various other cases for Is as well.
25227 * typemanager.cs (CACHE): New define used to control if we want or
25228 not the FindMembers cache. Seems to have a negative impact on
25229 performance currently
25231 (MemberLookup): Nested types have full acess to
25232 enclosing type members
25234 Remove code that coped with instance/static returns for events, we
25235 now catch this in RealFindMembers.
25237 (RealFindMembers): only perform static lookup if the instance
25238 lookup did not return a type or an event.
25240 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25242 * assign.cs (CompoundAssign): We pass more semantic information
25243 now to Compound Assignments than we did before: now we have all
25244 the information at hand, and now we resolve the target *before* we
25245 do the expression expansion, which allows the "CacheValue" method
25246 to have the effect we intended (before, a [x] += 1 would generate
25247 two differen ArrayAccess expressions from the ElementAccess,
25248 during the resolution process).
25250 (CompoundAssign.DoResolve): Resolve target and original_source here.
25252 2002-05-16 Miguel de Icaza <miguel@ximian.com>
25254 * expression.cs (ArrayAccess): dropped debugging information.
25256 * typemanager.cs: Small bug fix: I was always returning i_members,
25257 instead of one of i_members or s_members (depending on which had
25260 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
25261 method is invoked before any code generation takes place, and it
25262 is a mechanism to inform that the expression will be invoked more
25263 than once, and that the method should use temporary values to
25264 avoid having side effects
25266 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25268 * ecore.cs (Expression.CacheTemporaries): Provide empty default
25271 * expression.cs (Indirection, ArrayAccess): Add support for
25272 CacheTemporaries in these two bad boys.
25274 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25275 ldobj or ldind_ref.
25276 (StoreFromPtr): Handle stobj as well.
25278 * expression.cs (UnaryMutator): Share more code.
25280 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25281 down: I was not tracking the Filter function as well, which
25282 was affecting the results of the cache.
25284 2002-05-15 Miguel de Icaza <miguel@ximian.com>
25286 * attribute.cs: Remove the hack to handle the CharSet property on
25289 2002-05-14 Miguel de Icaza <miguel@ximian.com>
25291 * attribute.cs (DoResolve): More uglyness, we now only try to
25292 resolve the attribute partially, to extract the CharSet
25293 information (only if we are a StructLayout attribute). Otherwise
25295 (GetExtraTypeInfo): Add some code to conditionally kill in the
25296 future this. I am more and more convinced that the .NET
25297 framework has special code to handle the attribute setting on
25300 * expression.cs (IsParamsMethodApplicable): Revert my previous
25301 foreach change here, it was wrong.
25303 2002-05-13 Miguel de Icaza <miguel@ximian.com>
25305 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25306 (pp_expr): do not abort on unknown input, just return.
25307 (eval): abort if there are pending chars.
25309 * attribute.cs (Attribute.Resolve): Positional parameters are
25310 optional. Deal with that case.
25312 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25313 the Ansi/Unicode/Auto information for the type.
25315 (TypeContainer.DefineType): instantiate the EmitContext here, as
25316 we will be using it during the type definition (to resolve
25317 attributes) and during the emit phase.
25319 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25320 to pull type information out of the attributes
25322 (Attribute.Resolve): track the constructor builder, and allow for
25323 multiple invocations (structs and classes will use this).
25325 * ecore.cs (MemberLookupFinal): new version with all the
25326 parameters customizable.
25328 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25329 constructors. Return if the result value is null (as the error
25330 would have been flagged already by MemberLookupFinal)
25332 Do not allow instances of abstract classes or interfaces to be
25335 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25336 We have to compare the assembly property here when dealing with
25337 FamANDAssem and Assembly access modifiers, because we might be
25338 creating an assembly from *modules* (that means that we are not
25339 getting TypeBuilders for types defined in other modules that are
25340 part of this assembly).
25342 (Method.Emit): If the method is marked abstract and has a body,
25345 (TypeContainer.DefineMembers): If both the defined member and the
25346 parent name match are methods, then do not emit any warnings: let
25347 the Method.Define routine take care of flagging warnings. But if
25348 there is a mismatch (method overrides something else, or method is
25349 overriwritten by something, then emit warning).
25351 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25352 set to null, this means `do not check for the return type on the
25355 (Method.Define): set the return type for the method signature to
25356 null, so that we get methods with the same name and parameters and
25357 different return types. This is used to flag warning 114 (you are
25358 hiding a method, and you probably want to use the new/override
25361 * typemanager.cs (MemberLookup): Implemented proper access
25362 control, closing a long standing set of bug reports. The problem
25363 was that the Framework only has two bits: Public and NonPublic,
25364 and NonPublic includes private and protected methods, but we need
25365 to enforce the FamANDAssem, FamOrAssem and Family.
25367 2002-05-11 Miguel de Icaza <miguel@ximian.com>
25369 * statement.cs (GotoCase): Return true: Ammounts to giving up
25370 knowledge on whether we return or not, and letting the other case
25371 be responsible for it.
25373 2002-05-10 Miguel de Icaza <miguel@ximian.com>
25375 * driver.cs: Do not load directories for each file processed, only
25376 do it if there is a pattern.
25378 * ecore.cs: Report readonly assigns here as well, as we might have
25379 been resolved only by MemberAccess.
25381 (SimpleName.SimpleNameResolve): Also be useful for LValue
25382 resolution. We need this to propagate assign to local readonly variables
25384 * typemanager.cs: Use a ptrhashtable for the criteria, because we
25385 do not want to reuse potential criteria memory.
25387 * class.cs (MyEventBuilder): Set reflected_type;
25389 * ecore.cs (Constantify): Added support for constifying bools.
25391 (RootContext.LookupType): Added a cache for values looked up in
25392 the declaration space.
25394 * typemanager.cs (FindMembers): Now is a front-end to
25395 RealFindMembers, and provides a two-level hashtable-based cache to
25398 15% performance improvement: from 22.5 to 19.2 seconds.
25400 * expression.cs (IsParamsMethodApplicable): use foreach.
25401 (Invocation.DoResolve): ditto.
25402 (New.DoResolve): ditto.
25403 (ArrayCreation.DoResolve): ditto.
25405 * ecore.cs (FindMostEncompassingType): use foreach.
25407 * delegate.cs (NewDelegate.DoResolve): Use foreach
25409 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25410 (RemoveMethods): use foreach.
25412 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25413 nested foreach statements instead of for, and also break out of
25414 the inner loop once a match is found.
25416 (Invocation.OverloadResolve): Use foreach, simplify the code.
25418 2002-05-08 Miguel de Icaza <miguel@ximian.com>
25420 * cfold.cs (BinaryFold): During an enumeration evaluation context,
25421 we actually unwrap the expression to allow for extra information
25424 * expression.cs: Use Shr_Un on unsigned operations.
25426 2002-05-08 Ravi Pratap <ravi@ximian.com>
25428 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
25429 applicable operators was not being considered correctly. This closes
25430 the bug Miguel reported.
25432 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25434 * attribute.cs: check that the type derives from System.Attribute
25435 and report the correct error in that case (moved the duplicate code to
25436 its own method, too).
25438 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25440 * attribute.cs: lookup attribute type name as the spec says: first the
25441 bare attribute name and then name + "Attribute" (nant compiles with
25442 mcs after this fix).
25444 2002-05-07 Miguel de Icaza <miguel@ximian.com>
25446 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
25447 Because of the way we parse things, we should try to see if a
25448 UIntConstant can fit in an integer.
25450 2002-05-07 Ravi Pratap <ravi@ximian.com>
25452 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25453 when we are in an explicit context.
25455 (ConvertReferenceExplicit): When converting from Iface type S to Class
25456 T make sure the rules are implemented as an OR.
25458 * parameter.cs (ParameterType): Make it a property for now although the
25459 purpose really isn't anything immediate.
25461 * expression.cs (Is*Applicable): Do better checking on the parameter type
25462 of a ref/out parameter. The ones from the system assemblies are already
25463 marked with the correct type so we don't need to do any correction.
25465 * ecore.cs (StandardConversionExists): Conversion from Interface types to
25466 the object type is standard too so include that.
25468 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25470 * ecore.cs (StandardConversionExists): Augment with missing code:
25471 deal with IntConstant, LongConstants and Enumerations.
25473 * assign.cs: Report the error, instead of failing silently
25475 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25476 typecontainer that they are declared, because the
25477 typecontainer/namespace will have the list of using clauses that
25478 need to be applied.
25480 Assembly Attributes were escaping the normal registration
25483 (EmitCode): Apply attributes within an EmitContext that represents
25484 the container they were declared on.
25486 * cs-parser.jay: Track bases for structs. How did I get this wrong?
25488 2002-05-06 Ravi Pratap <ravi@ximian.com>
25490 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25491 Revamp completely - make much cleaner as we now operate only
25494 (FindMostSpecificSource, FindMostSpecificTarget): New methods
25495 to implement the logic detailed in the spec more correctly.
25497 (UserDefinedConversion): Update accordingly.
25499 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25501 * statement.cs: Return flow analysis information up.
25503 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25506 (token): Do not consume an extra character before calling
25509 2002-05-06 Piers Haken <piersh@friskit.com>
25511 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25513 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25515 * class.cs (Constructor.Emit): Set the IsStatic flag in the
25516 EmitContext during the instance constructor initializer
25517 resolution, to stop access to instance variables.
25519 This is mandated by the spec, last paragraph of the `constructor
25520 initializers' section.
25522 2002-05-05 Miguel de Icaza <miguel@ximian.com>
25524 * cs-parser.jay, class.cs (Accessor): new class used to represent
25525 an accessor (get or set). In the past we used `null' to represent
25526 a missing accessor. But this is ambiguous because there was no
25527 way to tell in abstract indexers/properties if one of them was
25530 Now there is a way of addressing that.
25532 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25533 instead of FindMembers.
25535 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25536 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25538 * attribute.cs: Treat indexers and properties as the same in terms
25539 of applying attributes
25541 * ecore.cs (FindMostEncompassedType): Use statically initialized
25542 EmptyExpressions()s like we do elsewhere to avoid creating useless
25543 objects (and we take this out of the tight loop).
25545 (GetConversionOperators): Move the code to extract the actual
25546 operators to a separate routine to clean things up.
25548 2002-05-04 Miguel de Icaza <miguel@ximian.com>
25550 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25551 events are always registered FieldBuilders.
25553 * class.cs (FieldBase): New class shared by Fields
25555 * delegate.cs: If we are a toplevel delegate, use our full name.
25556 If we are a nested delegate, then only use our tail name.
25558 2002-05-02 Ravi Pratap <ravi@ximian.com>
25560 * expression.cs (IsApplicable): Ensure that we add the "&" to
25561 ref/out types before comparing it with the type of the argument.
25563 (IsParamsMethodApplicable): Ditto.
25565 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
25568 * delegate.cs : Handle the case when we have more than one applicable
25569 method. Flag an error only when we finish checking all.
25571 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25573 * expression.cs: Add support for boolean static initializers.
25575 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25577 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25579 * parameter.cs (ComputeParameterTypes,
25580 ComputeAndDefineParameterTypes): Better error handling: now we
25581 clear the `types' cache if we fail during any of the type lookups.
25582 We also return the status code correctly to our caller
25584 * delegate.cs: If we fail to define a delegate, abort the extra
25587 * expression.cs (Binary.ResolveOperator): for
25588 operator==(object,object) and operator !=(object, object) we also
25589 have to verify that there is an implicit conversion from one to
25592 (ArrayAccess.DoResolve): Array Access can operate on
25595 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25597 * assign.cs (CompoundAssign): A new class used as a "flag" that
25598 the assignment actually is happening as part of a compound
25599 assignment operator.
25601 During compound assignment, a few new rules exist to enable things
25608 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25609 to the type of x) if y is implicitly convertible to the type of x,
25610 and the operator is a builtin operator and the return type of the
25611 operator is explicitly convertible to the type of x.
25613 * rootcontext.cs: Reset warning level to 2. 4 catches various
25614 "interesting" features in mcs, we must clean this up at some
25615 point, but currently am trying to kill other bugs ;-)
25617 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25618 in container classes as well.
25620 * expression.cs (Binary.ResolveOperator): Handle string case
25621 before anything else (as operator overloading does emit an error
25622 before doing anything else).
25624 This code could go away when we move to a table driven model, but
25625 i could not come up with a good plan last night.
25627 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25629 * typemanager.cs (CSharpName): reimplementation using regex.
25630 * class.cs: added null check for fields in Emit
25631 * rootcontext.cs: set warninglevel to 4
25633 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25635 * typemanager.cs (CSharpName): reimplemented with Lupus
25638 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25640 * statement.cs (If): correclty implement Resolve, because we were
25641 not catching sem errors in there. The same process is needed
25643 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25646 (Statement.Warning_DeadCodeFound): Factorize code.
25647 (While): Report dead code here too.
25649 (Statement): Added Resolve virtual method to allow
25650 for resolution split from the emit code.
25652 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25654 * statement.cs (EmitBoolExpression): No longer try to resolve the
25656 (MakeBoolean): New utility function that resolve, implicitly
25657 converts to boolean and tags the expression.
25660 (If, Do): Implement dead code elimination.
25661 (While): Implement loop inversion
25663 (Do, While, For, If): Resolve the expression prior to calling our
25666 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25669 - added method Report28 (warning: program has more than one entry point)
25670 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25671 - modified method Method.Define, the part at the end of the method
25673 * rootcontext.cs: added static public Location EntryPointLocation;
25675 * ../errors/cs0028.cs : Add test case for the above warning.
25678 - modified method CSharpName to allow arrays of primitive type to
25679 be printed nicely (e.g. instead of System.Int32[][] it now prints
25681 - added method CSharpSignature: returns the signature of a method
25682 in string format to be used in reporting errors, warnings, etc.
25684 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25687 2002-04-26 Ravi Pratap <ravi@ximian.com>
25689 * delegate.cs (Define): Fix extremely silly bug where I was
25690 setting the type of the 'object' parameter of the BeginInvoke
25691 method to System.IAsyncResult instead of System.Object ;-)
25693 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25695 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25698 (Constructor.Emit): return if we fail to initialize the
25699 constructor. Another door closed!
25701 * expression.cs (New.DoResolve): Improve error message (from -6 to
25702 1501). Use DeclaredOnly lookup to find the exact constructor.
25704 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25705 loop. This is useful.
25707 * cs-parser.jay: Adjust the default parameters so that destructors
25708 have the proper signature.
25710 2002-04-26 Martin Baulig <martin@gnome.org>
25712 * driver.cs (LoadAssembly): If `assembly' contains any characters
25713 which are only valid in path names and not in assembly names
25714 (currently slash, backslash and point), use Assembly.LoadFrom ()
25715 instead of Assembly.Load () on the `assembly' (before iteration
25716 over the link_paths).
25718 2002-04-26 Martin Baulig <martin@gnome.org>
25720 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25722 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25724 * class.cs (Property): use the new typemanager.MemberLookup
25726 (TypeContainer.MemberLookup): Implement using the
25727 TypeManager.MemberLookup now.
25729 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25730 and return MemberInfos, so that these can be used without an
25731 EmitContext (what we had before).
25733 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25735 * expression.cs: Fix the case where the argument to params if the
25736 type of the params. I omitted handling this before. Fixed
25738 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25740 * driver.cs: Call BootCorlib_PopulateCoreType
25742 * class.cs (Property.CheckBase): Check for properties only, not
25745 * interface.cs: Temporary hack: try/catch around the
25746 CustomAttributeBuilder, because I am getting an exception that I
25749 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25750 types whose definitions are required to be there (attributes are
25751 defined before standard types).
25753 Compute definitions as we boot the various types, as they are used
25754 immediately (value_type class will need object_type, but if we do
25755 not initialize object_type, we will pass a null, which will let
25756 the runtime pick the System.Object from the existing corlib, which
25757 is not what we want).
25759 2002-04-22 Patrik Torstensson <totte@labs2.com>
25761 * cs-tokenizer.cs: fixed a number of trim() issues.
25763 2002-04-22 Ravi Pratap <ravi@ximian.com>
25765 * expression.cs (Argument.Type): Ensure that we return the correct
25766 type when we have out or ref parameters [in which case we
25769 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25771 * class.cs (Property, Indexer): Allow extern modifier in there.
25773 * typemanager.cs (InitBaseTypes): Initializes object_type and
25774 value_type, since those will be used early on during the bootstrap
25775 process to compile corlib.
25777 (InitCoreTypes): Move code from here to InitBaseTypes.
25779 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25781 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25782 single-dimension arrays as using the ldlen opcode.
25784 Daniel Lewis discovered this optimization.
25786 * typemanager.cs: Add signature for System.Array::get_Length
25788 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25790 * statement.cs: report the error when the foreach does not apply to an
25791 array nor a collection.
25793 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25795 * expression.cs: Add implicit conversions to the operator ~.
25797 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25799 * typemanager.cs: Locate the decimal constructor.
25801 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25803 * attribute.cs: use the new property of TypeOf.
25804 * expression.cs: added 'get' property around typearg.
25806 These changes fix a build breaker reported by NickD. Is this the
25807 correct way to fix? If not, please, revert my changes and make it
25810 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25812 * attribute.cs: Add support for typeof in attribute invocations.
25813 I am not sure that this is right though.
25815 2002-04-14 Duncan Mak <duncan@ximian.com>
25817 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25818 Binary.Operator.Division case.
25820 2002-04-13 Ravi Pratap <ravi@ximian.com>
25822 * class.cs (DefineType): Ensure that we do a proper check on
25823 attribute types and also register it with the TypeManager.
25825 (TypeContainer.Targets): The default for attribute types is
25826 AttributeTargets.All.
25828 * attribute.cs (ApplyAttributes): Registering the attribute type
25829 is done elsewhere, not when we discover we have a Usage attribute.
25831 2002-04-12 Ravi Pratap <ravi@ximian.com>
25833 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25834 and get rid of is_delegate parameter.
25836 * everywhere : update.
25838 2002-04-12 Ravi Pratap <ravi@ximian.com>
25840 * cs-parser.jay (compilation_unit): Revamp completely to use
25841 some new ideas that I got from Rhys' grammar to solve the problems
25842 with assembly level attributes.
25844 (outer_declaration): New grammar production.
25846 (attribute_sections): Add.
25848 (opt_attributes): Base on attribute_sections
25850 (namespace_declaration): Allow opt_attributes to tackle the case
25851 when we have assembly level attributes - we are clever in this
25854 * attribute.cs (ApplyAttributes): Do not worry about assembly
25855 attributes in the non-global context.
25857 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25858 instead of SetGlobalAttributes.
25860 * class.cs, rootcontext.cs : Ensure we define and generate
25861 attribute types before anything else.
25863 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25864 and flag the new error -20 for the case when the attribute type
25865 does not have valid targets specified. csc does not catch this.
25867 * ../errors/errors.txt : update for error # -20
25869 2002-04-11 Ravi Pratap <ravi@ximian.com>
25871 * support.cs (InternalParameters.ParameterModifier): Do some null
25872 checking and return sane values.
25874 * class.cs (Method.Define): If we are a PInvoke method, ensure
25875 that we are static and extern. Report error # 601
25877 * ../errors/cs0601.cs : Add test case for the above error.
25879 2002-04-07 Ravi Pratap <ravi@ximian.com>
25881 * rootcontext.cs (attribute_types): We need to keep type of
25882 all attribute types separately and emit code for them first.
25884 (RegisterAttribute) : Implement.
25886 * class.cs (DefineType): Check if the current Type is a custom
25887 attribute type and register it accordingly.
25889 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25890 adding the first attribute twice and rename to
25892 (SetGlobalAttributes): this.
25894 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25897 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25898 if we are processing global arguments. Hmm, I am unsure of this.
25900 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25902 * expression.cs: added static array of strings to avoid calling
25903 Enum.ToString () for Operator in Binary. Significant recover of
25906 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25908 * class.cs (FindMembers): Allow the Builders of the various
25909 members to be null. If they are skip them. This only happens
25910 during the PInvoke declaration.
25912 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25914 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25915 failure, so we do not keep going afterwards.
25917 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25918 wanted to pass `false' as the `is_delegate' argument. If this is
25919 the case, why not use delegate_type == null to mean `is_delegate =
25920 false' and anything else as is_delegate = true.
25922 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25924 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25925 code for the section, not the beginning of the tests.
25927 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25929 * cfold.cs: Handle operator + (Enum x, Underlying x)
25931 * expression.cs (Binary): same. Warn about errors where we have
25932 Enum/Enum in operator + as well.
25934 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25937 - added support for switch(bool)
25938 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25939 - add TableSwitchEmit() to handle table-based switch statements
25941 2002-04-05 Ravi Pratap <ravi@ximian.com>
25943 * expression.cs (Invocation.OverloadResolve): Factor out code which
25944 does parameter compatibility checking with arguments so that we can
25945 re-use the code even from Delegate.VerifyApplicability
25947 (VerifyArgumentsCompat): Move above code here.
25949 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25950 and instead make a call to the above method.
25952 2002-03-31 Ravi Pratap <ravi@ximian.com>
25954 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25955 We use it to keep track of classes which are attribute types.
25957 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25959 * delegate.cs (Delegate.Define): Correctly define the types in the
25960 presence of fixed and array parameters.
25962 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25965 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25966 include NonPublic after the first iteration.
25968 * class.cs (Indexer.CheckBase): Only check if both parents are
25971 * cs-parser.jay (accessor_body): If empty, set to null.
25973 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25974 same code path here to resolve constants names that we did have in
25975 MemberAccess.DoResolve. There is too much code duplicated here.
25977 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25979 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25981 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25984 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25985 tokens, numbers and strings.
25987 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25990 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25991 asyncronous parameters and the regular parameters.
25993 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25994 specify the target directory.
25996 * expression.cs: (This.DoResolve): Simplify
25997 (As.Emit): Optimize, do not generate IsInst if the expression is
25998 always of the given type.
26000 (Is.DoResolve): Bug fix, we were reporting both always/never for
26003 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26004 creating too many unnecessary arrays.
26006 2002-03-31 Miguel de Icaza <miguel@ximian.com>
26008 * class.cs (EmitFieldInitializer): Use Assign expression to assign
26009 fields instead of rolling our own initializer. Takes care of all
26010 implicit conversions, and drops unnecessary static checks/argument.
26012 2002-03-31 Dick Porter <dick@ximian.com>
26014 * driver.cs: use the GetDirectories() return values properly, and
26015 use "/" as path separator.
26017 2002-03-30 Miguel de Icaza <miguel@ximian.com>
26019 * expression.cs (Unary): Optimize - - expr into expr.
26020 (Binary): Optimize a + (-b) into a -b.
26022 * codegen.cs (CodeGen): Made all methods static.
26024 2002-03-29 Miguel de Icaza <miguel@ximian.com>
26028 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26029 TypeBuilder property.
26031 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26034 * tree.cs: Removed the various RecordXXXX, and replaced with a
26035 single RecordDecl. Removed all the accessor methods, and just
26036 left a single access point Type
26038 * enum.cs: Rename DefineEnum to DefineType.
26040 * decl.cs: New abstract method `DefineType' used to unify the
26041 Defines for Enumerations, Interfaces, TypeContainers and
26044 (FindType): Moved LookupInterfaceOrClass here. Moved the
26045 LookupBaseClasses method that used to live in class.cs and
26046 interface.cs here, and renamed to FindType.
26048 * delegate.cs: Implement DefineType. Take advantage of the
26049 refactored pattern for locating the parent builder without taking
26050 the parent_builder argument (which we know does not work if we are
26051 nested, and triggering a toplevel definition).
26053 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26055 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26056 accessibility of a member has changed during override and report
26059 * class.cs (Method.Define, Property.Define): Only complain on
26060 overrides if the method is private, any other accessibility is
26061 fine (and since we just checked the permission is the same, we are
26064 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26065 and elif are processed always. The other pre-processing
26066 directives are only processed if we are "taking" the path
26068 2002-03-29 Martin Baulig <martin@gnome.org>
26070 * class.cs (Method.Emit): Only emit symbolic debugging info if the
26071 current location is not Null.
26073 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26074 a separate method so we can profile it.
26076 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26077 `span.Seconds' are just seconds, but no minutes or hours.
26078 (MainDriver): Profile the CodeGen.SaveSymbols calls.
26080 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26082 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26083 Remove the gratuitous set of Final:
26085 // If an interface implementation, then we can set Final.
26086 if (((flags & MethodAttributes.Abstract) == 0) &&
26087 implementing.DeclaringType.IsInterface)
26088 flags |= MethodAttributes.Final;
26090 I do not know what I was smoking when I used that.
26093 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26094 step into fixing the name resolution issues for delegates and
26095 unifying the toplevel name resolution.
26097 2002-03-28 Martin Baulig <martin@gnome.org>
26099 * class.cs (Method.Emit): If we have a symbol writer, call its
26100 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26101 tell it about the current method.
26103 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26104 writer that we're going to emit the first byte of IL code for a new
26105 statement (a new source line).
26106 (EmitContext.EmitTopBlock): If we have a symbol writer, call
26107 EmitContext.Mark() before emitting any code.
26109 * location.cs (SymbolDocument): Return null when we're Null.
26111 * statement.cs (Statement): Moved the `Location loc' variable here.
26112 (Statement.EmitBoolExpression): If we have a symbol writer, call
26113 ec.Mark() before emitting any code to tell it that we're at the
26114 beginning of a new statement.
26115 (StatementExpression): Added `Location' argument to the constructor.
26116 (Block): Added public readonly variable `StartLocation' and public
26117 variable `EndLocation'. The latter is to be set using SetEndLocation().
26118 (Block): Added constructor which takes a start and end location.
26119 (Block.SetEndLocation): New method. This sets the end location.
26120 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26121 local variables we create.
26122 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26123 each statement and do also mark the begin and end of the block.
26125 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26126 tell it the current lexer.Location, use Location.Null for the end of the
26128 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26129 current block, set its end location using SetEndLocation().
26130 (statement_expression): StatementExpression constructor now takes the
26131 lexer.Location as additional argument.
26132 (for_statement, declare_local_variables): Likewise.
26133 (declare_local_variables): When creating a new implicit block, use the
26134 new Block constructor and pass it the lexer.Location.
26136 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26138 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26139 members also on the parent interfaces recursively.
26141 2002-03-27 Miguel de Icaza <miguel@ximian.com>
26143 * report.cs: Use new formats, since Gonzalo finished the missing
26146 * expression.cs (Binary.ResolveOperator): added missing operator|
26147 operator& and operator^ for bool/bool.
26149 * cs-parser.jay: CheckDef now takes a Location argument that is
26150 used to report errors more precisly (instead of reporting the end
26151 of a definition, we try to track something which is a lot closer
26152 to the source of the problem).
26154 * cs-tokenizer.cs: Track global token use, so we can properly flag
26155 the use of #define/#undef after the first token has been seen.
26157 Also, rename the reportXXXX to Error_DescriptiveName
26159 * decl.cs (DeclSpace.IsTopLevel): Move property here from
26160 TypeContainer, so that Enum and Interface can use this too.
26162 * class.cs (TypeContainer.LookupInterfaceOrClass,
26163 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26164 `builder' argument. Typically this was used to pass the parent
26165 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26168 The problem is that a nested class could trigger the definition of
26169 a toplevel class, and the builder would be obviously wrong in that
26172 So we drop this argument, and we compute dynamically the
26173 TypeBuilder/ModuleBuilder (the correct information was available
26174 to us anyways from DeclSpace.Parent)
26176 * interface.cs (Interface.DefineInterface): Drop builder
26177 parameter cleanup like class.cs
26179 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
26182 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26185 (Try.Emit): Propagate the returns value from the statement.
26187 (Return.Emit): Even if we are leavning
26189 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26191 * modifiers.cs: Fix the computation of MethodAttributes flags.
26193 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26195 * driver.cs: allow compilation of files that start with '/'.
26196 Add a default case when checking the argument of --target.
26198 2002-03-25 Miguel de Icaza <miguel@ximian.com>
26200 * interface.cs: Implement the same search algorithm for types in
26201 the interface code.
26203 * delegate.cs: Do not allow multiple definition.
26205 * Recovered ChangeLog that got accidentally amputated
26207 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26209 * rootcontext.cs: Load manually enum to allow core classes to
26210 contain enumerations.
26212 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26213 Update to new static methods in TypeManager.
26215 * typemanager.cs (GetMethod, GetConstructor): Use our
26216 implementation of FindMembers to find the members, since during
26217 corlib compilation, the types are TypeBuilders and GetMethod and
26218 GetConstructor do not work.
26220 Make all methods in TypeManager static.
26222 (InitCodeHelpers): Split the functionality from
26223 the InitCodeTypes function.
26225 * driver.cs: Call InitCodeHelpers after we have populated the
26228 * cs-parser.jay (delegate_declaration): we did not used to compute
26229 the delegate name correctly for void delegates.
26231 2002-03-24 Miguel de Icaza <miguel@ximian.com>
26233 * rootcontext.cs (RootContext): Init the interface_resolve_order
26234 and type_container_resolve_order always.
26236 (ResolveCore, BootstrapCorlib_ResolveClass,
26237 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26238 compiler when compiling with --nostdlib
26240 * class.cs (TypeContainer.DefineType): Check that our parent is
26241 not null. This test is most important when we are bootstraping
26244 * codegen.cs: Split out the symbol writing code.
26246 2002-03-25 Martin Baulig <martin@gnome.org>
26248 * driver.cs (-g): Made -g an alias for --debug.
26250 2002-03-24 Martin Baulig <martin@gnome.org>
26252 * codegen.cs (SymbolWriter): New public variable. Returns the
26253 current symbol writer.
26254 (CodeGen): Added `bool want_debugging_support' argument to the
26255 constructor. If true, tell the ModuleBuild that we want debugging
26256 support and ask it for the ISymbolWriter.
26257 (Save): If we have a symbol writer, call it's Close() method after
26258 saving the assembly.
26260 * driver.c (--debug): New command line argument to create a
26261 debugger information file.
26263 * location.cs (SymbolDocument): New public property. Returns an
26264 ISymbolDocumentWriter object for the current source file or null
26265 if we don't have a symbol writer.
26267 2002-03-21 Miguel de Icaza <miguel@ximian.com>
26269 * driver.cs (LoadAssembly): Correctly return when all the paths
26270 have been tried and not before.
26272 * statement.cs (Switch.Emit): return the actual coverage for this
26273 statement (returns/not-returns)
26275 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26276 switch of the statement if we are the last switch section. That
26277 kills two problems: try/catch problems (we used to emit an empty
26278 nop at the end) and switch statements where all branches would
26281 2002-03-19 Miguel de Icaza <miguel@ximian.com>
26283 * driver.cs: Add default assemblies (the equivalent to the
26284 Microsoft CSC.RSP file)
26286 * cs-tokenizer.cs: When updating `cols and setting it to zero,
26287 also update tokens_seen and set it to false.
26289 * driver.cs: Implement --recurse for Mike.
26291 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26292 correctly splitting out the paths.
26294 2002-03-18 Miguel de Icaza <miguel@ximian.com>
26296 * interface.cs (Interface.PopulateProperty): Instead of using
26297 `parent' as the declaration space for the set parameters, use
26300 * support.cs (InternalParameters): InternalParameters constructor
26301 takes a DeclSpace instead of a TypeContainer.
26303 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26304 types are being initialized, load the address of it before calling
26307 (New): Provide a mechanism to disable the generation of local
26308 value type temporaries when the caller will be providing us with
26309 an address to store it.
26311 (ArrayCreation.EmitDynamicInitializers): Use it.
26313 2002-03-17 Miguel de Icaza <miguel@ximian.com>
26315 * expression.cs (Invocation.EmitArguments): Only probe for array
26316 property if there is more than one argument. Sorry about that.
26318 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26319 empty param arrays.
26321 * class.cs (Method.LabelParameters): Fix incorrect code path that
26322 prevented the `ParamArrayAttribute' from being applied to the
26325 2002-03-16 Miguel de Icaza <miguel@ximian.com>
26327 * support.cs (ReflectionParameters): Correctly compute whether the
26328 last argument is a params array. Fixes the problem with
26331 * typemanager.cs: Make the assemblies array always be non-null
26332 (empty, but non-null)
26334 * tree.cs (RecordDecl): New function that abstracts the recording
26335 of names. This reports error 101, and provides a pointer to the
26336 previous declaration. Fixes a crash in the compiler.
26338 * cs-parser.jay (constructor_declaration): Update to new grammar,
26339 and provide a constructor_body that can be empty.
26341 2002-03-15 Miguel de Icaza <miguel@ximian.com>
26343 * driver.cs: Add support for --resources.
26345 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26346 Make all types for the various array helper methods be integer.
26348 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26349 CheckState to ConvCast.
26351 (ConvCast): Now it takes a `checked' state argument, to avoid
26352 depending on the emit context for the conversion, and just using
26353 the resolve time setting.
26355 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26356 instead of Invocation.EmitArguments. We do not emit the original
26357 arguments, instead we emit those which have been converted to
26358 unsigned int expressions.
26360 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26362 * codegen.cs: ditto.
26364 * expression.cs (LocalVariableReference): Drop the use of the
26365 Store function that depended on the variable index.
26367 * statement.cs (VariableInfo): Drop the `Idx' property from this
26368 class, as this is not taking into account the indexes for
26369 temporaries tat we generate during the execution, getting the
26372 * class.cs: First emit class initializers, then call the parent
26375 * expression.cs (Binary): Fix opcode emision.
26376 (UnaryMutator.EmitCode): Support checked code generation
26378 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26379 matches for events for both the Static and Instance scans,
26380 pointing to the same element. Fix that.
26382 2002-03-14 Miguel de Icaza <miguel@ximian.com>
26384 * rootcontext.cs (ResolveTree): Always set the
26385 interface_resolve_order, because nested interfaces will be calling
26388 * class.cs (GetInterfaceOrClass): Track the same resolution
26389 process used by TypeManager.LookupType. This fixes the nested
26390 type lookups in class declarations (separate path from
26393 (TypeContainer.DefineType): Also define nested interfaces.
26394 (TypeContainer.RegisterOrder): New public function used to
26395 register the order in which child interfaces need to be closed.
26397 Nested interfaces need to be closed after their parents have been
26400 * interface.cs (InterfaceAttr): Put all the logic for computing
26401 the interface attribute here.
26403 (DefineInterface): Register our interface order with the
26404 RootContext or with the TypeContainer depending on the case.
26406 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26408 * cs-parser.jay: rework foreach statement to work with the new
26409 changes to the policy on SimpleNames.
26411 * report.cs: support Stacktrace on warnings as well.
26413 * makefile: drop --unsafe and /unsafe from the compile.
26415 2002-03-13 Ravi Pratap <ravi@ximian.com>
26417 * ecore.cs (StandardConversionExists): Modify to take an Expression
26418 as the first parameter. Ensure we do null -> reference type conversion
26421 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26422 temporary Expression objects.
26424 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26426 * interface.cs: workaround bug in method overloading resolution
26427 (there is already a bugzilla bug for it).
26429 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26431 We could also solve this problem by having a separate path for
26432 performing type lookups, instead of DoResolve, we could have a
26433 ResolveType entry point, and only participating pieces of the
26434 production (simplename, deref, array) would implement this.
26436 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26437 signal SimpleName to only resolve type names and not attempt to
26438 resolve anything else.
26440 * expression.cs (Cast): Set the flag.
26442 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26444 * class.cs: Only report 108 if there is no `new' modifier.
26446 * cs-parser.jay: rework foreach statement to work with the new
26447 changes to the policy on SimpleNames.
26449 * report.cs: support Stacktrace on warnings as well.
26451 * makefile: drop --unsafe and /unsafe from the compile.
26453 2002-03-11 Miguel de Icaza <miguel@ximian.com>
26455 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26456 lookups here, instead of doing that at parse time. This means
26457 that our grammar will not introduce `LocalVariableReferences' as
26458 expressions at this point. That solves the problem of code like
26462 static void Main ()
26466 This is only half the fix. The full fix requires parameters to
26467 also be handled in this way.
26469 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26470 makes the use more obvious of the DeclSpace. The
26471 ec.TypeContainer.TypeBuilder is now only used to pull the
26472 TypeBuilder for it.
26474 My theory is that I can get rid of the TypeBuilder completely from
26475 the EmitContext, and have typecasts where it is used (from
26476 DeclSpace to where it matters).
26478 The only pending problem is that the code that implements Aliases
26479 is on TypeContainer, and probably should go in DeclSpace.
26481 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26482 lookups here, instead of doing that at parse time. This means
26483 that our grammar will not introduce `LocalVariableReferences' as
26484 expressions at this point. That solves the problem of code like
26488 static void Main ()
26492 This is only half the fix. The full fix requires parameters to
26493 also be handled in this way.
26495 * class.cs (Property.DefineMethod): When implementing an interface
26496 method, set newslot, when implementing an abstract method, do not
26497 set the flag (before we tried never setting it, or always setting
26498 it, which is the difference).
26499 (Indexer.DefineMethod): same.
26500 (Method.DefineMethod): same.
26502 * ecore.cs: Only set the status used flag if we get back a Field.
26504 * attribute.cs: Temporary hack, so Paolo can keep working.
26506 2002-03-08 Ravi Pratap <ravi@ximian.com>
26508 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26509 the unmanaged type in the case we have a MarshalAs attribute.
26511 (Resolve): Handle the case when we are parsing the special MarshalAs
26512 attribute [we need to store the unmanaged type to use later]
26514 * typemanager.cs (marshal_as_attr_type): Built in type for the
26515 MarshalAs Attribute.
26517 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
26518 on parameters and accordingly set the marshalling info.
26520 2002-03-09 Miguel de Icaza <miguel@ximian.com>
26522 * class.cs: Optimizing slightly by removing redundant code after
26523 we switched to the `NoTypes' return value.
26524 (Property.DefineMethod): use NoTypes here too.
26526 This fixes the bug I introduced in my last batch of changes.
26528 2002-03-05 Ravi Pratap <ravi@ximian.com>
26530 * tree.cs (RecordEnum): Add. We now keep track of enums too.
26532 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26533 Enums since those are types too.
26535 * cs-parser.jay (enum_declaration): Record enums as we parse them.
26537 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
26538 thanks to a call during the lookup process.
26540 2002-03-07 Miguel de Icaza <miguel@ximian.com>
26542 * statement.cs (Foreach): Lots of work to accomodate a particular
26543 kind of foreach statement that I had not kept in mind. It is
26544 possible to have foreachs on classes that provide a GetEnumerator
26545 method that return objects that implement the "pattern" for using
26546 a foreach, there is no need to support GetEnumerator
26549 This is needed to compile nant.
26551 * decl.cs: Only report 114 if the member is not `Finalize' and if
26552 the warning level is at least 2.
26554 * class.cs: Moved the compare function from Method to
26557 (MethodSignature.InheritableMemberSignatureCompare): Add new
26558 filter function that is used to extract inheritable methods from a
26561 (Method.Define): Use the new `inheritable_method_signature_filter'
26564 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26567 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26569 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26571 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26573 * expression.cs: Pass location information to
26574 ConvertImplicitStandard.
26576 * class.cs: Added debugging code to track return values from
26579 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26581 * expression.cs (Is.DoResolve): If either side of the `is' is an
26582 interface, do not flag the warning.
26584 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26587 * report.cs: Allow for --fatal to be used with --probe.
26589 * typemanager.cs (NoTypes): Move the definition for the empty Type
26592 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26594 (TypeContainer.DefineProxy): New function used to proxy to parent
26595 implementations when implementing interfaces.
26596 (TypeContainer.ParentImplements): used to lookup if our parent
26597 implements a public function that is required by an interface.
26598 (TypeContainer.VerifyPendingMethods): Hook this up.
26600 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26601 `modules' and `assemblies' arraylists into arrays. We only grow
26602 these are the very early start up of the program, so this improves
26603 the speedof LookupType (nicely measured).
26605 * expression.cs (MakeByteBlob): Replaced unsafe code with
26606 BitConverter, as suggested by Paolo.
26608 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26609 folding of string concatenation, but if either side is a string,
26610 and the other is not, then return null, and let the runtime use
26611 the concatenation on the string plus the object (using
26612 `Object.ToString').
26614 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26616 Constant Folding has been implemented now.
26618 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26619 the error instead on types that are not supported in one's
26622 * constant.cs (Constant and all children): New set of functions to
26623 perform implict and explicit conversions.
26625 * ecore.cs (EnumConstant): Implement the new functions to perform
26626 conversion by proxying to the child expression.
26628 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26629 own separate setting that can not be turned off from the command
26630 line using --unchecked or --checked and is only controlled using
26631 the checked/unchecked statements and expressions. This setting is
26632 used by the constant folder to flag errors.
26634 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26635 ConstantCheckState as well.
26637 During Resolve, they also have to flag the state, because the
26638 constant folder runs completely in the Resolve phase.
26640 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26643 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26645 * cfold.cs: New file, this file contains the constant folder.
26647 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26648 argument to track whether we are using the resulting address to
26649 load or store a value and provide better error messages.
26651 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26652 new AddressOf arguments.
26654 * statement.cs (Foreach.EmitCollectionForeach): Update
26656 * expression.cs (Argument.Emit): Call AddressOf with proper
26657 arguments to track usage.
26659 (New.DoEmit): Call AddressOf with new arguments.
26661 (Unary.Emit): Adjust AddressOf call.
26663 2002-03-01 Ravi Pratap <ravi@ximian.com>
26665 * cs-parser.jay (member_access): Change the case for pre-defined types
26666 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26669 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26672 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26673 essentially like methods and apply attributes like MethodImplOptions to them too.
26675 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26678 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26679 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26682 * Update code everywhere accordingly.
26684 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26686 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26688 2002-02-28 Ravi Pratap <ravi@ximian.com>
26690 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26691 try performing lookups against those instead of jumping straight into using
26692 the 'using' clauses.
26694 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26696 (LookupType): Perform lookups in implicit parents too.
26698 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26699 sequence as RootContext.LookupType.
26701 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26702 the various cases of namespace lookups into this method.
26704 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26706 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26707 in positional arguments)
26709 * class.cs (Operator): Update the AllowedModifiers to contain
26712 * cs-parser.jay: Update operator declaration to allow for the
26713 operator body to be empty.
26715 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26718 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26720 * class.cs (Method.Emit): Label parameters.
26722 * driver.cs: Return 1 or 0 as the program exit code.
26724 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26726 * expression.cs: Special case the `null' object when trying to
26727 auto-compute the type, as anything can be explicitly converted to
26730 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26731 spotting this Paolo.
26733 (Expression.ImplicitNumericConversion): Perform comparissions of
26734 the type using the underlying type in the case of an enumeration
26735 rather than using the enumeration type for the compare.
26737 Cope with the underlying == type case, which is not possible to
26740 (Expression.ConvertNumericExplicit): Perform comparissions of
26741 the type using the underlying type in the case of an enumeration
26742 rather than using the enumeration type for the compare.
26744 * driver.cs: If the user does not supply an extension, assume .exe
26746 * cs-parser.jay (if_statement): Rewrote so that we can track the
26747 location for the if statement.
26749 * expression.cs (Binary.ConstantFold): Only concat strings when
26750 the operation is "+", not everything ;-)
26752 * statement.cs (Statement.EmitBoolExpression): Take a location
26754 (If, While, Do): Track location.
26756 * expression.cs (Binary.ResolveOperator): In the object + string
26757 case, I was missing a call to ConvertImplicit
26759 2002-02-25 Ravi Pratap <ravi@ximian.com>
26761 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26762 Location arguments. Ensure we use RootContext.LookupType to do our work
26763 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26765 * interface.cs (PopulateMethod): Handle the type of the parameter being
26768 * expression.cs (Invocation.BetterFunction): Handle the case when we
26769 have a params method with no fixed arguments and a call is made with no
26772 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26774 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26775 the verbatim-string-literal
26777 * support.cs (InternalParameters.ParameterModifier): handle null
26779 (InternalParameters.ParameterType): ditto.
26781 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26782 duplicating the name of the variable parameter.
26783 (GetParameterByName): Fix bug where we were not looking up array
26784 paramters if they were the only present (thanks Paolo!).
26785 (GetParameterInfo): We only have an empty set of types if both
26786 fixed and array are set to null.
26787 (GetParameterInfo-idx): Handle FixedParameter == null
26789 * cs-parser.jay: Handle the case where there is no catch
26790 statements (missing null test).
26792 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26794 * driver.cs (MainDriver): Be conservative on our command line
26797 Catch DirectoryNotFoundException when calling GetFiles.
26799 (SplitPathAndPattern): Used to split the input specification into
26800 a path and a pattern that we can feed to Directory.GetFiles.
26802 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26804 * statement.cs (Fixed): Implement the last case of the Fixed
26805 statement (string handling).
26807 * expression.cs (StringPtr): New class used to return a char * to
26808 a string; Used by the Fixed statement.
26810 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26812 * expression.cs (Binary.ResolveOperator): Remove redundant
26813 MemberLookup pn parent type.
26814 Optimize union call, we do not need a union if the types are the same.
26815 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26818 Specialize the use of MemberLookup everywhere, instead of using
26819 the default settings.
26821 (StackAlloc): Implement stackalloc keyword.
26823 * cs-parser.jay: Add rule to parse stackalloc.
26825 * driver.cs: Handle /h, /help, /?
26827 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26828 before we supported unsafe code.
26830 * makefile: add --unsafe to the self compilation of mcs.
26832 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26834 * expression.cs (PointerArithmetic): New class that is used to
26835 perform pointer arithmetic.
26836 (Binary.Resolve): Handle pointer arithmetic
26837 Handle pointer comparission.
26838 (ArrayPtr): Utility expression class that is used to take the
26839 address of an array.
26841 (ElementAccess): Implement array access for pointers
26843 * statement.cs (Fixed): Implement fixed statement for arrays, we
26844 are missing one more case before we are done.
26846 * expression.cs (Indirection): Implement EmitAssign and set the
26847 ExprClass to Variable. This allows pointer dereferences to be
26848 treated as variables, and to have values assigned to them.
26850 * ecore.cs (Expression.StoreFromPtr): New utility function to
26851 store values dereferencing.
26853 2002-02-20 Ravi Pratap <ravi@ximian.com>
26855 * expression.cs (Binary.ResolveOperator): Ensure that we are
26856 not trying to operate on a void type - this fixes the reported
26859 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26860 the parent implementation is sealed.
26862 * ../errors/cs0239.cs : Add.
26864 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26866 * typemanager.cs (unverifiable_code_type): Corresponds to
26867 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26868 which have unsafe code in them.
26870 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26873 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26875 * cs-tokenizer.cs: Add support for @"litreal strings"
26877 Make tokenizer accept pre-processor directives
26878 on any column (remove the old C-like limitation).
26880 * rootcontext.cs (EmitCode): Emit any global attributes.
26881 (AddGlobalAttributes): Used to keep track of assembly attributes.
26883 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26885 * cs-parser.jay: Add support for global attributes.
26887 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26889 * expression.cs (Indirection): New helper class. Unary will
26890 create Indirection classes to be able to implement the
26891 IMemoryLocation interface on it.
26893 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26895 * cs-parser.jay (fixed_statement): reference the right statement.
26897 * statement.cs (Fixed.Emit): Finish implementing the fixed
26898 statement for the &x case.
26900 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26902 * class.cs (Property.Define, Method.Define): Remove newslot when
26905 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26906 wrong. NewSlot should only be used if the `new' keyword is present.
26908 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26909 locating our system dir. Sorry about this.
26911 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26913 * driver.cs (GetSystemDir): Compute correctly the location of our
26914 system assemblies. I was using the compiler directory instead of
26915 the library directory.
26917 2002-02-13 Ravi Pratap <ravi@ximian.com>
26919 * expression.cs (BetterFunction): Put back in what Miguel commented out
26920 since it is the correct fix. The problem is elsewhere ;-)
26922 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26923 parameters of the parms method are themselves compatible or not !
26925 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26926 to check that a class implements an interface before saying that an implicit
26927 conversion was allowed. Use ImplementsInterface to do the checking.
26929 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26931 * class.cs (Method.Define): Track whether we are an explicit
26932 implementation or not. And only call DefineMethodOverride if we
26933 are an explicit implementation.
26935 (Property.DefineMethod): Ditto.
26937 2002-02-11 Ravi Pratap <ravi@ximian.com>
26939 * expression.cs (BetterFunction): Catch hideous bug which was
26940 preventing us from detecting ambiguous calls due to implicit casts i.e
26943 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26945 * support.cs (Pair): Remove un-needed method. I figured why I was
26946 getting the error in cs-parser.jay, the variable in a foreach loop
26947 is readonly, and the compiler does not really treat this as a variable.
26949 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26950 instead of EQUALS in grammar.
26952 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26954 * expression.cs (Unary.DoResolve): Check whether the argument is
26957 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26959 * support.cs: Api for Pair to set a value. Despite the fact that
26960 the variables are public the MS C# compiler refuses to compile
26961 code that accesses the field if the variable is part of a foreach
26964 * statement.cs (Fixed): Begin implementation of the fixed
26967 (Block.AddVariable): Return the VariableInfo on success and null
26968 on failure instead of true/false.
26970 * cs-parser.jay (foreach): Catch errors on variables already
26971 defined (we were ignoring this value before) and properly unwind
26972 the block hierarchy
26974 (fixed_statement): grammar for the fixed statement.
26976 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26978 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26979 pointer types to be incretemented.
26981 (SizeOf): Implement.
26983 * cs-parser.jay (pointer_member_access): Implement
26984 expr->IDENTIFIER production.
26986 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26987 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26990 (Unary): Implement indirection.
26992 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26993 use in non-unsafe context).
26995 (SimpleName.DoResolve): Check for pointers in field access on safe
26998 (Expression.LoadFromPtr): Factor the load-indirect code in this
26999 function. This was duplicated in UnboxCast and ParameterReference
27001 2002-01-24 Miguel de Icaza <miguel@ximian.com>
27003 * expression.cs (ComposedCast): report an error if a pointer cast
27004 is used in a safe region.
27006 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27007 pointer type casts in unsafe context.
27009 * codegen.cs (EmitContext): Set up IsUnsafe.
27011 * cs-parser.jay (non_expression_type): Add productions for pointer
27014 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27015 code. We should not use force into static mode if the method is
27016 not virtual. Fixes bug in MIS
27018 * statement.cs (Do.Emit, While.Emit, For.Emit,
27019 Statement.EmitBoolExpression): Add support to Do and While to
27020 propagate infinite loop as `I do return' semantics.
27022 Improve the For case to also test for boolean constants.
27024 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27025 to the list of attributes we can add.
27027 Remove `EmitContext' argument.
27029 * class.cs (Method.Define): Apply parameter attributes.
27030 (Constructor.Define): Apply parameter attributes.
27031 (MethodCore.LabelParameters): Move here the core of labeling
27034 * support.cs (ReflectionParameters.ParameterModifier,
27035 InternalParameters.ParameterModifier): Use IsByRef on the type and
27036 only return the OUT bit for these parameters instead of in/out/ref
27039 This is because I miss-understood things. The ParameterInfo.IsIn
27040 and IsOut represent whether the parameter has the [In] and [Out]
27043 2002-01-22 Miguel de Icaza <miguel@ximian.com>
27045 * ecore.cs (FieldExpr.Emit): Release temporaries.
27047 * assign.cs (LocalTemporary.Release): new function.
27049 * codegen.cs (EmitContext.GetTemporaryStorage,
27050 EmitContext.FreeTemporaryStorage): Rework the way we deal with
27051 temporary storage. Now we can "put back" localbuilders when we
27054 2002-01-21 Miguel de Icaza <miguel@ximian.com>
27056 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27057 need to make a copy of the variable to generate verifiable code.
27059 2002-01-19 Miguel de Icaza <miguel@ximian.com>
27061 * driver.cs: Compute dynamically the system directory.
27063 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27064 Slower, but more generally useful. Used by the abstract
27065 registering implementation.
27067 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27068 the rules for the special rule on Type/instances. First check if
27069 we have the same name, and if so, try that special static path
27070 rather than the instance path.
27072 2002-01-18 Miguel de Icaza <miguel@ximian.com>
27074 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27077 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27078 Enum, ValueType, Delegate or Array for non-corlib compiles.
27080 * cs-tokenizer.cs: Catch long identifiers (645)
27082 * typemanager.cs (IndexerPropetyName): Ravi never tested this
27085 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27086 fix, we were returning too early, so we were not registering
27087 pending methods from abstract classes.
27089 Do not register pending methods if the class is abstract.
27091 * expression.cs (Conditional.DoResolve): Report circular implicit
27092 conversions when we neecd to compute it for conditional
27095 (Is.DoResolve): If the expression is always of the provided type,
27096 flag warning 183. If the expression can not ever be of the
27097 provided type flag warning 184.
27099 * class.cs: Catch 169 as well.
27101 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27104 2002-01-18 Nick Drochak <ndrochak@gol.com>
27106 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
27108 2002-01-17 Miguel de Icaza <miguel@ximian.com>
27110 * interface.cs: (PopulateMethod): Check for pointers being defined
27111 only if the unsafe context is active.
27112 (PopulateProperty): ditto.
27113 (PopulateIndexer): ditto.
27115 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27116 specified. If pointers are present, make sure that they are
27117 present in an unsafe context.
27118 (Constructor, Constructor.Define): ditto.
27119 (Field, Field.Define): ditto.
27120 (Property, Property.Define): ditto.
27121 (Event, Event.Define): ditto.
27123 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27124 hashtable if there are classes or structs defined.
27126 * expression.cs (LocalVariableReference.DoResolve): Simplify this
27127 code, as the constant resolution moved.
27129 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27130 the metadata, so we can flag error 133.
27132 * decl.cs (MemberCore.UnsafeOK): New function to test that a
27133 pointer is being declared in an unsafe context.
27135 2002-01-16 Miguel de Icaza <miguel@ximian.com>
27137 * modifiers.cs (Modifiers.Check): Require a Location argument.
27138 Report error 227 for Unsafe use.
27140 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27142 * statement.cs (For.Emit): If the test is null, then report that
27143 we do `return', as we wont reach anything afterwards.
27145 (Switch.SwitchGoverningType): Track the expression that matched
27148 * driver.cs: Allow negative numbers as an error code to flag.
27150 * cs-parser.jay: Handle 1551.
27152 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27154 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27156 * cs-parser.jay: Report 1518 (type declaration can only contain
27157 class, struct, interface, enum or delegate)
27159 (switch_label): Report 1523 (keywords `case' or `default' must
27162 (opt_switch_sections): Report 1522 (empty switch)
27164 * driver.cs: Report 1515 (response file specified multiple times)
27165 Report 1516 (Source file specified multiple times).
27167 * expression.cs (Argument.Resolve): Signal 1510
27169 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27170 access not allowed in static code)
27172 2002-01-11 Ravi Pratap <ravi@ximian.com>
27174 * typemanager.cs (IsPointerType): Utility method which we are going
27177 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27178 the object type, so we take care of that.
27180 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27182 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27183 added to non-params parameters :-)
27185 * typemanager.cs (CSharpName): Include 'void' type too.
27187 (void_ptr_type): Include in the set of core types.
27189 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
27192 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
27195 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
27196 completely forgotten about it.
27198 2002-01-10 Ravi Pratap <ravi@ximian.com>
27200 * cs-parser.jay (pointer_type): Add. This begins our implementation
27201 of parsing rules for unsafe code.
27203 (unsafe_statement): Implement.
27205 (embedded_statement): Modify to include the above.
27207 * statement.cs (Unsafe): Implement new class for unsafe blocks.
27209 * codegen.cs (EmitContext.InUnsafe): Add. This determines
27210 if the current context is an unsafe one.
27212 * cs-parser.jay (local_variable_pointer_type): Since local variable types
27213 are handled differently, we need separate rules for them.
27215 (local_variable_declaration): Update to use local_variable_pointer_type
27216 to allow variable declarations of unmanaged pointer types.
27218 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27219 in unsafe contexts.
27221 * ../errors/cs0214.cs : Add.
27223 2002-01-16 Nick Drochak <ndrochak@gol.com>
27225 * makefile: remove 'response' file when cleaning.
27227 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27229 * cs-parser.jay: Report 1524.
27231 2002-01-14 Miguel de Icaza <miguel@ximian.com>
27233 * typemanager.cs (RegisterMethod): drop checking if we have
27234 registered this from here
27236 2002-01-12 Miguel de Icaza <miguel@ximian.com>
27238 * class.cs (Method.EmitDestructor): Implement calling our base
27241 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27242 value of InFinally.
27244 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27245 this routine and will wrap the call in a try/catch block. Deal
27248 2002-01-11 Miguel de Icaza <miguel@ximian.com>
27250 * ecore.cs (Expression.MemberLookup): instead of taking a
27251 parameter `same_type' that was used to tell whether we could
27252 access private members we compute our containing type from the
27255 (FieldExpr): Added partial support for volatile fields. This does
27256 not work for volatile fields exposed from assemblies, as I can not
27257 figure out how to extract the modreq from it.
27259 Updated all the source files to use this.
27261 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27262 because it is referenced by MemberLookup very often.
27264 2002-01-09 Ravi Pratap <ravi@ximian.com>
27266 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27267 TypeBuilder.GetCustomAttributes to retrieve what we need.
27269 Get rid of redundant default_member_attr_type as this is the same as
27270 default_member_type which already exists.
27272 * interface.cs, attribute.cs : Update accordingly.
27274 2002-01-08 Miguel de Icaza <miguel@ximian.com>
27276 * typemanager.cs: Enable IndexerPropertyName again. It does not
27277 work for TYpeBuilders though. Ravi, can you please fix this?
27279 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27281 * expression.cs (Argument.Emit): Handle the case of ref objects
27282 being passed to ref functions;
27284 (ParameterReference.EmitLoad): Loads the content of the pointer
27285 without dereferencing.
27287 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27289 * cs-tokenizer.cs: Implemented the pre-processing expressions.
27291 2002-01-08 Ravi Pratap <ravi@ximian.com>
27293 * class.cs (Indexer.DefineMethod): Incorporate the interface
27294 type in the name of the method if we are doing explicit interface
27297 * expression.cs (ConversionExists): Remove as it is completely obsolete.
27299 (BetterConversion): Fix extremely trivial bug where we were referring to
27300 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27303 * ../errors/bug16.cs : Add although we have fixed it.
27305 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27307 * expression.cs (BaseIndexer): Begin implementation.
27309 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27311 * cs-parser.jay (indexer_declarator): Use qualified_identifier
27312 production directly to remove a shift/reduce, and implement
27313 explicit interface implementation.
27315 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27316 after a floating point suffix.
27318 * expression.cs (DoNumericPromotions): Improved the conversion for
27319 uint/uint. If we have a constant, we avoid doing a typecast to a
27322 * class.cs (Indexer): Implement explicit interface implementation
27325 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27327 * class.cs: make the default instance constructor public and hidebysig.
27329 2001-01-03 Ravi Pratap <ravi@ximian.com>
27331 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27332 so we can call it from elsewhere.
27334 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27335 we emit it internally if the class has a defined indexer; otherwise the user
27336 emits it by decorating the class definition with the DefaultMemberAttribute.
27338 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27339 attribute is not used on a type which defines an indexer.
27341 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27342 character when we skip whitespace.
27344 * ../errors/cs0646.cs : Add.
27346 2002-01-03 Miguel de Icaza <miguel@ximian.com>
27348 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27351 * makefile: Add practical target `mcs3.exe' which builds the third
27352 generation compiler.
27354 * expression.cs (New): Fix structures constructor calling.
27356 * class.cs (Property, Method, Indexer): Emit Final flag on the
27357 method if we are an interface implementation and we are not
27360 * ecore.cs (PropertyExpr): New public field `IsBase', tells
27361 whether this property is referencing a `base' method.
27363 * expression.cs (Invocation.EmitCall): take an extra argument:
27364 is_base, this is used to determine whether the `call' or
27365 `callvirt' opcode should be used.
27368 * delegate.cs: update EmitCall.
27370 * class.cs (Method.Define): Set NewSlot for the cases where we are
27371 not implementing an interface method.
27373 (Property.Define): ditto.
27375 2002-01-02 Miguel de Icaza <miguel@ximian.com>
27377 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27378 'r'. Allows mcs to parse itself fully.
27380 2002-01-02 Ravi Pratap <ravi@ximian.com>
27382 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27383 of the number of initializers that require the InitializeArray method.
27385 (CheckIndices): Store the Expression in all cases - not the plain value. Also
27386 update the above field where necessary.
27388 (MakeByteBlob): Update accordingly.
27390 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
27393 (EmitDynamicInitializers): Update in accordance with the new optimization.
27395 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27396 same OpCode applies.
27398 * cs-parser.jay : Fix some glaring errors I introduced.
27400 2002-01-01 Ravi Pratap <ravi@ximian.com>
27402 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27403 so that we can check for name clashes there too.
27405 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27406 for interface indexers.
27408 * interfaces.cs (Define): Emit the default member attribute.
27410 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27411 variable was being referred to while setting the value ;-)
27413 2002-01-01 Miguel de Icaza <miguel@ximian.com>
27415 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27416 byte-by-byte information when we know the data is zero.
27418 Make the block always a multiple of 4, because
27419 DefineInitializedData has a bug.
27421 * assign.cs: Fix, we should assign from the temporary, not from
27424 * expression.cs (MakeByteBlob): Fix my incorrect code.
27426 2001-12-31 Miguel de Icaza <miguel@ximian.com>
27428 * typemanager.cs (EnumToUnderlying): This function is used to get
27429 the underlying type from an enumeration, because it does not
27432 * constant.cs: Use the I4_S form for values between -128 and 127.
27434 * statement.cs (Block.LookupLabel): Looks up a label.
27435 (Block): Drop support for labeled blocks.
27437 (LabeledStatement): New kind of statement that represents a label
27440 (Goto): Finally implement this bad boy.
27442 * cs-parser.jay: Update to reflect new mechanism to implement
27445 2001-12-30 Miguel de Icaza <miguel@ximian.com>
27447 * codegen.cs (EmitContext.This): a codegen property that keeps the
27448 a single instance of this instead of creating many different this
27451 * delegate.cs (Delegate.DoResolve): Update to use the property;
27453 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27455 * expression.cs (BaseAccess.DoResolve): Ditto.
27457 2001-12-29 Ravi Pratap <ravi@ximian.com>
27459 * typemanager.cs (methodimpl_attr_type): Add to hold the type
27460 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27462 (InitCoreTypes): Update accordingly.
27464 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27465 so we can quickly store the state.
27467 (ApplyAttributes): Set the correct implementation flags
27468 for InternalCall methods.
27470 2001-12-29 Miguel de Icaza <miguel@ximian.com>
27472 * expression.cs (EmitCall): if a method is not virtual, then do
27473 not use callvirt on it.
27475 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27476 user defined stuff) requires the use of stobj, which takes an
27477 address on the stack instead of an array and an index. So emit
27478 the Ldelema operation for it.
27480 (EmitStoreOpcode): Use stobj for valuetypes.
27482 (UnaryMutator.EmitCode): Use the right 1 value depending on
27483 whether we are dealing with int64/uint64, float or doubles.
27485 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27486 constructors that I implemented last night.
27488 (Constructor.IsDefault): Fix to work properly for static
27491 * cs-parser.jay (CheckDef): report method signature errors.
27492 Update error number 103 to be 132.
27494 * decl.cs: New AdditionResult enumeration value: MethodExists.
27495 Although we do this check for methods later on in the semantic
27496 analysis, catching repeated default constructors is so easy that
27497 we catch these here.
27499 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27502 (ParameterReference.EmitAssign, Emit): handle
27505 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27506 (ArrayAccess.EmitStoreOpcode): ditto.
27508 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27510 * expression.cs (MakeByteBlob): Complete all the missing types
27511 (uint, short, ushort, byte, sbyte)
27513 * class.cs: Only init instance field initializers on instance
27516 Rename `constructors' to instance_constructors.
27518 (TypeContainer.AddConstructor): Only add constructors to the list
27519 if it is not static.
27521 Make sure that we handle default_static_constructor independently
27522 everywhere where we handle instance_constructors
27524 2001-12-28 Miguel de Icaza <miguel@ximian.com>
27526 * class.cs: Do not lookup or create a base initializer for a
27527 static constructor.
27529 (ConstructorInitializer.Resolve): use the proper type to lookup
27532 * cs-parser.jay: Report error 1585 (modifiers between type and name).
27534 * enum.cs, interface.cs: Remove CloseType, this is taken care by
27537 * decl.cs: CloseType is now an virtual method, the default
27538 implementation just closes this type.
27540 2001-12-28 Ravi Pratap <ravi@ximian.com>
27542 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27543 to PreserveSig by default. Also emit HideBySig on such methods.
27545 Basically, set the defaults to standard values.
27547 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27548 argument, if candidate is better, it can't be worse than the best !
27550 (Invocation): Re-write bits to differentiate between methods being
27551 applicable in their expanded form and their normal form - for params
27554 Get rid of use_standard everywhere as only standard conversions are allowed
27555 in overload resolution.
27557 More spec conformance.
27559 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27561 * driver.cs: Add --timestamp, to see where the compiler spends
27564 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27565 `this' in static code.
27567 (SimpleName.DoResolve): Implement in terms of a helper function
27568 that allows static-references to be passed upstream to
27571 (Expression.ResolveWithSimpleName): Resolve specially simple
27572 names when called by MemberAccess to implement the special
27575 (Expression.ImplicitReferenceConversion): Handle conversions from
27576 Null to reference types before others, as Null's type is
27579 * expression.cs (Invocation.EmitCall): Handle the special case of
27580 calling methods declared on a reference type from a ValueType
27581 (Base classes System.Object and System.Enum)
27583 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27584 the left hand side is a TypeExpr, not on every enumeration.
27586 (Binary.Resolve): If types are reference types, then do a cast to
27587 object on operators != and == of both arguments.
27589 * typemanager.cs (FindMembers): Extract instance and static
27590 members if requested.
27592 * interface.cs (PopulateProperty): Use void_type instead of null
27593 as the return type for the setter method.
27595 (PopulateIndexer): ditto.
27597 2001-12-27 Ravi Pratap <ravi@ximian.com>
27599 * support.cs (ReflectionParameters): Fix minor bug where we
27600 were examining the wrong parameter for the ParamArray attribute.
27602 Cope with requests for the type of the parameter at position
27603 greater than the params parameter's. We now return the element
27604 type of the params array as that makes more sense.
27606 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27607 accordingly as we no longer have to extract the element type
27610 (Invocation.OverloadResolve): Update.
27612 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27614 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27615 against IEnumerator, test whether the return value is a descendant
27616 of the IEnumerator interface.
27618 * class.cs (Indexer.Define): Use an auxiliary method to implement
27619 the other bits of the method definition. Begin support for
27620 explicit interface implementation.
27622 (Property.DefineMethod): Use TypeManager.void_type instead of null
27623 for an empty return value.
27625 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27627 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27628 dealing with a FieldExpr which is composed of a FieldBuilder, in
27629 the code path we did extract the constant, but we should have
27630 obtained the underlying value to be able to cast it (otherwise we
27631 end up in an infinite loop, this is what Ravi was running into).
27633 (ArrayCreation.UpdateIndices): Arrays might be empty.
27635 (MemberAccess.ResolveMemberAccess): Add support for section
27636 14.5.4.1 that deals with the special case of E.I when E is a type
27637 and something else, that I can be a reference to a static member.
27639 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27640 handle a particular array type to create byte blobs, it is just
27641 something we dont generate byteblobs for.
27643 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27646 * location.cs (Push): remove the key from the hashtable that we
27647 are about to add. This happens for empty files.
27649 * driver.cs: Dispose files after we have parsed them.
27651 (tokenize): new function that only runs the tokenizer on its
27652 input, for speed testing.
27654 2001-12-26 Ravi Pratap <ravi@ximian.com>
27656 * class.cs (Event.Define): Define the private field only if there
27657 are no accessors defined.
27659 * expression.cs (ResolveMemberAccess): If there is no associated
27660 field with the event, that means we have an event defined with its
27661 own accessors and we should flag error cs0070 since transforming
27662 ourselves into a field is not valid in that case.
27664 * ecore.cs (SimpleName.DoResolve): Same as above.
27666 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27667 and charset to sane values.
27669 2001-12-25 Ravi Pratap <ravi@ximian.com>
27671 * assign.cs (DoResolve): Perform check on events only if they
27672 are being accessed outside the declaring type.
27674 * cs-parser.jay (event_declarations): Update rules to correctly
27675 set the type of the implicit parameter etc.
27677 (add_accessor, remove_accessor): Set current local parameters.
27679 * expression.cs (Binary): For delegate addition and subtraction,
27680 cast the return value from the method into the appropriate delegate
27683 2001-12-24 Ravi Pratap <ravi@ximian.com>
27685 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27686 of these as the workaround is unnecessary.
27688 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27689 delegate data - none of that is needed at all.
27691 Re-write bits to extract the instance expression and the delegate method
27694 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27697 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27698 of attaching attributes instead of duplicating code everywhere.
27700 * everywhere : Update code to do attribute emission using the above method.
27702 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27704 * expression.cs (IsParamsMethodApplicable): if there are not
27705 parameters, return immediately.
27707 * ecore.cs: The 0 literal can be implicity converted to an enum
27710 (SimpleName.DoResolve): First lookup the type, then lookup the
27713 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27714 want to get its address. If the InstanceExpression is not
27715 addressable, store the result in a temporary variable, then get
27718 * codegen.cs: Only display 219 errors on warning level or above.
27720 * expression.cs (ArrayAccess): Make it implement the
27721 IMemoryLocation interface.
27723 (Binary.DoResolve): handle the operator == (object a, object b)
27724 and operator != (object a, object b) without incurring into a
27725 BoxedCast (because 5 != o should never be performed).
27727 Handle binary enumerator operators.
27729 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27730 value type, otherwise use Ldelem_ref.
27732 Use precomputed names;
27734 (AddressOf): Implement address of
27736 * cs-parser.jay (labeled_statement): Fix recursive block
27737 addition by reworking the production.
27739 * expression.cs (New.DoEmit): New has a special case:
27741 If we are dealing with a ValueType, we have a few
27742 situations to deal with:
27744 * The target of New is a ValueType variable, that is
27745 easy, we just pass this as the variable reference
27747 * The target of New is being passed as an argument,
27748 to a boxing operation or a function that takes a
27751 In this case, we need to create a temporary variable
27752 that is the argument of New.
27755 2001-12-23 Ravi Pratap <ravi@ximian.com>
27757 * rootcontext.cs (LookupType): Check that current_type is not null before
27758 going about looking at nested types.
27760 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27761 not implement the IAssignMethod interface any more.
27763 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27764 where we tranform them into FieldExprs if they are being resolved from within
27765 the declaring type.
27767 * ecore.cs (SimpleName.DoResolve): Do the same here.
27769 * assign.cs (DoResolve, Emit): Clean up code considerably.
27771 * ../errors/bug10.cs : Add.
27773 * ../errors/cs0070.cs : Add.
27775 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27777 * assign.cs : Get rid of EventIsLocal everywhere.
27779 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27781 * ecore.cs (ConvertIntLiteral): finished the implementation.
27783 * statement.cs (SwitchLabel): Convert the value we are using as a
27784 key before looking up the table.
27786 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27788 * codegen.cs (EmitTopBlock): Require a Location argument now.
27790 * cs-parser.jay (constructor_declarator): We need to setup
27791 current_local_parameters before we parse the
27792 opt_constructor_initializer, to allow the variables to be bound
27793 to the constructor arguments.
27795 * rootcontext.cs (LookupType): First lookup nested classes in our
27796 class and our parents before we go looking outside our class.
27798 * expression.cs (ConstantFold): Extract/debox the values at the
27801 * rootcontext.cs (EmitCode): Resolve the constants first before we
27802 resolve the types. This is not really needed, but it helps debugging.
27804 * statement.cs: report location.
27806 * cs-parser.jay: pass location to throw statement.
27808 * driver.cs: Small bug fix.
27810 * report.cs: Updated format to be 4-zero filled digits.
27812 2001-12-22 Ravi Pratap <ravi@ximian.com>
27814 * expression.cs (CheckIndices): Fix minor bug where the wrong
27815 variable was being referred to ;-)
27817 (DoEmit): Do not call EmitStaticInitializers when the
27818 underlying type is System.Object.
27820 2001-12-21 Ravi Pratap <ravi@ximian.com>
27822 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27823 and do the usual workaround for SRE.
27825 * class.cs (MyEventBuilder.EventType): New member to get at the type
27826 of the event, quickly.
27828 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27830 * assign.cs (Assign.DoResolve): Handle the case when the target
27831 is an EventExpr and perform the necessary checks.
27833 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27836 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27838 (EventExpr): Set the type in the constructor itself since we
27839 are meant to be born fully resolved.
27841 (EventExpr.Define): Revert code I wrote earlier.
27843 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27844 instance expression is null. The instance expression is a This in that case
27845 or a null, depending on whether it is a static method or not.
27847 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27848 refers to more than one method.
27850 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27851 and accordingly flag errors.
27853 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27855 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27857 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27859 * location.cs (ToString): Provide useful rutine.
27861 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27863 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27864 objects, return the actual integral boxed.
27866 * statement.cs (SwitchLabel): define an ILLabel for each
27869 (Switch.CheckSwitch): If the value is a Literal, extract
27870 the underlying literal.
27872 Also in the unused hashtable we had, add the SwitchLabel so we can
27873 quickly look this value up.
27875 * constant.cs: Implement a bunch of new constants. Rewrite
27876 Literal based on this. Made changes everywhere to adapt to this.
27878 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27879 dereferencing array only once, and also copes with enumrations.
27881 bytes are two bytes wide, not one.
27883 (Cast): Perform constant conversions.
27885 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27886 wrappers to the literals here.
27888 * expression.cs (DoNumericPromotions): long literals can converted
27889 to ulong implicity (this is taken care of elsewhere, but I was
27890 missing this spot).
27892 * ecore.cs (Expression.Literalize): Make the return type Literal,
27893 to improve type checking.
27895 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27897 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27899 * literal.cs: Revert code from ravi that checked the bounds. The
27900 bounds are sane by the definition of the type itself.
27902 * typemanager.cs: Fix implementation of ImplementsInterface. We
27903 need to actually look up in our parent hierarchy for interfaces
27906 * const.cs: Use the underlying type for enumerations
27908 * delegate.cs: Compute the basename for the delegate creation,
27909 that should fix the delegate test case, and restore the correct
27910 Type Lookup semantics in rootcontext
27912 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27913 referencing a nested type with the Reflection API is using the "+"
27916 * cs-parser.jay: Do not require EOF token at the end.
27918 2001-12-20 Ravi Pratap <ravi@ximian.com>
27920 * rootcontext.cs (LookupType): Concatenate type names with
27921 a '.' instead of a '+' The test suite passes again.
27923 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27924 field of the enumeration.
27926 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27927 the case when the member is an EventExpr.
27929 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27930 static has an associated instance expression.
27932 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27934 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27936 * class.cs (Event.Define): Register event and perform appropriate checks
27939 We define the Add and Remove methods even if the use provides none because
27940 in that case, we provide default implementations ourselves.
27942 Define a private field of the type of the event. This is done by the CSC compiler
27943 and we should be doing it too ;-)
27945 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27946 More methods we use in code we generate.
27948 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27951 (InitCoreTypes): Update accordingly for the above.
27953 * class.cs (Event.Emit): Generate code for default accessors that we provide
27955 (EmitDefaultMethod): Do the job in the above.
27957 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27960 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27962 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27963 builders even if we were missing one.
27965 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27966 pass the Basename as our class name instead of the Name. The
27967 basename will be correctly composed for us.
27969 * parameter.cs (Paramters): Now takes a Location argument.
27971 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27972 make all the code call directly LookupType in RootContext and take
27973 this chance to pass the Location information everywhere.
27975 * Everywhere: pass Location information.
27977 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27979 * class.cs (Constructor.Define): Updated way of detecting the
27980 length of the parameters.
27982 (TypeContainer.DefineType): Use basename as the type name for
27985 (TypeContainer.Define): Do not recursively define types here, as
27986 definition is taken care in order by the RootContext.
27988 * tree.cs: Keep track of namespaces in a per-file basis.
27990 * parameter.cs (Parameter.ComputeSignature): Update to use
27993 (Parameters.GetSignature): ditto.
27995 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27996 instead of a TypeContainer.
27998 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27999 resolve names. Because we need to be resolve in our context, not
28002 * driver.cs: Implement response files.
28004 * class.cs (TypeContainer.DefineType): If we are defined, do not
28005 redefine ourselves.
28007 (Event.Emit): Emit the code for add/remove handlers.
28008 (Event.Define): Save the MethodBuilders for add/remove.
28010 * typemanager.cs: Use pair here too.
28012 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28013 DictionaryEntry requires the first argument to be non-null.
28015 (enum_declaration): Compute full name for registering the
28018 (delegate_declaration): Instead of using
28019 formal_parameter_list, use opt_formal_parameter_list as the list
28022 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28023 (EventParsing): New property that controls whether `add' and
28024 `remove' are returned as tokens or identifiers (for events);
28026 2001-12-19 Ravi Pratap <ravi@ximian.com>
28028 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28029 use MyEventBuilder only and let it wrap the real builder for us.
28031 (MyEventBuilder): Revamp constructor etc.
28033 Implement all operations that we perform on EventBuilder in precisely the same
28036 (FindMembers): Update to use the EventBuilder member.
28038 (Event.Emit): Update accordingly.
28040 2001-12-18 Ravi Pratap <ravi@ximian.com>
28042 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28043 by calling the appropriate methods.
28045 (GetCustomAttributes): Make stubs as they cannot possibly do anything
28048 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28050 2001-12-17 Ravi Pratap <ravi@ximian.com>
28052 * delegate.cs (Delegate.Populate): Check that the return type
28053 and various parameters types are indeed accessible.
28055 * class.cs (Constructor.Define): Same here.
28057 (Field.Define): Ditto.
28059 (Event.Define): Ditto.
28061 (Operator.Define): Check that the underlying Method defined itself
28062 correctly - so it's MethodBuilder should not be null.
28064 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28065 expression happens to be null.
28067 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28068 members but as of now we don't seem to be able to do anything really useful with it.
28070 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28071 not the EventBuilder.
28073 2001-12-18 Miguel de Icaza <miguel@ximian.com>
28075 * cs-tokenizer.cs: Add support for defines.
28076 Add support for #if, #elif, #else, #endif
28078 (eval_var): evaluates a variable.
28079 (eval): stubbed for evaluating functions.
28081 * cs-parser.jay: Pass the defines information
28083 * driver.cs: Add --define command line option.
28085 * decl.cs: Move MemberCore here.
28087 Make it the base class for DeclSpace. This allows us to catch and
28088 report 108 and 109 for everything now.
28090 * class.cs (TypeContainer.Define): Extract all the members
28091 before populating and emit the warning 108 (new keyword required
28092 to override) instead of having each member implement this.
28094 (MemberCore.Define): New abstract method, we will be using this in
28095 the warning reporting engine in Populate.
28097 (Operator.Define): Adjust to new MemberCore protocol.
28099 * const.cs (Const): This does not derive from Expression, it is a
28100 temporary object we use to create fields, it is a MemberCore.
28102 * class.cs (Method.Define): Allow the entry point to be in a
28105 * driver.cs: Rewrite the argument handler to clean it up a bit.
28107 * rootcontext.cs: Made it just an auxiliary namespace feature by
28108 making everything static.
28110 * driver.cs: Adapt code to use RootContext type name instead of
28113 * delegate.cs: Remove RootContext argument.
28115 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28118 * class.cs (Event.Define): The lookup can fail.
28120 * cs-tokenizer.cs: Begin implementation of pre-procesor.
28122 * expression.cs: Resolve the this instance before invoking the code.
28124 2001-12-17 Miguel de Icaza <miguel@ximian.com>
28126 * cs-parser.jay: Add a production in element_access that allows
28127 the thing to become a "type" reference. This way we can parse
28128 things like "(string [])" as a type.
28130 Note that this still does not handle the more complex rules of
28134 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
28136 * ecore.cs: (CopyNewMethods): new utility function used to
28137 assemble the list of methods from running FindMembers.
28139 (MemberLookup): Rework FindMembers so that
28141 2001-12-16 Miguel de Icaza <miguel@ximian.com>
28143 * class.cs (TypeContainer): Remove Delegates who fail to be
28146 * delegate.cs (Populate): Verify that we dont get null return
28147 values. TODO: Check for AsAccessible.
28149 * cs-parser.jay: Use basename to emit error 574 (destructor should
28150 have the same name as container class), not the full name.
28152 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28153 possible representation.
28155 Also implements integer type suffixes U and L.
28157 2001-12-15 Miguel de Icaza <miguel@ximian.com>
28159 * expression.cs (ArrayCreation.DoResolve): We need to do the
28160 argument resolution *always*.
28162 * decl.cs: Make this hold the namespace. Hold the root context as
28164 (LookupType): Move here.
28166 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28168 * location.cs (Row, Name): Fixed the code, it was always returning
28169 references to the first file.
28171 * interface.cs: Register properties defined through interfaces.
28173 * driver.cs: Add support for globbing on the command line
28175 * class.cs (Field): Make it derive from MemberCore as well.
28178 2001-12-15 Ravi Pratap <ravi@ximian.com>
28180 * class.cs (Event::Define): Check that the type of the event is a delegate
28181 type else flag error #66.
28183 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28186 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28187 values of EntryPoint, CharSet etc etc.
28189 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28191 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28192 be null and we should ignore this. I am not sure if this is really clean. Apparently,
28193 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28194 which needs this to do its work.
28196 * ../errors/cs0066.cs : Add.
28198 2001-12-14 Miguel de Icaza <miguel@ximian.com>
28200 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28203 * class.cs: (MethodSignature.MethodSignature): Removed hack that
28204 clears out the parameters field.
28205 (MemberSignatureCompare): Cleanup
28207 (MemberCore): New base class used to share code between MethodCore
28210 (RegisterRequiredImplementations) BindingFlags.Public requires
28211 either BindingFlags.Instace or Static. Use instance here.
28213 (Property): Refactored code to cope better with the full spec.
28215 * parameter.cs (GetParameterInfo): Return an empty array instead
28218 * class.cs (Property): Abstract or extern properties have no bodies.
28220 * parameter.cs (GetParameterInfo): return a zero-sized array.
28222 * class.cs (TypeContainer.MethodModifiersValid): Move all the
28223 method modifier validation to the typecontainer so we can reuse
28224 this on properties.
28226 (MethodCore.ParameterTypes): return an empty sized array of types.
28228 (Property.Define): Test property modifier validity.
28230 Add tests for sealed/override too.
28232 (Method.Emit): abstract or extern methods have no bodies.
28234 2001-12-14 Ravi Pratap <ravi@ximian.com>
28236 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28239 (Method::Define, ::Emit): Modify accordingly.
28241 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28243 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28245 * makefile: Pass in /unsafe.
28247 2001-12-13 Miguel de Icaza <miguel@ximian.com>
28249 * class.cs (MakeKey): Kill routine.
28251 * class.cs (TypeContainer.Define): Correctly define explicit
28252 method implementations (they require the full interface name plus
28255 * typemanager.cs: Deply the PtrHashtable here and stop using the
28256 lame keys. Things work so much better.
28258 This of course broke everyone who depended on `RegisterMethod' to
28259 do the `test for existance' test. This has to be done elsewhere.
28261 * support.cs (PtrHashtable): A hashtable that avoid comparing with
28262 the object stupid Equals method (because, that like fails all over
28263 the place). We still do not use it.
28265 * class.cs (TypeContainer.SetRequiredInterface,
28266 TypeContainer.RequireMethods): Killed these two routines and moved
28267 all the functionality to RegisterRequiredImplementations.
28269 (TypeContainer.RegisterRequiredImplementations): This routine now
28270 registers all the implementations required in an array for the
28271 interfaces and abstract methods. We use an array of structures
28272 which can be computed ahead of time to reduce memory usage and we
28273 also assume that lookups are cheap as most classes will not
28274 implement too many interfaces.
28276 We also avoid creating too many MethodSignatures.
28278 (TypeContainer.IsInterfaceMethod): Update and optionally does not
28279 clear the "pending" bit if we find that there are problems with
28282 (TypeContainer.VerifyPendingMethods): Update to report errors of
28283 methods that look like implementations but are not.
28285 (TypeContainer.Define): Add support for explicit interface method
28288 2001-12-12 Miguel de Icaza <miguel@ximian.com>
28290 * typemanager.cs: Keep track of the parameters here instead of
28291 being a feature of the TypeContainer.
28293 * class.cs: Drop the registration of parameters here, as
28294 InterfaceMethods are also interface declarations.
28296 * delegate.cs: Register methods with the TypeManager not only with
28297 the TypeContainer. This code was buggy.
28299 * interface.cs: Full registation here.
28301 2001-12-11 Miguel de Icaza <miguel@ximian.com>
28303 * expression.cs: Remove reducer for binary expressions, it can not
28306 * const.cs: Put here the code that used to go into constant.cs
28308 * constant.cs: Put here the code for constants, this is a new base
28309 class for Literals.
28311 * literal.cs: Make Literal derive from Constant.
28313 2001-12-09 Miguel de Icaza <miguel@ximian.com>
28315 * statement.cs (Return.Emit): Report error 157 if the user
28316 attempts to return from a finally block.
28318 (Return.Emit): Instead of emitting a return, jump to the end of
28321 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28322 LocalBuilder to store the result of the function. ReturnLabel is
28323 the target where we jump.
28326 2001-12-09 Radek Doulik <rodo@ximian.com>
28328 * cs-parser.jay: remember alias in current namespace
28330 * ecore.cs (SimpleName::DoResolve): use aliases for types or
28333 * class.cs (LookupAlias): lookup alias in my_namespace
28335 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28337 (LookupAlias): lookup alias in this and if needed in parent
28340 2001-12-08 Miguel de Icaza <miguel@ximian.com>
28344 * rootcontext.cs: (ModuleBuilder) Made static, first step into
28345 making things static. I need this to avoid passing the
28346 TypeContainer when calling ParameterType.
28348 * support.cs (InternalParameters.ParameterType): Remove ugly hack
28349 that did string manipulation to compute the type and then call
28350 GetType. Use Parameter.ParameterType instead.
28352 * cs-tokenizer.cs: Consume the suffix for floating values.
28354 * expression.cs (ParameterReference): figure out whether this is a
28355 reference parameter or not. Kill an extra variable by computing
28356 the arg_idx during emission.
28358 * parameter.cs (Parameters.GetParameterInfo): New overloaded
28359 function that returns whether a parameter is an out/ref value or not.
28361 (Parameter.ParameterType): The type of the parameter (base,
28362 without ref/out applied).
28364 (Parameter.Resolve): Perform resolution here.
28365 (Parameter.ExternalType): The full type (with ref/out applied).
28367 * statement.cs (Using.Emit, Using.EmitExpression): Implement
28368 support for expressions on the using statement.
28370 2001-12-07 Miguel de Icaza <miguel@ximian.com>
28372 * statement.cs (Using.EmitLocalVariableDecls): Split the
28373 localvariable handling of the using statement.
28375 (Block.EmitMeta): Keep track of variable count across blocks. We
28376 were reusing slots on separate branches of blocks.
28378 (Try.Emit): Emit the general code block, we were not emitting it.
28380 Check the type of the declaration to be an IDisposable or
28381 something that can be implicity converted to it.
28383 Emit conversions if required.
28385 * ecore.cs (EmptyExpression): New utility class.
28386 (Expression.ImplicitConversionExists): New utility function.
28388 2001-12-06 Miguel de Icaza <miguel@ximian.com>
28390 * statement.cs (Using): Implement.
28392 * expression.cs (LocalVariableReference): Support read only variables.
28394 * statement.cs: Remove the explicit emit for the Leave opcode.
28395 (VariableInfo): Add a readonly field.
28397 2001-12-05 Miguel de Icaza <miguel@ximian.com>
28399 * ecore.cs (ConvCast): new class used to encapsulate the various
28400 explicit integer conversions that works in both checked and
28401 unchecked contexts.
28403 (Expression.ConvertNumericExplicit): Use new ConvCast class to
28404 properly generate the overflow opcodes.
28406 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28408 * statement.cs: The correct type for the EmptyExpression is the
28409 element_type, not the variable type. Ravi pointed this out.
28411 2001-12-04 Ravi Pratap <ravi@ximian.com>
28413 * class.cs (Method::Define): Handle PInvoke methods specially
28414 by using DefinePInvokeMethod instead of the usual one.
28416 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28417 above to do the task of extracting information and defining the method.
28419 2001-12-04 Ravi Pratap <ravi@ximian.com>
28421 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28422 of the condition for string type.
28424 (Emit): Move that here.
28426 (ArrayCreation::CheckIndices): Keep string literals in their expression
28429 (EmitDynamicInitializers): Handle strings appropriately.
28431 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28433 * codegen.cs (EmitContext): Replace multiple variables with a
28434 single pointer to the current Switch statement.
28436 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28439 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28443 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28446 (Foreach.Emit): Foreach on arrays was not setting
28447 up the loop variables (for break/continue).
28449 (GotoCase): Semi-implented.
28451 2001-12-03 Ravi Pratap <ravi@ximian.com>
28453 * attribute.cs (CheckAttribute): Handle system attributes by using
28454 Attribute.GetAttributes to examine information we need.
28456 (GetValidPlaces): Same here.
28458 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28460 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28462 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28464 (Method::Define): Set appropriate flags if we have a DllImport attribute.
28466 (Method::Emit): Handle the case when we are a PInvoke method.
28468 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28470 * expression.cs: Use ResolveWithSimpleName on compound names.
28472 2001-12-02 Ravi Pratap <ravi@ximian.com>
28474 * constant.cs (EmitConstant): Make sure we resolve the associated expression
28475 before trying to reduce it.
28477 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28479 * constant.cs (LookupConstantValue): Implement.
28481 (EmitConstant): Use the above in emitting the constant.
28483 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28484 that are user-defined by doing a LookupConstantValue on them.
28486 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28489 2001-11-29 Miguel de Icaza <miguel@ximian.com>
28491 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28493 (BaseAccess.DoResolve): Implement.
28495 (MemberAccess.DoResolve): Split this routine into a
28496 ResolveMemberAccess routine that can be used independently
28498 2001-11-28 Miguel de Icaza <miguel@ximian.com>
28500 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28501 As that share bits of the implementation. Is returns a boolean,
28502 while As returns the Type that is being probed.
28504 2001-12-01 Ravi Pratap <ravi@ximian.com>
28506 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28507 instead of a Literal - much easier.
28509 (EnumInTransit): Remove - utterly useless :-)
28511 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28513 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28515 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28516 chain when we have no associated expression.
28518 2001-11-30 Ravi Pratap <ravi@ximian.com>
28520 * constant.cs (Define): Use Location while reporting the errror.
28522 Also emit a warning when 'new' is used and there is no inherited
28525 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
28528 (LookupEnumValue): Implement to lookup an enum member's value and define it
28531 (Populate): Re-write accordingly to use the above routine.
28533 2001-11-27 Miguel de Icaza <miguel@ximian.com>
28535 * expression.cs (This): Fix prototype for DoResolveLValue to
28536 override the base class DoResolveLValue.
28538 * cs-parser.cs: Report errors cs574 and cs575 (destructor
28541 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28542 (we need to load the address of the field here). This fixes
28545 (FieldExpr.DoResolveLValue): Call the DoResolve
28546 function to initialize the Instance expression.
28548 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28549 correctly the GetEnumerator operation on a value type.
28551 * cs-parser.jay: Add more simple parsing error catches.
28553 * statement.cs (Switch): Add support for string switches.
28554 Handle null specially.
28556 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
28558 2001-11-28 Ravi Pratap <ravi@ximian.com>
28560 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28562 (declare_local_constant): New helper function.
28564 * statement.cs (AddConstant): Keep a separate record of constants
28566 (IsConstant): Implement to determine if a variable is a constant.
28568 (GetConstantExpression): Implement.
28570 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28572 * statement.cs (IsVariableDefined): Re-write.
28574 2001-11-27 Ravi Pratap <ravi@ximian.com>
28576 * class.cs (TypeContainer::FindMembers): Look for constants
28577 in the case when we are looking for MemberTypes.Field
28579 * expression.cs (MemberAccess::DoResolve): Check that in the
28580 case we are a FieldExpr and a Literal, we are not being accessed
28581 by an instance reference.
28583 * cs-parser.jay (local_constant_declaration): Implement.
28585 (declaration_statement): Implement for constant declarations.
28587 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28589 * statement.cs (Switch): Catch double defaults.
28591 (Switch): More work on the switch() statement
28592 implementation. It works for integral values now, need to finish
28596 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28598 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28599 integer literals into other integer literals. To be used by
28602 2001-11-24 Ravi Pratap <ravi@ximian.com>
28604 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28607 (EmitDynamicInitializers): Cope with the above since we extract data
28608 directly from ArrayData now.
28610 (ExpectInitializers): Keep track of whether initializers are mandatory
28613 (Bounds): Make it a hashtable to prevent the same dimension being
28614 recorded for every element in that dimension.
28616 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28619 Also fix bug which was causing the indices to be emitted in the reverse
28622 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28624 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28625 unfinished. They do not work, because the underlying code is
28628 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28630 * cs-parser.jay: Remove bogus fixme.
28632 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28633 on Switch statement.
28635 2001-11-23 Ravi Pratap <ravi@ximian.com>
28637 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28640 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28641 parameter. Apparently, any expression is allowed.
28643 (ValidateInitializers): Update accordingly.
28645 (CheckIndices): Fix some tricky bugs thanks to recursion.
28647 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28648 I was being completely brain-dead.
28650 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28651 and re-write acordingly.
28653 (DelegateInvocation): Re-write accordingly.
28655 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28657 (MakeByteBlob): Handle types more correctly.
28659 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28660 initialization from expressions but it is incomplete because I am a complete
28663 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28665 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28666 on If. Basically, we have to return `true' (ie, we do return to
28667 our caller) only if both branches of the if return.
28669 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28670 short-circuit operators, handle them as short circuit operators.
28672 (Cast.DoResolve): Resolve type.
28673 (Cast.Cast): Take an expression as the target type.
28675 * cs-parser.jay (cast_expression): Remove old hack that only
28676 allowed a limited set of types to be handled. Now we take a
28677 unary_expression and we resolve to a type during semantic
28680 Use the grammar productions from Rhys to handle casts (this is
28681 not complete like Rhys syntax yet, we fail to handle that corner
28682 case that C# has regarding (-x), but we will get there.
28684 2001-11-22 Ravi Pratap <ravi@ximian.com>
28686 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28687 field which is an array type.
28689 * cs-parser.jay (declare_local_variables): Support array initialization too.
28691 * typemanager.cs (MakeKey): Implement.
28693 (everywhere): Use the above appropriately.
28695 * cs-parser.jay (for_statement): Update for array initialization while
28696 declaring variables.
28698 * ecore.cs : The error message was correct, it's the variable's names that
28699 were misleading ;-) Make the code more readable.
28701 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28702 the correct type etc.
28704 (ConvertExplicit): Handle Enum types by examining the underlying type.
28706 2001-11-21 Ravi Pratap <ravi@ximian.com>
28708 * parameter.cs (GetCallingConvention): Always return
28709 CallingConventions.Standard for now.
28711 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28713 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28714 and `r' after calling DoNumericPromotions.
28716 * ecore.cs: Fix error message (the types were in the wrong order).
28718 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28719 BindingFlags.Instance as well
28721 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28722 implicit int literal conversion in an empty cast so that we
28723 propagate the right type upstream.
28725 (UnboxCast): new class used to unbox value types.
28726 (Expression.ConvertExplicit): Add explicit type conversions done
28729 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28730 the target type before applying the implicit LongLiterals to ULong
28733 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28735 * cs-parser.jay (for_statement): Reworked the way For works: now
28736 we declare manually any variables that are introduced in
28737 for_initializer to solve the problem of having out-of-band code
28738 emition (that is what got for broken).
28740 (declaration_statement): Perform the actual variable declaration
28741 that used to be done in local_variable_declaration here.
28743 (local_variable_declaration): Do not declare anything, just pass
28744 the information on a DictionaryEntry
28746 2001-11-20 Ravi Pratap <ravi@ximian.com>
28748 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28749 re-write of the logic to now make it recursive.
28751 (UpdateIndices): Re-write accordingly.
28753 Store element data in a separate ArrayData list in the above methods.
28755 (MakeByteBlob): Implement to dump the array data into a byte array.
28757 2001-11-19 Ravi Pratap <ravi@ximian.com>
28759 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28762 * constant.cs (Define): Implement.
28764 (EmitConstant): Re-write fully.
28766 Pass in location info.
28768 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28771 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28772 DictionaryEntry since we need location info too.
28774 (constant_declaration): Update accordingly.
28776 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28777 code into another method : UpdateIndices.
28779 2001-11-18 Ravi Pratap <ravi@ximian.com>
28781 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28782 some type checking etc.
28784 2001-11-17 Ravi Pratap <ravi@ximian.com>
28786 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28787 bits to provide dimension info if the user skips doing that.
28789 Update second constructor to store the rank correctly.
28791 2001-11-16 Ravi Pratap <ravi@ximian.com>
28793 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28794 and try to implement.
28796 * ../errors/cs0150.cs : Add.
28798 * ../errors/cs0178.cs : Add.
28800 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28802 * statement.cs: Implement foreach on multi-dimensional arrays.
28804 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28805 name of the params argument.
28807 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28808 initializing the array.
28810 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28811 we can use this elsewhere.
28813 * statement.cs: Finish implementation of foreach for single
28816 * cs-parser.jay: Use an out-of-band stack to pass information
28817 around, I wonder why I need this.
28819 foreach_block: Make the new foreach_block the current_block.
28821 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28822 function used to return a static Parameters structure. Used for
28823 empty parameters, as those are created very frequently.
28825 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28827 2001-11-15 Ravi Pratap <ravi@ximian.com>
28829 * interface.cs : Default modifier is private, not public. The
28830 make verify test passes again.
28832 2001-11-15 Ravi Pratap <ravi@ximian.com>
28834 * support.cs (ReflectionParameters): Fix logic to determine
28835 whether the last parameter is a params one. Test 9 passes again.
28837 * delegate.cs (Populate): Register the builders we define with
28838 RegisterParameterForBuilder. Test 19 passes again.
28840 * cs-parser.jay (property_declaration): Reference $6 instead
28841 of $$ to get at the location.
28843 (indexer_declaration): Similar stuff.
28845 (attribute): Ditto.
28847 * class.cs (Property): Register parameters for the Get and Set methods
28848 if they exist. Test 23 passes again.
28850 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28851 call to EmitArguments as we are sure there aren't any params arguments.
28852 Test 32 passes again.
28854 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28855 IndexOutOfRangeException.
28857 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28858 Test 33 now passes again.
28860 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28862 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28863 broke a bunch of things. Will have to come up with a better way
28864 of tracking locations.
28866 * statement.cs: Implemented foreach for single dimension arrays.
28868 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28870 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28871 an error. This removes the lookup from the critical path.
28873 * cs-parser.jay: Removed use of temporary_loc, which is completely
28876 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28878 * support.cs (ReflectionParameters.ParameterModifier): Report
28879 whether the argument is a PARAMS argument or not.
28881 * class.cs: Set the attribute `ParamArrayAttribute' on the
28882 parameter argument.
28884 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28885 and cons_param_array_attribute (ConstructorInfo for
28886 ParamArrayAttribute).,
28888 * codegen.cs: Emit the return using the `Return' statement, that
28889 way we can report the error correctly for missing return values.
28891 * class.cs (Method.Emit): Clean up.
28893 * expression.cs (Argument.Resolve): Take another argument: the
28894 location where this argument is used. Notice that this is not
28895 part of the "Argument" class as to reduce the size of the
28896 structure (we know the approximate location anyways).
28898 Test if the argument is a variable-reference, if not, then
28899 complain with a 206.
28901 (Argument.Emit): Emit addresses of variables.
28903 (Argument.FullDesc): Simplify.
28905 (Invocation.DoResolve): Update for Argument.Resolve.
28907 (ElementAccess.DoResolve): ditto.
28909 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28910 method should be virtual, as this method is always virtual.
28912 (NewDelegate.DoResolve): Update for Argument.Resolve.
28914 * class.cs (ConstructorInitializer.DoResolve): ditto.
28916 * attribute.cs (Attribute.Resolve): ditto.
28918 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28920 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28922 * expression.cs (ParameterReference): Drop IStackStorage and implement
28923 IAssignMethod instead.
28925 (LocalVariableReference): ditto.
28927 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28928 IAssignMethod instead.
28930 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28932 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28933 enumerations that are used in heavily used structures derive from
28934 byte in a laughable and pathetic attempt to reduce memory usage.
28935 This is the kind of pre-optimzations that you should not do at
28936 home without adult supervision.
28938 * expression.cs (UnaryMutator): New class, used to handle ++ and
28939 -- separatedly from the other unary operators. Cleans up the
28940 code, and kills the ExpressionStatement dependency in Unary.
28942 (Unary): Removed `method' and `Arguments' from this class, making
28943 it smaller, and moving it all to SimpleCall, so I can reuse this
28944 code in other locations and avoid creating a lot of transient data
28945 strucutres when not required.
28947 * cs-parser.jay: Adjust for new changes.
28949 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28951 * enum.cs (Enum.Populate): If there is a failure during
28954 * cs-parser.jay (opt_enum_base): we used to catch type errors
28955 here, but this is really incorrect. The type error should be
28956 catched during semantic analysis.
28958 2001-12-11 Ravi Pratap <ravi@ximian.com>
28960 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28961 current_local_parameters as expected since I, in my stupidity, had forgotten
28964 * attribute.cs (GetValidPlaces): Fix stupid bug.
28966 * class.cs (Method::Emit): Perform check on applicability of attributes.
28968 (Constructor::Emit): Ditto.
28970 (Field::Emit): Ditto.
28972 (Field.Location): Store location information.
28974 (Property, Event, Indexer, Operator): Ditto.
28976 * cs-parser.jay (field_declaration): Pass in location for each field.
28978 * ../errors/cs0592.cs : Add.
28980 2001-11-12 Ravi Pratap <ravi@ximian.com>
28982 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28984 (InitCoreTypes): Update accordingly.
28986 (RegisterAttrType, LookupAttr): Implement.
28988 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28989 info about the same.
28991 (Resolve): Update to populate the above as necessary.
28993 (Error592): Helper.
28995 (GetValidPlaces): Helper to the above.
28997 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28999 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29001 2001-11-12 Ravi Pratap <ravi@ximian.com>
29003 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29005 * ../errors/cs0617.cs : Add.
29007 2001-11-11 Ravi Pratap <ravi@ximian.com>
29009 * enum.cs (Emit): Rename to Populate to be more consistent with what
29010 we expect it to do and when exactly it is called.
29012 * class.cs, rootcontext.cs : Update accordingly.
29014 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29015 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29017 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29019 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29020 of a fieldinfo using the above, when dealing with a FieldBuilder.
29022 2001-11-10 Ravi Pratap <ravi@ximian.com>
29024 * ../errors/cs0031.cs : Add.
29026 * ../errors/cs1008.cs : Add.
29028 * ../errrors/cs0543.cs : Add.
29030 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29033 (FindMembers): Implement.
29035 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29036 enums and delegates too.
29038 (enum_types): Rename to builder_to_enum.
29040 (delegate_types): Rename to builder_to_delegate.
29042 * delegate.cs (FindMembers): Implement.
29044 2001-11-09 Ravi Pratap <ravi@ximian.com>
29046 * typemanager.cs (IsEnumType): Implement.
29048 * enum.cs (Emit): Re-write parts to account for the underlying type
29049 better and perform checking etc.
29051 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29052 of the underlying type.
29054 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29057 * enum.cs (error31): Helper to report error #31.
29059 * cs-parser.jay (enum_declaration): Store location of each member too.
29061 * enum.cs (member_to_location): New hashtable.
29063 (AddEnumMember): Update location hashtable.
29065 (Emit): Use the location of each member while reporting errors.
29067 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29069 * cs-parser.jay: A for_initializer if is a
29070 local_variable_declaration really ammount to have an implicit
29071 block with the variable declaration and no initializer for for.
29073 * statement.cs (For.Emit): Cope with null initializers.
29075 This fixes the infinite loop on for initializers.
29077 2001-11-08 Miguel de Icaza <miguel@ximian.com>
29079 * enum.cs: More cleanup.
29081 * ecore.cs: Remove dead code.
29083 * class.cs (Property.Emit): More simplification.
29084 (Event.Emit): ditto.
29086 Reworked to have less levels of indentation.
29088 2001-11-08 Ravi Pratap <ravi@ximian.com>
29090 * class.cs (Property): Emit attributes.
29100 * enum.cs (Emit): Ditto.
29102 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29105 * class.cs (Field, Event, etc.): Move attribute generation into the
29106 Emit method everywhere.
29108 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29109 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29110 as we had no way of defining nested enums !
29112 * rootcontext.cs : Adjust code accordingly.
29114 * typemanager.cs (AddEnumType): To keep track of enum types separately.
29116 2001-11-07 Ravi Pratap <ravi@ximian.com>
29118 * expression.cs (EvalConstantExpression): Move into ecore.cs
29120 * enum.cs (Enum): Rename some members and make them public and readonly
29121 according to our convention.
29123 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29126 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29128 (Enum::Emit): Write a simple version for now which doesn't try to compute
29129 expressions. I shall modify this to be more robust in just a while.
29131 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29133 (TypeContainer::CloseType): Create the Enum types too.
29135 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29137 * expression.cs (EvalConstantExpression): Get rid of completely.
29139 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29140 user-defined values and other cases.
29142 (IsValidEnumLiteral): Helper function.
29144 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
29145 out there in the case we had a literal FieldExpr.
29147 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29149 (Literalize): Revamp a bit to take two arguments.
29151 (EnumLiteral): New class which derives from Literal to wrap enum literals.
29153 2001-11-06 Ravi Pratap <ravi@ximian.com>
29155 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29157 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29159 (Resolve): Use the above to ensure we have proper initializers.
29161 2001-11-05 Ravi Pratap <ravi@ximian.com>
29163 * expression.cs (Expression::EvalConstantExpression): New method to
29164 evaluate constant expressions.
29166 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29168 2001-11-07 Miguel de Icaza <miguel@ximian.com>
29170 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29173 (Binary.ResolveOperator): Handle operator != (object a, object b)
29174 and operator == (object a, object b);
29176 (Binary.DoNumericPromotions): Indicate whether the numeric
29177 promotion was possible.
29179 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29182 Made the ArrayAccess implement interface IAssignMethod instead of
29183 IStackStore as the order in which arguments are passed reflects
29186 * assign.cs: Instead of using expr.ExprClass to select the way of
29187 assinging, probe for the IStackStore/IAssignMethod interfaces.
29189 * typemanager.cs: Load InitializeArray definition.
29191 * rootcontext.cs (RootContext.MakeStaticData): Used to define
29192 static data that can be used to initialize arrays.
29194 2001-11-05 Miguel de Icaza <miguel@ximian.com>
29196 * expression.cs: Handle operator== and operator!= for booleans.
29198 (Conditioal.Reduce): Implement reducer for the ?: operator.
29200 (Conditional.Resolve): Implement dead code elimination.
29202 (Binary.Resolve): Catch string literals and return a new
29203 concatenated string.
29205 (Unary.Reduce): Implement reduction of unary expressions.
29207 * ecore.cs: Split out the expression core handling here.
29209 (Expression.Reduce): New method used to perform constant folding
29210 and CSE. This is needed to support constant-expressions.
29212 * statement.cs (Statement.EmitBoolExpression): Pass true and false
29213 targets, and optimize for !x.
29215 2001-11-04 Ravi Pratap <ravi@ximian.com>
29217 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29218 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29219 set custom atttributes.
29221 * literal.cs (Literal::GetValue): New abstract method to return the actual
29222 value of the literal, cast as an object.
29224 (*Literal): Implement GetValue method.
29226 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29227 expressions to the arraylist but objects of type Argument.
29229 * class.cs (TypeContainer::Emit): Emit our attributes too.
29231 (Method::Emit, Constructor::Emit): Ditto.
29233 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29234 to be ignoring earlier.
29236 2001-11-03 Ravi Pratap <ravi@ximian.com>
29238 * attribute.cs (AttributeSection::Define): Implement to do the business
29239 of constructing a CustomAttributeBuilder.
29241 (Attribute): New trivial class. Increases readability of code.
29243 * cs-parser.jay : Update accordingly.
29245 (positional_argument_list, named_argument_list, named_argument): New rules
29247 (attribute_arguments): Use the above so that we are more correct.
29249 2001-11-02 Ravi Pratap <ravi@ximian.com>
29251 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29252 to perform all checks for a method with a params parameter.
29254 (Invocation::OverloadResolve): Update to use the above method and therefore
29255 cope correctly with params method invocations.
29257 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
29260 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29261 constructors in our parent too because we can't afford to miss out on
29264 * attribute.cs (AttributeSection): New name for the class Attribute
29266 Other trivial changes to improve readability.
29268 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29269 use the new class names.
29271 2001-11-01 Ravi Pratap <ravi@ximian.com>
29273 * class.cs (Method::Define): Complete definition for params types too
29275 (Indexer::Define): Ditto.
29277 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29278 Cope everywhere with a request for info about the array parameter.
29280 2001-11-01 Ravi Pratap <ravi@ximian.com>
29282 * tree.cs (RecordNamespace): Fix up to check for the correct key.
29284 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
29285 local_variable_type to extract the string corresponding to the type.
29287 (local_variable_type): Fixup the action to use the new helper method.
29289 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
29292 * expression.cs : Clean out code which uses the above.
29294 2001-10-31 Ravi Pratap <ravi@ximian.com>
29296 * typemanager.cs (RegisterMethod): Check if we already have an existing key
29297 and bale out if necessary by returning a false.
29299 (RegisterProperty): Ditto.
29301 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29302 and print out appropriate error messages.
29304 * interface.cs (everywhere): Ditto.
29306 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29307 location to constructor.
29309 * class.cs (Property, Event, Indexer): Update accordingly.
29311 * ../errors/cs111.cs : Added.
29313 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29314 of a method, as laid down by the spec.
29316 (Invocation::OverloadResolve): Use the above method.
29318 2001-10-31 Ravi Pratap <ravi@ximian.com>
29320 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29321 now take a TypeContainer and a Parameters object.
29323 (ParameterData): Modify return type of ParameterModifier method to be
29324 Parameter.Modifier and not a string.
29326 (ReflectionParameters, InternalParameters): Update accordingly.
29328 * expression.cs (Argument::GetParameterModifier): Same here.
29330 * support.cs (InternalParameters::ParameterType): Find a better way of determining
29331 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29332 symbol in it at all so maybe this is only for now.
29334 2001-10-30 Ravi Pratap <ravi@ximian.com>
29336 * support.cs (InternalParameters): Constructor now takes an extra argument
29337 which is the actual Parameters class.
29339 (ParameterDesc): Update to provide info on ref/out modifiers.
29341 * class.cs (everywhere): Update call to InternalParameters to pass in
29342 the second argument too.
29344 * support.cs (ParameterData): Add ParameterModifier, which is a method
29345 to return the modifier info [ref/out etc]
29347 (InternalParameters, ReflectionParameters): Implement the above.
29349 * expression.cs (Argument::ParameterModifier): Similar function to return
29350 info about the argument's modifiers.
29352 (Invocation::OverloadResolve): Update to take into account matching modifiers
29355 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29356 a new SetFormalParameters object which we pass to InternalParameters.
29358 2001-10-30 Ravi Pratap <ravi@ximian.com>
29360 * expression.cs (NewArray): Merge into the ArrayCreation class.
29362 2001-10-29 Ravi Pratap <ravi@ximian.com>
29364 * expression.cs (NewArray): Merge classes NewBuiltinArray and
29365 NewUserdefinedArray into one as there wasn't much of a use in having
29368 * expression.cs (Argument): Change field's name to ArgType from Type.
29370 (Type): New readonly property which returns the proper type, taking into
29371 account ref/out modifiers.
29373 (everywhere): Adjust code accordingly for the above.
29375 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29376 whether we are emitting for a ref or out parameter.
29378 * expression.cs (Argument::Emit): Use the above field to set the state.
29380 (LocalVariableReference::Emit): Update to honour the flag and emit the
29383 * parameter.cs (Attributes): Set the correct flags for ref parameters.
29385 * expression.cs (Argument::FullDesc): New function to provide a full desc.
29387 * support.cs (ParameterData): Add method ParameterDesc to the interface.
29389 (ReflectionParameters, InternalParameters): Implement the above method.
29391 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29394 (Invocation::FullMethodDesc): Ditto.
29396 2001-10-29 Miguel de Icaza <miguel@ximian.com>
29398 * cs-parser.jay: Add extra production for the second form of array
29401 * expression.cs (ArrayCreation): Update to reflect the above
29404 * Small changes to prepare for Array initialization.
29406 2001-10-28 Miguel de Icaza <miguel@ximian.com>
29408 * typemanager.cs (ImplementsInterface): interface might be null;
29409 Deal with this problem;
29411 Also, we do store negative hits on the cache (null values), so use
29412 this instead of calling t.GetInterfaces on the type everytime.
29414 2001-10-28 Ravi Pratap <ravi@ximian.com>
29416 * typemanager.cs (IsBuiltinType): New method to help determine the same.
29418 * expression.cs (New::DoResolve): Get rid of array creation code and instead
29419 split functionality out into different classes.
29421 (New::FormArrayType): Move into NewBuiltinArray.
29423 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29426 (NewBuiltinArray): New class to handle creation of built-in arrays.
29428 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29429 account creation of one-dimensional arrays.
29431 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29433 (NewUserdefinedArray::DoResolve): Implement.
29435 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29437 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29438 we maintain inside the TypeManager. This is necessary to perform lookups on the
29441 (LookupType): Update to perform GetType on the module builders too.
29443 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29445 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29447 2001-10-23 Ravi Pratap <ravi@ximian.com>
29449 * expression.cs (New::DoResolve): Implement guts of array creation.
29451 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29453 2001-10-27 Miguel de Icaza <miguel@ximian.com>
29455 * expression.cs: Fix bug I introduced lsat night that broke
29458 (Expression.Resolve): Report a 246 error (can not resolve name)
29459 if we find a SimpleName in the stream.
29461 (Expression.ResolveLValue): Ditto.
29463 (Expression.ResolveWithSimpleName): This function is a variant of
29464 ResolveName, this one allows SimpleNames to be returned without a
29465 warning. The only consumer of SimpleNames is MemberAccess
29467 2001-10-26 Miguel de Icaza <miguel@ximian.com>
29469 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29470 might arrive here. I have my doubts that this is correct.
29472 * statement.cs (Lock): Implement lock statement.
29474 * cs-parser.jay: Small fixes to support `lock' and `using'
29476 * cs-tokenizer.cs: Remove extra space
29478 * driver.cs: New flag --checked, allows to turn on integer math
29481 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29482 Threading.Monitor.Exit
29484 2001-10-23 Miguel de Icaza <miguel@ximian.com>
29486 * expression.cs (IndexerAccess::DoResolveLValue): Set the
29487 Expression Class to be IndexerAccess.
29489 Notice that Indexer::DoResolve sets the eclass to Value.
29491 2001-10-22 Miguel de Icaza <miguel@ximian.com>
29493 * class.cs (TypeContainer::Emit): Emit code for indexers.
29495 * assign.cs (IAssignMethod): New interface implemented by Indexers
29496 and Properties for handling assignment.
29498 (Assign::Emit): Simplify and reuse code.
29500 * expression.cs (IndexerAccess, PropertyExpr): Implement
29501 IAssignMethod, clean up old code.
29503 2001-10-22 Ravi Pratap <ravi@ximian.com>
29505 * typemanager.cs (ImplementsInterface): New method to determine if a type
29506 implements a given interface. Provides a nice cache too.
29508 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29511 (ConvertReferenceExplicit): Ditto.
29513 * delegate.cs (Delegate::Populate): Update to define the parameters on the
29514 various methods, with correct names etc.
29516 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
29517 Operator.UnaryNegation.
29519 * cs-parser.jay (operator_declarator): Be a little clever in the case where
29520 we have a unary plus or minus operator.
29522 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
29525 * everywhere : update accordingly.
29527 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29530 * class.cs (Method::Define): For the case where we are implementing a method
29531 inherited from an interface, we need to set the MethodAttributes.Final flag too.
29532 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29534 2001-10-21 Ravi Pratap <ravi@ximian.com>
29536 * interface.cs (FindMembers): Implement to work around S.R.E
29539 * typemanager.cs (IsInterfaceType): Implement.
29541 (FindMembers): Update to handle interface types too.
29543 * expression.cs (ImplicitReferenceConversion): Re-write bits which
29544 use IsAssignableFrom as that is not correct - it doesn't work.
29546 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29547 and accordingly override EmitStatement.
29549 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29550 using the correct logic :-)
29552 2001-10-19 Ravi Pratap <ravi@ximian.com>
29554 * ../errors/cs-11.cs : Add to demonstrate error -11
29556 2001-10-17 Miguel de Icaza <miguel@ximian.com>
29558 * assign.cs (Assign::Resolve): Resolve right hand side first, and
29559 then pass this as a hint to ResolveLValue.
29561 * expression.cs (FieldExpr): Add Location information
29563 (FieldExpr::LValueResolve): Report assignment to readonly
29566 (Expression::ExprClassFromMemberInfo): Pass location information.
29568 (Expression::ResolveLValue): Add new method that resolves an
29571 (Expression::DoResolveLValue): Default invocation calls
29574 (Indexers): New class used to keep track of indexers in a given
29577 (IStackStore): Renamed from LValue, as it did not really describe
29578 what this did. Also ResolveLValue is gone from this interface and
29579 now is part of Expression.
29581 (ElementAccess): Depending on the element access type
29583 * typemanager.cs: Add `indexer_name_type' as a Core type
29584 (System.Runtime.CompilerServices.IndexerNameAttribute)
29586 * statement.cs (Goto): Take a location.
29588 2001-10-18 Ravi Pratap <ravi@ximian.com>
29590 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29591 if two delegates are compatible.
29593 (NewDelegate::DoResolve): Update to take care of the case when
29594 we instantiate a delegate from another delegate.
29596 * typemanager.cs (FindMembers): Don't even try to look up members
29597 of Delegate types for now.
29599 2001-10-18 Ravi Pratap <ravi@ximian.com>
29601 * delegate.cs (NewDelegate): New class to take care of delegate
29604 * expression.cs (New): Split the delegate related code out into
29605 the NewDelegate class.
29607 * delegate.cs (DelegateInvocation): New class to handle delegate
29610 * expression.cs (Invocation): Split out delegate related code into
29611 the DelegateInvocation class.
29613 2001-10-17 Ravi Pratap <ravi@ximian.com>
29615 * expression.cs (New::DoResolve): Implement delegate creation fully
29616 and according to the spec.
29618 (New::DoEmit): Update to handle delegates differently.
29620 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29621 because of which we were printing out arguments in reverse order !
29623 * delegate.cs (VerifyMethod): Implement to check if the given method
29624 matches the delegate.
29626 (FullDelegateDesc): Implement.
29628 (VerifyApplicability): Implement.
29630 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29631 delegate invocations too.
29633 (Invocation::Emit): Ditto.
29635 * ../errors/cs1593.cs : Added.
29637 * ../errors/cs1594.cs : Added.
29639 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29641 2001-10-16 Ravi Pratap <ravi@ximian.com>
29643 * typemanager.cs (intptr_type): Core type for System.IntPtr
29645 (InitCoreTypes): Update for the same.
29647 (iasyncresult_type, asynccallback_type): Ditto.
29649 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29652 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29655 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29656 the builders for the 4 members of a delegate type :-)
29658 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29661 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29663 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29665 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29667 * statement.cs (Break::Emit): Implement.
29668 (Continue::Emit): Implement.
29670 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29671 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29672 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29673 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29676 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29677 properties that track the label for the current loop (begin of the
29678 loop and end of the loop).
29680 2001-10-15 Ravi Pratap <ravi@ximian.com>
29682 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29683 use of emitting anything at all.
29685 * class.cs, rootcontext.cs : Get rid of calls to the same.
29687 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29689 (Populate): Define the constructor correctly and set the implementation
29692 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29695 (AddDelegateType): Implement.
29697 (IsDelegateType): Implement helper method.
29699 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29701 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29702 and accordingly handle it.
29704 * delegate.cs (Populate): Take TypeContainer argument.
29705 Implement bits to define the Invoke method. However, I still haven't figured out
29706 how to take care of the native int bit :-(
29708 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29709 Qualify the name of the delegate, not its return type !
29711 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29714 (StandardConversionExists): Checking for array types turns out to be recursive.
29716 (ConvertReferenceExplicit): Implement array conversion.
29718 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29720 2001-10-12 Ravi Pratap <ravi@ximian.com>
29722 * cs-parser.jay (delegate_declaration): Store the fully qualified
29723 name as it is a type declaration.
29725 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29728 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29729 as TypeContainer::DefineType.
29731 (Populate): Method in which all the definition of the various methods (Invoke)
29734 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29737 (CloseDelegate): Finally creates the delegate.
29739 * class.cs (TypeContainer::DefineType): Update to define delegates.
29740 (Populate, Emit and CloseType): Do the same thing here too.
29742 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29743 delegates in all these operations.
29745 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29747 * expression.cs: LocalTemporary: a new expression used to
29748 reference a temporary that has been created.
29750 * assign.cs: Handle PropertyAccess back here, so that we can
29751 provide the proper semantic access to properties.
29753 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29754 a few more explicit conversions.
29756 * modifiers.cs: `NEW' modifier maps to HideBySig.
29758 * expression.cs (PropertyExpr): Make this into an
29759 ExpressionStatement, and support the EmitStatement code path.
29761 Perform get/set error checking, clean up the interface.
29763 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29764 them into toplevel access objects.
29766 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29768 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29771 * typemanager.cs: Keep track here of our PropertyBuilders again to
29772 work around lameness in SRE.
29774 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29776 * expression.cs (LValue::LValueResolve): New method in the
29777 interface, used to perform a second resolution pass for LValues.
29779 (This::DoResolve): Catch the use of this in static methods.
29781 (This::LValueResolve): Implement.
29783 (This::Store): Remove warning, assigning to `this' in structures
29786 (Invocation::Emit): Deal with invocation of
29787 methods on value types. We need to pass the address to structure
29788 methods rather than the object itself. (The equivalent code to
29789 emit "this" for structures leaves the entire structure on the
29790 stack instead of a pointer to it).
29792 (ParameterReference::DoResolve): Compute the real index for the
29793 argument based on whether the method takes or not a `this' pointer
29794 (ie, the method is static).
29796 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29797 value types returned from functions when we need to invoke a
29798 method on the sturcture.
29801 2001-10-11 Ravi Pratap <ravi@ximian.com>
29803 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29804 defining the type in the Modulebuilder or Typebuilder. This is to take
29805 care of nested types which need to be defined on the TypeBuilder using
29806 DefineNestedMethod.
29808 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29809 methods in RootContext, only ported to be part of TypeContainer.
29811 (TypeContainer::GetInterfaceOrClass): Ditto.
29813 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29815 * interface.cs (Interface::DefineInterface): New method. Does exactly
29816 what RootContext.CreateInterface did earlier, only it takes care of nested types
29819 (Interface::GetInterfaces): Move from RootContext here and port.
29821 (Interface::GetInterfaceByName): Same here.
29823 * rootcontext.cs (ResolveTree): Re-write.
29825 (PopulateTypes): Re-write.
29827 * class.cs (TypeContainer::Populate): Populate nested types too.
29828 (TypeContainer::Emit): Emit nested members too.
29830 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29831 instead just use the name argument passed in as it is already fully
29834 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29835 to TypeContainer mapping to see if a type is user-defined.
29837 * class.cs (TypeContainer::CloseType): Implement.
29839 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29840 the default constructor.
29842 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29845 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29847 * interface.cs (CloseType): Create the type here.
29849 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29852 Remove all the methods which are now in TypeContainer.
29854 2001-10-10 Ravi Pratap <ravi@ximian.com>
29856 * delegate.cs (Define): Re-write bits to define the delegate
29859 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29861 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29863 * expression.cs (ImplicitReferenceConversion): handle null as well
29864 as a source to convert to any reference type.
29866 * statement.cs (Return): Perform any implicit conversions to
29867 expected return type.
29869 Validate use of return statement.
29871 * codegen.cs (EmitContext): Pass the expected return type here.
29873 * class.cs (Method, Constructor, Property): Pass expected return
29874 type to EmitContext.
29876 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29878 * expression.cs: Make DoResolve take an EmitContext instead of a
29881 Replaced `l' and `location' for `loc', for consistency.
29883 (Error, Warning): Remove unneeded Tc argument.
29885 * assign.cs, literal.cs, constant.cs: Update to new calling
29888 * codegen.cs: EmitContext now contains a flag indicating whether
29889 code is being generated in a static method or not.
29891 * cs-parser.jay: DecomposeQI, new function that replaces the old
29892 QualifiedIdentifier. Now we always decompose the assembled
29893 strings from qualified_identifier productions into a group of
29896 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29898 * rootcontext.cs: Deal with field-less struct types correctly now
29899 by passing the size option to Define Type.
29901 * class.cs: Removed hack that created one static field.
29903 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29905 * statement.cs: Moved most of the code generation here.
29907 2001-10-09 Ravi Pratap <ravi@ximian.com>
29909 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29912 (ElementAccess): Remove useless bits for now - keep checks as the spec
29915 2001-10-08 Ravi Pratap <ravi@ximian.com>
29917 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29918 and start performing checks according to the spec.
29920 2001-10-07 Ravi Pratap <ravi@ximian.com>
29922 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29923 rank_specifiers instead.
29925 (rank_specifiers): Change the order in which the rank specifiers are stored
29927 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29929 * expression.cs (ElementAccess): Implement the LValue interface too.
29931 2001-10-06 Ravi Pratap <ravi@ximian.com>
29933 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29934 except that user defined conversions are not included.
29936 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29937 perform the conversion of the return type, if necessary.
29939 (New::DoResolve): Check whether we are creating an array or an object
29940 and accordingly do the needful.
29942 (New::Emit): Same here.
29944 (New::DoResolve): Implement guts of array creation.
29946 (New::FormLookupType): Helper function.
29948 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29950 * codegen.cs: Removed most of the code generation here, and move the
29951 corresponding code generation bits to the statement classes.
29953 Added support for try/catch/finalize and throw.
29955 * cs-parser.jay: Added support for try/catch/finalize.
29957 * class.cs: Catch static methods having the flags override,
29958 virtual or abstract.
29960 * expression.cs (UserCast): This user cast was not really doing
29961 what it was supposed to do. Which is to be born in fully resolved
29962 state. Parts of the resolution were being performed at Emit time!
29966 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29968 * expression.cs: Implicity convert the result from UserCast.
29970 2001-10-05 Ravi Pratap <ravi@ximian.com>
29972 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29973 prevented it from working correctly.
29975 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29976 merely ConvertImplicit.
29978 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29980 * typemanager.cs: Make the LookupTypeContainer function static,
29981 and not per-instance.
29983 * class.cs: Make static FindMembers (the one that takes a Type
29986 * codegen.cs: Add EmitForeach here.
29988 * cs-parser.jay: Make foreach a toplevel object instead of the
29989 inline expansion, as we need to perform semantic analysis on it.
29991 2001-10-05 Ravi Pratap <ravi@ximian.com>
29993 * expression.cs (Expression::ImplicitUserConversion): Rename to
29994 UserDefinedConversion.
29996 (Expression::UserDefinedConversion): Take an extra argument specifying
29997 whether we look for explicit user conversions too.
29999 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30001 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30003 (ExplicitUserConversion): Make it a call to UserDefinedConversion
30004 with the appropriate arguments.
30006 * cs-parser.jay (cast_expression): Record location too.
30008 * expression.cs (Cast): Record location info.
30010 (Expression::ConvertExplicit): Take location argument.
30012 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30013 to determine if we are doing explicit conversions.
30015 (UserCast::Emit): Update accordingly.
30017 (Expression::ConvertExplicit): Report an error if everything fails.
30019 * ../errors/cs0030.cs : Add.
30021 2001-10-04 Miguel de Icaza <miguel@ximian.com>
30023 * modifiers.cs: If the ABSTRACT keyword is present, also set the
30024 virtual and newslot bits.
30026 * class.cs (TypeContainer::RegisterRequiredImplementations):
30027 Record methods we need.
30029 (TypeContainer::MakeKey): Helper function to make keys for
30030 MethodBases, since the Methodbase key is useless.
30032 (TypeContainer::Populate): Call RegisterRequiredImplementations
30033 before defining the methods.
30035 Create a mapping for method_builders_to_methods ahead of time
30036 instead of inside a tight loop.
30038 (::RequireMethods): Accept an object as the data to set into the
30039 hashtable so we can report interface vs abstract method mismatch.
30041 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30043 * report.cs: Make all of it static.
30045 * rootcontext.cs: Drop object_type and value_type computations, as
30046 we have those in the TypeManager anyways.
30048 Drop report instance variable too, now it is a global.
30050 * driver.cs: Use try/catch on command line handling.
30052 Add --probe option to debug the error reporting system with a test
30055 * report.cs: Add support for exiting program when a probe
30056 condition is reached.
30058 2001-10-03 Ravi Pratap <ravi@ximian.com>
30060 * expression.cs (Binary::DoNumericPromotions): Fix the case when
30061 we do a forcible conversion regardless of type, to check if
30062 ForceConversion returns a null.
30064 (Binary::error19): Use location to report error.
30066 (Unary::error23): Use location here too.
30068 * ../errors/cs0019.cs : Check in.
30070 * ../errors/cs0023.cs : Check in.
30072 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30073 case of a non-null MethodInfo object with a length of 0 !
30075 (Binary::ResolveOperator): Flag error if overload resolution fails to find
30076 an applicable member - according to the spec :-)
30077 Also fix logic to find members in base types.
30079 (Unary::ResolveOperator): Same here.
30081 (Unary::report23): Change name to error23 and make first argument a TypeContainer
30082 as I was getting thoroughly confused between this and error19 :-)
30084 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30085 (::FindMostEncompassedType): Implement.
30086 (::FindMostEncompassingType): Implement.
30087 (::StandardConversionExists): Implement.
30089 (UserImplicitCast): Re-vamp. We now need info about most specific
30090 source and target types so that we can do the necessary conversions.
30092 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30093 mathematical union with no duplicates.
30095 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30097 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30098 in order from base classes to child classes, so that we can in
30099 child classes look up in our parent for method names and
30100 attributes (required for handling abstract, virtual, new, override
30101 constructs: we need to instrospect our base class, and if we dont
30102 populate the classes in order, the introspection might be
30103 incorrect. For example, a method could query its parent before
30104 the parent has any methods and would determine that the parent has
30105 no abstract methods (while it could have had them)).
30107 (RootContext::CreateType): Record the order in which we define the
30110 2001-10-02 Miguel de Icaza <miguel@ximian.com>
30112 * class.cs (TypeContainer::Populate): Also method definitions can
30113 fail now, keep track of this.
30115 (TypeContainer::FindMembers): Implement support for
30116 DeclaredOnly/noDeclaredOnly flag.
30118 (Constructor::Emit) Return the ConstructorBuilder.
30120 (Method::Emit) Return the MethodBuilder.
30121 Check for abstract or virtual methods to be public.
30123 * rootcontext.cs (RootContext::CreateType): Register all the
30124 abstract methods required for the class to be complete and the
30125 interface methods that must be implemented.
30127 * cs-parser.jay: Report error 501 (method requires body if it is
30128 not marked abstract or extern).
30130 * expression.cs (TypeOf::Emit): Implement.
30132 * typemanager.cs: runtime_handle_type, new global type.
30134 * class.cs (Property::Emit): Generate code for properties.
30136 2001-10-02 Ravi Pratap <ravi@ximian.com>
30138 * expression.cs (Unary::ResolveOperator): Find operators on base type
30139 too - we now conform exactly to the spec.
30141 (Binary::ResolveOperator): Same here.
30143 * class.cs (Operator::Define): Fix minor quirk in the tests.
30145 * ../errors/cs0215.cs : Added.
30147 * ../errors/cs0556.cs : Added.
30149 * ../errors/cs0555.cs : Added.
30151 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30153 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30154 single integer which is really efficient
30156 2001-10-01 Ravi Pratap <ravi@ximian.com>
30158 * expression.cs (Expression::ImplicitUserConversion): Use location
30159 even in the case when we are examining True operators.
30161 * class.cs (Operator::Define): Perform extensive checks to conform
30162 with the rules for operator overloading in the spec.
30164 * expression.cs (Expression::ImplicitReferenceConversion): Implement
30165 some of the other conversions mentioned in the spec.
30167 * typemanager.cs (array_type): New static member for the System.Array built-in
30170 (cloneable_interface): For System.ICloneable interface.
30172 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30173 we start resolving the tree and populating types.
30175 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30177 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30179 * expression.cs (Expression::ExprClassFromMemberInfo,
30180 Expression::Literalize): Create literal expressions from
30181 FieldInfos which are literals.
30183 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30184 type casts, because they were wrong. The test suite in tests
30187 (ImplicitNumericConversion): ushort to ulong requires a widening
30190 Int32 constant to long requires widening cast as well.
30192 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30193 for integers because the type on the stack is not i4.
30195 2001-09-30 Miguel de Icaza <miguel@ximian.com>
30197 * expression.cs (report118): require location argument.
30199 * parameter.cs: Do not dereference potential null value.
30201 * class.cs: Catch methods that lack the `new' keyword when
30202 overriding a name. Report warnings when `new' is used without
30203 anything being there to override.
30205 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30207 * class.cs: Only add constructor to hashtable if it is non-null
30208 (as now constructors can fail on define).
30210 (TypeManager, Class, Struct): Take location arguments.
30212 Catch field instance initialization in structs as errors.
30214 accepting_filter: a new filter for FindMembers that is static so
30215 that we dont create an instance per invocation.
30217 (Constructor::Define): Catch errors where a struct constructor is
30220 * cs-parser.jay: Pass location information for various new
30223 * delegate.cs (Delegate): take a location argument.
30225 * driver.cs: Do not call EmitCode if there were problesm in the
30226 Definition of the types, as many Builders wont be there.
30228 * decl.cs (Decl::Decl): Require a location argument.
30230 * cs-tokenizer.cs: Handle properly hex constants that can not fit
30231 into integers, and find the most appropiate integer for it.
30233 * literal.cs: Implement ULongLiteral.
30235 * rootcontext.cs: Provide better information about the location of
30236 failure when CreateType fails.
30238 2001-09-29 Miguel de Icaza <miguel@ximian.com>
30240 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30243 * expression.cs (Binary::CheckShiftArguments): Add missing type
30245 (Binary::ResolveOperator): Add type to the logical and and logical
30246 or, Bitwise And/Or and Exclusive Or code paths, it was missing
30249 (Binary::DoNumericPromotions): In the case where either argument
30250 is ulong (and most signed types combined with ulong cause an
30251 error) perform implicit integer constant conversions as well.
30253 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30255 * expression.cs (UserImplicitCast): Method should always be
30257 (Invocation::BetterConversion): Simplified test for IntLiteral.
30259 (Expression::ImplicitNumericConversion): Split this routine out.
30260 Put the code that performs implicit constant integer conversions
30263 (Expression::Resolve): Become a wrapper around DoResolve so we can
30264 check eclass and type being set after resolve.
30266 (Invocation::Badness): Remove this dead function
30268 (Binary::ResolveOperator): Do not compute the expensive argumnets
30269 unless we have a union for it.
30271 (Probe::Emit): Is needs to do an isinst and then
30272 compare against null.
30274 (::CanConvert): Added Location argument. If the Location argument
30275 is null (Location.Null), then we do not report errors. This is
30276 used by the `probe' mechanism of the Explicit conversion. We do
30277 not want to generate an error for something that the user
30278 explicitly requested to be casted. But the pipeline for an
30279 explicit cast first tests for potential implicit casts.
30281 So for now, if the Location is null, it means `Probe only' to
30282 avoid adding another argument. Might have to revise this
30285 (ClassCast): New class used to type cast objects into arbitrary
30286 classes (used in Explicit Reference Conversions).
30288 Implement `as' as well.
30290 Reverted all the patches from Ravi below: they were broken:
30292 * The use of `level' as a mechanism to stop recursive
30293 invocations is wrong. That was there just to catch the
30294 bug with a strack trace but not as a way of addressing
30297 To fix the problem we have to *understand* what is going
30298 on and the interactions and come up with a plan, not
30299 just get things going.
30301 * The use of the type conversion cache that I proposed
30302 last night had an open topic: How does this work across
30303 protection domains. A user defined conversion might not
30304 be public in the location where we are applying the
30305 conversion, a different conversion might be selected
30306 (ie, private A->B (better) but public B->A (worse),
30307 inside A, A->B applies, but outside it, B->A will
30310 * On top of that (ie, even if the above is solved),
30311 conversions in a cache need to be abstract. Ie, `To
30312 convert from an Int to a Short use an OpcodeCast', not
30313 `To convert from an Int to a Short use the OpcodeCast on
30314 the variable 5' (which is what this patch was doing).
30316 2001-09-28 Ravi Pratap <ravi@ximian.com>
30318 * expression.cs (Invocation::ConversionExists): Re-write to use
30319 the conversion cache
30321 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30322 cache all conversions done, not just user-defined ones.
30324 (Invocation::BetterConversion): The real culprit. Use ConversionExists
30325 to determine if a conversion exists instead of acutually trying to
30326 perform the conversion. It's faster too.
30328 (Expression::ConvertExplicit): Modify to use ConversionExists to check
30329 and only then attempt the implicit conversion.
30331 2001-09-28 Ravi Pratap <ravi@ximian.com>
30333 * expression.cs (ConvertImplicit): Use a cache for conversions
30334 already found. Check level of recursion and bail out if necessary.
30336 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30338 * typemanager.cs (string_concat_string_string, string_concat_object_object):
30339 Export standard methods that we expect for string operations.
30341 * statement.cs (Block::UsageWarning): Track usage of variables and
30342 report the errors for not used variables.
30344 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30347 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30349 * codegen.cs: remove unnneded code
30351 * expression.cs: Removed BuiltinTypeAccess class
30353 Fix the order in which implicit conversions are
30356 The previous fixed dropped support for boxed conversions (adding a
30357 test to the test suite now)
30359 (UserImplicitCast::CanConvert): Remove test for source being null,
30360 that code is broken. We should not feed a null to begin with, if
30361 we do, then we should track the bug where the problem originates
30362 and not try to cover it up here.
30364 Return a resolved expression of type UserImplicitCast on success
30365 rather than true/false. Ravi: this is what I was talking about,
30366 the pattern is to use a static method as a "constructor" for
30369 Also, do not create arguments until the very last minute,
30370 otherwise we always create the arguments even for lookups that
30371 will never be performed.
30373 (UserImplicitCast::Resolve): Eliminate, objects of type
30374 UserImplicitCast are born in a fully resolved state.
30376 * typemanager.cs (InitCoreTypes): Init also value_type
30377 (System.ValueType).
30379 * expression.cs (Cast::Resolve): First resolve the child expression.
30381 (LValue): Add new method AddressOf to be used by
30384 Change the argument of Store to take an EmitContext instead of an
30385 ILGenerator, because things like FieldExpr need to be able to call
30386 their children expression to generate the instance code.
30388 (Expression::Error, Expression::Warning): Sugar functions for
30391 (Expression::MemberLookup): Accept a TypeContainer instead of a
30392 Report as the first argument.
30394 (Expression::ResolvePrimary): Killed. I still want to improve
30395 this as currently the code is just not right.
30397 (Expression::ResolveMemberAccess): Simplify, but it is still
30400 (Unary::Resolve): Catch errors in AddressOf operators.
30402 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30403 index to a byte for the short-version, or the compiler will choose
30404 the wrong Emit call, which generates the wrong data.
30406 (ParameterReference::Emit, ::Store): same.
30408 (FieldExpr::AddressOf): Implement.
30410 * typemanager.cs: TypeManager: made public variable instead of
30413 * driver.cs: document --fatal.
30415 * report.cs (ErrorMessage, WarningMessage): new names for the old
30416 Error and Warning classes.
30418 * cs-parser.jay (member_access): Turn built-in access to types
30419 into a normal simplename
30421 2001-09-27 Ravi Pratap <ravi@ximian.com>
30423 * expression.cs (Invocation::BetterConversion): Fix to cope
30424 with q being null, since this was introducing a bug.
30426 * expression.cs (ConvertImplicit): Do built-in conversions first.
30428 2001-09-27 Ravi Pratap <ravi@ximian.com>
30430 * expression.cs (UserImplicitCast::Resolve): Fix bug.
30432 2001-09-27 Ravi Pratap <ravi@ximian.com>
30434 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30435 I had introduced long ago (what's new ?).
30437 * expression.cs (UserImplicitCast::CanConvert): Static method to do
30438 the work of all the checking.
30439 (ConvertImplicit): Call CanConvert and only then create object if necessary.
30440 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30442 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30443 that is the right way.
30445 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
30446 overloading resolution. Use everywhere instead of cutting and pasting code.
30448 (Binary::ResolveOperator): Use MakeUnionSet.
30450 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
30451 we have to convert to bool types. Not complete yet.
30453 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30455 * typemanager.cs (TypeManager::CSharpName): support ushort.
30457 * expression.cs (Expression::TryImplicitIntConversion): Attempts
30458 to provide an expression that performsn an implicit constant int
30459 conversion (section 6.1.6).
30460 (Expression::ConvertImplicitRequired): Reworked to include
30461 implicit constant expression conversions.
30463 (Expression::ConvertNumericExplicit): Finished.
30465 (Invocation::Emit): If InstanceExpression is null, then it means
30466 that we perform a call on this.
30468 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30470 * expression.cs (Unary::Emit): Remove some dead code.
30471 (Probe): Implement Resolve and Emit for `is'.
30472 (Expression::ConvertImplicitRequired): Attempt to do constant
30473 expression conversions here. Maybe should be moved to
30474 ConvertImplicit, but I am not sure.
30475 (Expression::ImplicitLongConstantConversionPossible,
30476 Expression::ImplicitIntConstantConversionPossible): New functions
30477 that tell whether is it possible to apply an implicit constant
30478 expression conversion.
30480 (ConvertNumericExplicit): Started work on explicit numeric
30483 * cs-parser.jay: Update operator constants.
30485 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30486 (Parameters::GetSignature): Hook up VerifyArgs here.
30487 (Parameters::VerifyArgs): Verifies that no two arguments have the
30490 * class.cs (Operator): Update the operator names to reflect the
30491 ones that the spec expects (as we are just stringizing the
30494 * expression.cs (Unary::ResolveOperator): Fix bug: Use
30495 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30496 previous usage did only work for our methods.
30497 (Expression::ConvertImplicit): Handle decimal implicit numeric
30498 conversions as well.
30499 (Expression::InternalTypeConstructor): Used to invoke constructors
30500 on internal types for default promotions.
30502 (Unary::Emit): Implement special handling for the pre/post
30503 increment/decrement for overloaded operators, as they need to have
30504 the same semantics as the other operators.
30506 (Binary::ResolveOperator): ditto.
30507 (Invocation::ConversionExists): ditto.
30508 (UserImplicitCast::Resolve): ditto.
30510 2001-09-26 Ravi Pratap <ravi@ximian.com>
30512 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30513 operator, return after emitting body. Regression tests pass again !
30515 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30516 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30517 (Invocation::OverloadResolve): Ditto.
30518 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30520 * everywhere : update calls to the above methods accordingly.
30522 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30524 * assign.cs (Assign): Make it inherit from ExpressionStatement.
30526 * expression.cs (ExpressionStatement): New base class used for
30527 expressions that can appear in statements, so that we can provide
30528 an alternate path to generate expression that do not leave a value
30531 (Expression::Emit, and all the derivatives): We no longer return
30532 whether a value is left on the stack or not. Every expression
30533 after being emitted leaves a single value on the stack.
30535 * codegen.cs (EmitContext::EmitStatementExpression): Use the
30536 facilties of ExpressionStatement if possible.
30538 * cs-parser.jay: Update statement_expression.
30540 2001-09-25 Miguel de Icaza <miguel@ximian.com>
30542 * driver.cs: Change the wording of message
30544 2001-09-25 Ravi Pratap <ravi@ximian.com>
30546 * expression.cs (Binary::ResolveOperator): Had forgottten to set
30547 the type of the expression to the return type of the method if
30548 we have an overloaded operator match ! The regression tests pass again !
30549 (Unary::ResolveOperator): Ditto.
30551 * expression.cs (Invocation::ConversionExists): Correct the member lookup
30552 to find "op_Implicit", not "implicit" ;-)
30553 (UserImplicitCast): New class to take care of user-defined implicit conversions.
30554 (ConvertImplicit, ForceConversion): Take TypeContainer argument
30556 * everywhere : Correct calls to the above accordingly.
30558 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30559 (ConvertImplicit): Do user-defined conversion if it exists.
30561 2001-09-24 Miguel de Icaza <miguel@ximian.com>
30563 * assign.cs: track location.
30564 (Resolve): Use implicit conversions on assignment.
30566 * literal.cs: Oops. Not good, Emit of short access values should
30567 pass (Bytes) or the wrong argument will be selected.
30569 * expression.cs (Unary::Emit): Emit code for -expr.
30571 (Unary::ResolveOperator): Handle `Substract' for non-constants
30572 (substract from zero from the non-constants).
30573 Deal with Doubles as well.
30575 (Expression::ConvertImplicitRequired): New routine that reports an
30576 error if no implicit conversion exists.
30578 (Invocation::OverloadResolve): Store the converted implicit
30579 expressions if we make them
30581 2001-09-24 Ravi Pratap <ravi@ximian.com>
30583 * class.cs (ConstructorInitializer): Take a Location argument.
30584 (ConstructorBaseInitializer): Same here.
30585 (ConstructorThisInitializer): Same here.
30587 * cs-parser.jay : Update all calls accordingly.
30589 * expression.cs (Unary, Binary, New): Take location argument.
30590 Update accordingly everywhere.
30592 * cs-parser.jay : Update all calls to the above to take a location
30595 * class.cs : Ditto.
30597 2001-09-24 Ravi Pratap <ravi@ximian.com>
30599 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30600 (Invocation::BetterConversion): Same here
30601 (Invocation::ConversionExists): Ditto.
30603 (Invocation::ConversionExists): Implement.
30605 2001-09-22 Ravi Pratap <ravi@ximian.com>
30607 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30608 Also take an additional TypeContainer argument.
30610 * All over : Pass in TypeContainer as argument to OverloadResolve.
30612 * typemanager.cs (CSharpName): Update to check for the string type and return
30615 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30618 2001-09-21 Ravi Pratap <ravi@ximian.com>
30620 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30621 (Invocation::BetterFunction): Implement.
30622 (Invocation::BetterConversion): Implement.
30623 (Invocation::ConversionExists): Skeleton, no implementation yet.
30625 Okay, things work fine !
30627 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30629 * typemanager.cs: declare and load enum_type, delegate_type and
30632 * expression.cs (Expression::Emit): Now emit returns a value that
30633 tells whether a value is left on the stack or not. This strategy
30634 might be reveted tomorrow with a mechanism that would address
30635 multiple assignments.
30636 (Expression::report118): Utility routine to report mismatches on
30639 (Unary::Report23): Report impossible type/operator combination
30642 (Unary::IsIncrementableNumber): Whether the type can be
30643 incremented or decremented with add.
30644 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30646 (Unary::ResolveOperator): Implement ++, !, ~,
30648 (Invocation::Emit): Deal with new Emit convetion.
30650 * All Expression derivatives: Updated their Emit method to return
30651 whether they leave values on the stack or not.
30653 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30654 stack for expressions that are statements.
30656 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30658 * expression.cs (LValue): New interface. Must be implemented by
30660 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30663 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30664 interface for generating code, simplifies the code.
30666 2001-09-20 Ravi Pratap <ravi@ximian.com>
30668 * expression.cs (everywhere): Comment out return statements in ::Resolve
30669 methods to avoid the warnings.
30671 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30673 * driver.cs (parse): Report error 2001 if we can not open the
30676 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30679 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30682 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30683 otherwise nested blocks end up with the same index.
30685 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30687 * expression.cs: Instead of having FIXMEs in the Resolve
30688 functions, throw exceptions so it is obvious that we are facing a
30691 * cs-parser.jay (invocation_expression): Pass Location information.
30693 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30694 Use a basename for those routines because .NET does not like paths
30697 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30700 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30702 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30703 are loading the correct data types (throws an exception if not).
30704 (TypeManager::InitCoreTypes): Use CoreLookupType
30706 * expression.cs (Unary::ResolveOperator): return the child
30707 expression for expressions which are just +expr.
30708 (Unary::ResolveOperator): Return negative literals for -LITERAL
30709 expressions (otherwise they are Unary {Literal}).
30710 (Invocation::Badness): Take into account `Implicit constant
30711 expression conversions'.
30713 * literal.cs (LongLiteral): Implement long literal class.
30714 (IntLiteral): export the `Value' of the intliteral.
30716 2001-09-19 Ravi Pratap <ravi@ximian.com>
30718 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30720 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30721 instead of 'Operator'
30723 * expression.cs (Binary::ResolveOperator): Update accordingly.
30724 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30727 * cs-parser.jay (unary_expression): Update to use the new names.
30729 * gen-treedump.cs (GetUnary): Same here.
30731 * expression.cs (Unary::Resolve): Implement.
30732 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30733 operators are found instead of making noise ;-)
30734 (Unary::ResolveOperator): New method to do precisely the same thing which
30735 Binary::ResolveOperator does for Binary expressions.
30736 (Unary.method, .Arguments): Add.
30737 (Unary::OperName): Implement.
30738 (Unary::ForceConversion): Copy and Paste !
30740 * class.cs (Operator::Define): Fix a small bug for the case when we have
30743 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30744 for the inbuilt operators. Only overloading works for now ;-)
30746 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30748 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30749 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30751 * expression.cs (This::Emit): Implement.
30752 (This::Resolve): Implement.
30753 (TypeOf:Resolve): Implement.
30754 (Expression::ResolveSimpleName): Add an implicit this to instance
30756 (MemberAccess::Resolve): Deal with Parameters and Fields.
30757 Bind instance variable to Field expressions.
30758 (FieldExpr::Instance): New field used to track the expression that
30759 represents the object instance.
30760 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30762 (FieldExpr::Emit): Implement.
30764 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30765 the last instruction contains a return opcode to avoid generating
30766 the last `ret' instruction (this generates correct code, and it is
30767 nice to pass the peverify output).
30769 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30770 initializer for static and instance variables.
30771 (Constructor::Emit): Allow initializer to be null in the case of
30772 static constructors. Only emit initializer for instance
30775 (TypeContainer::FindMembers): Return a null array if there are no
30778 Also fix the code for the MemberTypes.Method branch, as it was not
30779 scanning that for operators (or tried to access null variables before).
30781 * assign.cs (Assign::Emit): Handle instance and static fields.
30785 * driver.cs: Stop compilation if there are parse errors.
30787 * cs-parser.jay (constructor_declaration): Provide default base
30788 initializer for non-static constructors.
30789 (constructor_declarator): Do not provide a default base
30790 initializers if none was specified.
30791 Catch the fact that constructors should not have parameters.
30793 * class.cs: Do not emit parent class initializers for static
30794 constructors, that should be flagged as an error.
30796 2001-09-18 Ravi Pratap <ravi@ximian.com>
30798 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30799 Move back code into TypeContainer::Populate.
30801 2001-09-18 Ravi Pratap <ravi@ximian.com>
30803 * class.cs (TypeContainer::AddConstructor): Fix the check to
30804 compare against Name, not Basename.
30805 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30807 * cs-parser.jay : Update accordingly.
30809 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30810 for methods, don't forget to look into the operators too.
30811 (RegisterMethodBuilder): Helper method to take care of this for
30812 methods, constructors and operators.
30813 (Operator::Define): Completely revamp.
30814 (Operator.OperatorMethod, MethodName): New fields.
30815 (TypeContainer::Populate): Move the registering of builders into
30816 RegisterMethodBuilder.
30817 (Operator::Emit): Re-write.
30819 * expression.cs (Binary::Emit): Comment out code path to emit method
30820 invocation stuff for the case when we have a user defined operator. I am
30821 just not able to get it right !
30823 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30825 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30828 (Expression::MemberLookup): Provide a version that allows to
30829 specify the MemberTypes and BindingFlags.
30831 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30832 so it was not fetching variable information from outer blocks.
30834 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30835 Beforefieldinit as it was buggy.
30837 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30838 that Ravi put here.
30840 * class.cs (Constructor::Emit): Only emit if block is not null.
30841 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30842 deal with this by semantically definining it as if the user had
30845 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30846 constructors as we now "emit" them at a higher level.
30848 (TypeContainer::DefineDefaultConstructor): Used to define the
30849 default constructors if none was provided.
30851 (ConstructorInitializer): Add methods Resolve and Emit.
30853 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30855 2001-09-17 Ravi Pratap <ravi@ximian.com>
30857 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30858 the default constructor builder with our hashtable for methodbuilders
30861 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30862 and argument_count is 0 in which case we have a match.
30863 (Binary::ResolveOperator): More null checking and miscellaneous coding
30866 2001-09-17 Ravi Pratap <ravi@ximian.com>
30868 * rootcontext.cs (IsNameSpace): Compare against null.
30870 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30872 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30873 and Unary::Operator.
30875 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30878 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30879 we have overloaded operators.
30880 (Binary::ResolveOperator): Implement the part which does the operator overload
30883 * class.cs (Operator::Emit): Implement.
30884 (TypeContainer::Emit): Emit the operators we have too.
30886 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30887 the case when we have a user-defined operator.
30889 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30891 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30893 2001-09-16 Ravi Pratap <ravi@ximian.com>
30895 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30896 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30897 (Constructor::Emit): Implement.
30898 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30899 if we have no work to do.
30900 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30903 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30904 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30906 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30909 2001-09-15 Ravi Pratap <ravi@ximian.com>
30911 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30913 (Tree::RecordNamespace): Method to do what the name says ;-)
30914 (Tree::Namespaces): Property to get at the namespaces hashtable.
30916 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30919 * rootcontext.cs (IsNamespace): Fixed it :-)
30921 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30923 * class.cs (TypeContainer::FindMembers): Add support for
30925 (MethodCore): New class that encapsulates both the shared aspects
30926 of a Constructor and a Method.
30927 (Method, Constructor): Factored pieces into MethodCore.
30929 * driver.cs: Added --fatal which makes errors throw exceptions.
30930 Load System assembly as well as part of the standard library.
30932 * report.cs: Allow throwing exceptions on errors for debugging.
30934 * modifiers.cs: Do not use `parent', instead use the real type
30935 container to evaluate permission settings.
30937 * class.cs: Put Ravi's patch back in. He is right, and we will
30938 have to cope with the
30940 2001-09-14 Ravi Pratap <ravi@ximian.com>
30942 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30943 FamORAssem, not FamANDAssem.
30945 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30947 * driver.cs: Added --parse option that only parses its input files
30950 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30951 incorrect. IsTopLevel is not used to tell whether an object is
30952 root_types or not (that can be achieved by testing this ==
30953 root_types). But to see if this is a top-level *class* (not
30954 necessarly our "toplevel" container).
30956 2001-09-14 Ravi Pratap <ravi@ximian.com>
30958 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30959 parent instead of a direct call to GetType.
30961 2001-09-14 Ravi Pratap <ravi@ximian.com>
30963 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30964 Modifiers.TypeAttr. This should just be a call to that method.
30966 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30967 object so that we can determine if we are top-level or not.
30969 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30972 * enum.cs (Enum::Define): Ditto.
30974 * modifiers.cs (FieldAttr): Re-write.
30976 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30977 (TypeContainer::HaveStaticConstructor): New property to provide access
30978 to precisely that info.
30980 * modifiers.cs (MethodAttr): Re-write.
30981 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30983 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30984 of top-level types as claimed.
30986 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30988 * expression.cs (MemberLookup): Fruitless attempt to lookup
30989 constructors. Maybe I need to emit default constructors? That
30990 might be it (currently .NET emits this for me automatically).
30991 (Invocation::OverloadResolve): Cope with Arguments == null.
30992 (Invocation::EmitArguments): new function, shared by the new
30993 constructor and us.
30994 (Invocation::Emit): Handle static and instance methods. Emit
30995 proper call instruction for virtual or non-virtual invocations.
30996 (New::Emit): Implement.
30997 (New::Resolve): Implement.
30998 (MemberAccess:Resolve): Implement.
30999 (MethodGroupExpr::InstanceExpression): used conforming to the spec
31000 to track instances.
31001 (FieldExpr::Resolve): Set type.
31003 * support.cs: Handle empty arguments.
31005 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31006 SimpleLookup): Auxiliary routines to help parse a qualifier
31009 Update qualifier_identifier rule.
31011 * codegen.cs: Removed debugging messages.
31013 * class.cs: Make this a global thing, this acts just as a "key" to
31014 objects that we might have around.
31016 (Populate): Only initialize method_builders_to_methods once.
31018 * expression.cs (PropertyExpr): Initialize type from the
31021 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31022 Resolve pattern. Attempt to implicitly convert value to boolean.
31025 * expression.cs: Set the type for the int32/int32 argument case.
31026 (Binary::ResolveOperator): Set the return type to boolean for
31027 comparission operators
31029 * typemanager.cs: Remove debugging print code.
31031 (Invocation::Resolve): resolve type.
31033 * class.cs: Allocate a MemberInfo of the correct size, as the code
31034 elsewhere depends on the test to reflect the correct contents.
31036 (Method::) Keep track of parameters, due to System.Reflection holes
31038 (TypeContainer::Populate): Keep track of MethodBuilders to Method
31041 (TypeContainer::FindMembers): Use ArrayList and then copy an array
31042 of the exact size and return that.
31044 (Class::LookupMethodByBuilder): New function that maps
31045 MethodBuilders to its methods. Required to locate the information
31046 on methods because System.Reflection bit us again.
31048 * support.cs: New file, contains an interface ParameterData and
31049 two implementations: ReflectionParameters and InternalParameters
31050 used to access Parameter information. We will need to grow this
31053 * expression.cs (Invocation::GetParameterData): implement a cache
31054 and a wrapper around the ParameterData creation for methods.
31055 (Invocation::OverloadResolve): Use new code.
31057 2001-09-13 Ravi Pratap <ravi@ximian.com>
31059 * class.cs (TypeContainer::EmitField): Remove and move into
31060 (Field::Define): here and modify accordingly.
31061 (Field.FieldBuilder): New member.
31062 (TypeContainer::Populate): Update accordingly.
31063 (TypeContainer::FindMembers): Implement.
31065 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31067 * statement.cs: (VariableInfo::VariableType): New field to be
31068 initialized with the full type once it is resolved.
31070 2001-09-12 Miguel de Icaza <miguel@ximian.com>
31072 * parameter.cs (GetParameterInfo): Use a type cache to compute
31073 things only once, and to reuse this information
31075 * expression.cs (LocalVariableReference::Emit): Implement.
31076 (OpcodeCast::Emit): fix.
31078 (ParameterReference::Resolve): Implement.
31079 (ParameterReference::Emit): Implement.
31081 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31082 that are expressions need to stay as Expressions.
31084 * typemanager.cs (CSharpName): Returns the C# name of a type if
31087 * expression.cs (Expression::ConvertImplicit): New function that
31088 implements implicit type conversions.
31090 (Expression::ImplicitReferenceConversion): Implements implicit
31091 reference conversions.
31093 (EmptyCast): New type for transparent casts.
31095 (OpcodeCast): New type for casts of types that are performed with
31096 a sequence of bytecodes.
31098 (BoxedCast): New type used for casting value types into reference
31099 types. Emits a box opcode.
31101 (Binary::DoNumericPromotions): Implements numeric promotions of
31102 and computation of the Binary::Type.
31104 (Binary::EmitBranchable): Optimization.
31106 (Binary::Emit): Implement code emission for expressions.
31108 * typemanager.cs (TypeManager): Added two new core types: sbyte
31111 2001-09-12 Ravi Pratap <ravi@ximian.com>
31113 * class.cs (TypeContainer::FindMembers): Method which does exactly
31114 what Type.FindMembers does, only we don't have to use reflection. No
31115 implementation yet.
31117 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31118 typecontainer objects as we need to get at them.
31119 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31121 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31122 typecontainer object.
31124 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31125 of just a Report object.
31127 2001-09-11 Ravi Pratap <ravi@ximian.com>
31129 * class.cs (Event::Define): Go back to using the prefixes "add_" and
31131 (TypeContainer::Populate): Now define the delegates of the type too.
31132 (TypeContainer.Delegates): Property to access the list of delegates defined
31135 * delegates.cs (Delegate::Define): Implement partially.
31137 * modifiers.cs (TypeAttr): Handle more flags.
31139 2001-09-11 Ravi Pratap <ravi@ximian.com>
31141 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31143 (Operator::Define): Re-write logic to get types by using the LookupType method
31144 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31145 (Indexer::Define): Ditto.
31146 (Event::Define): Ditto.
31147 (Property::Define): Ditto.
31149 2001-09-10 Ravi Pratap <ravi@ximian.com>
31151 * class.cs (TypeContainer::Populate): Now define operators too.
31152 (TypeContainer.Operators): New property to access the list of operators
31154 (Operator.OperatorMethodBuilder): New member to hold the method builder
31155 for the operator we are defining.
31156 (Operator::Define): Implement.
31158 2001-09-10 Ravi Pratap <ravi@ximian.com>
31160 * class.cs (Event::Define): Make the prefixes of the accessor methods
31161 addOn_ and removeOn_
31163 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31164 of the location being passed in too. Ideally, this should go later since all
31165 error reporting should be done through the Report object.
31167 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31168 (Populate): Iterate thru the indexers we have and define them too.
31169 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31170 for the get and set accessors.
31171 (Indexer::Define): Implement.
31173 2001-09-09 Miguel de Icaza <miguel@ximian.com>
31175 * expression.cs (Binary::Resolve): Beginning of it. I scratched
31176 my previous implementation, did not work.
31178 * typemanager.cs: Add a couple of missing types (the longs).
31180 * literal.cs: Use TypeManager.bool_type instead of getting it.
31182 * expression.cs (EventExpr): New kind of expressions.
31183 (Expressio::ExprClassFromMemberInfo): finish
31185 2001-09-08 Miguel de Icaza <miguel@ximian.com>
31187 * assign.cs: Emit stores to static fields differently.
31189 2001-09-08 Ravi Pratap <ravi@ximian.com>
31191 * Merge in changes and adjust code to tackle conflicts. Backed out my
31192 code in Assign::Resolve ;-)
31194 2001-09-08 Ravi Pratap <ravi@ximian.com>
31196 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31197 instead Report.Error and also pass in the location.
31198 (CSharpParser::Lexer): New readonly property to return the reference
31199 to the Tokenizer object.
31200 (declare_local_variables): Use Report.Error with location instead of plain
31204 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31205 (Operator.CheckBinaryOperator): Ditto.
31207 * cs-parser.jay (operator_declarator): Update accordingly.
31209 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31210 (CheckBinaryOperator): Same here.
31212 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31213 on the name without any prefixes of namespace names etc. This is because we
31214 already might have something already fully qualified like
31215 'System.Console.WriteLine'
31217 * assign.cs (Resolve): Begin implementation. Stuck ;-)
31219 2001-09-07 Ravi Pratap <ravi@ximian.com>
31221 * cs-tokenizer.cs (location): Return a string which also contains
31224 * expression.cs (ElementAccess): New class for expressions of the
31225 type 'element access.'
31226 (BaseAccess): New class for expressions of the type 'base access.'
31227 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31230 * cs-parser.jay (element_access): Implement action.
31231 (base_access): Implement actions.
31232 (checked_expression, unchecked_expression): Implement.
31234 * cs-parser.jay (local_variable_type): Correct and implement.
31235 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31237 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31239 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31240 name and the specifiers.
31242 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31244 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
31245 making them all public ;-)
31247 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31250 2001-09-07 Miguel de Icaza <miguel@ximian.com>
31252 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31254 (FieldExpr, PropertyExprs): New resolved expressions.
31255 (SimpleName::MemberStaticCheck): Perform static checks for access
31256 to non-static fields on static methods. Maybe this should be
31257 generalized for MemberAccesses.
31258 (SimpleName::ResolveSimpleName): More work on simple name
31261 * cs-parser.jay (primary_expression/qualified_identifier): track
31262 the parameter index.
31264 * codegen.cs (CodeGen::Save): Catch save exception, report error.
31265 (EmitContext::EmitBoolExpression): Chain to expression generation
31266 instead of temporary hack.
31267 (::EmitStatementExpression): Put generic expression code generation.
31269 * assign.cs (Assign::Emit): Implement variable assignments to
31270 local variables, parameters and fields.
31272 2001-09-06 Miguel de Icaza <miguel@ximian.com>
31274 * statement.cs (Block::GetVariableInfo): New method, returns the
31275 VariableInfo for a variable name in a block.
31276 (Block::GetVariableType): Implement in terms of GetVariableInfo
31278 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31279 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31281 2001-09-06 Ravi Pratap <ravi@ximian.com>
31283 * cs-parser.jay (operator_declaration): Continue on my quest : update
31284 to take attributes argument.
31285 (event_declaration): Ditto.
31286 (enum_declaration): Ditto.
31287 (indexer_declaration): Ditto.
31289 * class.cs (Operator::Operator): Update constructor accordingly.
31290 (Event::Event): Ditto.
31292 * delegate.cs (Delegate::Delegate): Same here.
31294 * enum.cs (Enum::Enum): Same here.
31296 2001-09-05 Ravi Pratap <ravi@ximian.com>
31298 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31300 * ../tests/cs0658.cs : New file to demonstrate error 0658.
31302 * attribute.cs (Attributes): New class to encapsulate all attributes which were
31303 being passed around as an arraylist.
31304 (Attributes::AddAttribute): Method to add attribute sections.
31306 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31307 (struct_declaration): Update accordingly.
31308 (constant_declaration): Update.
31309 (field_declaration): Update.
31310 (method_header): Update.
31311 (fixed_parameter): Update.
31312 (parameter_array): Ditto.
31313 (property_declaration): Ditto.
31314 (destructor_declaration): Ditto.
31316 * class.cs (Struct::Struct): Update constructors accordingly.
31317 (Class::Class): Ditto.
31318 (Field::Field): Ditto.
31319 (Method::Method): Ditto.
31320 (Property::Property): Ditto.
31321 (TypeContainer::OptAttribute): update property's return type.
31323 * interface.cs (Interface.opt_attributes): New member.
31324 (Interface::Interface): Update to take the extra Attributes argument.
31326 * parameter.cs (Parameter::Parameter): Ditto.
31328 * constant.cs (Constant::Constant): Ditto.
31330 * interface.cs (InterfaceMemberBase): New OptAttributes field.
31331 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
31332 the attributes as a parameter.
31333 (InterfaceProperty): Update constructor call.
31334 (InterfaceEvent): Ditto.
31335 (InterfaceMethod): Ditto.
31336 (InterfaceIndexer): Ditto.
31338 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
31339 pass the attributes too.
31340 (interface_event_declaration): Ditto.
31341 (interface_property_declaration): Ditto.
31342 (interface_method_declaration): Ditto.
31343 (interface_declaration): Ditto.
31345 2001-09-05 Miguel de Icaza <miguel@ximian.com>
31347 * class.cs (Method::Define): Track the "static Main" definition to
31348 create an entry point.
31350 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31351 EntryPoint if we find it.
31353 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31354 (EmitContext::ig): Make this variable public.
31356 * driver.cs: Make the default output file be the first file name
31357 with the .exe extension.
31359 Detect empty compilations
31361 Handle various kinds of output targets. Handle --target and
31362 rename -t to --dumper.
31364 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31365 methods inherited from Expression return now an Expression. This
31366 will is used during the tree rewriting as we resolve them during
31369 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31370 the spec. Missing entirely is the information about
31371 accessability of elements of it.
31373 (Expression::ExprClassFromMemberInfo): New constructor for
31374 Expressions that creates a fully initialized Expression based on
31375 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31378 (Invocation::Resolve): Begin implementing resolution of invocations.
31380 * literal.cs (StringLiteral): Implement Emit.
31382 2001-09-05 Ravi Pratap <ravi@ximian.com>
31384 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31387 2001-09-04 Ravi Pratap <ravi@ximian.com>
31389 * cs-parser.jay (attribute_arguments): Implement actions.
31390 (attribute): Fix bug in production. Implement action.
31391 (attribute_list): Implement.
31392 (attribute_target): Implement.
31393 (attribute_target_specifier, opt_target_specifier): Implement
31394 (CheckAttributeTarget): New method to check if the attribute target
31396 (attribute_section): Implement.
31397 (opt_attributes): Implement.
31399 * attribute.cs : New file to handle attributes.
31400 (Attribute): Class to hold attribute info.
31402 * cs-parser.jay (opt_attribute_target_specifier): Remove production
31403 (attribute_section): Modify production to use 2 different rules to
31404 achieve the same thing. 1 s/r conflict down !
31405 Clean out commented, useless, non-reducing dimension_separator rules.
31407 * class.cs (TypeContainer.attributes): New member to hold list
31408 of attributes for a type.
31409 (Struct::Struct): Modify to take one more argument, the attribute list.
31410 (Class::Class): Ditto.
31411 (Field::Field): Ditto.
31412 (Method::Method): Ditto.
31413 (Property::Property): Ditto.
31415 * cs-parser.jay (struct_declaration): Update constructor call to
31416 pass in the attributes too.
31417 (class_declaration): Ditto.
31418 (constant_declaration): Ditto.
31419 (field_declaration): Ditto.
31420 (method_header): Ditto.
31421 (fixed_parameter): Ditto.
31422 (parameter_array): Ditto.
31423 (property_declaration): Ditto.
31425 * constant.cs (Constant::Constant): Update constructor similarly.
31426 Use System.Collections.
31428 * parameter.cs (Parameter::Parameter): Update as above.
31430 2001-09-02 Ravi Pratap <ravi@ximian.com>
31432 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31433 (TypeContainer.delegates): New member to hold list of delegates.
31435 * cs-parser.jay (delegate_declaration): Implement the action correctly
31436 this time as I seem to be on crack ;-)
31438 2001-09-02 Miguel de Icaza <miguel@ximian.com>
31440 * rootcontext.cs (RootContext::IsNamespace): new function, used to
31441 tell whether an identifier represents a namespace.
31443 * expression.cs (NamespaceExpr): A namespace expression, used only
31444 temporarly during expression resolution.
31445 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31446 utility functions to resolve names on expressions.
31448 2001-09-01 Miguel de Icaza <miguel@ximian.com>
31450 * codegen.cs: Add hook for StatementExpressions.
31452 * class.cs: Fix inverted test for static flag in methods.
31454 2001-09-02 Ravi Pratap <ravi@ximian.com>
31456 * class.cs (Operator::CheckUnaryOperator): Correct error number used
31457 to make it coincide with MS' number.
31458 (Operator::CheckBinaryOperator): Ditto.
31460 * ../errors/errors.txt : Remove error numbers added earlier.
31462 * ../errors/cs1019.cs : Test case for error # 1019
31464 * ../errros/cs1020.cs : Test case for error # 1020
31466 * cs-parser.jay : Clean out commented cruft.
31467 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31468 used anywhere - non-reducing rule.
31469 (namespace_declarations): Non-reducing rule - comment out.
31471 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31472 with TypeContainer::AddEnum.
31474 * delegate.cs : New file for delegate handling classes.
31475 (Delegate): Class for declaring delegates.
31477 * makefile : Update.
31479 * cs-parser.jay (delegate_declaration): Implement.
31481 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
31483 * class.cs (Event::Define): Implement.
31484 (Event.EventBuilder): New member.
31486 * class.cs (TypeContainer::Populate): Update to define all enums and events
31488 (Events): New property for the events arraylist we hold. Shouldn't we move to using
31489 readonly fields for all these cases ?
31491 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31493 * class.cs (Property): Revamp to use the convention of making fields readonly.
31494 Accordingly modify code elsewhere.
31496 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31497 the Define method of the Property class.
31499 * class.cs : Clean up applied patch and update references to variables etc. Fix
31501 (TypeContainer::Populate): Update to define all the properties we have. Also
31502 define all enumerations.
31504 * enum.cs (Define): Implement.
31506 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31508 * cs-parser.jay (overloadable_operator): The semantic value is an
31509 enum of the Operator class.
31510 (operator_declarator): Implement actions.
31511 (operator_declaration): Implement.
31513 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31514 validity of definitions.
31515 (Operator::CheckBinaryOperator): Static method to check for binary operators
31516 (TypeContainer::AddOperator): New method to add an operator to a type.
31518 * cs-parser.jay (indexer_declaration): Added line to actually call the
31519 AddIndexer method so it gets added ;-)
31521 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
31522 already taken care of by the MS compiler ?
31524 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31526 * class.cs (Operator): New class for operator declarations.
31527 (Operator::OpType): Enum for the various operators.
31529 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31531 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31532 ostensibly handle this in semantic analysis.
31534 * cs-parser.jay (general_catch_clause): Comment out
31535 (specific_catch_clauses, specific_catch_clause): Ditto.
31536 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31537 (catch_args, opt_catch_args): New productions.
31538 (catch_clause): Rewrite to use the new productions above
31539 (catch_clauses): Modify accordingly.
31540 (opt_catch_clauses): New production to use in try_statement
31541 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31542 and re-write the code in the actions to extract the specific and
31543 general catch clauses by being a little smart ;-)
31545 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31546 Hooray, try and catch statements parse fine !
31548 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31550 * statement.cs (Block::GetVariableType): Fix logic to extract the type
31551 string from the hashtable of variables.
31553 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31554 I end up making that mistake ;-)
31555 (catch_clauses): Fixed gross error which made Key and Value of the
31556 DictionaryEntry the same : $1 !!
31558 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31560 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31562 * cs-parser.jay (event_declaration): Correct to remove the semicolon
31563 when the add and remove accessors are specified.
31565 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31567 * cs-parser.jay (IndexerDeclaration): New helper class to hold
31568 information about indexer_declarator.
31569 (indexer_declarator): Implement actions.
31570 (parsing_indexer): New local boolean used to keep track of whether
31571 we are parsing indexers or properties. This is necessary because
31572 implicit_parameters come into picture even for the get accessor in the
31573 case of an indexer.
31574 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31576 * class.cs (Indexer): New class for indexer declarations.
31577 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31578 (TypeContainer::indexers): New member to hold list of indexers for the
31581 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31583 * cs-parser.jay (add_accessor_declaration): Implement action.
31584 (remove_accessor_declaration): Implement action.
31585 (event_accessors_declaration): Implement
31586 (variable_declarators): swap statements for first rule - trivial.
31588 * class.cs (Event): New class to hold information about event
31590 (TypeContainer::AddEvent): New method to add an event to a type
31591 (TypeContainer::events): New member to hold list of events.
31593 * cs-parser.jay (event_declaration): Implement actions.
31595 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31597 * cs-parser.jay (dim_separators): Implement. Make it a string
31598 concatenating all the commas together, just as they appear.
31599 (opt_dim_separators): Modify accordingly
31600 (rank_specifiers): Update accordingly. Basically do the same
31601 thing - instead, collect the brackets here.
31602 (opt_rank_sepcifiers): Modify accordingly.
31603 (array_type): Modify to actually return the complete type string
31604 instead of ignoring the rank_specifiers.
31605 (expression_list): Implement to collect the expressions
31606 (variable_initializer): Implement. We make it a list of expressions
31607 essentially so that we can handle the array_initializer case neatly too.
31608 (variable_initializer_list): Implement.
31609 (array_initializer): Make it a list of variable_initializers
31610 (opt_array_initializer): Modify accordingly.
31612 * expression.cs (New::NType): Add enumeration to help us
31613 keep track of whether we have an object/delegate creation
31614 or an array creation.
31615 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31616 members to hold data about array creation.
31617 (New:New): Modify to update NewType
31618 (New:New): New Overloaded contructor for the array creation
31621 * cs-parser.jay (array_creation_expression): Implement to call
31622 the overloaded New constructor.
31624 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31626 * class.cs (TypeContainer::Constructors): Return member
31627 constructors instead of returning null.
31629 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31631 * typemanager.cs (InitCoreTypes): Initialize the various core
31632 types after we have populated the type manager with the user
31633 defined types (this distinction will be important later while
31634 compiling corlib.dll)
31636 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31637 on Expression Classification. Now all expressions have a method
31638 `Resolve' and a method `Emit'.
31640 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31641 generation from working. Also add some temporary debugging
31644 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31646 * codegen.cs: Lots of code generation pieces. This is only the
31647 beginning, will continue tomorrow with more touches of polish. We
31648 handle the fundamentals of if, while, do, for, return. Others are
31649 trickier and I need to start working on invocations soon.
31651 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31654 * codegen.cs (EmitContext): New struct, used during code
31655 emission to keep a context. Most of the code generation will be
31658 * cs-parser.jay: Add embedded blocks to the list of statements of
31659 this block. So code generation proceeds in a top down fashion.
31661 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31663 * statement.cs: Add support for multiple child blocks.
31665 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31667 * codegen.cs (EmitCode): New function, will emit the code for a
31668 Block of code given a TypeContainer and its ILGenerator.
31670 * statement.cs (Block): Standard public readonly optimization.
31671 (Block::Block constructors): Link children.
31672 (Block::Child): Child Linker.
31673 (Block::EmitVariables): Emits IL variable declarations.
31675 * class.cs: Drop support for MethodGroups here, delay until
31677 (Method::): Applied the same simplification that I did before, and
31678 move from Properties to public readonly fields.
31679 (Method::ParameterTypes): Returns the parameter types for the
31680 function, and implements a cache that will be useful later when I
31681 do error checking and the semantic analysis on the methods is
31683 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31684 and made a method, optional argument tells whether this is a class
31685 or a structure to apply the `has-this' bit.
31686 (Method::GetCallingConvention): Implement, returns the calling
31688 (Method::Define): Defines the type, a second pass is performed
31689 later to populate the methods.
31691 (Constructor::ParameterTypes): implement a cache similar to the
31692 one on Method::ParameterTypes, useful later when we do semantic
31695 (TypeContainer::EmitMethod): New method. Emits methods.
31697 * expression.cs: Removed MethodGroup class from here.
31699 * parameter.cs (Parameters::GetCallingConvention): new method.
31701 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31703 * class.cs (TypeContainer::Populate): Drop RootContext from the
31706 (Constructor::CallingConvention): Returns the calling convention.
31707 (Constructor::ParameterTypes): Returns the constructor parameter
31710 (TypeContainer::AddConstructor): Keep track of default constructor
31711 and the default static constructor.
31713 (Constructor::) Another class that starts using `public readonly'
31714 instead of properties.
31716 (Constructor::IsDefault): Whether this is a default constructor.
31718 (Field::) use readonly public fields instead of properties also.
31720 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31721 track of static constructors; If none is used, turn on
31722 BeforeFieldInit in the TypeAttributes.
31724 * cs-parser.jay (opt_argument_list): now the return can be null
31725 for the cases where there are no arguments.
31727 (constructor_declarator): If there is no implicit `base' or
31728 `this', then invoke the default parent constructor.
31730 * modifiers.cs (MethodAttr): New static function maps a set of
31731 modifiers flags into a MethodAttributes enum
31732 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31733 MethodAttr, TypeAttr to represent the various mappings where the
31734 modifiers are used.
31735 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31737 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31739 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31742 * interface.cs (PopulateIndexer): Implemented the code generator
31743 for interface indexers.
31745 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31747 * interface.cs (InterfaceMemberBase): Now we track the new status
31750 (PopulateProperty): Implement property population. Woohoo! Got
31751 Methods and Properties going today.
31753 Removed all the properties for interfaces, and replaced them with
31754 `public readonly' fields.
31756 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31758 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31759 initialize their hashtables/arraylists only when they are needed
31760 instead of doing this always.
31762 * parameter.cs: Handle refs and out parameters.
31764 * cs-parser.jay: Use an ArrayList to construct the arguments
31765 instead of the ParameterCollection, and then cast that to a
31768 * parameter.cs: Drop the use of ParameterCollection and use
31769 instead arrays of Parameters.
31771 (GetParameterInfo): Use the Type, not the Name when resolving
31774 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31776 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31777 and instead use public readonly fields.
31779 * class.cs: Put back walking code for type containers.
31781 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31783 * class.cs (MakeConstant): Code to define constants.
31785 * rootcontext.cs (LookupType): New function. Used to locate types
31788 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31790 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31791 this System.Reflection code is. Kudos to Microsoft
31793 * typemanager.cs: Implement a type cache and avoid loading all
31794 types at boot time. Wrap in LookupType the internals. This made
31795 the compiler so much faster. Wow. I rule!
31797 * driver.cs: Make sure we always load mscorlib first (for
31798 debugging purposes, nothing really important).
31800 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31801 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31803 * rootcontext.cs: Lookup types on their namespace; Lookup types
31804 on namespaces that have been imported using the `using' keyword.
31806 * class.cs (TypeContainer::TypeAttr): Virtualize.
31807 (Class::TypeAttr): Return attributes suitable for this bad boy.
31808 (Struct::TypeAttr): ditto.
31809 Handle nested classes.
31810 (TypeContainer::) Remove all the type visiting code, it is now
31811 replaced with the rootcontext.cs code
31813 * rootcontext.cs (GetClassBases): Added support for structs.
31815 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31817 * interface.cs, statement.cs, class.cs, parameter.cs,
31818 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31819 Drop use of TypeRefs, and use strings instead.
31821 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31825 * class.cs (Struct::Struct): set the SEALED flags after
31826 checking the modifiers.
31827 (TypeContainer::TypeAttr): new property, returns the
31828 TypeAttributes for a class.
31830 * cs-parser.jay (type_list): Oops, list production was creating a
31831 new list of base types.
31833 * rootcontext.cs (StdLib): New property.
31834 (GetInterfaceTypeByName): returns an interface by type name, and
31835 encapsulates error handling here.
31836 (GetInterfaces): simplified.
31837 (ResolveTree): Encapsulated all the tree resolution here.
31838 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31841 * driver.cs: Add support for --nostdlib, to avoid loading the
31842 default assemblies.
31843 (Main): Do not put tree resolution here.
31845 * rootcontext.cs: Beginning of the class resolution.
31847 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31849 * rootcontext.cs: Provide better error reporting.
31851 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31853 * rootcontext.cs (CreateInterface): Handle the case where there
31854 are no parent interfaces.
31856 (CloseTypes): Routine to flush types at the end.
31857 (CreateInterface): Track types.
31858 (GetInterfaces): Returns an array of Types from the list of
31859 defined interfaces.
31861 * typemanager.c (AddUserType): Mechanism to track user types (puts
31862 the type on the global type hash, and allows us to close it at the
31865 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31867 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31868 RecordInterface instead.
31870 * cs-parser.jay: Updated to reflect changes above.
31872 * decl.cs (Definition): Keep track of the TypeBuilder type that
31873 represents this type here. Not sure we will use it in the long
31874 run, but wont hurt for now.
31876 * driver.cs: Smaller changes to accomodate the new code.
31878 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31881 * rootcontext.cs (CreateInterface): New method, used to create
31882 the System.TypeBuilder type for interfaces.
31883 (ResolveInterfaces): new entry point to resolve the interface
31885 (CodeGen): Property, used to keep track of the code generator.
31887 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31889 * cs-parser.jay: Add a second production for delegate_declaration
31892 (enum_body): Put an opt_comma here instead of putting it on
31893 enum_body or enum_member_declarations so we can handle trailing
31894 commas on enumeration members. Gets rid of a shift/reduce.
31896 (type_list): Need a COMMA in the middle.
31898 (indexer_declaration): Tell tokenizer to recognize get/set
31900 * Remove old targets.
31902 * Re-add the parser target.
31904 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31906 * cs-parser.jay: Add precendence rules for a number of operators
31907 ot reduce the number of shift/reduce conflicts in the grammar.
31909 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31911 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31914 Get rid of old crufty code.
31916 * rootcontext.cs: Use this to keep track of the parsed
31917 representation and the defined types available to the program.
31919 * gen-treedump.cs: adjust for new convention.
31921 * type.cs: Split out the type manager, and the assembly builder
31924 * typemanager.cs: the type manager will live here now.
31926 * cil-codegen.cs: And the code generator here.
31928 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31930 * makefile: Fixed up for easy making.
31932 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31934 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31937 (unary_expression): Expand pre_increment_expression and
31938 post_decrement_expression to reduce a shift/reduce.
31940 2001-07-11 Simon Cozens
31942 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31944 Improve allow_keyword_as_indent name.
31946 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31948 * Adjustments for Beta2.
31950 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31952 * decl.cs: Added `Define' abstract method.
31953 (InTransit): new property, used to catch recursive definitions.
31955 * interface.cs: Implement `Define'.
31957 * modifiers.cs: Map Modifiers.constants to
31958 System.Reflection.TypeAttribute flags.
31960 * class.cs: Keep track of types and user-defined types.
31961 (BuilderInit): New method for creating an assembly
31962 (ResolveType): New function to launch the resolution process, only
31963 used by interfaces for now.
31965 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31966 that are inserted into the name space.
31968 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31970 * ARGH. I have screwed up my tree so many times due to the use of
31971 rsync rather than using CVS. Going to fix this at once.
31973 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31976 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31978 * Experiment successful: Use System.Type rather that our own
31981 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31983 * cs-parser.jay: Removed nsAliases from here.
31985 Use new namespaces, handle `using XXX;'
31987 * namespace.cs: Reimplemented namespace handling, use a recursive
31988 definition of the class. Now we can keep track of using clauses
31989 and catch invalid using clauses.
31991 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31993 * gen-treedump.cs: Adapted for all the renaming.
31995 * expression.cs (Expression): this class now has a Type property
31996 which returns an expression Type.
31998 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31999 `Type', as this has a different meaning now in the base
32001 2001-05-22 Miguel de Icaza <miguel@ximian.com>
32003 * interface.cs, class.cs: Removed from all the sources the
32004 references to signature computation, as we can not do method
32005 signature computation during the parsing time, as we are not
32006 trying to solve at that point distinguishing:
32010 void a (NS.Blah x) {}
32013 Which depending on the context might be valid or not, as we do not
32014 know if Blah is the same thing as NS.Blah at that point.
32016 * Redid everything so the code uses TypeRefs now instead of
32017 Types. TypeRefs are just temporary type placeholders, that need
32018 to be resolved. They initially have a pointer to a string and the
32019 current scope in which they are used. This is used later by the
32020 compiler to resolve the reference to an actual Type.
32022 * DeclSpace is no longer a CIR.Type, and neither are
32023 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
32024 are all DeclSpaces, but no Types.
32026 * type.cs (TypeRefManager): This implements the TypeRef manager,
32027 which keeps track of all the types that need to be resolved after
32028 the parsing has finished.
32030 2001-05-13 Miguel de Icaza <miguel@ximian.com>
32032 * ARGH. We are going to have to store `foreach' as a class rather
32033 than resolving it, as we need to verify error 1579 after name
32034 resolution. *OR* we could keep a flag that says `This request to
32035 IEnumerator comes from a foreach statement' which we can then use
32036 to generate the error.
32038 2001-05-10 Miguel de Icaza <miguel@ximian.com>
32040 * class.cs (TypeContainer.AddMethod): we now add methods to the
32041 MethodGroup instead of the method hashtable.
32043 * expression.cs: Add MethodGroup abstraction, which gets us one
32044 step closer to the specification in the way we handle method
32047 * cs-parser.jay (primary_expression): qualified_identifier now
32048 tried to match up an identifier to a local variable reference or
32049 to a parameter reference.
32051 current_local_parameters is now a parser global variable that
32052 points to the current parameters for the block, used during name
32055 (property_declaration): Now creates an implicit `value' argument to
32058 2001-05-09 Miguel de Icaza <miguel@ximian.com>
32060 * parameter.cs: Do not use `param' arguments as part of the
32061 signature, per the spec.
32063 2001-05-08 Miguel de Icaza <miguel@ximian.com>
32065 * decl.cs: Base class for classes, structs and interfaces. This
32066 is the "Declaration Space"
32068 * cs-parser.jay: Use CheckDef for checking declaration errors
32069 instead of having one on each function.
32071 * class.cs: Factor out some code for handling error handling in
32072 accordance to the "Declarations" section in the "Basic Concepts"
32073 chapter in the ECMA C# spec.
32075 * interface.cs: Make all interface member classes derive from
32076 InterfaceMemberBase.
32078 2001-05-07 Miguel de Icaza <miguel@ximian.com>
32080 * Many things: all interfaces are parsed and generated in
32081 gen-treedump. Support for member variables, constructors,
32082 destructors, properties, constants is there.
32084 Beginning of the IL backend, but very little done, just there for
32087 2001-04-29 Miguel de Icaza <miguel@ximian.com>
32089 * cs-parser.jay: Fix labeled statement.
32091 * cs-tokenizer.cs (escape): Escape " and ' always.
32092 ref_line, ref_name: keep track of the line/filename as instructed
32093 by #line by the compiler.
32096 2001-04-27 Miguel de Icaza <miguel@ximian.com>
32098 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32099 to match the values in System.CodeDOM.
32101 Divid renamed to Divide.
32103 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32105 (Statements.set): remove.
32107 * System.CodeDOM/CodeCatchClause.cs: always have a valid
32110 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32111 falseStatements always have valid values.
32113 * cs-parser.jay: Use System.CodeDOM now.