1 2009-04-23 Miguel de Icaza <miguel@novell.com>
3 * eval.cs: Make getcompletions silent and enable debugging output
4 if the -v option is passed.
6 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
7 Consider looking up the namespace that matches the prefix being
10 This is part of the support for allowing completions like:
11 `System.Co<TAB>' to complete to System.Console.
13 * complete.cs (CompletionSimpleName.AppendResults): Make this
16 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
18 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
19 COMPLETE_COMPLETION as internal.
21 2009-04-17 Miguel de Icaza <miguel@novell.com>
23 * complete.cs: Include namespace resolution in simple names as
24 well as global types and types in the using scope in the
27 * namespace.cs: Supporting infrastrcture to provide completions
28 based on the current using scope.
30 * eval.cs: Introduce an entry point that allows for initialization
31 to return a list of the files passed on the command line.
33 2009-04-14 Marek Safar <marek.safar@gmail.com>
36 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
38 2009-04-13 Marek Safar <marek.safar@gmail.com>
41 * statement.cs: Don't skip string multi-section with default or
42 null label when populating string hashtable.
44 2009-04-06 Marek Safar <marek.safar@gmail.com>
47 * expression.cs (New): Load variable when assigning type parameter
50 2009-04-06 Marek Safar <marek.safar@gmail.com>
53 * decl.cs: Compare MVAR types using non-null values.
55 2009-03-27 Marek Safar <marek.safar@gmail.com>
57 * typemanager.cs, expression.cs: Removed unused nullable checks.
59 2009-03-27 Marek Safar <marek.safar@gmail.com>
61 * *.cs: Removed some gmcs conditionals.
63 2009-03-26 Marek Safar <marek.safar@gmail.com>
65 * generic.cs, support.cs: Moved generics stuff out of support.cs
67 2009-03-24 Marek Safar <marek.safar@gmail.com>
69 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
72 2009-03-23 Marek Safar <marek.safar@gmail.com>
74 * attribute.cs: Consider all members for error reporting when
75 checking named arguments.
77 2009-03-23 Marek Safar <marek.safar@gmail.com>
80 * namespace.cs: Use a warning for all predefined type conflicts.
82 2009-03-23 Marek Safar <marek.safar@gmail.com>
85 * statement.cs: Explicitly type catch type argument to pass verifier
88 2009-03-22 Miguel de Icaza <miguel@novell.com>
90 Initial support to provide code completion facilities to consumers
93 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
94 support the completion engine. When we reach the end of the
95 input stream instead of returning EOF, when this flag is true the
96 tokenizer instead produces:
98 One GENERATE_COMPLETION token: this token then must be
99 handled in the grammar at every point where the user
100 would likely request a completion.
102 As many COMPLETE_COMPLETION tokens as necessary. These
103 tokens are generated to assist the parser in unwinding and
104 producing a valid parse tree.
106 The parser rules do not have to be perfect, the parser needs to be
107 augmented with judicious use of GENERATE_COMPLETION tokens to
108 improve the areas where we can provide completion and the parser
109 needs to add support for COMPLETE_COMPLETION tokens in productions
112 It is common to not have enough support for COMPLETE_COMPLETION
113 under certain rules and that even if we generated the
114 GENERATE_COMPLETION token that the resulting tree will be invalid
115 due to the missing rules that support COMPLETE_COMPLETION.
117 The final EOF token is produced by having the parser notify the
118 tokenizer when it reaches the root production that the next token
121 * support.cs (CompletionResult): New Exception. This exception
122 is thrown to return the completion results when one of the special
123 completion expressions is reached.
125 This exception is thrown by the completing ExpressionStatements
126 classes that live in complete.cs
128 * complete.cs (CompletingExpression): a new base class for
129 completing expressions. This derives from the
130 ExpressionStatement class and not from Expression as it allows
131 completion to happen not only where expressions are expected in
132 the grammar, but also where statements are expected.
134 (CompletionSimpleName): A new class used to provide completions
135 for SimpleNames. This currently only resolves to local
136 variables from the evaluator context (GetVars call).
138 (CompletionMemberAccess): Implements support for completing member
141 * cs-parser.jay: Add support for completion in a few places.
143 * eval.cs (GetCompletions): New public API for the evaluator that
144 returns a list of possible completions given the input. The
145 return value is an array of completions
147 * anonymous.cs (Compatible): If the exception thrown from the
148 resolved expression is a CompletionResult exception let that one
149 through instead of printing a diagnostic error in the try/catch.
151 2009-03-22 Miguel de Icaza <miguel@novell.com>
155 * driver.cs (Main): Use Environment.Exit to quit quickly and
156 prevent the compiler from doing the usual wait for helper thread
159 This is to prevent a slowdown that was reported by Gonzalo on
162 2009-03-19 Marek Safar <marek.safar@gmail.com>
164 * ecore.cs: Load build-in types directly instead of accessing
167 2009-03-18 Marek Safar <marek.safar@gmail.com>
169 * ecore.cs: Always use unbox.any when available.
171 2009-03-18 Marek Safar <marek.safar@gmail.com>
173 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
175 2009-03-17 Marek Safar <marek.safar@gmail.com>
177 * generic.cs: Removed obsolete version of type inference.
179 2009-03-16 Marek Safar <marek.safar@gmail.com>
181 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
182 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
183 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
184 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
186 2009-03-11 Marek Safar <marek.safar@gmail.com>
188 A fix for bug #482996
189 * anonymous.cs: Make sure we are not infering return type when
190 checking type compatibility.
192 2009-03-11 Marek Safar <marek.safar@gmail.com>
194 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
195 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
196 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
197 attributes in their own structure. Needed when accessing their
198 properties before they are resolved.
200 2009-03-09 Marek Safar <marek.safar@gmail.com>
202 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
203 hashtable (~10x faster).
205 * driver.cs: Removed wrong Reset.
207 2009-03-08 Marek Safar <marek.safar@gmail.com>
209 * class.cs: Use correct common base type for unmanaged delayed
212 * rootcontext.cs: Wrap unhandled exception.
214 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
216 Make SeekableStreamReader self-tuning and arbitrarily seekable
217 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
219 (SeekableStreamReader.Position.set): Use it. Simplify logic
220 which, as a side-effect, makes it arbitrarily-seekable. Tune the
221 buffer size when the stream needs to be re-read from the beginning.
223 2009-03-05 Marek Safar <marek.safar@gmail.com>
225 A fix for bug #480100
226 * parameter.cs: A parameter is not hoisted when used directly as ET.
228 2009-03-04 Marek Safar <marek.safar@gmail.com>
230 * statement.cs: Fixed an issue when using variable is of interface
233 2009-03-03 Marek Safar <marek.safar@gmail.com>
235 A fix for bug #480319
236 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
238 2009-03-03 Marek Safar <marek.safar@gmail.com>
240 A fix for bug #480867
241 * typemanager.cs, expression.cs, ecore.cs: Changed method group
242 expression to have no valid type.
244 2009-03-03 Marek Safar <marek.safar@gmail.com>
246 A fix for bug #481258
247 * class.cs: Set extension method flag in partial container.
249 2009-03-03 Marek Safar <marek.safar@gmail.com>
251 * statement.cs, typemanager.cs: Use expression for StringEmitter.
253 * attribute.cs: Add sanity check.
255 2009-02-27 Marek Safar <marek.safar@gmail.com>
257 * class.cs: Add external constructor error.
259 2009-02-26 Marek Safar <marek.safar@gmail.com>
261 A fix for bug #475354
262 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
263 correctly user defined nullable equality operators.
265 2009-02-25 Marek Safar <marek.safar@gmail.com>
267 A fix for bug #479532
268 * expression.cs: Implement NewInitialize::AddressOf.
270 2009-02-25 Marek Safar <marek.safar@gmail.com>
272 A fix for bug #413633
273 * expression.cs: Iterate all base class-constraint types.
275 2009-02-24 Marek Safar <marek.safar@gmail.com>
277 A fix for bug #479209
278 * literal.cs: Mutate null underlying type.
280 2009-02-24 Marek Safar <marek.safar@gmail.com>
282 A fix for bug #476295
283 * convert.cs: Avoid wrapping implicitly convertible reference type.
285 2009-02-23 Marek Safar <marek.safar@gmail.com>
287 * iterators.cs: Create MemberName correctly.
289 2009-02-23 Marek Safar <marek.safar@gmail.com>
291 A fix for bug #478655
292 * literal.cs: Check also underlying null type conversion.
294 2009-02-21 Marek Safar <marek.safar@gmail.com>
296 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
298 2009-02-20 Marek Safar <marek.safar@gmail.com>
300 A fix for bug #477447
301 * statement.cs: Add reference to correct parent storey when this
302 is accessible from deep children storey (more than 1 level).
304 2009-02-19 Marek Safar <marek.safar@gmail.com>
306 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
307 * class.cs: Define base type members before setting up member cache.
309 2009-02-18 Marek Safar <marek.safar@gmail.com>
311 A fix for bug #477378
312 * nullable.cs, expression.cs, statement.cs: More precise null type
315 2009-02-18 Marek Safar <marek.safar@gmail.com>
317 A fix for bug #472805
318 * typemanager.cs, namespace.cs: Import only visible extension method
321 2009-02-18 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #476895
324 * attribute.cs: Use correct resolve context for attribute type.
326 2009-02-18 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #476266
329 * anonymous.cs: Mutate multi-dimensional arrays.
331 2009-02-18 Marek Safar <marek.safar@gmail.com>
333 A fix for bug #476400
334 * statement.cs, expression.cs: Removed wrong Dispose optimization.
336 2009-02-18 Marek Safar <marek.safar@gmail.com>
338 A fix for bug #476811
339 * generics.cs: Fixed null-literal check.
341 2009-02-17 Marek Safar <marek.safar@gmail.com>
343 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
344 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
345 messing with static variables.
347 2009-02-16 Marek Safar <marek.safar@gmail.com>
349 A fix for bug #475965
350 * generics.cs: Check generic parameter type after extracting from
353 2009-02-16 Marek Safar <marek.safar@gmail.com>
355 A fix for bug #475823
356 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
359 2009-02-14 Marek Safar <marek.safar@gmail.com>
361 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
362 Simplified event field definition using backing field and not
363 field builder directly.
365 * expression.cs (EmitLdArg): Optimize fast paths.
367 2009-02-13 Marek Safar <marek.safar@gmail.com>
369 A fix for bug #475327
370 * expression.cs (ArrayCreation): Don't mutate values optimized away.
372 2009-02-13 Marek Safar <marek.safar@gmail.com>
374 A fix for bug #475342
375 * cs-parser.jay: Using 'super' instead of 'base' to call base
376 constructor crashes compiler.
378 2009-02-13 Marek Safar <marek.safar@gmail.com>
380 A fix for bug #475354
381 * expression.cs (Constantify): Add nullable types.
383 * const.cs (EmitDecimalConstant): Avoid explicit cast.
385 2009-02-12 Marek Safar <marek.safar@gmail.com>
387 A fix for bug #475246
388 * expression.cs: More broken flowanalysis hacking needed.
390 2009-02-12 Marek Safar <marek.safar@gmail.com>
392 * attribute.cs: Compare only ref/out array modifiers.
394 2009-02-11 Marek Safar <marek.safar@gmail.com>
396 * statement.cs: Use member cache when looking for foreach members.
398 2009-02-11 Marek Safar <marek.safar@gmail.com>
400 * expression.cs: Don't expose internal initializer types.
402 * statement.cs: Check also explicit conversions for goto case.
404 2009-02-11 Marek Safar <marek.safar@gmail.com>
406 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
408 2009-02-10 Marek Safar <marek.safar@gmail.com>
410 * *.cs: Replace null-type with NullLiteral where appropriate.
412 2009-02-09 Marek Safar <marek.safar@gmail.com>
414 * expression.cs: Initializer of reference argument use temporary
415 variable to be verifiable.
417 * parameter.cs: Share EmitLdArg.
419 2009-02-09 Marek Safar <marek.safar@gmail.com>
421 A fix for bug #473559
422 * class.cs: Fixed: Not reporting error about nested class with the
425 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
427 Contributed under the MIT/X11 license.
429 * generic.cs: Added VerifyVariantTypeParameters which performs new
430 variance verification logic. The old logic, based on the spec, was
431 wrong because the spec is full of LIES!
433 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
435 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
438 * ecore.cs: Added calls to the new variance verification logic.
441 * delegate.cs: Removed calls to the old variance verification logic.
443 2009-02-06 Marek Safar <marek.safar@gmail.com>
445 * delegate.cs: Use cached Invoke method directly.
447 2009-02-06 Marek Safar <marek.safar@gmail.com>
449 * expression.cs: Emit expression tree for hoisted variable access.
451 2009-02-04 Marek Safar <marek.safar@gmail.com>
453 * namespace.cs: Add better extension class check.
455 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
457 * generic.cs: Fixed typeo (TypeParameter.Variacne).
459 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
461 This patch adds initial generic variance support to the compiler.
462 It is contributed under the MIT/X11 license.
464 * typemanager.cs: Modified ImplementsInterface to check variance.
465 Added VerifyVariantTypeParameters which checks the specified type to see
466 if it uses a variant type parameter as a type argument (which is not
467 allowed). Added IsVariantOf which determins if the first type is a
468 variant of the second. NOTE: This only supports reference types at
469 the moment to conform with the current level of VM support. When the
470 VM supports value types, this will follow step.
472 * generic.cs: Added the Variance enum. Added a Variance property to
473 TypeParameter and added variance support to definition phase. Added a
474 Variance property to TypeParameterName. Also check to make sure that
475 no variant types appear in generic method parameters.
477 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
478 keywords if the langversion supports it.
480 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
481 that variant types are only used in legal positions. Also added
482 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
485 * decl.cs: Construct TypeParameter with the variance information.
487 * convert.cs: Checks variance in ImplicitReferenceConversionExists
488 and ImplicitConversionStandard.
490 * rootcontext.cs: Added new "Future" language version.
492 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
493 type parameters are not used as type arguments in interface inheritance.
494 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
495 parameters are not used as method return types. In MemberBase.
496 ResolveMemberType, ensure that variant type parameters are not used
497 as type arguments. Also call VerifyNoVariantTypeParameters on every
498 set of parameters which are resolved.
500 * delegate.cs: Modified Delegate.Define to ensure that variant
501 parameters are not used as type arguments and that a contravariant
502 parameter is not used as the return type. Also call
503 VerifyNoVariantTypeParameters on the delegate parameters.
505 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
506 to specify generic variance.
508 * driver.cs: Added support for LanguageVersion.Future in the form of
509 "-langversion:future".
511 * generic-mcs.cs: Stubbed out new members in generic.cs.
513 2009-02-03 Marek Safar <marek.safar@gmail.com>
515 * class.cs, generic.cs: Emit type parameter constraints for nested
518 2009-02-02 Marek Safar <marek.safar@gmail.com>
520 A fix for bug #471213
521 * class.cs: Avoid emitting backing field for abstract event fields.
523 2009-02-01 Marek Safar <marek.safar@gmail.com>
525 A fix for bug #359731
526 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
529 2009-01-30 Marek Safar <marek.safar@gmail.com>
531 A fix for bug #470767
532 * statement.cs: Introduced BlockScopeExpression, needed when
533 expression tree conversion has to emit scope variables.
535 2009-01-29 Marek Safar <marek.safar@gmail.com>
537 * class.cs: Remove duplicate CallingConvention.
539 2009-01-29 Marek Safar <marek.safar@gmail.com>
541 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
542 when I finally found the right naming convention.
544 2009-01-29 Marek Safar <marek.safar@gmail.com>
546 * cs-tokenizer.cs: Put back different open parens optimization.
548 2009-01-28 Marek Safar <marek.safar@gmail.com>
550 A fix for bug #470227
551 * cs-tokenizer.cs: Remove too agressive parser optimization.
553 2009-01-28 Marek Safar <marek.safar@gmail.com>
555 A fix for bug #324319
556 * class.cs: Remove too early base type resolve.
558 2009-01-27 Marek Safar <marek.safar@gmail.com>
560 A fix for bug #324319
561 * ecore.cs: Explicitly type null when assigning to type argument to
562 make pass verifier check.
564 2009-01-27 Marek Safar <marek.safar@gmail.com>
566 * anonymous.cs: Fixed recent regression when initializing captured
569 2009-01-26 Marek Safar <marek.safar@gmail.com>
571 A fix for bug #469019
572 * anonymous.cs: Use all parent type parameters when instantiating
573 nested generic storey.
575 2009-01-26 Marek Safar <marek.safar@gmail.com>
577 * expression.cs: Check for null instance methodgroup expression.
579 2009-01-26 Marek Safar <marek.safar@gmail.com>
581 A fix for bug #469244
582 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
583 instance inside a conditional expression.
585 2009-01-23 Marek Safar <marek.safar@gmail.com>
587 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
588 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
589 GetElementType and HasElementType. IsValueType clean up.
591 2009-01-23 Marek Safar <marek.safar@gmail.com>
593 * nullable.cs: Use common EmitCall.
595 * expression.cs: Emit constraint. for virtual calls only.
597 2009-01-23 Marek Safar <marek.safar@gmail.com>
599 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
600 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
601 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
604 2009-01-22 Jb Evain <jbevain@novell.com>
606 * anonymous.cs: make anonymous types' ToString implementation
607 match what csc outputs.
609 2009-01-21 Marek Safar <marek.safar@gmail.com>
611 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
614 2009-01-17 Marek Safar <marek.safar@gmail.com>
616 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
619 2009-01-16 Marek Safar <marek.safar@gmail.com>
621 * nullable.cs (LiftedBinaryOperator): Check for all possible null
624 2009-01-15 Marek Safar <marek.safar@gmail.com>
626 A fix for bug #466634
627 * statement.cs: Add reference for nested storey when only this
630 2009-01-15 Marek Safar <marek.safar@gmail.com>
632 A fix for bug #466474
633 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
636 2009-01-15 Marek Safar <marek.safar@gmail.com>
638 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
639 Fixed nested stories parent referencing process. Also fixes #463985.
641 2009-01-06 Marek Safar <marek.safar@gmail.com>
643 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
644 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
645 implementation. Also fixes #463108.
647 2009-01-05 Marek Safar <marek.safar@gmail.com>
649 A fix for bug #416109
650 * decl.cs: Issue correct CLSAttribute warning location.
652 2009-01-05 Marek Safar <marek.safar@gmail.com>
654 A fix for bug #456775
655 * attribute.cs: Use attribute owner scope when resolving attribute
658 2009-01-05 Marek Safar <marek.safar@gmail.com>
660 A fix for bug #457257
661 * decl.cs: Fixed incorrect member declaring type comparison.
663 2009-01-05 Marek Safar <marek.safar@gmail.com>
665 A fix for bug #460896
666 * driver.cs: Handle /RES resources as embeddable.
668 2009-01-05 Marek Safar <marek.safar@gmail.com>
670 A fix for bug #462515
671 * ecore.cs: Report inacessible members upwards.
673 2009-01-05 Marek Safar <marek.safar@gmail.com>
675 A fix for bug #463190, #463192
676 * decl.cs, namespace.cs: Also import internal extension classes.
678 2009-01-04 Marek Safar <marek.safar@gmail.com>
680 A fix for bug #463415
681 * generic.cs: Use right index for RemoveDependentTypes.
683 2009-01-02 Marek Safar <marek.safar@gmail.com>
685 A fix for bug #463196
686 * expression.cs: Fixed enum to null comparison.
688 2009-01-02 Marek Safar <marek.safar@gmail.com>
690 A fix for bug #463121
691 * nullable.cs: Fixed nullable user equality operator comparison.
693 2009-01-02 Marek Safar <marek.safar@gmail.com>
695 A fix for bug #462950
696 * class.cs, decl.cs: Use full explicit name when defining automatic
697 property backing field.
699 2009-01-02 Marek Safar <marek.safar@gmail.com>
701 A fix for bug #462592
702 * pending.cs: Emit type arguments for generic proxy method.
704 2008-12-30 Marek Safar <marek.safar@gmail.com>
706 * expression.cs (As): Mutate all type arguments.
708 2008-12-29 Marek Safar <marek.safar@gmail.com>
710 A fix for bug #462622
711 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
714 2008-12-29 Marek Safar <marek.safar@gmail.com>
716 A fix for bug #450782
717 * ecore.cs: Consider more variables of form V.I to be fixed.
719 2008-12-29 Marek Safar <marek.safar@gmail.com>
721 A fix for bug #460712
722 * typemanager.cs: Core types could be imported.
724 2008-12-28 Marek Safar <marek.safar@gmail.com>
726 A fix for bugs #460847, #460772, #458049, #457339, #447807
727 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
728 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
729 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
730 user lambdas used inside query clauses.
732 2008-12-18 Marek Safar <marek.safar@gmail.com>
734 A fix for bug #460229
735 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
737 2008-12-18 Marek Safar <marek.safar@gmail.com>
739 A fix for bug #459952
740 * decl.cs, namespace.cs: Use common CheckAccessLevel.
742 2008-12-18 Marek Safar <marek.safar@gmail.com>
744 A fix for bug #459630
745 * convert.cs: Enum to valuetype conversion is not allowed.
747 2008-12-18 Marek Safar <marek.safar@gmail.com>
749 A fix for bug #457087
750 * generic.cs: Don't crash when constraint comes from type
753 2008-12-16 Marek Safar <marek.safar@gmail.com>
755 A fix for bug #459221
756 * anonymous.cs, statement.cs: Delay only captured this
759 2008-12-12 Marek Safar <marek.safar@gmail.com>
761 A fix for bug #457489
762 * anonymous.cs, statement.cs: Split anonymous storey instantiation
763 and initialization to capture scope initializers correctly.
765 2008-12-11 Marek Safar <marek.safar@gmail.com>
767 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
768 ParameterReference refactoring.
770 2008-12-03 Marek Safar <marek.safar@gmail.com>
772 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
773 to be imported from any assembly.
775 2008-12-03 Marek Safar <marek.safar@gmail.com>
777 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
778 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
779 from anonymous method and lambda expression.
781 2008-12-01 Marek Safar <marek.safar@gmail.com>
783 A fix for bug #448560
784 * expression.cs (As): Box any generic type arguments to be
787 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
789 Add tripwire for implicit conversion bugs
790 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
792 (MethodGroupExpr.OverloadResolve): Add sanity check between
793 IsApplicable and VerifyArgumentsCompat.
794 (VerifyArgumentsCompat): Report CS1501 where appropriate.
796 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
798 Fix build break in System.Data_test
799 * convert.cs (ImplicitConversionExists): Move NullLiteral
801 (ImplicitStandardConversionExists): ... here.
803 2008-11-28 Marek Safar <marek.safar@gmail.com>
805 * literal.cs: Emit correctly explicit null to nullable cast.
807 2008-11-28 Marek Safar <marek.safar@gmail.com>
809 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
812 2008-11-28 Marek Safar <marek.safar@gmail.com>
814 A fix for bug #449005
815 * convert.cs, nullable.cs: Use only one implicit nullable
818 2008-11-27 Marek Safar <marek.safar@gmail.com>
820 * convert.cs, literal.cs: More Convert cleanup is needed.
822 2008-11-27 Marek Safar <marek.safar@gmail.com>
824 * decl.cs, class.cs: Fixed misleading error message.
826 2008-11-26 Marek Safar <marek.safar@gmail.com>
828 A fix for bug #449005
829 * nullable.cs (EmitEquality): Disable optimization for user operator
832 2008-11-25 Marek Safar <marek.safar@gmail.com>
834 A fix for bug #447027
835 * anonymous.cs (HoistedVariable): Cache also outer access to deal
836 with context variables stored as expression instances.
838 2008-11-25 Marek Safar <marek.safar@gmail.com>
840 A fix for bug #447027
841 * delegate.cs: Fixed delegate VerifyMethod logic.
843 2008-11-24 Marek Safar <marek.safar@gmail.com>
845 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
848 2008-11-21 Marek Safar <marek.safar@gmail.com>
850 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
851 member type resolve to follow normal flow, instead of random
854 2008-11-21 Marek Safar <marek.safar@gmail.com>
856 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
859 2008-11-21 Marek Safar <marek.safar@gmail.com>
861 * const.cs: Emit decimal array constant as literal.
863 2008-11-20 Marek Safar <marek.safar@gmail.com>
865 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
867 2008-11-19 Marek Safar <marek.safar@gmail.com>
869 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
870 into real property (saves 8 MB for corlib compilation).
872 2008-11-19 Marek Safar <marek.safar@gmail.com>
874 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
875 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
876 generic-mcs.cs: Small cleanup of TypeArguments.
878 2008-11-18 Marek Safar <marek.safar@gmail.com>
880 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
881 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
882 of ConstructedType expression, renamed to GenericTypeExpr.
884 2008-11-17 Marek Safar <marek.safar@gmail.com>
886 A fix for bug #445303
887 * location.cs (IsConditionalDefined): Handle undefined global
890 2008-11-17 Marek Safar <marek.safar@gmail.com>
892 A fix for bug #444678
893 * expression.cs (TryReduceConstant): Always create new constant
896 2008-11-17 Marek Safar <marek.safar@gmail.com>
898 A fix for bug #444673
899 * ecore.cs: Ignore open generic types when used as generic type
902 2008-11-17 Marek Safar <marek.safar@gmail.com>
904 A fix for bug #445458
905 * expression.cs, cs-parser.jay: Don't crash when an expression
908 2008-11-17 Marek Safar <marek.safar@gmail.com>
910 A fix for bug #445464
911 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
914 2008-11-14 Jb Evain <jbevain@novell.com>
916 * driver.cs: ignore empty -nowarn argument such as
917 the one in -nowarn:12,13,,.
919 2008-11-13 Marek Safar <marek.safar@gmail.com>
921 A fix for bug #444271
922 * anonymous.cs: Rescan parent storeys when best candidate was
925 2008-11-13 Marek Safar <marek.safar@gmail.com>
927 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
928 useless UnboundTypeExpression.
930 * attribute.cs: Do check obsolete attribute on generic types.
932 2008-11-12 Marek Safar <marek.safar@gmail.com>
934 A fix for bugs #425680, #400139
935 * ecore.cs, expression.cs: Trying to do some almost_matched_members
938 2008-11-11 Marek Safar <marek.safar@gmail.com>
940 A fix for bug #435747
941 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
942 compound value types assignment. Few micro optimizations added.
944 2008-11-10 Marek Safar <marek.safar@gmail.com>
946 A fix for bug #442610
947 * anonymous.cs (MutateConstructor): More SRE hacking.
949 2008-11-10 Marek Safar <marek.safar@gmail.com>
951 A fix for bug #442579
952 * ecore.cs: Also initialize expanded form of a method with 1 params
955 2008-11-06 Marek Safar <marek.safar@gmail.com>
957 * expression.cs (UnaryMutator): Do early l-side check.
959 2008-11-05 Miguel de Icaza <miguel@novell.com>
961 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
962 Init, otherwise we would crash later on when checking for friend
965 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
966 Otherwise we never get any meaningful information as to what
969 2008-11-05 Marek Safar <marek.safar@gmail.com>
971 A fix for bug #436318
972 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
974 2008-11-05 Miguel de Icaza <miguel@novell.com>
976 * namespace.cs: Turns out that it was a really bad idea to hide
977 the errors for namespaces not found here in eval mode.
979 * eval.cs: When we process using clauses, only enter those into
980 the list of valid using clauses after they have been validated.
982 The above change gives the proper semantics: it does not
983 senselessly report the same errors with broken using statements by
984 never storing them in the first place when they are invalid.
986 2008-11-05 Marek Safar <marek.safar@gmail.com>
988 A fix for bug #421839
989 * cs-parser.jay: Remove expression from coalesce rule to force lower
990 priority than the assignment operator.
992 2008-11-05 Marek Safar <marek.safar@gmail.com>
994 A fix for bug #437875
995 * nullable.cs: Compile correctly method group operand used with null
998 2008-11-04 Marek Safar <marek.safar@gmail.com>
1000 A fix for bug #434589
1001 * expression.cs (Binary): Ignore lifted conversions when at least
1002 one operand is of reference type.
1004 2008-11-04 Marek Safar <marek.safar@gmail.com>
1006 * cs-parser.jay: Better syntax error report.
1008 2008-11-03 Marek Safar <marek.safar@gmail.com>
1010 A fix for bug #436792
1011 * cs-parser.jay: Use GetLocation to access location.
1013 2008-11-03 Marek Safar <marek.safar@gmail.com>
1015 A fix for bug #440774
1016 * cs-parser.jay: Also set current_array_type when parsing local
1019 2008-11-03 Marek Safar <marek.safar@gmail.com>
1021 A fix for bug #440785
1022 * expression.cs (As): Don't resolve self modifing expression
1025 2008-11-03 Marek Safar <marek.safar@gmail.com>
1027 A fix for bug #439447
1028 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1030 2008-11-03 Marek Safar <marek.safar@gmail.com>
1032 A fix for bug #437571
1033 * cs-parser.jay: Fixes internal error for invalid expression
1036 2008-10-17 Marek Safar <marek.safar@gmail.com>
1038 * ecore.cs: Resolve correctly ambiguous params delegate methods.
1040 2008-10-17 Marek Safar <marek.safar@gmail.com>
1042 * generic.cs, anonymous.cs: Simplified GetDeclarations.
1044 2008-10-17 Marek Safar <marek.safar@gmail.com>
1046 * cs-tokenizer.cs: More precise cast parsing.
1048 2008-10-16 Martin Baulig <martin@ximian.com>
1050 * anonymous.cs (AnonymousMethodStorey): Put back the
1051 `hoisted_locals' hashtable and use it in EmitType().
1053 2008-10-15 Marek Safar <marek.safar@gmail.com>
1055 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1056 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1059 2008-10-14 Marek Safar <marek.safar@gmail.com>
1061 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1063 2008-10-14 Marek Safar <marek.safar@gmail.com>
1065 * statement.cs: Mutate scope initializers.
1067 2008-10-14 Marek Safar <marek.safar@gmail.com>
1069 * expression.cs: Use typeless value for This constant.
1071 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1073 2008-10-14 Marek Safar <marek.safar@gmail.com>
1075 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1078 2008-10-13 Marek Safar <marek.safar@gmail.com>
1080 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1083 2008-10-13 Marek Safar <marek.safar@gmail.com>
1085 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1086 parser and tokenizer. Fixes many ambiguities including #433258.
1088 2008-10-10 Marek Safar <marek.safar@gmail.com>
1090 * cs-parser.jay: Fixed missing accessor recovery.
1092 2008-10-10 Marek Safar <marek.safar@gmail.com>
1094 A fix for bug #433701
1095 * expression.cs: Better error message.
1097 2008-10-10 Marek Safar <marek.safar@gmail.com>
1099 * cs-parser.jay, expression.cs: Start reporting real parser errors.
1101 * Makefile: Disabled unused debug symbols.
1103 Also fixes: #320556, #321097, #321656, #321876, #351316
1105 2008-10-09 Miguel de Icaza <miguel@novell.com>
1107 * eval.cs: rename "<interactive>" to "{interactive}", to work
1108 around a requirement in the compiler that this be a valid
1109 filename, and in Windows it is not (433886).
1111 2008-10-09 Marek Safar <marek.safar@gmail.com>
1113 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1115 2008-10-08 Marek Safar <marek.safar@gmail.com>
1117 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1118 cs-parser.jay: Generic type declaration and type arguments cleanup.
1120 2008-10-05 Marek Safar <marek.safar@gmail.com>
1122 * cs-parser.jay: Allow parsing weird array creation construct.
1124 2008-10-05 Marek Safar <marek.safar@gmail.com>
1126 * cs-parser.jay: Conflicts reduction.
1128 2008-10-04 Marek Safar <marek.safar@gmail.com>
1130 * cs-parser.jay: Conflicts reduction.
1132 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
1135 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1136 property. Add a 'count' hint about the use of the shared vector.
1137 Ensure that we don't leak out dirty bits.
1138 (UsageVector.MergeChild): Throw away information about variables
1140 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1142 2008-10-03 Marek Safar <marek.safar@gmail.com>
1144 A fix for bug #431746
1145 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1146 parameters when iterator is created.
1148 2008-10-03 Marek Safar <marek.safar@gmail.com>
1150 A fix for bug #431827
1151 * expression.cs: Fixed right based pointer arithmetic operations
1154 2008-10-03 Marek Safar <marek.safar@gmail.com>
1156 A fix for bug #353779
1157 * assign.cs, expression.cs: Fixed compound assignment conversions.
1159 2008-10-02 Marek Safar <marek.safar@gmail.com>
1161 A fix for bug #375262
1162 * statement.cs: Refactor ArrayForeach to be usable with string
1163 indexer. Optimized single dimentional arrays foreach.
1165 2008-10-02 Marek Safar <marek.safar@gmail.com>
1167 A fix for bug #431255
1168 * anonymous.cs, expression.cs: Removed broken optimization.
1170 2008-10-01 Marek Safar <marek.safar@gmail.com>
1172 * anonymous.cs: Use full type parameters of parent generic
1173 containers. Removed unnecessary AddParentStoreyReference call.
1175 2008-10-01 Marek Safar <marek.safar@gmail.com>
1177 A fix for bug #324702
1178 * class.cs: Use better shorter names for explicit interface member
1181 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1183 2008-10-01 Marek Safar <marek.safar@gmail.com>
1185 * expression.cs: Use new interface to check fixed expression.
1187 2008-10-01 Marek Safar <marek.safar@gmail.com>
1189 A fix for bug #421101
1190 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1191 interface to check for fixed fixed-buffers.
1193 2008-10-01 Marek Safar <marek.safar@gmail.com>
1195 A fix for bug #429264
1196 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1198 * delegate.cs: Removed unnecessary casts.
1200 2008-09-30 Marek Safar <marek.safar@gmail.com>
1202 A fix for bug #352151
1203 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1204 class.cs: Fixed already defined explicit interface members check.
1206 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
1208 cs-tokenizer.cs: Fix typo.
1210 2008-09-28 Miguel de Icaza <miguel@novell.com>
1212 * eval.cs (InteractiveBase): The quit command now just sets a
1213 flag, instead of calling Environment.Exit(), it is milder on
1216 CompiledMethod is now in Mono.CSharp, not nested inside
1217 the Evaluator, it was inconvenient to use.
1219 2008-09-27 Miguel de Icaza <miguel@novell.com>
1221 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1222 code to be invoked without having to reparse.
1224 2008-09-27 Miguel de Icaza <miguel@novell.com>
1226 * ecore.cs: The recent changes to FieldExpr broke this as well.
1227 Fixes LINQ queries in the interactive shell.
1229 * Multiple files: indentation fixing for the Mono coding
1230 guidelines for the switch statement.
1232 * eval.cs: Make the Evaluator API thread safe.
1234 2008-09-26 Marek Safar <marek.safar@gmail.com>
1236 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1237 constructor parsing.
1239 2008-09-26 Marek Safar <marek.safar@gmail.com>
1241 A fix for bug #325326
1242 * statement.cs: Check possible mistaken empty statement using
1243 explicit blocks only.
1245 2008-09-25 Miguel de Icaza <miguel@novell.com>
1247 * eval.cs (LoadAssembly, ReferenceAssembly): Call
1248 RootNamespace.ComputeNamespaces to update the internal list of
1249 namespaces, this is no longer done for us.
1251 (InteractiveBase): Use the Evaluator APIs instead of calling into
1254 2008-09-25 Marek Safar <marek.safar@gmail.com>
1256 A fix for bug #429264
1257 * expression.cs: Missing mutator for access to multidimensional
1260 2008-09-25 Marek Safar <marek.safar@gmail.com>
1262 * class.cs, statement: Emit DebuggerHidden attribute for iterator
1265 * driver.cs: Missing input argument check.
1267 2008-09-25 Marek Safar <marek.safar@gmail.com>
1269 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1270 expression.cs, statement.cs, rootcontext.cs, class.cs,
1271 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1274 2008-09-24 Miguel de Icaza <miguel@novell.com>
1276 * ecore.cs (FieldExpr): Only initialize eclass when we return a
1277 fully constructed FieldExpr, fixes the regression introduced in
1280 * ecore.cs, expression.cs: Plug back the eclass initialization as
1281 otherwise it regresses `csharp'.
1283 2008-09-24 Marek Safar <marek.safar@gmail.com>
1285 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1286 ecore.cs, attribute.cs: Moved obsolete method checks from emit
1287 phase to resolve phase. It resolves problems with expression trees
1288 and fixes bugs #323796, #325156.
1290 2008-09-23 Marek Safar <marek.safar@gmail.com>
1292 * codegen.cs: Report better error when symbol writer is missing.
1294 2008-09-23 Marek Safar <marek.safar@gmail.com>
1296 * codegen.cs: Set .NET symbol writer.
1298 * decl.cs: Guard against null generic arguments.
1300 * report.cs: Don't report exactly same additional details.
1302 2008-09-22 Marek Safar <marek.safar@gmail.com>
1304 A fix for bug #324917
1305 * cs-parser.jay: Add missing multidimensional non-expression type
1308 2008-09-22 Marek Safar <marek.safar@gmail.com>
1310 A fix for bug #428191
1311 * anonymous.cs: Create an outer generic fields also for non-storey
1314 2008-09-22 Marek Safar <marek.safar@gmail.com>
1316 A fix for bug #378294
1317 * class.cs: Make fixed size buffers gmcs feature only.
1319 2008-09-22 Marek Safar <marek.safar@gmail.com>
1321 A fix for bug #355622, #324993
1322 * assign.cs, const.cs, class.cs: Create new EmitContext for each
1325 2008-09-19 Marek Safar <marek.safar@gmail.com>
1327 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1330 2008-09-19 Marek Safar <marek.safar@gmail.com>
1332 A fix for bug #416110
1333 * generic.cs: Struct constraint results in default ctor and
1334 ValueType base type constraint to be set.
1336 2008-09-19 Marek Safar <marek.safar@gmail.com>
1338 A fix for bug #423791
1339 * generic.cs: Fixed params output type type-inference.
1341 2008-09-19 Marek Safar <marek.safar@gmail.com>
1343 * cs-parser.jay, expression.cs: Fixed few expression crashes.
1345 2008-09-19 Marek Safar <marek.safar@gmail.com>
1347 * cs-tokenizer.cs: Don't break on extra partial modifier.
1349 2008-09-19 Marek Safar <marek.safar@gmail.com>
1351 A fix for bug #427592
1352 * generic.cs: Use common parameter resolve method.
1354 2008-09-18 Marek Safar <marek.safar@gmail.com>
1356 A fix for bug #414758
1357 * expression.cs, ecore.cs: Fixed crash when accessing non-static
1360 2008-09-18 Marek Safar <marek.safar@gmail.com>
1362 * driver.cs, namespace.cs: Read types and namespaces after all
1363 requested assemblies are loaded, fixes issues with System.Core
1364 auto-reference, and #419888.
1366 2008-09-18 Marek Safar <marek.safar@gmail.com>
1368 A fix for bug #417705
1369 * cs-parser.jay: Fixed as/is operator expression split.
1371 2008-09-18 Marek Safar <marek.safar@gmail.com>
1373 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1374 Fixed expression tree representation of empty new expression and
1375 new initializer expression.
1377 2008-09-18 Miguel de Icaza <miguel@novell.com>
1379 * eval.cs: Remove warning, keep reference to driver around.
1381 * Hide fields that do not need to be public.
1383 2008-09-17 Marek Safar <marek.safar@gmail.com>
1385 A fix for bug #426385
1386 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1387 conversion for array elements.
1389 2008-09-17 Marek Safar <marek.safar@gmail.com>
1391 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1392 void parsing conflicts.
1394 2008-09-15 Marek Safar <marek.safar@gmail.com>
1396 A fix for bug #425601
1397 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1398 System.Core only when there is no custom ExtensionAttribute
1401 2008-09-15 Miguel de Icaza <miguel@novell.com>
1403 * namespace.cs: Do not report CS0246 (name
1405 2008-09-12 Marek Safar <marek.safar@gmail.com>
1407 A fix for bug #425669
1408 * generic.cs: Don't cache generic static anonymous method
1411 2008-09-12 Marek Safar <marek.safar@gmail.com>
1413 * generic.cs, class.cs, delegate.cs: Check recursive inherited
1414 conflicting constraints.
1416 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
1418 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1421 2008-09-12 Marek Safar <marek.safar@gmail.com>
1423 * literal.cs, convert.cs, expression.cs, statement.cs: More null
1424 to null pointer conversion fixes.
1426 2008-09-11 Marek Safar <marek.safar@gmail.com>
1428 * cs-parser.jay, expression.cs: An implicitly typed local variable
1429 declarator cannot use an array initializer.
1431 2008-09-11 Marek Safar <marek.safar@gmail.com>
1433 * cs-parser.jay: Reduced number of printed tokens, add sorting.
1435 2008-09-11 Marek Safar <marek.safar@gmail.com>
1437 * generic.cs (InflatedConstraints): Don't crash when constraints
1440 * cs-parser.jay: const_declarator is a block.
1442 * constant.cs: Check for not allowed NaN conversions.
1444 2008-09-10 Miguel de Icaza <miguel@novell.com>
1446 * driver.cs: Drop --shell argument, the compiler is no longer a
1449 * eval.cs: Move most of the code that deals with evaluation into
1450 this file and document the public API from repl.cs
1452 * repl.cs: Remove from here.
1454 2008-09-10 Marek Safar <marek.safar@gmail.com>
1456 A fix for bug #424684
1457 * generic.cs: Generic class constraints must come first.
1459 2008-09-09 Miguel de Icaza <miguel@novell.com>
1461 * cs-parser.jay: Improve error reporting for syntax errors in
1462 statements and expressions, we now report the expected tokens
1463 instead of reporting the useless "; expected".
1465 Drop the strings from the token declaration, it turns out that
1466 they did not do what I thought they did. Instead they were adding
1467 two sets of tokens to the tables.
1469 2008-09-09 Marek Safar <marek.safar@gmail.com>
1471 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1472 delegate.cs: Share special type check.
1474 2008-09-09 Marek Safar <marek.safar@gmail.com>
1476 A fix for bug #423981
1477 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1479 2008-09-09 Marek Safar <marek.safar@gmail.com>
1481 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1484 2008-09-09 Marek Safar <marek.safar@gmail.com>
1486 A fix for bugs: #324750, #335946
1487 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
1488 lookup rule to determine ?-based tokens.
1490 2008-09-08 Miguel de Icaza <miguel@novell.com>
1492 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1493 expressions (like event adding or removing) end up here, so we
1494 need to treat those as statements.
1496 Add LoadAssembly method.
1498 2008-09-04 Miguel de Icaza <miguel@novell.com>
1500 * repl.cs: Add Time method.
1502 2008-09-05 Marek Safar <marek.safar@gmail.com>
1504 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1506 2008-09-05 Miguel de Icaza <miguel@novell.com>
1508 * repl.cs: Add workaround for old compilers.
1510 2008-09-04 Jb Evain <jbevain@novell.com>
1512 * repl.cs (PrettyPrint): pretty print everything that
1513 implements IDictionary, as well as IEnumerables. Also,
1514 add a quit helper property.
1516 2008-09-04 Marek Safar <marek.safar@gmail.com>
1518 * constant.cs: Better error reporting for decimal literals.
1520 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1523 2008-09-04 Marek Safar <marek.safar@gmail.com>
1524 Miguel de Icaza <miguel@novell.com>
1526 A fix for bug #422951
1527 * assign.cs (Assign.DoResolve): Perform the type conversions
1528 checks before we attempt to initialize `New' initializers.
1530 2008-09-04 Marek Safar <marek.safar@gmail.com>
1532 A fix for bug #422853
1533 * delegate.cs (DelegateCreation): Add special handling for
1534 EmptyExpression.Null instance expression which is just another
1535 hack for undecided member instance exression.
1537 2008-09-04 Marek Safar <marek.safar@gmail.com>
1539 * expression.cs, ecore.cs: Emit full expression tree for reduced
1542 2008-09-04 Marek Safar <marek.safar@gmail.com>
1544 * expression.cs (This): Guard against multi-resolving.
1546 * ecore.cs, statement.cs (Throw): Simplified.
1548 * flowanalysis.cs: Also verify event fields.
1550 2008-09-04 Miguel de Icaza <miguel@novell.com>
1552 * assign.cs (Assign.DoResolve): Perform the type conversions
1553 checks before we attempt to initialize `New' initializers.
1555 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1557 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1560 * repl.cs: Update help.
1562 2008-09-03 Miguel de Icaza <miguel@novell.com>
1564 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1565 handling of the default config handling, including the special
1566 treatment of System.Core assembly.
1568 Fixes the REPL processing for LINQ.
1570 2008-09-03 Marek Safar <marek.safar@gmail.com>
1572 A fix for bug #422507
1573 * expression.cs (UnboxCast): Add missing child expression mutator.
1575 2008-09-03 Marek Safar <marek.safar@gmail.com>
1577 * driver.cs: Don't self reference System.Core assembly.
1579 2008-09-03 Marek Safar <marek.safar@gmail.com>
1581 A fix for bug #422507
1582 * expression.cs (StringConcat): Add missing type mutator.
1584 2008-09-03 Marek Safar <marek.safar@gmail.com>
1586 * generic.cs (TypeInferenceContext): Follow equality rule for
1587 constructed type lower bound type inference.
1589 2008-09-02 Miguel de Icaza <miguel@novell.com>
1591 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1592 <dblank@cs.brynmawr.edu> which updates the cursor position on
1595 2008-09-02 Marek Safar <marek.safar@gmail.com>
1597 A fix for bug #367145
1598 * driver.cs: Fixed import of extension methods when using -noconfig
1601 2008-09-02 Marek Safar <marek.safar@gmail.com>
1603 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1604 version from non-generic implementation instead.
1606 2008-09-01 Marek Safar <marek.safar@gmail.com>
1608 A fix for bug #418908
1609 * class.cs: Use AddScopeStatement for field initializers.
1611 2008-09-01 Marek Safar <marek.safar@gmail.com>
1613 A fix for bug #415385
1614 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1616 2008-09-01 Marek Safar <marek.safar@gmail.com>
1618 A fix for bug #421736
1619 * iterators.cs: Don't crash on unreachable iterators.
1621 2008-09-01 Marek Safar <marek.safar@gmail.com>
1623 A fix for bug #421628
1624 * parameter.cs, attribute.cs: Clone also parameter attributes.
1626 2008-08-30 Miguel de Icaza <miguel@novell.com>
1628 * namespace.cs (LookupType): In EvalMode, try to replace
1629 the TypeBuilder from our cache with a Type as Reflection.Emit does
1630 not like to mix code from older assemblies emitted and new
1633 This sounds like a serious Mono bug that prevents multiple
1634 assemblies to be generated and consumed at the same time.
1636 * cs-parser.jay (push_current_class): Do not make interactive
1637 classes internal or private, make them public as we currently
1638 generate each new class in a new assembly.
1640 2008-08-29 Miguel de Icaza <miguel@novell.com>
1642 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1643 remove types that are entered into the global namespace during
1644 parsing so that we can remove them on failure.
1646 * cs-parser.jay: Parsing: we now keep track of types that are
1647 entered into global variables and queue those in case the parsing
1650 This happens in a few situations: during partial-input, we invoke
1651 the parser repeatedly for example with the string "class X", this
1652 would cause X to be registed, and we need to remove this
1653 registration so that another parse attempt later with say "class X {"
1654 would actually work.
1656 Additionally, if there is an error in the resolution phase, for
1657 example: "class X : NonExistant {}" th
1659 * cs-parser.jay: Be more precise with the errors being raised,
1660 instead of flagging all exceptions during parsing to be attributed
1661 to the parsing process, distinguish those from errors happening in
1662 the actions and hint that using -v would produce the actual
1665 * repl.cs: Do not load all compiler references on each reset,
1666 doing the partial reset takes care of this.
1668 2008-08-28 Miguel de Icaza <miguel@novell.com>
1670 * repl.cs: Add support for loading all the files from
1671 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1674 Introduce a micro-parser that is able to deambiguate on its input
1675 whether we are dealing with a compilation unit (namespace, class,
1676 interface, struct, delegate) declaration or a statement. This
1677 allows both declarations and statements to be entered.
1679 Set history size by default to 300 lines.
1681 Instead of distinguishing based on the parser.InteractiveResult,
1682 have only two cases: statements were parsed, or a compilation unit
1683 was. Always pull the Using statement additions from the
1684 compilation unit parse.
1686 * cs-tokenizer.cs: Rename tokens to better describe their intent
1687 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1689 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1690 EvalMode is used to trigger the lookup of global variables while
1691 StatementMode is used turn variable declarations into static
1694 * getline.cs: Allow history size to be set.
1696 2008-08-29 Marek Safar <marek.safar@gmail.com>
1698 A fix for bug #360755
1699 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1701 2008-08-29 Marek Safar <marek.safar@gmail.com>
1703 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1705 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1706 member name, it is too confusing
1708 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1710 * rootcontext.cs: Finally default to warning level 4.
1712 2008-08-28 Marek Safar <marek.safar@gmail.com>
1714 * class.cs (CheckBase): Ignore overloaded operators.
1716 2008-08-28 Marek Safar <marek.safar@gmail.com>
1718 A fix for bug #420830
1719 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1721 2008-08-28 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #420832
1724 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1726 2008-08-28 Marek Safar <marek.safar@gmail.com>
1728 A fix for bug #420386
1729 * nullables.cs: Fixed logic of nullable user comparison operators involving
1732 2008-08-28 Marek Safar <marek.safar@gmail.com>
1734 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1736 2008-08-27 Miguel de Icaza <miguel@novell.com>
1738 * repl.cs: Add support for aborting the running code with C-c.
1740 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1742 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1744 2008-08-27 Miguel de Icaza <miguel@novell.com>
1746 * cs-parser.jay (interactive_statement_list): A new set of rules
1747 for hosting statements that uses the "interactive_" prefix.
1749 * repl.cs: Add support for parsing `using' as a statement or as a
1750 directive. Deambiguating before passing this to the parser.
1752 We need to distinguish statement_expressions that occur at the
1753 toplevel vs those that occur embedded into expressions.
1755 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1756 that fixes the cursor key handling, and a history bug.
1758 2008-08-26 Miguel de Icaza <miguel@novell.com>
1760 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1761 limitations in Console, instead the 2.0 bootstrap libraries now
1762 include the Console bits.
1764 Also, remove the use of Nullables from getline.cs
1768 Interactive support for the C# compiler. Use gmcs --shell to
1769 enter a read-eval-print loop shell.
1771 Docs: http://www.mono-project.com/CsharpRepl
1773 * sources: include repl.cs here and getline.cs for gmcs.exe,
1774 everything else is getline.cs impaired.
1776 * Makefile: when bootstrapping pass a special flag
1777 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1778 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1779 This distinguishes those two cases.
1781 * repl.cs: Support for a read-eval-print loop. Will be soon
1782 refactored into eval support and then REPL on top of it.
1784 * ecore.cs: If a simplename lookup fails, before erroring out,
1785 if we are in EvalMode to resolve the name to a declaration in the
1788 This means that variable declarations that happened in previous
1789 classes (as repl puts every statement in a separate class) are
1790 made visible in this way.
1792 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1793 triggered an error due to the end of file being reached. This is
1794 used to do multi-line input, and notify the caller that the user
1795 needs to provide more text before a successful parse.
1797 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1798 to drive the evaluation with a custom wrapper.
1800 * driver.cs: Add support for --shell, and refactor some code to be
1803 * namespace.cs: Add support for serializing the contents of the
1804 namespaces and reloading them.
1806 * getline.cs: A managed implementation of ReadLine under
1807 X11/Apache2 license terms. Easy to embed in other applications as
1810 * namespace.cs: Add some functions to save and restore the
1813 * rootcontext.cs: New public field.
1815 * cs-tokenizer.cs: Add support for one of the possible characters
1816 we introduce into the token stream.
1818 This patch does not affect the regular tokenization process, the
1819 only performance hit would happen if there is an invalid character
1820 on the input string.
1822 * support.cs: Move isatty helper routine here.
1824 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1825 code generator for in-memory assemblies.
1827 2008-08-26 Marek Safar <marek.safar@gmail.com>
1829 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1830 parameter cannot be always used as a type.
1832 2008-08-21 Marek Safar <marek.safar@gmail.com>
1834 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1836 2008-08-21 Marek Safar <marek.safar@gmail.com>
1838 * convert.cs: Implement explicit array to IList<T> conversion.
1840 2008-08-20 Marek Safar <marek.safar@gmail.com>
1842 A fix for bug #362740
1843 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1845 2008-08-20 Marek Safar <marek.safar@gmail.com>
1847 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1848 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1849 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1850 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1851 handling to use just one type of infrastructure and deal with generics
1854 2008-07-23 Martin Baulig <martin@ximian.com>
1856 *** Merged this from trunk revision 108527 ***
1859 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1860 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1863 2008-08-15 Marek Safar <marek.safar@gmail.com>
1865 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1868 2008-08-15 Marek Safar <marek.safar@gmail.com>
1870 * delegate.cs: Fixed compiler crash when creating delegate using partial
1873 * typemanager.cs: MulticastDelegate is not a delegate.
1875 2008-08-14 Marek Safar <marek.safar@gmail.com>
1877 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1880 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1882 * cs-parser.jay (type): Allow 'var' in mcs too.
1883 (local_variable_type): Likewise.
1885 2008-08-14 Marek Safar <marek.safar@gmail.com>
1887 * driver.cs: Removed broken -noconfig variants.
1889 2008-08-14 Marek Safar <marek.safar@gmail.com>
1891 A fix for bug #417078
1892 * expression.cs: Emit correctly left side pointer operators.
1894 2008-08-13 Marek Safar <marek.safar@gmail.com>
1896 * generic.cs, lambda.cs: Inflate method generic arguments only.
1898 2008-08-12 Marek Safar <marek.safar@gmail.com>
1900 * class.cs: Fixed struct layout check regression.
1902 2008-08-12 Marek Safar <marek.safar@gmail.com>
1904 * cs-parser.jay, enum.cs: Simplified enum parsing.
1906 * decl.cs: Check all type parameters conflicts.
1908 * expression.cs, statement.cs, attribute.cs: More expression checks.
1910 2008-08-11 Marek Safar <marek.safar@gmail.com>
1912 * generic.cs: Add type inference types restriction.
1914 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1915 anonymous.cs, expression.cs: Allocate less accessor parameters.
1917 2008-08-08 Marek Safar <marek.safar@gmail.com>
1919 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1922 2008-08-08 Marek Safar <marek.safar@gmail.com>
1924 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1926 2008-08-07 Marek Safar <marek.safar@gmail.com>
1928 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1929 Also fixes #362146 and #381592.
1931 2008-08-07 Marek Safar <marek.safar@gmail.com>
1933 * ecore.cs: Reduced constant cannot be used as an attribute value.
1935 * cs-parser.jay: Base expression has to be a type.
1937 * expression.cs (Conditional): Uses ReducedExpression.
1939 2008-08-06 Marek Safar <marek.safar@gmail.com>
1941 A fix for bug #376826
1942 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1943 address of hoisted local variable or parameter cannot be taken.
1945 2008-08-05 Marek Safar <marek.safar@gmail.com>
1947 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1948 anonymous method inside checked/unchecked expression.
1950 2008-08-05 Marek Safar <marek.safar@gmail.com>
1952 * typemanager.cs (IsEqual): Guard against null.
1954 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1955 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1956 routine. Fixed few misleading conversion errors.
1958 2008-08-04 Marek Safar <marek.safar@gmail.com>
1960 * class.cs: Consider generics when checking cycles in struct layout.
1962 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
1964 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
1966 2008-08-04 Marek Safar <marek.safar@gmail.com>
1968 A fix for bug #414165
1969 * anonymous.cs: Use same anonymous implementation method for all anonymous
1972 2008-08-04 Marek Safar <marek.safar@gmail.com>
1974 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1977 2008-08-04 Marek Safar <marek.safar@gmail.com>
1979 * cs-parser.jay: Typeof argument has to be a type expression.
1981 * namespace.cs: Check alias and namespace definitions collisions.
1983 * class.cs, pending.cs: Moved explicit interface accessor implementation
1986 * delegate.cs, expression.cs: Verify special name invocations.
1988 2008-08-01 Marek Safar <marek.safar@gmail.com>
1990 * cs-parser.jay: Don't choke on empty generic type arguments.
1992 * cs-tokenizer.cs: Handle escaped preprocessor directives.
1994 * expression.cs, ecore.cs: Minor expressions bugs.
1996 2008-08-01 Marek Safar <marek.safar@gmail.com>
1998 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1999 and added more error handling.
2001 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2003 * modifiers.cs, enum.cs: Fixed.
2005 2008-07-31 Jb Evain <jbevain@novell.com>
2007 * driver.cs: remove -pkg ability of smcs.
2009 2008-07-30 Marek Safar <marek.safar@gmail.com>
2011 * statement.cs (Switch): Correctly set empty default target for single
2014 2008-07-30 Marek Safar <marek.safar@gmail.com>
2016 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2017 string switch statement implementation to use string dictionary which
2018 significantly (2-8x) improves performance of generated code.
2020 2008-07-29 Marek Safar <marek.safar@gmail.com>
2022 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2023 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2025 2008-07-29 Marek Safar <marek.safar@gmail.com>
2027 A fix for bug #412595
2028 * typemanager.cs, convert.cs, expression.cs: Some types are never
2029 convertible to each other.
2031 2008-07-29 Marek Safar <marek.safar@gmail.com>
2033 * nullable.cs (CreateNullConstant): An error messages update.
2035 2008-07-29 Marek Safar <marek.safar@gmail.com>
2037 A fix for bug #412595
2038 * cfold.cs: Don't cast undefined bool constant.
2040 2008-07-29 Martin Baulig <martin@ximian.com>
2043 (SymbolWriter.Reset): New public static method.
2046 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2048 2008-07-28 Marek Safar <marek.safar@gmail.com>
2050 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2052 * expression.cs (ElementAccess): Exact size allocation.
2054 2008-07-26 Marek Safar <marek.safar@gmail.com>
2056 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2058 2008-07-25 Marek Safar <marek.safar@gmail.com>
2060 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2062 * class.cs: Removed $PRIVATE$ field hack which caused problems during
2065 2008-07-25 Marek Safar <marek.safar@gmail.com>
2067 A fix for bug #412217
2068 * assign.cs: Mutate also assignment type.
2070 2008-07-25 Marek Safar <marek.safar@gmail.com>
2072 A fix for bug #323644
2073 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2076 2008-07-25 Marek Safar <marek.safar@gmail.com>
2078 A fix for bug #412134
2079 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2080 non-enumerable operands when overloading equality or bitwise operators.
2082 2008-07-25 Marek Safar <marek.safar@gmail.com>
2084 * anonymous.cs: Cache closed generic anonymous method delegates.
2086 2008-07-24 Marek Safar <marek.safar@gmail.com>
2088 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
2089 anonymous.cs, statement.cs: Always emit anonymous method as static method
2090 when is instance free. Use nesting for nested anynomous methods blocks.
2092 2008-07-23 Marek Safar <marek.safar@gmail.com>
2094 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2097 2008-07-23 Marek Safar <marek.safar@gmail.com>
2099 * expression.cs: Removed MakeSimpleCall.
2101 2008-07-23 Marek Safar <marek.safar@gmail.com>
2103 A fix for bug #323012
2104 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2105 Base method implementing interface has to be public.
2107 2008-07-23 Marek Safar <marek.safar@gmail.com>
2109 * cs-parser.jay: Don't break on missing argument.
2111 2008-07-22 Marek Safar <marek.safar@gmail.com>
2113 A fix for bug #320993
2114 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2115 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2117 2008-07-22 Marek Safar <marek.safar@gmail.com>
2119 A fix for bug #320748
2120 * convert.cs: Implicit user operators cannot convert to interfaces
2122 2008-07-22 Marek Safar <marek.safar@gmail.com>
2124 A fix for bug #312686
2125 * driver.cs: Ignore empty assembly references.
2127 2008-07-22 Marek Safar <marek.safar@gmail.com>
2129 A fix for bug #387040
2130 * ecore.cs: Skip constrains check for an explicit implementation.
2132 2008-07-21 Marek Safar <marek.safar@gmail.com>
2134 A fix for bug #409045
2135 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2136 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2137 identifiers are file specific unless passed as input arguments.
2139 2008-07-21 Marek Safar <marek.safar@gmail.com>
2141 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2142 to emit UnmanagedMarshal data under 2.0 profile.
2144 2008-07-21 Marek Safar <marek.safar@gmail.com>
2146 A fix for bug #410369
2147 * parameter.cs: Clone correctly ParamsParameter.
2149 2008-07-21 Marek Safar <marek.safar@gmail.com>
2151 * expression.cs (Argument): Always report type for type based expressions
2154 2008-07-18 Marek Safar <marek.safar@gmail.com>
2156 A fix for bug #410666
2157 * anonymous.cs: Correctly initialize generic storey reference.
2159 2008-07-18 Marek Safar <marek.safar@gmail.com>
2161 * convert.cs: Don't box same type arguments.
2163 2008-07-18 Marek Safar <marek.safar@gmail.com>
2165 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2166 Finished missing generic type mutators.
2168 2008-07-18 Marek Safar <marek.safar@gmail.com>
2170 * iterators.cs, statement.cs: Finished statements CloneTo.
2172 2008-07-18 Marek Safar <marek.safar@gmail.com>
2174 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2176 * expression.cs: Emit optimized default value expressions in expression tree
2179 2008-07-18 Marek Safar <marek.safar@gmail.com>
2181 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2183 2008-07-17 Marek Safar <marek.safar@gmail.com>
2185 A fix for bug #367536
2186 * cs-parser.jay: Check static constructor of generic types for an access
2189 2008-07-17 Marek Safar <marek.safar@gmail.com>
2191 A fix for bug #353800
2192 * lambda.cs: Emit ret for contextual statements.
2194 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2195 up emitting redundant ret for all anonymous methods with return.
2197 2008-07-17 Marek Safar <marek.safar@gmail.com>
2199 A fix for bug #365188
2200 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2201 create anonymous method storey in unreachable block.
2203 2008-07-17 Marek Safar <marek.safar@gmail.com>
2205 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2206 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2207 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2208 statement.cs: Fixed relevant defects found by Gendarme.
2210 2008-07-17 Marek Safar <marek.safar@gmail.com>
2212 A fix for bug #325291
2213 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
2214 statement.cs: Replaced IAnonymousHost with top level block flag.
2216 2008-07-17 Marek Safar <marek.safar@gmail.com>
2218 * cs-parser.jay: Clean up unused open_parens.
2220 2008-07-17 Marek Safar <marek.safar@gmail.com>
2222 * ecore.cs: Custom error message for a range variable assignment.
2224 2008-07-16 Marek Safar <marek.safar@gmail.com>
2226 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2229 2008-07-16 Marek Safar <marek.safar@gmail.com>
2231 * literal.cs: Null literal is of object type.
2233 2008-07-16 Marek Safar <marek.safar@gmail.com>
2235 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2236 expression of nullable equality comparison.
2238 2008-07-15 Marek Safar <marek.safar@gmail.com>
2240 * expression.cs(PointerArithmetic): Removed redundant assignment.
2242 2008-07-15 Marek Safar <marek.safar@gmail.com>
2244 * decl.cs (GetSignatureForError): Report full namespace name for containers.
2246 2008-07-14 Marek Safar <marek.safar@gmail.com>
2248 A fix for bug #408361
2249 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2250 they are replaced by GetMethod.
2252 2008-07-14 Marek Safar <marek.safar@gmail.com>
2254 A fix for bug #408721 by jeremie.laval@gmail.com
2255 * expression.cs (Indirection): Implemented CloneTo.
2257 2008-07-14 Marek Safar <marek.safar@gmail.com>
2259 * statement.cs (AssignableSlots): Temporary disabled variable initialization
2262 2008-07-14 Marek Safar <marek.safar@gmail.com>
2264 * report.cs (EnableReporting): Don't reinitialize 0-based values.
2266 2008-07-11 Marek Safar <marek.safar@gmail.com>
2268 * linq.cs: Reset tranparent parameter counter in probing mode.
2270 2008-07-11 Marek Safar <marek.safar@gmail.com>
2272 * anonymous.cs: Mutate anonymous method type.
2274 2008-07-11 Marek Safar <marek.safar@gmail.com>
2276 * ecore.cs, anonymous.cs: Mutate field expressions.
2278 2008-07-10 Marek Safar <marek.safar@gmail.com>
2280 A fix for bug #369670
2281 * linq.cs, statement.cs: Use explicit block for query expressions variables.
2283 2008-07-10 Marek Safar <marek.safar@gmail.com>
2285 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2287 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
2290 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2291 only one '>', and finds a '>>', abort the generic lookahead.
2293 2008-07-10 Marek Safar <marek.safar@gmail.com>
2295 A fix for bug #319902
2296 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
2298 2008-07-10 Marek Safar <marek.safar@gmail.com>
2300 A fix for bug #406371
2301 * statement.cs: Moved EmitSymbolInfo to Block.
2303 2008-07-09 Marek Safar <marek.safar@gmail.com>
2305 * ecore.cs: Report better error for extension method overload failures.
2307 2008-07-09 Marek Safar <marek.safar@gmail.com>
2309 * expression.cs (Is): No need to box reference values.
2311 2008-07-09 Marek Safar <marek.safar@gmail.com>
2313 * class.cs: Use event resolve context when initializing CreateEmitContext.
2315 2008-07-09 Marek Safar <marek.safar@gmail.com>
2317 A fix for bug #394436
2318 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2319 method used inside expression trees. Added more LINQ to expression tree
2322 2008-07-08 Marek Safar <marek.safar@gmail.com>
2324 A fix for bug #378189, #370577
2325 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2328 2008-07-08 Marek Safar <marek.safar@gmail.com>
2330 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2333 2008-07-08 Marek Safar <marek.safar@gmail.com>
2335 A fix for bug #406702
2336 * anonymous.cs: Always park anonymous method in the nearest parent storey.
2338 2008-07-07 Marek Safar <marek.safar@gmail.com>
2340 A fix for bug #406648
2341 * cs-parser.jay: Report nullable use in mcs for some cases.
2343 2008-07-07 Marek Safar <marek.safar@gmail.com>
2345 * ecore.cs: Improved argument mismatch error messages.
2347 2008-07-07 Marek Safar <marek.safar@gmail.com>
2349 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2351 2008-07-07 Marek Safar <marek.safar@gmail.com>
2353 * expression.cs (TypeOf): Mutate type argument.
2355 2008-07-04 Marek Safar <marek.safar@gmail.com>
2357 * class.cs: Report missing partial modifier for correct type.
2359 2008-07-04 Marek Safar <marek.safar@gmail.com>
2361 * ecore.cs, expression.cs (VariableReference): Variable property is
2364 2008-07-04 Marek Safar <marek.safar@gmail.com>
2366 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2368 2008-07-04 Marek Safar <marek.safar@gmail.com>
2370 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2373 2008-07-04 Marek Safar <marek.safar@gmail.com>
2375 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2376 anonymous method storey to an instance method when only "this" is hoisted.
2378 2008-07-03 Marek Safar <marek.safar@gmail.com>
2380 A fix for bug #321615
2381 * expression.cs: Pointer comparisons use unsigned operator.
2383 2008-07-03 Marek Safar <marek.safar@gmail.com>
2385 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2387 2008-07-02 Marek Safar <marek.safar@gmail.com>
2389 A fix for bug #404905
2390 * class.cs: Always initialize local unsafe variables.
2392 2008-06-30 Marek Safar <marek.safar@gmail.com>
2394 A fix for bug #396987
2395 * expression.cs (NewInitialize): Clear local temporary variable for next run
2397 2008-06-27 Marek Safar <marek.safar@gmail.com>
2399 A fix for bug #401020
2400 * ecore.cs: Both types and modifiers have to match for ref and out arguments
2402 2008-06-27 Marek Safar <marek.safar@gmail.com>
2404 A fix for bug #398319
2405 * cs-parser.jay: Implemented undocumented base access expression inside
2408 2008-06-26 Marek Safar <marek.safar@gmail.com>
2410 A fix for bug #404227
2411 * cs-parser.jay: Parse namespace declaration using qualified identifier.
2413 2008-06-26 Marek Safar <marek.safar@gmail.com>
2415 A fix for bug #404227
2416 * convert.cs: Fixed explicit array to interface cast.
2418 2008-06-26 Marek Safar <marek.safar@gmail.com>
2420 A fix for bug #403894
2421 * delegate.cs: Mutate DelegateInvocation type.
2423 2008-06-26 Marek Safar <marek.safar@gmail.com>
2425 A fix for bug #379348
2426 * delegate.cs: Box a load of generic parameters.
2428 2008-06-26 Marek Safar <marek.safar@gmail.com>
2430 * expression.cs: Add an array creation arguments mutate.
2432 2008-06-26 Marek Safar <marek.safar@gmail.com>
2434 A fix for bug #386068
2435 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2438 2008-06-25 Marek Safar <marek.safar@gmail.com>
2440 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2443 2008-06-25 Marek Safar <marek.safar@gmail.com>
2445 A fix for bug #403518
2446 * delegate.cs: Type correctly anonymous method new invocation.
2448 2008-06-24 Marek Safar <marek.safar@gmail.com>
2450 A fix for bug #394826
2451 * anonymous.cs: Fully qualify members when resolving anonymous type internal
2454 2008-06-24 Marek Safar <marek.safar@gmail.com>
2456 A fix for bug #394826
2457 * anonymous.cs, iterators.cs: Construct generic storey only when is really
2460 2008-06-24 Marek Safar <marek.safar@gmail.com>
2462 * class.cs: Clone indexer parameters for localized capturing.
2464 2008-06-24 Marek Safar <marek.safar@gmail.com>
2466 A fix for bug #402379
2467 * expression.cs: Don't crash when an object initializer resolve fails.
2469 2008-06-24 Marek Safar <marek.safar@gmail.com>
2471 A fix for bug #402888
2472 * expression.cs: Mutate conditional expression.
2474 2008-06-24 Marek Safar <marek.safar@gmail.com>
2476 A fix for bug #401012
2477 * class.cs: Keep StructLayout in shared container.
2479 2008-06-24 Marek Safar <marek.safar@gmail.com>
2481 A fix for bug #400438
2482 * decl.cs, class.cs: Only properties can be automatically implemented.
2484 2008-06-24 Marek Safar <marek.safar@gmail.com>
2486 * statement.cs (ChangeToIterator): Copy also labels.
2488 2008-06-23 Marek Safar <marek.safar@gmail.com>
2490 * ecore.cs: Pass type argument details to parent extension method.
2492 2008-06-23 Marek Safar <marek.safar@gmail.com>
2494 A fix for bug #375966
2495 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2497 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
2499 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2501 2008-06-22 Marek Safar <marek.safar@gmail.com>
2503 A fix for bug #394347
2504 * anonymous.cs: Cache compatible delegates as compatibility check produces
2505 a new method every time.
2507 2008-06-20 Marek Safar <marek.safar@gmail.com>
2509 * anonymous.cs: Propagate storey reference for single references.
2511 2008-06-20 Marek Safar <marek.safar@gmail.com>
2513 A fix for bug #387615
2514 * assign.cs, expression.cs: Correctly clone compound assignment.
2516 2008-06-19 Marek Safar <marek.safar@gmail.com>
2518 A fix for bug #359611, #359604
2519 * anonymous.cs: Mutate all types of hoisted parameters.
2521 2008-06-19 Marek Safar <marek.safar@gmail.com>
2523 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2524 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2525 expression.cs, codegen.cs, statement.cs
2527 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2528 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2530 ** Anonymous methods, lambda expressions rewrite **
2532 Anonymous expressions are now resolved when an explicit block is resolved
2533 and they don't require any registration procedure anymore. Further,
2534 anonymous methods are defined when explicit block is emitted which allows
2535 better control of whole process and opens possibilities for more
2536 optimizations as well as alternative to reverse whole process.
2538 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2539 process consistent and to correctly emit hoisted generic methods when they
2540 have at least 1 hoisted variable.
2542 2008-06-17 Martin Baulig <martin@ximian.com>
2544 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2546 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2547 virtual property; check it in Emit().
2548 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2550 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2552 (Indexer.Define): Likewise.
2554 2008-06-17 Marek Safar <marek.safar@gmail.com>
2556 * convert.cs: Don't use IsInterface on type arguments.
2558 * delegate.cs: DelegateInvocation uses MethodInfo.
2560 * parameter.cs: Removed IsTypeParameter.
2562 * generic-mcs.cs: More missing stuff.
2564 2008-06-16 Martin Baulig <martin@ximian.com>
2567 (Modifiers.DEBUGGER_HIDDEN): New public const.
2570 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2573 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2574 (AbstractPropertyEventMethod): Likewise.
2575 (Constructor.Emit): Likewise.
2576 (SourceMethod.SetCompilerGenerated): Removed.
2578 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2582 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2583 if we're an `IteratorHost'.
2584 (AnonymousMethodMethod..ctor): Don't set
2585 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2588 2008-06-16 Marek Safar <marek.safar@gmail.com>
2590 * statement.cs: Clean-up foreach statements.
2592 2008-06-12 Marek Safar <marek.safar@gmail.com>
2594 * class.cs: Stop using public method which should not exist
2595 (MethodBuilder.SetGenericMethodSignature).
2597 2008-06-11 Martin Baulig <martin@ximian.com>
2600 (Location.LookupFile): Add `CompilationUnit' argument; when given
2601 a relative file name, make it relative to the directory the .cs
2602 file is located in instead of using the current directory.
2604 2008-06-11 Martin Baulig <martin@ximian.com>
2607 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2608 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2609 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2610 (SourceMethod.SetCompilerGenerated): Likewise.
2612 2008-06-11 Marek Safar <marek.safar@gmail.com>
2614 * codegen.cs, driver: Only write symbol file when it's asked for.
2616 2008-06-11 Marek Safar <marek.safar@gmail.com>
2618 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2620 2008-06-10 Martin Baulig <martin@ximian.com>
2622 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2624 2008-06-09 Marek Safar <marek.safar@gmail.com>
2626 A fix for bug #316290
2627 * expression.cs: Include decimal operators in predefined table.
2629 * parameters.cs: More readonlyness.
2631 2008-06-09 Marek Safar <marek.safar@gmail.com>
2633 A fix for bug #397213
2634 * cs-parser.jay: One more missing current_local_parameters reset.
2636 2008-06-09 Marek Safar <marek.safar@gmail.com>
2638 A fix for bug #396633
2639 * class.cs: Host backing field in partial container.
2641 2008-06-09 Marek Safar <marek.safar@gmail.com>
2643 A fix for bug #397068
2644 * expression.cs: Check both operand types when predefined operator is used.
2646 2008-06-05 Martin Baulig <martin@ximian.com>
2648 Merged the `debugger-kahalo' branch.
2651 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2652 we're an iterator method.
2653 (SourceMethod): Reflect latest symbol writer changes;
2654 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2655 now `start_row' and `end_row'.
2656 (Constructor.Emit): Fix the logic whether to emit symbol information.
2658 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2662 (CompilationUnit): New public class; derives from `SourceFile'.
2663 (SourceFileEntry.DefineSymbolInfo): New public method.
2664 (SourceFileEntry.SetChecksum): New public method.
2665 (Location): Encode hidden line numbers by using `column == 255';
2666 the .ctor now accepts `column == -1' to mark a hidden line number.
2667 (Location.Hidden): New public property.
2668 (Location.CheckPoint): Add `CompilationUnit'.
2669 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2670 (Location.Push): Add `CompilationUnit compile_unit' argument.
2671 (Location.CompilationUnit): New public property.
2674 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2676 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2678 * driver.cs: `SourceFile' -> `CompilationUnit'.
2680 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2682 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2684 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2688 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2689 new symbol writer API to also pass the file.
2691 2008-06-05 Marek Safar <marek.safar@gmail.com>
2693 * statement.cs: Emit catch variable assignment using variable expression.
2695 2008-06-05 Marek Safar <marek.safar@gmail.com>
2697 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2698 with other variable types.
2700 2008-06-04 Marek Safar <marek.safar@gmail.com>
2702 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2703 GetLength method emit, it breaks resolve rules.
2705 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2706 Marek Safar <marek.safar@gmail.com>
2708 A fix for bug #395542
2709 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2712 2008-06-02 Marek Safar <marek.safar@gmail.com>
2714 A fix for bug #395287
2715 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2717 2008-05-31 Marek Safar <marek.safar@gmail.com>
2719 A fix for bug #395845
2720 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2721 non-nullable parameter type.
2723 2008-05-31 Marek Safar <marek.safar@gmail.com>
2725 * class.cs: Handle contructor initializer as a statement in top-level block.
2727 2008-05-30 Marek Safar <marek.safar@gmail.com>
2729 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2730 security attributes.
2732 2008-05-24 Marek Safar <marek.safar@gmail.com>
2734 * ecore.cs, expression.cs: Small IVariable refactoring.
2736 2008-05-22 Marek Safar <marek.safar@gmail.com>
2738 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2740 2008-05-21 Marek Safar <marek.safar@gmail.com>
2742 * cs-parser.jay: Removed redundant catch type check.
2744 2008-05-21 Marek Safar <marek.safar@gmail.com>
2746 A fix for bug #390372
2747 * nullable.cs: Set correct return type.
2749 2008-05-21 Marek Safar <marek.safar@gmail.com>
2751 A fix for bug #391062
2752 * typemanager.cs: Fixed crash when comparing null types.
2754 2008-05-21 Marek Safar <marek.safar@gmail.com>
2756 A fix for bug #391871
2757 * cs-parser.jay: Better error handling for invalid catch type.
2759 2008-05-20 Marek Safar <marek.safar@gmail.com>
2761 A fix for bug #392155
2762 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2764 2008-05-15 Marek Safar <marek.safar@gmail.com>
2766 A fix for bug #390666
2767 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2770 2008-05-15 Marek Safar <marek.safar@gmail.com>
2772 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2775 2008-05-13 Marek Safar <marek.safar@gmail.com>
2777 A fix for bug #389625
2778 * delegate.cs, generic.cs: Some progress on method group return type
2781 2008-05-13 Marek Safar <marek.safar@gmail.com>
2783 A fix for bug #378419
2784 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2786 2008-05-12 Marek Safar <marek.safar@gmail.com>
2788 * class.cs (Constructor): Added IsCompilerGenerated.
2790 2008-05-12 Marek Safar <marek.safar@gmail.com>
2792 * expression.cs: Enum binary operators can accept non-enum operand only when
2793 is implicitly convertible to underlying type.
2795 2008-05-12 Marek Safar <marek.safar@gmail.com>
2797 A fix for bug #389272
2798 * support.cs: Workaround System.InvalidOperationException for enums.
2800 2008-05-12 Marek Safar <marek.safar@gmail.com>
2802 A fix for bug #389073
2803 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2805 2008-05-10 Marek Safar <marek.safar@gmail.com>
2807 * driver.cs: Split Parse.
2809 * location.cs (LookupFile): Uses string.Empty.
2811 2008-05-07 Marek Safar <marek.safar@gmail.com>
2813 * expression.cs, parameter.cs: Small ParameterReference clean up.
2815 2008-05-07 Marek Safar <marek.safar@gmail.com>
2817 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2818 hack. Fixes #387502.
2820 2008-05-06 Martin Baulig <martin@ximian.com>
2822 * class.cs (Constructor.Emit): Fix the logic whether to emit
2825 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2828 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2829 InvalidOperationException when the iterator is before the start or
2832 2008-05-06 Marek Safar <marek.safar@gmail.com>
2834 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2835 when left is nullable type.
2837 2008-05-06 Marek Safar <marek.safar@gmail.com>
2839 A fix for bug #386628
2840 * expression.cs (LocalVariableReference): Continue in resolving when
2841 variable is not assigned.
2843 2008-05-05 Marek Safar <marek.safar@gmail.com>
2845 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2846 nullable operations.
2848 2008-05-04 Marek Safar <marek.safar@gmail.com>
2850 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2851 it saves many redundant temporary variables for nullable operations.
2853 2008-05-03 Marek Safar <marek.safar@gmail.com>
2855 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2857 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2860 * nullable.cs: Constant coalescing operator optimizations.
2862 2008-05-03 Marek Safar <marek.safar@gmail.com>
2864 * constant.cs: Use unsigned conversion for values which are unsigned only.
2866 2008-05-03 Marek Safar <marek.safar@gmail.com>
2868 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2869 coalescing operator as it should be.
2871 2008-05-02 Marek Safar <marek.safar@gmail.com>
2873 A fix for bug #371016
2874 * expression.cs: All predefined delegate operators require implicit method
2877 2008-05-02 Marek Safar <marek.safar@gmail.com>
2879 * constant.cs: Emit long constant as uint when fits the range.
2881 * convert.cs, expression.cs: Fixed few unsafe conversions.
2883 2008-05-02 Marek Safar <marek.safar@gmail.com>
2885 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2887 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2890 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2892 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2894 2008-05-01 Marek Safar <marek.safar@gmail.com>
2896 * constant.cs, literal.cs: IsLiteral property for error reporting.
2898 * ecore.cs, expression.cs: Implemented Property expression.
2900 2008-05-01 Marek Safar <marek.safar@gmail.com>
2902 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2904 * nullable.cs: Implemented nullable coalescing null operator.
2906 * ecore.cs, expression.cs: Expression trees work.
2908 2008-05-01 Marek Safar <marek.safar@gmail.com>
2910 * ecore.cs: CreateExpressionTree is finally abstract.
2912 * expression.cs, linq.cs: Updated.
2914 2008-05-01 Marek Safar <marek.safar@gmail.com>
2916 * expression.cs, ecore.cs: Block base access expression inside expression
2919 2008-05-01 Marek Safar <marek.safar@gmail.com>
2921 A fix for bug #385058
2922 * expression.cs: User-defined operator implementations always take
2923 precedence over predefined operator implementations.
2925 2008-04-30 Marek Safar <marek.safar@gmail.com>
2927 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2928 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2929 expression tree conversions.
2931 2008-04-30 Marek Safar <marek.safar@gmail.com>
2933 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2934 operators method details to Operator class.
2936 2008-04-30 Marek Safar <marek.safar@gmail.com>
2938 * anonymous.cs: Pass unsafe flags to anonymous container.
2940 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2941 inside expression tree.
2943 2008-04-29 Martin Baulig <martin@ximian.com>
2945 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2946 (Tokenizer.PopPosition): Also restore the `line'.
2948 2008-04-29 Marek Safar <marek.safar@gmail.com>
2950 * delegate.cs: Implemented Invoke expression.
2952 2008-04-29 Marek Safar <marek.safar@gmail.com>
2954 * expression.cs: Fixed equality reference comparison regression.
2956 2008-04-29 Marek Safar <marek.safar@gmail.com>
2958 * ecore.cs: Clean up EmptyCast hack.
2960 * expression.cs, nullable.cs: Implemented enum binary and unary operations
2961 using correct conversion rules. Also fixes #383993.
2963 2008-04-28 Martin Baulig <martin@ximian.com>
2965 * class.cs (Constructor.Emit): Don't emit debugging information
2966 for generated default .ctor's.
2968 2008-04-28 Marek Safar <marek.safar@gmail.com>
2970 * convert.cs: Empty-cast ushort to int conversion.
2972 2008-04-28 Marek Safar <marek.safar@gmail.com>
2974 A fix for bug #384191
2975 * ecore.cs, expression.cs: Fixed expression cloning.
2977 2008-04-28 Marek Safar <marek.safar@gmail.com>
2979 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2981 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
2983 Fix #381559, test-638.cs, test-639.cs
2984 * assign.cs (CompoundAssign.Helper): New wrapper.
2985 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2987 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2988 Pass unconverted expressions to the params array creation expression.
2989 (FieldExpr.EmitAssign): Don't special-case StringConcat.
2990 (PropertyExpr.EmitAssign): Likewise.
2991 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2992 element if it is of kind CompoundAssign.Helper.
2993 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2994 first before anything else.
2995 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2996 (ArrayAccess.LoadArrayAndArguments): Simplify.
2998 2008-04-27 Marek Safar <marek.safar@gmail.com>
3000 * expression.cs: Fixed cloning of typeof(void).
3002 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
3004 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3005 (Assign.Emit): Likewise. Move it to ...
3006 (CompoundAssign.DoResolve): ... here and ...
3007 (CompoundAssign.Emit): ... here.
3008 (EventAddOrRemove): New helper to handle += and -= on events, and
3009 avoid the use of BinaryDelegates.
3010 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3011 (EventExpr.EmitAddOrRemove): Improve.
3012 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3014 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3015 create VarExprs for 'foo.bar.var'.
3016 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3017 is a highly inappropriate name for its functionality.
3019 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3021 Simplify handling of multiple assignments
3022 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
3024 (SimpleAssign): New. Class to be used for normal assignments.
3025 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3026 * expression.cs, parameter.cs, statement.cs: Likewise.
3028 2008-04-25 Marek Safar <marek.safar@gmail.com>
3030 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3031 for incompatible underlying types, more to come, uff.
3033 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3036 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3037 Handle 'leave_copy'.
3039 2008-04-25 Marek Safar <marek.safar@gmail.com>
3041 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3043 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
3045 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
3046 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3047 * statement.cs (While, Do, For): Allow test to have side effects.
3048 (For.DoEmit): Always emit InitStatement.
3051 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3052 Always create SideEffectConstant.
3053 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3054 of type EnumConstant.
3056 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3057 Handle 'right' being SideEffectConstant of type 'bool'.
3059 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3060 Use left.EmitBranchable instead of open coding it, so as to
3061 improve optimization opportunities.
3063 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3065 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3067 (Expression.EmitSideEffect): Document.
3069 2008-04-23 Marek Safar <marek.safar@gmail.com>
3071 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3073 2008-04-23 Marek Safar <marek.safar@gmail.com>
3075 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3077 2008-04-23 Marek Safar <marek.safar@gmail.com>
3079 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3080 conversion to expression tree.
3082 2008-04-23 Marek Safar <marek.safar@gmail.com>
3084 * ecore.cs: Removed unused expression.
3086 2008-04-22 Marek Safar <marek.safar@gmail.com>
3088 * expression.cs: Implemented NegateChecked and New expressions.
3090 2008-04-22 Marek Safar <marek.safar@gmail.com>
3092 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3094 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
3097 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3098 needing final 'ret' instruction.
3100 2008-04-22 Marek Safar <marek.safar@gmail.com>
3102 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3104 2008-04-21 Marek Safar <marek.safar@gmail.com>
3106 * expression.cs: Emit ldnull and not null expression as an instance argument
3107 of static method expression calls.
3109 2008-04-21 Marek Safar <marek.safar@gmail.com>
3111 A fix for bug #378200
3112 * expression.cs: Fixed crash when creating parameterless expression tree
3115 2008-04-21 Marek Safar <marek.safar@gmail.com>
3117 A fix for bug #375297
3118 * anonymous.cs: Fixed crash when inferring from null argument anonymous
3121 2008-04-21 Marek Safar <marek.safar@gmail.com>
3123 A fix for bug #377596
3124 * decl.cs, class.cs: Emit delegate type argument attributes.
3126 2008-04-21 Marek Safar <marek.safar@gmail.com>
3128 A fix for bug #365314
3129 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3131 2008-04-21 Marek Safar <marek.safar@gmail.com>
3133 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3136 2008-04-21 Marek Safar <marek.safar@gmail.com>
3138 * generic.cs (TypeParameter): Removed redundant location.
3140 2008-04-19 Marek Safar <marek.safar@gmail.com>
3142 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3143 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3144 FullNamedExpression in all declaration type expression, statements will come
3147 2008-04-18 Marek Safar <marek.safar@gmail.com>
3149 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3150 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3152 2008-04-18 Marek Safar <marek.safar@gmail.com>
3154 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3157 2008-04-17 Marek Safar <marek.safar@gmail.com>
3159 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3162 2008-04-17 Marek Safar <marek.safar@gmail.com>
3164 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3168 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
3170 Hook up 'EmitSideEffect'
3171 * constant.cs (Constant.EmitSideEffect): New.
3172 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
3173 (SideEffectConstant.EmitSideEffect): New.
3174 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
3175 unconditional branch in EmitBranchable.
3176 (FieldExpr.EmitBranchable): New.
3177 * expression.cs (Unary.EmitSideEffect): New.
3178 (Binary.EmitSideEffect): New.
3179 (VariableReference.EmitSideEffect): New. Do nothing.
3181 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3183 Introduce 'EmitSideEffect'
3184 * ecore.cs (Expression.EmitSideEffect): New.
3185 (TypeCast): Rename from EmptyCast.
3187 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3188 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3189 * convert.cs, nullable.cs: Update to changes.
3191 2008-04-16 Marek Safar <marek.safar@gmail.com>
3193 * class.cs, cs-parser.jay: Early check for base types expression.
3195 2008-04-16 Marek Safar <marek.safar@gmail.com>
3197 * decl.cs (MemberName): Declare PrettyName as obsolete.
3199 2008-04-16 Marek Safar <marek.safar@gmail.com>
3201 * namespace.cs: Use MemberName comparison.
3203 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3206 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
3208 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3209 (MemberName.FullyQualifiedName): New. Provides the functionality
3210 that users assume FullName would have.
3211 * ecore.cs, namespace.cs: Update to changes.
3213 * statement.cs (Using.assign): Make into ExpressionStatement.
3214 (Using.EmitPreTryBody): Simplify.
3216 2008-04-16 Marek Safar <marek.safar@gmail.com>
3218 * report.cs: ColorFormat is protected.
3220 * rootcontext.cs: Unused fields clean-up.
3222 * namespace.cs: Made UsingEntry name private.
3224 2008-04-16 Marek Safar <marek.safar@gmail.com>
3226 * cs-tokenizer.cs, location.cs: Removed unused field.
3228 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
3229 Raja R Harinath <harinath@hurrynot.org>
3232 * constant.cs (SideEffectConstant.value): Rename from 'left'.
3233 (SideEffectConstant.side_effect): Rename from 'right'.
3234 (SideEffectConstant..ctor): Normalize 'side_effect'.
3235 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3236 value of this constant.
3237 * cfold.cs: Update to changes.
3239 2008-04-15 Marek Safar <marek.safar@gmail.com>
3241 * cs-paser.jay: Removed unused variable.
3243 * driver.cs: Made Compile instance method.
3245 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
3247 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3249 2008-04-15 Marek Safar <marek.safar@gmail.com>
3251 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
3253 2008-04-13 Jb Evain <jbevain@novell.com>
3255 * namespace.cs: update the System.Core fullname for 2.1
3256 * driver.cs: update the list of required assemblies for 2.1.
3257 Merged from the Moonlight 2 branch.
3259 2008-04-11 Marek Safar <marek.safar@gmail.com>
3261 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3262 types and user defined operators. User operators arguments has to be checked
3263 for null value before invocation, which also means no operator is called
3264 when any argument is not convertible to unwrapped nullable type.
3266 2008-04-09 Marek Safar <marek.safar@gmail.com>
3268 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3269 of Unary expressions to follow operator overloading rules precisely.
3270 Also fixes #321794, #323794
3272 2008-04-08 Marek Safar <marek.safar@gmail.com>
3274 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3277 2008-04-08 Marek Safar <marek.safar@gmail.com>
3279 * expression.cs, ecore.cs: Implemented MemberInit expression.
3281 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
3283 Fix mono/tests/exception4.cs
3284 * statement.cs (ExceptionStatement, TryCatch): Revert to using
3285 ec.NeedReturnLabel () rather emitting a 'nop'.
3287 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3289 (TryCatch.SomeCodeFollows): Likewise.
3290 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3291 for 'break', 'continue' and 'return' statements inside a try.
3292 We're fairly sure that the generated IL stream will have more
3293 instructions textually following the try.
3294 (FlowBranchingTryCatch): Likewise.
3296 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3297 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3300 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3301 wrapper -- forward everything to CollectionForeach.
3302 (CollectionForeach.NonDisposableWrapper): New.
3303 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3304 instead of a pop + branch to end.
3306 2008-04-07 Marek Safar <marek.safar@gmail.com>
3308 A fix for bug #377485
3309 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
3310 Propagate location for extension method groups. Report conversion failure at
3313 2008-04-07 Marek Safar <marek.safar@gmail.com>
3315 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3316 ListInit and Field expressions.
3318 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
3320 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3321 Since $PC is always -1 inside the body of MoveNext, the fault
3323 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3324 * statement.cs (ExceptionStatement.emit_finally): Likewise.
3325 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3327 The denouement! Fix #324708
3328 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3329 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3330 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3331 'finally' inside the finally clause.
3333 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3334 inside an iterator. Don't emit the body of the 'finally' inside
3335 the finally clause yet.
3337 Use the ResumableStatement infrastructure for MoveNext ()
3338 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3339 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
3340 'old_resume_points'. Move dispatcher upfront.
3341 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3342 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3343 in an enumerator. This encodes the main fix in this patch series
3344 -- we can only jump into the first instruction of a try from the
3345 outside, but we want to emit try/finally regions in iterators and
3346 resume in the middle of them.
3348 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
3350 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3351 of NeedReturnLabel here.
3353 Introduce a common point for emitting try/finally to IL
3354 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
3355 features of the various subclasses, which are now driven by ...
3356 (ExceptionStatement.EmitPreTryBody): ... this and ...
3357 (ExceptionStatement.EmitTryBody): ... this and the original
3359 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3360 Remove DoEmit and update to follow above protocol.
3362 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3363 of the dispatcher are the same, skip emitting the 'switch'.
3364 * iterator.cs (Iterator.EmitDispose): Update to changes.
3366 Clean up handling of 'using' statement
3367 * statement.cs (UsingTemporary): New. Carved out of ...
3368 (Using): ... this. Simplify drastically. Handle exactly
3370 * cs-parser.jay (using_statement): Split. Create UsingTemporary
3371 or Using as appropriate. If there are multiple variable declared,
3372 create nested Using statements.
3373 (resource_acquisition): Kill.
3375 * statement.cs (ExceptionStatement.EmitForDispose): Use
3376 EmitFinallyBody, not EmitFinally.
3378 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3379 * iterator.cs: Update to changes.
3381 Start using the ResumableStatement infrastructure
3382 * statement.cs (ResumeableStatement.PrepareForDispose): New.
3383 (ResumableStatement.EmitForDispose): New.
3384 (ExceptionStatement): Override them.
3385 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3386 EmitForDispose to create the body of the Dispose method. Don't
3389 * iterator.cs (Iterator.AddResumePoint): Move here from ...
3390 * statement.cs (Toplevel.AddResumePoint): ... here.
3391 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3392 * flowanalysis.cs (FlowBranchingIterator): New.
3393 * codegen.cs (EmitContext): Update to changes.
3395 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3396 (Iterator.old_resume_points): Rename from 'resume_points'.
3397 (Iterator.MoveNextStatement): Remove unused class.
3399 New infrastructure for try/finally in iterators (still unused)
3400 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3401 (FlowBranchingToplevel.AddResumePoint): Hook into
3402 ToplevelBlock.AddResumePoint.
3403 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3404 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3405 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
3406 resume points and assign program-counter values.
3407 (ExceptionBlock.AddResumePoint): Collect resume points for
3408 de-muxer at the top of try block.
3409 * iterators.cs (Yield.CheckContext): Simplify.
3410 (Yield.Resolve): Use FlowBranching.AddResumePoint.
3412 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
3414 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3415 argument to an ExitStatement.
3416 (FlowBranchingException): Refactor saved origins code.
3417 * statement.cs (ExitStatement): Update to cahges.
3418 * iterator.cs (YieldBreak): Likewise.
3420 * statement.cs (ResumableStatement): New. Common base class for
3421 YieldReturn and ExceptionStatement.
3422 (ExitStatement): New. Common base class for Return and YieldBreak.
3423 (Return): Update to changes.
3424 * iterator.cs (YieldBreak): Likewise.
3425 * lambda.cs (ContextualReturn): Likewise.
3428 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3429 emit a meaningful error message.
3431 Fix #324765, #319508
3432 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3433 (VariableInfo.SetAssigned): Set it.
3434 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3435 determine if CS0219 or CS0168 is appropriate. Don't use
3436 flow-analysis information.
3437 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3438 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
3439 (EmitContext.EndFlowBranching): ... this.
3441 2008-04-03 Marek Safar <marek.safar@gmail.com>
3443 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3445 2008-04-03 Marek Safar <marek.safar@gmail.com>
3447 A fix for bug #376508
3448 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3449 ImplicitConversionExists.
3451 2008-04-03 Marek Safar <marek.safar@gmail.com>
3453 * expression.cs (Binary): Added remaining binary operators to expression
3456 * nullable.cs: Optimize shift with null argument.
3458 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
3460 Fix minor IL regression
3461 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3462 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3463 * cs-parser.jay (try_statement): Update to changes.
3465 * statement.cs (TryFinally.need_exc_block): Delete.
3466 (TryFinally): Update to changes.
3468 Now all ExceptionStatements are unconditional
3469 * statement.cs (CollectionForeach.DisposableWrapper): New.
3470 Extract out the try/finally code into a new wrapper.
3471 (CollectionForeach.Resolve): Use it to simplify the code.
3473 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
3475 Start at simplifying ExceptionStatement semantics a bit
3476 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3477 * cs-parser.jay (try_statement): Update to changes.
3478 (opt_catch_clauses): Remove.
3479 * flowanalysis.cs: Update to changes.
3480 (FlowBranching.BranchingType.TryCatch): New.
3481 (FlowBranchingTryCatch): New.
3483 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3484 (FlowBranching.CreateBranching): Update to changes.
3485 (FlowBranchingBlock.AddSibling): Add sanity check.
3486 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3489 * iterators.cs (Iterator.MarkFinally): Remove.
3490 * statement.cs (ExceptionStatement): Update to changes.
3492 Add support for skipping over finally blocks at runtime. First
3493 in a series to fix #324708
3494 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3495 (Iterator.EmitMoveNext): Initialize it.
3496 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3497 branch over the body of the 'finally' clause.
3499 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
3501 Avoid lopsided use of Foo/DoFoo names
3502 * statement.cs (ExpressionStatement.EmitFinallyBody):
3503 Rename from EmitFinally.
3504 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3505 * iterator.cs: Update to changes.
3507 2008-04-02 Marek Safar <marek.safar@gmail.com>
3509 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3510 based on UserOperatorCall. More binary nullable operators clean up.
3512 2008-04-02 Martin Baulig <martin@ximian.com>
3514 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3516 2008-04-02 Marek Safar <marek.safar@gmail.com>
3518 * nullable.cs: Merge user and empty conversions when lifting expression
3521 * expression.cs (StringConcat): Implemented expression tree representation.
3523 2008-04-01 Marek Safar <marek.safar@gmail.com>
3525 * nullable.cs: When lifting null literal and a user operator exists, no call
3528 2008-04-01 Marek Safar <marek.safar@gmail.com>
3530 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3533 2008-04-01 Marek Safar <marek.safar@gmail.com>
3535 * nullable.cs, expression.cs: Use namespace instead heavily nested
3536 monster abstract class.
3538 2008-04-01 Marek Safar <marek.safar@gmail.com>
3540 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3541 lifting of null literal and user operators. Clean up of some temporary
3544 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3546 Fix #368224, test-629.cs
3547 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3548 if it crossed an unwind-protect boundary.
3549 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3550 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3551 inside an unwind-protected region.
3552 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3553 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3554 'leave' instead of a 'br' if unwind-protected.
3555 (Iterator.EmitYieldBreak): Likewise.
3557 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3559 * driver.cs: Only define versioninfo resources if no win32 resource
3562 2008-03-28 Marek Safar <marek.safar@gmail.com>
3564 A fix for bug #372375
3565 * convert.cs: Fixed boxing of nullable types.
3567 2008-03-28 Marek Safar <marek.safar@gmail.com>
3569 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3572 2008-03-28 Marek Safar <marek.safar@gmail.com>
3574 A fix for bug #374619
3575 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3577 2008-03-27 Marek Safar <marek.safar@gmail.com>
3579 * lambda.cs: Check return type only for invocation.
3581 2008-03-27 Marek Safar <marek.safar@gmail.com>
3583 A fix for bug #374214
3584 * ecore.cs: Correctly report argument type mismatch.
3586 2008-03-27 Marek Safar <marek.safar@gmail.com>
3588 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3589 and not rely on broken IsEnum.
3591 2008-03-27 Marek Safar <marek.safar@gmail.com>
3593 * nullable.cs: New file, extracted from generic.cs.
3595 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3597 2008-03-27 Marek Safar <marek.safar@gmail.com>
3599 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3600 predefined comparison operators and null literals.
3602 * report.cs: New warning ID.
3604 2008-03-25 Marek Safar <marek.safar@gmail.com>
3606 A fix for bug #370577
3607 * lambda.cs: Check return type too.
3609 2008-03-25 Marek Safar <marek.safar@gmail.com>
3611 A fix for bug #372846
3612 * class.cs: Automatic properties can be declared as unsafe.
3614 2008-03-20 Marek Safar <marek.safar@gmail.com>
3616 * location.cs: Use string based concatenation.
3618 * expression.cs: LiftedBinaryOperator is gmcs only.
3620 2008-03-20 Marek Safar <marek.safar@gmail.com>
3622 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3623 conversions rules and expression trees.
3625 2008-03-19 Marek Safar <marek.safar@gmail.com>
3627 * delegate.cs: Use extension method source as delegate target.
3629 2008-03-19 Marek Safar <marek.safar@gmail.com>
3631 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3632 binary operations to be purely based on binary operations and optimized
3633 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3634 and other ET refactoring.
3636 * typemanager.cs: Fixed warning.
3638 2008-03-17 Marek Safar <marek.safar@gmail.com>
3640 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3642 * symbolwriter.cs: Fixed.
3644 2008-03-17 Marek Safar <marek.safar@gmail.com>
3646 * anonymous.cs, driver.cs: Reset anonymous types counters.
3648 2008-03-17 Marek Safar <marek.safar@gmail.com>
3650 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3652 * class.cs: Use fullname for all type member definitions.
3654 2008-02-19 Martin Baulig <martin@ximian.com>
3657 (IMethodData.EmitExtraSymbolInfo): New interface method.
3658 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3659 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3660 interface method here as an empty public virtual method.
3663 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3664 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3665 CodeGen.SymbolWriter.SetRealMethodName().
3667 2008-02-18 Martin Baulig <martin@ximian.com>
3670 (ScopeInfo.EmitType): Override this and emit debugging
3671 information for captured variables.
3672 (RootScopeInfo.EmitType): Override this and emit symbol
3673 information for a captured `this'.
3675 2008-02-15 Martin Baulig <martin@ximian.com>
3677 * iterators.cs: Emit debugging info.
3680 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3681 (EmitContext.OmitDebuggingInfo): New public property.
3684 (While): Override Emit() and don't emit symbol info there; do it
3685 inside DoEmit() instead.
3686 (Block.Emit): Omit symbol information while emitting the scope
3687 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3689 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3690 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3691 .ctor to make `IsIterator' work.
3693 2008-03-14 Martin Baulig <martin@ximian.com>
3695 * symbolwriter.cs: Added the new symbol writer function from the
3696 debugger's `terrania' branch; temporarily enclose them inside
3697 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3700 2008-03-14 Martin Baulig <martin@ximian.com>
3703 (SymbolWriter): Make this a public static class.
3706 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3707 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3709 2008-03-14 Marek Safar <marek.safar@gmail.com>
3711 A fix for bug #370577
3712 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3715 2008-03-14 Marek Safar <marek.safar@gmail.com>
3717 * typemanager.cs (CSharpName): Made 250 times faster.
3719 2008-03-13 Marek Safar <marek.safar@gmail.com>
3721 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3723 2008-03-12 Marek Safar <marek.safar@gmail.com>
3725 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3726 crash when predefined field does not exist.
3728 2008-03-12 Marek Safar <marek.safar@gmail.com>
3730 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3732 2008-03-12 Marek Safar <marek.safar@gmail.com>
3734 * class.cs (FixedField): Don't crash when contructors are missing.
3736 2008-03-11 Marek Safar <marek.safar@gmail.com>
3738 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3739 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3740 check internal types accessibility for internal and external types.
3741 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3743 2008-03-11 Marek Safar <marek.safar@gmail.com>
3745 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3746 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3747 attribute.cs, statement: Use corect instance of predefined types (work
3748 related to #364674).
3750 2008-03-07 Marek Safar <marek.safar@gmail.com>
3752 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3754 2008-03-07 Marek Safar <marek.safar@gmail.com>
3756 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3757 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3758 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3759 predefined types clean up, delayed predefined types members initialization
3760 (work related to #364674).
3762 2008-03-05 Marek Safar <marek.safar@gmail.com>
3764 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3766 2008-03-05 Marek Safar <marek.safar@gmail.com>
3768 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3769 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3770 predefined types clean up (work related to #364674).
3772 2008-03-04 Marek Safar <marek.safar@gmail.com>
3774 * ecore.cs: Print an error message instead of throwing exception.
3776 2008-03-04 Marek Safar <marek.safar@gmail.com>
3778 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3779 expression.cs, statement.cs: Unififed null literal representation.
3781 2008-03-03 Marek Safar <marek.safar@gmail.com>
3783 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3784 expression.cs: Refactored binary operators resolve phase and improved speed.
3785 The nullable code is still missing and won't work correctly, more fixes
3788 It also fixes #323726, #324312, #324248, and many other unreported issues.
3790 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3792 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3795 2008-02-27 Marek Safar <marek.safar@gmail.com>
3797 * ecore.cs: Clean-up and split BetterConversion.
3799 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3802 * enum.cs (EnumMember.Value): Only access 'value' if
3803 ResolveValue says it's ok.
3804 (EnumMember.DoResolveValue): Don't set prev_member.value.
3805 (Enum.GetDefinition): Reverse arguments of Equals --
3806 EnumMember.Value can return 'null'.
3808 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3810 2008-02-22 Marek Safar <marek.safar@gmail.com>
3812 * generic.cs, expression.cs: More ongoing work on expression trees.
3814 2008-02-21 Marek Safar <marek.safar@gmail.com>
3816 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3817 handle missing matches when mutiple operators exist.
3819 2008-02-20 Marek Safar <marek.safar@gmail.com>
3821 A fix for bug #363218
3822 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3825 2008-02-20 Marek Safar <marek.safar@gmail.com>
3827 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3828 update. This time to deal correctly with SideEffectConstant expression used
3829 as an argument for another constant folding.
3831 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3833 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3836 2008-02-19 Marek Safar <marek.safar@gmail.com>
3838 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3840 2008-02-19 Marek Safar <marek.safar@gmail.com>
3842 A fix for bug #328136
3843 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3844 side is a false constant, because we still need to evaluate the right-hand
3847 * statement.cs (If): Emit two types of boolean constants (simple constant,
3848 side-effect constant).
3850 2008-02-19 Marek Safar <marek.safar@gmail.com>
3852 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3854 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3857 2008-02-18 Marek Safar <marek.safar@gmail.com>
3859 A fix for bug #361457
3860 * ecore.cs (IsApplicable): Params methods have lower priority.
3862 * support.cs: Return correct parameter modifier for params types.
3864 2008-02-18 Marek Safar <marek.safar@gmail.com>
3866 * generic.cs (TypeParameter): Cache attribute target name.
3868 * support.cs: Removed unused variable.
3870 * typemanager.cs: Removed debugging leftover.
3872 * ecore.cs: Use local type instead of a property;
3874 * class.cs (VerifyMembers): Consider also parent to test whether type member
3877 * expression.cs (FullMethodDesc): Removed.
3879 * attribute.cs (IsValidArgumentType): Made static.
3881 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3883 Cleanup to be more readable.
3884 * Makefile (GMCS_PROFILE): Remove.
3885 (COMPILER_NAME): New helper.
3887 2008-02-15 Miguel de Icaza <miguel@novell.com>
3889 * cs-tokenizer.cs: if a conditional expression happens inside a
3890 (...) this also means that we do not need to de-ambiguate between
3891 an parenthesized expression and a cast.
3895 * constant.cs (SideEffectConstant): a constant value that happens
3896 to have a side effect.
3898 Fixes the build regressions introduced by the fix for #359789
3900 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3902 * expression.cs (Conditional.Emit): when emitting the ternary
3903 operator, use local variables to generate code verifiable code.
3905 The verifier cannot infer that the type on stack before the
3906 stloc.0 is executed is of type ParentB. This happens because the
3907 stack merge algorithm uses only parent types when deciding which
3908 is the common type. This is described in Part III 1.8.1.3 of ECMA
3911 This code compiled with mcs is not verifiable under MS. The MS
3912 verifier picks the first common interface of Foo and Bar, which is
3913 wrong, but doesn't use a full join type of the 2 interfaces.
3915 CSC uses a clever hack to compile such code in a verifiable
3916 way. It stores the intermediate values in a local variable with
3921 2008-02-14 Miguel de Icaza <miguel@novell.com>
3923 * expression.cs: Do not fold BitwiseAnd operators when the left
3924 side is a false constant, because we still need to evaluate the
3929 * support.cs: Instead of throwing an InternalErrorException when
3930 the position of the stream is outside the boundary of our buffer,
3931 reset the state of the reader, and restart the reading from the
3932 beginning of the file.
3934 2008-02-14 Marek Safar <marek.safar@gmail.com>
3936 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3938 2008-02-14 Marek Safar <marek.safar@gmail.com>
3940 A fix for bug #361686
3941 * decl.cs: A protected types used inside a private class which parents
3942 derives from the protected class are accessible.
3944 2008-02-13 Marek Safar <marek.safar@gmail.com>
3946 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3947 the parameterless constructor.
3949 2008-02-13 Marek Safar <marek.safar@gmail.com>
3951 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3952 lookup methods to use standard member cache when doing member lookup.
3954 2008-02-12 Marek Safar <marek.safar@gmail.com>
3956 * driver.cs: Don't report full path for referenced module as assembly error.
3958 2008-02-12 Marek Safar <marek.safar@gmail.com>
3960 * Makefile: Fixed `qh' target to work on all machines.
3962 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3963 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3964 and HasElementType with TypeManager implementation.
3966 2008-02-08 Marek Safar <marek.safar@gmail.com>
3968 A fix for bugs #325134, #359749
3969 * expression.cs, ecore.cs: Try to resolve an extension method even if the
3970 first binds point to non-method member expression.
3972 2008-02-08 Marek Safar <marek.safar@gmail.com>
3974 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3976 2008-02-08 Marek Safar <marek.safar@gmail.com>
3978 A fix for bugs #321394, #323028
3979 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3980 Reworked naive IsAccessibleAs implementation to handle nested types.
3982 2008-02-05 Jb Evain <jbevain@novell.com>
3984 * class.cs: use generic type comparison for parameters
3987 2008-02-05 Marek Safar <marek.safar@gmail.com>
3989 A fix for bug #325372
3990 * class.cs: Use generic type comparison when testing method signatures.
3992 2008-02-05 Marek Safar <marek.safar@gmail.com>
3994 A fix for bug #357047
3995 * ecore.cs: Applied C# 3.0 changes to better conversion.
3997 2008-02-05 Marek Safar <marek.safar@gmail.com>
3999 A fix for bug #358374
4000 * cs-parser.jay: Correctly set modifiers for all constructor types.
4002 2008-02-04 Marek Safar <marek.safar@gmail.com>
4004 A fix for bug #355251
4005 * generic.cs: Added base class constraint based type inference.
4007 2008-02-01 Marek Safar <marek.safar@gmail.com>
4009 A fix for bug #357255
4010 * decl.cs: One more missing visibility check.
4012 2008-02-01 Marek Safar <marek.safar@gmail.com>
4014 * support.cs: Fixed broken return.
4016 2008-01-25 Marek Safar <marek.safar@gmail.com>
4018 * report.cs: Correctly reset warnings count after probing.
4020 2008-01-25 Martin Baulig <martin@ximian.com>
4023 (NamespaceEntry.SymbolFileID): Make this work again after
4024 MemberName.ToString() is gone.
4026 2008-01-25 Marek Safar <marek.safar@gmail.com>
4028 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4031 2008-01-25 Marek Safar <marek.safar@gmail.com>
4033 * generic.cs: Use full implicit conversion for type inference fixing.
4035 2008-01-24 Marek Safar <marek.safar@gmail.com>
4037 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4038 Fixed user operator conversions.
4040 2008-01-24 Marek Safar <marek.safar@gmail.com>
4042 * generic.cs: Do nullable type to null comparison optimization during
4045 2008-01-24 Marek Safar <marek.safar@gmail.com>
4047 A fix for bug #355163
4048 * generic.cs: Enabled l-value resolve on nullable expressions.
4050 2008-01-24 Marek Safar <marek.safar@gmail.com>
4052 A fix for bug #353986
4053 * class.cs: Ingore static ctors with parameters for any further checks.
4055 2008-01-24 Marek Safar <marek.safar@gmail.com>
4057 A fix for bug #354310
4058 * namespace.cs: Removed redundant check.
4060 2008-01-24 Marek Safar <marek.safar@gmail.com>
4062 A fix for bug #354928
4063 * expression.cs: ElementInitializers can be resolved only once.
4065 2008-01-24 Marek Safar <marek.safar@gmail.com>
4067 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4068 Condition expressions.
4070 2008-01-23 Marek Safar <marek.safar@gmail.com>
4072 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4074 2008-01-22 Marek Safar <marek.safar@gmail.com>
4076 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4079 * generic.cs: Implemented coalesce expression.
4081 2008-01-22 Marek Safar <marek.safar@gmail.com>
4083 A fix for bug #355145
4084 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4085 expression tree type inference.
4087 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
4090 * expression.cs (Binary.IsUnsignedType): Fix typo.
4092 2008-01-22 Marek Safar <marek.safar@gmail.com>
4094 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4096 2008-01-22 Marek Safar <marek.safar@gmail.com>
4098 A fix for bug #355161
4099 * ecore.cs, expression.cs: Wider range of extension method supported
4102 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
4104 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4105 AssemblyBuilder to operate in compiler context. Fixes mcs part of
4108 2008-01-22 Marek Safar <marek.safar@gmail.com>
4110 A fix for bug #355148
4111 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4113 2008-01-22 Miguel de Icaza <miguel@novell.com>
4115 * expression.cs (CreateExpressionTree): Add support for or and
4116 logical or, and indent following the coding conventions.
4118 * typemanager.cs (LinqExpression): renamed from
4119 ExpressionTreeManager, for a shorter name.
4121 Use TypeManager.CoreLookupType to lookup types from our core
4122 assemblies and turn those into "Type" variables.
4124 Consumers that previously used "Namespace" and "Type" from this
4125 class should instead use the TypeExpression which is a type that
4126 is fully resolved (without involving the regular C# resolution
4129 This typically looks like this:
4131 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4132 new MemberAccess (texpr, name, type_arguments, loc)
4134 This avoids the problem in: #355178
4136 2008-01-21 Marek Safar <marek.safar@gmail.com>
4138 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4139 feature in parser only as we do in other cases.
4141 2008-01-21 Marek Safar <marek.safar@gmail.com>
4143 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4144 typemanager.cs: A refactoring of params arguments to reuse existing
4145 expressions (params -> array initializer) to emit params argument instead
4146 of specialized handling.
4147 It was required by expression tree implementation and it has other benefits
4148 as well, we now apply same optimization for params arguments as we do for
4151 2008-01-18 Marek Safar <marek.safar@gmail.com>
4153 A fix for bug #353526
4154 * generic.cs: A type inference of params arguments may not required any
4155 temporary array creation.
4157 2008-01-18 Marek Safar <marek.safar@gmail.com>
4159 A fix for bug #353534
4160 * generic.cs, ecore.cs, expression.cs: A method group type inference is
4161 supported for delegates only.
4163 2008-01-18 Marek Safar <marek.safar@gmail.com>
4165 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4166 type for more than 1 candidates.
4168 2008-01-18 Marek Safar <marek.safar@gmail.com>
4170 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4173 2008-01-16 Marek Safar <marek.safar@gmail.com>
4175 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4176 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4177 operator) expressions.
4179 2008-01-16 Zoltan Varga <vargaz@gmail.com>
4181 * statement.cs: Avoid declaring an IL variable for this_variable since it is
4182 not accessed from the generated IL.
4184 2008-01-14 Marek Safar <marek.safar@gmail.com>
4186 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4187 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4188 statement.cs: The first expression tree implementation drop, mostly
4189 infrastructure work.
4191 2008-01-14 Marek Safar <marek.safar@gmail.com>
4193 * ecore.cs (IsNestedChild): Refactored.
4195 2008-01-11 Marek Safar <marek.safar@gmail.com>
4197 * lambda.cs: Don't use a cast on unknown expression statement.
4199 2008-01-10 Geoff Norton <gnorton@novell.com>
4201 * cs-tokenizer.cs: One more token to distinguish between method and lambda
4204 2008-01-09 Marek Safar <marek.safar@gmail.com>
4206 * doc.cs: Report better /doc crash details.
4208 2008-01-09 Marek Safar <marek.safar@gmail.com>
4210 A fix for bug #352536
4211 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4213 2008-01-08 Marek Safar <marek.safar@gmail.com>
4215 A fix for bug #352287
4216 * ecore.cs, expression.cs: Do `this' access checking in all member access
4219 2008-01-08 Marek Safar <marek.safar@gmail.com>
4221 * rootcontext.cs, driver.cs: Switch to linq mode by default.
4223 * report.cs: Reset message stacks.
4225 2008-01-08 Marek Safar <marek.safar@gmail.com>
4227 * generic.cs (InferInPhases): Correctly calculate params position.
4229 2008-01-08 Marek Safar <marek.safar@gmail.com>
4231 * cs-tokenizer.cs: No need to parse full string when parsing lambda
4234 2008-01-07 Marek Safar <marek.safar@gmail.com>
4236 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4238 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4240 * driver.cs: Updated --help option.
4242 2008-01-07 Marek Safar <marek.safar@gmail.com>
4244 * generic.cs (InferParamsTypeArguments): Removed.
4245 (InferInPhases): Add params type inference.
4246 (LowerBoundInference): Fixed scoring mechanism.
4248 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4250 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
4252 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4253 byte array for unsigned "baked" assemblies.
4255 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
4257 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4258 array for assemblies that are not strongnamed.
4260 2008-01-04 Marek Safar <marek.safar@gmail.com>
4262 A fix for bug #351481
4263 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4264 declaring type for nested generic types.
4266 2008-01-04 Marek Safar <marek.safar@gmail.com>
4268 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4269 instead of ToString.
4271 2008-01-03 Marek Safar <marek.safar@gmail.com>
4273 A fix for bug #351047
4274 * expression.cs (Binary.ResolveOperator): Allow equality operators between
4275 null and structs only when equality and inequality operators are defined
4276 either as an user-operators or predefined operators.
4278 2008-01-03 Marek Safar <marek.safar@gmail.com>
4280 A fix for bug #351047
4281 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4283 2008-01-03 Marek Safar <marek.safar@gmail.com>
4285 A fix for bug #351257
4286 * cs-tokenizer.cs: Advance line number for '\r' correctly.
4288 2008-01-03 Marek Safar <marek.safar@gmail.com>
4290 A fix for bug #351157
4291 * class.cs (Using): Fixed yet another broken cloning.
4293 (Block): Put back more sensible default value for statements.
4295 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
4297 * codegen.cs: Allow AssemblyVersion with only major version component.
4300 2007-12-29 Marek Safar <marek.safar@gmail.com>
4302 A fix for bug #324654
4303 * class.cs: Use FullName property as member name.
4305 2007-12-28 Marek Safar <marek.safar@gmail.com>
4307 A fix for bug #342117
4308 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4309 constructor constraint.
4311 2007-12-28 Marek Safar <marek.safar@gmail.com>
4313 A fix for bug #338273
4314 * class.cs (ProbertyBase): Access modifier checks are required for overrides
4317 2007-12-28 Marek Safar <marek.safar@gmail.com>
4319 A fix for bug #350839
4320 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4322 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4324 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4327 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4329 * statement.cs: Changed some Hashtables to use HybridDictionaries
4330 instead. It was observed that some HashTables only contained a few
4331 items in the vast majority of cases. Since HybridDictionary is
4332 more efficient on small sets (<10 elements), "known_variables"
4333 from class ExplicitBlock as well as "labels" and "constants " from
4334 class Block were changed to HybridDictionaries.
4336 Atsai results: (56216kb->54987kb)
4338 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4341 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4343 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4346 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4348 * expression.cs: foreach loop to for loop, saved on allocation of
4349 enumerator (59333kb->59141kb)
4351 * statement.cs. Changed foreach loops to for loops, saved on
4352 allocation of enumerator (59141kb->59006kb)
4354 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4355 when constructed with no specified capacity. This was causing a
4356 few ArrayLists to allocate more memory than they would potentially
4357 need in the Block class and MemberCache class. Setting the
4358 ArrayLists to construct with a capacity of 1 saves some
4359 memory. (56216kb->55585kb)
4361 2007-12-27 Marek Safar <marek.safar@gmail.com>
4363 A fix for bug #347189 (2nd issue)
4364 * expression.cs (MemberAccess): Nested type can be found in base non-generic
4367 2007-12-27 Miguel de Icaza <miguel@novell.com>
4369 * report.cs: Do not use colors if stdout and stderr are not a
4372 2007-12-27 Marek Safar <marek.safar@gmail.com>
4374 A fix for bug #346998
4375 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4378 2007-12-27 Marek Safar <marek.safar@gmail.com>
4380 A fix for bug #343465
4381 * class.cs: Explicit method name for nested types uses dots only.
4383 2007-12-27 Marek Safar <marek.safar@gmail.com>
4385 A fix for bug #343707
4386 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4388 2007-12-27 Marek Safar <marek.safar@gmail.com>
4390 * ecore.cs: Report type inference errors only when arguments count matches
4393 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4395 * expression.cs, report.cs: New warning.
4397 * typemanager.cs: Catch anonymous method type too.
4399 2007-12-23 Marek Safar <marek.safar@gmail.com>
4401 A fix for bug #346379
4402 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4404 2007-12-23 Marek Safar <marek.safar@gmail.com>
4406 A fix for bug #347359
4407 * expression.cs (Invocation): Don't resolve already resolved expression.
4409 2007-12-23 Marek Safar <marek.safar@gmail.com>
4411 A fix for bug #347189
4412 * class.cs (FixedField): Use non-dependent code only in the define phase.
4414 2007-12-23 Marek Safar <marek.safar@gmail.com>
4416 A fix for bug #348076
4417 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4419 2007-12-22 Marek Safar <marek.safar@gmail.com>
4421 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4422 discovered extension methods.
4424 2007-12-22 Marek Safar <marek.safar@gmail.com>
4426 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4429 2007-12-21 Miguel de Icaza <miguel@novell.com>
4431 * report.cs (ErrorMessage): Add support for using colors on
4432 terminals that support it.
4434 2007-12-21 Marek Safar <marek.safar@gmail.com>
4436 * ecore.cs: Use information about expanded params for error reporting.
4438 2007-12-21 Marek Safar <marek.safar@gmail.com>
4440 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4441 and logic for params overloads.
4443 2007-12-15 Miguel de Icaza <miguel@novell.com>
4445 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4446 as this is also created from the parser. Fixes #349034
4448 2007-12-12 Miguel de Icaza <miguel@novell.com>
4450 * statement.cs (Throw.CloneTo): it is valid to have empty
4451 expressions for throw.
4453 2007-12-03 Marek Safar <marek.safar@gmail.com>
4455 * cs-parser.jay: Set delegate constraint parsing region correctly.
4457 2007-12-03 Marek Safar <marek.safar@gmail.com>
4459 A fix for bug #345467
4460 * typemanager.cs (IsEqual): Compare generic parameters position only.
4462 2007-11-28 Marek Safar <marek.safar@gmail.com>
4464 * expression.cs (BaseAccess): Type arguments can be null.
4466 2007-11-27 Raja R Harinath <harinath@gmail.com>
4468 * statement.cs (Block.Resolve): Ensure flow-branching tree is
4469 consistent even when an error has occured.
4470 (Switch.Resolve): Likewise.
4472 2007-11-22 Marek Safar <marek.safar@gmail.com>
4474 A fix for bug #334505
4475 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4478 2007-11-22 Marek Safar <marek.safar@gmail.com>
4480 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
4481 refactorings required to resolve extension methods correctly when mixing
4482 generics and non-generics members.
4484 2007-11-20 Marek Safar <marek.safar@gmail.com>
4486 A fix for bug #342584
4487 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4490 2007-11-19 Marek Safar <marek.safar@gmail.com>
4492 A fix for bug #342512
4493 * delegate.cs: Use delegate argument expression when is available. Don't
4494 emit virtual call when class is sealed.
4496 2007-11-16 Marek Safar <marek.safar@gmail.com>
4498 A fix for bug #325423
4499 * assign.cs (FieldInitializer): Use resolved expression for emit.
4501 * class.cs: Print less confusing error message.
4503 2007-11-16 Marek Safar <marek.safar@gmail.com>
4505 * cs-tokenizer.cs: Removed GMCS ifdefs.
4507 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4510 * cs-parser.jay: Disabled nullable check.
4512 * generic-mcs: Copied more generic stuff.
4514 2007-11-16 Marek Safar <marek.safar@gmail.com>
4516 * gcs-parser.jay: Merged to cs-parser.jay.
4518 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4519 * *.csproj, *.sources: Updated to use only jay parser file.
4521 2007-11-16 Marek Safar <marek.safar@gmail.com>
4523 * gcs-parser.jay: Added nullable and default expression feature checks.
4525 2007-11-16 Marek Safar <marek.safar@gmail.com>
4527 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4528 it fixes many TODOs and hidden bugs.
4530 * expression: Removed duplicate error check.
4532 2007-11-15 Marek Safar <marek.safar@gmail.com>
4534 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4535 implicitly type local variable only when it is used in a declaration.
4537 2007-11-15 Marek Safar <marek.safar@gmail.com>
4539 * attribute.cs: Use CS0612 for empty strings.
4541 2007-11-14 Marek Safar <marek.safar@gmail.com>
4543 * lambda.cs, statement.cs: Contextual return may act as a statement.
4545 2007-11-14 Marek Safar <marek.safar@gmail.com>
4547 A fix for a regression cause by #324222
4548 * class.cs: Don't report unused even when it implements an interface.
4550 2007-11-13 Marek Safar <marek.safar@gmail.com>
4552 A fix for bug #341205
4553 * ecore.cs, expression.cs: Method group expression cannot do static
4554 method access with an instance reference check before overloading takes
4557 2007-11-13 Marek Safar <marek.safar@gmail.com>
4559 A fix for bug #325359
4560 * class.cs: Use predictable name for automatically generated property.
4562 2007-11-12 Marek Safar <marek.safar@gmail.com>
4564 A fix for bug #324996
4565 * expression.cs (Is): Handle case where D is nullable and T is not
4568 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4570 2007-11-12 Marek Safar <marek.safar@gmail.com>
4572 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4573 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4574 Flush small error reporting changes.
4576 2007-11-09 Marek Safar <marek.safar@gmail.com>
4578 A fix for bug #324996
4579 * expression.cs: Rewrote Is expression implementation to work with
4580 generics, nullable types, anonymous method. A const result expression
4581 uses existing infrastructure instead of custom not fully-featured one.
4583 2007-11-08 Marek Safar <marek.safar@gmail.com>
4585 A fix for bug #340202
4586 * class.cs: Consider generics for volatile field.
4588 2007-11-08 Marek Safar <marek.safar@gmail.com>
4590 A fix for bug #335594
4591 * expression.cs: Use conversion rules when handling string addition.
4593 2007-11-07 Marek Safar <marek.safar@gmail.com>
4595 A fix for bug #336651
4596 * expression.cs: Fixed a crash when probing is on.
4598 2007-11-07 Marek Safar <marek.safar@gmail.com>
4600 A fix for bug #324242
4601 * covert.cs: Added a conversion from any nullable-type with an
4602 underlying enum-type to the type System.Enum.
4604 2007-11-07 Marek Safar <marek.safar@gmail.com>
4606 A fix for bug #324222
4607 * class.cs: Report all non-used event fields.
4609 2007-11-07 Marek Safar <marek.safar@gmail.com>
4611 A fix for bug #325161
4612 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4613 qualifier for generic types.
4615 2007-11-07 Marek Safar <marek.safar@gmail.com>
4617 A fix for bug #322971
4618 * expression.cs, ecore.cs: Added intermediate result value check for
4621 2007-11-07 Marek Safar <marek.safar@gmail.com>
4623 A fix for bug #324754
4624 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4625 when it was requested.
4627 2007-11-07 Marek Safar <marek.safar@gmail.com>
4629 A fix for bug #325101
4630 * expression.cs: Do type not value comparison for `is' expression.
4632 2007-11-07 Marek Safar <marek.safar@gmail.com>
4634 A fix for bug #320236
4635 * convert.cs: Don't apply user conversion on underlying target type.
4637 2007-11-06 Marek Safar <marek.safar@gmail.com>
4639 * expression.cs: Don't use unresolved expression for error reporting.
4641 2007-11-06 Marek Safar <marek.safar@gmail.com>
4643 A fix for bugs #337712, #324490
4644 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4645 overloading resolution too.
4647 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4648 the process consistent and more robust.
4650 * expression.cs, linq.cs, report.cs: Update.
4652 2007-11-02 Marek Safar <marek.safar@gmail.com>
4654 A fix for bug #332909
4655 * attribute.cs: Resolve attributes in correct context using error
4658 * rootcontext.cs: Define Obsolete attribute members as core members.
4660 2007-11-02 Marek Safar <marek.safar@gmail.com>
4662 * statement.cs: Removed unused methods.
4664 2007-10-31 Wade Berrier <wberrier@novell.com>
4666 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4667 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4670 2007-10-31 Marek Safar <marek.safar@gmail.com>
4672 A fix for bug #338102
4673 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4674 methods registered as non-generics.
4676 2007-10-31 Marek Safar <marek.safar@gmail.com>
4678 A fix for bugs #337712, #324490
4679 * delegate.cs: Delegate covariance and contravariance is not allowed for
4682 2007-10-31 Marek Safar <marek.safar@gmail.com>
4684 A fix for bug #337719
4685 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4688 2007-10-30 Marek Safar <marek.safar@gmail.com>
4690 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4692 2007-10-29 Marek Safar <marek.safar@gmail.com>
4694 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4697 2007-10-29 Raja R Harinath <rharinath@novell.com>
4699 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4701 2007-10-29 Marek Safar <marek.safar@gmail.com>
4703 A fix for bug #334652
4704 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4705 extension methods when we have not found the best candidate in normal
4708 2007-10-27 Marek Safar <marek.safar@gmail.com>
4710 * AssemblyInfo.cs: Keep up-to-date.
4712 2007-10-27 Marek Safar <marek.safar@gmail.com>
4714 * Makefile: Fixed generics compiler name.
4716 2007-10-27 Marek Safar <marek.safar@gmail.com>
4718 * lambda.test: removed, lambda parsing is done differently.
4720 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4722 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4724 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4726 2007-10-27 Marek Safar <marek.safar@gmail.com>
4728 * Makefile, *.sources : All C# compilers are in mcs folder.
4730 * *.cs: Use existing 2_1 define for smcs.
4732 2007-10-26 Marek Safar <marek.safar@gmail.com>
4734 A fix for bug #335847
4735 * assign.cs, expression.cs: Couple of changes to avoid creating a
4736 temporary variable for each object initializer assignment statement. It
4737 simplifies struct initialization too, otherwise two temporary variables
4739 Implemented optimization of redundant default element initializers.
4741 2007-10-25 Marek Safar <marek.safar@gmail.com>
4743 A fix for bug #336766
4744 * expression.cs (Class.CheckBase): Use generic name when method is
4747 2007-10-25 Marek Safar <marek.safar@gmail.com>
4749 A fix for bug #334737
4750 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4751 variable and not variable argument for prepared copies.
4753 2007-10-24 Marek Safar <marek.safar@gmail.com>
4755 A fix for bug #325110
4756 * class.cs, expression.cs, attribute.cs: Use open generic method when
4757 checking conditional attribute.
4759 2007-10-24 Marek Safar <marek.safar@gmail.com>
4761 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4762 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4763 FeatureIsNotAvailable.
4765 2007-10-24 Marek Safar <marek.safar@gmail.com>
4767 ** C# 3.0 Partial methods
4769 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4770 methods support. Because of member cache issue with generics only
4771 non-generics partial methods are fully supported.
4773 2007-10-23 Marek Safar <marek.safar@gmail.com>
4775 * class.cs, decl.cs: Rewrote member overloads check to cope with
4776 generics and to use member cache for member checking. It also improves
4777 performance and fixes remaining overloads issues.
4779 2007-10-20 Marek Safar <marek.safar@gmail.com>
4781 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4782 roottypes.cs, typemanager.cs:
4784 A member cache creation logic changed to add members immediately and
4785 not rely on fallback. The member cache is now only prefered way
4786 how to access and find type declaration members. It saves 5 MB of memory
4787 during MWF compilation and makes code ready for more optimizations and
4788 clean-ups, it's also a pre-requirement for partial methods.
4790 2007-10-18 Raja R Harinath <harinath@gmail.com>
4792 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4793 handling for generic parameters.
4795 2007-10-15 Marek Safar <marek.safar@gmail.com>
4797 * class.cs (FixedField): Removed redundant volatile check.
4799 2007-10-15 Marek Safar <marek.safar@gmail.com>
4801 * class.cs, decl.cs: Fixed overload members verification to do only one
4802 check per possible collision.
4804 2007-10-13 Marek Safar <marek.safar@gmail.com>
4806 A fix for bug #325478
4807 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4808 and create only one disposable flags container.
4810 2007-10-12 Marek Safar <marek.safar@gmail.com>
4812 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4813 * statement.cs (Fixed): Fixed variables cloning.
4815 2007-10-12 Marek Safar <marek.safar@gmail.com>
4817 A fix for bug #333342
4818 * class.cs (EventField): Don't mark value type event as synchronized.
4820 2007-10-12 Marek Safar <marek.safar@gmail.com>
4822 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4823 inference to identify best candidate method correctly.
4824 (ProperyExpr): A range variable is read only and cannot be modified.
4826 2007-10-11 Marek Safar <marek.safar@gmail.com>
4828 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4829 logic to identify best candidate method correctly.
4831 2007-10-11 Marek Safar <marek.safar@gmail.com>
4833 * location.cs (Equals, GetHashCode): Removed.
4835 2007-10-11 Marek Safar <marek.safar@gmail.com>
4837 * report.cs: Implemented message recorder. It is used mainly for lambda
4838 expressions to capture otherwise swallowed error messages.
4840 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4842 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4844 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4846 * expression.cs (MemberAccess): Always report lookup failure.
4848 * location.cs: Implemented Equals, GetHashCode.
4850 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4852 2007-10-10 Jb Evain <jbevain@novell.com>
4854 * codegen.cs: re-enable assembly version check.
4856 2007-10-09 Marek Safar <marek.safar@gmail.com>
4858 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4861 * namespace.cs (UsingAlias): Do correct version check.
4863 2007-10-08 Marek Safar <marek.safar@gmail.com>
4865 * expresison.cs, ecore.cs: Issue extension method error message when
4868 * rootcontext.cs: Added ISO_2 compiler mode option.
4870 2007-10-08 Marek Safar <marek.safar@gmail.com>
4872 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4875 2007-10-08 Marek Safar <marek.safar@gmail.com>
4877 * attribute.cs (GetString, GetBoolean): Work with both literal and
4880 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4881 Moved method overload specific methods to MethodGroupExpr.
4883 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4884 it should be less memory consuming.
4886 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4888 * codegen.cs: remove the assembly version check until the buildbot is
4891 2007-10-07 Jb Evain <jbevain@novell.com>
4893 * attribute.cs (Attribute.GetString): if the value
4894 expression is a StringConstant, return its string value.
4896 2007-10-07 Jb Evain <jbevain@novell.com>
4898 * typemanager.cs: add `assembly_version_attribute_type`.
4899 * codegen.cs: on attribute emission, check that the
4900 AssemblyVersionAttribute doesn't overflow.
4902 2007-10-05 Marek Safar <marek.safar@gmail.com>
4904 A fix for bug #324677
4905 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4906 parent container of a scope container with currently resolved one.
4908 2007-10-05 Marek Safar <marek.safar@gmail.com>
4910 A fix for bug #325534
4911 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4914 2007-10-05 Marek Safar <marek.safar@gmail.com>
4916 A fix for bug #327504
4917 * class.cs (Operator.Define): Refactored implicit and explicit user
4918 operator conversion rules.
4920 2007-10-05 Marek Safar <marek.safar@gmail.com>
4922 A fix for bug #327520
4923 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4925 2007-10-04 Marek Safar <marek.safar@gmail.com>
4927 A fix for bug #328022
4928 * class.cs (MethodData.Define): Use correct method to check whether
4929 a method implementents an accessor.
4931 2007-10-04 Marek Safar <marek.safar@gmail.com>
4933 A fix for bug #330069
4934 * statement.cs (Fixed.Resolve): Read the first array element only when
4935 an array is instantiated.
4937 2007-10-04 Marek Safar <marek.safar@gmail.com>
4939 * expression.cs, assign.cs, generics.cs: Print correct operator when
4940 compound assignment is used.
4942 2007-10-04 Marek Safar <marek.safar@gmail.com>
4944 A fix for bug #325841
4945 * expression.cs (ArrayAccess): Use full argument cloning only for
4946 string compound concatenation.
4948 2007-10-03 Marek Safar <marek.safar@gmail.com>
4950 A fix for bug #328774
4951 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4953 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4956 2007-10-03 Raja R Harinath <rharinath@novell.com>
4959 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4960 Event accessibility checks here. Remove some bogus code that
4961 accidently made GenericMethods work.
4962 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4964 2007-09-25 Marek Safar <marek.safar@gmail.com>
4966 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4968 * statement.cs (Block): Refactored AddVariable to allow error handling
4971 * generic.cs: New stub.
4973 2007-09-23 Marek Safar <marek.safar@gmail.com>
4975 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4978 2007-09-17 Marek Safar <marek.safar@gmail.com>
4980 * class.cs: Use partial container to record whether any partial part
4981 contains static field initializer and therefore default contructor has
4984 2007-09-14 Marek Safar <marek.safar@gmail.com>
4986 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4987 mono-list when only one of two partial parts has defined accessibility
4990 2007-09-14 Marek Safar <marek.safar@gmail.com>
4992 A fix for bug #82845
4994 * class.cs (TypeContainer): Set correct resolve context for all field
4997 2007-09-13 Marek Safar <marek.safar@gmail.com>
4999 * assign.cs: Fixed a crash when field is resolved twice with an error.
5001 * codegen.cs: Changed InFieldInitializer to be flag.
5003 * anonymous.cs, ecore.cs, expression.cs: Update after
5004 IsInFieldInitializer rename.
5006 * const.cs: Removed unused parameter.
5008 * class.cs: Changed the way how we resolve and emit field initializers.
5009 The field initilizers have to have access to contructor block to emit
5010 compiler generated code.
5012 2007-09-13 Marek Safar <marek.safar@gmail.com>
5014 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5015 generics use TypeContainer instead.
5017 2007-09-12 Marek Safar <marek.safar@gmail.com>
5019 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5021 * lambda.cs (ResolveParameters): Use more powerful
5022 InflateGenericArgument.
5024 * parameters.cs: Better exception message.
5026 2007-09-10 Marek Safar <marek.safar@gmail.com>
5028 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5029 correct expression block type.
5031 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5033 * expression.cs (Invocation): Extracted method group resolve to
5036 2007-09-07 Marek Safar <marek.safar@gmail.com>
5038 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5039 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5041 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5042 generic extension methods.
5044 2007-09-06 Marek Safar <marek.safar@gmail.com>
5046 A fix for bug #82676 (Do I get it right now?)
5047 * convert.cs (Binary.ResolveOperator): An interface is converted to the
5048 object before a standard conversion is applied.
5050 2007-09-06 Marek Safar <marek.safar@gmail.com>
5052 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5055 2007-09-05 Marek Safar <marek.safar@gmail.com>
5057 A fix for bug #82676
5058 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5059 non-generic interface types.
5061 2007-09-05 Marek Safar <marek.safar@gmail.com>
5063 A fix for bug #82690
5064 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5066 2007-09-05 Marek Safar <marek.safar@gmail.com>
5068 A fix for bug #82571
5069 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
5070 modifier for container based methods.
5072 2007-09-05 Marek Safar <marek.safar@gmail.com>
5074 A fix for bug #82676
5075 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5076 any interface-type T means to any of interface type T.
5078 2007-09-04 Marek Safar <marek.safar@gmail.com>
5080 * namespace.cs: We have 2 versions of System.Core assembly.
5082 2007-09-04 Marek Safar <marek.safar@gmail.com>
5084 A fix for bug #82652
5085 * class.cs (Class.GetClassBases): Compare types and not expressions.
5087 2007-09-04 Marek Safar <marek.safar@gmail.com>
5089 A fix for bug #82620
5090 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5091 actually never worked before.
5092 (IndexerAccess): Emit prepared arguments before they are modified.
5094 2007-09-04 Marek Safar <marek.safar@gmail.com>
5096 A fix for bug #82563
5097 * assign.cs: Revert wrong fix.
5099 * expression.cs (VariableReference.EmitAssign): Handle ref reference
5101 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5102 Instead of ldelema/stdind we have to use temporary variables to handle
5103 cases like String.Concat (params string[]).
5105 2007-08-31 Marek Safar <marek.safar@gmail.com>
5107 * class.cs: EmitAttributes to Emit rename.
5109 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5111 (MemberCore.HasClsCompliantAttribute): Don't depend on
5112 GetClsCompliantAttributeValue execution.
5114 2007-08-31 Marek Safar <marek.safar@gmail.com>
5116 * anonymous.cs: Use shorter type prefix.
5118 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5121 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5122 variables when probing is on.
5124 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
5125 unresolved variables.
5126 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5127 handle transparent identifiers.
5129 2007-08-26 Marek Safar <marek.safar@gmail.com>
5131 * attribute.cs (IsClsCompliant): Add nullable types test.
5133 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
5135 * doc.cs : catch other types of exception than XmlException to
5136 report CS1570. Fixed bug #82565.
5138 2007-08-23 Marek Safar <marek.safar@gmail.com>
5140 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
5141 The number of delegate parameters has to match.
5142 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5145 2007-08-21 Marek Safar <marek.safar@gmail.com>
5147 * anonymous.cs (AnonymousMethod): Generate private anonymous method
5148 to fix problem with private arguments.
5150 2007-08-20 Marek Safar <marek.safar@gmail.com>
5152 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5154 * decl.cs (MemberName): Ignore generic type with no generic arguments.
5156 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5157 empty. Add cloning suport.
5159 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5161 2007-08-20 Marek Safar <marek.safar@gmail.com>
5163 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
5164 to create EmptyCast. It handles EmptyConstantCast specialization for
5167 2007-08-18 Marek Safar <marek.safar@gmail.com>
5169 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5170 (EmitArrayArgument): One routine for array arguments.
5171 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
5173 2007-08-17 Marek Safar <marek.safar@gmail.com>
5175 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5177 2007-08-17 Marek Safar <marek.safar@gmail.com>
5179 * anonymous.cs: MemberLookupFinal update.
5181 * class.cs (ConstructorInitializer): Is expression based.
5183 * delegate.cs: MethodGroupExpr update.
5185 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
5187 (Error_MemberLookupFailed): Customizable error override.
5188 (MethodGroupExpr): Keep queried type for later usage.
5189 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5192 * expression.cs: Error_MemberLookupFailed refactoring.
5193 (New.DoResolve): Resolve as much as possible.
5194 (ElementInitializer.Error_MemberLookupFailed): Object initializer
5195 customization for invalid member types.
5197 * statement.cs: MethodGroupExpr update.
5199 2007-08-16 Marek Safar <marek.safar@gmail.com>
5201 * modifier.cs (Check): Check all modifiers and not only accessibility
5204 2007-08-16 Marek Safar <marek.safar@gmail.com>
5206 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5207 type and not an expression.
5209 2007-08-16 Marek Safar <marek.safar@gmail.com>
5211 * statement.cs (Catch.Clone): Type and variable can be null.
5213 2007-08-16 Marek Safar <marek.safar@gmail.com>
5215 A fix for bug #81979
5216 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5217 I am really not sure whether this is the best fix.
5219 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5222 2007-08-14 Marek Safar <marek.safar@gmail.com>
5224 ** C# 3.0 Object and collection initializers (major re-write)
5226 * assign.cs (DoResolve): Initializers are not assign related.
5228 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5229 used during collection or object initialization.
5231 * expression.cs (Error_InvalidArguments): Add initializers specific
5232 messages. More will come later because it requires some general
5234 (New.DoResolve): Better error handling for unsafe types.
5235 (EmptyExpressionStatement): New class.
5236 (ElementInitializer): An object initializer expression.
5237 (CollectionElementInitializer): A collection initializer expression.
5238 (CollectionOrObjectInitializers): A block of object or collection
5240 (NewInitialize): New expression with element/object initializers.
5242 * statement.cs: Reverted object/collection initializer hacks.
5244 * typemanager.cs (CSharpName): Filter __arglist type.
5246 2007-08-09 Marek Safar <marek.safar@gmail.com>
5248 ** C# 3.0 Anonymous Types (update to the latest standard)
5250 * expression.cs (Binary.ResolveOperator): Threat all null based types
5252 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5253 (AnonymousTypeParameter): Updated.
5255 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5256 (AnonymousTypeClass): New anonymous type container.
5258 * class.cs (AddField): Return operation result.
5260 * generic.cs: Another empty TypeArguments overload.
5262 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5263 are stored at top of normal hierarchy.
5265 * typemanager.cs (CSharpName): Filter anonymous types.
5267 2007-08-09 Marek Safar <marek.safar@gmail.com>
5269 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5270 as single Concat call. How could we miss that :-(
5272 2007-08-08 Marek Safar <marek.safar@gmail.com>
5274 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5276 2007-08-07 Miguel de Icaza <miguel@novell.com>
5278 * expression.cs: Fix the previous commit, the creation of the
5279 arguments array list needs also to be conditional on the arguments
5282 * class.cs: Add a little bit of help to help narrow down problems.
5284 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5285 not try to copy in that case.
5287 * driver.cs: When building SMCS, include a new different set of
5288 default assemblies here. Do this here so we can control whether
5289 to include the default assemblies with /noconfig.
5291 2007-08-03 Marek Safar <marek.safar@gmail.com>
5293 A fix for bug #81979
5294 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5297 2007-08-03 Marek Safar <marek.safar@gmail.com>
5299 A fix for bug #82300
5301 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5302 we are in probing scope.
5304 2007-08-03 Marek Safar <marek.safar@gmail.com>
5306 A fix for bug #82301
5308 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5309 (Statement.CloneTo): Clone and not map children blocks.
5311 2007-08-03 Marek Safar <marek.safar@gmail.com>
5313 A fix for bug #82299
5315 * expression.cs (LocalVariableReference.CloneTo): Remap local info
5318 * statement.cs (Statement.CloneTo): Clone variables before statements
5319 to allow remaping of local variables.
5321 2007-08-03 Marek Safar <marek.safar@gmail.com>
5323 A fix for bug #82296
5326 * report.cs: Log crash details for future clone problems.
5328 * statement.cs (Return.Clone): Don't clone non-existent expression.
5330 2007-08-03 Raja R Harinath <harinath@gmail.com>
5332 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5333 (Class.AddBasesForPart): Move CS0537 check here from ...
5334 * cs-parser.jay (class_declaration): ... here. Move calling of
5335 'AddBasesForPart' to ...
5336 (class_bases): ... here.
5337 (struct_declaration, interface_declaration): Update to changes.
5339 2007-08-02 Marek Safar <marek.safar@gmail.com>
5341 A fix for bug #81923
5343 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5344 conversion is allowed.
5346 2007-08-02 Marek Safar <marek.safar@gmail.com>
5348 A fix for bug #81564
5350 * ecore.cs (EventExpr): Add IsBase handling.
5352 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5355 2007-08-02 Raja R Harinath <harinath@gmail.com>
5357 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5358 * cs-parser.jay: Some whitespace cleanups.
5359 (current_delegate): New.
5361 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5362 a dummy code block, and use 'type_name' instead of 'member_name'.
5363 (interface_declaration, class_declaration): Likewise.
5364 (delegate_declaration): Likewise. Rearrange slightly and use
5366 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5367 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
5369 2007-08-02 Marek Safar <marek.safar@gmail.com>
5371 A fix for bug #82039
5373 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5376 * typemanager.cs (CSharpName): Split to string overload.
5378 2007-08-02 Marek Safar <marek.safar@gmail.com>
5381 * report.cs: Updated warning CS0472.
5383 2007-08-01 Marek Safar <marek.safar@gmail.com>
5385 A fix for bug #82181
5387 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5389 2007-08-01 Marek Safar <marek.safar@gmail.com>
5391 A fix for bug #82277
5392 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5394 2007-08-01 Marek Safar <marek.safar@gmail.com>
5396 ** C# 3.0 Type Inference (major bits are working)
5398 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5399 (.ImplicitStandardConversionExists): Uses compatible.
5400 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5401 (.InferReturnType): New method.
5402 (.Compatible): Refactored.
5403 (.ResolveParameters): Uses factory to create resolved parameters.
5404 (.CompatibleMethod): Add probing mode support.
5405 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5406 clearly distinguish between 2 different operations.
5407 (LambdaMethod): Moved to lambda.cs.
5408 (AnonymousMethod): Removed unused fields and methods.
5409 (AnonymousDelegate): Simplified.
5411 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5413 * convert. cs (ImplicitConversionStandard): Compatible works differently.
5415 * delegate.cs (Delegate): New mehods to reduce code duplication.
5416 (.GetConstructor): New method.
5417 (.GetInvokeMethod): New method.
5418 (DelegateCreation): Updated.
5420 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5422 (OverloadResolve): Made probing little bit faster.
5424 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5427 * generic.cs (TypeInferenceContext): Dummy implementation.
5429 * iterators.cs: Updated after Resolve/Define rename.
5431 * lambda.cs (LambdaExpression)
5432 (.ResolveParameters): Handles both type of arguments and type inference too.
5434 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5435 (InflateTypes): Updated.
5437 * support.cs (InflateTypes): Changed signature and updated.
5439 * typemanager.cs (LookupMemberCache): Better dynamic type check.
5440 (MemberLookup_FindMembers): More MS tricks.
5441 (GetParameterData): Ditto.
5442 (GetDelegateParameters): Uses quick path for dynamic types.
5444 2007-08-01 Marek Safar <marek.safar@gmail.com>
5446 * class.cs (MethodData.Define): EmitContext is required for generic stuff
5449 2007-07-31 Marek Safar <marek.safar@gmail.com>
5451 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5454 2007-07-26 Jb Evain <jbevain@novell.com>
5456 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5457 which takes a boolean 'report_errors', similar to the GetMethod.
5458 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5459 in .net 2.1, do not report errors here.
5461 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5462 System.Runtime.CompilerServices.RequiredAttributeAttribute and
5463 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5466 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5467 of the type InternalsVisibleToAttribute before the first call
5468 to CoreLookupType which is allowed to fail (third boolean parameter
5469 to true). Because, during the resolution for a type that is not
5470 immediately found, we try to check if the type is not defined in
5471 a friend assembly, and to do so, we need the
5472 InternalVisibleToAttribute.
5474 2007-07-23 Miguel de Icaza <miguel@novell.com>
5476 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5477 feature that allows structs to be compared against null and inline
5478 the result as true or false.
5480 Notice that the same code is not permitted inside a generic block
5481 of code that would do:
5483 class Foo<T> where T : struct {
5490 It is only allowed if the type of T is not bound (no where
5491 clause). In my opinion, this CSC 2 behavior is broken but people
5492 seem to be using it (IronRuby does, a few bug reports on bugzilla
5493 have it and some people have complained about it).
5495 All of the users that depend on this behavior have code that is
5498 * report.cs (Warning, Error): make these take object arguments,
5499 not strings, as that allows us to take advantage of Format.
5501 2007-07-20 William Holmes <billholmes54@gmail.com>
5503 * decl.cs: Changed MemberName.CountTypeArguments to also check the
5504 Left member variable for the Count.
5505 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
5506 MemberName.CountTypeArguments to avoid a NRE.
5508 This code is contributed under the MIT X11 license
5510 2007-07-18 Marek Safar <marek.safar@gmail.com>
5512 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5514 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5516 * doc.cs : generic method arguments are written as ``x while generic
5517 type arguments are `x. Combined with the previous change, fixed bug
5520 2007-07-18 Raja R Harinath <rharinath@novell.com>
5523 * expression.cs (Binary.ResolveOperator): When converting
5524 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5526 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5528 * doc.cs : when T: or whatever x: is specified, it does not really
5529 check the doc comment's syntax correctness. Fixed bug #82006.
5531 2007-07-18 Marek Safar <marek.safar@gmail.com>
5533 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5534 LambdaExpression better.
5536 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5538 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5540 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5541 as it can be generated.
5543 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5546 * lambda.cs (LambdaExpression): Refactored to share same code with
5547 AnonymousMethodExpression.
5549 2007-07-17 Marek Safar <marek.safar@gmail.com>
5551 * anonymous.cs (MakeName): Include host name for easier debugging.
5552 (LambdaMethod): New class for lambda spcecific stuff.
5554 * attribute.cs: Set EmitContext return type.
5556 * class.cs: Set EmitContext return type.
5558 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5559 with null/void meaning.
5561 * iterators.cs (ContainerType): Implemented.
5563 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5565 * statement.cs (Return): Updated to lambda expressions.
5566 (Block.CloneTo): Parent can be null.
5568 2007-07-13 Marek Safar <marek.safar@gmail.com>
5570 A fix for bug #81917
5571 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5573 * class.cs (FixedField): Check whether field is in unsafe scope.
5575 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5576 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5578 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5581 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5583 2007-07-13 Marek Safar <marek.safar@gmail.com>
5585 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5586 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5589 2007-07-13 Marek Safar <marek.safar@gmail.com>
5591 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5593 2007-07-13 Marek Safar <marek.safar@gmail.com>
5595 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5596 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5598 * codegen.cs(EmitContext): Add ProbingMode flag.
5600 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5602 * driver.cs: For now set both warning values.
5604 * ecore.cs (SimpleName): Name is readonly.
5605 (MethodGroup.OverloadResolve): One quick path for probing.
5607 * expression.cs (Unary): Set Oper r/o.
5608 (Binary): Set Oper r/o.
5609 (ParameterReference): Set few instance variables as r/o.
5610 (ParameterReference.DoResolveBase): Don't capture aruments when
5612 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5613 (Arglist): arguments are private.
5614 (SizeOf): type is private and r/o.
5615 (MemberAccess): arguments are private.
5617 * report.cs: Enhanced reporting on/off capabilities.
5619 * lambda.cs: Uses ec.IsInProbingMode.
5620 (ContextualReturn): Derives from return.
5622 * rootcontext.cs: For now set both warning values.
5624 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5626 (Return.Resolve): Don't die immediately.
5627 (Block.Resolve): Speed-up probing.
5628 (Block.CloneTo): Clone only child blocks.
5630 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5632 * iterators.cs: reverted Miguel's latest change (r81925) as it
5633 breaks the build in System.
5635 2007-07-13 Miguel de Icaza <miguel@novell.com>
5637 * iterators.cs (Yield.CheckContext): Check for the iterator type
5638 also here as we can call into Yield even in codepaths that are not
5640 (MethodOrOperator is the only path that was checked).
5642 In addition to the standard check, use a more specific check for
5643 constructors to report a more verbose error.
5645 2007-07-12 Miguel de Icaza <miguel@novell.com>
5647 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5648 report the warning and continue
5650 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5651 values on the stack on the call to Emit. Use EmitStatement if
5652 possible, or using Emit + Pop if not possible. Fixes #82064
5654 2007-07-12 Raja R Harinath <rharinath@novell.com>
5656 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5657 avoid try...finally in some cases.
5659 2007-07-10 Marek Safar <marek.safar@gmail.com>
5661 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5663 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5664 instead of method. Re-use standard error handling.
5665 (ConstructorInitializer.Emit): Simplified.
5667 * delegate.cs: Updated after Invocation.EmitCall change.
5669 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5670 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5671 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5672 method and don't permanently changing input arguments.
5673 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5674 is resolved it has one of the candidates is the best one which is later
5675 used to emit. Removed a few unused method.
5676 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5678 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5679 (Binary.ResolveOperator): Ditto.
5680 (ConditionalLogicalOperator.DoResolve): Ditto.
5681 (Invocation): Uses method group.
5682 (Invocation.DoResolve): Simplified.
5683 (Invocation.EmitCall): Removed useless is_static.
5684 (Invocation.Emit): Delegate to method group.
5685 (Invocation.EmitStatement): Simplified.
5686 (New): Uses method group.
5687 (MemberAccess.DoResolve): Don't destroy original expression.
5689 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5691 2007-07-04 Marek Safar <marek.safar@gmail.com>
5693 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5696 * lambda.cs: Add custom error message type.
5698 2007-07-03 Marek Safar <marek.safar@gmail.com>
5700 * lambda.cs: Simplified little bit.
5702 * parameter.cs: Introduced ImplicitLambdaParameter.
5703 (Parameters.CreateFullyResolved): New factory instead of ctor.
5707 * delegate.cs: Updated parameter creation.
5709 2007-07-03 Marek Safar <marek.safar@gmail.com>
5711 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5714 * generic.cs: Synchronized with gmcs.
5716 2007-07-03 Marek Safar <marek.safar@gmail.com>
5718 * class.cs (Indexer): Check return type as soon as possible.
5720 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5723 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5725 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5727 * parameter.cs (Parameter): Use expression type when it is available.
5729 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5730 method modifier for the first parameter only.
5732 2007-06-24 Marek Safar <marek.safar@gmail.com>
5734 A fix for bug #81938
5735 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5737 * constant.cs: Tide up an exception message.
5739 2007-06-22 Marek Safar <marek.safar@gmail.com>
5741 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5742 an uninitialized variable is used.
5744 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5746 2007-06-22 Marek Safar <marek.safar@gmail.com>
5748 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5749 not found error handling.
5751 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5753 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5754 (ArrayCreation.DoResolve): Simplified.
5755 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5756 its own resolve process.
5757 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5759 2007-06-20 Marek Safar <marek.safar@gmail.com>
5761 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5764 2007-06-20 Marek Safar <marek.safar@gmail.com>
5766 * cs-tokenizer.cs: Removed var related stuff.
5768 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5769 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5770 a type and a keyword at same time.
5772 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5775 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5776 implicitly typed arrays, more changes will follow.
5778 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5780 2007-06-19 Marek Safar <marek.safar@gmail.com>
5782 * ecore.cs (VarExpr): Removed Handled field.
5784 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5785 build-in assign functionality.
5786 (ForEach.Resolve): Removed all implicitly typed local variable code and
5788 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5789 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5791 2007-06-18 Marek Safar <marek.safar@gmail.com>
5793 * assign.cs: Removed implicitly typed local variable check.
5795 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5796 referencing implicitly typed local variable.
5797 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5800 * statement.cs (Fixed): Removed unsupported implicitly typed local
5803 2007-06-15 Marek Safar <marek.safar@gmail.com>
5805 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5807 2007-06-14 Marek Safar <marek.safar@gmail.com>
5809 A fix for bugs #81855 and #76274
5810 * attribute.cs (AttachTo): Always set owner for global attributes to
5813 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5816 * cs-parser.jay: Assembly and module attributes must precede all other
5817 elements except using clauses and extern alias declarations.
5819 2007-06-13 Marek Safar <marek.safar@gmail.com>
5821 A fix for bug #81748
5823 * expression.cs: More checks for non ISO-1 features.
5825 2007-06-12 Marek Safar <marek.safar@gmail.com>
5827 A fix for bug #81807
5828 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5829 present inside switch statement and it is required by nullable check.
5831 2007-06-12 Marek Safar <marek.safar@gmail.com>
5833 A fix for bug #81840
5834 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5835 when type matching fails.
5837 * namespace.cs: Tiny error message change.
5839 2007-06-12 Marek Safar <marek.safar@gmail.com>
5841 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5842 reporting. Added automatic property check.
5844 * class.cs: Updated after CheckAbstractAndExtern relocation.
5845 (AEventPropertyAccessor.GetSignatureForError): Customized.
5847 2007-06-11 Marek Safar <marek.safar@gmail.com>
5849 * class.cs (DefineBaseTypes): Base type can be undefined.
5851 * ecore.cs (TypeLookup): Minor refactoring.
5852 (DoResolveAsTypeStep): Removed redundant check.
5854 * namespace.cs (Lookup): Removed redundant check.
5856 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5857 ResolveAsTypeTerminal step.
5858 (BootstrapCorlib_*): Simplified.
5859 (PopulateCoreType): Core types can be now external.
5861 2007-06-07 Marek Safar <marek.safar@gmail.com>
5863 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5865 (InferTypeArguments): Infers anonymous expression type arguments.
5866 (Compatible): Split to Compatible and InferTypeArguments.
5868 * lambda.cs: Updated.
5870 2007-06-08 Marek Safar <marek.safar@gmail.com>
5872 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5874 2007-06-07 Raja R Harinath <harinath@gmail.com>
5876 Fix #80477, cs0135-2.cs, cs0135-3.cs
5877 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5878 names to the "known" variables list.
5879 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5880 parameter names are also "known".
5881 (Block.CheckError136): Remove.
5882 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5885 2007-06-07 Marek Safar <marek.safar@gmail.com>
5887 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5889 2007-06-06 Marek Safar <marek.safar@gmail.com>
5891 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5892 internal error not an user error.
5894 * expression.cs (IsApplicable): Refactored to make debugging easier.
5896 * support.cs: More tricks for non-mono runtimes.
5898 * typemanager.cs (CoreLookupType): Made public.
5899 (InitSystemCore): All linq specific stuff moved to linq.cs
5901 2007-06-05 Marek Safar <marek.safar@gmail.com>
5903 * typemanager.cs (CSharpSignature): One more missing build-in types
5905 More tricks for non-mono runtime.
5907 2007-06-05 Raja R Harinath <harinath@gmail.com>
5909 * statement.cs (Block.CheckError136_InParents): Remove.
5910 (Block.AddVariable): Use GetParameterInfo instead.
5911 (ToplevelBlock.ProcessArguments): Likewise.
5913 2007-06-04 Raja R Harinath <rharinath@novell.com>
5915 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5917 (ToplevelBlock.GetParameterInfo): Split out of ...
5918 (ToplevelBlock.GetParameterRefernce): ... this.
5919 (ToplevelBlock.ParameterMap): Remove.
5920 * expression.cs (ParameterReference): Update to use
5921 ToplevelParameterInfo.
5923 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5926 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5927 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5929 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5930 (ToplevelBlock.ProcessParameters) ... here.
5931 (ToplevelBlock..ctor): Invoke it.
5933 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5936 * statement.cs (IKnownVariable): New interface.
5937 (LocalInfo): Implement it.
5938 (ToplevelParameterInfo): New class.
5939 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5940 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5941 GetKnownVariableInfo.
5943 2007-06-03 Raja R Harinath <harinath@gmail.com>
5945 Partly speed up CS0136 error checks.
5946 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5947 'recurse' parameter.
5948 (Block.DoCheckError136): Only check errors in parameters. Move
5949 local variable checks ...
5950 (Block.AddVariable): ... here, and ...
5951 (ToplevelBlock.ResolveMeta): ... here.
5953 2007-06-02 Raja R Harinath <harinath@gmail.com>
5955 * statement.cs (Block.IsChildOf): Remove.
5957 * statement.cs (Statement.Clone): Move special case code ...
5958 (Block.CloneTo): ... here.
5960 2007-05-29 Raja R Harinath <rharinath@novell.com>
5962 * statement.cs (ToplevelBlock.container): Remove field. It's
5963 redundant with 'Parent'.
5964 (ToplevelBlock.ContainerBlock): Remove accessor.
5965 (ToplevelBlock..ctor): Update to changes. Register anonymous
5966 child with parent here, ...
5967 * cs-parser.jay (end_anonymous): ... not here. Don't modify
5969 (start_anonymous): Don't save current_block.
5970 (top_current_block): Remove.
5972 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5973 (Block.Resolve): Update to changes.
5974 (Block..ctor): Move setting of "correct" 'Toplevel'
5975 and 'Explicit' fields to ...
5976 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5978 2007-05-27 Raja R Harinath <harinath@gmail.com>
5981 * statement.cs (Block.Implicit): Remove.
5982 (Block): Update to changes.
5983 * flowanalysis.cs: Likewise.
5985 Mildly speed up CheckInvariantMeaningInBlock
5986 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5987 Recursively call AddKnownVariable to all enclosing blocks.
5988 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5989 Remove recursive calls.
5990 (Block): Update to changes.
5992 New ExplicitBlock invariants
5993 * statement.cs (Block.Explicit): New field. It points to the
5994 immediately enclosing non-implicit block.
5995 (Block..ctor): Maintain the invariant.
5996 * cs-parser.jay: Take advantage of invariant.
5998 Introduce ExplicitBlock
5999 * statement.cs (ExplicitBlock): New.
6000 (ToplevelBlock): Derive from it.
6001 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6003 (Block.Implicit): Update to changes.
6004 * cs-parser.jay: Update to changes.
6007 * codegen.cs (EmitContext.IsLastStatement): Remove.
6008 * statement.cs (Block.DoEmit): Update to changes.
6010 2007-05-25 Raja R Harinath <rharinath@novell.com>
6012 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6013 modifying current_block directly.
6015 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
6017 * class.cs: Implemented automatic properties (C# 3.0)
6018 Thanks to Marek for the help.
6020 2007-05-23 Raja R Harinath <rharinath@novell.com>
6022 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6023 variable as assigned, note also that all its components are
6025 (MyBitVector.SetRange): New. Function to set multiple bits to true.
6027 2007-05-19 Marek Safar <marek.safar@gmail.com>
6029 * anonymous.cs, class.cs: Emit Compiler generated attribute when
6030 member is marked as compiler generated.
6032 * decl.cs (MemberCore): Refactored ModFlags into property.
6034 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6035 (Check): Check only accessibility modifiers.
6037 2007-05-18 Raja R Harinath <rharinath@novell.com>
6039 Track all assignable slots in one bit array
6040 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6041 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
6042 logic from VariableMap constructor here. Use the same 'offset'
6043 variable that's later used for computing offsets of local
6045 * flowanalysis.cs (UsageVector.parameters): Remove.
6046 (UsageVector): Update to changes.
6047 (VariableMap): Remove.
6049 Avoid creating ParameterMap in every block
6050 * statement.cs (Block.ParameterMap): Move ...
6051 (ToplevelBlock.ParameterMap): ... here.
6052 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6054 * flowanalysis.cs (FlowBranching.param_map): Remove.
6055 (FlowBranching.UsageVector): Update to changes.
6056 (FlowBranchingToplevel.CheckOutParameters): Likewise.
6058 * statement.cs (Block.CloneTo): Clone Toplevel field too.
6060 * expression.cs (ParameterReference): Distinguish between block
6061 where parameter was referenced and declared.
6063 2007-05-18 Marek Safar <marek.safar@gmail.com>
6065 * flowanalysis.cs, statement.cs: Put back improved error handling.
6067 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
6071 Imporved object and collection initialization (C# 3.0).
6073 2007-05-15 Marek Safar <marek.safar@gmail.com>
6075 A fix for bug #81380
6076 * expression.cs (Is.DoResolve): Only value types have constant `is'
6079 2007-05-15 Raja R Harinath <rharinath@novell.com>
6081 * statement.cs (ToplevelBlock.child): Remove.
6083 2007-05-15 Raja R Harinath <harinath@gmail.com>
6085 Rationalize ResolveMeta: refactoring
6086 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
6087 out constant handling code into ...
6088 (Block.DoResolveConstants): ... this.
6090 Rationalize ResolveMeta: kill local_map
6091 * statement.cs (Block.local_map, Block.LocalMap): Remove.
6092 (Block.AssignableSlots): New.
6093 (Block.ResolveMeta): Make protected. Don't create a VariableMap
6094 for locals -- move code from VariableMap here. Avoid unnecessary
6096 * flowanalysis.cs (FlowBranching.local_map): Remove.
6097 (FlowBranching..ctor): Use Block.AssignableSlots.
6098 (VariableMap): Remove unused constructors.
6100 2007-05-11 Raja R Harinath <rharinath@novell.com>
6102 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6104 2007-05-11 Marek Safar <marek.safar@gmail.com>
6106 * typemanager.cs (IsFriendAssembly): Should not be called for building
6109 2007-05-09 Marek Safar <marek.safar@gmail.com>
6111 * literal.cs (NullConstant): Print null in all cases.
6113 * expression.cs (Binary.ResolveOperator): Implemented delegate
6114 comparison based on C# 2.0 changes.
6116 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
6118 This code is contributed under the MIT X11 license
6120 The following enables support for several C# 3.0 language features:
6122 * cs-tokenizer.cs: Added support for the "var" keyword.
6124 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6125 Added VarExpr class to facilitate type inferencing.
6127 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6128 to support anonymous types.
6130 * assign.cs: Added support for type inferencing and initialization.
6132 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6134 * expression.cs: Added implicit array support to ArrayCreation.
6135 Added 5 types and 1 interface:
6137 IInitializable Implementing classes can inject initializing
6138 statements after object instantiation.
6140 Initializer Stores data for object initialization.
6142 AnonymousType An expression for anonymous types.
6144 AnonymousTypeParameter Stores data about an anonymous type's field.
6146 NewInitialize An expression for object initialization.
6148 CollectionInitialize An expression for collection initialization.
6150 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6153 2007-05-06 Marek Safar <marek.safar@gmail.com>
6155 A fix for bug #81500
6156 * cs-tokenizer.cs: Add special handling for coalescing operator.
6158 2007-05-06 Marek Safar <marek.safar@gmail.com>
6160 A fix for bug #81529
6161 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6162 its value from base class until it is redefined.
6164 2007-05-02 Raja R Harinath <rharinath@novell.com>
6166 Fix regression in cs0631-3.cs
6167 * cs-parser.jay (operator_declarator): Add opt_attributes to error
6168 fallback. Make error fallback catch more cases.
6170 2007-05-01 Miguel de Icaza <miguel@novell.com>
6172 * cs-parser.jay: Allow parameters in operator declarations to have
6175 2007-04-27 Miguel de Icaza <miguel@novell.com>
6177 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6180 * lambda.cs (ContextualReturn.Resolve): An expression is valid
6181 inside the ContextualReturn, it does not have to be an
6182 ExpressionStatement.
6184 2007-04-24 Miguel de Icaza <miguel@novell.com>
6186 * lambda.cs (ContextualReturn.Resolve): if the return type is not
6189 2007-04-23 Miguel de Icaza <miguel@novell.com>
6191 * anonymous.cs (AnonymousContainer): split the virtual Resolve
6192 method in two methods: ResolveNoDefine and Resolve.
6194 ResolveNoDefine will stop just after ResolveTopBlock has been
6197 Resolve will then continue by creating a method and issuing the
6198 call to method.Define ().
6200 (AnonymousMethod): Split and implement the new Resolve and
6201 ResolveNoDefine as well.
6203 * lambda.cs (LambdaExpression): Split the anonymous method
6204 resolution code into a separate routine (CoreCompatibilityTest)
6205 from DoCompatibleTest.
6207 (LambdaExpression.TryBuild): New method, this method tries to
6208 build the LambdaExpression with the given set of types to be used
6209 as the types for the various parameters of the lambda expression.
6211 If the compilation succeed with the given types, the infered type
6212 of the Anonymous method is returned, otherwise null is returned.
6214 2007-04-23 Marek Safar <marek.safar@gmail.com>
6216 A fix for bug #81414
6217 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6219 2007-04-22 Miguel de Icaza <miguel@novell.com>
6221 * cs-tokenizer.cs: Change various identifiers here from the
6222 camelCasing to the recommended Linux-like style for instance
6223 variables from the Coding Guidelines.
6225 2007-04-19 Martin Baulig <martin@ximian.com>
6228 (Convert.ImplicitReferenceConversionCore): Allow conversions from
6229 System.Enum to System.ValueType.
6231 2007-04-13 Martin Baulig <martin@ximian.com>
6233 Rewrote implicit reference conversions. We need to distinguish
6234 between implicit reference conversions (13.1.4) and implicit
6235 boxing conversions (13.1.5).
6237 According to the spec, there's an an implicit conversion
6238 "From a one-dimensional array-type S[] to IList<T> and base
6239 interfaces of this interface, provided there is an implicit
6240 reference conversion from S to T." Note that this does not
6241 include boxing conversions.
6244 (Convert.ImplicitTypeParameterBoxingConversion): New method.
6245 (Convert.ImplicitReferenceConversion): Split into
6246 ImplicitReferenceConversionCore() and
6247 ImplicitBoxingConversionExist().
6248 (Convert.ImplicitReferenceConversionExists): Use the new
6249 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6251 2007-04-12 Martin Baulig <martin@ximian.com>
6253 * convert.cs (Convert.ImplicitReferenceConversion): Move the
6254 `TypeManager.null_type' checks up to the top of the method.
6256 2007-04-11 Marek Safar <marek.safar@gmail.com>
6258 A fix for bug #81350
6259 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6262 2007-04-11 Martin Baulig <martin@ximian.com>
6264 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6265 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6266 to make this work for generic classes; fixes #79561.
6268 2007-04-11 Martin Baulig <martin@ximian.com>
6270 * expression.cs (As): Add support for nullable types; fixes #79371.
6272 2007-04-11 Martin Baulig <martin@ximian.com>
6274 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6275 `type.FullName' is null; fixes #80243.
6277 2007-04-11 Martin Baulig <martin@ximian.com>
6279 * expression.cs (Invocation.IsApplicable): Don't modify the method
6280 if type inference succeeded, but the method was not applicable.
6283 2007-04-10 Marek Safar <marek.safar@gmail.com>
6285 A fix for bug #81324
6286 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6287 internal and external namespaces containers.
6289 2007-04-10 Martin Baulig <martin@ximian.com>
6291 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6292 TypeManager.DropGenericMethodArguments() so we also call
6293 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
6295 2007-04-10 Martin Baulig <martin@ximian.com>
6297 * iterators.cs (Iterator.CreateIterator): Don't crash if
6298 `method.ReturnType' is null. This happens if something went wrong
6299 while resolving that typ (we already reported an error in this case).
6301 2007-04-10 Martin Baulig <martin@ximian.com>
6303 * expression.cs (New.DoResolve): Don't call CheckComImport() on
6304 generic interfaces; report the CS0144 directly.
6306 2007-04-10 Martin Baulig <martin@ximian.com>
6308 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6309 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6311 2007-04-10 Martin Baulig <martin@ximian.com>
6313 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6315 2007-04-09 Raja R Harinath <rharinath@novell.com>
6318 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6319 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6322 * statement.cs (For.Resolve): If resolution fails, use
6325 2007-04-08 Marek Safar <marek.safar@gmail.com>
6327 * anonymous.cs (MakeName): Make faster and zero-based.
6328 (VerifyExplicitParameterCompatibility): Back to mode where generic
6329 parameter is ignored.
6330 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6332 * class.cs (EmitType): Method can emit another new method.
6334 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6336 * driver.cs: Updated.
6338 * lambda.cs: Reuse predefined empty parameters.
6340 * parameter.cs: Updated
6342 * support.cs: Implemented InflateTypes.
6344 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6345 (InitSystemCore): Introduced to isolate 3.0 dependencies.
6347 2007-04-03 Martin Baulig <martin@ximian.com>
6351 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6352 version of TypeManager.IsOverride() which also works with generic
6355 2007-04-03 Martin Baulig <martin@ximian.com>
6360 (Convert.ExplicitReferenceConversion): We need to cast when
6361 converting from IList<T> to S[].
6363 2007-04-01 Marek Safar <marek.safar@gmail.com>
6365 * decl.cs (FindExtensionMethods): Consider all candidates with same name
6368 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6370 2007-03-31 Marek Safar <marek.safar@gmail.com>
6372 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6373 argument and return type inferring.
6375 * codegen.cs (InferReturnType): Flag whether return can be inferred.
6376 (ReturnType): Turned to property.
6378 * statement.cs (Return): Implemented return type inferring.
6380 * support.cs (ReflectionParameters): Use local types if possible.
6382 2007-03-30 Raja R Harinath <rharinath@novell.com>
6384 * flowanalysis.cs (FlowBranching.Reachability): Remove.
6385 (FlowBranching.UsageVector): Update to changes.
6387 Prepare to kill 'Reachability'
6388 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6389 argument of constructor.
6391 2007-03-29 Raja R Harinath <rharinath@novell.com>
6393 Prepare to kill 'Reachability'
6394 * flowanalysis.cs (UsageVector.is_unreachable): New.
6395 (UsageVector): Update to maintain 'is_unreachable' in parallel to
6396 'reachability', and verify they're consistent.
6399 * expression.cs (New.EmitStatement): Handle type parameters here too.
6401 2007-03-29 Martin Baulig <martin@ximian.com>
6406 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6407 CompilerGeneratedClass.
6408 (ScopeInfo.EmitScopeInstance): Make this protected.
6409 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6410 `ec.CurrentAnonymousMethod.Scope == Scope'.
6412 * statement.cs (Block.ScopeInfo): Make this a property.
6414 2007-03-27 Raja R Harinath <harinath@gmail.com>
6416 Prepare to kill 'Reachability'
6417 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6418 (FlowBranching.UsageVector.Reachability): Remove property.
6419 (FlowBranching.UsageVector.IsUnreachable): New property.
6420 (FlowBranching.UsageVector.ResetBarrier): New.
6421 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6422 * codegen.cs, statement.cs: Update to changes.
6424 2007-03-27 Martin Baulig <martin@ximian.com>
6429 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6432 2007-03-26 Raja R Harinath <rharinath@novell.com>
6434 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6435 instead of TriState. Remove all mention of TriState.
6437 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6438 replaced by a boolean. Add boolean 'is_unreachable' field, check
6439 and maintain invariants.
6441 2007-03-25 Marek Safar <marek.safar@gmail.com>
6443 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6445 2007-03-25 Marek Safar <marek.safar@gmail.com>
6447 * expression.cs: Stop using obsolete 2.0 opcodes.
6449 2007-03-25 Marek Safar <marek.safar@gmail.com>
6451 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6452 one of the latests Martin's fixes.
6454 2007-03-23 Miguel de Icaza <miguel@novell.com>
6456 * expression.cs: On BigEndian systems, swap the bytes, temporary
6457 solution until we get a new bitconverter class.
6459 2007-03-23 Martin Baulig <martin@ximian.com>
6463 * decl.cs (MemberCache.AddMembers): Add generic methods both as
6464 "Method" and "Method`1". Normally, a cache lookup is done on the
6465 "Method" form (ie. without the generic arity), but this one makes
6466 lookups on the full form work as well.
6468 2007-03-22 Raja R Harinath <rharinath@novell.com>
6470 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6473 2007-03-20 Bill Holmes <billholmes54@gmail.com>
6475 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6476 ordered_member_list, to TypeBuilder to store members to be defined
6477 in the order they were parsed in.
6478 - ordered_explicit_member_list contains all properties indexers
6479 and methods that are defined as explicit implementation of an
6480 interface or base class.
6481 - ordered_member_list contains all properties indexers and methods
6482 that are not defined as explicit implementation of an interface
6485 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
6486 functionality in these removed classes has been replaced with
6487 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
6488 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6490 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6491 to CheckForDuplications inside GetMethod and SetMethod Define Method
6492 to handle method property and indexer name conflicts.
6496 All code is contributed under the MIT/X11 license.
6498 2007-03-20 Martin Baulig <martin@ximian.com>
6500 * class.cs (TypeContainer.Interfaces): Removed; they're now
6501 included in `TypeContainer.Types'.
6503 2007-03-20 Martin Baulig <martin@ximian.com>
6505 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
6507 * class.cs (TypeContainer.CreateType): New public method. This is
6508 now called before DefineType() to create the TypeBuilders.
6509 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6510 has already been created by CreateType().
6511 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6512 don't resolve our base classes here; this has been moved into
6513 DefineBaseTypes(). We're now called from CreateType().
6514 (TypeContainer.DefineBaseTypes): New private method; resolve our
6515 base classes here. We're now called from DefineType().
6518 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6519 our types first to create all the TypeBuilders. After that, call
6520 TypeContainer.DefineType() on all the types which'll resolve their
6521 base classes and setup the resolve order.
6523 2007-03-20 Martin Baulig <martin@ximian.com>
6525 * class.cs (TypeContainer.Enums): Removed; they're now included in
6526 `TypeContainer.Types'.
6528 2007-03-20 Martin Baulig <martin@ximian.com>
6531 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6532 (TypeContainer.DoResolveMembers): Call DefineType() on our
6533 `compiler_generated' classes; moved here from DefineNestedTypes().
6536 (RootContext.ResolveTree): Call ResolveMembers() on all
6537 TypeContainer's in the `type_container_resolve_order'.
6539 2007-03-19 Marek Safar <marek.safar@gmail.com>
6541 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6543 2007-03-17 Marek Safar <marek.safar@gmail.com>
6545 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6546 implementation flags.
6548 2007-03-17 Marek Safar <marek.safar@gmail.com>
6550 * class.cs: More optimizations for type parameters.
6552 2007-03-15 Marek Safar <marek.safar@gmail.com>
6554 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6556 * ecore.cs, parameter.cs: More common code for both corlibs.
6558 * typemanager.cs (IsGenericMethod): Simplified.
6560 2007-03-15 Raja R Harinath <rharinath@novell.com>
6562 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6564 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6566 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6567 unconditionally. Simplify explanation.
6568 (Try.Resolve, Using.Resolve): Likewise.
6570 2007-03-15 Martin Baulig <martin@ximian.com>
6574 * decl.cs (DeclSpace): If we're a partial class, use our
6575 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6577 2007-03-15 Raja R Harinath <rharinath@novell.com>
6579 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6581 (FlowBranching.UsageVector): Update to changes.
6582 (FlowBranching.MergeSiblings): Likewise.
6583 * statement.cs: Likewise.
6585 2007-03-15 Martin Baulig <martin@ximian.com>
6590 (MemberCache): Added a special .ctor for type parameters.
6593 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6596 2007-03-09 Martin Baulig <martin@ximian.com>
6598 * enum.cs (Enum): Make this a TypeContainer.
6599 (EnumMember): Derive from `Const'.
6602 (Const.DoResolveValue): New protected virtual method; move most of
6603 the functionality of ResolveValue() here so we can override it in
6605 (Const.CreateConstantReference): Make this virtual.
6607 * class.cs (Kind): Add `Kind.Enum'.
6608 (TypeContainer.Emit): Don't emit the enums here; they're already
6609 in the `RootContext.typecontainer_resolve_order'.
6611 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6612 here; they're already in the `typecontainer_resolve_order'.
6614 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6615 TypeManager.DropGenericTypeArguments().
6618 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6619 (TypeManager.IsEnumType): Likewise.
6620 (TypeManager.EnumToUnderlying): Likewise.
6621 (TypeManager.IsEqual): Add support for enums.
6623 2007-03-12 Raja R Harinath <rharinath@novell.com>
6625 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6626 DefaultParameterValueAttribute to be undefined, say if System.dll
6629 2007-03-11 Marek Safar <marek.safar@gmail.com>
6631 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6634 2007-03-10 Marek Safar <marek.safar@gmail.com>
6636 * class.cs, parameter.cs: Unified parameters verification.
6638 2007-03-08 Martin Baulig <martin@ximian.com>
6640 * cs-parser.jay (constructor_header): Pass the location to the
6641 newly created TopLevelBlock.
6643 2007-03-07 Martin Baulig <martin@ximian.com>
6645 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6647 2007-03-06 Miguel de Icaza <miguel@novell.com>
6649 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6650 with the changes from David, fixes the build.
6652 2007-03-05 David Mitchell <dmitchell@logos.com>
6654 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6655 and its base interfaces to a one-dimensional array type S[],
6656 provided there is an implicit or explicit reference conversion
6659 2007-03-03 Marek Safar <marek.safar@gmail.com>
6661 * cs-tokenizer.cs: Implemented basic linq grammar.
6663 * driver.cs: Set linq lang version on demand.
6665 2007-02-26 Marek Safar <marek.safar@gmail.com>
6667 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6669 2007-02-25 Marek Safar <marek.safar@gmail.com>
6671 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6674 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6676 Check property and event extern attributes.
6678 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6681 2007-02-24 Marek Safar <marek.safar@gmail.com>
6683 A fix for bug #80407
6684 * ecore.cs: Don't report ambiguity error when methods have same parent.
6686 2007-02-23 Marek Safar <marek.safar@gmail.com>
6688 A fix for bug #80878
6689 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6691 2007-02-22 Marek Safar <marek.safar@gmail.com>
6693 * attribute.cs: Enable ExtensionAttribute presence test.
6695 2007-02-22 Marek Safar <marek.safar@gmail.com>
6697 * class.cs: Warn about missing GetHashCode only when Equals is override.
6699 * decl.cs: Check accessibility of type arguments.
6701 * typemanager.cs: Correctly report nullable array.
6703 2007-02-20 Marek Safar <marek.safar@gmail.com>
6705 * class.cs, report.cs: Capture more details when things go wrong.
6707 2007-02-20 Marek Safar <marek.safar@gmail.com>
6709 A fix for bug #80650
6710 * cs-parser.jay: Anonymous container starts at constructor declaration
6711 and not at block beginning because it has to be usable in constructor
6714 * statement.cs: Use context location and not block one for error reporting.
6716 2007-02-18 Marek Safar <marek.safar@gmail.com>
6718 A fix for bug #78712
6719 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6722 2007-02-18 Marek Safar <marek.safar@gmail.com>
6724 A fix for bug #80493 by Atsushi Enomoto
6725 * cs-parser.jay: Ignore invalid attribute target.
6727 2007-02-18 Marek Safar <marek.safar@gmail.com>
6729 * cs-tokenizer.cs: Ignore '\0' as white space character.
6731 2007-02-17 Miguel de Icaza <miguel@novell.com>
6733 * cs-parser.jay: Add support for lambda expressions to the mcs
6736 * lambda.cs: Only clone when we are probing, not on the final call
6737 (Compatible is the final call).
6739 * statement.cs (CloneContext): Introduce class to provide block
6740 remapping during clone.
6742 All statements Clone themselves now.
6744 (Clone): special handling for blocks, when we clone a block, we
6745 register the block inside this routine, as children of the block
6746 might trigger a lookup.
6748 * expression.cs: Add support for CloneContext in all expressions.
6750 2007-02-17 Marek Safar <marek.safar@gmail.com>
6752 A fix for bug #80493
6753 * statement.cs: Report ambiguous warning when interfaces are not related.
6755 2007-02-15 Marek Safar <marek.safar@gmail.com>
6757 C# 3.0 extension methods.
6759 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6760 cannot be used directly.
6762 * class.cs (Class.Emit): Emit extension attribute if any class method
6763 is extension method.
6764 (Method.Define): Add basic extension method validation conditions.
6765 (Method.Emit): Emit extension attribute for method.
6767 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6768 extension method exists. Currently we follow same approach as Microsoft
6769 does, emit even if a method or a class are private but this can change
6772 * cs-parser.jay: Add handling of `this' keyword in method parameters
6775 * decl.cs (DeclSpace.IsStaticClass): New property.
6776 (MemberCache.FindExtensionMethods): Looks for extension methods with
6777 defined name and extension type.
6779 * doc.cs: Updated after OverloadResolve changes.
6781 * driver.cs: Add new soft reference to System.Core.dll.
6783 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6784 (ExtensionMethodGroupExpr): Represents group of extension methods.
6786 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6787 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6788 to MethodGroupExpr and made non-static for easier customization.
6789 (Invocation.DoResolve): Add extension method lookup when no standard
6791 (MemberAccess.DoResolve): Try extension methods if no member exists.
6793 * modifiers.cs: Add METHOD_EXTENSION modifier.
6795 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6796 as well as candidate extension type.
6797 (ComputeNamespaces): When assembly constains extension methods registers
6799 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6800 extension method lookup.
6801 (Namespace.LookupExtensionMethod): Looks for extension method in this
6803 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6804 find a method which matches name and extensionType.
6806 * parameter.cs (Parameter): Add This modifer.
6807 (HasExtensionMethodModifier): New property.
6808 (Resolve): Add extension parameter check.
6809 (ModFlags): turned to property to exclude this modifier as it is not real
6811 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6813 * support.cs (ParameterData): Add ExtensionMethodType.
6814 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6816 * typemanager.cs: Add type and ctor extension attribute type.
6818 2007-02-15 Miguel de Icaza <miguel@novell.com>
6820 * report.cs (DisableErrors, EnableErrors): used to prevent error
6821 output when we are "trying" to compile various methods with
6824 * ecore.cs (Expression): Add Clone method that calls the virtual
6825 CloneTo method. The current CloneTo method in Expression throws
6826 an exception so we can track down all the places where this must
6827 be implemented (not using abstract, because that would be a lot of
6828 up-front-work before we can start testing the implementation
6831 Important: we only need Clone capabilities for expressions created
6832 by the parser, as the expressions we will be cloning are
6833 expressions in the pre-resolved state. This vastly simplifies
6836 (SimpleName): Add CloneTo that does nothing.
6837 (EmptyCast): Add CloneTo.
6839 * expression.cs (Binary): Implement CloneTo.
6840 (Invocation.IsApplicable): Store the current ec in
6841 EmitContext.TempEc and restore it on return. This is used so we
6842 do not have to sprinkle hundres of methods with an extra
6843 EmitContext, we know that the only user is the lambda expression
6844 ImplicitConversionExists code.
6846 (Argument): Add Cloning capabilities.
6847 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6848 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6849 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6850 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6851 IndexerAccess): Add Clone capability.
6853 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6855 (Argument): Add cloning capability.
6857 * assign.cs (Assign): Implement CloneTo.
6859 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6861 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6862 version by calling Convert with the EmitContext (that we are
6863 currently storing in ec, this is not great, but will do for now,
6864 to avoid passing EmitContext parameters to hundreds of functions
6865 that do not need them now).
6867 (SetExpression): Remove, it is not needed.
6869 (ContextualReturn): Implement CloneTo.
6871 * statement.cs (Statement): Implement cloning infrastructure,
6872 similar to expressions.
6874 (Block): Partial implementation of Clone for statements.
6876 (Return): Implement clone.
6878 * constant.cs (Constant.CloneTo): New method, does nothing.
6880 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6881 solution, until we decide how to exactly do this.
6883 2007-02-14 Marek Safar <marek.safar@gmail.com>
6885 A fix for bug #80493
6886 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6887 a property is override we need to use second accessor.
6889 2007-02-13 Marek Safar <marek.safar@gmail.com>
6891 A fix for bug #80418
6892 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6895 2007-02-13 Marek Safar <marek.safar@gmail.com>
6897 Another fix for bug #80749
6898 * pending.cs: Abstract class has priority over interfaces.
6900 2007-02-13 Marek Safar <marek.safar@gmail.com>
6902 Another fix for bug #80749
6903 * pending.cs: Abstract class has priority over interfaces.
6905 2007-02-13 Marek Safar <marek.safar@gmail.com>
6907 Another fix for bug #80749
6908 * pending.cs: Abstract class has priority over interfaces.
6910 2007-02-13 Marek Safar <marek.safar@gmail.com>
6912 Another fix for bug #80749
6913 * pending.cs: Abstract class has priority over interfaces.
6915 2007-02-13 Marek Safar <marek.safar@gmail.com>
6917 * class.cs Better error message.
6919 * driver.cs: Add shorter versions of -optimize option.
6921 2007-02-13 Martin Baulig <martin@ximian.com>
6923 * class.cs (Constructor.Emit): Check the return value of
6924 ec.ResolveTopBlock() and return on error.
6926 2007-02-13 Raja R Harinath <rharinath@novell.com>
6928 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6929 message to fix error message regression.
6931 2007-02-12 Marek Safar <marek.safar@gmail.com>
6933 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6935 2007-02-12 Marek Safar <marek.safar@gmail.com>
6937 A fix for bug #80749
6938 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6939 its parent container.
6941 * class.cs (DefineFieldInitializers): Each initializer can has different
6944 * const.cs: Updated.
6946 2007-02-11 Miguel de Icaza <miguel@novell.com>
6948 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6949 now all the heavy lifting to check that embedded statements or
6950 expressions have the right form is done in the ContextualReturn.
6952 (ContextualReturn): New class.
6954 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6955 method that can be invoked to report 201, so we do not replicate
6958 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6960 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6961 treating tabs as spaces.
6963 2007-02-09 Marek Safar <marek.safar@gmail.com>
6965 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6966 * assign.cs: Use full implicit conversion for right side check.
6968 2007-02-09 Marek Safar <marek.safar@gmail.com>
6970 * statement.cs (Switch): Switch over boolean type is not standardized.
6972 2007-02-08 Marek Safar <marek.safar@gmail.com>
6974 A fix for bug #80755
6975 * decl.cs (FindBaseEvent): Don't use method cache for events.
6977 2007-02-07 Marek Safar <marek.safar@gmail.com>
6979 * cs-parser.jay: Better syntax error handling.
6981 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6982 instead of underlying type value.
6984 2007-02-06 Marek Safar <marek.safar@gmail.com>
6986 * driver.cs: Check define identifier before is registered.
6988 * namespace.cs: Use existing error message.
6990 * report.cs: New warning.
6992 2007-02-06 Marek Safar <marek.safar@gmail.com>
6994 A fix for bug #80742
6995 * expression.cs: Delegate Invoke method can be called directly.
6997 2007-02-06 Marek Safar <marek.safar@gmail.com>
6999 A fix for bug #80676
7000 * class.cs (IsEntryPoint): The Main method can have params modifier.
7002 2007-02-04 Miguel de Icaza <miguel@novell.com>
7004 * parameter.cs (Parameter, Parameters): Add Clone method.
7006 * anonymous.cs (Compatible): Turn method into virtual method, so
7007 LambdaExpression can implement a different behavior.
7009 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7010 out the basic checking here, so it can be used by
7013 * lambda.cs: Introduce "Compatible" function that will do the
7016 2007-02-02 Marek Safar <marek.safar@gmail.com>
7018 * attribute.cs: Unified one error message.
7020 * class.cs (Class): Use type attributes and not properties to test static
7022 (IsEntryPoint): Don's pass local variable.
7024 * convert.cs: Removed duplicate check.
7026 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7028 * driver.cs: Don't crash when soft reference does not exist.
7030 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7031 (UsingEntry): Removed redundant allocation.
7033 * parameter.cs: Add fast path for type parameters.
7035 * support.cs: Don't allocate attribute when it's not used.
7037 2007-01-30 Miguel de Icaza <miguel@novell.com>
7040 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7041 this into a virtual method, so we can override it in LambdaExpression.
7043 * driver.cs: Improve diagnostics in case of failure.
7045 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7046 write a function that is slightly more complex and that parses:
7048 type identifier [, type identifier]* )
7050 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7053 (canEmpty ? i >= 0 : i > 0)
7055 2007-01-30 Raja R Harinath <rharinath@novell.com>
7057 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7058 exception on possibly valid code.
7060 2007-01-29 Raja R Harinath <rharinath@novell.com>
7062 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7064 (parse_opt_type_arguments): Remove. It's almost the same as
7066 (parse_namespace_or_typename): Use parse_less_than.
7068 2007-01-28 Miguel de Icaza <miguel@novell.com>
7070 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7071 this bug took a few hours to find, because the state saved and
7072 restored by PushPosition and PopPosition was ignoring the state of
7073 parse_generic_less_than.
7075 I can also now remove the handling of OP_LT and OP_GT, this solves
7078 * cs-tokenizer.cs: store the location for the ARROW token, we use
7081 (PushPosition, PopPosition): save/restore also `current_token',
7082 restore `parse_generic_less_than' (was missing).
7084 (parse_opt_type_arguments): use parse_type, not
7085 parse_namespace_or_typename to parse types.
7087 * lambda.cs: Empty new file, will eventually have the lambda
7088 expression implementation.
7090 * lambda.test: used to test the internal tokenizer.
7092 * report.cs (FeatureIsNotISO1): Rename from
7093 FeatureIsNotStandardized, because it was about the language level
7094 (1 vs 2) it was not about standarization.
7096 (FeatureRequiresLINQ): New.
7098 * support.cs (SeekableStreamReader): Only require that the reader
7099 is a TextReader, not a StreamReader, so we can plug StringReader.
7101 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7102 given position in the input stream the following tokens can be
7103 parsed as a type followed by an identifier.
7105 (is_punct): after a '(' if parse_type_and_parameter returns true,
7106 then return a special token OPEN_PARENS_LAMBDA which is used to
7107 avoid reduce/reduce errors in the grammar for the
7108 lambda_expression rules.
7110 (parse_type): implement a type parser inside the
7111 tokenizer, the parser only returns true or false depending on
7112 whether the input at a given position can be parsed as a type.
7114 (peek_token): new method used during type parsing.
7116 2007-01-28 Raja R Harinath <rharinath@novell.com>
7119 * anonymous.cs (ScopeInfo.InflateParameters): New.
7120 (AnonymousContainer.Resolve): Use it to redirect types of
7121 delegate parameters.
7123 2007-01-27 Raja R Harinath <rharinath@novell.com>
7126 * expression.cs (Error_InvalidArguments): Don't use two different
7127 messages for CS1503. Use ExtraInformation and
7128 SymbolRelatedToPreviousError instead.
7131 * decl.cs (DeclSpace.initialize_type_params): Don't access
7132 'type_params' of a partial class directly.
7134 2007-01-26 Miguel de Icaza <miguel@novell.com>
7136 * constant.cs: Removed a handful of out-of-range checks that were
7139 2007-01-25 Marek Safar <marek.safar@gmail.com>
7141 * expression.cs (CheckUselessComparison): Add additional check for char
7144 * namespace.cs: Fixed typo.
7146 2007-01-23 Miguel de Icaza <miguel@novell.com>
7148 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7149 gone, instead we inline the test, preventing the needless casts to
7150 longs, ulongs and doubles for the parameters, avoiding calls to
7151 methods that overchecked stuff, and instead inlined things
7154 2007-01-20 Marek Safar <marek.safar@gmail.com>
7156 * cs-parser.jay: Better parameter error handling.
7158 2007-01-17 Marek Safar <marek.safar@gmail.com>
7160 A fix for bug #80368, #80522
7161 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7162 whether array initializer contains constants only.
7163 (ArrayCreation.Emit): Use better formula to decide when
7164 are array initializers for static initialization.
7165 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7166 have to emit even constants otherwise they are pre-initialized.
7168 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
7169 Raja R Harinath <rharinath@novell.com>
7171 Fix emit order of 'get' vs. 'set'.
7172 * support.cs (Accessors): New.
7173 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7174 Note the order in which accessors are declared in the source.
7175 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7176 Refactored from Property.Define and Indexer.Define.
7177 (PropertyBase.DefineAccessors): New helper that calls the above in
7178 appropriate order as noted by the parser.
7179 (Property.Define, Indexer.Define): Update to changes.
7180 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7182 2007-01-17 Raja R Harinath <rharinath@novell.com>
7184 Fix cs0029-6.cs and gcs0029-2.cs (regression)
7185 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7186 there's an implicit conversion from the current type to the target
7187 type before converting the underlying constant.
7189 2007-01-16 Marek Safar <marek.safar@gmail.com>
7191 * const.cs (ResolveValue): Updated after constant conversion was made more
7194 * constant.cs (GetAttributableValue): constant to object conversion is
7195 used for attributes only.
7196 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7197 constant conversions.
7198 (LongConstant.ConvertImplicitly): Ditto.
7200 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7201 (ImplicitConversionStandard): Handle constant conversion as extra step.
7202 It solves the issue when constant conversion was called indirectly like
7203 inside array initializer and constant folding was skipped.
7205 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7208 * statement.cs(ImplicitConversionStandard): Updated after constant
7209 conversion was made more generic.
7211 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
7213 * expression.cs (As.DoResolve): Use GenericConstraints instead of
7214 Constraints, solves the problem where the compiler incorrectly
7215 reported that a type parameter was not constrained to a class (Bug
7218 2007-01-14 Marek Habersack <grendello@gmail.com>
7220 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7222 2007-01-14 Marek Safar <marek.safar@gmail.com>
7224 A fix for bug #80368
7225 * assign.cs (FieldInitializer): New class implements field
7226 initializer statement.
7228 * attribute.cs: Update after FieldMember rename.
7230 * class.cs (PropertyBasedMember): New common class for property based
7232 (InterfaceMemberBase): New base class for all members which can be used as
7233 an interface members.
7234 (MethodCore): Moved really common code to InterfaceMemberBase.
7235 (Method.Define): Equal and GetHasCode detection is relevant for methods
7237 (MethodData.Define): Don't assume that public event implements an
7238 interface automatically.
7239 (MethodData.DefineMethodBuilder): Issue an error even if only extern
7241 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7242 (FieldMember): Merged with FieldBase.
7243 (EventProperty.AEventPropertyAccessor): New specialization to check whether
7244 event extern modifier can be used.
7245 (EventField.EventFieldAccessor): Moved event field specific code here.
7246 (Event.AllowedModifiers): Even event can be extern.
7247 (Event.FindOutBaseMethod): New override specific to events.
7248 (Indexer.parameters): Reintroduce parameters because base class holds
7249 only properties common data.
7250 (Indexer.CheckForDuplications): Indexers are threated as methods so we
7251 need do extra parameters check.
7253 * const.cs: Update after FieldMember rename.
7255 * decl.cs (MemberCache.FindBaseEvent): New method.
7257 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7258 to reflect that indexer is now derived from PropertyBased.
7260 * ecore.cs (GetMemberType): Made public.
7261 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7264 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7266 * typemanager.cs (CSharpSignature): Correctly print event accessors.
7267 (RegisterEvent): Removed.
7268 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7269 (GetPrivateFieldOfEvent): Renamed to GetEventField.
7271 2007-01-11 Raja R Harinath <rharinath@novell.com>
7274 * statement.cs (CollectionForeach.TryType): Prefer generic
7275 GetEnumerator over non-generic variant. Fix code to follow comments.
7277 2007-01-09 Raja R Harinath <rharinath@novell.com>
7280 * support.cs (ReflectionParameter): Don't use an invalid index on
7281 the generic parameter data.
7283 2007-01-08 Miguel de Icaza <miguel@novell.com>
7285 * driver.cs: Just add a tiny bit of infrastructure.
7287 2007-01-02 Marek Safar <marek.safar@gmail.com>
7289 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7290 where field type is struct from current assembly.
7292 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7295 2007-01-02 Marek Safar <marek.safar@gmail.com>
7297 A fix for bug #80381
7298 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7301 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7303 (Namespace.LookupType): Always use core types from corlib when speficied.
7305 * report.cs: A new warning.
7307 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7308 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7309 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7311 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7312 (InitCoreTypes): Set expression type of object_type and value_type
7313 immediately after lookup.
7315 2007-01-01 Miguel de Icaza <miguel@novell.com>
7317 * cs-tokenizer.cs: Accept Pc class characters (Connector
7318 Punctuation) as valid identifiers. Fixes #78259
7320 * expression.cs (Invocation.DoResolve): Moved the check for the
7321 use of `this' for doing method calls to the Invocation resolution
7322 step, after overload resolution has taken place instead of doing
7323 the check at the low-level `This.DoResolve' level.
7325 The `This.DoResolve'(appens before overload resolution, so it has
7326 no way of knowing if the method that will be called will be
7327 instace or static, triggering an erroneous report for cs0188 (Bug
7330 We now do the check for instance method invocations after we know
7331 what method will be called.
7333 (This.CheckThisUsage): Move the actual use of this structure
7334 checking into its own method and expose it.
7336 * Everywhere that called Error_ValueCannotBeConverted: pass a new
7339 Exceptions: Null.ConvertImplicitly,
7340 Constant.ImplicitConversionRequired as there are too many call
7341 sites for passing the ec.
7343 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7344 EmitContext, if the value is null, then we do not try to provide
7345 the extra information from the error (If a userdefined conversion
7346 exists, as UserDefinedConversion requires a non null-EmitContext).
7350 2006-12-30 Raja R Harinath <rharinath@novell.com>
7352 * flowanalysis.cs (MyBitVector): Document some invariants.
7353 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7354 introduced below, and add a couple of others,
7356 2006-12-30 Marek Safar <marek.safar@gmail.com>
7358 * attribute.cs (GetMethodObsoleteAttribute): Uses new
7359 GetPropertyFromAccessor and GetEventFromAccessor.
7361 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7362 overrides non-obsolete one.
7363 (Indexer.Define): Error message has been moved to the parser.
7365 * cs-parser.jay: Better syntax errors handling.
7367 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7368 when an invocation has no arguments.
7370 * ecore.cs: Removed not used caching.
7372 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7375 * report.cs: Add a new warning.
7377 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7379 * typemanager.cs (enumeration_type): Removed.
7380 (CSharpSignature): Reuses IsSpecialMethod.
7381 (IsEqual): Hack for MS BCL.
7382 (GetPropertyFromAccessor): New method.
7383 (GetEventFromAccessor): New method.
7384 (IsSpecialMethod): Fixed to handle more cases.
7386 2006-12-30 Marek Safar <marek.safar@gmail.com>
7388 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7389 Made white spaces array static.
7391 * ecore.cs (RemoveGenericArity): Optimized.
7393 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7395 (MyBitVector.initialize_vector): Simplified.
7397 2006-12-22 Miguel de Icaza <miguel@novell.com>
7399 * ecore.cs: Am not entirely happy with this hack, but it seems to
7400 address the issue in 80257 (a small test case for
7403 I set the MethodGroupExpr.Type to an internal compiler type
7404 (itself in this case) to force the resolution to take place. Why
7405 it does not take place with a null is beyond me.
7407 2006-12-20 Marek Safar <marek.safar@gmail.com>
7409 A fix for bug #80288
7410 * expression.cs (ResolveOperator): Consider user defined conversion for
7411 logical and operator too.
7412 (EmitBranchable): Optimization for logical and when full constant folding
7413 could not be applied but one operand is constant.
7415 2006-12-19 Marek Safar <marek.safar@gmail.com>
7417 * class.cs (GetClassBases): Write 5 times every day, will never use
7418 FullName for error reporting.
7420 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7422 2006-12-19 Martin Baulig <martin@ximian.com>
7424 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7425 the symbol file info here.
7427 2006-12-18 Marek Safar <marek.safar@gmail.com>
7429 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7430 of `elseif' is taking then following sections are not taking.
7431 Fixes an issue reported on mono mailing list.
7433 2006-12-18 Marek Safar <marek.safar@gmail.com>
7435 A fix for bug #80300
7436 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7437 a caller is not taking.
7439 2006-12-18 Raja R Harinath <rharinath@novell.com>
7441 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7442 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7443 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7444 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7445 * class.cs: Update to changes.
7447 2006-12-17 Marek Safar <marek.safar@gmail.com>
7449 A fix for bug #79934
7450 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7453 * class.cs (ResolveMembers): Register an iterator in current container and
7456 2006-12-16 Raja R Harinath <rharinath@novell.com>
7459 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7460 satisfy a params annotated parameter.
7462 2006-12-16 Marek Safar <marek.safar@gmail.com>
7464 A fix for bug #77014
7465 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7466 paramters correctly and not rely on hacks in Parameters class.
7467 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7469 (Invocation.VerifyArgumentsCompat): Ditto.
7470 (Invocation.EmitArguments): Changed to correctly emit params arguments at
7473 * parameter.cs (HasParams): Don't assume that params is the last one.
7475 * support.cs (ReflectionParameters.ctor): Look for params attribute
7477 (ReflectionParameters.ParameterType): Removed hack when we returned last
7478 parameter for out of range parameters.
7479 (ParameterName, ParameterModifier): Ditto.
7481 2006-12-14 Marek Safar <marek.safar@gmail.com>
7483 A fix for bug #79987
7484 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7485 when assembly is not CLS compliant but type is. I have no idea why is this
7488 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7490 2006-12-13 Miguel de Icaza <miguel@novell.com>
7492 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7493 in struct constructors, they are basically no-ops.
7495 2006-12-12 Marek Safar <marek.safar@gmail.com>
7497 * cs-tokenizer.cs (Position): Save preprocessor status too.
7499 2006-12-12 Marek Safar <marek.safar@gmail.com>
7501 A fix for bug #77794
7502 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7504 2006-12-12 Marek Safar <marek.safar@gmail.com>
7506 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7508 (pp_expr): Report error for an invalid expression.
7509 (handle_preprocessing_directive): Simplified; add more error checking.
7511 2006-12-11 Marek Safar <marek.safar@gmail.com>
7513 A fix for bug #74939
7514 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7515 directives handling.
7517 2006-12-10 Marek Safar <marek.safar@gmail.com>
7519 A fix for bugs #80093, and #75984
7520 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7521 logic, it seems to me as it worked before "by coincidence".
7522 (xtoken): Simplified to use reworked handle_preprocessing_directive.
7523 (cleanup): Enabled endif check.
7525 2006-12-09 Marek Safar <marek.safar@gmail.com>
7527 A fix for bug #80162
7528 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7529 enumerators are never ambiguous.
7531 2006-12-08 Raja R Harinath <rharinath@novell.com>
7534 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7536 2006-12-06 Marek Safar <marek.safar@gmail.com>
7538 A fix for bug #80144
7539 * class.cs (EventProperty.Define): Explicit implementation means
7540 that an even is used.
7542 2006-12-06 Marek Safar <marek.safar@gmail.com>
7544 Fixes the operators implementation (part II)
7546 * cfold.cs (DoConstantNumericPromotions): Renamed to
7547 DoBinaryNumericPromotions and simplified.
7548 (BinaryFold): Couple of conversion fixes; simplified.
7550 * constant.cs, ecore.cs, literal.cs
7551 (ToType): Renamed to ConvertImplicitly.
7552 (Reduce): Renamed to ConvertExplicitly.
7554 * class.cs, convert.cs: Updated.
7556 * expression.cs: TryReduce doesn't throw an exception.
7558 2006-12-01 Marek Safar <marek.safar@gmail.com>
7560 A fix for bug #80108
7561 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7564 2006-11-30 Marek Safar <marek.safar@gmail.com>
7566 Fixes unary operators implementation (part I)
7569 * cfold.cs (Error_CompileTimeOverflow): Made internal
7571 * const.cs (IConstant): Changed to use reference to constant and
7572 not constant itself.
7573 Updated IConstant implementations.
7575 * constant.cs (CreateConstant): New factory method.
7576 Updated IConstant implementation.
7578 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7580 * ecore.cs: Updated to use CreateConstantReference.
7582 * enum.cs: Reflects IConstant changes.
7584 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7586 * literal.cs (NullConstant): Change to be independently usable.
7588 2006-11-29 Martin Baulig <martin@ximian.com>
7590 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7591 we need to emit the scope initializer before calling the base .ctor.
7593 * anonymous.cs: Merged back from the new anonymous methods branch.
7594 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7596 * expression.cs (ParameterReference.DoResolveBase): Create a
7597 "normal" ScopeInfo when capturing parameters rather than using the
7598 root scope; this makes things work with anonymous methods having
7602 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7604 2006-11-22 Marek Safar <marek.safar@gmail.com>
7606 A fix for bug #79987
7607 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7608 check to a base class.
7609 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7610 only when assembly has missing attribute.
7611 * report.cs: Update.
7613 2006-11-21 Marek Safar <marek.safar@gmail.com>
7615 * cs-tokenizer.cs: Merged with gmcs version.
7617 2006-11-20 Marek Safar <marek.safar@gmail.com>
7620 * cs-parser.jay: Better error message when partial keyword is misplaced.
7622 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7624 A fix for bug #79810
7625 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7626 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7627 a RuntimeWrappedException by default.
7629 2006-11-18 Marek Safar <marek.safar@gmail.com>
7631 A fix for bug #79843
7632 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7634 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7636 2006-11-18 Marek Safar <marek.safar@gmail.com>
7638 * driver.cs, namespace.cs: Uses faster IndexOf version.
7640 2006-11-17 Marek Safar <marek.safar@gmail.com>
7642 A fix for bug #79941
7643 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7645 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7646 even if internal name is different.
7647 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7648 (UserDefinedConversion): Simplified as the operators cannot be internal.
7649 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7651 (MethodLookup): Replaced EmitContext with parentType.
7652 * expression.cs: Updated.
7654 2006-11-09 Raja R Harinath <rharinath@novell.com>
7656 * driver.cs (BadAssembly): Handle all the ugliness of
7657 DefineDynamicAssembly.
7659 2006-11-08 Raja R Harinath <rharinath@novell.com>
7661 Address parts of #58244 -- most of what's left is in the runtime
7662 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7663 CS1509 error checks, and handle them for all assembly loads, not
7664 just the first invocation.
7665 (LoadModule): Likewise. Move handling of 'adder_method' ...
7666 * codegen.cs (AssemblyClass.AddModule): ... here.
7668 2006-11-02 Marek Safar <marek.safar@gmail.com>
7670 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7671 IEnumerable<T> is ambiguous.
7673 2006-10-31 Marek Safar <marek.safar@gmail.com>
7675 A fix for bug #67689
7676 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7677 GetEnumerator is ambiguous.
7679 * report.cs: Add new warning.
7681 2006-10-29 Marek Safar <marek.safar@gmail.com>
7683 A fix for bug #78602
7684 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7685 to protected member can be nested type.
7687 2006-10-28 Marek Safar <marek.safar@gmail.com>
7689 A fix for bug #78965
7690 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7691 to protected member must derive from current type.
7693 2006-10-27 Marek Safar <marek.safar@gmail.com>
7695 assign.cs: Reuses error method.
7697 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7698 instead of type for constants.
7699 (Expression.Error_ValueAssignment): Common error method.
7701 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7704 2006-10-27 Marek Safar <marek.safar@gmail.com>
7706 A fix for bug #79081
7707 * expression.cs (MemberAccess.DoResolve): Check nested type
7710 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7712 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7714 2006-10-26 Marek Safar <marek.safar@gmail.com>
7716 A fix for bug #76591
7717 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7719 2006-10-26 Marek Safar <marek.safar@gmail.com>
7721 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7722 type forwarder of the same type multiple times.
7724 2006-10-26 Raja R Harinath <rharinath@novell.com>
7727 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7728 instance as an rvalue, even when we later resolve as an lvalue.
7730 2006-10-25 Martin Baulig <martin@ximian.com>
7732 * anonymous.cs: Fix #79673.
7734 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7736 A fix for bug #79666
7737 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7738 ignored when is optimized (= default value) as its value is already set.
7740 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7742 A fix for bug #79724
7743 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7744 TypeContainer for type lookup.
7746 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7748 A fix for bug #79231
7749 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7750 * expression.cs (OverloadResolve): Always convert type name for
7752 (ResolveNamespaceOrType): Don't confuse a nested type with any
7755 2006-10-18 Martin Baulig <martin@ximian.com>
7757 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7759 2006-10-17 Miguel de Icaza <miguel@novell.com>
7761 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7762 an int32, but requesting an int64 from the conversion
7764 2006-10-12 Martin Baulig <martin@ximian.com>
7767 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7769 2006-10-12 Martin Baulig <martin@ximian.com>
7772 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7774 2006-10-11 Miguel de Icaza <miguel@novell.com>
7776 * convert.cs: Remove broken code: I was doing the "Existance"
7777 tests for Implicit conversions.
7779 2006-10-10 Miguel de Icaza <miguel@novell.com>
7781 * convert.cs: Added one missing case in
7782 ImplicitStandardConversionExists uint64 to intptr.
7786 * typemanager.cs (uintptr_type): another core known type.
7788 * ecore.cs (OperatorCast): routine used to do cast operations that
7789 depend on op_Explicit. We could change some of the Decimal
7790 conversions to use this.
7792 This one has a probe mechanism that checks both types for an op_
7793 which it coudl be used to eliminate two classes: CastToDecimal
7794 and CastFromDecimal.
7796 * convert.cs: Implement the conversions documented in #59800
7798 2006-10-10 Martin Baulig <martin@ximian.com>
7800 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7801 before RootScope.ResolveMembers().
7803 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7804 `CurrentType' if appropriate.
7806 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7808 A fix for bug #78568
7809 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7810 when contains binary operators.
7811 * cs-parser.jay: Updated.
7813 2006-10-09 Martin Baulig <martin@ximian.com>
7816 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7817 moved that into Define() and also do the other type parameter
7818 checks there. Fixes #79094. Added gtest-292.cs.
7821 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7822 since that doesn't include type parameters; don't use `Ldelema'
7823 for type parameters. Fixes #78980. Added gtest-293.cs.
7825 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7828 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7829 conversion is allowed.
7831 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7833 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7834 error reporting when no error occurs.
7836 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7838 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7841 2006-10-06 Raja R Harinath <rharinath@novell.com>
7844 * class.cs (DefineTypeBuilder): Check circular dependencies before
7845 setting the parent of the TypeBuilder.
7846 (CheckRecursiveDefinition): Don't use 'BaseType', since
7847 it may not be valid until after DefineTypeBuilder. Use
7848 'base_type' instead.
7850 2006-10-04 Martin Baulig <martin@ximian.com>
7852 Merged the Anonymous Methods patch.
7854 * anonymous.cs, iterators.cs: The new anonymous methods code.
7856 * statement.cs (Variable): New public abstract class.
7857 (LocalInfo.Variable): New public property.
7858 (LocalInfo.ResolveVariable): New public method.
7859 (Block.Flags): Add `IsIterator'.
7860 (Block.AddVariable): Improved the CS0136 check.
7861 (Block.AnonymousChildren): New public property.
7862 (Block.AddAnonymousChild): New public method.
7863 (ToplevelBlock): Update to use the new anonymous method framework.
7864 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7865 `ToplevelBlock'; this is required to correctly implement the
7867 (Fixed, Using): Use `TemporaryVariable' instead of directly
7868 creating the `LocalBuilder'.
7870 * parameter.cs (Parameter.ResolveVariable): New public method.
7871 (Parameters.ResolveVariable): Likewise.
7873 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7875 * class.cs (TypeContainer): Replaced the `iterators' list and
7876 corresponding methods with a list of `CompilerGeneratedClass'es.
7877 (TypeContainer.ResolveMembers): New public method.
7878 (Method): `IIteratorContainer' has been replaced by
7881 * expression.cs (VariableReference): New public abstract base
7882 class for `LocalVariableReference', `ParameterReference' and
7885 * codegen.cs (EmitContext): Removed `capture_context',
7886 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7887 (EmitContext.EmitThis): Removed.
7889 * cs-parser.jay: Replace `iterator_container' with
7892 2006-10-04 Martin Baulig <martin@ximian.com>
7894 * generic.cs (GenericMethod): Don't make this abstract.
7895 (Constraints.Clone): Added dummy implementation.
7897 2006-10-04 Raja R Harinath <harinath@gmail.com>
7900 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7901 'declspaces'. Avoid allocating arrays willy-nilly.
7904 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7905 cases out of the switch.
7907 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7909 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7910 message when non-generic type is used with the type arguments.
7911 * expression.cs: Updated.
7913 2006-09-28 Raja R Harinath <rharinath@novell.com>
7916 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7917 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7918 Change semantics slightly. Don't insist on having only one
7919 temporary EmptyExpression -- just throttle the creation of new ones.
7922 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7923 non-interfaces too. If no methods are found, don't try to create
7926 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7928 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7931 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7932 us produce better error message.
7934 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7936 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7937 of the `|' operator.
7939 * report.cs: A new warning added.
7941 2006-09-27 Martin Baulig <martin@ximian.com>
7943 * generic.cs (GenericMethod): Don't make this abstract.
7945 2006-09-27 Martin Baulig <martin@ximian.com>
7948 (InternalErrorException): Added overloaded ctor taking a params array.
7950 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7952 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7953 Fixed the cases when same error was reported twice.
7955 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7956 now report symbol information.
7958 2006-09-25 Martin Baulig <martin@ximian.com>
7960 * class.cs: Completely unified with the gmcs version.
7962 2006-09-25 Martin Baulig <martin@ximian.com>
7964 * typemanager.cs (TypeManager.IsNullableType): New public function.
7965 (TypeManager.IsNullableTypeOf): Likewise.
7966 (TypeManager.IsNullableValueType): Likewise.
7968 * class.cs (MethodCore): Added the `GenericMethod' argument from
7969 gmcs and also unified all classes derived from `MethodCore' with gmcs.
7971 2006-09-24 Raja R Harinath <harinath@gmail.com>
7973 * convert.cs: Unify with gmcs version.
7975 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7977 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7978 verify them as well.
7980 * report.cs: New warning.
7982 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7984 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7985 for anonymous block with out argument.
7987 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7989 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7990 not used private events only.
7992 2006-09-23 Marek Safar <marek.safar@seznam.cz>
7994 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7996 * const.cs (Const.Define): Check for constant type.
7997 (Const.IsConstantTypeValid): Looks for valid constant types.
7999 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8001 * ecore.cs (EmptyConstantCast): New common class for all constant based
8004 * expression.cs (Is.DoResolve): Handle null constant especially.
8005 (New.DoResolve): Check for new void().
8006 (MemberAccess.DoResolve): Cope with all kind of nulls.
8008 * literal.cs (NullConstant): Uses EmptyConstantCast.
8009 (NullDefault): Based on EmptyConstantCast.
8010 (NullLiteral): Uses EmptyConstantCast.
8012 * statement.cs (Block.ResolveMeta): Check for constant type.
8014 2006-09-22 Martin Baulig <martin@ximian.com>
8016 * delegate.cs, attribute.cs: Merged with the gmcs versions.
8018 2006-09-22 Raja R Harinath <rharinath@novell.com>
8020 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8024 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8025 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
8028 2006-09-22 Martin Baulig <martin@ximian.com>
8030 * ecore.cs: Merged with the gmcs version.
8032 * generic.cs (ConstructedType): New dummy class.
8033 (TypeArguments): Don't make this abstract.
8036 (TypeManager.IsGenericTypeDefinition): New method.
8037 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8039 2006-09-22 Raja R Harinath <rharinath@novell.com>
8041 * expression.cs (ComposedCast): Check for arrays of TypedReference
8042 before creating the type, not after.
8044 2006-09-21 Marek Safar <marek.safar@seznam.cz>
8046 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8047 after ToType change.
8049 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8050 when constant must be implicitly convertible.
8052 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8054 * ecore.cs (NullCast): Derives from NullConstant.
8056 * expression.cs (Is.DoResolve): Removed useless variables.
8057 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8058 (New.Constantify): Add enum support.
8059 (MemberAccess.DoResolve): Add warning when accessing null constant or
8062 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8065 * literal.cs (NullConstant): New abstract class with common
8066 functionality for all null specializations.
8067 (NullDefault): Represents default(X) when result can be
8069 (NullLiteral): Updated.
8071 * report.cs: Add new warning.
8073 2006-09-21 Martin Baulig <martin@ximian.com>
8075 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8077 2006-09-21 Martin Baulig <martin@ximian.com>
8079 * generic.cs (GenericConstraints): New dummy class.
8080 (Constraints): Likewise.
8081 (TypeParameter): Likewise.
8082 (TypeParameterName): Likewise.
8083 (GenericMethod): Likewise.
8085 * typemanager.cs (TypeManager.GetGenericArguments): New method.
8087 * decl.cs: Merged with the gmcs version.
8089 2006-09-21 Raja R Harinath <rharinath@novell.com>
8091 * generic.cs (TypeParameter): Implement IMemberContainer.
8092 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
8094 * rootcontext.cs: Unify with gmcs version.
8096 * report.cs: Unify with gmcs version.
8097 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8098 from gmcs/generics.cs.
8099 * generics.cs (TypeParameter): New dummy class.
8101 * support.cs: Unify with gmcs version.
8103 2006-09-20 Raja R Harinath <rharinath@novell.com>
8105 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8106 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8108 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8109 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8110 * mcs.exe.sources: Add generic.cs.
8112 * codegen.cs: Unify with gmcs version.
8114 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8115 (EmitContext): Add GenericDeclContainer implementation.
8116 * decl.cs (MemberCore, DeclSpace): Likewise.
8117 * namespace.cs: Remove #ifdef GMCS_SOURCE.
8119 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8120 MCS TypeManager has a corresponding dummy method.
8122 2006-09-19 Martin Baulig <martin@ximian.com>
8124 * expression.cs: Completely merged with the gmcs version.
8126 2006-09-19 Martin Baulig <martin@ximian.com>
8128 * expression.cs (Invocation): Merged with the gmcs version.
8129 (ArrayAccess.GetStoreOpcode): Likewise.
8131 2006-09-19 Martin Baulig <martin@ximian.com>
8134 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8135 (TypeManager.IsGenericMethodDefinition): Likewise.
8137 2006-09-19 Martin Baulig <martin@ximian.com>
8140 (TypeManager.IsEqual): Moved the gmcs implementation here.
8141 (TypeManager.DropGenericTypeArguments): Likewise.
8142 (TypeManager.DropGenericMethodArguments): Likewise.
8143 (TypeManager.GetTypeArguments): Moved here from gmcs.
8144 (TypeManager.HasGenericArguments): Likewise.
8146 2006-09-19 Martin Baulig <martin@ximian.com>
8148 * expression.cs (Binary): Merged with the gmcs version.
8150 2006-09-19 Martin Baulig <martin@ximian.com>
8152 * expression.cs (Probe, As, Is): Merged with the gmcs version.
8154 2006-09-19 Martin Baulig <martin@ximian.com>
8156 * typemanager.cs: Merged with the gmcs version.
8158 2006-09-16 Raja R Harinath <rharinath@novell.com>
8160 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8161 * driver.cs: Likewise.
8163 2006-09-16 Marek Safar <marek.safar@seznam.cz>
8166 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8167 only if parent type is class.
8168 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8171 2006-09-15 Marek Safar <marek.safar@seznam.cz>
8174 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8176 * typemanager.cs(CSharpName): Converts NullType to null.
8178 2006-09-15 Martin Baulig <martin@ximian.com>
8181 (TypeManager.GetMethodName): Added mcs implementation.
8182 (TypeManager.IsEqual): Likewise.
8185 (SimpleName.RemoveGenericArity): Added dummy implementation.
8187 * pending.cs: Merged with the gmcs version.
8189 2006-09-15 Martin Baulig <martin@ximian.com>
8191 * statement.cs: Merge with the gmcs version.
8193 2006-09-15 Martin Baulig <martin@ximian.com>
8195 * statement.cs (Switch): Merge with the gmcs implementation
8196 (without nullables), which is newer.
8198 2006-09-15 Martin Baulig <martin@ximian.com>
8200 * statement.cs (Block.Variables): Make this public.
8201 (ToplevelBlock.Parameters): Make this a property.
8202 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8204 2006-09-15 Martin Baulig <martin@ximian.com>
8206 * namespace.cs: Merge with the gmcs version.
8208 2006-09-15 Martin Baulig <martin@ximian.com>
8210 * decl.cs (MemberName): Minor code cleanups.
8212 2006-09-15 Martin Baulig <martin@ximian.com>
8214 * parameter.cs: Merge with the gmcs version.
8216 2006-09-15 Martin Baulig <martin@ximian.com>
8218 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8219 and an error in mcs.
8221 2006-09-15 Martin Baulig <martin@ximian.com>
8223 * flowanalysis.cs: Merged from GMCS; added the generics code into
8224 a `GMCS_SOURCE' conditional so we can share this file.
8226 2006-09-08 Martin Baulig <martin@ximian.com>
8228 * typemanager.cs (TypeManager.interlocked_type): New public field.
8229 (TypeManager.int_interlocked_compare-exchange): New public field.
8230 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8231 enumerator types here and call InitGenericCoreTypes().
8232 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8233 after calling InitEnumUnderlyingTypes().
8236 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8237 `classes_second_stage'.
8239 2006-09-14 Marek Safar <marek.safar@seznam.cz>
8241 * assign.cs, ecore.cs, expression.cs: Share error message text.
8242 * class.cs (FieldMember.Define): Check for varible of static type.
8243 * driver.cs (LoadAssembly): Uses error output for errors.
8244 * statement.cs: Updated.
8246 2006-09-08 Marek Safar <marek.safar@seznam.cz>
8248 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8251 2006-09-07 Martin Baulig <martin@ximian.com>
8254 (MainDriver): Revert r62663 from Marek; see #70506 for details.
8256 2006-08-29 Miguel de Icaza <miguel@novell.com>
8258 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8260 2006-08-17 Miguel de Icaza <miguel@novell.com>
8262 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8263 #52019 and #79064, the use of the \uXXXX sequence in source code
8264 to represent unicode characters.
8266 2006-08-15 Marek Safar <marek.safar@seznam.cz>
8268 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8270 * class.cs, ecore.cs, statement.cs: Merged to one error message.
8272 2006-08-13 Miguel de Icaza <miguel@novell.com>
8274 * assign.cs: Catch attempts to assign to a method groups in += and
8277 2006-08-13 Marek Safar <marek.safar@seznam.cz>
8280 * cs-parser.jay: Don't destroy current array type by typeof of array's.
8282 2006-08-12 Marek Safar <marek.safar@seznam.cz>
8284 * class.cs (Method.Define): Issue a warning when generic method looks like
8286 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8289 2006-08-09 Marek Safar <marek.safar@seznam.cz>
8291 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8293 * decl.cs (MemberCache.FindMembers): When container is interface we need to
8294 search all base interfaces as a member can be ambiguous.
8295 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8296 Constructor member type filter.
8297 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8298 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8299 reporting for returned memberinfos.
8300 * report.cs: Updated.
8301 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8302 version to work on all runtimes.
8303 (TypeManager.RealMemberLookup): Removed members filtering.
8305 2006-08-08 Raja R Harinath <rharinath@novell.com>
8307 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8308 (PropertyExpr.EmitAssign): Likewise.
8309 * expression.cs (Indirection.EmitAssign): Likewise.
8310 (LocalVariableReference.EmitAssign): Likewise.
8311 (ParameterReference.EmitAssign): Likewise.
8312 (Invocation.EmitArguments): Likewise.
8313 (ArrayAccess.EmitAssign): Likewise.
8314 (IndexerAccess.EmitAssign): Likewise.
8315 (This.EmitAssign): Likewise.
8316 (ConditionalLogicalOperator.Emit): Likewise.
8319 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
8320 instead of ArrayList. If the hashtable has a LocalBuilder, don't
8321 leave it in after returning it.
8322 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
8324 2006-08-06 Marek Safar <marek.safar@seznam.cz>
8326 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8329 2006-08-03 Raja R Harinath <rharinath@novell.com>
8331 Fix cs0146-3.cs and cs0146-4.cs.
8332 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8333 enclosing types don't depend on the current type.
8335 2006-08-02 Raja R Harinath <rharinath@novell.com>
8338 * class.cs (TypeContainer.DoDefineMembers): Use
8339 FindBaseMemberWithSameName on Parent, since we're interested in
8340 whether we hide inherited members or not.
8341 (FindBaseMemberWithSameName): Make slightly more robust.
8343 Fix the non-generic testcase from #77396
8344 * decl.cs (DeclSpace.DeclContainer): Remove override.
8346 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8347 declspaces for doppelgangers too.
8348 (UsingEntry): Implement IResolveContext.
8349 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
8350 'this' as the resolve context.
8351 (LocalAliasEntry): Likewise.
8353 Implement parts of #77403
8354 * roottypes.cs (RootDeclSpace): New. Used to represent the
8355 toplevel declaration space. Each namespace declaration introduces
8356 a "partial" root declaretion space.
8357 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8358 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8359 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8360 from 'current_namespace.SlaveDeclSpace'.
8361 (namespace_declaration): Likewise.
8362 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8363 check. It can't happen now.
8364 * decl.cs (DeclSpace.LookupType): Likewise.
8365 * driver.cs (MainDriver): Sanity check.
8367 2006-08-01 Raja R Harinath <rharinath@novell.com>
8369 * decl.cs (DeclSpace.FindNestedType): Remove.
8370 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8371 LookupTypeContainer to get the container of the nested type.
8372 * class.cs (TypeContainer.FindNestedType): Make non-override.
8374 2006-07-31 Raja R Harinath <rharinath@novell.com>
8376 * decl.cs (DeclSpace.PartialContainer): Move field from ...
8377 * class.cs (TypeContainer.PartialContainer): ... here.
8378 (TypeContainer.AddBasesForPart): New helper.
8379 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
8381 * cs-parser.jay (current_class): Convert to DeclSpace.
8382 (struct_declaration, interface_declaration, class_declaration):
8383 Use AddBasesForPart instead of .Bases directly.
8384 * const.cs, iterators.cs: Update to changes.
8386 2006-07-28 Raja R Harinath <rharinath@novell.com>
8388 * class.cs (TypeContainer.AddMemberType): Rename from
8390 (TypeContainer.AddMember): Rename from AddToMemberContainer.
8391 (AddTypeContainer): New. Combine AddClassOrStruct and
8393 (AddPartial): Update. Add 'is_partial' argument.
8394 * roottypes.cs: Update to changes.
8395 * cs-parser.jay (push_current_class): New helper for handling
8396 current_container and current_class.
8397 (struct_declaration, interface_declaration, class_declaration):
8400 2006-07-26 Raja R Harinath <rharinath@novell.com>
8402 * roottypes.cs: Rename from tree.cs.
8404 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8405 * tree.cs (Tree, ITreeDump): Remove types.
8406 * rootcontext.cs (tree, Tree): Remove fields.
8407 (root, ToplevelTypes): New.
8408 * *.cs: Update to rename.
8410 * tree.cs (Tree.RecordDecl): Remove.
8411 (RootTypes.AddToTypeContainer): Record the toplevel type in its
8413 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8415 2006-07-23 Raja R Harinath <harinath@gmail.com>
8417 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8418 DoFlowAnalysis and OmitStructFlowAnalysis here.
8419 (ec.With): Rename from WithUnsafe and generalize.
8420 (ec.WithCheckState): Remove. All users can be handled by 'With'.
8421 (ec.WithFlowAnalyis): New.
8422 * ecore.cs, expression.cs, statement.cs: Update.
8424 2006-07-22 Raja R Harinath <harinath@gmail.com>
8426 * statement.cs (Block.ResolveMeta): Simplify slightly.
8428 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
8429 multiple boolean fields. Convert InUnsafe, constant_check_state,
8430 check_state to flags.
8431 (CheckState, ConstantCheckState): Update.
8432 (InUnsafe): New read-only property.
8433 (FlagsHandle): Rename from CheckStateHandle and convert to handle
8435 (WithUnsafe): New helper similar to WithCheckState.
8436 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8437 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8439 2006-07-21 Raja R Harinath <rharinath@novell.com>
8441 Make comparisons use the same IL irrespective of whether they're
8442 in a 'checked' or 'unchecked' context: one of the issues in #78899
8443 * codegen.cs (EmitContext.CheckState): Make read-only property.
8444 (EmitContext.ConstantCheckState): Likewise.
8445 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8446 helper that implement a save/restore stack for CheckState
8447 values. This is the only way to change check-state.
8448 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8449 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8450 (CheckedExpr.EmitBranchable): New forwarding method.
8451 (UnCheckedExpr): Likewise.
8452 * statement.cs (Block.ResolveMeta): Use WithCheckState.
8453 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8454 (Checked.Resolve, checked.DoEmit): Likewise.
8456 2006-07-20 Miguel de Icaza <miguel@novell.com>
8458 * anonymous.cs: Cache the resolved anonymous delegate, and return
8459 this so that the ResolveTopBlock is only triggered once, not
8462 Currently we trigger ResolvetopBlock twice due to a first pass of
8463 argument check compatibility, and a second pass that does the
8466 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8468 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8470 * rootcontext.cs (Reset): Add helper_classes.
8472 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8475 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8478 2006-07-13 Miguel de Icaza <miguel@novell.com>
8480 * statement.cs (Lock): Handle expressions of type
8481 TypeManager.null_type specially. Fixes #78770
8483 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8485 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8488 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8490 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8491 for accessors as well.
8492 * ecore.cs (EventExpr): Add AccessorTable.
8494 2006-07-01 Marek Safar <marek.safar@seznam.cz>
8497 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8498 for CS0122 where appropriate.
8499 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8501 (Filter): Assembly can be null in the case of top level attributes.
8503 2006-06-25 Marek Safar <marek.safar@seznam.cz>
8507 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8508 is done at global level.
8510 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8512 A fix for #77002, Implemented TypeForwarder support.
8514 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8515 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8516 * typemanager.cs (): Add type_forwarder_attr_type.
8518 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8520 * report.cs: Add CS0469 warning.
8522 2006-06-21 Martin Baulig <martin@ximian.com>
8524 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8525 the `try'-block, so we also report CS0016 etc. there.
8527 2006-06-21 Martin Baulig <martin@ximian.com>
8530 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8532 2006-06-21 Martin Baulig <martin@ximian.com>
8534 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8535 also report CS1686 for parameters.
8537 2006-06-21 Martin Baulig <martin@ximian.com>
8539 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8540 instead of an error if the value is not implicitly convertible to
8541 the switch types; fixes #77964.
8543 2006-06-21 Raja R Harinath <rharinath@novell.com>
8546 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8547 FieldBuilder is null.
8550 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8551 'left' and 'right' before error-checking.
8553 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8555 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8557 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8558 (FieldExpr.DoResolve): likewise.
8559 (PropertyExpr.InstanceResolve): likewise.
8560 (EventExpr.InstanceResolve): likewise.
8562 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8564 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8565 attribute applicable tests for attribute argument.
8567 2006-06-02 Raja R Harinath <rharinath@novell.com>
8570 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8571 (Binary.OverloadResolve_PredefinedIntegral): New.
8572 (Binary.OverloadResolve_PredefinedFloating): New.
8573 (Binary.OverloadResolve_PredefinedString): New.
8574 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8575 Follow the standard more closely, and treat numeric promotions in
8576 terms of overload resolution.
8577 (Binary.CheckShiftArguments): Simplify.
8579 2006-06-01 Raja R Harinath <rharinath@novell.com>
8581 * flowanalysis.cs (MyBitVector): Simplify representation.
8582 (MyBitVector.Clone): Avoid allocating BitArray.
8583 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8584 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8585 (*): Update. Change all references to MyBitVector.And and
8586 MyBitVector.Or to &= and |=.
8588 2006-05-29 Raja R Harinath <rharinath@novell.com>
8591 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8592 to param arguments too.
8594 2006-05-26 Miguel de Icaza <miguel@novell.com>
8596 * cs-parser.jay: Catch another parsing form for arglist being
8597 followed by other arguments. Fixes #78313.
8599 2006-05-24 Raja R Harinath <rharinath@novell.com>
8601 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8602 checking of out parameters to ...
8603 (FlowBranchingToplevel.Merge): ... here.
8604 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8605 set, propagate the origin upward, and only complain if there was
8607 (FlowBranchingException.AddContinueOrigin): Likewise.
8608 (FlowBranchingException.AddReturnOrigin): Likewise.
8609 (FlowBranchingException.AddGotoOrigin): Likewise.
8611 2006-05-23 Raja R Harinath <rharinath@novell.com>
8613 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8614 unreachable, skip it.
8615 (FlowBranchingException.Merge): Always propagate jumps, even if
8616 the finally block renders subsequent code unreachable.
8618 2006-05-18 Raja R Harinath <rharinath@novell.com>
8621 * statement.cs (Goto.Resolve): Move responsibility for resolving
8622 'goto' to FlowBranching.AddGotoOrigin.
8623 (Goto.SetResolvedTarget): New. Callback to set the
8624 LabeledStatement that's the target of the goto.
8625 (Goto.DoEmit): Use Leave instead of Br when crossing an
8626 unwind-protect boundary.
8627 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8628 LookupLabel and adjust to new semantics.
8629 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8630 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8631 Goto.SetResolvedTarget to update target.
8632 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8633 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8634 AddBreakOrigin & co. Delay propagation until ...
8635 (FlowBranchingException.Merge): ... this.
8637 * statement.cs (Block.Resolve): Always depend on flow-branching to
8638 determine unreachability. Kill workaround that originally emitted
8639 only one statement after an "unreachable" label (see infloop in
8642 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8643 This is still "wrong", but anything better would probably need a
8644 multi-pass algorithm.
8645 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8646 usage vector. Force current usage vector to be reachable, to
8647 optimistically signify backward jumps.
8648 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8650 (FlowBranchingLabeled.Merge): New. If no backward jump was
8651 detected, return the original salted-away usage vector instead,
8652 updated with appropriate changes. Print unreachable warning if
8654 * statement.cs (Block.Resolve): Don't print unreachable warning on
8655 a labeled statement.
8657 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8659 * driver.cs: Pass filename without path to AssemblyBuilder's
8660 AddResourceFile. Fixes bug #78407.
8662 2006-05-17 Raja R Harinath <rharinath@novell.com>
8664 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8665 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8666 (FlowBranching.MergeChild): Overwrite
8667 reachability information from Labeled branchings too.
8669 2006-05-16 Raja R Harinath <rharinath@novell.com>
8671 * statement.cs (Goto.Resolve): Merge jump origins here ...
8672 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8674 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8675 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8676 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8677 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8679 * statement.cs (Goto.Resolve): ... not here.
8680 (Goto.Emit): Remove CS1632 check.
8682 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8684 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8687 2006-05-11 Raja R Harinath <rharinath@novell.com>
8689 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8690 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8691 (FlowBranchingException.Label): Likewise.
8693 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8695 (MyBitVector.Or): Use it to avoid losing information (Count).
8696 (FlowBranching.MergeOrigins): Likewise.
8698 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8699 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8700 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8701 (UsageVector.ToString): Simplify.
8702 (UsageVector.MergeSiblings): Move here from ...
8703 (FlowBranching.Merge): ... here.
8704 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8707 2006-05-10 Raja R Harinath <rharinath@novell.com>
8709 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8710 null bitvector is treated as all-true.
8712 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8713 (MyBitVector): Rationalize invariants. 'vector != null' implies
8714 that we have our own copy of the bitvector. Otherwise,
8715 'InheritsFrom == null' implies all inherited bits are true.
8717 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8719 * statement.cs (LocalInfo): Add IsConstant.
8720 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8721 local variable for constants.
8723 2006-05-09 Raja R Harinath <rharinath@novell.com>
8725 * flowanalysis.cs (MyBitVector.Empty): New.
8726 (MyBitVector): Don't allow InheritedFrom to be null.
8727 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8728 (UsageVector, FlowBranching): Update to changes.
8730 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8731 recursion. The 'Parent == null' condition isn't sufficient for
8733 (FlowBranching.AddBreakOrigin): Likewise.
8734 (FlowBranching.AddContinueOrigin): Likewise.
8735 (FlowBranching.AddReturnOrigin): Likewise.
8736 (FlowBranching.StealFinallyClauses): Likewise.
8737 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8738 (FlowBranching.CheckOutParameters): Likewise.
8739 (FlowBranchingToplevel): Terminate all the above recursions here.
8740 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8741 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8743 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8745 (FlowBranchingToplevel): New. Empty for now.
8746 (FlowBranching.MergeTopBlock): Update.
8747 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8748 branching for the anonymous delegate.
8749 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8751 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8752 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8753 information at the start of the merge. Reorganize.
8755 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8757 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8759 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8761 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8762 to newly introduced ctor.
8764 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8765 message to one place.
8766 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8769 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8771 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8773 * ecore.cs (Expression.ResolveAsConstant): Updated.
8775 * statement.cs (ResolveMeta): Updated.
8777 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8779 * cs-parser.jay: __arglist cannot be used in initializer.
8781 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8784 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8787 2006-05-05 Raja R Harinath <rharinath@novell.com>
8789 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8790 (LabeledStatement): Add 'name' parameter.
8791 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8792 (Block.AddLabel): Update to changes.
8793 * cs-parser.jay (labeled_statement): Likewise.
8795 * flowanalysis.cs (BranchingType.Labeled): New.
8796 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8797 (FlowBranchingLabeled): New. Does nothing for now, but will
8798 eventually handle 'goto' flows.
8799 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8800 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8801 that's terminated ...
8802 (Block.Resolve): ... here.
8804 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8805 (UsageVector.MergeFinallyOrigins): Likewise.
8806 (FlowBranching.InTryOrCatch): Likewise.
8807 (FlowBranching.AddFinallyVector): Likewise.
8808 (FlowBranchingException): Update to changes.
8811 * statement.cs (Return.Resolve): Move error checking to ...
8812 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8813 (FlowBranchingException): Handle return origins like break and
8815 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8817 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8820 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8823 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8826 * class.cs (MethodData.Define): Do public accessor check only when method
8827 implements an interface.
8829 2006-05-04 Raja R Harinath <rharinath@novell.com>
8831 Remove special handling of 'break'
8832 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8833 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8834 (UsageVector.Break): Remove.
8835 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8837 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8839 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8840 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8842 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8845 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8846 be the interface member.
8848 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8851 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8852 for emitting small (int) values.
8854 2006-05-03 Raja R Harinath <rharinath@novell.com>
8857 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8858 control-flow passes through the 'finally' after merging-in all the
8859 control-flows from 'try' and the 'catch' clauses.
8861 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8862 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8863 always true at the only non-recursive entry point.
8864 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8865 FlowBranchingBreakable.
8866 (FlowBranchingLoop): Remove.
8867 * statement.cs (Return.DoResolve): Update to changes.
8870 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8871 (FlowBranching.CreateBranching): Handle it: create a
8872 FlowBranchingContinuable.
8873 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8874 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8875 except that it handles the 'continue' command.
8876 (FlowBranching.UsageVector.MergeOrigins): Rename from
8878 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8879 except that it overrides AddContinueOrigin.
8880 (FlowBranchingException): Override AddContinueOrigin, similar to
8882 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8883 Create a new branching around the embedded statement.
8884 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8885 control flow after the embedded statement.
8886 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8888 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8889 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8890 FlowBranchingBreakable.
8891 (FlowBranchingSwitch): Remove.
8894 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8895 error reporting to ...
8896 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8897 Rename from 'AddBreakVector'. Add new location argument. Return
8898 a bool indicating whether the 'break' crosses an unwind-protect.
8899 (FlowBranchingException.AddBreakOrigin): Add.
8900 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8901 flowbranching after updating with the effects of the 'finally'
8903 (FlowBranchingBreakable): New common base class for
8904 FlowBranchingLoop and FlowBranchingSwitch.
8906 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8908 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8910 2006-05-02 Raja R Harinath <rharinath@novell.com>
8912 * statement.cs (Do.Resolve): If the loop is infinite, set the
8914 (While.Resolve, For.Resolve): Set a barrier after the embedded
8915 statement. There's no direct control flow that goes from the end
8916 of the embedded statement to the end of the loop.
8917 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8918 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8919 above ensure that the reachability is correctly computed.
8921 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8922 (UsageVector.MergeBreakOrigins): If the current path is
8923 unreachable, treat it as if all parameters/locals are initialized.
8924 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8925 infinite loops before merging-in break origins.
8927 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8928 (Reachability.Reachable): Split part into ...
8929 (Reachability.Unreachable): ... this. Simplify.
8930 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8932 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8933 (Reachability.SetThrowsSometimes): Likewise.
8934 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8935 TriState.Always, use corresponding property.
8936 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8937 (Block.Resolve): Likewise. Remove some redundant checks.
8939 2006-05-02 Raja R Harinath <harinath@gmail.com>
8941 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8942 (Reachability.Meet): Don't bother checking AlwaysThrows --
8943 barrier is always set.
8944 (FlowBranchingBlock.Merge): Likewise.
8946 2006-05-01 Raja R Harinath <harinath@gmail.com>
8948 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8949 checks for unreachable.
8951 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8954 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8956 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8957 whether field is really assigned.
8959 2006-04-30 Raja R Harinath <harinath@gmail.com>
8961 * flowanalysis.cs (Reachability): Make 4-argument constructor
8963 (Reachability.Meet): Rename from 'And'. Remove static variant.
8964 (Reachability.Always): Rename from the highly misleading
8965 'Reachability.Never'.
8966 (FlowBranching.Merge): Update to changes. Mark an impossible
8967 situation with a 'throw'.
8968 (*): Update to changes.
8970 2006-04-29 Raja R Harinath <harinath@gmail.com>
8972 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8974 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8975 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8976 (*): Update to changes.
8977 * statement.cs: Update to changes.
8979 2006-04-28 Marek Safar <marek.safar@seznam.cz>
8982 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8984 2006-04-28 Raja R Harinath <harinath@gmail.com>
8986 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8989 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8990 argument to two arguments: an usage-vector and a bool. Move call
8991 to FlowBranching.Merge () ...
8992 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8994 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8995 handling of loop and switch reachability to ...
8996 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8998 2006-04-27 Raja R Harinath <harinath@gmail.com>
9000 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9001 handling to FlowBranchingLoop.InLoop.
9002 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9004 2006-04-26 Marek Safar <marek.safar@seznam.cz>
9007 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9008 anonymous method is allowed from AnonymousContainer here.
9010 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9012 2006-04-24 Raja R Harinath <rharinath@novell.com>
9015 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9017 2006-04-23 Marek Safar <marek.safar@seznam.cz>
9020 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9021 (DoubleConstant.Reduce): Ditto.
9023 2006-04-23 Raja R Harinath <rharinath@novell.com>
9025 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9026 Remove 'lvalue_right_side' argument. Move parts to ...
9027 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9028 (LocalVariable.DoResolveLValue): ... these.
9030 2006-04-21 Raja R Harinath <rharinath@novell.com>
9033 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9034 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9035 (LocalVariableReference.DoResolveBase): Use it to implement new
9037 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9038 (Argument.Resolve): Simplify. Move CS1510 check ...
9039 * ecore.cs (Expression.ResolveLValue): ... here.
9040 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9041 (PropertyExpr.DoResolveLValue): Likewise.
9042 (FieldExpr.Report_AssignToReadonly): Likewise.
9043 (FieldExpr.DoResolve): Add 'out_access' argument. Use
9044 LValueMemberAccess or LValueMemberOutAccess on instance depending
9046 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9047 DoResolve as appropriate.
9049 2006-04-20 Raja R Harinath <rharinath@novell.com>
9052 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9053 implicit conversions on 'out' and 'ref' arguments.
9055 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9056 improve clarity. Remove dead code.
9059 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9060 (Catch.Resolve): Resolve VarBlock if it exists.
9062 2006-04-19 Miguel de Icaza <miguel@novell.com>
9064 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9065 twice, this was some residual code, the enumerator was emitted
9066 properly in the two branche of if later.
9068 2006-04-19 Raja R Harinath <rharinath@novell.com>
9070 * expression.cs (Cast.ResolveLValue): Remove. The result of a
9071 cast is never an lvalue.
9072 (Cast.DoResolve, Cast.ResolveRest): Combine.
9073 (Argument.Emit): Simplify slightly. Move 'Expr is
9074 IMemoryLocation' check ...
9075 (Argument.Resolve): ... here.
9076 (Argument.Error_LValueRequired): Remove. Inline into only user.
9078 Simplifications. Fix cs0191-2.cs
9079 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9080 CS1649 and CS1651 to ...
9081 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
9082 the actual selection of the error code and message to a lookup
9083 table. Add a dummy return value to simplify callsites.
9084 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9085 readonly fields of other instances of the same type. Move CS0197
9087 * expression.cs (Argument.Resolve): ... here. Simplify code.
9088 Ensure that ec.InRefOutArgumentResolving is only set during LValue
9089 resolution of an out or ref argument. The code simplification
9090 above uses this invariant.
9092 2006-04-18 Raja R Harinath <rharinath@novell.com>
9094 Possibly fix #77752. Fix cs1690-[4-7].cs.
9095 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9096 CheckMarshallByRefAccess. Drop parameter.
9097 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
9099 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9101 * report.cs (AllWarnings): Add CS1690.
9102 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9104 (LocalVariableReference.DoResolveBase): Update.
9106 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9108 * class.cs (MethodOrOperator): Moved common parts from method class.
9109 detect obsolete attributes.
9110 (Method.Define): Simplified as it reuses code from base.
9111 (Constructor.ValidAttributeTargets): Fixed issue found during
9113 (Destructor.ValidAttributeTargets): Fixed issue found during
9115 (Operator): Finished refactoring set off by #78020. Operator class is now
9116 ordinary method class.
9118 * anonymous.cs: Updated.
9120 * decl.cs (DeclSpace): Add IsGeneric
9122 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9124 * class.cs (Constructor.Emit): Don't emit the attributes twice.
9126 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9128 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9129 detect obsolete attributes.
9130 (Method.CreateEmitContext): Moved to MethodOrOperator.
9132 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9135 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9136 customized exception to make crash detection easier.
9137 (MethodOrOperator): Started to work on new base class for methods and
9139 (Method): Derives from MethodOrOperator.
9140 (Constructor.Emit): Emits its own attributes.
9141 (AbstractPropertyEventMethod.Emit): Ditto.
9142 (Operator): Derives from MethodOrOperator, will refactor fully in extra
9144 (Operator.Emit): It's temporary more tricky than should be.
9146 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9148 * report.cs (InternalErrorException): Add ctor with inner exception.
9150 2006-04-08 Marek Safar <marek.safar@seznam.cz>
9153 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9156 2006-04-07 Marek Safar <marek.safar@seznam.cz>
9159 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9162 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9164 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9165 attribute is present and Guid not.
9166 (Interface.ApplyAttributeBuilder): Ditto.
9168 * attribute.cs: Add error message.
9170 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9174 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9175 sources (it's composite) so hold them in extra array as they are used in
9176 Emit phase only. It worked in the previous versions by mistake.
9177 (Attribute.Emit): Emit attribute for more owners when exist.
9179 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9180 it has now different behaviour.
9182 2006-04-04 Marek Safar <marek.safar@seznam.cz>
9184 * constant.cs (Constant.IsDefaultInitializer): New method.
9186 * class.cs: Updated.
9188 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9189 re-initialize default values. It saves KBs almost for every assembly.
9190 Thanks Zoltan for the idea.
9191 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9192 (ArrayCreation.DoResolve): Resolve only once.
9193 (ArrayCreation.Emit): Emit static initializer only when it is faster.
9194 (ArrayCreation.GetAttributableValue): Cope with optimized values.
9196 2006-04-03 Zoltan Varga <vargaz@gmail.com>
9198 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9201 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9203 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9204 in an embedded statement too.
9206 2006-04-01 Raja R Harinath <rharinath@novell.com>
9209 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9211 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9215 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9218 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9220 2006-03-31 Marek Safar <marek.safar@seznam.cz>
9222 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9225 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9226 LocalTemporary change.
9228 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9230 (ClassOrStruct.DefineFieldInitializers): Implemented static field
9231 initializers optimization.
9232 (ClassOrStruct.TypeAttr): Moved from modifiers.
9233 (Constructor.CheckBase): Don't crash when static ctor has parameters.
9234 (FieldBase.ResolveInitializer): Resolves initializer.
9235 (FieldBase.HasDefaultInitializer): New property.
9237 * cs-parser.jay: Removed message.
9239 * expression.cs (CompilerGeneratedThis): New specialization.
9241 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9243 2006-03-28 Marek Safar <marek.safar@seznam.cz>
9245 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9247 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9249 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9250 be now EnumConstants only.
9252 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9254 * attribute.cs, driver.cs: Reset more caches.
9256 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9258 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9260 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9262 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9263 for easier reuse. Updated all overrides.
9264 (IntegralConstant): New base class for all integral constants.
9265 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9266 of the constant range, report custom error.
9267 (UIntConstant.Reduce): Fixed uint conversion.
9269 * ecore.cs, literal.cs: Reduce updates.
9271 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9275 * class.cs (Constructor.Define): Removed extra if for default ctors.
9276 A patch from Atsushi Enomoto.
9278 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9280 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9281 GetAttributableValue.
9283 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9286 * convert.cs (ImplicitConversionRequired): Error message moved to
9289 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9290 automatic implicit conversion of an output value.
9291 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9293 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9295 (TypeOf.GetAttributableValue): Add extra handling for object type.
9297 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9298 special error message.
9300 2006-03-25 Marek Safar <marek.safar@seznam.cz>
9302 * class.cs (Constructor.Emit): Don't crash when struct ctor is
9304 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9305 compatible with MS runtime.
9307 2006-03-23 Marek Safar <marek.safar@seznam.cz>
9309 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9310 attribute arguments here.
9312 * class.cs (Indexer.Define): The check was moved to attribute class.
9314 2006-03-22 Marek Safar <marek.safar@seznam.cz>
9316 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9317 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9320 2006-03-22 Raja R Harinath <rharinath@novell.com>
9322 Support ParameterDefaultValueAttribute in gmcs. Also applied to
9323 mcs to keep code differences small.
9324 * attribute.cs (Attribute.GetParameterDefaultValue): New.
9325 * typemanager.cs (parameter_default_value_attribute_type): New.
9326 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
9329 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9331 * expression.cs (StringConcat.Append): Reverted back to no warning state.
9333 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9335 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9337 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9340 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
9342 * doc-bootstrap.cs : fix build.
9344 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9346 * expression.cs (StringConcat.Append): Issue a warning when empty string
9349 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9351 * assign.cs (CompoundAssign.ResolveSource): Removed.
9353 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9356 * class.cs (TypeContainer.FindMethods): Removed.
9357 (TypeContainer.CheckMemberUsage): Made static.
9359 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9361 * constant.cs (CheckRange): Removed unused type argument.
9362 (CheckUnsigned): Removed unused type argument.
9364 * cs-parser.jay: Updated after MemberAccess clean up.
9365 Uses Length for empty string test.
9367 * cs-tokenizer.cs: Uses Length for empty string test.
9368 (IsCastToken): Made static.
9369 (is_hex): Made static.
9370 (real_type_suffix): Made static.
9372 * decl.cs (SetupCache): Made static.
9373 (OnGenerateDocComment): Removed unused ds argument.
9375 * delegate.cs (VerifyDelegate): Removed unused argument.
9377 * doc.cs: Uses Length for empty string test.
9379 * driver.cs: Uses Length for empty string test.
9381 * enum.cs (IsValidEnumType): Made static
9383 * expression.cs (EnumLiftUp): Removed unused argument.
9384 (ResolveMethodGroup): Ditto.
9385 (BetterConversion): Ditto.
9386 (GetVarargsTypes): Ditto.
9387 (UpdateIndices): Ditto.
9388 (ValidateInitializers): Ditto.
9389 (MemberAccess.ctor): Ditto.
9390 (GetIndexersForType): Ditto.
9392 * flowanalysis.cs: (MergeFinally): Removed unused argument.
9394 * iterators.cs: Updated after MemberAccess clean up.
9396 * location.cs: Uses Length for empty string test.
9398 * namespace.cs: Uses Length for empty string test.
9400 * report.cs (CheckWarningCode): Made static.
9402 * statement.cs (LabeledStatement): Removed unused argument.
9404 * typemanager.cs (FilterNone): Removed.
9406 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9408 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9411 * class.cs: Updated.
9413 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9415 * cs-parser.jay.cs: __arglist is not allowed for delegates.
9417 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9421 * expression.cs (VerifyArgumentsCompat): Reverted to double error
9422 reporting, it's more tricky than I thought.
9424 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9428 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
9430 (AnonymousMethod.ImplicitStandardConversionExists): New method.
9431 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9432 Add more error reporting; Fixed issue with params.
9434 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9436 * cs-parser.jay: AnonymousMethod requires host container.
9438 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9440 2006-03-18 Raja R Harinath <harinath@gmail.com>
9442 * class.cs: Change 'TypeContainer ds' constructor argument to
9443 'DeclSpace parent'. Some classes were missed below due to
9444 different naming convention.
9446 * class.cs (MemberCore.Parent): Delete. This makes the
9447 ParentContainer changes below enforceable by the compiler.
9449 Treat pointers to enclosing declaration space as 'DeclSpace', not
9451 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9452 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9454 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9456 (Block.AddThisVariable): Likewise.
9457 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9458 (AbstractPropertyEventMethod.Emit): Likewise.
9459 (AbstractPropertyEventMethod.EmitMethod): Likewise.
9460 (GetMethod.Define, SetMethod.Define): Likewise.
9461 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9462 (DelegateMethod.EmitMethod): Likewise.
9464 Fix regression test-partial-13.cs.
9465 Rationalize use of PartialContainer. Ensure that the partial
9466 class semantics can be tied to type-correctness, i.e., any
9467 violation will cause a compile error.
9468 * class.cs, const.cs: Access all fields that belong to class
9469 TypeContainer via ParentContainer. Arguments of EmitContexts and
9470 Resolve()-like functions still use 'Parent'.
9472 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9473 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9474 (PropertyMethod.CheckModifiers): Remove unused argument.
9475 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9478 2006-03-17 Raja R Harinath <harinath@gmail.com>
9480 Make semantics of PartialContainer simpler.
9481 * decl.cs (DeclSpace.IsPartial): Remove.
9482 * class.cs (TypeContainer.IsPartial): Likewise.
9483 (TypeContainer..ctor): Set PartialContainer to point to self.
9484 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9485 (TypeContainer.FindNestedType): Likewise.
9486 (MemberCore.ParentContainer): Simplify. Remove deprecation.
9488 2006-03-17 Marek Safar <marek.safar@seznam.cz>
9490 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9492 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9494 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9497 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9499 * class.cs (Operator.Define): An error for base conversion was not
9502 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
9504 * iterator.cs : yield break is allowed in try statement which has
9505 catch clauses. Fixed bug #77767.
9507 2006-03-13 Marek Safar <marek.safar@seznam.cz>
9509 A fix for #77593, #77574.
9511 * class.cs (MethodCore.CheckBase): Another if for operator.
9513 2006-03-09 Marek Safar <marek.safar@seznam.cz>
9515 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9518 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9519 (DelegateCreation.ImplicitStandardConversionExists): New method for just
9522 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9525 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9526 Updated after another emitcontext usage was clean up. It should help us to
9527 synchronize with gmcs easier.
9529 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9533 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9534 (Event.Define): ditto
9535 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9537 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9538 Removed redundant code and set NewSlot for Invoke method too.
9540 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9541 (Parameters.MergeGenerated): New method. Use this method when you merge
9542 compiler generated argument with user arguments.
9544 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9546 * attribute.cs (ResolveAsTypeTerminal): Removed.
9548 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9549 specialization for predefined types; 30% speed up.
9550 Finally placed obsolete check to right place.
9551 (Expression.ResolveType): Removed.
9553 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9554 Updated after ResolveType was removed.
9556 * expression.cs (Cast.ctor): Check void cast.
9557 (Binary.ResolveAsTypeTerminal): Is never type.
9558 (Conditional.ResolveAsTypeTerminal): Is never type.
9560 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9562 2006-03-01 Raja R Harinath <rharinath@novell.com>
9565 * expression.cs (ParameterReference.DoResolveBase): Change return
9567 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9571 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9574 * typemanager.cs (GetFullNameSignature): Don't nullref on
9575 protected accessors.
9577 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9579 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9580 these two separated members to simplify the code.
9581 (Attribute.Resolve): Refactored to use new fields and methods.
9582 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9583 implemented obsolete attribute checking.
9584 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9585 implemented obsolete checking again. It look line never ending quest ;-)
9586 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9588 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9590 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9592 *class.cs (Property.Define): Add RegisterProperty call.
9594 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9595 argument groups (only 2).
9597 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9598 encoding expression to arguments.
9599 (Expression.ExprClassToResolveFlags): Just turned to property.
9601 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9602 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9603 optimized as well as implemented support for zero-length attributes.
9605 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9606 Add caching of PropertyInfo's.
9608 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9610 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9611 error multiple times.
9613 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9615 New partial class implementation.
9616 A fix for #77027, #77029, #77403
9618 * attribute.cs (Attributable): Made attributes protected.
9620 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9621 the replacements of ClassPart and PartialContainer.
9622 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9623 (TypeContainer.AddInterface): Ditto.
9624 (TypeContainer.AddPartial): The main method for partial classes. It checks
9625 for errors and merges ModFlags and attributes. At the end class is added to
9627 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9629 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9630 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9631 from the rest of partial classes.
9632 (TypeContainer.GetClassBases): Simplified.
9633 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9635 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9636 (TypeContainer.HasExplicitLayout): Uses Flags now.
9637 (PartialContainer): Removed.
9638 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9639 (StaticClass): Was merged with Class.
9640 (Class.GetClassBases): class and static class bases are verified here.
9641 (Class.TypeAttr): Added static attributes when class is static.
9642 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9643 (MemberBase): In some cases we need to call parent container for partial
9644 class. It should be eliminated but it's not easy now.
9646 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9648 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9649 partial classed to accumulate class comments.
9650 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9652 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9654 * driver.cs (MainDriver): Tree.GetDecl was removed.
9656 * modifiers.cs (Modifiers): Add partial modifier.
9658 * tree.cs (Tree.decl): Removed.
9659 (RootTypes): Started to use this class more often for root types
9662 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9666 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9667 external interface does not have an attribute.
9669 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9671 Another prerequisites for new partial classs implementation.
9673 * attribute.cs (Attribute.Equal): Implemented.
9674 (Attribute.Emit): Changed as attributes can be applied more than twice.
9675 (Attributes.Emit): Check for duplicate attributes here.
9677 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9678 as a parameter, clean-up.
9680 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9684 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9685 contains obsolete attribute check which can in some cases look for base
9686 type of current class which is not initialized yet.
9687 (TypeContainer.BaseType): Replacement of ptype.
9689 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9691 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9693 First of prerequisites for new partial classs implemention.
9695 * attribute.cs (Attributable): Extended by ResolveContext;
9696 Attributes finally have correct context for resolving in all cases.
9697 (AttachTo): Attribute owner is assigned here.
9699 * codegen.cs (IResolveContext): Introduce new interface to hold
9700 all information needed in resolving phase.
9701 (EmitContext): Implements IResolveContext; more clean-up needed here.
9703 * decl.cs (MemberCore): Implemented IResolveContext.
9705 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9706 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9707 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9708 Refactored to use new IResolveContext instead of EmitContext; cleanup
9710 2006-02-06 Miguel de Icaza <miguel@novell.com>
9712 * codegen.cs (EmitScopeInitFromBlock): check here the
9713 capture_context, there is no need to make two calls to the
9716 * anonymous.cs: Add some debugging messages that might help me
9717 track other instances of this problem in the future (the
9718 regression of test 467).
9720 * cs-parser.jay: track the variable block, as we need to initalize
9721 any captured variables declared in this block for the "catch"
9722 portion of the "Try" statement.
9724 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9725 scope initialization for captured variables.
9727 Also, move the emit for the variables after the block location has
9730 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9732 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9734 2006-02-02 Miguel de Icaza <miguel@novell.com>
9736 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9737 commit yesterday, the initialization for the roots is necessary.
9738 What is not necessary is the scope activation.
9740 2006-02-02 Raja R Harinath <rharinath@novell.com>
9742 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9743 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9745 (Argument.Resolve): Remove CS0206 checks.
9747 2006-02-01 Miguel de Icaza <miguel@novell.com>
9749 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9750 scopes for all the roots, the scopes will now be emitted when the
9751 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9753 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9754 code. This reduces a lot of existing cruft.
9756 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9757 that the ScopeInfo is generated as we enter the scope, not at the
9758 time of use, which is what we used to do before.
9760 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9761 every time a Block is about to be emitted if we have a
9764 2006-02-01 Raja R Harinath <rharinath@novell.com>
9766 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9768 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9770 * typemanager.cs (cons_param_array_attribute): Make private.
9771 (Reset): Set it to null.
9772 (InitCoreHelpers): Don't initialize it.
9773 (ConsParamArrayAttribute): New. Initialize it as needed.
9774 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9776 2006-01-31 Miguel de Icaza <miguel@novell.com>
9778 * expression.cs: There might be errors reported during the
9779 selection of applicable methods. If there are errors, do not
9780 continue execution as it will lead the compiler to crash.
9782 2006-01-30 Miguel de Icaza <miguel@novell.com>
9784 * expression.cs: Member access is not allowed on anonymous
9785 methods. Fixes #77402.
9787 2006-01-30 Raja R Harinath <rharinath@novell.com>
9790 * cs-parser.jay (VariableDeclaration): Don't set
9791 current_array_type to null.
9792 (field_declaration, event_declaration, declaration_statement):
9793 Set it to null here.
9795 2006-01-28 Raja R Harinath <harinath@gmail.com>
9797 * typemanager.cs (GenericParameterPosition): New.
9800 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9802 * doc.cs : To process "include" elements, first we should create
9803 another list than XmlNodeList, because it could result in node
9804 removal, which could result in that the XmlNodeList gives up
9807 (Also made code identical to gmcs again.)
9809 2006-01-25 Miguel de Icaza <miguel@novell.com>
9811 * ecore.cs: Introduce an error report that we were not catching
9812 before, if not silent, we must report the error. Gonzalo ran into
9815 2006-01-23 Miguel de Icaza <miguel@novell.com>
9817 A fix for bug: #76957
9819 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9820 ComputeMethodHost before creating the method, this is a new
9823 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9824 that this method references (RegisterScope). The actual scope
9825 where the method is hosted is computed with the ComputeMethodHost
9826 before we create the method.
9828 Moved the Deepest routine here.
9830 (AnonymousContainer.ComputeMethodHost): New routine used to
9831 compute the proper ScopeInfo that will host the anonymous method.
9833 (ScopeInfo): Deal with multiple roots. The problem was that we
9834 did not have a unique root where all ScopeInfos could be hanged
9835 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9838 Remove AdjustMethodScope which is now computed at the end. Remove
9839 LinkScope which did a partial link, instead link all ScopeInfos
9840 before code generation from the new "LinkScopes" routine.
9842 Simplify all the Add* routines as they no longer need to maintain
9843 the tree, they just need to record that they are using variables
9846 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9847 routines to produce the forest of ScopeInfo trees.
9849 * class.cs (TypeContainer.AppendMethod): This is just like
9850 AddMethod, but ensures that an interface implementation method
9851 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9852 methods, but at the end.
9854 We use this functionality to ensure that the generated MoveNext
9855 method in the iterator class is resolved/emitted before the
9856 enumerator methods created.
9858 This is required because the MoveNext method computes the right
9859 ScopeInfo for the method. And the other methods will eventually
9860 need to resolve and fetch information computed from the anonymous
9863 2006-01-21 Raja R Harinath <harinath@gmail.com>
9864 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9867 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9869 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9870 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9872 2006-01-18 Raja R Harinath <rharinath@novell.com>
9874 Fix #76656, cs0231-2.cs.
9875 * cs-parser.jay (formal_parameter_list): Make error case catch
9877 (parenthesized_expression_0): Add CS1026 check.
9878 (invocation_expression): Remove unused { $$ = lexer.Location }.
9880 2006-01-17 Raja R Harinath <rharinath@novell.com>
9883 * cs-parser.jay (statement_expression): Don't list out the
9884 individual statement-expressions. Convert syntax error into
9887 2006-01-16 Raja R Harinath <rharinath@novell.com>
9890 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9891 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9892 CheckIntermediateModification.
9893 (FieldExpr.DoResolve): Add new two-argument version that
9894 allows us to resolve the InstanceExpression as an lvalue.
9895 The one-argument variant is now just a wrapper.
9896 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9897 Resolve the lhs as an lvalue if the it has a value type.
9898 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9899 from Assign.DoResolve.
9900 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9901 resolved as an lvalue.
9902 (PropertyExpr.DoResolve): Update.
9903 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9904 has a value type. Move CS1612 check here from
9905 CheckIntermediateModification.
9906 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9907 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9908 'right_side' of a ResolveLValue on an 'out' argument.
9909 (EmptyExpression.LValueMemberAccess): New. Used as the
9910 'right_side' of a propagated ResolveLValue on a value type.
9911 (LocalVariableReference.DoResolveBase): Recognize
9912 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9914 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9915 EmptyExpression.Null.
9917 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9919 * typemanager.cs : added IsGenericParameter(). In mcs it always
9921 * doc.cs : for generic parameters, use GenericParameterPosition,
9924 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9926 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9928 2006-01-12 Miguel de Icaza <miguel@novell.com>
9930 This fixes the problem where we used ldfld instead of ldflda to
9931 load the "THIS" pointer on captured parameters, when THIS is a
9932 value type. See bug #77205.
9934 * iterators.cs (CapturedThisReference.Emit): Pass false to
9935 EmitThis (we do not need the address).
9937 * codegen.cs (EmitThis): it needs to know whether we need the
9938 address of `this' or not. This is used by value types.
9940 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9941 every other call passes false.
9943 2006-01-12 Raja R Harinath <rharinath@novell.com>
9946 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9948 * expression.cs (Invocation.OverloadResolve): Update.
9949 (Invocation.DoResolve): Avoid double resolution of invocation.
9951 2006-01-11 Raja R Harinath <rharinath@novell.com>
9954 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9955 unary negation of floating point types as 0-expr; negation cannot
9956 overflow in floating point types.
9959 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9960 on operands of 'void' type.
9963 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9964 and ExclusiveOr for boolean constants too.
9966 2006-01-09 Raja R Harinath <rharinath@novell.com>
9969 * expression.cs (Invocation.OverloadResolve): Replace reflected
9970 override methods with their base virtual methods, rather than
9972 * typemanager.cs (TypeManager.GetOverride): New.
9974 2006-01-05 Jb Evain <jbevain@gmail.com>
9976 * class.cs (Property.Define, Indexer.Define): do not tag the
9977 properties as SpecialName | RTSpecialName.
9979 2006-01-04 Miguel de Icaza <miguel@novell.com>
9981 * class.cs (MethodCore.IsDuplicateImplementation): This method was
9982 doing a low-level comparission of parameter types. It was lacking
9983 a check for __argslist.
9985 2005-12-30 Miguel de Icaza <miguel@novell.com>
9987 * expression.cs (ParameterReference.DoResolveBase): Allow
9988 reference parameters if they are local to this block.
9990 This allows the ref and out parameters of a delegate to be used in
9991 an anonymous method, for example:
9993 delegate void set (out int x);
9995 set s = delegate (out int x){
9999 This is used by functionality introduced late in the C# language.
10001 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10002 method that take ref and out parameters.
10004 Fixes #77119 which was a late change in the spec.
10006 2005-12-23 Miguel de Icaza <miguel@novell.com>
10008 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10009 parent if its the same scope. Fixes #77060.
10011 2005-12-21 Miguel de Icaza <miguel@novell.com>
10013 * driver.cs: Report the case of no source files and no -out:
10016 2005-12-20 Raja R Harinath <rharinath@novell.com>
10019 * expression.cs (ComposedCast.GetSignatureForError): Define.
10021 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10025 * namespace.cs (NamespaceEntry): Add extern_aliases as a
10026 ListDictionary, to contain the ExternAliasEntry entries (in
10027 addition to the NamespaceEntry.aliases hashtable). This field is
10028 shared between the original entry and its doppelganger (bodyless
10030 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10031 extern_aliases field.
10032 (NamespaceEntry.Lookup): Move the IsImplicit check after the
10033 lookup in extern_aliases.
10035 2005-12-16 Raja R Harinath <rharinath@novell.com>
10038 * class.cs (TypeContainer.Mark_HasEquals): New.
10039 (TypeContainer.Mark_HasGetHashCode): New.
10040 (ClassPart): Override them.
10041 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10044 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10045 'parent' argument to the base constructor.
10047 Remove all mention of TypeContainer from decl.cs.
10048 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10049 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10050 (DeclSpace.DeclSpace): Likewise.
10051 (DeclSpace.DefineMembers): Remove unused argument.
10052 * cs-parser.jay (pop_current_class): Update to changes. Simplify
10053 debugging check -- we don't care if the debug code throws an
10054 InvalidCastException instead of an InternalErrorException.
10055 * class.cs (TypeContainer.DefineMembers): Update to changes.
10056 (TypeContainer.DoDefineMembers): Likewise.
10057 (TypeContainer.GetMethods): Likewise.
10058 (PropertyMember.Define): Likewise.
10059 (MemberBase.Parent): New property that forwards to
10060 MemberCore.Parent, but ensures that we get a TypeContainer.
10061 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10062 (RootContext.PopulateTypes): Likewise. Remove special case code
10063 for !RootContext.StdLib: DefineMembers is idempotent.
10065 2005-12-14 Miguel de Icaza <miguel@novell.com>
10067 * convert.cs (ExplicitConversionCore): Check the return value from
10068 ExplicitConversionCore which can return null on failure. Fixes #76914
10070 2005-12-13 Marek Safar <marek.safar@seznam.cz>
10072 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10074 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
10076 * doc.cs : The search for referenced namespace was insufficient to
10077 get global one as it used to do. Fixed bug #76965.
10079 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
10081 * doc.cs : check name in cref in the last phase that whether it is
10084 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10086 * cs-tokenizer.cs : reverted the latest change: it somehow broke
10089 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10091 * doc.cs : so it turned out that we cannot skip override check for
10092 interface members. Fixed bug #76954.
10094 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10096 * cs-tokenizer.cs : fixed bug #75984:
10097 - #warning and #error should not be handled when the source line
10099 - #line is not checked strictly when the source line is disabled.
10100 - #define and #undef is on the other hand checked strictly at any
10103 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
10105 * cs-tokenizer.cs : missing Location (actually, filename) in one of
10108 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10110 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10112 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10113 event initializers.
10114 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10115 (FieldBase.Initializer): Initializer is now optional.
10116 (EventField.Define): Only event field can have initializer.
10118 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10120 * const.cs (Const): Reuse initializer.
10122 * cs-parser.jay: Updated after FieldBase changes.
10123 Added current_array_type to simplify array initializers.
10125 * ecore.cs (NullCast.IsDefaultValue): Implemented.
10127 * expression.cs, iterators.cs: Updated.
10129 * namespace.cs (NamespaceEntry): Made UsingFound private.
10131 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10133 * parameterCollection.cs: Obsolete, removed.
10134 * parser.cs: Obsolete, removed.
10136 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10139 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10141 * enum.cs (Enum.Define): Set obsolete context here.
10143 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10146 - FindDocumentedMember() now expects 1) paramList as null
10147 when "we don't have to check the number of parameters" and
10148 2) Type.EmptyTypes when "there is no arguments".
10149 - Introduced FoundMember struct to hold the exact type which was
10150 used to find the documented member (the above change broke
10151 test-xml-044; it might be better just to use DeclaringType than
10152 what MS does, like this change does, but it depends on usage.)
10154 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10156 * doc.cs : documented member might be from DeclaringType for nested
10157 types. Fixed bug #76782.
10159 2005-12-03 Ben Maurer <bmaurer@ximian.com>
10161 * anonymous.cs: Have the param code handle leaving copies on the
10162 stack etc. Allows anonymous params to take part in the assignment
10163 code (++, +=, etc). Fixes bug #76550
10165 * expression.cs: Handle the prepare_for_load/leave_copy by passing
10166 it down to the anon code.
10168 * iterators.cs: Use dummy var here
10170 * codegen.cs: Handle new vars
10172 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10175 * class.cs (MethodData.Define): Set proper Obsolete context.
10177 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10179 (FieldExpr.DoResolve): Ditto.
10181 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10184 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10185 parent is not obsolete.
10187 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
10189 * doc.cs : (FindDocumentedMember) find parameterless members first
10190 and get CS0419 in the early stage. Fixed first case of bug #76727.
10192 2005-11-30 Marek Safar <marek.safar@seznam.cz>
10195 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10196 no error was reported.
10198 *expression.cs (Binary.DoResolve): left can be null.
10200 2005-11-22 Marek Safar <marek.safar@seznam.cz>
10203 * class.cs (MethodData.Emit): Parameters should be labeled first.
10205 2005-11-21 Marek Safar <marek.safar@seznam.cz>
10208 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10210 2005-11-18 Marek Safar <marek.safar@seznam.cz>
10212 * attribute.cs (AreParametersCompliant): Moved to Parameter.
10214 * class.cs (MethodCore): Parameter clean up.
10215 (IMethodData): Added ParameterInfo.
10216 (MethodData): Parameter clean up.
10217 (Indexer.Define): Parameter clean up.
10229 * typemanager.cs: Parameter clean up.
10231 * delegate.cs (Define): Get rid of duplicated code.
10233 * expression.cs (ParameterReference): Removed useless parameters
10235 (Invocation): Ditto.
10237 * parameter.cs (ParamsParameter): New class, params specialization.
10238 (ArglistParameter): Attemp to separate arglist.
10239 (Parameter): Refactored to be reusable and faster.
10240 (Parameter.Modifier): Made understandable.
10241 (Parameters): Changed to be used as a class for `this' assembly
10242 parameters. Refactored to use new specialized classes.
10244 * support.cs (ParameterData): Added Types property.
10245 (InternalParameters): Deleted.
10247 2005-08-20 Martin Baulig <martin@ximian.com>
10249 Merging this patch from GMCS to fix #75867.
10251 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10252 scope if we don't already have it.
10254 2005-11-17 Martin Baulig <martin@ximian.com>
10257 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10258 inherit the scope from our parent. Fixes #76653.
10260 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10262 * doc.cs : the previous patch does not actually fix the bug.
10263 PropertyInfo override check is now implemented and really fixed it.
10264 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10266 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10268 * doc.cs : apply "override filter" also to properties.
10271 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10273 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10274 no need to check overrides. For classes, omit those results from
10275 interfaces since they must exist in the class. Fixed bug #76726.
10277 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10279 * typemanager.cs : (GetFullNameSignature) differentiate indexers
10280 with different parameters. Fixed the second problem in #76685.
10282 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10284 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10285 get expected 'protected' access in CheckValidFamilyAccess()).
10288 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10290 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10291 Fixed bug #76705. CS1569 was incorrectly commented out.
10293 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10295 * doc.cs : use Invocation.IsOverride() to do real override check.
10296 * expression.cs : made Invocation.IsOverride() internal.
10298 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10300 * doc.cs : use TypeManager.FindMembers() instead of (possible)
10301 TypeBuilder.FindMembers() and filter overriden base members out.
10304 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10306 * doc.cs : ref/out parameters are represented as '@' (instead of
10307 '&' in type FullName). Fixed bug #76630 (additionally crefs).
10309 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10311 * doc.cs : when there was no '.' in cref to methods in doc comment,
10312 then parameters were missing in the output. Fixed bug #76691.
10314 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10316 * driver.cs : don't output docs when there is an error.
10319 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10322 Now it should detect indexers. Fixed primary concern in bug #76685.
10323 Fixed CS0419 message to not show the identical member signature in
10326 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10328 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10329 instead of Type.FindMembers() since it does not handle events.
10332 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
10334 * codegen.cs: Fixed typo (speficied -> specified).
10336 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10339 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10341 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10343 * attribute.cs: Changed error message.
10345 * cs-tokenizer.cs: One more check.
10347 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10349 * statement.cs (Block.Resolve): Ignore empty statement.
10351 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10353 * report.cs: Made error/warning methods more strict to avoid
10356 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10357 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10358 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10359 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10361 2005-11-08 Marek Safar <marek.safar@seznam.cz>
10363 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10364 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10366 * class.cs (TypeContainer.IsComImport): New property.
10367 (Constructor.Define): Create proper ctor for ComImport types.
10369 * expression.cs (New.CheckComImport): Fixed.
10371 2005-11-07 Miguel de Icaza <miguel@novell.com>
10373 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10374 that a parameter has been captured does not mean that we do not
10375 have to do the rest of the processing. This fixes the second part
10376 of #76592. If there was another anonymous method capturing
10377 values in the past, the Scope would never be set for the second
10378 method that captured the same parameter.
10380 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10381 properly manipulate the stack. Second part of fix for #76592.
10383 * expression.cs (New): Add support for invoking "new" on
10384 interfaces that have been flagged with the ComImport attribute and
10385 the CoClass. Fixes #76637
10387 * statement.cs (Try.DoEmit): When a variable is captured, do not
10388 try to emit the vi.LocalBuilder variable as it has been captured.
10389 Create a temporary variable and store the results on the
10390 FieldBuilder. Fixes #76642
10392 2005-11-07 Marek Safar <marek.safar@seznam.cz>
10394 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10396 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10398 * expression.cs (Binary.DoResolve): Added && optimalization.
10400 * typemanager.cs (AddUserType): Removed useless argument.
10402 2005-11-04 Marek Safar <marek.safar@seznam.cz>
10404 * statement.cs (Block.variables): Uses ListDictionary.
10406 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10409 * class.cs (PartialContainer.EmitType): Customized to emit
10410 security attributes.
10411 (ClassPart.ApplyAttributeBuilder): Transform security attribute
10412 for partial classes.
10414 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10417 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10418 access has to be fixed.
10420 * typemanager.cs (IsUnmanagedType): Wrong common field type.
10422 2005-11-01 Marek Safar <marek.safar@seznam.cz>
10425 * ecore.cs (NullCast.Reduce): Implemented.
10427 * expression.cs (ArrayCreation.CheckIndices): Correcly check
10430 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10432 (Foreach.Resolve): Catch null properly.
10434 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10436 * cs-tokenizer.cs: Warning text fix.
10438 * driver.cs: AllWarningNumbers exposed on public interface.
10440 * report.cs (): Reviewed warning numbers.
10441 (IsValidWarning): Use binary search.
10443 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10445 * driver.cs: Implemeted resource visibility.
10446 (Resources): New class for code sharing between /res: and
10449 2005-10-28 Marek Safar <marek.safar@seznam.cz>
10452 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10455 * convert (Convert.ImplicitReferenceConversion): NullCast holds
10458 * ecore.cs (NullCast): Child is contant only.
10460 * literal.cs (NullLiteral.Reduce): null can be converted to any
10463 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
10465 * driver.cs: Use Encoding.Default as default code page instead
10468 2005-10-27 Raja R Harinath <rharinath@novell.com>
10471 * expression.cs (Invocation.Error_InvalidArguments): Handle
10472 __arglist parameters.
10473 (Invocation.VerifyArgumentsCompat): Likewise.
10474 * support.cs (ReflectionParameters.GetSignatureForError): Print
10475 __arglist parameters.
10476 (InternalParamters.GetSignatureForError): Likewise.
10477 * parameter.cs (Parameters.GetSignatureForError): Likewise.
10479 2005-10-26 Marek Safar <marek.safar@seznam.cz>
10481 * attribute.cs (GetPropertyValue): Made public.
10483 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10485 Add new property WrapNonExceptionThrows to handle 2.0 assembly
10487 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10490 * driver.cs: Reflect method name change.
10492 * statement.cs (Try.Resolve): Warn when try has both general
10493 exception handlers.
10495 * typemanager.cs: runtime_compatibility_attr_type new predefined
10498 2005-10-26 Raja R Harinath <harinath@gmail.com>
10501 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10502 treat it as an empty parameter list.
10504 2005-10-26 Raja R Harinath <rharinath@novell.com>
10507 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
10508 ResolveAsTypeStep silent.
10509 * statement.cs (Block.AddConstant): Mark block as used.
10510 (Block.ResolveMeta): Avoid piling on error messages
10511 if a constant initializer resolution fails.
10513 2005-10-25 Raja R Harinath <rharinath@novell.com>
10515 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10517 (NamespaceEntry.VerifyAllUsing): New.
10518 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
10519 behaviour. Delegates actual resolution of alias to ...
10520 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
10521 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10523 * driver.cs (Driver.MainDriver): Update.
10525 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10526 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10528 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10530 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10531 RootNamespace.DefineNamespacesForAll.
10533 2005-10-24 Raja R Harinath <harinath@gmail.com>
10535 * typemanager.cs (assemblies, external_aliases, modules)
10536 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10537 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10538 overhead. Move resposibility ...
10539 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10540 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10542 2005-10-23 Raja R Harinath <harinath@gmail.com>
10544 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10545 cached_namespaces. Improve usage.
10546 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10547 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10548 Move from GlobalRootNamespace and simplify.
10549 (RootNamespace.Global): Make instance variable.
10550 (RootNamespace.RootNamespace): Add "alias name" parameter.
10551 (GlobalRootNamespace): Simplify drastically.
10552 (Namespace.Lookup): Don't use GetNamespace.
10553 * typemanager.cs (GetRootNamespace): Rename from
10554 ComputeNamespaceForAlias.
10555 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10557 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10559 * anonymous.cs (AnonymousContainer): Don't crash when container
10562 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10564 * expression.cs (Binary.DoResolve): Warn when comparing same
10567 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10570 * expression.cs (Binary.DoResolve): It looks like there are no
10571 convetsion rules in enum context.
10573 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10575 Add support for extern alias qualifiers.
10576 * typemanager.cs: Move some LookupTypeReflection code
10577 to namespace.cs, to have cleaner code. Added some methods
10578 to help us keep track of the extern aliased references.
10579 * driver.cs: Add suport for extern alias assemblies on command
10580 line and check for their warnings/errors. Also keep track of the
10581 extern aliased assemblies.
10582 * namespace.cs: Move the global functionality of Namespace
10583 to GlobalRootNamespace/RootNamespace. Now the global namespace
10584 is GlobalRootNamespace.Globa. Also the code moved from
10585 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10586 Finally added LocalAliasEntry (AliasEntry before) and
10587 ExternAliasEntry, to handle alias statements.
10588 * cs-parser.jay: Add support in the grammar for extern alias
10590 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10591 Update callings to Namespace (now in GlobalRootNamespace).
10593 2005-10-18 Raja R Harinath <rharinath@novell.com>
10596 * class.cs (TypeContainer.DefineType): Move updating of
10597 topological sort earlier in the code.
10598 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10600 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10603 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10605 * constant.cs (Constant.TryReduce): Moved from Cast class.
10606 (Reduce): Made little bit more OO and fixed missing conversions.
10608 * ecore.cs (Reduce): Implemented.
10609 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10611 * literal.cs (Reduce): Implemented.
10613 * class.cs: Reverted Miguel's wrong commit.
10615 2005-10-14 Miguel de Icaza <miguel@novell.com>
10617 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10619 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10621 * cs-parser.jay, expression.cs : CS0214 was missing error location
10622 for constants. Fixed bug #76404.
10624 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10627 * convert.cs (ExplicitConversionCore): Fixed object->enum
10630 2005-10-10 Raja R Harinath <rharinath@novell.com>
10632 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10633 InstanceExpression.
10634 (PropertyExpr.EmitCall): Likewise.
10635 * expression.cs (Invocation.EmitArguments): Handle case where
10637 (Invocation.EmitCall): Avoid allocating temporary variable if
10638 there are no arguments.
10640 2005-10-07 Raja R Harinath <rharinath@novell.com>
10643 * convert.cs (ImplicitConversionStandard): Move conversion of
10644 void* to arbitrary pointer types ...
10645 (ExplicitConversionStandard): .. here.
10646 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10647 error to always print typenames.
10649 2005-10-07 Raja R Harinath <rharinath@novell.com>
10651 * convert.cs (GetConversionOperator): Rename from
10652 GetConversionOperators. Move operator selection code from ...
10653 (UserDefinedConversion): ... here.
10655 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10657 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10660 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10662 * assign.cs (Assign.DoResolve): Error method changed.
10664 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10666 * const.cs (ResolveValue): Reset in_transit immediately.
10668 * constant.cs: Error method changed.
10670 * convert.cs: Removed useless location parameter.
10671 (ExplicitNumericConversion): Don't do double enum check.
10672 (ExplicitConversionCore): Renamed from ExplicitConversion.
10673 (ExplicitUnsafe): Extracted from ExplicitConversion.
10674 (ExplicitConversion): Uses for error reporting.
10676 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10678 (ResolveBoolean): Uses common error method.
10679 (CastToDecimal): Get rid of ec.
10680 (CastFromDecimal): Optimized.
10681 (ConvCast): Get rid of ec.
10683 * enum.cs (ResolveValue): Reset in_transit immediately.
10684 (Emit): Return after first error.
10686 * expression.cs: Convert changes.
10688 * literal.cs: Error method changed.
10690 * statement.cs: Error method changed.
10692 2005-10-03 Raja R Harinath <rharinath@novell.com>
10694 * support.cs (SeekableStreamReader.Position): Don't error out when
10695 the requested position is just beyond the end of the current
10698 2005-09-28 Raja R Harinath <rharinath@novell.com>
10700 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10701 try to keep in sync with the byte count of the underlying Stream.
10702 However, this limits us to a window size of 2048 characters: i.e.,
10703 the maximum lookahead of our lexer/parser can be 2048 characters.
10705 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10708 * driver.cs: Fix compilation files with full root path.
10710 2005-09-25 Miguel de Icaza <miguel@novell.com>
10712 * report.cs (SymbolRelatedToPreviousError): Format the output so
10713 it does not use an open parenthesis that is never closed.
10715 * driver.cs: Follow coding guidelines
10717 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10720 * const.cs (Const.ResolveValue): Check for assigning non-null
10721 value to reference type.
10723 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10725 * anonymous.cs: Implemented ExprClassName.
10727 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10730 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10733 * class.cs (StaticClass.DefineContainerMembers): Report protected
10736 * codegen.cs: if(ed) PRODUCTION.
10738 * convert.cs (Error_CannotImplicitConversion): Better error
10741 * cs-parser.jay: More error checks.
10743 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10745 * driver.cs (CSCParseOption): Enabled wrong option check.
10747 * ecore.cs (Expression.ExprClassName): Turned to property.
10748 (MemberExpr.CheckIntermediateModification): For checking boxed
10749 value types modification.
10751 * statement.cs (Fixed.Resolve): Expression type must be
10752 convertible to fixed type.
10753 (CollectionForeach.GetEnumeratorFilter,TryType):
10754 Small refactoring for easier error checking.
10756 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10758 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10761 * class.cs (GeneratedBaseInitializer): New class for customization
10762 compiler generated initializers.
10763 (MemberBase.DoDefine): Check Obsolete attribute here.
10764 (FieldMember.DoDefine): Ditto.
10766 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10769 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10770 (MemberCore.GetObsoleteAttribute): Removed argument.
10771 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10772 (MemberCore.CheckObsoleteType): New helper.
10776 * statement.cs: Updates after MemberCore changes.
10778 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10779 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10781 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10782 obsolete attribute for compiler construct.
10783 (As.DoResolve): Cache result.
10785 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10787 2005-09-26 Raja R Harinath <rharinath@novell.com>
10790 * expression.cs (This.VerifyFixed): In a value type T, the type of
10791 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10792 value type R, 'this' is treated as a value parameter.
10794 2005-09-22 Miguel de Icaza <miguel@novell.com>
10796 * statement.cs (Lock): Use the TemporaryVariable class instead of
10797 manually using local variables as those do not work when variables
10800 * ecore.cs: Moved the TemporaryVariable class from being a nested
10801 class inside Foreach to be a public class that can be employed in
10804 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10806 * cs-parser.jay: interface_accessors replaced by
10807 accessor_declarations.
10809 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10812 * statement.cs (GotoCase.Resolve): Convert null constant to
10814 (SwitchLabel.ResolveAndReduce): Ditto.
10815 (SwitchLabel.NullStringCase): Custom null stamp.
10816 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10818 typemanager.cs (CSharpSignature): Don't skip first argument
10821 2005-09-18 Miguel de Icaza <miguel@novell.com>
10823 * driver.cs: Set InEmacs based on the environment variable EMACS.
10825 * location.cs (InEmacs): in this mode, do not report column
10826 location as it confuses Emacs.
10828 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10830 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10831 expression.cs, iterators.cs, literal.cs: Store constants and
10834 * class.cs (MemberBase.ShortName): Pass location.
10836 * cs-parser.jay: Some location fixes.
10838 * ecore.cs (Expression.Location): Made virtual.
10840 2005-09-05 Miguel de Icaza <miguel@novell.com>
10842 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10843 if the underlying types are the same, otherwise we need to produce
10844 code that will do the proper cast.
10846 This was exposed by Marek's constant rewrite which produced
10847 invalid code for the call site:
10849 enum X : long { a }
10850 void Method (X v) {}
10854 This fixes test-49.cs
10856 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10858 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10859 Type/Object should be allowed as well. Fixed bug #75968.
10861 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10863 * expression.cs : (Binary.DoResolve): when one is enum constant and
10864 another is constant 0, then return enum one *as enum type*.
10867 2005-09-02 Raja R Harinath <rharinath@novell.com>
10869 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10873 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10874 flow-branching for LocalVariableReferences in case we were invoked
10875 from a MemberAccess.
10876 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10878 (LocalVariableReference.DoResolveBase): ... this.
10879 (MemberAccess.Resolve): Do the check that was disabled during
10882 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10885 (PartialContainer.Create): check abstract/sealed/static strictly
10886 but abstract/sealed can exist only at one side. Fixed bug #75883.
10888 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10891 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10892 specified, don't default to UnmanagedType.I4.
10894 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10896 * expression.cs : conditional operator should check possibly
10897 incorrect assign expression. Fixed bug #75946.
10899 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10901 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10902 Reverting the change. gmcs is much complex than mcs on this matter.
10904 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10906 * cs-tokenizer.cs : To read another token ahead of the actual
10907 consumption, use new SavedToken and cache token instead of moving
10908 back the stream with SeekableStreamReader (it seemed problematic).
10910 driver.cs : Thus use StreamReader directly.
10911 * support.cs : Thus removed SeekableStreamReader.
10913 2005-08-30 Raja R Harinath <rharinath@novell.com>
10916 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10917 (ScopeInfo.EmitScopeType): Use it to construct field names from
10918 names of captured locals.
10921 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10922 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10923 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10924 (ExplicitConversion): Remove enum cases already handled by
10925 implicit conversion. Move implicit conversion check to the beginning.
10926 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10927 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10928 Don't treat System.Enum as a struct.
10930 2005-08-30 Jb Evain <jbevain@gmail.com>
10932 * attribute.cs: handles as expression in parameters.
10934 2005-08-30 Raja R Harinath <rharinath@novell.com>
10937 * class.cs (TypeContainer.VerifyClsName): Don't use a
10938 PartialContainer when verifying CLS compliance.
10939 (AbstractPropertyEventMethod): Set Parent here, ...
10940 (PropertyMethod): ... not here.
10942 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10944 * attribute.cs : escaped attribute name should not be allowed to be
10945 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10947 2005-08-29 Raja R Harinath <rharinath@novell.com>
10950 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10951 when converting a long constant to unsigned long.
10952 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10953 detect where IsApplicable and VerifyArgumentsCompat disagree.
10955 2005-08-29 Raja R Harinath <rharinath@novell.com>
10956 and Carlos Alberto Cortez <carlos@unixmexico.org>
10959 * class.cs (TypeContainer.CanElideInitializer): New helper.
10960 (TypeContainer.EmitFieldInitializers): Use it to determine if we
10961 can safely emitting the initializer of a field.
10963 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10965 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10966 allowed inside a switch (without loop). Fixed bug #75433.
10968 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
10970 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10971 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10973 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10975 * driver.cs : kinda reverting the default encoding changes (not exact
10976 revert since I noticed that "codepage:reset" might not work fine).
10978 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10980 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10981 Location. Now getter and setter store location correctly.
10982 (errors/cs0111-12.cs now reports the expected location.)
10984 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10986 * driver.cs : Use default encoding on the environment.
10987 Removed (now that) extra parameter for SeekableStreamReader.
10988 * support.cs : (SeekableStreamReader) third .ctor() argument for
10989 StreamReader is not required (always true). preamble size could
10990 be acquired in simpler and safe way.
10992 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
10994 * cs-parser.jay: report CS0642 at warning level 3
10995 and report CS0642 for an if else statement also
10996 fixes bug #74745. Patch by John Luke (and a bit
10998 Removed extra CS0642 warning check for "while",
11000 * statement.cs: In Block.Resolve(), CS0642 check
11001 is reimplemented to check a sequence of an empty
11002 statement and a block.
11004 Both fix bug #66777.
11006 2005-08-24 Marek Safar <marek.safar@seznam.cz>
11008 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11009 detection until I fix it.
11011 * cs-tokenizer.cs: Changed error message.
11013 * cs-parser.jay: Fixed 2 error locations.
11015 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11016 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11019 * enum.cs (GetSignatureForError): Fixed.
11021 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11025 * typemanager.cs (RegisterProperty): Removed.
11027 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11029 2005-08-24 Raja R Harinath <rharinath@novell.com>
11032 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11033 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11035 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11037 * expression.cs : tiny fix is required for not warning positive ulong.
11040 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11042 * expression.cs : add CS0652 check for constant and integral
11043 expression. Fixed bug #53974.
11045 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11047 * expression.cs : in DoNumericPromotions(), check if there is implicit
11048 conversion overload for string (to check CS0034). Fixed bug #52492.
11050 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11052 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11054 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11056 * ecore.cs : report location when it is *not* Null.
11058 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11064 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11065 correctly. Fixed bug #75721.
11067 2005-08-23 Raja R Harinath <rharinath@novell.com>
11069 * support.cs (SeekableStreamReader.Position): Avoid an expensive
11070 loop that performs 'min (pos, char_count)'.
11073 * expression.cs (Unary.ResolveOperator): Don't discard implicit
11074 converted value in Operator.OnesComplement.
11076 2005-08-22 Ben Maurer <bmaurer@ximian.com>
11078 * anonymous.cs: If the anon method is pulled into a helper class,
11079 it needs to be `internal' not `private'. Fixes runtime behavior on
11082 2005-08-20 Martin Baulig <martin@ximian.com>
11084 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11085 scope if we don't already have it.
11087 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11088 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11091 2005-08-17 Marek Safar <marek.safar@seznam.cz>
11094 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11095 is a partial class.
11097 2005-08-16 Marek Safar <marek.safar@seznam.cz>
11099 The big constants rewrite
11100 Fix #75746, #75685 and more
11101 As a side effect saved 1MB for MWF ;-)
11103 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11104 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11105 enum based for corlib compilation.
11107 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11110 * class.cs (FixedField.Define): Use ResolveAsConstant.
11112 * const.cs (IConstant): Interface constants and enums.
11113 (Const.ResolveValue): New method for constant resolvning.
11114 (ExternalConstant): Constants from imported assemblies.
11116 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11117 conversion; like enums.
11118 (Constant.ToType): Converts this constant to different type.
11119 (Constant.Increment): Adds 1.
11121 * convert.cs (ImplicitConversionRequired): Simplified.
11123 * cs-parser.jay: Create EnumMember directly.
11125 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11127 * doc.cs (GenerateEnumDocComment): Removed.
11129 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11130 (ConvertIntLiteral): Removed.
11131 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11133 * enum.cs (EnumMember): Implement IConstant.
11134 (Enum.IsValidEnumConstant): Removed.
11135 (Enum.GetNextDefaultValue): Removed.
11136 (Enum.FindMembers): Updated.
11137 (Enum.GenerateDocComment): Iterate enum members.
11139 * expression.cs (Cast.TryReduce): Handle enums correctly.
11140 (New.Constantify): Made public.
11141 (MemberAccess.DoResolve): Removed contant specific if(s).
11143 * literal.cs (NullLiteral): Implement new abstract methods.
11145 * statement.cs (GotoCase.Resolve): Use new constant methods.
11146 (SwitchLabel.ResolveAndReduce): Use new constant methods.
11148 * typemanager.cs (LookupEnum): Removed.
11149 (IsEnumType): Fixed to work with corlib.
11150 (RegisterConstant): Removed.
11151 (LookupConstant): Removed.
11152 (GetConstant): Changed to work with IConstant.
11154 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
11156 * location.cs : Fixed overflown (>255) column number.
11158 2005-08-03 Raja R Harinath <rharinath@novell.com>
11160 First cut of the qualified-alias-member feature.
11161 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11163 * cs-parser.jay (DOUBLE_COLON): New token.
11164 (namespace_or_type_name): Add rule for recognizing
11165 qualified-alias-members.
11166 (primary_expression): Likewise.
11167 (element_access): Allow QualifiedAliasMember as a possible
11168 type-bearing expression.
11169 (local_variable_type, local_variable_pointer_type): Likewise.
11170 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
11171 aliases in the current and enclosing namespace declarations.
11172 (NamespaceEntry.UsingAlias): Add CS0440 warning.
11173 * decl.cs (MemberName.is_double_colon): New.
11174 (MemberName.MemberName): Add new constructor for alias-member.
11175 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11176 * expression.cs (QualifiedAliasMember): New expression type.
11178 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11180 * location.cs : it borked when no argument was specified.
11182 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11184 * location.cs : tiny ToString() format fix.
11186 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11188 * statement.cs : oops, it was missing.
11190 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11192 A set of fixes for precise line/column location.
11195 "token" field now holds a file/line "delta", a line number offset
11196 from the segment, and a column number. See also:
11197 http://lists.ximian.com/pipermail/mono-devel-list/2004-
11198 December/009508.html
11199 Removed static IsNull. Use instance IsNull property instead.
11200 * cs-tokenizer.cs :
11201 For some tokens it stores Location. For Identifier it stores
11202 LocatedToken which is a pair of string name and location.
11203 Column numbers are adjusted only at getChar().
11205 Use Location.ToString() for reporting (it now contains column).
11207 Largely modified to use LocatedToken instead of
11208 string (IDENTIFIER), and to acquire Location from some tokens.
11209 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11210 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11212 Now MemberName holds Location. DeclSpace.ctor() receives Location
11213 as a parameter. Removed extra parameters to all derived classes.
11214 Replaced Location.IsNull() with instance property.
11215 * assign.cs, expression.cs :
11216 Added .ctor() overload that omits Location.
11218 Added "nameEscaped" flag that indicates the identifier was escaped
11219 in the source file. This fixes bug #57047.
11221 2005-08-02 Marek Safar <marek.safar@seznam.cz>
11223 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11224 New method, looking for lo-case imported cls type.
11226 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11229 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11231 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11233 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11234 all_imported_types.
11235 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11237 Optimized to save 3.5 MB for SWF compilation.
11239 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11241 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11242 (PartialContainer.Create): Moved logic AddToContainer.
11243 (PartialContainer.MarkForDuplicationCheck): Shares name.
11245 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11248 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11250 (Namespace.GetSignatureForError): New method.
11252 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11253 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11255 2005-08-01 Raja R Harinath <rharinath@novell.com>
11258 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11259 member lookup rather than qualifier_type, since qualifier_type can
11262 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11264 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11267 2005-07-31 Miguel de Icaza <miguel@novell.com>
11269 * statement.cs: Copy the local exception into the exception
11270 captured local. Fixes 75674
11272 2005-07-31 Raja R Harinath <harinath@gmail.com>
11275 * expression.cs (Invocation.OverloadResolve): Don't report error
11276 CS1501 if error CS1502 has been reported.
11277 (New.DoResolve): Delegate CS1501 reporting to
11278 Invocation.OverloadResolve.
11281 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11282 invariant-meaning-in-block property in an enclosing block if
11285 2005-07-29 Marek Safar <marek.safar@seznam.cz>
11287 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11288 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11289 (Switch.CheckSwitch): Just save 50kb for SWF.
11291 2005-07-27 Martin Baulig <martin@ximian.com>
11293 * anonymous.cs (CaptureContext.AddField): Added
11294 `AnonymousContainer am' argument; compute its toplevel scope if
11295 it's not already computed. Fixes #75649.
11297 2005-07-26 Raja R Harinath <rharinath@novell.com>
11300 * class.cs (Constructor.Emit): Reset block to null if the block
11303 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11305 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11307 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11309 * class.cs (MethodData.Define): Check whether accessor implementing
11310 interface is public.
11312 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11314 2005-07-22 Marek Safar <marek.safar@seznam.cz>
11317 * namespace.cs (LookupType): Moved same type check to...
11319 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11320 with the same name.
11322 2005-07-21 Raja R Harinath <rharinath@novell.com>
11324 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11325 already found a typebuilder.
11326 * class.cs (MethodCore.IsDuplicateImplementation): Compare
11327 MemberNames, not strings.
11329 * const.cs (Error_ExpressionMustBeConst):
11330 Rename from Error_EpressionMustBeConst.
11331 * const.cs, class.cs, statement.cd: Update.
11333 2005-07-21 Marek Safar <marek.safar@seznam.cz>
11337 * const.cs (Const.LookupConstantValue): Report missing contant expression
11339 (Error_EpressionMustBeConstant): Only one error method.
11341 * class.cs, statement.c: Updated.
11343 2005-07-20 Raja R Harinath <rharinath@novell.com>
11345 * statement.cs (Block.Flags): Add back HasVarargs.
11346 (Block.flags): Make protected.
11347 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11349 * typemanager.cs (types, typecontainers, user_types): Remove.
11350 (UserTypes, TypeContainers): Likewise.
11351 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11352 (CleanUp, Reset): Update.
11353 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
11354 (GetNestedType): Use Type.GetNestedType.
11355 (CoreLookupType): Take two arguments, the namespace and the
11356 basename of the type. Update to use the Namespace.Lookup
11358 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11359 (RealMemberLookup): Use IsNestedChildOf instead of playing with
11360 string concatenation and substring matches.
11361 * class.cs, enum.cs, delegate.cs: Update to changes.
11363 2005-07-20 Marek Safar <marek.safar@seznam.cz>
11365 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11366 Expression and made virtual.
11368 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11369 (ImplicitStandardConversionExists): Fixed `byte' typo ?
11371 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11373 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11376 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11379 2005-07-18 Marek Safar <marek.safar@seznam.cz>
11382 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11383 AssemblyCultureAttribute is not used on executable.
11386 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11388 2005-07-16 Raja R Harinath <rharinath@novell.com>
11391 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11392 New. Reports CS0252/CS0253.
11393 Mostly taken from preliminary patch by Duncak Mak.
11394 (Binary.DoResolveOperator): Store results of operator lookup.
11395 Use them to detect if we need to warn about unintended reference
11398 2005-07-15 Raja R Harinath <rharinath@novell.com>
11401 * namespace.cs (Namespace.Lookup): Add back location parameter.
11402 (Namespace.LookupType): Add CS0436 report. Add location parameter.
11403 * delegate.cs, ecore.cs, expression.cs: Update to changes.
11405 * codegen.cs (EmitContext.DeclSpace): Make readonly.
11406 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11407 (Namespace.LookupType): ... this.
11408 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11410 * typemanager.cs (LookupTypeReflection): Remove buggy code that
11411 purported to handle pointers.
11412 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11415 2005-07-15 Marek Safar <marek.safar@seznam.cz>
11417 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11420 2005-07-15 Raja R Harinath <rharinath@novell.com>
11422 * namespace.cs (Namespace.Lookup): Drop location parameter.
11423 (NamespaceEntry.LookupAlias): Remove. Merge into ...
11424 (NamespaceEntry.Lookup): ... this.
11425 (NamespaceEntry.Error_AmbiguousTypeReference):
11426 Move here from DeclSpace.
11427 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11429 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11430 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11431 Move to NamespaceEntry.
11432 * delegate.cs, expression.cs: Update to changes.
11434 2005-07-14 Marek Safar <marek.safar@seznam.cz>
11436 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11437 CheckAttributeType and refactored.
11438 (Attribute.ResolvePossibleAttributeType): Changed to reuse
11439 ResolveAsTypeTerminal error handling.
11440 (ResolveAsTypeTerminal): Introduced because of global attributes extra
11442 (GetSignatureForError): Print errors in same way.
11445 * codegen.cs: Reflect attribute GetSignatureForError change.
11448 * expression.cs: Add silent parameter to ResolveAsTypeStep.
11450 * namespace.cs (UsingEntry): Refactored to make fields private.
11453 statement.cs: Error_UnexpectedKind has extra parameter.
11455 2005-07-14 Raja R Harinath <rharinath@novell.com>
11457 * ecore.cs (IAlias): Remove.
11458 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
11459 that implement the interface.
11460 * namespace.cs (Namespace): Likewise.
11461 (Namespace.declspaces): Renamed from 'defined_names'.
11462 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
11463 DeclSpace instead of an IAlias.
11464 * tree.cs (Tree.AddDecl): Update.
11466 2005-07-12 Raja R Harinath <rharinath@novell.com>
11468 * statement.cs (Block.Flags); Remove HasVarargs.
11469 (Block.HasVarargs): Move to ToplevelBlock.
11470 (Block.ThisVariable, Block.AddThisVariable): Likewise.
11471 (Block.Variables): Make protected. Initialize variable hashtable
11473 (Block.AddVariable): Update.
11474 (Block.Resolve): Update to changes.
11475 (ToplevelBlock.HasVarargs): New boolean.
11476 (ToplevelBlock.ThisVariable): Move here from Block.
11477 (ToplevelBlock.AddThisVariable): Likewise.
11478 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
11479 * expression.cs (This.ResolveBase): Update to changes.
11480 (ArglistAccess.DoResolve): Likewise.
11482 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11485 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11487 * class.cs (TypeContainer.VerifyMembers): Distinguish between
11488 not used and not used & assigned.
11489 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11491 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11494 * expression.cs (Is.DoResolve): null is never provided type.
11496 2005-07-08 Marek Safar <marek.safar@seznam.cz>
11499 * cs-parser.jay: Less strict event error rule to catch more errors.
11501 2005-07-08 Martin Baulig <martin@ximian.com>
11503 Fix test-iter-10.cs - distinguish whether we `yield' in a property
11504 gettter (allowed) or setter (not allowed).
11506 * class.cs (Accessor): Implement IIteratorContainer.
11507 (Accessor.Yields): New public field.
11508 (PropertyBase.PropertyMethod.Define): Handle iterators on a
11509 per-accessor basis.
11512 (get_accessor_declaration, set_accessor_declaration): Set the
11513 `yields' flag on the accessor, not the property.
11514 (property_declaration): Do the iterators check on a per-accessor
11515 basis and not for the whole property.
11517 2005-07-08 Martin Baulig <martin@ximian.com>
11519 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11520 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11522 2005-07-07 Marek Safar <marek.safar@seznam.cz>
11525 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11526 (ExtractSecurityPermissionSet): Cope with self referencing security
11527 attributes properly.
11529 * driver.cs (SetOutputFile): Made public property OutputFile.
11531 2005-07-07 Raja R Harinath <rharinath@novell.com>
11534 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11535 has_nonstatic_fields. Make into a FieldBase pointer.
11536 (TypeContainer.AddField): Add CS0282 check.
11537 (TypeContainer.EmitType): Update.
11539 2005-07-06 Miguel de Icaza <miguel@novell.com>
11541 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11542 compare if they start with __.
11544 2005-07-06 Raja R Harinath <rharinath@novell.com>
11546 * statement.cs (Switch.SwitchGoverningType): Only look at
11547 UserCasts that don't need implicit standard conversions to one of
11548 the allowed switch types (Fixes test-322.cs).
11549 (LocalInfo.Resolve): Re-enable sanity-test.
11551 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11553 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11555 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11557 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11559 2005-07-06 Raja R Harinath <rharinath@novell.com>
11562 * ecore.cs (SimpleName.GetSignatureForError): Add.
11563 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11564 (MemberAccess.GetSignatureForError): Add.
11566 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11568 The big error and warning messages review.
11598 * typemanager.cs: Updated.
11600 * class.cs: (MethodCore.SetYields): Moved here to share.
11601 (PropertyMethod.Define): Moved iterator setup here.
11603 * iterators.cs: Add orig_method to have full access to parent
11606 2005-07-05 Raja R Harinath <rharinath@novell.com>
11608 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11609 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11610 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11611 variable of struct type.
11612 * expression.cs (Unary.ResolveOperator): Update to change.
11613 (Indirection.VerifyFixed): Likewise.
11614 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11615 (ParameterReference.VerifyFixed): Value parameters are fixed.
11616 (This.VerifyFixed): Treat 'this' as a value parameter.
11617 * statement.cs (LocalInfo.IsFixed): Remove.
11619 2005-07-01 Martin Baulig <martin@ximian.com>
11621 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11622 `ec.EmitThis ()' to get the correct scope.
11624 2005-07-01 Martin Baulig <martin@ximian.com>
11626 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11627 instance is a ParameterReference; fixes #75299.
11629 2005-07-01 Martin Baulig <martin@ximian.com>
11631 Reverted Marek's latest patch (r46725):
11632 - it contains structural changes which are neither mentioned in
11633 the ChangeLog nor explained anywhere; for example the additional
11634 argument of EmitContext's and Iterator's .ctor's and the
11635 TypeContainer.DefineMembers() change.
11636 - structural changes like this should go in in seperate patches
11637 and not be hidden in a huge patch which just seems to affect
11638 warnings and errors.
11639 a big and hard to understand patch.
11640 - it breaks iterators and causes regressions, for instance in
11643 2005-06-30 Raja R Harinath <rharinath@novell.com>
11646 * expression.cs (Indexers.map): Remove.
11647 (Indexers.Append): Filter out inaccessible setters and getters.
11648 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11651 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11652 Refactored from ...
11653 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11654 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11655 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11656 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11658 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11661 * class.cs (FieldBase.GetInitializerExpression): One more field
11664 2005-06-28 Miguel de Icaza <miguel@novell.com>
11666 * pending.cs: Do not define a proxy if the base method is virtual,
11667 it will be picked up by the runtime (bug 75270).
11669 2005-06-08 Martin Baulig <martin@ximian.com>
11671 The big Iterators rewrite :-)
11673 * iterators.cs: Rewrite this to use the anonymous methods framework.
11675 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11676 before the TypeContainers; see 2test-21.cs.
11679 (TypeContainer.DefineType): Don't create a new EmitContext if we
11680 already have one (this only happens if we're an Iterator).
11681 (TypeContainer.Define): Also call Define() on all our iterators.
11682 (Method.CreateEmitContext): Added support for iterators.
11685 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11686 (AnonymousContainer.CreateMethodHost): Moved here from
11687 AnonymousMethod and made abstract.
11688 (AnonymousContainer.CreateScopeType): New abstract method.
11689 (AnonymousContainer.IsIterator): New public property.
11690 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11691 get the ScopeTypeBuilder rather than manually defining it here.
11692 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11695 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11696 before RootContext.DefineTypes().
11698 * codegen.cs (EmitContext.RemapToProxy): Removed.
11699 (EmitContext.CurrentAnonymousMethod): Changed type from
11700 AnonymousMethod -> AnonymousContainer.
11701 (EmitContext.ResolveTopBlock): Protect from being called twice.
11702 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11703 (EmitContext.EmitThis): Removed the iterators hacks; use the
11704 anonymous methods framework for that.
11707 (ToplevelBlock.Container): Make this a property, not a field.
11708 (ToplevelBlock.ReParent): New public method; move the
11709 ToplevelBlock into a new container.
11710 (Foreach.TemporaryVariable): Simplify.
11712 2005-06-05 Martin Baulig <martin@ximian.com>
11714 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11715 (Block.AddTemporaryVariable): New public method; creates a new
11716 `LocalInfo' for a temporary variable.
11717 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11719 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11720 non-iterator variables.
11722 2005-06-05 Martin Baulig <martin@ximian.com>
11724 * statement.cs (Foreach.TemporaryVariable): Create the
11725 LocalBuilder in the Emit phase and not in Resolve since in some
11726 situations, we don't have an ILGenerator during Resolve; see
11727 2test-19.cs for an example.
11729 2005-06-04 Martin Baulig <martin@ximian.com>
11731 **** Merged r45395 from GCS ****
11733 The big Foreach rewrite - Part II.
11735 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11736 with `PropertyInfo ienumerator_getcurrent'.
11738 * codegen.cs (VariableStorage): Removed.
11741 (Foreach): Derive from Statement, not ExceptionStatement.
11742 (Foreach.CollectionForeach): New nested class. Moved all the code
11743 dealing with collection foreach here.
11744 (Foreach.ForeachHelperMethods): Removed.
11745 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11747 2005-05-23 Martin Baulig <martin@ximian.com>
11749 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11750 don't need to. Fix #75014.
11752 2005-05-20 Martin Baulig <martin@ximian.com>
11754 Merged r44808 from GMCS.
11756 * class.cs (TypeContainer.CircularDepException): Removed.
11757 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11758 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11759 (CS0146) and interface (CS0529) dependencies here.
11761 2005-06-21 Raja R Harinath <rharinath@novell.com>
11763 * expression.cs (Invocation.EmitCall): Fix initialization
11764 'this_call' to reflect current behaviour. Fix indentation.
11766 * convert.cs (FindMostEncompassedType): Add two trivial special
11767 cases (number_of_types == 0 || number_of_types == 1).
11768 (FindMostEncompasingType): Likewise.
11770 2005-06-17 Raja R Harinath <rharinath@novell.com>
11772 Some cleanups preparing for the fix of #75283.
11773 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11775 (EventExpr.InstanceResolve): Likewise.
11776 (EventExpr.DoResolve): Remove redundant checks.
11778 2005-06-10 Duncan Mak <duncan@novell.com>
11780 * cs-tokenizer.cs (process_directives): New flag for controlling
11781 the processing of preprocessor directives.
11782 (x_token): After seeing a '#', return Token.NONE instead of going
11783 to handle_preprocessing_directive() when not processing
11784 directives. This avoids unnecessary processing during the token peek in
11789 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11790 the existing error reporting methods instead of Report.Error.
11792 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11793 after Raja's rewrite.
11795 2005-06-08 Miguel de Icaza <miguel@novell.com>
11797 * class.cs: Small fix.
11799 2005-06-08 Raja R Harinath <rharinath@novell.com>
11802 * class.cs (GetPartialBases): Fix return value check of
11803 part.GetClassBases.
11805 2005-06-07 Raja R Harinath <rharinath@novell.com>
11807 Ensure that partial classes are registered in their enclosing
11808 namespace. Initial part of fix of #75160.
11809 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11810 Register declspace with namespace here, not in
11811 DeclSpace.RecordDecl.
11812 * cs-parser.jay: Pass namespace to RecordDecl.
11813 * class.cs (PartialContainer.Create): Likewise.
11814 (ClassPart.DefineType): New sanity-check. Throws an exception if
11816 * decl.cs (Declspace.RecordDecl): Remove.
11817 * namespace.cs (NamespaceEntry.DefineName): Remove.
11819 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11821 * rootcontext.cs: Reset TargetExt as well.
11823 2005-06-03 Raja R Harinath <rharinath@novell.com>
11825 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11826 -langversion:ISO-1.
11828 2005-06-02 Raja R Harinath <rharinath@novell.com>
11830 Fix #75080, cs0119.cs.
11831 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11833 (Expression.Resolve): ... this. Use it. Remove bogus code
11834 allowing ExprClass.Type and ExprClass.Namespace for
11835 ResolveFlags.VariableOrValue.
11836 (Expression.Resolve) [1-argument variant]: Change default resolve
11837 flags based on language version.
11838 (Expression.Error_UnexpectedKind): Use a simple string array
11839 rather than an ArrayList.
11840 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11841 not ExprClass.Type.
11842 (TypeOfVoid.DoResolve): Likewise.
11843 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11844 flags argument -- it always has the same value.
11846 2005-05-31 Raja R Harinath <rharinath@novell.com>
11849 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11850 Use it in the error message.
11851 * assign.cs, expression.cs, statement.cs: Update.
11853 2005-05-30 Raja R Harinath <rharinath@novell.com>
11856 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11857 the "almostMatchedMember" case too.
11858 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11859 that failed the accessibility checks to 'almost_match'.
11861 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11863 * attribute.cs: Use internal MethodBuilder methods to set
11864 ExactSpelling and SetLastError on PInvoke methods, instead
11865 of passing them via charset. Fixes #75060.
11867 2005-05-27 Raja R Harinath <rharinath@novell.com>
11869 * parameter.cs (Parameter): Remove TODO comment.
11870 (Parameter.DefineParameter): Remove Location parameter.
11871 (Parameters.LabelParameters): Likewise.
11872 * class.cs (Constructor.Emit): Update to change.
11873 (MethodData.Emit): Likewise.
11874 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11875 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11877 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11880 Removed Parameters.Location and added Parameter.Location instead.
11881 Removed Location parameter from Emit() and GetSignature().
11888 Modified all related calls.
11890 2005-05-26 Raja R Harinath <rharinath@novell.com>
11892 Improve user-defined conversion handling.
11893 * convert.cs (GetConversionOperators): Rewrite. Return only the
11894 applicable operators.
11895 (AddConversionOperators): New. Helper for GetConversionOperators.
11896 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11897 there is only one most encompassed/encompassing type.
11898 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11899 "applicable operator" handling.
11900 (UserConversion): Move cache here from GetConversionOperators.
11901 Directly cache the chosen operator, rather than the whole
11903 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11904 case. Allow conversion of decimal to sbyte and byte too.
11905 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11906 New static methods. Used to avoid allocating EmptyExpressions in
11909 2005-05-24 Duncan Mak <duncan@novell.com>
11911 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11912 another class, used in Convert.ExplicitNumericConversion.
11913 (CastToDecimal): New class, similar to above, but casts to
11914 System.Decimal, used in Convert.ImplicitNumericConversion and also
11915 in explicit convesion from double/float to decimal.
11917 * convert.cs (ImplicitNumericConversion): Handle implicit
11918 conversions to System.Decimal.
11919 (ExplicitNumericConversion): handle explicit conversions to
11924 2005-05-20 Miguel de Icaza <miguel@novell.com>
11926 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11927 know the type at this stage, just break through. Fixes #75008
11929 2005-05-19 Martin Baulig <martin@ximian.com>
11932 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11933 to disable error reporting.
11935 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11936 here since we don't want to report an error; see the new test-336.cs.
11938 2005-05-19 Raja R Harinath <rharinath@novell.com>
11940 * statement.cs (ToplevelBlock.GetParameterReference)
11941 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11942 Move here from class Block.
11943 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11944 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11946 2005-05-18 Martin Baulig <martin@ximian.com>
11951 (FlowBranching.Reachability): Add non-static public And() and Or()
11953 (FlowBranchingSwitch): New class; do the `break_origins' thing
11954 like in FlowBranchingLoop.
11955 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11956 reachability, not just locals and parameters.
11957 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11958 switch; MergeBreakOrigins() now takes care of that.
11960 2005-05-18 Martin Baulig <martin@ximian.com>
11962 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11963 a loop and may leave it, reset the barrier; fixes #74974.
11965 2005-05-17 Marek Safar <marek.safar@seznam.cz>
11967 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11970 * cs-parser.jay: Catch more lexical errors.
11972 * report.cs: Add one more Error method.
11975 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11977 2005-05-17 Martin Baulig <martin@ximian.com>
11979 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11982 2005-05-16 Raja R Harinath <rharinath@novell.com>
11984 Fix test-382.cs. Emit values of decimal constants.
11985 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11987 (TypeContainer.AddField): ... this.
11988 (TypeContainer.EmitFieldInitializers): Allow the list of fields
11989 with initializers to include 'Const's.
11990 (ClassPart.RegisterFieldForInitialization): Forward to
11992 * const.cs (Const.Const): Pass initializer to base class.
11993 (Const.Define): In case of decimal constants, register them for
11994 initialization in a static constructor.
11996 2005-05-14 Martin Baulig <martin@ximian.com>
11998 * statement.cs (Block.Resolve): Correctly handle unreachable code;
11999 do not call ResolveUnreachable() on unreachable statements in
12000 here, see the comment in the source code.
12002 2005-05-13 Raja R Harinath <rharinath@novell.com>
12005 * expression.cs (BinaryResolveOperator): If one of the operands of
12006 an equality comparison is 'null' and the other is a pointer type,
12007 convert the null to a NullPointer.
12008 * convert.cs (ImplicitReferenceConversion): If the expression is a
12009 NullLiteral and the target type is a pointer type, return a
12010 NullPointer instead.
12011 (ImplicitConversionStandard): Likewise.
12013 2005-05-13 Marek Safar <marek.safar@seznam.cz>
12015 * cs-parser.jay: Set readonly context based on special constructs.
12017 * expression.cs (LocalVariableReference.DoResolveBase): Improved
12018 readonly variable error handling.
12020 * rootcontext.cs (EmitCode): Don't verify members when error
12023 * statement.cs (LocalInfo): Add reaodnly context information.
12024 (SetReadOnlyContext, GetReadOnlyContext): New methods.
12026 2005-05-13 Raja R Harinath <rharinath@novell.com>
12028 * statement.cs (Block.Resolve): Revert change below. Modify fix
12029 for #74041 to initialize 'resolved' to false only for explicit
12030 blocks. Fixes #74873.
12032 2005-05-12 Raja R Harinath <harinath@gmail.com>
12035 * typemanager.cs (unmanaged_enclosing_types): New.
12036 (IsUnmanagedType): Avoid infloops by using
12037 'unmanaged_enclosing_types' to talk with recursive invocations.
12039 2005-05-13 Martin Baulig <martin@ximian.com>
12041 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12042 instance variable, not a local. Fix #74873.
12043 (Block.ResolveUnreachable): Set it to true here.
12045 2005-05-11 Duncan Mak <duncan@novell.com>
12047 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12048 continuing to process for 'arg'.
12049 (handle_preprocessing_directive): Check the argument of the #endif
12050 directive and report error CS1025 if there are any trailing
12053 According to the C# spec, having even whitespace after the #endif
12054 directive is illegal; however, because we call arg.TrimEnd ()
12055 beforehand, we have the same behavior as csc, allowing whitespace
12056 after the directive.
12060 2005-05-11 Marek Safar <marek.safar@seznam.cz>
12064 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12065 (Constructor.GetObsoleteAttribute): Implemented correctly.
12067 2005-05-10 Martin Baulig <martin@ximian.com>
12069 * support.cs (ReflectionParameters.ParameterModifier): Use
12070 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12071 and `ParameterAttributes.In'. Fixes #74884.
12073 2005-05-10 Marek Safar <marek.safar@seznam.cz>
12075 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12077 * expression.cs (Argument.GetParameterModifier): Turned to property.
12078 (Invocation.Error_InvalidArguments): Add more descriptive errors.
12080 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12083 2005-05-09 Raja R Harinath <rharinath@novell.com>
12086 * decl.cs (MemberCache.AddMethods): Register override methods,
12087 rather than non-override methods.
12088 * typemanager.cs (RegisterOverride): New.
12089 (IsOverride): Update.
12091 2005-05-09 Marek Safar <marek.safar@seznam.cz>
12095 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12096 recursive declaration.
12098 * statement.cs (Block.ResolveMeta): Report any error in resolving.
12100 2005-05-06 Marek Safar <marek.safar@seznam.cz>
12102 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12104 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12106 2005-05-05 Raja R Harinath <rharinath@novell.com>
12109 * decl.cs (DeclSpace.FamilyAccessible):
12110 Use TypeManager.IsNestedFamilyAccessible.
12112 Fix reopened #64812.
12113 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12116 2005-05-04 Raja R Harinath <rharinath@novell.com>
12117 Abin Thomas <projectmonokochi@rediffmail.com>
12118 Anoob V E <projectmonokochi@rediffmail.com>
12119 Harilal P R <projectmonokochi@rediffmail.com>
12122 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12123 allow access to all static members.
12125 2005-05-04 Martin Baulig <martin@ximian.com>
12127 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12129 2005-05-04 Martin Baulig <martin@ximian.com>
12133 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12134 section at the end; make things work if `default' is not the last
12137 2005-05-04 Martin Baulig <martin@ximian.com>
12141 * statement.cs (Switch): Replaced the `got_default' field with a
12142 `default_section' one.
12143 (Switch.CheckSwitch): Set `default_section' here.
12144 (Switch.Resolve): If we're a constant switch and the constant is
12145 not found, use the default section.
12147 2005-05-03 Martin Baulig <martin@ximian.com>
12149 * expression.cs (ArrayAccess.EmitGetLength): New public method.
12151 * statement.cs (Foreach.ArrayForeach): New nested class.
12152 (Foreach.TemporaryVariable): New nested class.
12153 (Foreach.EmitArrayForeach): Removed; this is now in the new
12154 ArrayForeach class.
12156 2005-05-03 Raja R Harinath <rharinath@novell.com>
12158 * pending.cs (BaseImplements): Move the #74773 fix here. This is
12160 (VerifyPendingMethods): Revert change below.
12162 * typemanager.cs (IsOverride, RegisterNonOverride): New.
12163 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12164 that used to trigger warning -28. Remove warning -28.
12165 * expression.cs (Invocation.OverloadResolve): Use
12166 TypeManager.IsOverride to distinguish override methods.
12169 * pending.cs (VerifyPendingMethods): If a base type implements the
12170 requested interface, don't bother checking individual methods of
12171 the base type. As a side-effect, this prevents the creation of
12172 unnecessary proxies.
12174 2005-05-02 Martin Baulig <martin@ximian.com>
12178 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12179 Also `And' the locals if the old vector is null.
12180 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12181 null; in this case we basically reset all the variables.
12183 2005-05-02 Martin Baulig <martin@ximian.com>
12187 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12188 Added `FlowBranching branching' argument; always `and' the
12189 variables instead of `or'ing them unless we're an infinite loop.
12191 * statement.cs (While.Resolve): Create a new sibling unless we're
12194 2005-05-02 Martin Baulig <martin@ximian.com>
12198 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12199 arguments; use it instead of creating a new TopLevelBlock.
12200 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12201 our ConstructorInitializer.
12204 (TopLevelBlock.TopLevelBranching): New public property.
12205 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12206 and create our `TopLevelBranching'.
12208 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12209 anonymous method host, use `block.TopLevelBranching' rather than
12210 creating a new branching.
12212 2005-04-20 Miguel de Icaza <miguel@novell.com>
12214 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12215 a ScopeInfo, if any of the current children is a child of the new
12216 entry, move those children there.
12218 2005-04-30 Martin Baulig <martin@ximian.com>
12220 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12221 at the beginning of a SwitchSection. Fix #73335.
12223 2005-04-27 Marek Safar <marek.safar@seznam.cz>
12226 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12228 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12229 (FieldExpr.DoResolve): Obsolete members are ignored for field
12232 2005-04-26 Marek Safar <marek.safar@seznam.cz>
12234 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12235 of arrays detection.
12237 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12239 (Field.VerifyClsCompliance): Volatile fields are not compliant.
12241 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12244 2005-04-25 Ben Maurer <bmaurer@ximian.com>
12246 * cs-parser.jay: Use the prefered version of -unsafe in error
12249 2005-04-22 Marek Safar <marek.safar@seznam.cz>
12251 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12254 2005-04-20 John Luke <john.luke@gmail.com>
12256 * driver.cs: fix typo in error message, --outout to --output
12258 2005-04-20 Marek Safar <marek.safar@seznam.cz>
12260 * codegen.cs (InRefOutArgumentResolving): New field.
12262 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12263 fields outside contructor.
12265 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12267 2005-04-19 Miguel de Icaza <miguel@novell.com>
12269 * anonymous.cs (CaptureContext.EmitParameterInstance): The
12270 parameter code was not completed ever, so it was not as up-to-date
12271 as local variables. Must finish it.
12273 The bug fix was to compare the Toplevel of the block, not the
12274 current block. Thanks for Ben for pointing this out.
12276 2005-04-19 Raja R Harinath <rharinath@novell.com>
12278 * decl.cs (AddMethods): Use the declaring type of the problem
12279 method to determine if we want to squash a warning.
12281 2005-04-19 Marek Safar <marek.safar@seznam.cz>
12283 * attribute.cs: Removed debug output.
12285 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12287 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12290 2005-04-18 Raja R Harinath <rharinath@novell.com>
12293 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12294 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12295 all null comparisons against reference types.
12297 2005-04-18 Marek Safar <marek.safar@seznam.cz>
12300 * class.cs (TypeContainer.CircularDepException) New nested
12302 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12303 (TypeContainer.DefineType): Removed error, reset InTransit before
12305 (Class.DefineType): Throw exception when is in Transit.
12306 Catch exception and report error.
12307 (Struct.DefineType): Throw exception when is in Transit.
12308 Catch exception and report error.
12309 (Interface.DefineType): Throw exception when is in Transit.
12310 Catch exception and report error.
12312 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12313 handle nested exception handlers.
12315 * flowanalysis.cs (InTryWithCatch): New method, search for try with
12318 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12319 InFinally and InCatch storage.
12321 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12322 (Catch.Resolve): Set and Restore ec.InCatch.
12323 (Try.Resolve): Set and Restore ec.InFinally.
12324 (Try.HasCatch): True when try has catch.
12326 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
12328 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12329 for the same event member, so exclude such cases from warning 419.
12332 2005-04-16 Miguel de Icaza <miguel@novell.com>
12334 * expression.cs (Binary.ResolveOperator): Apply patch from John
12335 Luke to fix bug 59864: operators &, | and ^ on enumerations
12336 require that the same enum type on both sides.
12338 * driver.cs: Add warnings to old flag usage, this is to assist
12339 people who produce Makefiles and hope that the Makefiles will be
12342 * class.cs (TypeContainer.EmitType): Moved the definition of the
12343 special $PRIVATE$ field from the resolve phase to the Emit phase.
12344 During resolve we do not know if we are a struct with
12345 HasExplicitLayout, we know this only after the attributes for the
12348 Set the FieldOffset to zero on the dummy field that we create for
12349 the class. Fixes 74590.
12351 2005-04-16 Raja R Harinath <rharinath@novell.com>
12354 * ecore.cs (PropertyExpr.resolved): New.
12355 (DoResolve): Use it to handle a case of double resolution here.
12356 Handle a case of identical-name-and-type-name.
12357 * expression.cs (ArrayCreation.CheckIndices): Avoid double
12358 resolution by storing the results of expression resolution back
12359 into the "probes" array.
12361 2005-04-15 Raja R Harinath <rharinath@novell.com>
12363 Fix cs0208-7.cs and cs0208-8.cs.
12364 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12365 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
12366 error reporting to point out the reason a struct is not unmanaged.
12368 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12370 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
12371 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12373 2005-04-13 Raja R Harinath <rharinath@novell.com>
12376 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12377 IdenticalNameAndTypeName here.
12378 (EventExpr.InstanceResolve): Likewise.
12380 2005-04-13 Marek Safar <marek.safar@seznam.cz>
12382 C# 2.0 DefaultCharSetAttribute implementation
12384 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12385 which allows us to set GlobalNamespace for every resolve.
12386 (Attribute.ResolveArguments): Cut from Resolve.
12387 (Attribute.GetCharSetValue): Returns CharSet named argument.
12388 (Attribute.DefinePInvokeMethod): Gets default charset from
12390 (GlobalAttribute.ResolveAsTypeStep): Override.
12391 (GlobalAttribute.ResolveArguments): Override.
12393 * class.cs (TypeAttr): Is protected.
12395 * codegen.cs (ModuleClass.DefaultCharSet): New member.
12396 (ModuleClass.DefaultCharSetType): New memeber.
12397 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12399 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12400 charset from module.
12402 * delegate.cs (TypeAttr): Override.
12403 (Delegate.DefineType): Use this TypeAttr.
12405 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12406 at very early stage (before types are defined) to resolve model
12407 module attributes. It will probably not work with corlib but it
12410 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12411 charset from module.
12413 * typemanager.cs (default_charset_type): New type.
12415 2005-04-13 Raja R Harinath <rharinath@novell.com>
12417 * decl.cs (MemberCache.AddMethods): Don't warn if
12418 System.Object.Finalize has buggy MethodAttributes.
12420 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12423 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12425 * doc.cs : detect ambiguous reference to overloaded members.
12426 Fixed bug #71603. MS 1.1 csc does not detect it.
12428 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12430 * doc.cs : delegates must not be referenced with parameters.
12433 2005-04-12 Miguel de Icaza <miguel@novell.com>
12435 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12437 2005-04-10 Miguel de Icaza <miguel@novell.com>
12439 * driver.cs (MainDriver): Stop processing if the CLS stage found
12442 (CompilerCallableEntryPoint.InvokeCompiler): Always
12443 reset after execution; Take a TextWriter argument for the
12446 * report.cs: Use the error stream instead of hardcoding stderr.
12448 2005-04-09 Miguel de Icaza <miguel@novell.com>
12450 * class.cs: Reduce code paths to test, too small of an
12451 optimization to make it worth the extra testing. Always perform
12454 2005-04-08 Raja R Harinath <rharinath@novell.com>
12457 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12458 operators that had errors reported on them.
12460 2005-04-08 Marek Safar <marek.safar@seznam.cz>
12462 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12464 (Attribute.Resolve): Add named argument type checking.
12466 * class.cs (FixedField.Define): Use IsPrimitiveType
12468 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12470 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12471 unsafe parameter types.
12473 * statement.cs (Using.ResolveExpression): Add better error description.
12475 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12477 2005-04-08 Raja R Harinath <rharinath@novell.com>
12480 * attribute.cs (Attribute.GetAttributeUsage): Resolve
12481 AttributeUsageAttribute in the emitcontext of the attribute class,
12482 not in the emitcontext of the attributable entity it was attached to.
12483 * cs-parser.jay: Use 'current_class', not 'current_container',
12484 when creating a GlobalAttribute.
12486 2005-04-08 Alp Toker <alp@atoker.com>
12488 * pending.cs: The fix to #58413 failed to compile methods implementing
12489 interfaces with/without params modifiers and vice versa, even though
12490 params modifiers aren't part of the signature. Make the modifier check
12491 less strict as in csc.
12493 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
12494 Anoob V E <projectmonokochi@rediffmail.com>
12495 Harilal P R <projectmonokochi@rediffmail.com>
12498 * pending.cs (TypeAndMethods.mods): New. Store the parameter
12499 modifiers of pending methods.
12500 (PendingImplementation.PendingImplementation): Initialize it.
12501 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12502 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12503 with ParameterData. Add check for modifiers.
12504 * class.cs (MethodData.Define): Update to changes.
12506 2005-04-07 Raja R Harinath <rharinath@novell.com>
12508 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12510 2005-04-07 Marek Safar <marek.safar@seznam.cz>
12512 * class.cs (PropertyMethod.Define): Check private accessor in abstract
12515 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12518 * typemanager.cs: Registered RequiredAttributeAttribute.
12520 2005-04-06 Marek Safar <marek.safar@seznam.cz>
12522 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12523 Warning CS0169 is back at level 3.
12524 (IMethodData.SetMemberIsUsed): New method.
12526 * decl.cs (IsUsed): New value; moved from FieldBase.Status
12527 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12529 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12531 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12533 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12536 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12539 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12540 to avoid the problems with nested types.
12542 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12543 Anoob V.E <projectmonokochi@rediffmail.com>
12544 Harilal P.R <projectmonokochi@rediffmail.com>
12545 Raja R Harinath <rharinath@novell.com>
12548 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12550 * typemanager (GetConstructor): Make public.
12552 2005-04-05 John Luke <john.luke@gmail.com>
12553 Raja R Harinath <rharinath@novell.com>
12556 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12557 struct too. Return false quicker in a few cases.
12558 (VerifyUnManaged): Use it.
12560 2005-04-05 Raja R Harinath <rharinath@novell.com>
12563 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12564 not 'unreachable_seen'.
12566 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12568 * attribute.cs (Attribute.GetValue): Removed unused.
12570 * codegen.cs (CodeGen.TrimExt): Removed unused.
12572 * cs-parser.jay (output): Removed unused.
12574 * cs-tokenizer.cs (hex_digits): Removed unused.
12576 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12578 * expression.cs (Indirection.LoadExprValue): Removed unused.
12579 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12581 * iterators.cs (Iterator.param_types): Removed unused.
12583 * statement.cs (Goto.block): Removed unused.
12584 (ToplevelBlock.did): Removed unused.
12585 (Switch.ResolveConstantSwitch): Removed unused.
12587 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12589 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12592 2005-04-01 Raja R Harinath <rharinath@novell.com>
12594 Fix #74232 and cs0208-3.cs.
12595 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12596 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12597 unmanaged type. Don't use FieldBuilders when 't' is a
12598 TypeBuilder. Use ModFlags and MemberType fields.
12599 * class.cs (MemberBase.member_type): Rename from MemberType.
12600 (MemberBase.MemberType): New property. Determines member_type on
12602 (MemberBase.DoDefine): Don't initialize MemberType here.
12603 (FieldMember.Define): Likewise.
12605 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12608 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12609 Attributes are emitted there.
12611 2005-04-01 Raja R Harinath <rharinath@novell.com>
12613 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12614 keyword in 'partial enum' too.
12615 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12617 Report from Kamil Skalski <nazgul@omega.pl>.
12620 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12621 have partial containers too.
12623 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12624 in block' checks to Block.CheckInvariantMeaningInBlock.
12625 * statement.cs (Block.GetKnownVariableInfo): Make private.
12626 (Block.IsVariableUsedInChildBlock): Remove.
12627 (Block.IsVariableUsedInBlock): Likewise.
12628 (Block.CheckInvariantMeaningInBlock): New. Show location of
12629 conflicting declaration.
12630 (Block.AddVariable): Make error messages less long-winded and more
12631 specific. Show location of conflicting declaration.
12632 * parameter.cs (Parameters.Location): New readonly property.
12634 2005-03-31 Raja R Harinath <rharinath@novell.com>
12636 Clean up semantics of invoking ResolveMemberAccess.
12637 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12638 can have an instance, ensure that we pass in a non-TypeExpression
12639 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12640 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12641 argument. Update to changes and simplify.
12642 (FieldExpr.Emitinstance): Remove CS0120 check.
12643 (PropertyExpr.EmitInstance): Likewise.
12644 * expression.cs (Argument.Resolve): Likewise.
12645 (Invocation.DoResolve): Update to changes in semantics of
12646 InstanceExpression.
12648 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12651 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12654 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12656 2005-03-31 Raja R Harinath <rharinath@novell.com>
12658 Fix difference in behaviour with commandline invocation.
12659 * driver.cs (Driver.Reset): New.
12660 (CompilerCallableEntryPoint): Call it.
12662 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12663 variable" warnings if the boolean expression failed to resolve.
12665 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12667 * attribute.cs: Fix the union of several permissions when some of them
12668 are unrestricted (so the result isn't an unrestricted permission set).
12671 2005-03-30 Raja R Harinath <rharinath@novell.com>
12673 * ecore.cs (MemberExpr): New class. Convert from interface
12675 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12676 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12678 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12679 (MethodGroupExpr.IsExplicitImpl): Remove.
12680 (Expression.GetFieldFromEvent): Remove.
12681 (SimpleName.MemberStaticCheck): Remove.
12682 (SimpleName.DoSimpleNameResolve): Update to changes.
12683 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12684 (MemberAccess.IdenticalNameAndTypeName): Remove.
12685 (MemberAccess.error176): Move to MemberExpr.
12686 (MemberAccess.DoResolve): Update to changes.
12687 (BaseAccess.DoResolve): Likewise.
12689 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12691 C# 2.0 Conditional attribute class implementation
12693 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12694 Analyzes class whether it has attribute which has ConditionalAttribute
12695 and its condition is not defined.
12697 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12698 (Class.IsExcluded): New method. Search for at least one defined
12699 condition in ConditionalAttribute of attribute class.
12701 2005-03-30 Raja R Harinath <rharinath@novell.com>
12703 * ecore.cs (PropertyExpr): Derive from Expression, not
12704 ExpressionStatement.
12705 (PropertyExpr.EmitStatement): Remove.
12707 2005-03-29 Raja R Harinath <rharinath@novell.com>
12710 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12711 internal field "value__" of an enum be private. The examples for
12712 "value__" that I found on MSDN all used FieldAttributes.Private.
12714 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12715 Don't mention IL method attribute names.
12717 Fix #47991. Remove a TODO.
12718 * statement.cs (Block.Toplevel): Make into a field.
12719 (Block.Parameters): Move into ToplevelBlock.
12720 (Block.known_variables): Rename from child_variable_names.
12721 (Block.Block): Remove variants that take Parameters. Initialize
12722 'Toplevel' with the immediately surrounding toplevel block.
12723 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12724 LocalInfo parameter.
12725 (Block.GetKnownVariableInfo): New.
12726 (Block.IsVariableNameUsedInChildBlock): Update.
12727 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12728 the block, even though it may not be in scope.
12729 (Block.AddVariable): Remove Parameters parameter. Use
12730 Toplevel.Parameters instead.
12731 (Block.AddConstant): Remove Parameters parameter.
12732 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12733 (Block.IsParamaterReference): Likewise.
12734 (Block.IsLocalParameter): Likewise. Simplify a lot.
12735 (ToplevelBlock.Parameters): New. Moved from Block.
12736 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12737 initialize Parameters to a non-null value.
12738 * cs-parser.jay: Update to changes.
12739 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12740 simple names that mean different things in the same block. Use
12741 Block.IsVariableNameUsedInBlock.
12743 2005-03-28 Raja R Harinath <rharinath@novell.com>
12745 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12746 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12747 GetTypeHandle. It is possible for a reflected type to derive from
12748 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12749 System.Array during mscorlib compilation).
12750 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12751 contain a method_hash, don't create one either. Don't create a
12752 deep copy of the base cache's method_hash.
12753 (MemberCache.SetupCache): Rename back from DeepCopy.
12754 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12755 already initialized. If we see an override function, add its
12756 underlying base virtual function to the member_hash too.
12758 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12760 2005-03-26 Raja R Harinath <harinath@acm.org>
12763 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12764 fails to resolve, ensure that the LHS is still resolved as an
12767 2005-03-25 Raja R Harinath <harinath@acm.org>
12769 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12771 (Enum.current_ec): Remove.
12772 (Enum.LookupEnumValue): Remove EmitContext argument.
12773 Just uses the one created during DefineType.
12774 (Enum.FindMembers): Update.
12775 * expression.cs (MemberAccess.DoResolve): Update.
12777 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12779 * assign.cs (Assign.DoResolve): Check for CS1717 when
12780 source and target are same (uses Equals).
12782 * expression.cs (LocalVariableReference, ParameterReference,
12783 This): Implemented Equals, GetHashCode.
12785 * statement.cs (Block.GetParameterReference): Removed useless
12788 2005-03-22 Raja R Harinath <rharinath@novell.com>
12791 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12792 blocks before deciding whether the error is cs0136 or cs0128.
12794 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12795 (using_alias_directive, using_namespace_directive): Pass
12796 MemberName, not an expression to Namespace.UsingAlias and
12798 (MakeName): Use the MemberName of the namespace.
12799 * namespace.cs (Namespace.MemberName): New.
12800 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12801 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12803 * decl.cs (MemberName.Name): Make readonly.
12804 (MemberName.FromDotted): New "constructor".
12805 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12806 (MemberCore.Name): Compute from MemberName on demand.
12807 (MemberCore.SetMemberName): Provide a way to change the
12809 (MemberCore.AddToContainer): Don't take a fullname parameter.
12810 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12811 fully qualified name of the container to the member name.
12812 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12813 only if the type is a member of the root container.
12814 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12815 MemberName.Left rather than searching for an embedded ".".
12816 (PartialContainer.CreatePart): Update to changes in RootContext.
12817 (MemberBase.ShortName): Turn into a property. Use
12818 MemberCore.SetMemberName.
12819 (MemberBase.ExplicitInterfaceName): Remove.
12820 (MemberBase.UpdateMemberName): Remove.
12821 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12822 (PropertyBase.SetMemberName): New override.
12823 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12824 (Tree.GetDecl): New.
12825 (Tree.AllDecls): Rename from Decls.
12826 * attribute.cs, enum.cs, report.cs: Update to changes.
12827 * driver.cs (MainDriver): Use MemberName.FromDotted on
12828 RootContext.MainClass.
12830 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12832 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12835 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12837 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12839 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12840 property accessor modifiers.
12842 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12843 fixed buffer attribute (CS1716).
12844 (PropertyMethod.HasCustomAccessModifier): When property accessor
12845 has custom modifier.
12847 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12849 (PropertyExpr.DoResolveLValue): Add CS0272.
12851 2005-03-17 Miguel de Icaza <miguel@novell.com>
12853 * convert.cs: When converting to a pointer, use the proper Conv.U
12854 or Conv.I depending on the source data type.
12856 * cs-tokenizer.cs: Make the size for large decimal constants,
12859 2005-03-17 Martin Baulig <martin@ximian.com>
12861 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12862 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12864 2005-03-17 Martin Baulig <martin@ximian.com>
12866 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12867 to bool so we can return an error condition.
12868 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12871 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12873 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12876 2005-03-16 Raja R Harinath <rharinath@novell.com>
12878 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12879 Refactor to avoid traversing the list of assemblies, and to avoid
12880 string concatenation.
12881 * typemanager.cs (guid_attr_type): Remove.
12882 (negative_hits, pointers, references): Remove hashes.
12884 (GetConstructedType): New. Uses type_hash to handle constructed
12885 types (arrays, references, pointers).
12886 (GetReferenceType, GetPointerType): Use it.
12887 (GetNestedType): New. Uses type_hash to handle nested types of
12889 (LookupType, LookupTypeDirect): Remove.
12890 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12891 'types' hash and LookupTypeReflection directly.
12892 (params_string, params_object): Use GetConstructedType.
12893 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12895 (Namespace.Lookup): Use cached_types.
12896 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12897 provided by old TypeManager.LookupType.
12898 * rootcontext.cs (MakeFQN): Remove.
12899 * decl.cs (DeclSpace.MakeFQN): Likewise.
12900 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12901 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12902 TypeManager.GetConstructedType.
12903 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12905 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12907 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12910 * cs-parser.jay: Reports CS1527 for any namespace element.
12912 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12915 * expression.cs (ParameterReference.IsAssigned): Changed error to
12917 (Error_WrongNumArguments): Moved CS0245 detection here.
12919 * statement.cs (Return.Resolve): Add CS1622 report.
12921 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12923 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12925 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12927 * attribute.cs expression.cs: Get rid of some allocations.
12929 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12931 * doc.cs : just eliminate the latest change.
12933 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12935 * doc.cs : commented out the latest change. It breaks xml-030.cs
12937 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12939 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12940 fail. So invoke CreateType() in FindDocumentedType().
12942 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12944 * cs-tokenizer.cs : added IsKeyword().
12945 * doc.cs : Detect keyword incorrectly used as identifier.
12946 Allow identifiers prefixed by @.
12948 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12950 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12951 It caused exception in namespace resolving (again!).
12953 * class.cs (Class.ctor): Removed exit.
12954 (PropertyMethod.ctor): ditto.
12956 * codegen.cs (Codegen.Reset): Reset static data.
12957 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12959 * cs-tokenizer.cs (Cleanup): Removed.
12961 * driver.cs (GetSystemDir): Rewrote to one line command.
12962 It caused problem with unloaded dynamic modules.
12963 (UnixParseOption): Removed Exit.
12964 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12965 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12966 Now can be mcs used as library.
12968 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12971 * location.cs (Reset): Reset static data.
12973 * namespace.cs (Reset): Reset static data.
12975 * report.cs (Report.Reset): Reset static data.
12977 * rootcontext.cs (RootContext.Reset): Reset static data.
12979 * tree.cs (RootTypes.ctor): Use Location.Null
12981 * typemanager.cs (TypeManager.Reset): Reset static data.
12982 (CoreLookupType): Removed Exit.
12983 (TypeHandle.Reset): Reset static data.
12985 2005-03-10 Raja R Harinath <rharinath@novell.com>
12988 * typemanager.cs (ComputeNamespaces): Import namespaces from
12989 referenced modules too.
12991 2005-03-09 Raja R Harinath <rharinath@novell.com>
12993 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12996 2005-03-09 Raja R Harinath <rharinath@novell.com>
12998 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12999 enclosing DeclSpace. This ensures that a name-lookup populates
13000 more caches and there are fewer 'TypeExpression's. Carve out
13001 nested type lookup into ...
13002 (LookupNestedTypeInHierarchy): ... this.
13004 2005-03-09 Raja R Harinath <rharinath@novell.com>
13006 Clean up a few partial-class semantics.
13007 Fixes test-357.cs and cs1618-2.cs.
13008 * cs-parser.jay (struct_declaration): Use 'current_class' as
13009 parent of newly-created struct. Remove call to Register ().
13010 Use 'pop_current_class' to complete handing the current struct.
13011 (interface_declaration): Likewise.
13012 (class_declaration): Likewise.
13013 (enum_declaration): Use 'current_class' as parent of newly created
13015 (delegate_declaration): Likewise.
13016 (pop_current_class): New function. This is used to handle closing
13017 up the 'current_class' and 'current_container', and pointing them
13018 to the enclosing class/container.
13019 (CSharpParser): Initialize 'current_class' too.
13020 * decl.cs (MemberCore): Add check for invariant: a partial
13021 container is not a parsed entity, and thus does not enclose any
13023 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13024 (DeclSpace.BaseTypeExpr): Use it.
13025 (DeclSpace.LookupType): Add check for invariant.
13026 * class.cs (TypeContainer): Add check for invariant: a nested
13027 class should have the same NamespaceEntry as its enclosing class.
13028 (TypeContainer.EmitFieldInitializers): Make virtual.
13029 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13031 (TypeContainer.Register): Remove.
13032 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13033 null. Use TypeResolveEmitContext for resolving base types and
13034 interfaces. Move initialization of Parts.TypeBuilder here from
13036 (TypeContainer.DefineNestedTypes): ... here.
13037 (PartialContainer): Take a Namespace not a NamespaceEntry.
13038 (PartialContainer.Create): Don't use Register. Call the
13039 appropriate Add... function directly.
13040 (ClassPart): Take both the PartialContainer and the enclosing
13041 class as constructor arguments.
13042 (ClassPart.EmitFieldInitializers): Override.
13043 (ClassPart.PartFindNestedTypes): Remove.
13044 (FieldBase.GetInitializerExpression): Resolve the initializer
13045 expression in the emit context of the enclosing class.
13046 * tree.cs (RootTypes): Remove Register ().
13048 2005-03-08 Marek Safar <marek.safar@seznam.cz>
13050 * cs-parser.jay: Removed CS0134.
13052 * driver.cs: Removed CS1901.
13054 * expression.cs (SizeOf.DoResolve): Don't report CS0233
13055 for predefined types.
13057 2005-03-07 Duncan Mak <duncan@novell.com>
13059 * codegen.cs (Save): Catch UnauthorizedAccessException as
13060 well. Fixes bug #73454.
13062 2005-03-07 Marek Safar <marek.safar@seznam.cz>
13064 * cs-tokenizer.cs (xtoken): Add CS1035.
13066 * class.cs (MethodData.Define): Add CS0683.
13067 (FieldMember.ctor): Add CS0681.
13069 2005-03-07 Raja R Harinath <rharinath@novell.com>
13071 * ecore.cs (SimpleName.DoResolve): Rename from
13072 SimpleName.DoResolveAllowStatic.
13073 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13074 Pass 'intermediate' flag to MemberStaticCheck.
13075 (SimpleName.MemberStaticCheck): Skip "static check" only in case
13076 of "intermediate" lookups via MemberAccess.
13077 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
13078 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13080 2005-03-07 Raja R Harinath <rharinath@novell.com>
13083 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13084 slipped in because of variable names that are identical to a
13085 builtin type's BCL equivalent ('string String;', 'int Int32;').
13086 (PropertyExpr.EmitInstance): Likewise.
13088 2005-03-04 Marek Safar <marek.safar@seznam.cz>
13090 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13092 * report.cs (warning_ignore_table): Made public.
13094 2005-03-04 Raja R Harinath <rharinath@novell.com>
13097 * class.cs (MethodData.Emit): Pass 'container' to
13098 container.GetObsoleteAttribute instead of 'container.Parent'.
13100 2005-03-03 Marek Safar <marek.safar@seznam.cz>
13102 * cs-parser.jay: Add 1534 error test.
13104 * iterators.cs (Yield.CheckContext): Add error 1629.
13105 (Iterator.ctor): Save unsafe modifier.
13106 (MoveNextMethod.DoEmit): Restore unsafe context.
13108 * namespace.cs (UsingAlias): Better error message.
13110 2005-03-03 Dan Winship <danw@novell.com>
13112 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13113 the warning message [#73219]
13115 2005-03-03 Raja R Harinath <rharinath@novell.com>
13117 Fix compile with MCS 1.0.0.0.
13118 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13119 w_restore to not depend on string constant folding.
13121 2005-03-03 Raja R Harinath <rharinath@novell.com>
13123 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
13124 CS0246 check to users who passed 'silent = false'.
13125 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13127 (SimpleName.SimpleNameResolve): Update.
13128 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13129 (MemberAccess.IdenticalNameAndTypeName): Update.
13130 * doc.cs (FindDocumentedTypeNonArray): Update.
13132 2005-03-03 Raja R Harinath <rharinath@novell.com>
13134 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13135 * parameters.cs (ComputeAndDefineParameters): Remove.
13136 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13137 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13138 Use GetParameterInfo.
13140 2005-03-02 Marek Safar <marek.safar@seznam.cz>
13142 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13144 2005-03-02 Raja R Harinath <rharinath@novell.com>
13146 Unify DeclSpace.LookupType and DeclSpace.FindType.
13147 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
13148 is in charge of defining nested types on demand.
13149 (DeclSpace.LookupType): Use it when the current_type is a
13150 TypeBuilder. Use LookupTypeDirect for reflected types.
13151 (DeclSpace.FindType): Remove.
13152 (DeclSpace.LookupInterfaceOrClass): Likewise.
13153 (DeclSpace.DefineTypeAndParents): Likewise.
13154 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13155 DeclSpace.LookupType.
13156 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13157 * typemanager.cs (LookupType): Simplify.
13158 (AddUserType): Remove type from negative_hits.
13159 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13160 * class.cs (TypeContainer.FindMembers): Move handling of nested
13162 (TypeContainer.FindMembers_NestedTypes): ... here.
13163 (TypeContainer.FindNestedType): Implement override.
13164 (ClassPart.FindNestedType): Delegate to PartialContainer.
13165 (ClassPart.PartFindNestedType): Looks up the nested types of the
13168 2005-03-02 Martin Baulig <martin@ximian.com>
13170 * class.cs (TypeContainer.DoDefineMembers): We also need a default
13171 static constructor in static classes.
13173 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
13175 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13176 sizeParamIndex is not specified.
13178 2005-03-01 Marek Safar <marek.safar@seznam.cz>
13181 * report.cs (WarningMessage.IsEnabled): Missing null check.
13183 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13185 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13186 in the fields and not in the properties.
13188 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
13190 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
13193 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13195 * attribute.cs: Small refactoring (improved robustness).
13196 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13197 (ValidateGuid): Removed.
13198 (Resolve): Removed referenced to above mentioned.
13199 (GetAttributeUsage): Made private and changed to work without
13201 (GetIndexerAttributeValue): Don't crash.
13202 (GetConditionalAttributeValue): Ditto.
13203 (GetClsCompliantAttributeValue): Ditto.
13204 (ExtractSecurityPermissionSet): All attributes exceptions are
13206 (GetPropertyValue): New helper.
13207 (GetMethodImplOptions): New method.
13208 (DefinePInvokeMethod): Reuse common code. Implemented handling of
13209 some missing properties.
13211 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13212 (Method.ApplyAttributeBuilder): Updated.
13214 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13217 2005-02-28 Raja R Harinath <rharinath@novell.com>
13220 * report.cs (Report.SymbolRelatedToPreviousError): Handle
13221 non-simple types (array, pointer, reference).
13223 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13225 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13227 * class.cs (MethodCore.IsDuplicateImplementation): Special error
13229 (Method.CheckBase): Catch wrong destructor here.
13230 (MethodData.Define): Add errors 550, 668.
13232 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13234 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13236 * pending.cs (VerifyPendingMethods): Add error 551.
13238 * typemanager.cs (CSharpName): Next error report helper.
13240 2005-02-25 Marek Safar <marek.safar@seznam.cz>
13242 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13243 attributes. Removed useless attribute double check.
13244 It saves almost 2MBs for corlib.
13246 2005-02-25 Raja R Harinath <rharinath@novell.com>
13249 * statement.cs (ExpressionStatement.Resolve): Make robust to being
13250 called twice in case of error.
13252 2005-02-23 Chris Toshok <toshok@ximian.com>
13254 Fix compiler portions of #72827.
13255 * statement.cs (Block.Emit): call Begin/EndScope on the
13256 EmitContext instead of the ILGenerator.
13258 * codegen.cs (EmitContext.BeginScope): new method, call
13259 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13261 (EmitContext.BeginScope): same, but EndScope and CloseScope
13263 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13264 offset and call the superclass's OpenScope(int) with it.
13265 (SymbolWriter.CloseScope): get the current il
13266 offset and call superclass's CloseScope(int) with it.
13268 2005-02-23 Marek Safar <marek.safar@seznam.cz>
13270 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13271 CS1677 for out and ref as well.
13273 * class.cs (Method.Define): Add error CS1599 detection.
13275 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13277 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13279 * delegate.cs (Delegate.Define): Add error CS1599 detection.
13281 * support.cs.cs (ModifierDesc): New helper method.
13283 2005-02-23 Raja R Harinath <rharinath@novell.com>
13284 Abin Thomas <projectmonokochi@rediffmail.com>
13285 Anoob V E <projectmonokochi@rediffmail.com>
13286 Harilal P R <projectmonokochi@rediffmail.com>
13288 Fix #57851, #72718.
13289 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13290 MemberLookup (used for error reporting) actually returns a result.
13291 Fix error report number (122, not 112).
13293 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
13294 Anoob V E <projectmonokochi@rediffmail.com>
13295 Harilal P R <projectmonokochi@rediffmail.com>
13298 * pending.cs (PendingImplementation.GetAbstractMethods):
13299 Find NonPublic members too.
13301 2005-02-22 Marek Safar <marek.safar@seznam.cz>
13303 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13306 * class.cs (MethodCore.CheckMethodAgainstBase):
13307 Add error 239 report.
13309 2005-02-21 Raja R Harinath <rharinath@novell.com>
13312 * expression.cs (Invocation.IsApplicable): Make public.
13313 (Invocation.IsParamsMethodApplicable): Likewise.
13314 * delegate.cs (Delegate.VerifyApplicability): Don't use
13315 Invocation.VerifyArgumentCompat for parameter applicability
13316 testing. Use Invocation.IsApplicable and
13317 Invocation.IsParamsMethodApplicable.
13319 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13321 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13323 * class.cs (Operator.Define): Add error 217 report.
13325 2005-02-21 Raja R Harinath <rharinath@novell.com>
13327 * namespace.cs (UsingEntry.Resolve): Undo change below.
13329 2005-02-21 Raja R Harinath <rharinath@novell.com>
13332 * ecore.cs (Expression.MemberLookupFailed): Add argument to
13333 disable the error message when the extended MemberLookup also
13335 (Expression.MemberLookupFinal): Update.
13336 (SimpleName.DoSimpleNameResolve): Update.
13337 * expression.cs (MemberAccess.ResolveNamespaceOrType):
13338 Don't use MemberLookupFinal.
13339 (New.DoResolve): Update.
13340 (BaseAccess.CommonResolve): Update.
13342 2005-02-21 Raja R Harinath <rharinath@novell.com>
13345 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13346 occured previously, don't resolve again.
13348 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13351 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13352 argument. Call ResolveAttributeUsage for unresolved.
13353 when types doesn't match ctor arguments.
13355 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13356 for nested attribute classes.
13357 (Class.attribute_usage): Removed.
13358 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13359 for attribute class.
13361 * ecore.cs (IsAttribute): Removed.
13363 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13365 * rootcontext.cs (RegisterAttribute): Removed, attributes are
13367 (attribute_types): Removed.
13368 (EmitCode): Global attributes are emited as the latest.
13370 2005-02-18 Marek Safar <marek.safar@seznam.cz>
13372 * class.cs (EmitFieldInitializers): Don't emit field initializer
13373 for default values when optimilization is on.
13375 * constant.cs (Constant.IsDefaultValue): New property.
13377 * driver.cs: Add /optimize handling.
13381 * literal.cs: Implement new IsDefaultValue property.
13383 * rootcontext.cs (Optimize): New field, holds /optimize option.
13385 2005-02-18 Raja R Harinath <rharinath@novell.com>
13387 Fix crasher in re-opened #72347.
13388 * namespace.cs (Namespace.Lookup): Return null if
13389 DeclSpace.DefineType returns null.
13392 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13394 2005-02-18 Raja R Harinath <rharinath@novell.com>
13396 Fix remainder of #63202. Change semantics of DoResolveLValue: it
13397 now returns null if it cannot resolve to an lvalue.
13398 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13399 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13400 returned null. Remove check for SimpleName.
13401 (EventExpr.DoResolveLValue): New.
13402 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13403 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
13405 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
13406 avoid CS0131 error.
13407 (Unary.ResolveOperator): Move CS0211 check ...
13408 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
13410 (Unary.DoResolveLValue): Simplify.
13411 (AddressOf.DoResolveLValue): New.
13412 (ArrayAccess.DoResolveLValue): New.
13414 2005-02-16 Marek Safar <marek.safar@seznam.cz>
13416 * attribute.cs (Attribute.Resolve): Add arguments casting for
13417 when types doesn't match ctor arguments.
13419 2005-02-16 Raja R Harinath <rharinath@novell.com>
13421 Fix parts of #63202.
13422 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13423 lookup of operator in base type. Ensure that all checks happen
13424 when the operator resolves to an "op_..." method.
13426 2005-02-15 Raja R Harinath <rharinath@novell.com>
13429 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13430 'ignore_cs0104' parameter. Pass it to ...
13431 (NamespaceEntry.Lookup): ... this.
13432 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13433 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13434 (TypeLookupExpression.DoResolveAsTypeStep): Update.
13435 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13436 Update. Request that cs0104 errors be ignored.
13437 (ComposedCast.ResolveAsTypeStep): Update.
13439 2005-02-14 Raja R Harinath <rharinath@novell.com>
13442 * expression.cs (Invocation.BetterFunction): Remove support for
13443 comparing virtual functions and their overrides.
13444 (Invocation.IsOverride): New.
13445 (Invocation.OverloadResolve): Don't consider 'override' functions
13446 during candidate selection. Store them in a lookaside list.
13447 If the selected method is a 'virtual' function, use the list to
13448 find any overrides that are closer to the LHS type.
13450 2005-02-14 Marek Safar <marek.safar@seznam.cz>
13452 * expression.cs (New.DoResolve): Add complex core type reduction.
13453 (New.Constantify): Converts complex core type syntax like 'new int ()'
13454 to simple constant.
13456 2005-02-14 Raja R Harinath <rharinath@novell.com>
13458 * decl.cs (EntryType.EntryType): New constructor to create an
13459 updated copy of a cache entry.
13460 (MemberCache.AddMethods): Use it.
13461 (MemberCache.ClearDeclaredOnly): Remove.
13462 (MemberCache.MemberCache): Update.
13464 2005-02-11 Miguel de Icaza <miguel@novell.com>
13466 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13467 variable. This one is represents the actual low-level declaration
13468 of the method, as opposed to the semantic level `IsStatic'.
13470 An anonymous method which is hosted into a static method might be
13471 actually an instance method. IsStatic would reflect the
13472 container, while MethodIsStatic represents the actual code
13475 * expression.cs (ParameterReference): Use the new MethodIsStatic
13476 instead of IsStatic.
13478 * anonymous.cs (AnonymousMethod.Compatible): Pass the
13479 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13480 set on the current EmitContext.
13482 * expression.cs (Cast): Overload DoResolveLValue so we can pass
13483 resolve our casted expression as an LValue. This triggers the
13484 proper LValue processing that is later required by Assign.
13488 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13490 2005-02-11 Marek Safar <marek.safar@seznam.cz>
13492 C# 2.0 Fixed buffer implementation
13494 * anonymous.cs: Update after RegisterHelperClass renaming.
13496 * attribute.cs (AttributeTester.fixed_buffer_cache):
13497 Cache of external fixed buffers.
13498 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13499 implementation if field is fixed buffer else null.
13502 (TypeContainer.AddField): Accept FieldMember instead of Field.
13503 (FieldBase.IsFieldClsCompliant): Extracted code from
13504 VerifyClsCompliance descendant customization.
13505 (FixedField): New class handles fixed buffer fields.
13506 (FixedFieldExternal): Keeps information about imported fixed
13508 (IFixedField): Make access to internal or external fixed buffer
13511 * cs-parser.jay: Add fixed buffer parsing.
13513 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13516 * expression.cs (Indirection): Extended implementation to accept
13517 fixed buffer field.
13518 (PointerArithmetic.Emit): Get element from fixed buffer as well.
13519 (ElementAccess.MakePointerAccess): Get type as parameter.
13520 (DoResolve): Add fixed buffer field expression conversion.
13521 (DoResolveLValue): Ditto.
13522 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13523 (ArrayPtr): Derives from FixedBufferPtr.
13524 (ArrayPtr.Emit): Add extra emit for array elements.
13526 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13528 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13529 for compiler generated types.
13530 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13532 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13533 and consume less memory.
13534 (Fixed.Resolve): Add fixed buffer case.
13536 * typemanager.cs (compiler_generated_attr_ctor,
13537 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13538 (HasElementType): Add our own implementation to work on every
13541 2005-02-11 Miguel de Icaza <miguel@novell.com>
13543 * anonymous.cs (CaptureContext): Track whether `this' has been
13546 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13547 only captured `this' if it was implicitly done (instance
13548 methods/variables were used).
13550 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13551 `this' must be captured.
13553 2005-01-30 Miguel de Icaza <miguel@novell.com>
13555 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13556 is null it means that there has been no need to capture anything,
13557 so we just create a sibling.
13559 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13561 Just a partial fix. The other half is fairly elusive.
13563 2005-02-10 Raja R Harinath <rharinath@novell.com>
13565 Fix #52586, cs0121-4.cs.
13566 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13567 and return a hashtable.
13568 (MemberCache.ClearDeclaredOnly): New.
13569 (MemberCache.MemberCache): Update to change. Make a deep copy of
13570 the method_hash of a base type too.
13571 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13572 type methods. Overwrite entries with the same MethodHandle so
13573 that the ReflectedType is correct. The process leaves in base
13574 virtual functions and their overrides as distinct entries.
13575 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13576 matters since it was boxed in a ArrayList before.
13577 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13579 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13580 case of a virtual function and its override (choose the overload
13582 (Invocation.OverloadResolve): Avoid 'override' members during
13583 'applicable_type' calculation.
13585 2005-02-09 Raja R Harinath <rharinath@novell.com>
13587 Combine two near-redundant caches.
13588 * typemanager.cs (method_params): Rename from method_internal_params.
13589 (TypeManager.GetParameterData): New. Replace
13590 Invocation.GetParameterData.
13591 (TypeManager.LookupParametersByBuilder): Remove.
13592 * expression.cs (Invocation.method_parameter_cache): Remove.
13593 (Invocation.GetParameterData): Remove.
13595 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13598 2005-02-08 Raja R Harinath <rharinath@novell.com>
13601 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13602 TypeManager.multicast_delegate_type is null, resolve it by looking
13603 up "System.MulticastDelegate".
13604 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13606 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13607 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13608 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13611 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13612 (LabeledStatement.AddReference): New. Set 'referenced'.
13613 (Goto.Resolve): Use it.
13615 2005-02-05 John Luke <john.luke@gmail.com>
13617 * driver.cs: remove duplicate -doc line in Usage ()
13619 2005-02-04 Raja R Harinath <rharinath@novell.com>
13621 * location.cs (Location.AddFile): Fix CS2002 error report.
13623 2005-02-02 Martin Baulig <martin@ximian.com>
13625 * delegate.cs (Delegate.DefineType): Report an internal error if
13626 TypeManager.multicast_delegate_type is null. See bug #72015 for
13629 2005-02-02 Raja R Harinath <rharinath@novell.com>
13631 Fix a crasher in a variant of #31984.
13632 * const.cs (Constant.CheckBase): New override that defers the
13633 new-or-override check in case the base type hasn't been populated
13635 (Constant.Define): Ensure the new-or-override check is performed.
13637 2005-02-01 Duncan Mak <duncan@ximian.com>
13639 * const.cs (LookupConstantValue): Check that `ce' is not null
13640 before calling GetValue ().
13642 2005-02-01 Raja R Harinath <rharinath@novell.com>
13644 Fix test-334.cs (#69519).
13645 * cs-parser.jay (using_alias_directive): Pass in an expression to
13646 NamespaceEntry.UsingAlias.
13647 (using_namespace_directive): Pass in an expression to
13648 NamespaceEntry.Using.
13649 (namespace_name): Don't flatten to a string.
13650 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13651 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13653 (NamespaceEntry.UsingEntry): Likewise.
13654 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13656 (NamespaceEntry.LookupForUsing): Remove.
13657 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13659 (NamespaceEntry.Lookup): Remove support for dotted names.
13661 2005-02-01 Raja R Harinath <rharinath@novell.com>
13663 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13665 (NamespaceEntry.ImplicitParent): Compute on demand.
13666 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13667 parallels the current.
13668 (NamespaceEntry.LookupForUsing): Use it.
13669 (NamespaceEntry.Lookup): If the current namespace-entry is
13670 implicit, don't search aliases and using tables.
13672 2005-02-01 Raja R Harinath <rharinath@novell.com>
13675 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13677 (TypeContainer.BaseCache): Compute on demand.
13678 (TypeContainer.FindMembers): Define constants and types if they're
13679 not already created.
13680 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13682 * const.cs (Constant.Define): Make idempotent.
13684 2005-01-29 Miguel de Icaza <miguel@novell.com>
13686 * pending.cs: Produce better code (no nops produced by using Ldarg
13689 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13690 i - 1' it should be arg + 1.
13694 2005-01-28 Raja R Harinath <rharinath@novell.com>
13696 * attribute.cs (Attribute.CheckAttributeType): Make private
13698 (Attribute.ResolveType): Make virtual.
13699 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13700 handling of RootContext.Tree.Types.
13702 2005-01-27 Raja R Harinath <rharinath@novell.com>
13704 Update attribute-handling to use the SimpleName/MemberAccess
13706 * cs-parser.jay (attribute): Pass in an expression to the
13707 constructors of Attribute and GlobalAttribute.
13708 * attribute.cs (Attribute): Take an expression for the name.
13709 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13710 passed in attribute name expression.
13711 (Attribute.CheckAttributeType): Use it.
13712 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13713 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13714 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13715 argument to prevent error messages if the lookup fails.
13717 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13719 * expression.cs (Indirection): Implemented IVariable interface
13720 to support indirection in AddressOf operator.
13721 (PointerArithmetic.Emit): Add optimalization for case where
13722 result can be precomputed.
13724 2005-01-26 Martin Baulig <martin@ximian.com>
13726 * class.cs (TypeContainer.AttributeTargets): Return the correct
13727 AttributeTargets depending on our `Kind' instead of throwing an
13728 exception; fixes #71632.
13730 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13733 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13736 2005-01-25 Raja R Harinath <rharinath@novell.com>
13739 * expression.cs (MemberAccess.DoResolve): Don't complain with
13740 cs0572 when the LHS of a member access has identical name and type
13743 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13746 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13748 Create custom PermissionSet only for PermissionSetAttribute.
13750 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13753 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13754 delegates in static class.
13756 2005-01-24 Martin Baulig <martin@ximian.com>
13758 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13759 merging an implicit block, just use its reachability.
13761 * statement.cs (Block.Resolve): Make the unreachable code check
13762 work wrt. implicit blocks; see test-337 from #63842.
13764 2005-01-21 Alp Toker <alp@atoker.com>
13766 * cs-parser.jay: destructor_declaration's container is PartialContainer
13767 not Class when partial types are used, so use Kind prop instead of
13770 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13772 * cs-parser.jay: Improve error reporting when an interface
13773 declares new types.
13775 2005-01-20 Dick Porter <dick@ximian.com>
13777 * support.cs: SeekableStreamReader fix from Sandor Dobos
13778 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13779 chars are read. Fixes bug 70369.
13781 2005-01-20 Raja R Harinath <rharinath@novell.com>
13783 * cs-parser.jay (catch_clause): Simplify current_block handling
13786 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13788 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13789 code with ImplicitStandardConversion to handle the implicit
13790 conversion of method groups into valid delegate invocations.
13792 The problem is that in parameter handling we were using this code
13793 path. Fixes bug #64698
13795 2005-01-19 Raja R Harinath <rharinath@novell.com>
13797 * cs-parser.jay: Fix several infelicities.
13798 - Avoid assigning to the parser value stack. Code like
13799 '$3 = null' is unclean. Synthesize a value for the code block
13801 - Avoid using oob_stack for storing location information. Use ...
13802 (_mark_): ... this. New (empty) rule. Saves the current location
13804 (foreach_statement): Avoid using oob_stack for current_block
13805 handling. Use technique used in for_statement and
13806 using_statement. Synthesize a value for the code block to store
13807 additional intermediate information.
13809 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13811 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13812 of a different type is only allowed to private fields of a
13813 containing type, not on fields of a base class.
13815 See test-174.cs and error cs0122-9.cs
13817 2005-01-13 Raja R Harinath <rharinath@novell.com>
13819 Fix test-335.cs (bug #58126).
13820 * cs-parser.jay (argument): Split out non-expression parts of the
13821 rule into 'non_simple_argument'.
13822 (invocation_expression): Support parenthesized invocations with
13823 multiple arguments, and with single non-simple arguments.
13825 2005-01-13 Raja R Harinath <rharinath@novell.com>
13827 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13830 2005-01-12 Raja R Harinath <rharinath@novell.com>
13832 Fix cs0038-1.cs, cs1640-6.cs.
13833 * ecore.cs (Expression.Resolve): Remove special-case for
13834 SimpleName in error-handling.
13835 (Expression.almostMatchedMembers): Relax access permission to
13837 (Expression.MemberLookupFailed): Handle duplicates in
13838 almostMatchedMembers list.
13839 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13840 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13841 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13842 overload if the passed in MemberInfo is a MethodBase.
13844 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13847 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13848 for non-CAS & merge permission sets properly.
13850 2005-01-11 Raja R Harinath <rharinath@novell.com>
13852 Improve standard-compliance of simple name and member access
13853 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13854 * ecore.cs (FullNamedExpression): New abstract base class
13855 for Namespaces and TypeExpressions.
13856 (ResolveFlags.SimpleName): Remove.
13857 (SimpleName): Remove support for dotted names.
13858 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13859 DeclSpace.FindType and DeclSpace.LookupType.
13860 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13861 (Expression.ExprClassName): Make member function.
13862 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13863 a namespace. Remove creation of dotted "SimpleName"s.
13864 (MemberAccess.DoResolve): Likewise.
13865 * decl.cs (DeclSpace.Cache): Make private.
13866 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13867 (DeclSpace.FindType): Update.
13868 (DeclSpace.LookupType): Move here from RootContext. Return a
13869 FullNamedExpression.
13870 * namespace.cs (Namespace): Derive from FullNamedExpression
13871 so that it can be part of expression resolution.
13872 (Namespace.Lookup): Return an FullNamedExpression.
13873 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13875 * rootcontext.cs (NamespaceLookup): Remove.
13876 (LookupType): Move to DeclSpace.
13877 * attribute.cs (CheckAttributeType): Update.
13878 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13879 (FindDocumentedTypeNonArray): Likewise.
13881 2005-01-11 Raja R Harinath <rharinath@novell.com>
13883 Fix cs0509.cs, cs1632.cs.
13884 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13885 is the same as IsInterface.
13886 (TypeContainer.GetClassBases): Likewise.
13887 * statement.cs (LabeledStatement.ig): New field.
13888 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13890 (LabeledStatement.DoEmit): Check that the label was created with
13891 the same ILGenerator.
13893 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13896 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13897 accessors to its properties.
13899 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13900 from accessors to property.
13902 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13905 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13906 only for overrides.
13908 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13910 * attribute.cs: Check for null and empty strings.
13912 I have lost another battle to Paolo.
13914 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13917 * class.cs (PropertyMethod): Set Parent field in ctors.
13918 (SetMethod.InternalParameters): Add unsafe switch hack.
13919 Override MarkForDuplicationCheck where it is appropriate.
13921 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13922 It says whether container allows members with the same name.
13923 Base default is no.
13924 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13925 Removed is_method parameter.
13927 2005-01-06 Duncan Mak <duncan@ximian.com>
13929 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13930 because the previous change led to incorrect reporting of CS1032
13931 ("Cannot define/undefine preprocessor symbols after first token in
13932 file"). Instead of using `tokens_seen' as the only flag that
13933 triggers CS1040, introduce `comments_seen'. This new flag is used
13934 to signify having seen comments on the current line, so it is
13935 unset after a newline.
13937 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13939 * doc.cs : When searching for a type, find nested type too.
13940 This fixes bug #71040.
13942 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13945 - Warn missing member comment on those classes which also does not
13946 have doc comments. Fixed bug #71041.
13947 - Don't warn missing doc comment on default constructor.
13950 2005-01-06 Duncan Mak <duncan@ximian.com>
13952 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13953 comments, set `tokens_seen' to true. This allows us to detect
13954 misplaced preprocessor directives (i.e. not at the beginning of
13955 the a line, nor after whitespaces). In that case, report error
13956 CS1040. This fixes bug #56460.
13958 * cs-parser.jay (interface_member_declaration): Add checks for
13959 IsExplicitImpl, and report CS0541 error if an interface member is
13960 defined as an explicit interface declaration.
13962 2005-01-06 Marek Safar <marek.safar@seznam.cz>
13965 * class.cs (PropertyMethod): Set Parent field in ctors.
13966 (SetMethod.InternalParameters): Add unsafe switch hack.
13968 * decl.cs (MemberCore.Parent): Cannot be readonly.
13970 2005-01-06 Raja R Harinath <rharinath@novell.com>
13972 * decl.cs (DeclSpace.ResolveType): Remove.
13973 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13974 Merge in code from ...
13975 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
13976 * class.cs, enum.cs: Update to changes.
13978 2005-01-06 Miguel de Icaza <miguel@ximian.com>
13980 * anonymous.cs: Ensure that we init the scope of our parent if it
13981 has not been initialized yet.
13983 2004-12-30 Duncan Mak <duncan@ximian.com>
13985 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13986 if field.FieldBuilder is null. Fixes #70758.
13988 * convert.cs: Fixed some typos and updated some of the comments.
13989 (ImplicitStandardConversionExists):
13990 (TryImplicitIntConversion): If `target_type' is an interface and
13991 the type of `ic' implements this interface, return true or a new
13992 BoxedCast instead of null. This fixes #70468.
13994 2004-12-29 Duncan Mak <duncan@ximian.com>
13996 * expression.cs (Argument.Emit): Check that Expr is
13997 IMemoryLocation before casting to it, and report CS1510 otherwise.
14001 2004-12-21 Ben Maurer <bmaurer@ximian.com>
14003 * statement.cs (Block.ThisVariable): remove the recursion here, to
14004 make the --profile more sane.
14006 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
14008 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14009 assembly, by JB Evain.
14011 2004-12-17 Raja R Harinath <rharinath@novell.com>
14013 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
14014 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14015 "parent" refers to enclosing type/class. "base" refers to superclass.
14017 2004-12-17 Raja R Harinath <rharinath@novell.com>
14019 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14020 Ensure that we only have GlobalAttributes.
14021 * attribute.cs (Attribute.Emit): Make non-virtual.
14022 (GlobalAttribute.Emit): Remove.
14023 (Attribute.Resolve): Make virtual.
14024 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
14025 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14026 the argument. Don't create one.
14027 (Attribute.GetObsoleteAttribute): Likewise.
14028 (Attribute.GetClsCompliantAttributeValue): Likewise.
14029 * class.cs, decl.cs: Update to changes.
14031 2004-12-17 Marek Safar <marek.safar@seznam.cz>
14033 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14035 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14037 * statement.cs (Foreach.Resolve): Add error 186 report.
14039 2004-12-16 Marek Safar <marek.safar@seznam.cz>
14041 * expression.cs (Conditional.DoResolve): Add warning 429.
14043 * statement.cs (If.Resolve): Add warning 665.
14045 2004-12-16 Raja R Harinath <rharinath@novell.com>
14047 New invariant: RootContext.Tree.Types.NamespaceEntry == null
14048 except when in the parser, and in GlobalAttribute.
14049 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14050 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14051 RootContext.Tree.Types.NamespaceEntry once work is done.
14052 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
14053 and resets RootContext.Tree.Types.NamespaceEntry.
14055 2004-12-15 Marek Safar <marek.safar@seznam.cz>
14057 * cs-parser.jay: Don't create a block for every variable.
14059 2004-12-14 Miguel de Icaza <miguel@ximian.com>
14061 * location.cs: Provide extra information.
14063 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14064 variables from the captured environment, it is the ldarg_0.
14066 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14068 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14071 * class.cs: Changed warning level for 169 to avoid developer
14072 displeasure from warning flooding. It will be changed back when they
14073 fix most of current BCL warnings.
14075 * RootContext.cs: Pushed default WarningLevel to 3.
14077 * statement.cs: Removed unused variable.
14079 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14081 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14082 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14083 Add error 502 report.
14084 (StaticClass.DefineType): Add error 441 report.
14085 (Class.AllowedModifiersProp): New virtual property as temporary
14086 extension to AllowedModifiers.
14087 (Class.DefineType): Add error 418 report. Moved ModFlags check here
14088 to share implementation with StaticClass and don't call virtual
14091 * driver.cs (MainDriver): Add error 1558 test.
14093 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14094 report. Moved error 36 test here.
14096 * statement.cs (Throw.Resolve): Add error 724 report.
14098 * typemanager.cs: Add out_attribute_type core type.
14100 2004-12-13 Marek Safar <marek.safar@seznam.cz>
14102 * class.cs (TypeContainer.VerifyClsCompliance): Add error
14104 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14106 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14109 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14111 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
14112 Add error 3023 report.
14113 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14115 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14118 2004-12-12 John Luke <john.luke@gmail.com>
14120 * driver.cs (AddArgs): take -- into account when
14121 adding arguments, fixes bug 65710
14123 2004-12-12 Martin Baulig <martin@ximian.com>
14125 * expression.cs (Unary.TryReduceNegative): Added support for
14126 SByteConstant and ByteConstant.
14127 (Unary.Reduce): Check error values from TryReduceNegative().
14129 2004-12-10 Marek Safar <marek.safar@seznam.cz>
14131 * attributes.cs (Attribute.Resolve): Avoid multiple error report
14132 and report exception as error 182.
14134 2004-12-10 Raja R Harinath <rharinath@novell.com>
14136 * driver.cs (Main): Fix message when there are warnings.
14138 2004-12-09 Miguel de Icaza <miguel@ximian.com>
14140 * delegate.cs: Fixed my fix from yesterday, sorry about that.
14142 2004-12-09 Marek Safar <marek.safar@seznam.cz>
14144 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
14145 Reduced number of warnings.
14147 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14149 2004-12-08 Miguel de Icaza <miguel@ximian.com>
14151 * driver.cs: Removed message.
14153 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14155 2004-12-08 <vargaz@freemail.hu>
14157 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14159 2004-12-08 Martin Baulig <martin@ximian.com>
14161 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14162 instead of a CS3002 for properties and indexer.
14164 2004-12-08 Martin Baulig <martin@ximian.com>
14166 * decl.cs (MemberName.ToString): Make this work again.
14168 2004-12-08 Marek Safar <marek.safar@seznam.cz>
14170 * attribute.cs (Resolve): Add error 591 detection.
14172 * class.cs (FieldMember.Define): Add error 1547 detection.
14173 (Indexer.Define): Add error 620 detection.
14174 (Operator.Define): Add error 590 detection.
14176 * ecore.cs: Missing argument for error 79.
14178 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14181 2004-12-07 Marek Safar <marek.safar@seznam.cz>
14184 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14187 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
14189 * cs-parser.jay : handle doc comments on implicit/explicit operators.
14190 Some operator comments were suppressed.
14191 * doc.cs : Implicit/explicit operator name in doc comments are like
14192 "op_Explicit(type)~returnType", so added suffix handling.
14194 2004-12-07 Martin Baulig <martin@ximian.com>
14197 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14198 (MemberCore.GetClsCompliantAttributeValue): Likewise.
14199 (DeclSpace.ec): New protected field; store the EmitContext here.
14200 (DeclSpace.EmitContext): New public property; moved here from
14202 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14205 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14206 (Enum.Emit): Don't create a new EmitContext.
14208 * delegate.cs (Delegate.DefineType): Always create the
14211 * iterators.cs (Iterators.DefineIterator): Create a new
14212 EmitContext and store it in `ec'.
14214 2004-08-24 Martin Baulig <martin@ximian.com>
14217 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14218 this for accessibility checks.
14219 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14220 IsNestedFamilyAccessible.
14221 (TypeManager.IsSubclassOf): New method, do what the name actually
14224 2004-12-06 Raja R Harinath <rharinath@novell.com>
14226 Fix crash on cs0657-17.cs.
14227 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14228 Use RootContext.Tree.Types, not 'new RootTypes ()'.
14229 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14230 the case where the NamespaceEntry gets overwritten.
14232 2004-12-06 Marek Safar <marek.safar@seznam.cz>
14234 Fixed #69195, #56821
14235 * ecore.cs (ResolveBoolean): Tiny refactoring.
14237 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14238 of right expression resolving when left is false constant and
14239 operator is LogicalAnd OR true constant and operator is LogicalOr.
14241 * statement.cs (ResolveUnreachable): Always reports warning.
14243 2004-12-05 Miguel de Icaza <miguel@ximian.com>
14245 * class.cs: Distinguish between 1721 and 1722 (just a little help
14246 for the programmer).
14248 2004-12-03 Miguel de Icaza <miguel@ximian.com>
14250 * delegate.cs: Only allow this on new versions of the language.
14252 2004-12-02 Duncan Mak <duncan@ximian.com>
14254 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14256 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14257 here as a static method. Take an additional bool out parameter
14258 `must_do_cs1540_check' for signaling to InstanceResolve.
14259 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14260 member field from PropertyExpr class and made it an argument of
14261 the method instead.
14262 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14263 check for MarshalByRefObject, and report CS0122 instead of CS1540.
14264 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14265 and `remove_accessor' as well as InstanceResolve: report CS0122
14270 2004-12-03 Raja R Harinath <rharinath@novell.com>
14272 Fix test-327.cs, test-328.cs, and put in early infrastructure
14273 for eventually fixing #52697.
14274 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14275 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14276 from other methods.
14277 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14278 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14279 (VerifyUsing, error246): Update.
14280 * rootcontext.cs (RootContext.NamespaceLookup): Just use
14281 'NamespaceEntry.LookupNamespaceOrType'.
14283 2004-12-03 Martin Baulig <martin@ximian.com>
14285 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14286 method as our child, call AnonymousMethod.Compatible() on it.
14288 2004-12-03 Raja R Harinath <rharinath@novell.com>
14290 Disable XML documentation support in 'basic' profile.
14291 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14292 Redirect XmlElement to System.Object.
14293 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14294 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14295 * mcs.exe.sources: Add doc-bootstrap.cs.
14296 * doc-bootstrap.cs: New file. Contains empty stub implementation
14299 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
14301 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14302 comments are allowed.
14304 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14306 * delegate.cs: Add checks for subtypes in paramaters and return values
14307 in VerifyMethod () to add support for Covariance/Contravariance
14310 2004-12-02 Miguel de Icaza <miguel@ximian.com>
14312 * report.cs: Remove extra closing parenthesis.
14314 * convert.cs (Error_CannotImplicitConversion): If the name of the
14315 types are the same, provide some extra information.
14317 * class.cs (FieldBase): Use an unused bit field from the field to
14318 encode the `has_offset' property from the FieldMember. This saves
14319 a couple of Ks on bootstrap compilation.
14321 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14322 method as our child, return the AnonymousMethod resolved
14325 * expression.cs (New.DoResolve): Allow return values from
14326 NewDelegate to also include AnonymousMethods.
14330 2004-12-02 Marek Safar <marek.safar@seznam.cz>
14333 * attribute.cs (Resolve): Improved implementation of params
14334 attribute arguments.
14336 * support.cs (ParameterData): Add HasParams to be faster.
14338 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
14340 all things are for /doc support:
14342 * doc.cs: new file that supports XML documentation generation.
14343 * mcs.exe.sources: added doc.cs.
14345 Handle /doc command line option.
14346 Report error 2006 instead of 5 for missing file name for /doc.
14347 Generate XML documentation when required, after type resolution.
14349 Added support for picking up documentation (/// and /** ... */),
14350 including a new XmlCommentState enumeration.
14352 Added lines to fill Documentation element for field, constant,
14353 property, indexer, method, constructor, destructor, operator, event
14354 and class, struct, interface, delegate, enum.
14355 Added lines to warn incorrect comment.
14357 Added Documentation field (passed only when /doc was specified).
14359 Added DocComment, DocCommentHeader, GenerateDocComment() and
14360 OnGenerateDocComment() and some supporting private members for
14361 /doc feature to MemberCore.
14363 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14365 Added overriden DocCommentHeader.
14367 Added overriden DocCommentHeader and GenerateDocComment().
14369 2004-12-01 Miguel de Icaza <miguel@ximian.com>
14371 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14372 unwrapping the enumeration values, chain to
14373 DoConstantNumericPromotions again, so we can promote things to the
14374 fundamental types (takes care of enums that are bytes, sbytes).
14378 2004-12-01 Raja R Harinath <rharinath@novell.com>
14380 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14381 Fix long-standing bug in type-lookup. Use FindType instead of
14382 LookupType when ec.ResolvingTypeTree.
14383 (Attribute.ResolveType, Attribute.Resolve)
14384 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14386 (Attributes.Search): Remove internal version. Update.
14387 (Attributes.SearchMulti): Update.
14388 (Attributes.GetClsCompliantAttribute): Remove.
14389 (Attributes.GetIndexerNameAttribute): Remove.
14390 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14391 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14392 * class.cs (Indexer.Define): Likewise.
14394 2004-12-01 Marek Safar <marek.safar@seznam.cz>
14397 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14398 MarshallByReference members access.
14400 * expression.cs: Use CheckMarshallByRefAccess;
14401 Better error CS0197 message.
14403 * report.cs: Print whole related error message.
14405 2004-11-30 Raja R Harinath <rharinath@novell.com>
14407 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14408 the current directory to help debugging.
14410 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14412 * class (GetClassBases): Better error 60 report.
14413 (EventProperty): Disabled warning 67 detection.
14415 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14418 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14420 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14423 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14426 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14428 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14430 2004-11-26 Miguel de Icaza <miguel@ximian.com>
14432 * attribute.cs (Attribute.Resolve): Refine error reporting and
14433 report a cs0117 if the identifier does not exist, to distinguish
14434 from 0617 which is a miss-use of the actual identifier.
14436 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14437 between cs0070 and cs0079.
14439 * class.cs (MemberBase.DoDefine): When reporting a wrong
14440 accessibility level, we use MethodCore to compare instead of
14441 Method (this was a regression in some refactoring effort).
14443 So now we correctly report cs0056 again.
14445 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14446 testing the target_type (which was known to be object_type) and
14447 not the source type (which is anonymous_method).
14449 Fixed reporting of error cs1660.
14451 * expression.cs (UserCast.Source): Expose the underlying cast.
14453 * statement.cs (Switch.SwitchGoverningType): Sort the list of
14454 allowed types to find a match to int32 first (most common).
14456 In addition, it ignores any ImplicitUserConversions that did an
14457 internal implicit conversion (as the switch statement allows only
14458 one integral conversion to exist).
14460 * class.cs (PartialContainer.Create): rename `name' to
14461 `member_name' for clarity. Then replace the string calls with a
14462 call to MemberName.GetPartialName, as now using
14463 MemberName.ToString is an error (this is due to the side effects
14464 it had, that were fixed in the past).
14466 This will restore the error reporting on a number of partial class
14467 errors that were missusing this (and getting an exception as a
14468 results, which is now just a plain textual warning, because
14469 yyparse debug output would crash otherwise).
14471 2004-11-26 Raja R Harinath <rharinath@novell.com>
14473 * Makefile (PROGRAM_INSTALL_DIR): Remove.
14475 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14477 * rootcontext.cs (LookupType): Make sure to cache lookups that
14478 don't give us a negative result. This saves about 5% of corlib
14481 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14483 * report.cs (AbstractMessage.Print): messages are sent to stderr
14485 * class.cs (TypeContainer.GetClassBases): It is an error to have a
14486 non-interface in the list of interfaces (at this point, either
14487 parent was properly set, or a base class is being listed in the
14488 interfaces section).
14490 This flags error 1722, and resolves the crash from bug 69259.
14492 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14494 * statement.cs (Using.EmitExpressionFinally): make this work right
14495 for valuetypes. Fixes 69926.
14497 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14499 * const.cs (Const.ChangeType): Cope with the "0 literal can be
14500 converted to an enum" here, before we try to change the underlying
14501 type. This code exists, but it is a different code path than the
14502 one used while encoding constants.
14504 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14505 old bug: when converting from the null literal to a pointer,
14506 return an EmptyCast, not the NullLiteral.
14508 This fixes #69921, the recent null_type changes probably made this
14509 bug more prominent.
14511 (ImplicitReferenceConversionExists): In addition, resynchronized
14512 the code here, so it matches the same code in
14513 ImplicitReferenceConversionExists for the `from any class-type S
14514 to any interface-type T'.
14517 2004-11-25 Marek Safar <marek.safar@seznam.cz>
14519 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14521 2004-11-24 Miguel de Icaza <miguel@ximian.com>
14523 * cs-parser.jay: Use verbosity accordingly.
14525 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14527 * expression.cs (Unary.ResolveOperator): Do not report warning;
14528 AddressOf reads from variable.
14530 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14532 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14536 * attribute.cs (Attributable): Removed CheckTargets.
14537 (Attributes.Emit): Explicit attribute targets are tested here.
14539 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14540 not enabled for interfaces.
14542 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14543 (GetAssemblyName): Ouch next bug there.
14545 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14547 * expression.cs: Error 275 added.
14549 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14551 Fix bug #69177 (Implemented decimal constant support)
14553 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14554 (BinaryFold): Add DecimalConstant.
14556 * const.cs (Define): Decimal constant
14558 (ChangeType): Add decimal type handling.
14559 (LookupConstantValue): Don't set value for decimal type but
14560 emit DecimalConstantAttribute. Needed for constant optimization.
14562 * constant.cs (ToDecimal): New method.
14563 (ConvertToDecimal): New method.
14564 (IntConstant): Implemented ConvertToDecimal.
14565 (DecimalConstant.Emit): Emit optimized version for decimals in
14568 * expression.cs (ResolveOperator): Changed order of constant
14569 reduction to work correctly with native types which have
14570 overloaded operators.
14571 (ResolveMemberAccess): Extract constant value from attribute
14574 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14576 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14577 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14578 (ChangeType): Decimal is special.
14579 (TypeToCoreType): Add decimal type.
14581 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14583 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14586 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14588 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14591 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14593 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14595 * pending.cs (PendingImplementation): Grab only interfaces.
14597 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14599 * statement.cs (ForeachHelperMethods): Add location member and
14600 error 202 detection.
14602 2004-11-19 Raja R Harinath <rharinath@novell.com>
14604 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14605 automatically handled by executable.make.
14606 (PROGRAM): Make profile-specific.
14608 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14610 * expression.cs (DoResolveBase): Fixed wrong warning for out
14613 2004-11-18 Martin Baulig <martin@ximian.com>
14615 Merged latest changes into gmcs. Please keep this comment in
14616 here, it makes it easier for me to see what changed in MCS since
14617 the last time I merged.
14619 2004-11-17 Raja R Harinath <rharinath@novell.com>
14621 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14622 (TypeHandle.GetMemberCache): New.
14623 (TypeHandle.TypeHandle): Update.
14624 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14625 (TypeManager.LookupParentInterfacesCache):
14626 Rename from LookupInterfaceCache. Optimize slightly.
14627 (TypeManager.MemberLookup_FindMembers): Update.
14628 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14629 multi-type variant.
14630 (AddCacheContents): Rename from AddHashtable.
14631 * class.cs (TypeContainer.parent_container): Remove.
14632 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14633 (TypeContainer.DoDefineMembers): Don't initialize it.
14634 Update to name changes.
14636 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14638 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14639 that factors the code to check access modifiers on override.
14641 (PropertyBase): Use the code here.
14643 Patch from Lluis S'anchez, fixes bug #69361.
14645 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14647 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14648 routine that is used to report the use of a captured variable
14649 whose address has been taken.
14651 There are two checks: one when variables are being captured and
14652 the other check is when the address of a variable is taken.
14654 (because an anonymous methods might be resolved before *or* after
14655 the address has been taken) and
14657 * expression.cs (Conditional.DoResolve): Remove the special
14658 casing that Martin added to trueExpr and falseExpr being both
14659 NullLiteral. We get the right behavior now just by introducing
14660 the null_type into the compiler.
14662 * convert.cs (ExplicitConversion): Change the code to use
14663 null_type instead of testing `expr is NullLiteral'.
14664 (ImplicitConversionStandard): use null_type too.
14665 (ImplicitReferenceConversionExists): use null_type too.
14666 (ImplicitReferenceConversion): use null_type too.
14668 * literal.cs: The type of `NullLiteral' is now null_type instead
14670 (Resolve): Set the type here.
14672 * typemanager.cs: Introduce null_type.
14674 2004-11-17 Martin Baulig <martin@ximian.com>
14676 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14677 direction, like FindMembers() does. Fixes #69546, testcase is in
14680 2004-11-16 Martin Baulig <martin@ximian.com>
14682 This is based on a patch from Marek Safar, see bug #69082.
14683 Fixes bugs #63705 and #67130.
14685 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14686 method; create a MemberCache for an interface type and cache the
14689 * decl.cs (IMemberContainer.ParentContainer): Removed.
14690 (IMemberContainer.ParentCache): New property.
14691 (MemberCache.SetupCacheForInterface): Removed.
14692 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14693 to create a cache for an interface's "parent".
14695 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14698 2004-11-16 Martin Baulig <martin@ximian.com>
14700 Merged back from gmcs; these changes already went into gmcs a
14701 couple of weeks ago.
14704 (TypeManager.AddUserType): Removed the `ifaces' argument.
14705 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14707 (TypeManager.AddUserInterface): Removed.
14708 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14710 (TypeManager.GetInterfaces): Likewise.
14711 (TypeManager.GetExplicitInterfaces): Likewise.
14713 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14715 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14716 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14718 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14720 * statement.cs: Avoid adding bools to a hashtable.
14722 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14724 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14725 calling an unsafe method from a safe location.
14727 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14730 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14732 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14734 * namespace.cs (VerifyUsing): use GetPartialName instead of
14737 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14739 * statement.cs (Return.Resolve): Fix regression in typo: if
14740 `in_exc', we have to request a NeedReturnLabel, this was a typo
14741 introduced in the anonymous method check-in. Fixes #69131.
14743 * Indexers were using the ShortName when defining themselves,
14744 causing a regression in the compiler bootstrap when applying the
14745 patch from 2004-11-02 (first part), now they use their full name
14746 and the bug is gone.
14748 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14750 * driver.cs: Strip the path from the names of embedded resources. Fixes
14753 2004-11-04 Raja R Harinath <rharinath@novell.com>
14755 Fix error message regression: cs0104-2.cs.
14756 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14757 (AliasEntry.Resolve): Update.
14758 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14760 (RootContext.LookupType): Update.
14762 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14764 * cs-parser.jay: Add support for handling accessor modifiers
14765 * class: Add support port accessor modifiers and error checking,
14766 define PropertyMethod.Define as virtual (not abstract anymore)
14767 * ecore.cs: Add checking for proeprties access with access modifiers
14768 * iterators.cs: Modify Accessor constructor call based in the modified
14770 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14772 * expression.cs (StringConcat): Handle being called twice,
14773 as when we have a concat in a field init with more than two
14776 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14778 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14779 special case explicit implementations, we should always produce
14780 the .property or .event declaration.
14782 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14783 since it will not return correct data if people use this
14784 unresolved in the presence of using statements (see test-313).
14786 * class.cs (MethodData.Define): If we are an explicit interface
14787 implementation, set the method name to the full name of the
14788 interface plus the name of the method.
14790 Notice that using the method.MethodName.GetFullName() does not
14791 work, as it will only contain the name as declared on the source
14792 file (it can be a shorthand in the presence of using statements)
14793 and not the fully qualifed type name, for example:
14797 class D : ICloneable {
14798 object ICloneable.Clone () {
14802 Would produce a method called `ICloneable.Clone' instead of
14803 `System.ICloneable.Clone'.
14805 * namespace.cs (Alias.Resolve): Use GetPartialName.
14807 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14809 * cs-parser.jay: Add error 1055 report.
14811 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14813 * assign.cs (Assign.DoResolve): Only do the transform of
14814 assignment into a New if the types are compatible, if not, fall
14815 through and let the implicit code deal with the errors and with
14816 the necessary conversions.
14818 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14820 * cs-parser.jay: Add error 1031 report.
14822 * cs-tokenizer.cs: Add location for error 1038.
14824 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14826 * cs-parser.jay: Add error 1016 report.
14828 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14830 * cs-parser.jay: Add errors 1575,1611 report.
14832 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14834 * cs-parser.jay: Add error 1001 report.
14836 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14839 * attribute.cs (GetMarshal): Add method argument for
14840 caller identification.
14842 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14843 agument for GetMarshal and RuntimeMissingSupport.
14845 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14847 * attribute.cs (ExtractSecurityPermissionSet): Removed
14848 TypeManager.code_access_permission_type.
14850 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14852 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14854 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14855 for obsolete use of a variable here. Fixes regression on errors
14856 cs0619-25 and cs0619-26.
14858 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14860 Fix #62358, implemented security attribute encoding.
14862 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14863 Tests permitted SecurityAction for assembly or other types.
14864 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14865 data from SecurityPermissionAttribute to PermisionSet class.
14867 * class.cs (ApplyAttributeBuilder): Added special handling
14868 for System.Security.Permissions.SecurityAttribute based types.
14870 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14871 special handling for System.Security.Permissions.SecurityAttribute
14874 * enum.cs (ApplyAttributeBuilder): Added special handling
14875 for System.Security.Permissions.SecurityAttribute based types.
14877 * parameter.cs (ApplyAttributeBuilder): Added special handling
14878 for System.Security.Permissions.SecurityAttribute based types.
14880 * rootcontext.cs: Next 2 core types.
14882 * typemanager.cs (TypeManager.security_permission_attr_type):
14883 Built in type for the SecurityPermission Attribute.
14884 (code_access_permission_type): Build in type.
14886 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14888 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14889 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14890 all of this information into
14891 EmitContext.EmitCapturedVariableInstance.
14893 * codegen.cs (EmitCapturedVariableInstance): move here the
14894 funcionality of emitting an ldarg.0 in the presence of a
14895 remapping. This centralizes the instance emit code.
14897 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14898 then emit a load of this: it means that we have reached the
14899 topmost ScopeInfo: the one that contains the pointer to the
14900 instance of the class hosting the anonymous method.
14902 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14903 captures to the topmost CaptureContext.
14905 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14907 * expression.cs (LocalVariableReference): Move the knowledge about
14908 the iterators into codegen's EmitCapturedVariableInstance.
14910 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14912 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14913 all code paths return a value from an anonymous method (it is the
14914 same as the 161 error, but for anonymous methods).
14916 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14918 The introduction of anonymous methods in the compiler changed
14919 various ways of doing things in the compiler. The most
14920 significant one is the hard split between the resolution phase
14921 and the emission phases of the compiler.
14923 For instance, routines that referenced local variables no
14924 longer can safely create temporary variables during the
14925 resolution phase: they must do so from the emission phase,
14926 since the variable might have been "captured", hence access to
14927 it can not be done with the local-variable operations from the runtime.
14931 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14932 is a toplevel block.
14934 (ToplevelBlock): A new kind of Block, these are the blocks that
14935 are created by the parser for all toplevel method bodies. These
14936 include methods, accessors and anonymous methods.
14938 These contain some extra information not found in regular blocks:
14939 A pointer to an optional CaptureContext (for tracking captured
14940 local variables and parameters). A pointer to the parent
14943 (Return.Resolve): Catch missmatches when returning a value from an
14944 anonymous method (error 1662).
14945 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14948 (Break.Resolve): ditto.
14950 (SwitchLabel): instead of defining the labels during the
14951 resolution phase, we now turned the public ILLabel and ILLabelCode
14952 labels into methods called GetILLabelCode() and GetILLabel() that
14953 only define the label during the Emit phase.
14955 (GotoCase): Track the SwitchLabel instead of the computed label
14956 (its contained therein). Emit the code by using
14957 SwitchLabel.GetILLabelCode ().
14959 (LocalInfo.Flags.Captured): A new flag has been introduce to track
14960 whether the Local has been captured or not.
14962 (LocalInfo.IsCaptured): New property, used to tell whether the
14963 local has been captured.
14965 * anonymous.cs: Vastly updated to contain the anonymous method
14968 The main classes here are: CaptureContext which tracks any
14969 captured information for a toplevel block and ScopeInfo used to
14970 track the activation frames for various local variables.
14972 Each toplevel block has an optional capture context associated
14973 with it. When a method contains an anonymous method both the
14974 toplevel method and the anonymous method will create a capture
14975 context. When variables or parameters are captured, they are
14976 recorded on the CaptureContext that owns them, for example:
14980 MyDelegate d = delegate {
14985 Here `a' will be recorded as captured on the toplevel
14986 CapturedContext, the inner captured context will not have anything
14987 (it will only have data if local variables or parameters from it
14988 are captured in a nested anonymous method.
14990 The ScopeInfo is used to track the activation frames for local
14991 variables, for example:
14993 for (int i = 0; i < 10; i++)
14994 for (int j = 0; j < 10; j++){
14995 MyDelegate d = delegate {
15000 At runtime this captures a single captured variable `i', but it
15001 captures 10 different versions of the variable `j'. The variable
15002 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15003 recorded on a child.
15005 The toplevel ScopeInfo will also track information like the `this'
15006 pointer if instance variables were referenced (this is necessary
15007 as the anonymous method lives inside a nested class in the host
15008 type of the method).
15010 (AnonymousMethod): Expanded to track the Toplevel, implement
15011 `AnonymousMethod.Compatible' to tell whether an anonymous method
15012 can be converted to a target delegate type.
15014 The routine now also produces the anonymous method content
15016 (AnonymousDelegate): A helper class that derives from
15017 DelegateCreation, this is used to generate the code necessary to
15018 produce the delegate for the anonymous method that was created.
15020 * assign.cs: API adjustments for new changes in
15021 Convert.ImplicitStandardConversionExists.
15023 * class.cs: Adjustments to cope with the fact that now toplevel
15024 blocks are of type `ToplevelBlock'.
15026 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15027 insteda of standard blocks.
15029 Flag errors if params arguments are passed to anonymous methods.
15031 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15032 `CurrentAnonymousMethod' which points to the current Anonymous
15033 Method. The variable points to the AnonymousMethod class that
15034 holds the code being compiled. It is set in the new EmitContext
15035 created for the anonymous method.
15037 (EmitContext.Phase): Introduce a variable and an enumeration to
15038 assist in enforcing some rules about when and where we are allowed
15039 to invoke certain methods (EmitContext.NeedsReturnLabel is the
15040 only one that enfonces this right now).
15042 (EmitContext.HaveCaptureInfo): new helper method that returns
15043 whether we have a CapturedContext initialized.
15045 (EmitContext.CaptureVariable): New method used to register that a
15046 LocalInfo must be flagged for capturing.
15048 (EmitContext.CapturedParameter): New method used to register that a
15049 parameters must be flagged for capturing.
15051 (EmitContext.CapturedField): New method used to register that a
15052 field must be flagged for capturing.
15054 (EmitContext.HaveCapturedVariables,
15055 EmitContext.HaveCapturedFields): Return whether there are captured
15056 variables or fields.
15058 (EmitContext.EmitMethodHostInstance): This is used to emit the
15059 instance for the anonymous method. The instance might be null
15060 (static methods), this (for anonymous methods that capture nothing
15061 and happen to live side-by-side with the current method body) or a
15062 more complicated expression if the method has a CaptureContext.
15064 (EmitContext.EmitTopBlock): Routine that drives the emission of
15065 code: it will first resolve the top block, then emit any metadata
15066 and then emit the code. The split is done so that we can extract
15067 any anonymous methods and flag any captured variables/parameters.
15069 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15070 during this phase, the ILGenerator should not be used as labels
15071 and local variables declared here might not be accessible to any
15072 code that is part of an anonymous method.
15074 Exceptions to this include the temporary variables that are
15075 created by some statements internally for holding temporary
15078 (EmitContext.EmitMeta): New routine, in charge of emitting all the
15081 (EmitContext.TemporaryReturn): This method is typically called
15082 from the Emit phase, and its the only place where we allow the
15083 ReturnLabel to be defined other than the EmitMeta. The reason is
15084 that otherwise we would have to duplicate a lot of logic in the
15085 Resolve phases of various methods that today is on the Emit
15088 (EmitContext.NeedReturnLabel): This no longer creates the label,
15089 as the ILGenerator is not valid during the resolve phase.
15091 (EmitContext.EmitThis): Extended the knowledge in this class to
15092 work in anonymous methods in addition to iterators.
15094 (EmitContext.EmitCapturedVariableInstance): This emits whatever
15095 code is necessary on the stack to access the instance to a local
15096 variable (the variable will be accessed as a field).
15098 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15099 EmitContext.EmitAddressOfParameter): Routines to support
15100 parameters (not completed at this point).
15102 Removals: Removed RemapLocal and RemapLocalLValue. We probably
15103 will also remove the parameters.
15105 * convert.cs (Convert): Define a `ConstantEC' which points to a
15106 null. This is just to prefity some code that uses
15107 ImplicitStandardConversion code and do not have an EmitContext
15110 The idea is to flag explicitly that at that point in time, it is
15111 known that the conversion will not trigger the delegate checking
15112 code in implicit conversions (which requires a valid
15115 Everywhere: pass new EmitContext parameter since
15116 ImplicitStandardConversionExists now requires it to check for
15117 anonymous method conversions.
15119 (Convert.ImplicitStandardConversionExists): If the type of an
15120 expression is the anonymous_method_type, and the type is a
15121 delegate, we invoke the AnonymousMethod.Compatible method to check
15122 whether an implicit conversion is possible.
15124 (Convert.ImplicitConversionStandard): Only do implicit method
15125 group conversions if the language level is not ISO_1.
15127 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15128 MethodInfo for the Invoke method. used by Delegate and
15131 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15132 method conversions if the target type is a delegate.
15134 Removed extra debugging nops.
15136 (LocalVariableReference): Turn the `local_info' into a public
15139 Add `prepared' field, the same hack used for FieldExprs to cope
15140 with composed assignments, as Local variables do not necessarily
15141 operate purely on the stack as they used to: they can be captured
15144 Add `temp' for a temporary result, like fields.
15146 Refactor DoResolve and DoResolveLValue into DoResolveBase.
15148 It now copes with Local variables that are captured and emits the
15149 proper instance variable to load it from a field in the captured
15152 (ParameterReference.DoResolveBase): During the resolve phase,
15153 capture parameters if we are in an anonymous method.
15155 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15156 anonymous method, use the EmitContext helper routines to emit the
15157 parameter reference.
15159 * iterators.cs: Set RemapToProxy to true/false during the
15162 * parameters.cs (GetParameterByName): New helper method.
15164 * typemanager.cs (anonymous_method_type) a new type that
15165 represents an anonyous method. This is always an internal type,
15166 used as a fencepost to test against the anonymous-methodness of an
15169 2004-10-20 Marek Safar <marek.safar@seznam.cz>
15171 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15173 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15175 2004-10-18 Martin Baulig <martin@ximian.com>
15177 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15178 `Type' directly, but call ResolveType() on it.
15179 (Catch.Resolve): Likewise.
15180 (Foreach.Resolve): Likewise.
15182 2004-10-18 Martin Baulig <martin@ximian.com>
15184 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15185 `Type' directly, but call ResolveType() on it.
15186 (Probe.DoResolve): Likewise.
15187 (ArrayCreation.LookupType): Likewise.
15188 (TypeOf.DoResolve): Likewise.
15189 (SizeOf.DoResolve): Likewise.
15191 2004-10-18 Martin Baulig <martin@ximian.com>
15193 * expression.cs (Invocation.BetterFunction): Put back
15194 TypeManager.TypeToCoreType().
15196 2004-10-18 Raja R Harinath <rharinath@novell.com>
15198 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15201 2004-10-18 Martin Baulig <martin@ximian.com>
15203 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
15204 `Type' directly, but call ResolveType() on it.
15206 2004-10-18 Martin Baulig <martin@ximian.com>
15208 * class.cs (FieldMember.Define): Don't access the TypeExpr's
15209 `Type' directly, but call ResolveType() on it.
15210 (MemberBase.DoDefine): Likewise.
15212 * expression.cs (New.DoResolve): Don't access the TypeExpr's
15213 `Type' directly, but call ResolveType() on it.
15214 (ComposedCast.DoResolveAsTypeStep): Likewise.
15216 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15217 `Type' directly, but call ResolveType() on it.
15219 2004-10-17 John Luke <john.luke@gmail.com>
15221 * class.cs (Operator.GetSignatureForError): use CSharpName
15223 * parameter.cs (Parameter.GetSignatureForError): Returns
15224 correct name even if was not defined.
15226 2004-10-13 Raja R Harinath <rharinath@novell.com>
15229 * class.cs (TypeContainer.EmitContext): New property.
15230 (DefineNestedTypes): Create an emitcontext for each part.
15231 (MethodCore.DoDefineParameters): Use container's emitcontext.
15232 Pass type array to InternalParameters.
15233 (MemberBase.DoDefine): Use container's emitcontext.
15234 (FieldMember.Define): Likewise.
15235 (Event.Define): Likewise.
15236 (SetMethod.GetParameterInfo): Change argument to EmitContext.
15237 Pass type array to InternalParameters.
15238 (SetIndexerMethod.GetParameterInfo): Likewise.
15239 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15240 * delegate.cs (Define): Pass emitcontext to
15241 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
15242 array to InternalParameters.
15243 * expression.cs (ParameterReference.DoResolveBase): Pass
15244 emitcontext to GetParameterInfo.
15245 (ComposedCast.DoResolveAsTypeStep): Remove check on
15246 ec.ResolvingTypeTree.
15247 * parameter.cs (Parameter.Resolve): Change argument to
15248 EmitContext. Use ResolveAsTypeTerminal.
15249 (Parameter.GetSignature): Change argument to EmitContext.
15250 (Parameters.ComputeSignature): Likewise.
15251 (Parameters.ComputeParameterTypes): Likewise.
15252 (Parameters.GetParameterInfo): Likewise.
15253 (Parameters.ComputeAndDefineParameterTypes): Likewise.
15254 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
15255 * support.cs (InternalParameters..ctor): Remove variant that takes
15257 * typemanager.cs (system_intptr_expr): New.
15258 (InitExpressionTypes): Initialize it.
15260 2004-10-12 Chris Toshok <toshok@ximian.com>
15262 * cs-parser.jay: fix location for try_statement and catch_clause.
15264 2004-10-11 Martin Baulig <martin@ximian.com>
15266 * report.cs: Don't make --fatal abort on warnings, we have
15267 -warnaserror for that.
15269 2004-10-07 Raja R Harinath <rharinath@novell.com>
15271 More DeclSpace.ResolveType avoidance.
15272 * decl.cs (MemberCore.InUnsafe): New property.
15273 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
15274 with newly created EmitContext.
15275 (FieldMember.Define): Likewise.
15276 * delegate.cs (Delegate.Define): Likewise.
15277 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15278 only if normal name-lookup fails.
15279 (TypeExpr.DoResolve): Enable error-checking.
15280 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15281 (SizeOf.DoResolve): Likewise.
15282 (ComposedCast.DoResolveAsTypeStep): Likewise.
15283 (StackAlloc.DoResolve): Likewise.
15284 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15285 (Block.Unsafe): New property.
15286 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15287 (Unsafe): Set 'unsafe' flag of contained block.
15288 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15289 (Fixed.Resolve): Likewise.
15290 (Catch.Resolve): Likewise.
15291 (Using.ResolveLocalVariableDecls): Likewise.
15292 (Foreach.Resolve): Likewise.
15294 2004-10-05 John Luke <john.luke@gmail.com>
15296 * cs-parser.jay: add location to error CS0175
15298 2004-10-04 Miguel de Icaza <miguel@ximian.com>
15300 * ecore.cs (Expression.Constantity): Add support for turning null
15303 * const.cs (Const.Define): Allow constants to be reference types
15304 as long as the value is Null.
15306 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
15308 * namespace.cs (NamespaceEntry.Using): No matter which warning
15309 level is set, check if this namespace name has already been added.
15311 2004-10-03 Ben Maurer <bmaurer@ximian.com>
15313 * expression.cs: reftype [!=]= null should always use br[true,false].
15316 2004-10-03 Marek Safar <marek.safar@seznam.cz>
15319 * attribute.cs: Enum conversion moved to
15320 GetAttributeArgumentExpression to be applied to the all
15323 2004-10-01 Raja R Harinath <rharinath@novell.com>
15325 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15326 * class.c (TypeContainer.DefineType): Flag error if
15327 base types aren't accessible due to access permissions.
15328 * decl.cs (DeclSpace.ResolveType): Move logic to
15329 Expression.ResolveAsTypeTerminal.
15330 (DeclSpace.ResolveTypeExpr): Thin layer over
15331 Expression.ResolveAsTypeTerminal.
15332 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15333 Refactor code into NestedAccess. Use it.
15334 (DeclSpace.NestedAccess): New.
15335 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15336 argument to silence errors. Check access permissions.
15337 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15338 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15339 (Cast.DoResolve): Likewise.
15340 (New.DoResolve): Likewise.
15341 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15342 (TypeOf.DoResolve): Likewise.
15344 * expression.cs (Invocation.BetterConversion): Return the Type of
15345 the better conversion. Implement section 14.4.2.3 more faithfully.
15346 (Invocation.BetterFunction): Make boolean. Make correspondence to
15347 section 14.4.2.2 explicit.
15348 (Invocation.OverloadResolve): Update.
15349 (Invocation): Remove is_base field.
15350 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
15351 (Invocation.Emit): Likewise.
15353 2004-09-27 Raja R Harinath <rharinath@novell.com>
15355 * README: Update to changes.
15357 2004-09-24 Marek Safar <marek.safar@seznam.cz>
15359 * cs-parser.jay: Reverted 642 warning fix.
15361 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15364 * decl.cs (FindMemberWithSameName): Indexer can have more than
15367 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15369 * expression.cs (LocalVariableReference.DoResolveLValue):
15370 Do not report warning 219 for out values.
15371 (EmptyExpression.Null): New member to avoid extra allocations.
15373 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15375 * cs-parser.jay: Fix wrong warning 642 report.
15377 * cs-tokenizer.cs (CheckNextToken): New helper;
15378 Inspect next character if is same as expected.
15380 2004-09-23 Martin Baulig <martin@ximian.com>
15382 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15383 (Convert.ImplicitReferenceConversionExists): Likewise.
15385 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15387 * class.cs (Operator.Define): Add error 448 and 559 report.
15389 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15391 * class.cs (MemberBase.IsTypePermitted): New protected
15392 method for checking error CS0610.
15394 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15396 * class.cs (TypeContainer.HasExplicitLayout): New property
15397 Returns whether container has StructLayout attribute set Explicit.
15398 (FieldMember): New abstract class for consts and fields.
15399 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15400 (Field): Reuse FieldMember.
15402 * const.cs (Const): Reuse FieldMember.
15404 * rootcontext.cs: EmitConstants call moved to class.
15406 2004-09-22 Martin Baulig <martin@ximian.com>
15408 Thanks to Peter Sestoft for this bug report.
15410 * expression.cs (Conditional): If both the `trueExpr' and the
15411 `falseExpr' is a NullLiteral, return a NullLiteral.
15413 2004-09-22 Martin Baulig <martin@ximian.com>
15415 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15416 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15417 for the "get_Current" call.
15419 2004-09-22 Martin Baulig <martin@ximian.com>
15421 Marek and me just fixed one of our oldest bugs: #28562 :-)
15423 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15425 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15426 we're an EnumConstant, just return that.
15427 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15428 an EnumConstant. In this case, we need to use GetValueAsEnumType()
15429 to get the value which'll actually be written into the attribute.
15430 However, we have to use GetValue() to access the attribute's value
15433 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15435 * constant.cs (Constant.IsNegative): New abstract property
15438 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15439 (StackAlloc.DoResolve): Reused IsNegative.
15441 2004-09-21 Martin Baulig <martin@ximian.com>
15443 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15444 if we're used in an iterator, we may be called from different
15447 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15448 we actually have an exception block.
15450 2004-09-20 John Luke <jluke@cfl.rr.com>
15452 * class.cs, cs-parser.jay: Improve the error report for 1520:
15453 report the actual line where the error happens, not where the
15454 class was declared.
15456 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15457 Pass location information that was available elsewhere.
15459 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
15461 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15462 runtime to delay sign assemblies.
15464 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15466 * cs-parser.jay: Do not report the stack trace, this is barely
15469 2004-08-22 John Luke <john.luke@gmail.com>
15471 * driver.cs : check that a resource id is not already used
15472 before adding it, report CS1508 if it is, bug #63637
15474 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15476 * ecore.cs: Removed dead code.
15478 2004-09-18 Marek Safar <marek.safar@seznam.cz>
15480 * class.cs: Do not report warning CS0067 on the interfaces.
15482 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15484 * cs-parser.jay: Add error 504 report.
15486 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15488 * rootcontext.cs: WarningLevel is 4 by default now.
15490 * statement.cs (Fixed.Resolve): Do not null
15493 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15496 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15497 deep search when property is not virtual.
15498 (PropertyExpr.ResolveAccessors): Make one call for both
15501 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15504 * statement.cs: Error 152 report constains also location.
15506 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15509 * const.cs: Explicitly set constant as static.
15511 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15514 * cs-parser.jay: Add error 1017 report.
15516 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15518 Fixed bug #59980, #64224
15519 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15521 * typemanager.cs (IsSpecialMethod): Simplified
15523 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15525 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15526 condition with better params.
15528 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15531 * attribute.cs (Resolve): Property has to have both
15534 2004-09-14 Martin Baulig <martin@ximian.com>
15536 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15538 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15541 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15542 called and is obsolete then this member suppress message
15543 when call is inside next [Obsolete] method or type.
15545 * expression.cs: Use TestObsoleteMethodUsage member.
15547 2004-09-14 Martin Baulig <martin@ximian.com>
15549 * cs-parser.jay: Sync a bit with the GMCS version.
15551 2004-09-14 Martin Baulig <martin@ximian.com>
15553 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15554 (CSharpParser.yacc_verbose_flag): New public field.
15556 * genericparser.cs: Removed.
15558 2004-09-14 Raja R Harinath <rharinath@novell.com>
15560 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15562 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15564 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15566 2004-09-10 Martin Baulig <martin@ximian.com>
15568 Backported my MemberName changes from GMCS into MCS.
15570 - we are now using a special `MemberName' class instead of using
15571 strings; in GMCS, the `MemberName' also contains the type
15574 - changed the grammar rules a bit:
15575 * the old `member_name' is now a `namespace_or_type_name':
15576 The rule is that we use `namespace_or_type_name' everywhere
15577 where we expect either a "member name" (GetEnumerator) or a
15578 "member name" with an explicit interface name
15579 (IEnumerable.GetEnumerator).
15580 In GMCS, the explicit interface name may include type arguments
15581 (IEnumerable<T>.GetEnumerator).
15582 * we use `member_name' instead of just `IDENTIFIER' for
15584 The rule is that we use `member_name' wherever a member may
15585 have type parameters in GMCS.
15587 * decl.cs (MemberName): New public class.
15588 (MemberCore.MemberName): New public readonly field.
15589 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15590 (DeclSpace): Likewise.
15592 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15593 * enum.cs (Enum.ctor): Likewise.
15595 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15597 (AliasEntry.ctor): Take a MemberName, not an Expression.
15598 (AliasEntry.UsingAlias): Likewise.
15600 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15601 (IMethodData.MemberName): Changed type from string to MemberName.
15602 (MemberBase.ExplicitInterfaceName): Likewise.
15603 (AbstractPropertyEventMethod.SetupName): Make this private.
15604 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15605 argument; compute the member name here.
15606 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15607 on the `member.MemberName' and the `prefix'.
15609 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15611 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15612 thus, we get a `MemberName' instead of a `string'. These
15613 declarations may have type parameters in GMCS.
15614 (interface_method_declaration, delegate_declaration): Likewise.
15615 (class_declaration, interface_declaration): Likewise.
15616 (method_header): Use `namespace_or_type_name' instead of
15617 `member_name'. We may be an explicit interface implementation.
15618 (property_declaration, event_declaration): Likewise.
15619 (member_name): This is now just an `IDENTIFIER', not a
15620 `namespace_or_type_name'.
15621 (type_name, interface_type): Removed.
15622 (namespace_or_type_name): Return a MemberName, not an Expression.
15623 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15624 call GetTypeExpression() on the MemberName to get an expression.
15625 (IndexerDeclaration.interface_type): Changed type from string to
15627 (MakeName): Operate on MemberName's instead of string's.
15629 2004-09-13 Raja R Harinath <rharinath@novell.com>
15632 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15633 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15634 lookup to avoid symbols introduced by 'using'.
15635 * rootcontext.cs (NamespaceLookup): Update.
15637 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15639 * class.cs (TypeContainer.DoDefineMembers): Do not call
15640 DefineDefaultConstructor for static classes.
15642 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15644 * attribute.cs (Attribute.Resolve): Add error 653 report.
15646 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15648 (Method.ApplyAttributeBuilder): Add error 685 report.
15649 (Operator.Define): Add error 564 report.
15651 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15653 * expression.cs (Invocation.DoResolve): Add error
15654 245 and 250 report.
15656 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15659 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15661 * class.cs (ConstructorInitializer.Resolve):
15662 Wrong error number (515->516).
15664 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15666 * class.cs (Indexer.Define): Add error 631 report.
15668 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15670 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15672 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15674 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15676 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15678 * cs-parser.jay: Added error CS0241 report.
15680 2004-09-10 Raja R Harinath <rharinath@novell.com>
15682 * cs-parser.jay (fixed_statement): Introduce a scope for the
15683 declaration in the 'fixed' statement.
15685 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15687 * cs-parser.jay: Added CS0230 error report.
15689 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15691 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15693 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15695 * expression.cs (Argument.Resolve): Added error CS0192 and
15698 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15700 C# 2.0 #pragma warning feature
15702 * cs-tokenizer.cs (PreProcessPragma): New method;
15703 Handles #pragma directive.
15705 * report.cs (WarningRegions): New class; Support
15706 class for #pragma warning directive. It tests whether
15707 warning is enabled for a given line.
15709 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15711 * const.cs: Add more descriptive error report, tahnks to
15714 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15716 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15718 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15720 * expression.cs: Apply patch from Ben: Remove dead code from
15721 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15722 as that code just threw an exception anwyays.
15724 * const.cs: Remove the call to the turnintoconstant, for details
15727 * literal.cs: The type of the null-literal is the null type; So
15728 we use a placeholder type (literal.cs:System.Null, defined here)
15731 * expression.cs (Conditional.DoResolve): Remove some old code that
15732 is no longer needed, conversions have been fixed.
15734 (ArrayCreationExpression.DoResolve): Return false if we fail to
15735 resolve the inner expression.
15737 2004-09-07 Raja R Harinath <rharinath@novell.com>
15740 * cs-parser.jay (delegate_declaration): Record a delegate
15741 declaration as a type declaration.
15742 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15744 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15746 * parameter.cs: Do not crash if the type can not be resolved.
15748 * expression.cs: Report errors with unsafe pointers, fixes #64896
15750 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15752 * expression.cs: Pointer arith always needs to do a conv.i
15753 if the operand is a long. fix 65320
15755 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15757 Fixed cs0619-37.cs, cs0619-38.cs
15759 * enum.cs (GetObsoleteAttribute): Removed.
15761 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15762 on Enum member is double staged. The first is tested member
15765 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15767 Fixed #56986, #63631, #65231
15769 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15770 adds member to name container.
15771 (TypeContainer.AddToTypeContainer): New method, adds type to
15773 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15774 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15775 AddOperator): Simplified by reusing AddToMemberContainer.
15776 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15778 (Method.CheckForDuplications): Fixed implementation to test all
15780 (MemberBase): Detection whether member is explicit interface
15781 implementation is now in constructor.
15782 (MemberBase.UpdateMemberName): Handles IndexerName.
15783 (Accessor): Changed to keep also location information.
15784 (AbstractPropertyEventMethod): Is derived from MemberCore.
15785 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15786 will be emited or not.
15787 (PropertyBase.AreAccessorsDuplicateImplementation):
15788 Tests whether accessors are not in collision with some method.
15789 (Operator): Is derived from MethodCore to simplify common
15792 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15794 (DeclSpace.AddToContainer): Adds the member to defined_names
15795 table. It tests for duplications and enclosing name conflicts.
15797 * enum.cs (EnumMember): Clean up to reuse the base structures
15799 2004-09-03 Martin Baulig <martin@ximian.com>
15801 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15802 into TypeContainer, to make partial classes work again.
15804 2004-09-03 Martin Baulig <martin@ximian.com>
15806 * rootcontext.cs (RootContext.V2): Removed.
15808 2004-03-23 Martin Baulig <martin@ximian.com>
15810 * expression.cs (Invocation.OverloadResolve): Added `bool
15811 may_fail' argument and use it instead of the Location.IsNull() hack.
15813 2004-09-03 Martin Baulig <martin@ximian.com>
15815 Merged latest changes into gmcs. Please keep this comment in
15816 here, it makes it easier for me to see what changed in MCS since
15817 the last time I merged.
15819 2004-09-03 Raja R Harinath <rharinath@novell.com>
15822 * expression.cs (BetterConversion): Don't allow either conversion
15823 to be null. Remove redundant implicit conversion test when 'q ==
15824 null' -- when this function is invoked, we already know that the
15825 implicit conversion exists.
15826 (BetterFunction): Assume that 'best' is non-null. Remove
15827 redundant reimplementation of IsApplicable when 'best' is null.
15828 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15829 number of arguments.
15830 (IsAncestralType): Extract from OverloadResolve.
15831 (OverloadResolve): Make robust to the MethodGroupExpr being
15832 unsorted. Implement all the logic of Section 14.5.5.1, and
15833 support overloading of methods from multiple applicable types.
15834 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15836 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15837 (RealError, Warning): Append type of report to related symbol.
15839 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15841 * enum.cs: Fixed CLS-Compliance checks for enum members.
15842 Error tests cs3008-8.cs, cs3014-8.cs
15844 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15846 Fixed bug #62342, #63102
15847 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15848 like ImplementMethod.
15850 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15852 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15855 2004-09-02 Martin Baulig <martin@ximian.com>
15857 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15858 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15861 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15863 C# 2.0 Static classes implemented
15865 * class.cs (TypeContainer): instance_constructors,
15866 initialized_fields, initialized_static_fields,
15867 default_constructor, base_inteface_types are protected to be
15868 accessible from StaticClass.
15869 (TypeContainer.DefineDefaultConstructor): New virtual method
15870 for custom default constructor generating
15871 (StaticClass): New class to handle "Static classes" feature.
15873 * cs-parser.jay: Handle static keyword on class like instance
15876 * driver.cs: Added "/langversion" command line switch with two
15877 options (iso-1, default).
15879 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15881 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15883 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15885 * delegate.cs: Style.
15887 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15889 * delegate.cs: Add seperate instance expr field for miguel.
15891 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15893 * PointerArithmetic (Resolve): make sure we are not doing
15894 pointer arith on void*. Also, make sure we are resolved
15895 by not setting eclass until resolve.
15897 All callers: Make sure that PointerArithmetic gets resolved.
15899 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15901 * ArrayCreation (LookupType): If the type does not resolve
15902 to an array, give an error.
15904 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15906 * statement.cs (Try.Resolve): Fixed bug #64222
15908 2004-08-27 Martin Baulig <martin@ximian.com>
15911 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15914 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15916 * ecore.cs (Constantify): Get underlying type via
15917 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15918 Windows in special cases.
15920 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15922 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15923 for obtaining also private methods.
15924 (GetRemoveMethod): Used GetRemoveMethod (true)
15925 for obtaining also private methods.
15927 2004-08-24 Martin Baulig <martin@ximian.com>
15929 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15930 MethodAttributes.HideBySig for operators.
15932 2004-08-23 Martin Baulig <martin@ximian.com>
15934 Back to the old error reporting system :-)
15936 * report.cs (Message): Removed.
15937 (Report.MessageData, ErrorData, WarningData): Removed.
15938 (Report.Error, Warning): Back to the old system.
15940 2004-08-23 Martin Baulig <martin@ximian.com>
15942 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15944 * class.cs (TypeContainer.ParentContainer): New public virtual
15945 method; replaces the explicit interface implementation.
15946 (ClassPart.ParentContainer): Override.
15948 2004-08-23 Martin Baulig <martin@ximian.com>
15950 * statement.cs (Switch): Added support for constant switches; see
15951 #59428 or test-285.cs.
15953 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15956 * statement.cs (GetEnumeratorFilter): Removed useless
15957 logic because C# specs is strict. GetEnumerator must be
15960 2004-08-22 Martin Baulig <martin@ximian.com>
15962 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15963 a switch and may break, reset the barrier. Fixes #59867.
15965 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15967 CLS-Compliance speed up (~5% for corlib)
15969 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15970 New method. Tests container for CLS-Compliant names
15972 * class.cs (TypeContainer.VerifyClsName): New method.
15973 Checks whether container name is CLS Compliant.
15974 (Constructor): Implements IMethodData.
15976 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15977 low-case table for CLS Compliance test.
15978 (MemberCache.VerifyClsParameterConflict): New method.
15979 Checks method parameters for CS3006 error.
15981 * enum.cs (EnumMember): Is derived from MemberCore.
15982 (Enum.VerifyClsName): Optimized for better performance.
15984 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15986 * report.cs: Renamed Error_T to Error and changed all
15989 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15991 * class.cs (TypeContainer.IndexerArrayList): New inner class
15992 container for indexers.
15993 (TypeContainer.DefaultIndexerName): New constant for default
15994 indexer name. Replaced all "Item" with this constant.
15995 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15997 * typemanager.cs (TypeManager.default_member_ctor): Cache here
15998 DefaultMemberAttribute constructor.
16000 2004-08-05 Martin Baulig <martin@ximian.com>
16002 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16005 2004-08-05 Marek Safar <marek.safar@seznam.cz>
16007 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16008 multi platforms problem.
16010 * compiler.csproj: Included shared files.
16012 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16014 Fix bug 60333, 55971 in the more general way
16015 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16016 Added arg_type argument for constant conversion.
16017 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16019 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16022 * class.cs (TypeContainer ): New inner classes MethodArrayList,
16023 OperatorArrayList, MethodCoreArrayList for typecontainer
16024 containers. Changed class member types to these new types.
16025 (MethodArrayList.DefineMembers): Added test for CS0659.
16027 2004-08-04 Miguel de Icaza <miguel@ximian.com>
16029 * cfold.cs: Synchronize the folding with the code in expression.cs
16030 Binary.DoNumericPromotions for uint operands.
16032 * attribute.cs: Revert patch from Raja, it introduced a regression
16033 while building Blam-1.2.1 (hard to isolate a test case).
16035 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16039 (TypeContainer.Define): Renamed to DefineContainerMembers because of
16041 (MethodCore.parent_method): New member. The method we're overriding
16042 if this is an override method.
16043 (MethodCore.CheckBase): Moved from Method class and made common.
16044 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16046 (MethodCore.CheckForDuplications): New abstract method. For custom
16047 member duplication search in a container
16048 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16049 method and its return type.
16050 (Event.conflict_symbol): New member. Symbol with same name in the
16054 (MemberCache.FindMemberWithSameName): New method. The method
16055 is looking for conflict with inherited symbols.
16057 2004-08-04 Martin Baulig <martin@ximian.com>
16059 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16061 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16063 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16065 * report.cs (Message): New enum for better error, warning reference in
16067 (MessageData): New inner abstract class. It generally handles printing of
16068 error and warning messages.
16069 Removed unused Error, Warning, Message methods.
16071 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16073 Fix for cs0592-8.cs test
16075 (Attributable.ValidAttributeTargets): Made public.
16076 (Attribute.ExplicitTarget): New member for explicit target value.
16077 (Attribute.CheckTargets): Now we translate explicit attribute
16078 target to Target here.
16080 2004-08-03 Ben Maurer <bmaurer@ximian.com>
16082 * ecore.cs (MethodGroupExpr): new IsBase property.
16084 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16086 * delegate.cs (DelegateCreation): store a MethodGroupExpr
16087 rather than an instance expr.
16089 (DelegateCreation.Emit): Use the method group rather than
16090 the instance expression. Also, if you have base.Foo as the
16091 method for a delegate, make sure to emit ldftn, not ldftnvirt.
16093 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
16095 (NewDelegate.DoResolve): Only check for the existance of Invoke
16096 if the method is going to be needed. Use MethodGroupExpr.
16098 (NewDelegate.Emit): Remove, DelegateCreation implements this.
16100 * expression.cs: For pointer arith., make sure to use
16101 the size of the type, not the size of the pointer to
16104 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16107 * class.cs (Class): Added error CS0502 test.
16109 2004-08-03 John Luke <jluke@cfl.rr.com>
16110 Raja R Harinath <rharinath@novell.com>
16113 * attribute.cs (Attribute.complained_before): New flag.
16114 (Attribute.ResolveType, Attribute.Resolve),
16115 (Attribute.DefinePInvokeMethod): Set it.
16116 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16118 2004-08-03 Martin Baulig <martin@ximian.com>
16120 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16121 use a user-defined operator; we still need to do numeric
16122 promotions in case one argument is a builtin type and the other
16123 one has an implicit conversion to that type. Fixes #62322.
16125 2004-08-02 Martin Baulig <martin@ximian.com>
16127 * statement.cs (LocalInfo.Flags): Added `IsThis'.
16128 (LocalInfo.IsThis): New public property.
16129 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16131 2004-08-01 Martin Baulig <martin@ximian.com>
16133 * class.cs (TypeContainer.GetClassBases): Don't set the default
16134 here since we may get called from GetPartialBases().
16135 (TypeContainer.DefineType): If GetClassBases() didn't return a
16136 parent, use the default one.
16138 2004-07-30 Duncan Mak <duncan@ximian.com>
16140 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16142 2004-07-30 Martin Baulig <martin@ximian.com>
16144 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16146 * class.cs (SourceMethod): New public class, derive from the
16147 symbol writer's ISourceMethod.
16148 (Method): Use the new symbol writer API.
16150 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16151 as argument and use the new symbol writer.
16154 (SourceFile): Implement the symbol writer's ISourceFile.
16155 (Location.SymbolDocument): Removed.
16156 (Location.SourceFile): New public property.
16158 * symbolwriter.cs: Use the new symbol writer API.
16160 2004-07-30 Raja R Harinath <rharinath@novell.com>
16162 * Makefile (install-local): Remove. Functionality moved to
16165 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
16167 * Makefile: Install mcs.exe.config file together with mcs.exe.
16168 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16169 correct runtime version.
16171 2004-07-25 Martin Baulig <martin@ximian.com>
16174 (TypeContainer.RegisterOrder): Removed, this was unused.
16175 (TypeContainer, interface_order): Removed.
16176 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16177 TypeContainer as argument since we can also be called with a
16178 `PartialContainer' for a partial class/struct/interface.
16179 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16180 of checking whether we're an `Interface' - we could be a
16181 `PartialContainer'.
16182 (PartialContainer.Register): Override; call
16183 AddClass()/AddStruct()/AddInterface() on our parent.
16185 * cs-parser.jay (interface_member_declaration): Add things to the
16186 `current_container', not the `current_class'.
16188 * rootcontext.cs (RegisterOrder): The overloaded version which
16189 takes an `Interface' was unused, removed.
16191 * typemanager.cs (TypeManager.LookupInterface): Return a
16192 `TypeContainer', not an `Interface'.
16193 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16194 contain a `PartialContainer' for an interface, so check it's
16195 `Kind' to figure out what it is.
16197 2004-07-25 Martin Baulig <martin@ximian.com>
16199 * class.cs (Class.DefaultTypeAttributes): New public constant.
16200 (Struct.DefaultTypeAttributes): Likewise.
16201 (Interface.DefaultTypeAttributes): Likewise.
16202 (PartialContainer.TypeAttr): Override this and add the
16203 DefaultTypeAttributes.
16205 2004-07-25 Martin Baulig <martin@ximian.com>
16207 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16208 we can just use the `Parent' field instead.
16210 2004-07-25 Martin Baulig <martin@ximian.com>
16212 * class.cs (TypeContainer.Emit): Renamed to EmitType().
16214 2004-07-25 Martin Baulig <martin@ximian.com>
16216 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16217 our parts before defining any methods.
16218 (TypeContainer.VerifyImplements): Make this virtual.
16219 (ClassPart.VerifyImplements): Override and call VerifyImplements()
16220 on our PartialContainer.
16222 2004-07-25 Martin Baulig <martin@ximian.com>
16224 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16226 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16227 argument, we can just use the `Parent' field instead.
16230 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
16231 (MemberBase.DoDefine): Likewise.
16233 2004-07-24 Martin Baulig <martin@ximian.com>
16235 * decl.cs (MemberCore.Parent): New public field.
16236 (DeclSpace.Parent): Moved to MemberCore.
16238 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16239 (MemberBase.ctor): Added TypeContainer argument, pass it to our
16241 (FieldBase, Field, Operator): Likewise.
16242 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16243 (EventField, Event): Likewise.
16245 2004-07-23 Martin Baulig <martin@ximian.com>
16247 * class.cs (PartialContainer): New public class.
16248 (ClassPart): New public class.
16249 (TypeContainer): Added support for partial classes.
16250 (TypeContainer.GetClassBases): Splitted some of the functionality
16251 out into GetNormalBases() and GetPartialBases().
16253 * cs-tokenizer.cs (Token.PARTIAL): New token.
16254 (Tokenizer.consume_identifier): Added some hacks to recognize
16255 `partial', but only if it's immediately followed by `class',
16256 `struct' or `interface'.
16258 * cs-parser.jay: Added support for partial clases.
16260 2004-07-23 Martin Baulig <martin@ximian.com>
16262 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16263 a `DeclSpace' and also made it readonly.
16264 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16265 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16266 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16268 * cs-parser.jay: Pass the `current_class', not the
16269 `current_container' (at the moment, this is still the same thing)
16270 to a new Method, Property, Event, Indexer or Constructor.
16272 2004-07-23 Martin Baulig <martin@ximian.com>
16274 * cs-parser.jay (CSharpParser): Added a new `current_class' field
16275 and removed the `current_interface' one.
16276 (struct_declaration, class_declaration, interface_declaration):
16277 Set `current_class' to the newly created class/struct/interface;
16278 set their `Bases' and call Register() before parsing their body.
16280 2004-07-23 Martin Baulig <martin@ximian.com>
16282 * class.cs (Kind): New public enum.
16283 (TypeContainer): Made this class abstract.
16284 (TypeContainer.Kind): New public readonly field.
16285 (TypeContainer.CheckDef): New public method; moved here from
16287 (TypeContainer.Register): New public abstract method.
16288 (TypeContainer.GetPendingImplementations): New public abstract
16290 (TypeContainer.GetClassBases): Removed the `is_class' and
16291 `is_iface' parameters.
16292 (TypeContainer.DefineNestedTypes): Formerly known as
16294 (ClassOrStruct): Made this class abstract.
16296 * tree.cs (RootTypes): New public type.
16298 2004-07-20 Martin Baulig <martin@ximian.com>
16300 * tree.cs (Tree.RecordNamespace): Removed.
16301 (Tree.Namespaces): Removed.
16303 * rootcontext.cs (RootContext.IsNamespace): Removed.
16305 * cs-parser.jay (namespace_declaration): Just create a new
16306 NamespaceEntry here.
16308 2004-07-20 Martin Baulig <martin@ximian.com>
16310 * statement.cs (ExceptionStatement): New abstract class. This is
16311 now used as a base class for everyone who's using `finally'.
16312 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16313 our local variables before using them.
16315 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16316 virtual method. This is used by Yield.Resolve() to "steal" an
16317 outer block's `finally' clauses.
16318 (FlowBranchingException): The .ctor now takes an ExceptionStatement
16321 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16322 version which takes an ExceptionStatement. This version must be
16323 used to create exception branchings.
16326 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16327 (Iterator.EmitMoveNext): Added exception support; protect the
16328 block with a `fault' clause, properly handle 'finally' clauses.
16329 (Iterator.EmitDispose): Run all the `finally' clauses here.
16331 2004-07-20 Martin Baulig <martin@ximian.com>
16333 * iterator.cs: This is the first of a set of changes in the
16334 iterator code. Match the spec more closely: if we're an
16335 IEnumerable, then GetEnumerator() must be called. The first time
16336 GetEnumerator() is called, it returns the current instance; all
16337 subsequent invocations (if any) must create a copy.
16339 2004-07-19 Miguel de Icaza <miguel@ximian.com>
16341 * expression.cs: Resolve the constant expression before returning
16344 2004-07-19 Martin Baulig <martin@ximian.com>
16346 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16347 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16348 the return type of the new EmitContext.
16350 2004-07-18 Martin Baulig <martin@ximian.com>
16352 * class.cs (Property.Define): Fix iterators.
16354 * iterators.cs (Iterator.Define): Moved the
16355 `container.AddInterator (this)' call here from the .ctor; only do
16356 it if we resolved successfully.
16358 2004-07-17 Miguel de Icaza <miguel@ximian.com>
16360 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16361 `true' for preprocessing directives that we parse. The return
16362 value indicates whether we should return to regular tokenizing or
16363 not, not whether it was parsed successfully.
16365 In the past if we were in: #if false ... #line #endif, we would
16366 resume parsing after `#line'. See bug 61604.
16368 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16369 building: IsEnumType should return true only for enums, not for
16370 enums or System.Enum itself. This fixes #61593.
16372 Likely what happened is that corlib was wrong: mcs depended on
16373 this bug in some places. The bug got fixed, we had to add the
16374 hack, which caused bug 61593.
16376 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16377 that was a workaround for the older conditions.
16379 2004-07-16 Ben Maurer <bmaurer@ximian.com>
16381 * assign.cs: IAssignMethod has a new interface, as documented
16382 inline. All assignment code now uses this new api.
16384 * ecore.cs, expression.cs: All classes which implement
16385 IAssignMethod now use the new interface.
16387 * expression.cs (Invocation): add a hack to EmitCall so that
16388 IndexerAccess can be the target of a compound assignment without
16389 evaluating its arguments twice.
16391 * statement.cs: Handle changes in Invocation api.
16393 2004-07-16 Martin Baulig <martin@ximian.com>
16395 * iterators.cs: Rewrote this. We're now using one single Proxy
16396 class for both the IEnumerable and the IEnumerator interface and
16397 `Iterator' derives from Class so we can use the high-level API.
16399 * class.cs (TypeContainer.AddIterator): New method.
16400 (TypeContainer.DoDefineType): New protected virtual method, which
16401 is called from DefineType().
16402 (TypeContainer.DoDefineMembers): Call DefineType() and
16403 DefineMembers() on all our iterators.
16404 (TypeContainer.Emit): Call Emit() on all our iterators.
16405 (TypeContainer.CloseType): Call CloseType() on all our iterators.
16407 * codegen.cs (EmitContext.CurrentIterator): New public field.
16409 2004-07-15 Martin Baulig <martin@ximian.com>
16412 (TypeManager.not_supported_exception_type): New type.
16414 2004-07-14 Martin Baulig <martin@ximian.com>
16416 * iterators.cs: Use real error numbers.
16418 2004-07-14 Martin Baulig <martin@ximian.com>
16420 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16421 requires this to be a System.Collection.IEnumerable and not a
16422 class implementing that interface.
16423 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
16425 2004-07-13 Marek Safar <marek.safar@seznam.cz>
16427 * class.cs: Fixed previous fix, it broke some error tests.
16429 2004-07-12 Martin Baulig <martin@ximian.com>
16431 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16434 2004-07-09 Miguel de Icaza <miguel@ximian.com>
16436 * assign.cs (LocalTemporary): Add new argument: is_address,If
16437 `is_address' is true, then the value that we store is the address
16438 to the real value, and not the value itself.
16440 * ecore.cs (PropertyExpr): use the new local temporary
16441 stuff to allow us to handle X.Y += z (where X is a struct)
16443 2004-07-08 Martin Baulig <martin@ximian.com>
16445 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16446 not always return, just like we're doing in Using.Resolve().
16448 2004-07-07 Miguel de Icaza <miguel@ximian.com>
16450 * cs-parser.jay (fixed_statement): flag this as Pinned.
16452 2004-07-06 Miguel de Icaza <miguel@ximian.com>
16454 * typemanager.cs (TypeManager): Removed MakePinned method, this
16455 mechanism is replaced with the .NET 2.x compatible mechanism of
16456 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16458 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
16459 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16460 `IsFixed' property which has a different meaning.
16462 2004-07-02 Raja R Harinath <rharinath@novell.com>
16464 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16465 visible from inside a nested class, not just the names of the
16466 immediately enclosing class.
16467 Fix for bug #60730.
16469 2004-06-24 Raja R Harinath <rharinath@novell.com>
16471 * expression.cs (BetterConversion): Remove buggy special-case
16472 handling of "implicit constant expression conversions". At this
16473 point, we already know that the conversion is possible -- we're
16474 only checking to see which is better.
16476 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16478 * cs-parser.jay: Added error CS0210 test.
16480 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16482 * cs-parser.jay: Added error CS0134 test.
16484 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16487 * cs-parser.jay: Added error CS0145 test.
16489 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16491 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16493 2004-06-23 Ben Maurer <bmaurer@ximian.com>
16495 * expression.cs (StackAlloc.Resolve): The argument may not
16496 be a constant; deal with this case.
16498 2004-06-23 Marek Safar <marek.safar@seznam.cz>
16500 * attribute.cs (IndexerName_GetIndexerName): Renamed to
16501 GetIndexerAttributeValue.
16502 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16504 * class.cs (Indexer.Define): Added error tests for CS0415,
16507 2004-06-23 Miguel de Icaza <miguel@ximian.com>
16509 * attribute.cs (Attribute.Resolve): Keep field code in sync with
16512 2004-06-23 Martin Baulig <martin@ximian.com>
16514 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16515 neither return nor throw, reset the barrier as well. Fixes #60457.
16517 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
16519 * class.cs : EventAttributes is now set to None by default.
16520 This fixes bug #60459.
16522 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16525 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16526 Don't throw exception but return null (it's sufficient now).
16528 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16530 * typemanager.cs (GetArgumentTypes): Faster implementation.
16532 2004-06-18 Martin Baulig <martin@ximian.com>
16534 * attribute.cs (Attribute.Resolve): Check whether we're an
16535 EmptyCast which a Constant child. Fixes #60333.
16537 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16539 * statement.cs (EmitCollectionForeach): Account for the fact that
16540 not all valuetypes are in areas which we can take the address of.
16541 For these variables, we store to a temporary variable. Also, make
16542 sure that we dont emit a `callvirt' on a valuetype method.
16544 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16546 * expression.cs (StackAlloc.DoReSolve): Added test for
16547 negative parameter (CS0247).
16549 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16552 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16554 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16557 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16560 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16562 Fix bug #58254 & cs1555.cs, cs1556.cs
16563 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16565 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16567 * cs-parser.jay: Added error CS1669 test for indexers.
16569 2004-06-11 Martin Baulig <martin@ximian.com>
16571 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16572 call this twice: for params and varargs methods.
16574 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16577 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16579 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16581 * attribute.cs (Attribute.GetValidTargets): Made public.
16584 (AbstractPropertyEventMethod): New class for better code sharing.
16585 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16587 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16589 2004-06-11 Raja R Harinath <rharinath@novell.com>
16592 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16593 that the call to Resolve is part of a MemberAccess.
16594 (Expression.Resolve): Use it for SimpleName resolution.
16595 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16596 Add 'intermediate' boolean argument.
16597 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16598 error message when the SimpleName can be resolved ambiguously
16599 between an expression and a type.
16600 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16602 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16603 call on the left-side.
16605 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16608 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16610 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16612 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16614 2004-06-11 Martin Baulig <martin@ximian.com>
16616 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16617 varargs methods if applicable.
16619 2004-06-11 Martin Baulig <martin@ximian.com>
16621 * expression.cs (Invocation.EmitCall): Don't use
16622 `method.CallingConvention == CallingConventions.VarArgs' since the
16623 method could also have `CallingConventions.HasThis'.
16625 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16627 * class.cs (Event.GetSignatureForError): Implemented.
16628 Fixed crash in error test cs3010.cs
16630 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16632 * cs-tokenizer.cs: Change the way we track __arglist to be
16633 consistent with the other keywords.
16635 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16637 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16640 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16642 * codegen.cs: Check that all referenced assemblies have a strongname
16643 before strongnaming the compiled assembly. If not report error CS1577.
16644 Fix bug #56563. Patch by Jackson Harper.
16645 * typemanager.cs: Added a method to return all referenced assemblies.
16646 Fix bug #56563. Patch by Jackson Harper.
16648 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16651 (Method.ApplyAttributeBuilder): Moved and added conditional
16652 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16655 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16657 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16660 * class.cs: (EventField.attribute_targets): Changed default target.
16662 2004-06-08 Martin Baulig <martin@ximian.com>
16664 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16666 2004-06-08 Martin Baulig <martin@ximian.com>
16668 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16670 2004-06-07 Martin Baulig <martin@ximian.com>
16672 Added support for varargs methods.
16674 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16677 * cs-parser.jay: Added support for `__arglist'.
16679 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16681 * expression.cs (Argument.AType): Added `ArgList'.
16682 (Invocation): Added support for varargs methods.
16683 (ArglistAccess): New public class.
16684 (Arglist): New public class.
16686 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16688 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16689 a method's top-level block if the method has varargs.
16691 * support.cs (ReflectionParameters, InternalParameters): Added
16692 support for varargs methods.
16694 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16696 * class.cs: Provide location in indexer error report.
16698 * driver.cs: Use standard names.
16700 * namespace.cs: Catch the use of using after a namespace has been
16701 declared also on using aliases.
16703 2004-06-03 Raja R Harinath <rharinath@novell.com>
16706 * typemanager.cs (closure_private_ok, closure_invocation_type)
16707 (closure_qualifier_type, closure_invocation_assembly)
16708 (FilterWithClosure): Move to ...
16709 (Closure): New internal nested class.
16710 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16711 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16712 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16713 (MemberLookup, MemberLookupFailed): Use it.
16714 * expression.cs (New.DoResolve): Treat the lookup for the
16715 constructor as being qualified by the 'new'ed type.
16716 (Indexers.GetIndexersForTypeOrInterface): Update.
16718 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16721 (GetConditionalAttributeValue): New method. Returns
16722 condition of ConditionalAttribute.
16723 (SearchMulti): New method. Returns all attributes of type 't'.
16724 Use it when attribute is AllowMultiple = true.
16725 (IsConditionalMethodExcluded): New method.
16728 (Method.IsExcluded): Implemented. Returns true if method has conditional
16729 attribute and the conditions is not defined (method is excluded).
16730 (IMethodData): Extended interface for ConditionalAttribute support.
16731 (PropertyMethod.IsExcluded): Implemented.
16734 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16737 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16740 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16742 * expression.cs (ArrayCreationExpression): Make this just an
16743 `expression'. It can't be a statement, so the code here was
16746 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16749 * typemanager.cs (GetFullNameSignature): New method for
16752 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16755 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16756 Use this method when MethodBuilder is null.
16757 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16758 Added test for error CS0626 (MONO reports error for this situation).
16759 (IMethodData.GetSignatureForError): Extended interface.
16761 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16764 (AttributeTester.GetObsoleteAttribute): Returns instance of
16765 ObsoleteAttribute when type is obsolete.
16768 (TypeContainer.VerifyObsoleteAttribute): Override.
16769 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16770 (MethodCode.VerifyObsoleteAttribute): Override.
16771 (MemberBase.VerifyObsoleteAttribute): Override.
16774 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16775 and report proper error.
16778 Delegate.VerifyObsoleteAttribute): Override.
16781 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16782 and report proper error.
16783 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16786 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16790 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16791 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16792 Added test for ObsoleteAttribute.
16795 (Catch): Derived from Statement.
16797 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16799 Fixed bug #59071 & cs0160.cs
16801 * statement.cs (Try.Resolve): Check here whether order of catch
16802 clauses matches their dependencies.
16804 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16806 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16807 caused a regression: #59343. Referencing nested classes from an
16808 assembly stopped working.
16810 2004-05-31 Martin Baulig <martin@ximian.com>
16812 MCS is now frozen for beta 2.
16814 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16816 * convert.cs: add a trivial cache for overload operator resolution.
16818 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16820 * decl.cs: If possible, use lookuptypedirect here. We can only do
16821 this if there is no `.' after the namespace. Avoids using
16822 LookupType, which does lots of slow processing.
16823 (FindNestedType) New method, does what it says :-).
16824 * namespace.cs: use LookupTypeDirect.
16825 * rootcontext.cs: use membercache, if possible.
16826 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16828 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16831 According to the spec,
16833 In a member access of the form E.I, if E is a single identifier,
16834 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16835 field, property, localvariable, or parameter with the same type as
16836 the meaning of E as a type-name (§3.8), then both possible
16837 meanings of E are permitted.
16839 We did not check that E as a simple-name had the same type as E as
16842 This trivial check gives us 5-7% on bootstrap time.
16844 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16846 * expression.cs (Invocation.OverloadResolve): Avoid the
16847 use of hashtables and boxing here by allocating on demand.
16849 2004-05-30 Martin Baulig <martin@ximian.com>
16851 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16852 we're doing a silent lookup. Don't try to lookup nested types in
16853 TypeManager.object_type (thanks to Ben Maurer).
16855 2004-05-30 Martin Baulig <martin@ximian.com>
16857 Committing a patch from Ben Maurer.
16859 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16861 2004-05-29 Martin Baulig <martin@ximian.com>
16863 * class.cs (IMethodData.ShouldIgnore): New method.
16865 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16866 `Location' argument, we don't need it anywhere. Use
16867 `IMethodData.ShouldIgnore ()' instead of
16868 `MethodData.GetMethodFlags ()'.
16869 (TypeManager.AddMethod): Removed.
16870 (TypeManager.AddMethod2): Renamed to AddMethod.
16872 2004-05-29 Martin Baulig <martin@ximian.com>
16874 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16876 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16877 converting from a class type S to an interface type and we already
16878 have an object on the stack, don't box it again. Fixes #52578.
16880 2004-05-29 Martin Baulig <martin@ximian.com>
16882 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16883 Added support for `params' parameters. Fixes #59267.
16885 2004-05-29 Martin Baulig <martin@ximian.com>
16887 * literal.cs (NullPointer): Provide a private .ctor which sets
16888 `type' to TypeManager.object_type. Fixes #59048.
16890 2004-05-29 Martin Baulig <martin@ximian.com>
16892 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16893 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16895 * ecore.cs (EventExpr.instance_expr): Make the field private.
16897 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16899 Fixed bug #50080 & cs0214-2.cs
16900 * expression.cs (Cast.DoResolve): Check unsafe context here.
16902 * statement.cs (Resolve.DoResolve): Likewise.
16904 2004-05-26 Martin Baulig <martin@ximian.com>
16906 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16908 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16909 (RootContext.LookupType): Pass down the `silent' flag.
16911 2004-05-25 Martin Baulig <martin@ximian.com>
16914 (MethodGroupExpr.IdenticalTypeName): New public property.
16915 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16916 expression actually refers to a type.
16918 2004-05-25 Martin Baulig <martin@ximian.com>
16920 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16921 for #56176 and made it actually work.
16923 2004-05-25 Martin Baulig <martin@ximian.com>
16925 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16926 (FieldExpr, PropertyExpr): Override and implement
16927 CacheTemporaries. Fixes #52279.
16929 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16931 * location.cs: In the new compiler listing a file twice is a
16932 warning, not an error.
16934 2004-05-24 Martin Baulig <martin@ximian.com>
16936 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16937 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16939 2004-05-24 Martin Baulig <martin@ximian.com>
16941 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16942 walking the `using' list. Fixes #53921.
16944 2004-05-24 Martin Baulig <martin@ximian.com>
16946 * const.cs (Const.LookupConstantValue): Added support for
16947 EmptyCast's; fixes #55251.
16949 2004-05-24 Martin Baulig <martin@ximian.com>
16951 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16952 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16953 which does the CS0135 check. The reason is that we first need to
16954 check whether the variable actually exists.
16956 2004-05-24 Martin Baulig <martin@ximian.com>
16958 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16959 than RootContext.LookupType() to find the explicit interface
16960 type. Fixes #58584.
16962 2004-05-24 Raja R Harinath <rharinath@novell.com>
16964 * Makefile: Simplify. Use executable.make.
16965 * mcs.exe.sources: New file. List of sources of mcs.exe.
16967 2004-05-24 Anders Carlsson <andersca@gnome.org>
16971 Use the invariant culture when doing String.Compare for CLS case
16974 2004-05-23 Martin Baulig <martin@ximian.com>
16976 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16977 don't have any dots. Fixes #52622, added cs0246-8.cs.
16979 * namespace.cs (NamespaceEntry.Lookup): Likewise.
16981 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16983 * class.cs (MemberBase.Define): Reuse MemberType member for
16984 resolved type. Other methods can use it too.
16986 2004-05-23 Martin Baulig <martin@ximian.com>
16988 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16989 the variable also exists in the current block (otherwise, we need
16990 to report a CS0103). Fixes #58670.
16992 2004-05-23 Martin Baulig <martin@ximian.com>
16994 * flowanalysis.cs (Reachability.Reachable): Compute this
16995 on-the-fly rather than storing it as a field.
16997 2004-05-23 Martin Baulig <martin@ximian.com>
16999 * flowanalysis.cs (Reachability.And): Manually compute the
17000 resulting `barrier' from the reachability.
17002 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17005 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17006 instance of ObsoleteAttribute when symbol is obsolete.
17009 (IMethodData): Extended interface for ObsoleteAttribute support.
17011 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17013 * attribute.cs: Fix bug #55970
17015 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17019 (GetObsoleteAttribute): New method. Creates the instance of
17021 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17022 ObsoleteAttribute when member is obsolete.
17023 (AttributeTester.Report_ObsoleteMessage): Common method for
17024 Obsolete error/warning reporting.
17027 (TypeContainer.base_classs_type): New member for storing parent type.
17030 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17031 for this MemberCore.
17033 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17035 * attribute.cs, const.cs: Fix bug #58590
17037 2004-05-21 Martin Baulig <martin@ximian.com>
17039 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17040 out parameters if the end of the method is unreachable. Fixes
17043 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17045 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17046 Hari was right, why extra method.
17048 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17050 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17052 2004-05-20 Martin Baulig <martin@ximian.com>
17054 Merged this back from gmcs to keep the differences to a minumum.
17056 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17057 instead of a Declspace.
17058 (Attribute.ResolveType): Likewise.
17059 (Attributes.Search): Likewise.
17060 (Attributes.Contains): Likewise.
17061 (Attributes.GetClsCompliantAttribute): Likewise.
17063 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17065 (MethodData.ApplyAttributes): Take an EmitContext instead of a
17068 2004-05-19 Marek Safar <marek.safar@seznam.cz>
17070 Fix bug #58688 (MCS does not report error when the same attribute
17073 * attribute.cs (Attribute.Emit): Distinction between null and default.
17075 2004-05-19 Raja R Harinath <rharinath@novell.com>
17077 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17078 of a top-level attribute without an attribute target.
17079 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
17081 (Attribute.Conditional_GetConditionName),
17082 (Attribute.Obsolete_GetObsoleteMessage): Update.
17083 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
17084 part of ScanForIndexerName.
17085 (Attribute.CanIgnoreInvalidAttribute): New function.
17086 (Attribute.ScanForIndexerName): Move to ...
17087 (Attributes.ScanForIndexerName): ... here.
17088 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17089 (Attributes.Search): New internal variant that can choose not to
17090 complain if types aren't resolved. The original signature now
17092 (Attributes.GetClsCompliantAttribute): Use internal variant, with
17093 complaints suppressed.
17094 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17095 only if it not useful.
17096 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17097 top-level for attributes that are shared between the assembly
17098 and a top-level class.
17099 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17100 * class.cs: Update to reflect changes.
17101 (DefineIndexers): Fuse loops.
17102 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
17103 a couple more variants of attribute names.
17105 2004-05-18 Marek Safar <marek.safar@seznam.cz>
17107 Fix bug #52585 (Implemented explicit attribute declaration)
17110 (Attributable.ValidAttributeTargets): New abstract method. It gets
17111 list of valid attribute targets for explicit target declaration.
17112 (Attribute.Target): It holds target itself.
17113 (AttributeSection): Removed.
17114 (Attribute.CheckTargets): New method. It checks whether attribute
17115 target is valid for the current element.
17118 (EventProperty): New class. For events that are declared like
17119 property (with add and remove accessors).
17120 (EventField): New class. For events that are declared like field.
17123 * cs-parser.jay: Implemented explicit attribute target declaration.
17125 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
17126 Override ValidAttributeTargets.
17129 (ReturnParameter): Class for applying custom attributes on
17131 (ParameterAtribute): New class. Class for applying custom
17132 attributes on the parameter type.
17134 2004-05-17 Miguel de Icaza <miguel@ximian.com>
17136 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17139 (Method): Allow UNSAFE here.
17141 * modifiers.cs: Support unsafe reporting.
17143 2004-05-17 Marek Safar <marek.safar@seznam.cz>
17145 * decl.cs: Fix bug #58478.
17147 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17149 * statement.cs: When checking for unreachable code on an EmptyStatement,
17150 set the location. Fixes bug #58488.
17152 2004-05-13 Miguel de Icaza <miguel@ximian.com>
17154 * driver.cs: Add -pkg handling.
17156 From Gonzalo: UseShelLExecute=false
17158 2004-05-12 Marek Safar <marek.safar@seznam.cz>
17161 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17163 (Attribute.IsClsCompliaceRequired): Moved to base for better
17165 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17166 when attribute is AttributeUsageAttribute.
17167 (Attribute.GetValidTargets): Simplified.
17168 (Attribute.GetAttributeUsage): New method returns AttributeUsage
17169 attribute for this type.
17170 (Attribute.ApplyAttributes): Method renamed to Emit and make
17172 (GlobalAttributeSection): New class for special handling of global
17173 attributes (assembly, module).
17174 (AttributeSection.Emit): New method.
17176 * class.cs: Implemented Attributable abstract methods.
17177 (MethodCore.LabelParameters): Moved to Parameter class.
17178 (Accessor): Is back simple class.
17179 (PropertyMethod): Implemented Attributable abstract class.
17180 (DelegateMethod): Implemented Attributable abstract class.
17181 (Event): New constructor for disctintion between normal Event
17182 and Event with accessors.
17184 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17186 * codegen.cs, const.cs, decl.cs, delegate.cs:
17187 (CommonAssemblyModulClass): Implemented Attributable abstract class
17190 * enum.cs: Implement IAttributeSupport interface.
17191 (EnumMember): New class for emum members. Implemented Attributable
17195 (ParameterBase): Is abstract.
17196 (ReturnParameter): New class for easier [return:] attribute handling.
17198 * typemanager.cs: Removed builder_to_attr.
17200 2004-05-11 Raja R Harinath <rharinath@novell.com>
17203 * attribute.cs (Attribute.GetPositionalValue): New function.
17204 * class.cs (TypeContainer.VerifyMembers): New function.
17205 (TypeContainer.Emit): Use it.
17206 (ClassOrStruct): New base class for Class and Struct.
17207 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
17208 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17210 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17211 then each non-static field should have a FieldOffset attribute.
17212 Otherwise, none of the fields should have a FieldOffset attribute.
17213 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
17214 and FieldOffset attributes.
17215 * typemanager.cs (TypeManager.struct_layout_attribute_type)
17216 (TypeManager.field_offset_attribute_type): New core types.
17217 (TypeManager.InitCoreTypes): Initialize them.
17219 2004-05-11 Michal Moskal <malekith@pld-linux.org>
17221 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17222 Return correct type.
17225 2004-05-09 Miguel de Icaza <miguel@ximian.com>
17227 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17228 be implicitly converted to ulong.
17230 * expression.cs: The logic for allowing operator &, | and ^ worked
17231 was wrong, it worked before because we did not report an error in
17232 an else branch. Fixes 57895.
17234 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17235 allow volatile fields to be reference types.
17237 2004-05-07 Miguel de Icaza <miguel@ximian.com>
17239 * driver.cs: Add support for /debug-
17241 2004-05-07 Raja R Harinath <rharinath@novell.com>
17243 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
17244 Add a 'complain' parameter to silence errors.
17245 (Attribute.Resolve): Update to changes. Put in sanity check to catch
17246 silently overlooked type-resolutions.
17247 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17248 to reflect changes.
17249 (Attributes.Search): New function.
17250 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17251 (Attributes.GetAttributeFullName): Remove hack.
17252 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
17253 Update to reflect changes.
17254 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17255 Use Attributes.Search instead of nested loops.
17257 2004-05-07 Marek Safar <marek.safar@seznam.cz>
17260 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17261 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17262 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17264 * report.cs: (Report.Warning): Renamed to Warning_T because of
17265 parameter collision.
17267 2004-05-05 Raja R Harinath <rharinath@novell.com>
17269 * expression.cs (MemberAccess.ResolveMemberAccess):
17270 Exit with non-zero status after Report.Error.
17271 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17273 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17275 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17277 * support.cs: Don't hang when the file is empty.
17279 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17281 * support.cs: In SeekableStreamReader, compute the preamble size of the
17282 underlying stream. Position changes should take into account that initial
17285 2004-05-03 Todd Berman <tberman@sevenl.net>
17287 * driver.cs: remove unused GetSysVersion function.
17289 2004-05-03 Todd Berman <tberman@sevenl.net>
17291 * driver.cs: Remove the hack from saturday, as well as the hack
17292 from jackson (LoadAssemblyFromGac), also adds the CWD to the
17293 link_paths to get that bit proper.
17295 2004-05-01 Todd Berman <tberman@sevenl.net>
17297 * driver.cs: Try a LoadFrom before a Load, this checks the current
17298 path. This is currently a bug in mono that is be fixed, however, this
17299 provides a workaround for now. This will be removed when the bug
17302 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
17304 * CryptoConvert.cs: Updated to latest version. Fix issue with
17305 incomplete key pairs (#57941).
17307 2004-05-01 Todd Berman <tberman@sevenl.net>
17309 * driver.cs: Remove '.' from path_chars, now System.* loads properly
17312 2004-04-30 Jackson Harper <jackson@ximian.com>
17314 * codegen.cs: Open keys readonly.
17316 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17318 * typemanager.cs: don't report cyclic struct layout when a struct
17319 contains 2 or more fields of the same type. Failed for Pango.AttrShape
17320 which has 2 Pango.Rectangle fields.
17322 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
17324 * expression.cs: Handle IntPtr comparisons with IL code
17325 rather than a method call.
17327 2004-04-29 Martin Baulig <martin@ximian.com>
17329 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
17330 the list of PropertyInfo's in class hierarchy and find the
17331 accessor. Fixes #56013.
17333 2004-04-29 Martin Baulig <martin@ximian.com>
17335 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17337 2004-04-29 Martin Baulig <martin@ximian.com>
17339 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17341 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17343 2004-04-29 Martin Baulig <martin@ximian.com>
17345 * class.cs (ConstructorInitializer.Resolve): Check whether the
17346 parent .ctor is accessible. Fixes #52146.
17348 2004-04-29 Martin Baulig <martin@ximian.com>
17350 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17352 * statement.cs (Using.EmitLocalVariableDecls): Use
17353 TypeManager.idisposable_type, not typeof (IDisposable).
17354 (Foreach.EmitCollectionForeach): Added support for valuetypes.
17356 2004-04-29 Martin Baulig <martin@ximian.com>
17358 * class.cs (Event.Define): Don't emit the field and don't set
17359 RTSpecialName and SpecialName for events on interfaces. Fixes
17362 2004-04-29 Raja R Harinath <rharinath@novell.com>
17364 Refactor Attribute.ApplyAttributes.
17365 * attribute.cs (Attributable): New base class for objects that can
17366 have Attributes applied on them.
17367 (Attribute): Make AttributeUsage fields public.
17368 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17369 (Attribute.IsInternalCall): New property.
17370 (Attribute.UsageAttr): Convert to a public read-only property.
17371 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17372 (Attribute.ResolveType, Attribute.Resolve)
17373 (Attribute.ScanForIndexerName): Update to reflect changes.
17374 (Attribute.CheckAttributeTarget): Re-format.
17375 (Attribute.ApplyAttributes): Refactor, to various
17376 Attributable.ApplyAttributeBuilder methods.
17377 * decl.cs (MemberCore): Make Attributable.
17378 * class.cs (Accessor): Make Attributable.
17379 (MethodData.ApplyAttributes): Use proper attribute types, not
17381 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17382 (TypeContainer.ApplyAttributeBuilder)
17383 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17384 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
17385 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17386 (Operator.ApplyAttributeBuilder): New factored-out methods.
17387 * const.cs (Const.ApplyAttributeBuilder): Likewise.
17388 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17389 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17390 * parameter.cs (ParameterBase): New Attributable base class
17391 that can also represent Return types.
17392 (Parameter): Update to the changes.
17394 2004-04-29 Jackson Harper <jackson@ximian.com>
17396 * driver.cs: Prefer the corlib system version when looking for
17397 assemblies in the GAC. This is still a hack, but its a better hack
17400 2004-04-29 Marek Safar <marek.safar@seznam.cz>
17402 * decl.cs, enum.cs: Improved error 3005 reporting.
17404 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17405 (related_symbols): New private member for list of symbols
17406 related to reported error/warning.
17408 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17410 2004-04-29 Martin Baulig <martin@ximian.com>
17412 * ecore.cs (Expression.Constantify): If we're an enum and
17413 TypeManager.TypeToCoreType() doesn't give us another type, use
17414 t.UnderlyingSystemType. Fixes #56178.
17416 2004-04-29 Martin Baulig <martin@ximian.com>
17418 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17419 interfaces and for each interface, only add members directly
17420 declared in that interface. Fixes #53255.
17422 2004-04-28 Martin Baulig <martin@ximian.com>
17424 * expression.cs (ConditionalLogicalOperator): Use a temporary
17425 variable for `left' to avoid that we evaluate it more than once;
17428 2004-04-28 Martin Baulig <martin@ximian.com>
17430 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17433 2004-04-28 Martin Baulig <martin@ximian.com>
17435 * statement.cs (LocalInfo.Resolve): Check whether the type is not
17438 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17439 whether the type is not void (CS1547).
17441 2004-04-28 Martin Baulig <martin@ximian.com>
17443 * expression.cs (Unary.DoResolveLValue): Override this and report
17444 CS0131 for anything but Operator.Indirection.
17446 2004-04-28 Martin Baulig <martin@ximian.com>
17448 Committing a patch from Ben Maurer; see bug #50820.
17450 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17453 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17456 2004-04-28 Martin Baulig <martin@ximian.com>
17458 Committing a patch from Ben Maurer; see bug #50820.
17460 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17463 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17466 2004-04-28 Martin Baulig <martin@ximian.com>
17468 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17469 (Block.AddLabel): Call DoLookupLabel() to only search in the
17472 2004-04-28 Martin Baulig <martin@ximian.com>
17474 * cfold.cs (ConstantFold.BinaryFold): Added special support for
17475 comparing StringConstants and NullLiterals in Equality and Inequality.
17477 2004-04-28 Jackson Harper <jackson@ximian.com>
17479 * driver.cs: Attempt to load referenced assemblies from the
17480 GAC. This is the quick and dirty version of this method that
17481 doesnt take into account versions and just takes the first
17482 canidate found. Will be good enough for now as we will not have more
17483 then one version installed into the GAC until I update this method.
17485 2004-04-28 Martin Baulig <martin@ximian.com>
17487 * typemanager.cs (TypeManager.CheckStructCycles): New public
17488 static method to check for cycles in the struct layout.
17490 * rootcontext.cs (RootContext.PopulateTypes): Call
17491 TypeManager.CheckStructCycles() for each TypeContainer.
17492 [Note: We only need to visit each type once.]
17494 2004-04-28 Martin Baulig <martin@ximian.com>
17496 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17498 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17499 success and added `out object value'. Use a `bool resolved' field
17500 to check whether we've already been called rather than
17501 `ConstantValue != null' since this breaks for NullLiterals.
17503 2004-04-28 Raja R Harinath <rharinath@novell.com>
17505 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17506 setting of this flag, since the 'set' method may be non-public.
17508 2004-04-28 Raja R Harinath <rharinath@novell.com>
17510 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17511 check on current_vector.Block.
17513 2004-04-27 Martin Baulig <martin@ximian.com>
17515 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17516 a field initializer. Fixes #56459.
17518 2004-04-27 Martin Baulig <martin@ximian.com>
17520 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17521 we're not attempting to use an indexer. Fixes #52154.
17523 2004-04-27 Martin Baulig <martin@ximian.com>
17525 * statement.cs (Return): Don't create a return label if we don't
17526 need it; reverts my change from January 20th. Thanks to Ben
17529 2004-04-27 Martin Baulig <martin@ximian.com>
17531 According to the spec, `goto' can only leave a nested scope, but
17534 * statement.cs (Block.LookupLabel): Only lookup in the current
17535 block, don't recurse into parent or child blocks.
17536 (Block.AddLabel): Check in parent and child blocks, report
17537 CS0140/CS0158 if we find a duplicate.
17538 (Block): Removed this indexer for label lookups.
17539 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17540 this already does the error reporting for us.
17543 (FlowBranching.UsageVector.Block): New public variable; may be null.
17544 (FlowBranching.CreateSibling): Added `Block' argument.
17545 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17546 label for the target of a `goto' and check whether we're not
17547 leaving a `finally'.
17549 2004-04-27 Martin Baulig <martin@ximian.com>
17551 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17552 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17555 2004-04-27 Martin Baulig <martin@ximian.com>
17557 * statement.cs (Block.AddLabel): Also check for implicit blocks
17558 and added a CS0158 check.
17560 2004-04-27 Martin Baulig <martin@ximian.com>
17562 * flowanalysis.cs (FlowBranchingLoop): New class.
17563 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17564 UsageVector's instead of an ArrayList.
17565 (FlowBranching.Label): Likewise.
17566 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17567 (FlowBranching.AddBreakVector): New method.
17569 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17571 * attribute.cs: Small regression fix: only convert the type if we
17572 the type is different, fixes System.Drawing build.
17574 2004-04-27 Martin Baulig <martin@ximian.com>
17576 * attribute.cs (Attribute.Resolve): If we have a constant value
17577 for a named field or property, implicity convert it to the correct
17580 2004-04-27 Raja R Harinath <rharinath@novell.com>
17582 * statement.cs (Block.Block): Implicit blocks share
17583 'child_variable_names' fields with parent blocks.
17584 (Block.AddChildVariableNames): Remove.
17585 (Block.AddVariable): Mark variable as "used by a child block" in
17586 every surrounding block.
17587 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17588 been used in a child block, complain about violation of "Invariant
17589 meaning in blocks" rule.
17590 * cs-parser.jay (declare_local_variables): Don't use
17591 AddChildVariableNames.
17592 (foreach_statement): Don't create an implicit block: 'foreach'
17593 introduces a scope.
17595 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17597 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17598 converting from 0L to ulong. Fixes 57522.
17600 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17602 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17603 derived class hides via 'new' keyword field from base class (test-242.cs).
17604 TODO: Handle this in the more general way.
17606 * class.cs (CheckBase): Ditto.
17608 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17610 * decl.cs (caching_flags): New member for storing cached values
17612 (MemberCore.Flags): New enum where bit flags for caching_flags
17614 (MemberCore.cls_compliance): Moved to caching_flags.
17615 (DeclSpace.Created): Moved to caching_flags.
17617 * class.cs: Use caching_flags instead of DeclSpace.Created
17619 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17621 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17622 if we are only a derived class, not a nested class.
17624 * typemanager.cs: Same as above, but do this at the MemberLookup
17625 level (used by field and methods, properties are handled in
17626 PropertyExpr). Allow for the qualified access if we are a nested
17629 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17631 * class.cs: Refactoring.
17632 (IMethodData): New inteface; Holds links to parent members
17633 to avoid member duplication (reduced memory allocation).
17634 (Method): Implemented IMethodData interface.
17635 (PropertyBase): New inner classes for get/set methods.
17636 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17637 (Event): New inner classes for add/remove methods.
17638 (Event.DelegateMethod): Implemented IMethodData interface.
17640 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17641 EmitContext (related to class.cs refactoring).
17643 2004-04-21 Raja R Harinath <rharinath@novell.com>
17645 * delegate.cs (Delegate.VerifyApplicability): If the number of
17646 arguments are the same as the number of parameters, first try to
17647 verify applicability ignoring any 'params' modifier on the last
17651 2004-04-16 Raja R Harinath <rharinath@novell.com>
17653 * class.cs (TypeContainer.AddIndexer): Use
17654 'ExplicitInterfaceName' to determine if interface name was
17655 explicitly specified. 'InterfaceType' is not initialized at this time.
17656 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17657 Indexers array is already in the required order. Initialize
17658 'IndexerName' only if there are normal indexers.
17659 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17660 (TypeContainer.Emit): Emit DefaultMember attribute only if
17661 IndexerName is initialized.
17664 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17666 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17669 2004-04-15 Raja R Harinath <rharinath@novell.com>
17671 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17675 * attribute.cs (Attribute.Resolve): Check for duplicate named
17679 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17681 * iterators.cs (MarkYield): track whether we are in an exception,
17682 and generate code accordingly. Use a temporary value to store the
17683 result for our state.
17685 I had ignored a bit the interaction of try/catch with iterators
17686 since their behavior was not entirely obvious, but now it is
17687 possible to verify that our behavior is the same as MS .NET 2.0
17691 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17693 * iterators.cs: Avoid creating temporaries if there is no work to
17696 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17697 Enumerations, use TypeManager.EnumToUnderlying and call
17700 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17703 (This.Emit): Use EmitContext.EmitThis to emit our
17706 (This.EmitAssign): Ditto.
17708 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17709 codepaths, we will move all the functionality into
17712 (FieldExpr.EmitAssign): Ditto.
17714 This fixes several hidden bugs that I uncovered while doing a code
17715 review of this today.
17717 * codegen.cs (EmitThis): reworked so the semantics are more clear
17718 and also support value types "this" instances.
17720 * iterators.cs: Changed so that for iterators in value types, we
17721 do not pass the value type as a parameter.
17723 Initialization of the enumerator helpers is now done in the caller
17724 instead of passing the parameters to the constructors and having
17725 the constructor set the fields.
17727 The fields have now `assembly' visibility instead of private.
17729 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17731 * expression.cs (Argument.Resolve): Check if fields passed as ref
17732 or out are contained in a MarshalByRefObject.
17734 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17735 another compiler type.
17737 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17739 * class.cs (Indexer.Define): use the new name checking method.
17740 Also, return false on an error.
17741 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17742 (is_identifier_[start/part]_character): make static.
17744 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17746 * expression.cs (Binary.ResolveOperator): Do no append strings
17747 twice: since we can be invoked more than once (array evaluation)
17748 on the same concatenation, take care of this here. Based on a fix
17749 from Ben (bug #56454)
17751 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17753 * codegen.cs: Fix another case where CS1548 must be reported (when
17754 delay-sign isn't specified and no private is available #56564). Fix
17755 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17756 error when MCS is used on the MS runtime and we need to delay-sign
17757 (which seems unsupported by AssemblyBuilder - see #56621).
17759 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17761 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17762 (TypeManager.ComputeNamespaces): Faster implementation for
17765 * compiler.csproj: Updated AssemblyName to mcs.
17767 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17769 * rootcontext.cs: Add new types to the boot resolution.
17771 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17772 MulticastDelegate is not allowed.
17774 * typemanager.cs: Add new types to lookup: System.TypedReference
17777 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17778 check for TypedReference or ArgIterator, they are not allowed.
17780 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17781 makes us properly catch 1510 in some conditions (see bug 56016 for
17784 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17786 * CryptoConvert.cs: update from corlib version
17789 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17791 * class.cs (Indexer.Define): Check indexername declaration
17793 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17795 * attribute.cs (IsClsCompliant): Fixed problem with handling
17796 all three states (compliant, not-compliant, undetected).
17798 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17800 * attribute.cs (Attribute): Location is now public.
17801 (Resolve): Store resolved arguments (pos_values) in attribute class.
17802 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17803 (GetClsCompliantAttributeValue): New method that gets
17804 CLSCompliantAttribute value.
17805 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17806 if exists else null.
17807 (AttributeTester): New class for CLS-Compliant verification routines.
17809 * class.cs (Emit): Add CLS-Compliant verification.
17810 (Method.GetSignatureForError): Implemented.
17811 (Constructor.GetSignatureForError): Implemented
17812 (Constructor.HasCompliantArgs): Returns if constructor has
17813 CLS-Compliant arguments.
17814 (Constructor.Emit): Override.
17815 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17816 is needed to test only parameters.
17817 (FieldBase.GetSignatureForError): Implemented.
17818 (TypeContainer): New member for storing base interfaces.
17819 (TypeContainer.FindMembers): Search in base interfaces too.
17821 * codegen.cs (GetClsComplianceAttribute): New method that gets
17822 assembly or module CLSCompliantAttribute value.
17823 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17825 (ModuleClass.Emit): Add error 3012 test.
17827 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17829 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17830 state for all decl types.
17831 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17832 if CLS-Compliant tests are required.
17833 (IsClsCompliaceRequired): New method. Analyze whether code
17834 must be CLS-Compliant.
17835 (IsExposedFromAssembly): New method. Returns true when MemberCore
17836 is exposed from assembly.
17837 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17838 value or gets cached value.
17839 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17840 is explicitly marked with CLSCompliantAttribute.
17841 (IsIdentifierClsCompliant): New abstract method. This method is
17842 used to testing error 3005.
17843 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17844 for identifier and parameters CLS-Compliant testing.
17845 (VerifyClsCompliance): New method. The main virtual method for
17846 CLS-Compliant verifications.
17847 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17848 null. I don't know why is null (too many public members !).
17849 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17850 and get value of first CLSCompliantAttribute that found.
17852 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17853 (VerifyClsCompliance): Override and add extra tests.
17855 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17856 clscheck- disable CLS-Compliant verification event if assembly is has
17857 CLSCompliantAttribute(true).
17859 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17860 ApllyAttribute is now called in emit section as in the other cases.
17861 Possible future Emit integration.
17862 (IsIdentifierClsCompliant): New override.
17863 (VerifyClsCompliance): New override.
17864 (GetEnumeratorName): Returns full enum name.
17866 * parameter.cs (GetSignatureForError): Implemented.
17868 * report.cs (WarningData): New struct for Warning message information.
17869 (LocationOfPreviousError): New method.
17870 (Warning): New method. Reports warning based on the warning table.
17871 (Error_T): New method. Reports error based on the error table.
17873 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17874 verifications are done here.
17876 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17878 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17879 CLSCompliantAttribute.
17880 (all_imported_types): New member holds all imported types from other
17882 (LoadAllImportedTypes): New method fills static table with exported types
17883 from all referenced assemblies.
17884 (Modules): New property returns all assembly modules.
17886 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17888 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17889 throwing a parser error.
17891 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17892 which removes the hardcoded get_/set_ prefixes for properties, as
17893 IL allows for the properties to be named something else.
17897 * expression.cs: Do not override operand before we know if it is
17898 non-null. Fix 56207
17900 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17902 * typemanager.cs: support for pinned variables.
17904 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17906 * decl.cs, typemanager.cs: Avoid using an arraylist
17907 as a buffer if there is only one result set.
17909 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17911 * expression.cs: Make sure you cant call a static method
17912 with an instance expression, bug #56174.
17914 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17916 * class.cs (IsDuplicateImplementation): Improve error reporting to
17917 flag 663 (method only differs in parameter modifier).
17919 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17920 in preprocessor directives.
17922 * location.cs (LookupFile): Allow for the empty path.
17924 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17925 better approach for some of that patch, but its failing with the
17926 CharSet enumeration. For now try/catch will do.
17928 * typemanager.cs: Do not crash if a struct does not have fields.
17931 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17933 * expression.cs: cs0213, cant fix a fixed expression.
17936 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17938 * cs-parser.jay: detect invalid embeded statements gracefully.
17941 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17943 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17946 the invocation type may not be a subclass of the tye of the item/
17947 The type of the item must be a subclass of the invocation item.
17952 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17954 * attribute.cs: Added methods to get a string and a bool from an
17955 attribute. Required to information from AssemblyKeyFileAttribute,
17956 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17957 * codegen.cs: Modified AssemblyName creation to include support for
17958 strongnames. Catch additional exceptions to report them as CS1548.
17959 * compiler.csproj: Updated include CryptoConvert.cs.
17960 * compiler.csproj.user: Removed file - user specific configuration.
17961 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
17962 Mono.Security assembly. The original class is maintained and tested in
17963 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17964 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17965 like CSC 8.0 (C# v2) supports.
17966 * Makefile: Added CryptoConvert.cs to mcs sources.
17967 * rootcontext.cs: Added new options for strongnames.
17969 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
17971 * driver.cs: For --expect-error, report error code `2'
17972 if the program compiled with no errors, error code `1' if
17973 it compiled with an error other than the one expected.
17975 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
17977 * compiler.csproj: Updated for Visual Studio .NET 2003.
17978 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17979 * compiler.sln: Updated for Visual Studio .NET 2003.
17981 2004-03-24 Ravi Pratap M <ravi@ximian.com>
17983 * expression.cs: Fix bug #47234. We basically need to apply the
17984 rule that we prefer the conversion of null to a reference type
17985 when faced with a conversion to 'object' (csc behaviour).
17987 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17989 * statement.cs: Shorter form for foreach, eliminates
17990 a local variable. r=Martin.
17992 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17994 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17995 checks if we can use brtrue/brfalse to test for 0.
17996 * expression.cs: use the above in the test for using brtrue/brfalse.
17997 cleanup code a bit.
17999 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18001 * expression.cs: Rewrite string concat stuff. Benefits:
18003 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18004 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18005 rather than a concat chain.
18007 * typemanager.cs: Add lookups for more concat overloads.
18009 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18011 * expression.cs: Emit shorter il code for array init.
18028 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
18030 * statement.cs: Before, two switch blocks would be merged if the
18031 total size of the blocks (end_item - begin_item + 1) was less than
18032 two times the combined sizes of the blocks.
18034 Now, it will only merge if after the merge at least half of the
18039 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
18041 * class.cs : csc build fix for GetMethods(). See bug #52503.
18043 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
18045 * expression.cs: Make sure fp comparisons work with NaN.
18046 This fixes bug #54303. Mig approved this patch a long
18047 time ago, but we were not able to test b/c the runtime
18050 2004-03-19 Miguel de Icaza <miguel@ximian.com>
18052 * ecore.cs (TypExpr.GetHashCode): implement this overload.
18054 2004-03-19 Martin Baulig <martin@ximian.com>
18056 * class.cs (MemberCore.IsDuplicateImplementation): Report the
18057 error here and not in our caller.
18059 2004-03-19 Martin Baulig <martin@ximian.com>
18061 * interface.cs: Completely killed this file.
18062 (Interface): We're now a TypeContainer and live in class.cs.
18064 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18065 argument; we're now also called for interfaces.
18066 (TypeContainer.DefineMembers): Allow this method being called
18068 (TypeContainer.GetMethods): New public method; formerly known as
18069 Interface.GetMethod(). This is used by PendingImplementation.
18070 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18071 it's now private and non-static.
18072 (Interface): Moved this here; it's now implemented similar to
18074 (Method, Property, Event, Indexer): Added `bool is_interface'
18075 argument to their .ctor's.
18076 (MemberBase.IsInterface): New public field.
18078 * cs-parser.jay: Create normal Method, Property, Event, Indexer
18079 instances instead of InterfaceMethod, InterfaceProperty, etc.
18080 (opt_interface_base): Removed; we now use `opt_class_base' instead.
18081 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18083 2004-03-19 Martin Baulig <martin@ximian.com>
18085 * class.cs (MethodCore.IsDuplicateImplementation): New private
18086 method which does the CS0111 checking.
18087 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18088 Use IsDuplicateImplementation().
18090 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
18092 * decl.cs (FindMemberToOverride): New method to find the correct
18093 method or property to override in the base class.
18095 - Make Method/Property use the above method to find the
18096 version in the base class.
18097 - Remove the InheritableMemberSignatureCompare as it is now
18100 This patch makes large code bases much faster to compile, as it is
18101 O(n) rather than O(n^2) to do this validation.
18103 Also, it fixes bug 52458 which is that nested classes are not
18104 taken into account when finding the base class member.
18106 Reviewed/Approved by Martin.
18108 2004-03-17 Marek Safar <marek.safar@seznam.cz>
18110 * interface.cs: In all interface classes removed redundant
18111 member initialization.
18113 2004-03-16 Martin Baulig <martin@ximian.com>
18115 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18117 2004-03-15 Miguel de Icaza <miguel@ximian.com>
18119 * decl.cs (DefineTypeAndParents): New helper method to define a
18120 type's containers before the type itself is defined; This is a
18121 bug exposed by the recent changes to Windows.Forms when an
18122 implemented interface was defined inside a class that had not been
18125 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18127 (Check): Loop correctly to report errors modifiers
18128 (UNSAFE was not in the loop, since it was the same as TOP).
18130 * interface.cs: Every interface member now takes a ModFlags,
18131 instead of a "is_new" bool, which we set on the base MemberCore.
18133 Every place where we called "UnsafeOk" in the interface, now we
18134 call the proper member (InterfaceMethod.UnsafeOK) instead to get
18135 the unsafe settings from the member declaration instead of the
18136 container interface.
18138 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
18140 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18141 `set_indexer_name' to the pending bits (one per type).
18143 We fixed a bug today that was picking the wrong method to
18144 override, since for properties the existing InterfaceMethod code
18145 basically ignored the method name. Now we make sure that the
18146 method name is one of the valid indexer names.
18148 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
18150 * support.cs (SeekableStreamReader): Keep track of stream byte
18151 positions and don't mix them with character offsets to the buffer.
18153 Patch from Gustavo Giráldez
18155 2004-03-15 Marek Safar <marek.safar@seznam.cz>
18157 * interface.cs (InterfaceSetGetBase): Removed double member
18158 initialization, base class does it as well.
18160 2004-03-13 Martin Baulig <martin@ximian.com>
18162 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18163 when compiling corlib.
18165 2004-03-13 Miguel de Icaza <miguel@ximian.com>
18167 * convert.cs (ExplicitConversion): We were reporting an error on
18168 certain conversions (object_type source to a value type, when the
18169 expression was `null') before we had a chance to pass it through
18170 the user defined conversions.
18172 * driver.cs: Replace / and \ in resource specifications to dots.
18175 * class.cs: Add check for duplicate operators. Fixes 52477
18177 2004-03-11 Miguel de Icaza <miguel@ximian.com>
18179 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18180 that are in the middle of the statements, not only at the end.
18183 * class.cs (TypeContainer.AddField): No longer set the
18184 `HaveStaticConstructor' flag, now we call it
18185 `UserDefineStaticConstructor' to diferentiate the slightly
18186 semantic difference.
18188 The situation is that we were not adding BeforeFieldInit (from
18189 Modifiers.TypeAttr) to classes that could have it.
18190 BeforeFieldInit should be set to classes that have no static
18195 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18197 And most importantly Zoltan's comment:
18199 http://bugzilla.ximian.com/show_bug.cgi?id=44229
18201 "I think beforefieldinit means 'it's ok to initialize the type sometime
18202 before its static fields are used', i.e. initialization does not need
18203 to be triggered by the first access to the type. Setting this flag
18204 helps the JIT to compile better code, since it can run the static
18205 constructor at JIT time, and does not need to generate code to call it
18206 (possibly lots of times) at runtime. Unfortunately, mcs does not set
18207 this flag for lots of classes like String.
18209 csc sets this flag if the type does not have an explicit static
18210 constructor. The reasoning seems to be that if there are only static
18211 initalizers for a type, and no static constructor, then the programmer
18212 does not care when this initialization happens, so beforefieldinit
18215 This bug prevents the AOT compiler from being usable, since it
18216 generates so many calls to mono_runtime_class_init that the AOT code
18217 is much slower than the JITted code. The JITted code is faster,
18218 because it does not generate these calls if the vtable is type is
18219 already initialized, which is true in the majority of cases. But the
18220 AOT compiler can't do this."
18222 2004-03-10 Miguel de Icaza <miguel@ximian.com>
18224 * class.cs (MethodData.Emit): Refactor the code so symbolic
18225 information is generated for destructors; For some reasons we
18226 were taking a code path that did not generate symbolic information
18229 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
18231 * class.cs: Create a Constructor.CheckBase method that
18232 takes care of all validation type code. The method
18233 contains some code that was moved from Define.
18235 It also includes new code that checks for duplicate ctors.
18236 This fixes bug #55148.
18238 2004-03-09 Joshua Tauberer <tauberer@for.net>
18240 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18241 a { ... }-style array creation invokes EmitStaticInitializers
18242 which is not good for reference-type arrays. String, decimal
18243 and now null constants (NullCast) are not counted toward
18244 static initializers.
18246 2004-03-05 Martin Baulig <martin@ximian.com>
18248 * location.cs (SourceFile.HasLineDirective): New public field;
18249 specifies whether the file contains or is referenced by a "#line"
18251 (Location.DefineSymbolDocuments): Ignore source files which
18252 either contain or are referenced by a "#line" directive.
18254 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
18256 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18257 direct access to our parent, so check the method inline there.
18259 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
18261 * expression.cs (Invocation.EmitCall): Miguel's last commit
18262 caused a regression. If you had:
18267 In Foo the implict this would be null.
18269 2004-02-27 Miguel de Icaza <miguel@ximian.com>
18271 * expression.cs (Invocation.EmitCall): If the method is not
18272 virtual, do not emit a CallVirt to it, use Call.
18274 * typemanager.cs (GetFullNameSignature): Improve the method to
18275 cope with ".ctor" and replace it with the type name.
18277 * class.cs (ConstructorInitializer.Resolve): Now the method takes
18278 as an argument the ConstructorBuilder where it is being defined,
18279 to catch the recursive constructor invocations.
18281 2004-02-26 Miguel de Icaza <miguel@ximian.com>
18283 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18284 routines to check if a type is an enumerable/enumerator allow
18285 classes that implement the IEnumerable or IEnumerator interfaces.
18287 * class.cs (Property, Operator): Implement IIteratorContainer, and
18288 implement SetYields.
18290 (Property.Define): Do the block swapping for get_methods in the
18291 context of iterators. We need to check if Properties also
18292 include indexers or not.
18294 (Operator): Assign the Block before invoking the
18295 OperatorMethod.Define, so we can trigger the Iterator code
18298 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
18299 Property and Operator classes are not created when we parse the
18300 declarator but until we have the block completed, so we use a
18301 singleton SimpleIteratorContainer.Simple to flag whether the
18302 SetYields has been invoked.
18304 We propagate this setting then to the Property or the Operator to
18305 allow the `yield' to function.
18307 2004-02-25 Marek Safar <marek.safar@seznam.cz>
18309 * codegen.cs: Implemented attribute support for modules.
18310 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18311 Assembly/Module functionality.
18313 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18314 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18315 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18317 2004-02-16 Marek Safar <marek.safar@seznam.cz>
18319 * interface.cs (FindMembers): The operation is performed on all base
18320 interfaces and not only on the first. It is required for future CLS Compliance patch.
18322 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
18324 * statement.cs, codegen.cs:
18325 This patch deals with patterns such as:
18327 public class List : IEnumerable {
18329 public MyEnumerator GetEnumerator () {
18330 return new MyEnumerator(this);
18333 IEnumerator IEnumerable.GetEnumerator () {
18337 public struct MyEnumerator : IEnumerator {
18342 Before, there were a few things we did wrong:
18343 1) we would emit callvirt on a struct, which is illegal
18344 2) we emited ldarg when we needed to emit ldarga
18345 3) we would mistakenly call the interface methods on an enumerator
18346 type that derived from IEnumerator and was in another assembly. For example:
18348 public class MyEnumerator : IEnumerator
18350 Would have the interface methods called, even if there were public impls of the
18351 method. In a struct, this lead to invalid IL code.
18353 2004-02-11 Marek Safar <marek.safar@seznam.cz>
18355 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18358 * delegate.cs (Define): Fixed crash when delegate type is undefined.
18360 2004-02-11 Miguel de Icaza <miguel@ximian.com>
18362 * cs-parser.jay: Fix small regression: we were not testing V2
18363 compiler features correctly.
18365 * interface.cs: If the emit context is null, then create one
18367 2004-02-09 Marek Safar <marek.safar@seznam.cz>
18369 * decl.cs (GetSignatureForError): New virtual method to get full name
18370 for error messages.
18372 * attribute.cs (IAttributeSupport): New interface for attribute setting.
18373 Now it is possible to rewrite ApplyAttributes method to be less if/else.
18375 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18376 Duplicated members and code in these classes has been removed.
18377 Better encapsulation in these classes.
18379 2004-02-07 Miguel de Icaza <miguel@ximian.com>
18381 * assign.cs (Assign.DoResolve): When dealing with compound
18382 assignments, there is a new rule in ECMA C# 2.4 (might have been
18383 there before, but it is documented here) that states that in:
18387 If b is of type int, and the `op' is a shift-operator, then the
18388 above is evaluated as:
18392 * expression.cs (Binary.ResolveOperator): Instead of testing for
18393 int/uint/long/ulong, try to implicitly convert to any of those
18394 types and use that in pointer arithmetic.
18396 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18397 method to print information for from the type, not from the
18398 null-method we were given.
18400 2004-02-01 Duncan Mak <duncan@ximian.com>
18402 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18403 parsing for cmd, fixes bug #53694.
18405 2004-02-04 Marek Safar <marek.safar@seznam.cz>
18407 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18408 in the member name duplication tests. Property and operator name duplication
18409 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18411 2004-02-03 Marek Safar <marek.safar@seznam.cz>
18413 * interface.cs (PopulateMethod): Fixed crash when interface method
18414 returns not existing type (error test cs0246-3.cs).
18416 2004-02-02 Ravi Pratap M <ravi@ximian.com>
18418 * cs-parser.jay (interface_accessors): Re-write actions to also
18419 store attributes attached to get and set methods. Fix spelling
18422 (inteface_property_declaration): Modify accordingly.
18424 (InterfaceAccessorInfo): New helper class to store information to pass
18425 around between rules that use interface_accessors.
18427 * interface.cs (Emit): Apply attributes on the get and set
18428 accessors of properties and indexers too.
18430 * attribute.cs (ApplyAttributes): Modify accordingly to use the
18431 right MethodBuilder when applying attributes to the get and set accessors.
18433 2004-01-31 Miguel de Icaza <miguel@ximian.com>
18435 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18437 2004-01-26 Miguel de Icaza <miguel@ximian.com>
18439 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18441 2004-01-25 Miguel de Icaza <miguel@ximian.com>
18443 * cs-parser.jay: Remove YIELD token, instead use the new grammar
18444 changes that treat `yield' specially when present before `break'
18445 or `return' tokens.
18447 * cs-tokenizer.cs: yield is no longer a keyword.
18449 2004-01-23 Marek Safar <marek.safar@seznam.cz>
18451 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18452 setting for default constructors.
18453 For default constructors are almost every time set wrong Modifier. The
18454 generated IL code has been alright. But inside mcs this values was
18455 wrong and this was reason why several of my CLS Compliance tests
18458 2004-01-22 Martin Baulig <martin@ximian.com>
18460 * cs-parser.jay (namespace_or_type_name): Return an Expression,
18461 not a QualifiedIdentifier. This is what `type_name_expression'
18462 was previously doing.
18463 (type_name_expression): Removed; the code is now in
18464 `namespace_or_type_name'.
18465 (qualified_identifier): Removed, use `namespace_or_type_name'
18467 (QualifiedIdentifier): Removed this class.
18469 2004-01-22 Martin Baulig <martin@ximian.com>
18471 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18472 not a string as alias name.
18474 2004-01-21 Miguel de Icaza <miguel@ximian.com>
18476 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18477 #52730 bug, and instead compute correctly the need to use a
18478 temporary variable when requesting an address based on the
18479 static/instace modified of the field and the constructor.
18481 2004-01-21 Martin Baulig <martin@ximian.com>
18483 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18484 class and namespace before looking up aliases. Fixes #52517.
18486 2004-01-21 Martin Baulig <martin@ximian.com>
18488 * flowanalysis.cs (UsageVector.Merge): Allow variables being
18489 assinged in a 'try'; fixes exception4.cs.
18491 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18492 * class.cs : Implemented parameter-less constructor for TypeContainer
18494 * decl.cs: Attributes are now stored here. New property OptAttributes
18496 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18498 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18500 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18502 * typemanager.cs (CSharpSignature): Now reports also inner class name.
18503 (CSharpSignature): New method for indexer and property signature.
18505 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18507 * pending.cs (IsVirtualFilter): Faster implementation.
18509 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18511 * typemanager.cs: Avoid inclusion of same assembly more than once.
18513 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18515 * cs-parser.jay: Fixed problem where the last assembly attribute
18516 has been applied also to following declaration (class, struct, etc.)
18518 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18520 * class.cs: Added error CS0538, CS0539 reporting.
18521 Fixed crash on Microsoft runtime when field type is void.
18523 * cs-parser.jay: Added error CS0537 reporting.
18525 * pending.cs: Added error CS0535 reporting.
18526 Improved error report for errors CS0536, CS0534.
18528 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18530 Merge a few bits from the Anonymous Method MCS tree.
18532 * statement.cs (ToplevelBlock): New class for toplevel methods,
18533 will hold anonymous methods, lifted variables.
18535 * cs-parser.jay: Create toplevel blocks for delegates and for
18536 regular blocks of code.
18538 2004-01-20 Martin Baulig <martin@ximian.com>
18540 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18541 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18542 and `NeedExplicitReturn'; added `IsLastStatement'.
18543 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18544 have a `ReturnLabel' or we're not unreachable.
18546 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18547 child's reachability; don't just override ours with it. Fixes
18548 #58058 (lluis's example).
18549 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18550 InFinally(), InLoop(), InSwitch() and
18551 BreakCrossesTryCatchBoundary() methods.
18553 * statement.cs (Return): Do all error checking in Resolve().
18554 Unless we are the last statement in a top-level block, always
18555 create a return label and jump to it.
18556 (Break, Continue): Do all error checking in Resolve(); also make
18557 sure we aren't leaving a `finally'.
18558 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18559 statement in a top-level block.
18560 (Block.Flags): Added `IsDestructor'.
18561 (Block.IsDestructor): New public property.
18563 2004-01-20 Martin Baulig <martin@ximian.com>
18565 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18567 2004-01-20 Martin Baulig <martin@ximian.com>
18569 * statement.cs (Statement.ResolveUnreachable): New public method.
18570 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18571 (Block.Resolve): Resolve unreachable statements.
18573 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18575 * expression.cs: We need to fix the case where we do
18576 not have a temp variable here.
18578 * assign.cs: Only expression compound assignments need
18579 temporary variables.
18581 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18583 * flowanalysis.cs: Reduce memory allocation in a few ways:
18584 - A block with no variables should not allocate a bit
18586 - A method with no out parameters does not need any tracking
18587 for assignment of the parameters, so we need not allocate
18590 public readonly Type[] VariableTypes;
18591 public readonly string[] VariableNames;
18592 Are redundant. The data is already stored in the variable
18593 map, so we need not allocate another array for it.
18594 - We need to add alot of checks for if (params | locals) == null
18595 due to the first two changes.
18597 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18599 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18600 implement IMemoryLocation, we store a copy on a local variable and
18601 take the address of it. Patch from Benjamin Jemlich
18603 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18604 to use a special "type_name_expression" rule which reduces the
18605 number of "QualifiedIdentifier" classes created, and instead
18606 directly creates MemberAccess expressions.
18608 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18610 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18611 that fixes #52853. Null literal assignment to ValueType
18613 * class.cs (MethodData.Emit): Instead of checking the name of the
18614 method to determine if its a destructor, create a new derived
18615 class from Method called Destructor, and test for that.
18617 * cs-parser.jay: Create a Destructor object instead of a Method.
18619 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18623 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18625 * expression.cs (Binary.ResolveOperator): Perform an implicit
18626 conversion from MethodGroups to their delegate types on the
18627 Addition operation.
18629 * delegate.cs: Introduce a new class DelegateCreation that is the
18630 base class for `NewDelegate' and `ImplicitDelegateCreation',
18631 factor some code in here.
18633 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18634 conversion from MethodGroups to compatible delegate types.
18636 * ecore.cs (Expression.Resolve): Do not flag error 654
18637 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18638 we allow conversions from MethodGroups to delegate types now.
18640 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18641 assignments in v2 either.
18643 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18645 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18646 static read-only fields in ctors.
18648 Applied patch from Benjamin Jemlich
18650 * expression.cs (UnaryMutator): Avoid leaking local variables.
18652 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18654 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18655 here to return true, as they can be used like this:
18657 (XXX) int.MEMBER ()
18659 Fixed 49836 and all the other dups
18661 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18663 * driver.cs: Implement /win32res and /win32icon.
18665 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18667 * cs-parser.jay: Add a rule to improve error handling for the
18668 common mistake of placing modifiers after the type.
18670 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18672 * cs-parser.jay (interface_event_declaration): Catch
18673 initialization of events on interfaces, and report cs0068
18675 * cs-parser.jay (interface_event_declaration): Catch
18676 initialization of events.
18678 * ecore.cs: Better report missing constructors.
18680 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18681 the error reporting done in the wrong place. Fix.
18683 * expression.cs (Binary.ResolveOperator): Catch the
18684 operator + (E x, E y) error earlier, and later allow for implicit
18685 conversions in operator +/- (E e, U x) from U to the underlying
18688 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18689 52596, if the container class is abstract, the default constructor
18690 is protected otherwise its public (before, we were always public).
18692 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18695 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18696 Jemlich that fixes bug #52597, MCS was generating invalid code for
18697 idisposable structs. Thanks to Ben for following up with this
18700 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18702 * driver.cs: Allow assemblies without code to be generated, fixes
18705 2004-01-07 Nick Drochak <ndrochak@gol.com>
18707 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18709 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18711 * cs-parser.jay: Add rules to improve error reporting if fields or
18712 methods are declared at the namespace level (error 116)
18714 * Add rules to catch event add/remove
18716 2004-01-04 David Sheldon <dave-mono@earth.li>
18718 * expression.cs: Added matching ")" to error message for
18721 2004-01-03 Todd Berman <tberman@gentoo.org>
18723 * ecore.cs, attribute.cs:
18724 Applying fix from #52429.
18726 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18728 * ecore.cs, expression.cs, statement.cs:
18729 Total rewrite of how we handle branching. We
18730 now handle complex boolean expressions with fewer
18731 jumps. As well if (x == 0) no longer emits a ceq.
18733 if (x is Foo) is much faster now, because we generate
18736 Overall, we get a pretty big improvement on our benchmark
18737 tests. The code we generate is smaller and more readable.
18739 I did a full two-stage bootstrap. The patch was reviewed
18740 by Martin and Miguel.
18742 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18744 * cs-parser.jay: Make primary_expression not take a QI.
18745 we dont need this because the member_access rule covers
18746 us here. So we replace the rule with just IDENTIFIER.
18748 This has two good effects. First, we remove a s/r conflict.
18749 Second, we allocate many fewer QualifiedIdentifier objects.
18751 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18753 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18754 set the correct information via SRE. This prevents
18755 hanging on the MS runtime. Fixes #29374.
18757 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18759 * convert.cs: correctly handle conversions to value types
18760 from Enum and ValueType as unboxing conversions.
18762 Fixes bug #52569. Patch by Benjamin Jemlich.
18764 2004-01-02 Ravi Pratap <ravi@ximian.com>
18766 * expression.cs (BetterConversion): Prefer int -> uint
18767 over int -> ulong (csc's behaviour). This fixed bug #52046.
18769 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18771 * decl.cs (MemberCache.FindMembers): now returns a
18774 * typemanager.cs: In general, go with with ^^.
18775 (CopyNewMethods): take an IList.
18776 (RealMemberLookup): Only allocate an arraylist
18777 if we copy from two sets of methods.
18779 This change basically does two things:
18780 1) Fewer array lists allocated due to CopyNewMethods.
18781 2) the explicit cast in MemberList costed ALOT.
18783 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18785 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18786 a hashtable to avoid needless string allocations when an identifier is
18787 used more than once (the common case).
18789 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18791 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18792 is broken, it will not return anything. So, we
18793 have to use the information we have in mcs to
18796 * typemanager.cs: Add a cache for GetInterfaces,
18797 since this will now be used more often (due to ^^)
18799 (GetExplicitInterfaces) New method that gets the
18800 declared, not effective, interfaces on a type
18801 builder (eg, if you have interface IFoo, interface
18802 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18805 This patch makes MCS able to bootstrap itself on
18808 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18810 * expression.cs: Remove the Nop's that Miguel put
18813 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18815 * report.cs, codegen.cs: Give the real stack trace to
18816 the error when an exception is thrown.
18818 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18820 * decl.cs: only allocate hashtables for ifaces if
18823 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18825 * expression.cs: fix the error from cs0121-2.cs
18826 (a parent interface has two child interfaces that
18827 have a function with the same name and 0 params
18828 and the function is called through the parent).
18830 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18832 * class.cs, rootcontext.cs, typmanager.cs: do not
18835 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18837 * codegen.cs: remove stack for the ec flow branching.
18838 It is already a linked list, so no need.
18840 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18842 * Makefile: Allow custom profiler here.
18844 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18846 * typemanager.cs (LookupType):
18847 - Use a static char [], because split takes
18848 a param array for args, so it was allocating
18850 - Do not store true in a hashtable, it boxes.
18852 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18854 * flowanalysis.cs: bytify common enums.
18856 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18858 * modifiers.cs: Add a new set of flags for the
18859 flags allowed on explicit interface impls.
18860 * cs-parser.jay: catch the use of modifiers in
18861 interfaces correctly.
18862 * class.cs: catch private void IFoo.Blah ().
18864 All related to bug #50572.
18866 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18868 * decl.cs: Rewrite the consistant accessability checking.
18869 Accessability is not linear, it must be implemented in
18870 a tableish way. Fixes #49704.
18872 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18874 * expression.cs: Handle negation in a checked context.
18875 We must use subtraction from zero. Fixes #38674.
18877 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18879 * class.cs: Ignore static void main in DLLs.
18880 * rootcontext.cs: Handle the target type here,
18881 since we are have to access it from class.cs
18882 * driver.cs: account for the above.
18884 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18886 * report.cs: Give line numbers and files if available.
18888 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18890 * driver.cs: Implement /addmodule.
18892 * typemanager.cs: Change 'modules' field so it now contains Modules not
18895 2003-12-20 Martin Baulig <martin@ximian.com>
18897 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18898 (FieldBase.IsAssigned): Removed this field.
18899 (FieldBase.SetAssigned): New public method.
18900 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18902 2003-12-20 Martin Baulig <martin@ximian.com>
18904 * expression.cs (LocalVariableReference.DoResolve): Don't set
18905 `vi.Used' if we're called from DoResolveLValue().
18907 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18908 returns the usage vector it just merged into the current one -
18909 pass this one to UsageWarning().
18910 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18911 of the `EmitContext', don't call this recursively on our children.
18913 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18915 * driver.cs: Implement /target:module.
18917 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18919 * support.cs (CharArrayHashtable): New helper class.
18921 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18922 char arrays, not strings, so we can avoid creating a string in
18923 consume_identifier if the identifier is a keyword.
18925 2003-12-16 Martin Baulig <martin@ximian.com>
18927 * statement.cs (LocalInfo.Assigned): Removed this property.
18928 (LocalInfo.Flags): Removed `Assigned'.
18929 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18930 and uses flow analysis.
18931 (Block.UsageWarning): Made this method private.
18932 (Block.Resolve): Call UsageWarning() if appropriate.
18934 * expression.cs (LocalVariableReference.DoResolve): Always set
18935 LocalInfo.Used here.
18937 2003-12-13 Martin Baulig <martin@ximian.com>
18939 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18940 any value here; we're now using flow analysis to figure out
18941 whether a statement/block returns a value.
18943 2003-12-13 Martin Baulig <martin@ximian.com>
18945 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18947 (FlowBranching.MergeFinally): Don't call
18948 `branching.CheckOutParameters()' here, this is called in
18950 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18951 when adding the `finally' vector.
18953 2003-12-13 Martin Baulig <martin@ximian.com>
18956 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18957 actually work and also fix #48962.
18959 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
18961 * decl.cs: Do not check System.Object for nested types,
18962 since we know it does not have any. Big bang for buck:
18965 Run 1: 8.35 seconds
18966 Run 2: 8.32 seconds
18967 corlib: 17.99 seconds
18969 Run 1: 8.17 seconds
18970 Run 2: 8.17 seconds
18971 corlib: 17.39 seconds
18973 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
18975 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18976 time we are returning 0 members, so we save alot here.
18978 2003-12-11 Martin Baulig <martin@ximian.com>
18980 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18981 `MergeChild()', also just take the `FlowBranching' as argument;
18982 call Merge() on it and return the result.
18983 (FlowBranching.Merge): We don't need to do anything if we just
18986 2003-12-11 Martin Baulig <martin@ximian.com>
18988 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18989 them in an `ArrayList' to reduce memory usage. Thanks to Ben
18990 Maurer for this idea.
18992 2003-12-11 Martin Baulig <martin@ximian.com>
18994 * flowanalysis.cs (MergeResult): This class is now gone; we now
18995 use the `UsageVector' for this. The reason for this is that if a
18996 branching just has one sibling, we don't need to "merge" them at
18997 all - that's the next step to do.
18998 (FlowBranching.Merge): We now return a `UsageVector' instead of a
19001 2003-12-11 Martin Baulig <martin@ximian.com>
19003 Reworked flow analyis and made it more precise and bug-free. The
19004 most important change is that we're now using a special `Reachability'
19005 class instead of having "magic" meanings of `FlowReturns'. I'll
19006 do some more cleanups and optimizations and also add some more
19007 documentation this week.
19009 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19010 largely reworked this class.
19011 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19012 the new `Reachability' class instead of having "magic" values here.
19013 (FlowBranching): We're now using an instance of `Reachability'
19014 instead of having separate `Returns', `Breaks' etc. fields.
19016 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19017 based on flow analysis; ignore the return value of block.Emit ().
19019 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
19021 * driver.cs typemanager.cs: Find the mono extensions to corlib even
19022 if they are private.
19024 2003-12-09 Martin Baulig <martin@ximian.com>
19026 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19027 call them directly on the UsageVector.
19029 2003-12-09 Martin Baulig <martin@ximian.com>
19031 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19032 Changed return type from `FlowReturns' to `Reachability'.
19034 2003-12-09 Martin Baulig <martin@ximian.com>
19036 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19037 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19038 `Reachable' fields with a single `Reachability' one.
19040 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19042 * class.cs (FindMembers): Remove foreach's.
19047 Run 1: 8.74 seconds
19048 Run 2: 8.71 seconds
19051 Run 1: 8.64 seconds
19052 Run 2: 8.58 seconds
19055 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19060 This patch does a few things:
19061 1. EmptyStatement is now a singleton, so it is never reallocated.
19062 2. All blah is EmptyStatement constructs have been changed to
19063 blah == EmptyStatement.Value, which is much faster and valid
19064 now that EmptyStatement is a singleton.
19065 3. When resolving a block, rather than allocating a new array for
19066 the non-empty statements, empty statements are replaced with
19067 EmptyStatement.Value
19068 4. Some recursive functions have been made non-recursive.
19069 Mainly the performance impact is from (3), however (1) and (2) are needed for
19070 this to work. (4) does not make a big difference in normal situations, however
19071 it makes the profile look saner.
19076 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19077 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19078 Total memory allocated: 56397 KB
19081 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19082 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19083 Total memory allocated: 55666 KB
19085 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19087 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19088 than the hashtable in a hashtable version
19090 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19091 we always end up concating a string. This results in a huge perf
19092 loss, because many strings have to be tracked by the GC. In this
19093 patch, we first use a hashtable that works with two keys, so that
19094 the strings do not need to be concat'ed.
19098 Run 1: 8.74 seconds
19099 Run 2: 8.71 seconds
19102 Run 1: 8.65 seconds
19103 Run 2: 8.56 seconds
19105 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19107 * Makefile: Add a new target `do-time' that does a quick and simple
19108 profile, leaving easy to parse output.
19110 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
19112 * codegen.cs (Init): Create the dynamic assembly with
19113 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19115 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
19117 * support.cs: Make the PtrHashtable use only one
19118 instance of its comparer.
19120 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
19122 * typemanager.cs: Fix lookup of GetNamespaces.
19124 2003-11-29 Miguel de Icaza <miguel@ximian.com>
19126 * expression.cs: Removed redundant line.
19128 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19129 ArrayLists, use for loops with bounds.
19131 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19134 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19135 arraylists, use for loop with bounds.
19137 The above three changes give us a 0.071 second performance
19138 improvement out of 3.294 seconds down to 3.223. On my machine
19139 the above changes reduced the memory usage by 1,387 KB during
19140 compiler bootstrap.
19142 * cs-parser.jay (QualifiedIdentifier): New class used to represent
19143 QualifiedIdentifiers. Before we created a new string through
19144 concatenation, and mostly later on, the result would be
19145 manipulated by DecomposeQI through string manipulation.
19147 This reduced the compiler memory usage for bootstrapping from
19148 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19149 compile times in 0.05 seconds.
19151 2003-11-28 Dick Porter <dick@ximian.com>
19153 * support.cs: Do string compares with the Invariant culture.
19161 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19162 the comparison is done with the Invariant culture.
19164 2003-11-27 Miguel de Icaza <miguel@ximian.com>
19166 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19167 GetEnumerator method.
19169 (ProbeCollectionType): Iterate starting at the most specific type
19170 upwards looking for a GetEnumerator
19172 * expression.cs: Shift count can be up to 31 for int/uint and 63
19175 2003-11-26 Miguel de Icaza <miguel@ximian.com>
19177 * statement.cs (Block.LookupLabel): Also look for the label on the
19178 children blocks. Use a hash table to keep track of visited
19181 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19182 we actually did transform the other operand, otherwise fall back
19183 to the common codepath that casts to long.
19185 * cs-tokenizer.cs: Use the same code pattern as the int case.
19186 Maybe I should do the parsing myself, and avoid depending on the
19187 Parse routines to get this done.
19189 2003-11-25 Miguel de Icaza <miguel@ximian.com>
19191 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19192 which fixes bug 51347. This time test it.
19194 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19195 attributes for example can not tell the difference between these.
19196 The difference was only a syntax feature of the language.
19198 * attribute.cs: Apply attributes to delegates.
19200 * delegate.cs: Call the apply attributes method.
19202 2003-11-24 Miguel de Icaza <miguel@ximian.com>
19204 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19205 comparing 0 vs Byte.MinValue, not the value
19207 (ImplicitConversionRequired): When reporting a conversion error,
19208 use error 31 to print out the constant error instead of the
19211 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19212 which fixes bug 51347.
19214 2003-11-22 Miguel de Icaza <miguel@ximian.com>
19216 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
19217 which fixes the -warnaserror command line option.
19219 2003-11-21 Miguel de Icaza <miguel@ximian.com>
19221 * cfold.cs (DoNumericPromotions): During constant folding of
19222 additions on UIntConstant, special case intconstants with
19223 IntConstants like we do on the expression binary operator.
19225 2003-11-12 Miguel de Icaza <miguel@ximian.com>
19227 * convert.cs (ImplicitReferenceConversion): We were missing a case
19228 (System.Enum are not value types or class types, so we need to
19229 classify them separatedly).
19231 * driver.cs: We do not support error 2007.
19233 2003-11-12 Jackson Harper <jackson@ximian.com>
19235 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19236 system directory. Also use the full file name so users can
19237 libraries names mscorlib-o-tron.dll in a non system dir.
19239 2003-11-10 Martin Baulig <martin@ximian.com>
19241 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19242 (TypeManager.InitCoreTypes): Initialize them here, but instead of
19243 calling `ResolveType()' on them, directly assign their `Type'.
19245 2003-11-08 Martin Baulig <martin@ximian.com>
19247 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19248 return value and the `out parent' parameter.
19249 (TypeContainer.DefineType): Moved the CS0644 check into
19250 GetClassBases(). Don't pass the interface types to the
19251 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19252 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19254 * ecore.cs (TypeExpr.IsAttribute): New property.
19255 (TypeExpr.GetInterfaces): New method.
19257 * interface.cs (Interface.GetInterfaceTypeByName): Return a
19258 TypeExpr instead of a Type.
19259 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19260 (Interface.DefineType): Don't pass the interface types to the
19261 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19262 them later and then call `TypeBulider.AddInterfaceImplementation()'.
19264 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19265 instead of a `Type[]'.
19266 (TypeManager.RegisterBuilder): Likewise.
19267 (TypeManager.AddUserInterface): Likewise.
19268 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19269 `Type[]' and also return a `TypeExpr[]'.
19270 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19272 2003-11-08 Martin Baulig <martin@ximian.com>
19274 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19277 2003-11-08 Martin Baulig <martin@ximian.com>
19279 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19280 TypeManager.ResolveExpressionTypes().
19282 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19283 instead of an Expression.
19284 (TypeExpr): This is now an abstract base class for `TypeExpression'.
19285 (TypeExpression): New public class; formerly known as `TypeExpr'.
19287 * expression.cs (ComposedCast): Derive from TypeExpr.
19289 * typemanager.cs (TypeManager.system_*_expr): These are now
19290 TypExpr's instead of Expression's.
19291 (TypeManager.ResolveExpressionTypes): New public static function;
19292 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19295 2003-11-06 Miguel de Icaza <miguel@ximian.com>
19297 * expression.cs (New.DoResolve): Do not dereference value that
19298 might be a null return.
19300 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19301 sure that the constant value has the right type. Fixes an
19302 unreported bug, similar to 50425.
19304 * const.cs (Const.LookupConstantValue): Call
19305 ImplicitStandardConversionExists before doing a conversion to
19306 avoid havng the TypeManager.ChangeType do conversions.
19308 Reduced the number of casts used
19310 (Const.ChangeType): New routine to enable reuse of the constant
19311 type changing code from statement.
19313 * typemanager.cs (ChangeType): Move common initialization to
19314 static global variables.
19318 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19319 every value type to go through, even if it was void. Fix that.
19321 * cs-tokenizer.cs: Use is_identifier_start_character on the start
19322 character of the define, and the is_identifier_part_character for
19323 the rest of the string.
19325 2003-11-05 Miguel de Icaza <miguel@ximian.com>
19327 * expression.cs (UnaryMutator.EmitCode): When I updated
19328 LocalVariableReference.DoResolve, I overdid it, and dropped an
19329 optimization done on local variable references.
19331 2003-11-04 Miguel de Icaza <miguel@ximian.com>
19333 * ecore.cs: Convert the return from Ldlen into an int.
19335 2003-10-20 Miguel de Icaza <miguel@ximian.com>
19337 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19338 the accessibility, this is a special case for toplevel non-public
19339 classes (internal for instance).
19341 2003-10-20 Nick Drochak <ndrochak@gol.com>
19343 * ecore.cs: Fix typo and build. Needed another right paren.
19345 2003-10-19 Miguel de Icaza <miguel@ximian.com>
19347 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
19348 `internal' case regular and protected, but not allowing protected
19349 to be evaluated later. Bug 49840
19351 2003-10-15 Miguel de Icaza <miguel@ximian.com>
19353 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19354 to kb.Nlast, and not the kb.nFirst to isolate the switch
19357 Extract the underlying type, so enumerations of long/ulong are
19358 treated like long/ulong.
19360 2003-10-14 Miguel de Icaza <miguel@ximian.com>
19362 * expression.cs (New): Overload the meaning of RequestedType to
19363 track the possible creation of the NewDelegate type, since
19364 DoResolve is invoked more than once for new constructors on field
19367 See bugs: #48800 and #37014
19369 * cs-parser.jay (declare_local_constants): Take an arraylist
19370 instead of a single constant.
19372 (local_constant_declaration): It should take a
19373 constant_declarators, not a constant_declarator. Fixes 49487
19375 * convert.cs: Fix error report.
19377 2003-10-13 Jackson Harper <jackson@ximian.com>
19379 * typemanager.cs (TypeToCoreType): Add float and double this fixes
19382 2003-10-09 Martin Baulig <martin@ximian.com>
19384 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19386 (MethodCore.DoDefineParameters): Removed the TypeContainer
19387 argument; use the DeclSpace which was passed to the .ctor instead.
19388 (MethodCore.CheckParameter): Take a DeclSpace instead of a
19389 TypeContainer; we only need a DeclSpace here.
19391 2003-10-09 Martin Baulig <martin@ximian.com>
19393 * class.cs (MethodData): Added additional `DeclSpace ds' argument
19395 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19396 EmitContext's .ctor.
19398 2003-10-09 Martin Baulig <martin@ximian.com>
19400 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19401 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19402 AsAccessible(), moved them as well.
19404 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19406 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19408 * cs-parser.jay : Renamed yyName to yyNames related to jay.
19410 2003-10-07 Miguel de Icaza <miguel@ximian.com>
19412 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19413 generation for >=, as spotted by Paolo, bug 48679.
19414 Patch from David Waite.
19416 * cs-tokenizer.cs: Add handling for #pragma.
19418 * cs-parser.jay: Allow for both yield and yield return in the
19419 syntax. The anti-cobolization of C# fight will go on!
19421 * class.cs (TypeBuilder.DefineType): Catch error condition here
19422 (Parent.DefineType erroring out and returning null).
19424 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19425 coping with enumerations variables, we were mistakenly processing
19426 them as a regular value type instead of built-in types. Fixes the
19429 * typemanager.cs (IsBuiltinOrEnum): New method.
19431 2003-09-30 Miguel de Icaza <miguel@ximian.com>
19433 * cs-parser.jay: Upgrade: yield now needs the return clause.
19435 2003-09-19 Martin Baulig <martin@ximian.com>
19437 * decl.cs (MemberCache.SetupCacheForInterface): Take a
19438 `MemberCache parent' argument. Normally, an interface doesn't
19439 have a parent type except System.Object, but we use this in gmcs
19440 for generic type parameters.
19442 2003-09-18 Martin Baulig <martin@ximian.com>
19444 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19445 on `type.IsInterface'; don't check whether the type has a parent
19446 to determine whether it's an interface.
19448 2003-09-15 Martin Baulig <martin@ximian.com>
19450 * class.cs (TypeContainer.DefineType): Added an error flag to
19451 avoid reporting duplicate CS0146's ("class definition is
19454 * driver.cs (Driver.MainDriver): Abort if
19455 RootContext.ResolveTree() reported any errors.
19457 2003-09-07 Martin Baulig <martin@ximian.com>
19459 * report.cs (Error, Warning): Added overloaded versions which take
19460 a `params object[] args' and call String.Format().
19462 2003-09-07 Martin Baulig <martin@ximian.com>
19464 * decl.cs (DeclSpace..ctor): Don't call
19465 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19466 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
19467 (DeclSpace.RecordDecl): New method.
19469 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19471 2003-09-02 Ravi Pratap <ravi@ximian.com>
19473 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19474 value attributes to be applied to ParameterBuilders.
19476 * class.cs (MethodCore.LabelParameters): Make static and more
19477 generic so that it can be used from other places - like interface
19478 methods, for instance.
19480 * interface.cs (Interface.Emit): Call LabelParameters before
19481 emitting attributes on the InterfaceMethod.
19483 2003-08-26 Martin Baulig <martin@ximian.com>
19485 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19486 resolving aliases; fixes #47927.
19488 2003-08-26 Martin Baulig <martin@ximian.com>
19490 * statement.cs (Using.DoResolve): This is internally emitting a
19491 try/finally clause, so we need to set ec.NeedExplicitReturn if we
19492 do not always return. Fixes #47681.
19494 2003-08-26 Martin Baulig <martin@ximian.com>
19496 * decl.cs (MemberCore): Moved WarningNotHiding(),
19497 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19499 (AdditionResult): Make this nested in DeclSpace.
19500 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19501 argument; call NamespaceEntry.Define() unless we're nested in a
19504 * namespace.cs (Namespace.DefineName): New public function. This
19505 is called from DeclSpace's .ctor to add
19506 (Namespace.Lookup): Include DeclSpaces in the lookup.
19508 * class.cs (Operator): Derive from MemberBase, not MemberCore.
19510 * const.cs (Const): Derive from MemberBase, not MemberCore.
19512 2003-08-25 Martin Baulig <martin@ximian.com>
19514 * convert.cs (Convert.ExplicitReferenceConversion): When
19515 converting from an interface type to a class, unbox if the target
19516 type is a struct type. Fixes #47822.
19518 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19520 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19523 2003-08-22 Martin Baulig <martin@ximian.com>
19525 * class.cs (TypeManager.DefineType): When defining a nested type,
19526 call DefineType() on our parent; fixes #47801.
19528 2003-08-22 Martin Baulig <martin@ximian.com>
19530 * class.cs (MethodData.Define): While checking if a method is an
19531 interface implementation, improve the test a bit more to fix #47654.
19533 2003-08-22 Martin Baulig <martin@ximian.com>
19535 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19536 correctly; fixes #47722.
19538 2003-08-22 Martin Baulig <martin@ximian.com>
19540 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19541 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19543 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19545 2003-08-22 Martin Baulig <martin@ximian.com>
19547 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19548 can only be assigned in static constructors. Fixes #47161.
19550 2003-08-22 Martin Baulig <martin@ximian.com>
19552 Rewrote and improved the flow analysis code.
19554 * flowbranching.cs (FlowBranching): Make this class abstract.
19555 (FlowBranching.CreateBranching): New static function to create a
19556 new flow branching.
19557 (FlowBranchingBlock, FlowBranchingException): New classes.
19558 (FlowBranching.UsageVector.Type): New public readonly field.
19559 (FlowBranching.UsageVector.Breaks): Removed the setter.
19560 (FlowBranching.UsageVector.Returns): Removed the setter.
19561 (FlowBranching.UsageVector): Added Break(), Return(),
19562 NeverReachable() and Throw() methods to modify the reachability.
19563 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19564 done by FlowBranching.Merge().
19565 (FlowBranching.UsageVector.MergeChild): New method; merges the
19566 merge result into the current vector.
19567 (FlowBranching.Merge): New abstract method to merge a branching.
19569 2003-08-12 Martin Baulig <martin@ximian.com>
19571 * expression.cs (Indirection.CacheTemporaries): Create the
19572 LocalTemporary with the pointer type, not its element type.
19574 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19576 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19577 token was a keyword or not.
19579 Add `error' options where an IDENTIFIER was expected; Provide
19580 CheckToken and CheckIdentifierToken convenience error reporting
19583 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19585 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19586 NameSpaceEntry NameSpaceEntry.
19588 (LookupInterfaceOrClass): Avoid creating a full qualified name
19589 from namespace and name: avoid doing lookups when we know the
19590 namespace is non-existant. Use new Tree.LookupByNamespace which
19591 looks up DeclSpaces based on their namespace, name pair.
19593 * driver.cs: Provide a new `parser verbose' to display the
19594 exception thrown during parsing. This is turned off by default
19595 now, so the output of a failure from mcs is more graceful.
19597 * namespace.cs: Track all the namespaces defined in a hashtable
19600 (IsNamespace): New method
19602 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19604 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19605 we know that we need to concatenate (full typename can never be
19610 * statement.cs: Use a bitfield; Do not initialize to null things
19611 which are done by the constructor by default.
19613 * cs-parser.jay: bug fix, parameter was 4, not 3.
19615 * expression.cs: Just use the property;
19617 * statement.cs: No need for GetVariableInfo method.
19619 2003-08-08 Martin Baulig <martin@ximian.com>
19621 * flowanalysis.cs (FlowReturns): This is now nested in the
19622 `FlowBranching' class.
19623 (MyBitVector): Moved this here from statement.cs.
19624 (FlowBranching.SiblingType): New enum type.
19625 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19627 2003-08-07 Martin Baulig <martin@ximian.com>
19629 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19630 `FlowBranching' class and called `BranchingType'.
19632 2003-08-07 Martin Baulig <martin@ximian.com>
19634 * flowanalysis.cs: Moved all the control flow analysis code into
19637 2003-08-07 Martin Baulig <martin@ximian.com>
19639 * assign.cs (Assign.DoResolve): `target' must either be an
19640 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19643 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19645 * expression.cs (BinaryMethod): This kind of expression is created by the
19646 Binary class if it determines that the operator has to be handled
19649 (BinaryDelegate): This kind of expression is created if we are
19650 dealing with a + or - operator on delegates.
19652 (Binary): remove method, argumetns, and DelegateOperator: when
19653 dealing with methods,
19655 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19657 * statement.cs (Block): use bitfields for the three extra booleans
19658 we had in use. Remove unused topblock parameter.
19660 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19662 * assign.cs: Drop extra unneeded tests.
19664 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19666 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19668 * statement.cs (Foreach): Use VariableStorage instead of
19671 * codegen.cs (VariableStorage): New class used by clients that
19672 require a variable stored: locals or fields for variables that
19673 need to live across yield.
19675 Maybe provide a convenience api for EmitThis+EmitLoad?
19677 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19680 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19682 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19683 RemapParameterLValue): New methods that are used to turn a
19684 precomputed FieldInfo into an expression like this:
19688 The idea is to use this instead of making LocalVariableReference
19689 have more than one meaning.
19691 * cs-parser.jay: Add error production to BASE.
19693 * ecore.cs: Deal with TypeManager.GetField returning null, which
19694 is now a valid return value.
19696 (FieldExprNoAddress): New expression for Fields whose address can
19699 * expression.cs (LocalVariableReference): During the resolve
19700 phases, create new expressions if we are in a remapping context.
19701 Remove code that dealt with remapping here.
19703 (ParameterReference): same.
19705 (ProxyInstance): New expression, like the `This' expression, but
19706 it is born fully resolved. We know what we are doing, so remove
19707 the errors that are targeted to user-provided uses of `this'.
19709 * statement.cs (Foreach): our variable is now stored as an
19710 Expression; During resolution, follow the protocol, dont just
19711 assume it will return this.
19713 2003-08-06 Martin Baulig <martin@ximian.com>
19715 * support.cs (SeekableStreamReader.cs): New public class.
19717 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19718 SeekableStreamReader instead of the normal StreamReader.
19720 2003-08-04 Martin Baulig <martin@ximian.com>
19722 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19723 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19724 deambiguate casts and delegate invocations.
19725 (parenthesized_expression): Use the new tokens to ensure this is
19726 not a cast of method invocation.
19728 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19729 when reading a `)' and Deambiguate_CloseParens () was previously
19732 * expression.cs (ParenthesizedExpression): New class. This is
19733 just used for the CS0075 test.
19734 (Binary.DoResolve): Check for CS0075.
19736 2003-07-29 Ravi Pratap <ravi@ximian.com>
19738 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19739 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19740 reference comparison.
19742 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19743 examine the ReturnType for equality - this is necessary in the
19744 cases of implicit and explicit operators whose signature also
19745 includes the return type.
19747 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19749 * namespace.cs: Cache the result of the namespace computation,
19750 instead of computing it every time.
19752 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19754 * decl.cs: Use a global arraylist that we reuse over invocations
19755 to avoid excesive memory consumption. Reduces memory usage on an
19756 mcs compile by one meg (45 average).
19758 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19759 private, work around that.
19761 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19763 * literal.cs (IntLiteral): Define Zero and One static literals.
19765 * cs-parser.jay (integer_literal): use static literals to reduce
19766 memory usage for the most used literals (0, 1 and -1). 211kb
19767 reduced in memory usage.
19769 Replace all calls to `new ArrayList' with `new
19770 ArrayList(4)' which is a good average number for most allocations,
19771 and also requires only 16 bytes of memory for its buffer by
19774 This reduced MCS memory usage in seven megabytes for the RSS after
19777 2003-07-28 Ravi Pratap <ravi@ximian.com>
19779 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19780 handle params methods the correct way by forming only one
19781 applicable set with params and normal methods in them. Earlier we
19782 were looking at params methods only if we found no normal methods
19783 which was not the correct thing to do.
19785 (Invocation.BetterFunction): Take separate arguments indicating
19786 when candidate and the best method are params methods in their
19789 This fixes bugs #43367 and #46199.
19791 * attribute.cs: Documentation updates.
19793 (CheckAttribute): Rename to CheckAttributeTarget.
19794 (GetValidPlaces): Rename to GetValidTargets.
19796 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19797 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19801 2003-07-28 Martin Baulig <martin@ximian.com>
19803 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19804 name when looking up the base class of a nested class. Fixes #46977.
19806 2003-07-26 Martin Baulig <martin@ximian.com>
19808 * expression.cs (Indexers.Indexer): New nested struct; contains
19809 getter, setter and the indexer's type.
19810 (Indexers.Properties): This is now an ArrayList of
19811 Indexers.Indexer's.
19812 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19813 indexer doesn't have any getters.
19815 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19816 for embedded property and indexer assignments.
19818 2003-07-26 Martin Baulig <martin@ximian.com>
19820 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19821 preprocessor directive is not the first non-whitespace character
19824 2003-07-26 Martin Baulig <martin@ximian.com>
19826 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19827 namespace parsing, follow the spec more closely.
19829 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19830 NamespaceEntry.Lookup().
19832 2003-07-25 Martin Baulig <martin@ximian.com>
19834 * MethodCore.cs (OverridesSomething): New public field; it's set
19835 from TypeContainer.DefineMembers if this method overrides
19836 something (which doesn't need to be a method). Fix #39462.
19838 2003-07-25 Ravi Pratap <ravi@ximian.com>
19840 * typemanager.cs (GetMembers): Ensure that the list of members is
19841 reversed. This keeps things in sync.
19843 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19844 find an AttributeUsage attribute.
19846 * expression.cs (Invocation.OverloadResolve): Perform the check
19847 which disallows Invoke to be directly called on a Delegate.
19849 (Error_InvokeOnDelegate): Report error cs1533.
19851 2003-07-25 Martin Baulig <martin@ximian.com>
19853 * expression.cs (Indexers.GetIndexersForType): Only look in the
19854 interface hierarchy if the requested type is already an
19855 interface. Fixes #46788 while keeping #46502 fixed.
19857 2003-07-25 Martin Baulig <martin@ximian.com>
19859 * class.cs (TypeContainer.DefineMembers): Check whether all
19860 readonly fields have been assigned and report warning CS0649 if
19863 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19866 2003-07-24 Ravi Pratap <ravi@ximian.com>
19868 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19869 returned from GetMethods to make things consistent with the
19870 assumptions MCS makes about ordering of methods.
19872 This should comprehensively fix bug #45127 and it does :-)
19874 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19875 ordering is actually reverse.
19877 * Clean up some debug messages I left lying around.
19879 * interface.cs (Populate*): Get rid of code which emits attributes
19880 since the stage in which we emit attributes is the 'Emit' stage,
19881 not the define stage.
19883 (Emit): Move attribute emission for interface members here.
19885 2003-07-22 Ravi Pratap <ravi@ximian.com>
19887 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19888 closely: we eliminate methods in base types when we have an
19889 applicable method in a top-level type.
19891 Please see section 14.5.5.1 for an exact description of what goes
19894 This fixes bug #45127 and a host of other related to corlib compilation.
19896 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19897 array is the method corresponding to the top-level type (this is
19898 because of the changes made to icall.c) so we change this
19901 (MethodGroupExpr.Name): This too.
19903 * typemanager.cs (GetElementType): New method which does the right
19904 thing when compiling corlib.
19906 * everywhere: Make use of the above in the relevant places.
19908 2003-07-22 Martin Baulig <martin@ximian.com>
19910 * cs-parser.jay (invocation_expression): Moved
19911 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19912 `cast_expression', but create a InvocationOrCast which later
19913 resolves to either an Invocation or a Cast.
19915 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19916 method; call this before EmitStatement() to make sure that this
19917 expression can be used as a statement.
19919 * expression.cs (InvocationOrCast): New class; resolves to either
19920 an Invocation or a Cast.
19922 * statement.cs (StatementExpression): Call ResolveStatement() on
19923 the ExpressionStatement before emitting it.
19925 2003-07-21 Martin Baulig <martin@ximian.com>
19927 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19928 `ref' and `out' attributes match; fixes #46220.
19929 (MemberAccess.ResolveMemberAccess): You can't reference a type
19930 through an expression; fixes #33180.
19931 (Indexers.GetIndexersForType): Don't return the indexers from
19932 interfaces the class implements; fixes #46502.
19934 2003-07-21 Martin Baulig <martin@ximian.com>
19936 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19937 CS0661 checks; fixes bug #30442.
19939 2003-07-21 Martin Baulig <martin@ximian.com>
19941 * decl.cs (AdditionResult): Added `Error'.
19943 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19945 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19946 makes cs0031.cs actually work.
19948 2003-07-20 Martin Baulig <martin@ximian.com>
19950 * namespace.cs: Fixed that bug which caused a crash when compiling
19951 the debugger's GUI.
19953 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19955 * typemanager.cs (LookupTypeReflection): Never expose types which
19956 are NotPublic, NestedPrivate, NestedAssembly, or
19957 NestedFamANDAssem. We used to return these, and later do a check
19958 that would report a meaningful error, but the problem is that we
19959 would not get the real match, if there was a name override.
19961 2003-07-18 Miguel de Icaza <miguel@ximian.com>
19963 * namespace.cs (Namespace, Name): Do not compute the namespace
19964 name dynamically, compute it in the constructor. This reduced
19965 memory usage by 1697 KB.
19967 * driver.cs: Use --pause to pause at the end.
19969 2003-07-17 Peter Williams <peter@newton.cx>
19971 * Makefile: Change the name of the test target so that it doesn't
19972 conflict with the recursive test target.
19974 2003-07-17 Miguel de Icaza <miguel@ximian.com>
19976 * expression.cs (LocalVariableReference.Emit, EmitAssign,
19977 AddressOf): Do not use EmitThis, that was wrong, use the actual
19980 2003-07-15 Miguel de Icaza <miguel@ximian.com>
19982 * class.cs (MethodData.Define): While checking if a method is an
19983 interface implementation, improve the test: If we are not public
19984 (use new test here: use the computed MethodAttributes directly,
19985 instead of the parsed modifier flags) check if the `implementing'
19986 method comes from an interface or not.
19988 * pending.cs (VerifyPendingMethods): Slightly better error
19991 * makefile: add test target that does the mcs bootstrap.
19993 2003-07-16 Ravi Pratap <ravi@ximian.com>
19995 * interface.cs (Define): Do nothing here since there are no
19996 members to populate etc. Move the attribute emission out of here
19997 since this was just totally the wrong place to put it. Attribute
19998 application happens during the 'Emit' phase, not in the 'Define'
20001 (Emit): Add this method and move the attribute emission here
20003 * rootcontext.cs (EmitCode): Call the Emit method on interface
20006 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20008 * expression.cs (OverloadResolve): Report error only if Location
20009 is not 'Null' which means that there was a probe going on.
20011 2003-07-14 Martin Baulig <martin@ximian.com>
20013 * expression.cs (ConditionalLogicalOperator): New public class to
20014 implement user defined conditional logical operators.
20015 This is section 14.11.2 in the spec and bug #40505.
20017 2003-07-14 Martin Baulig <martin@ximian.com>
20019 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20021 2003-07-14 Martin Baulig <martin@ximian.com>
20023 * codegen.cs (EmitContext.InFixedInitializer): New public field.
20025 * ecore.cs (IVariable.VerifyFixed): New interface method.
20027 * expression.cs (Unary.ResolveOperator): When resolving the `&'
20028 operator, check whether the variable is actually fixed. Fixes bug
20029 #36055. Set a variable definitely assigned when taking its
20030 address as required by the spec.
20032 * statement.cs (LocalInfo.IsFixed): New field.
20033 (LocalInfo.MakePinned): Set `IsFixed' to true.
20035 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20037 * attribute.cs (Attribute.Resolve): While doing a Member lookup
20038 for .ctors, ensure that we only ask for members declared in the
20039 attribute type (BindingFlags.DeclaredOnly).
20043 * expression.cs (Error_WrongNumArguments): Report error 1501
20044 correctly the way CSC does.
20046 2003-07-13 Martin Baulig <martin@ximian.com>
20048 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20049 lookup on the fully qualified name, to make things like "X.X" work
20050 where "X.X" is a fully qualified type name, but we also have a
20051 namespace "X" in the using list. Fixes #41975.
20053 2003-07-13 Martin Baulig <martin@ximian.com>
20055 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20056 function. If we're a CompoundAssign, we need to create an embedded
20057 CompoundAssign, not an embedded Assign.
20058 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20061 2003-07-13 Martin Baulig <martin@ximian.com>
20063 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20064 work to fix bug #46088.
20066 2003-07-13 Ravi Pratap <ravi@ximian.com>
20068 * class.cs (Operator.Emit): Do not emit attributes here - it is
20069 taken care of by the Method class that we delegate too. This takes
20070 care of bug #45876.
20072 2003-07-10 Martin Baulig <martin@ximian.com>
20074 * expression.cs (TypeOfVoid): New class.
20075 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
20077 2003-07-10 Martin Baulig <martin@ximian.com>
20079 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20082 2003-07-10 Martin Baulig <martin@ximian.com>
20084 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20085 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20087 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20089 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20091 2003-07-10 Martin Baulig <martin@ximian.com>
20093 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20094 of decimal. Fixes #42850.
20096 NOTE: I also fixed the created byte blob, but this doesn't work on
20097 the MS runtime and csc never produces any byte blobs for decimal
20100 2003-07-10 Martin Baulig <martin@ximian.com>
20102 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20103 structs; fixes #32068.
20104 (Block.AddChildVariableNames): Fixed #44302.
20106 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20108 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20110 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20112 * attribute.cs: And this test is onger needed.
20114 2003-07-08 Martin Baulig <martin@ximian.com>
20116 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20117 inaccessible types. Fixes #36313.
20119 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20121 * namespace.cs (NamespaceEntry): Create implicit entries for all
20122 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20123 implicit entries for N1.N2 and N1.
20125 2003-07-08 Martin Baulig <martin@ximian.com>
20127 Rewrote the handling of namespaces to fix a lot of the issues
20128 wrt. `using' aliases etc.
20130 * namespace.cs (Namespace): Splitted this class into a
20131 per-assembly `Namespace' and a per-file `NamespaceEntry'.
20133 * typemanager.cs (TypeManager.IsNamespace): Removed.
20134 (TypeManager.ComputeNamespaces): Only compute namespaces from
20135 loaded assemblies here, not the namespaces from the assembly we're
20136 currently compiling.
20138 2003-07-08 Martin Baulig <martin@ximian.com>
20140 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20142 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20144 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20147 I thought about the memory savings here, but LookupTypeReflection
20148 is used under already very constrained scenarios. Compiling
20149 corlib or mcs only exposes one hit, so it would not really reduce
20150 any memory consumption.
20152 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20154 * typemanager.cs: fixes bug #45889 by only adding public types from
20155 other assemblies to the list of known types.
20157 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20159 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20160 on the type we resolved.
20162 2003-07-05 Martin Baulig <martin@ximian.com>
20164 * pending.cs (PendingImplementation.ParentImplements): Don't
20165 create the proxy if the parent is abstract.
20167 * class.cs (TypeContainer.DefineIndexers): Process explicit
20168 interface implementations first. Fixes #37714.
20170 2003-07-04 Miguel de Icaza <miguel@ximian.com>
20172 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20173 defined recursively; but since we modify the input parameters
20174 (left is set to `this' temporarily), we reset this value if the
20175 left_is_explicit is false, which gives the original semantics to
20178 * literal.cs (NullPointer): new class used to represent a null
20179 literal in a pointer context.
20181 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20182 type is a pointer, use a NullPointer object instead of a
20183 NullLiteral. Closes 43687
20185 (ExplicitConversion): Convert pointer values using
20186 the conv opcode to the proper type.
20188 * ecore.cs (New): change ValueTypeVariable property into a method,
20189 that returns whether the valuetype is suitable for being used.
20191 * expression.cs (Binary.DoNumericPromotions): Only return if we
20192 the int constant was a valid uint, and we can return both left and
20193 right as uints. If not, we continue processing, to trigger the
20194 type conversion. This fixes 39018.
20196 * statement.cs (Block.EmitMeta): During constant resolution, set
20197 the CurrentBlock property on the emitcontext, so that we resolve
20198 constants propertly.
20200 2003-07-02 Martin Baulig <martin@ximian.com>
20202 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20203 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20205 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20206 than emitting it here.
20208 * statement.cs: Fixed some more flow analysis bugs.
20210 2003-07-02 Martin Baulig <martin@ximian.com>
20212 * class.cs (MethodData.Define): When implementing interface
20213 methods, set Final unless we're Virtual.
20215 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20216 check work for interface methods.
20218 2003-07-01 Martin Baulig <martin@ximian.com>
20220 * ecore.cs (EmitContext.This): Replaced this property with a
20221 GetThis() method which takes a Location argument. This ensures
20222 that we get the correct error location for a CS0188.
20224 2003-07-01 Miguel de Icaza <miguel@ximian.com>
20226 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20227 ImplicitStandardConversion.
20229 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20231 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
20233 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20236 2003-06-30 Miguel de Icaza <miguel@ximian.com>
20238 * class.cs (Constructor.Define): Turn off initlocals for unsafe
20241 (MethodData.Define): Turn off initlocals for unsafe methods.
20243 2003-06-29 Miguel de Icaza <miguel@ximian.com>
20245 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20246 complete; Fixes #37521.
20248 * delegate.cs: Use Modifiers.TypeAttr to compute the
20249 TypeAttributes, instead of rolling our own. This makes the flags
20250 correct for the delegates.
20252 2003-06-28 Miguel de Icaza <miguel@ximian.com>
20254 * class.cs (Constructor.Define): Set the private flag for static
20255 constructors as well.
20257 * cs-parser.jay (statement_expression): Set the return value to
20258 null, to avoid a crash when we catch an error.
20260 2003-06-24 Miguel de Icaza <miguel@ximian.com>
20262 * cs-parser.jay: Applied patch from Jackson that adds support for
20263 extern and unsafe modifiers to destructor declarations.
20265 * expression.cs: Report error 21 if the user is trying to index a
20268 * driver.cs: Add an error message, suggested by the bug report.
20270 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20271 if we do not have a ": this ()" constructor initializer. Fixes 45149
20273 2003-06-14 Miguel de Icaza <miguel@ximian.com>
20275 * namespace.cs: Add some information to reduce FAQs.
20277 2003-06-13 Miguel de Icaza <miguel@ximian.com>
20279 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20280 underlying enumeration types. Fixes #43915.
20282 * expression.cs: Treat ushort/short as legal values to be used in
20283 bitwise operations.
20285 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20287 * delegate.cs: transfer custom attributes for paramenters from
20288 the delegate declaration to Invoke and BeginInvoke.
20290 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20292 * attribute.cs: handle custom marshalers and emit marshal info
20295 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
20297 * makefile.gnu: Added anonymous.cs to the compiler sources.
20299 2003-05-28 Miguel de Icaza <miguel@ximian.com>
20301 * iterators.cs: Change the name of the proxy class to include two
20304 * cs-parser.jay: Update grammar to include anonymous methods.
20306 * anonymous.cs: new file.
20308 2003-05-27 Miguel de Icaza <miguel@ximian.com>
20310 * class.cs (Field.Define): Add missing test for pointers and
20313 2003-05-27 Ravi Pratap <ravi@ximian.com>
20315 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20316 we use the stobj opcode.
20318 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20319 since it wasn't the correct fix.
20321 It still is puzzling that we are required to use stobj for IntPtr
20322 which seems to be a ValueType.
20324 2003-05-26 Miguel de Icaza <miguel@ximian.com>
20326 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20327 during regular simple name resolution. Now, the trick is that
20328 instead of returning for processing the simplename, we do a
20329 TypeManager.LookupType (ie, a rooted lookup as opposed to a
20330 contextual lookup type). If a match is found, return that, if
20331 not, return for further composition.
20333 This fixes long-standing 30485.
20335 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20336 using the address to initialize an object, do an Stobj instead of
20337 using the regular Stelem.
20339 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20340 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20341 Because if we are a BaseIndexerAccess that value will be true.
20344 * statement.cs (GotoCase.Resolve): Return after reporting an
20345 error, do not attempt to continue.
20347 * expression.cs (PointerArithmetic.Emit): If our operand is a
20348 long, convert our constants to match the operand before
20349 multiplying. Convert to I type before adding. Fixes 43670.
20351 2003-05-14 Ravi Pratap <ravi@ximian.com>
20353 * enum.cs (ImplicitConversionExists) : Rename to
20354 ImplicitEnumConversionExists to remove ambiguity.
20356 * ecore.cs (NullCast): New type of cast expression class which
20357 basically is very similar to EmptyCast with the difference being
20358 it still is a constant since it is used only to cast a null to
20360 (eg. (string) null)
20362 * convert.cs (ImplicitReferenceConversion): When casting a null
20363 literal, we return a NullCast.
20365 * literal.cs (NullLiteralTyped): Remove - I don't see why this
20366 should be around anymore.
20368 The renaming (reported was slightly wrong). Corrections:
20370 ConvertImplicitStandard -> ImplicitConversionStandard
20371 ConvertExplicitStandard -> ExplicitConversionStandard
20373 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20374 before passing them in !
20376 * convert.cs (ImplicitConversionStandard): When comparing for
20377 equal expr and target types, ensure that expr is not a
20380 In general, we must not be checking (expr_type ==
20381 target_type) in the top level conversion methods
20382 (ImplicitConversion, ExplicitConversion etc). This checking is
20383 done in the methods that they delegate to.
20385 2003-05-20 Miguel de Icaza <miguel@ximian.com>
20387 * convert.cs: Move Error_CannotConvertType,
20388 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20389 ImplicitNumericConversion, ImplicitConversionExists,
20390 ImplicitUserConversionExists, StandardConversionExists,
20391 FindMostEncompassedType, FindMostSpecificSource,
20392 FindMostSpecificTarget, ImplicitUserConversion,
20393 ExplicitUserConversion, GetConversionOperators,
20394 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20395 TryImplicitIntConversion, Error_CannotConvertImplicit,
20396 ConvertImplicitRequired, ConvertNumericExplicit,
20397 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20398 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20401 Perform the following renames:
20403 StandardConversionExists -> ImplicitStandardConversionExists
20404 ConvertImplicit -> ImplicitConversion
20405 ConvertImplicitStandard -> ImplicitStandardConversion
20406 TryImplicitIntConversion -> ImplicitIntConversion
20407 ConvertImplicitRequired -> ImplicitConversionRequired
20408 ConvertNumericExplicit -> ExplicitNumericConversion
20409 ConvertReferenceExplicit -> ExplicitReferenceConversion
20410 ConvertExplicit -> ExplicitConversion
20411 ConvertExplicitStandard -> ExplicitStandardConversion
20413 2003-05-19 Martin Baulig <martin@ximian.com>
20415 * statement.cs (TypeInfo.StructInfo): Made this type protected.
20416 (TypeInfo): Added support for structs having structs as fields.
20418 * ecore.cs (FieldExpr): Implement IVariable.
20419 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20420 VariableInfo for the field.
20422 2003-05-18 Martin Baulig <martin@ximian.com>
20424 * expression.cs (This.DoResolve): Report a CS0027 if we're
20425 emitting a field initializer.
20427 2003-05-18 Martin Baulig <martin@ximian.com>
20429 * expression.cs (This.ResolveBase): New public function.
20430 (This.DoResolve): Check for CS0188.
20432 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20435 * ecore.cs (MethodGroupExpr.DoResolve): Set the
20436 `instance_expression' to null if we don't have any non-static
20439 2003-05-18 Martin Baulig <martin@ximian.com>
20441 Reworked the way how local variables and parameters are handled by
20442 the flow analysis code.
20444 * statement.cs (TypeInfo, VariableMap): New public classes.
20445 (VariableInfo): New public class. This is now responsible for
20446 checking whether a variable has been assigned. It is used for
20447 parameters and local variables.
20448 (Block.EmitMeta): Take the InternalParameters as argument; compute
20449 the layout of the flow vectors here.
20450 (Block.LocalMap, Block.ParameterMap): New public properties.
20451 (FlowBranching): The .ctor doesn't get the InternalParameters
20452 anymore since Block.EmitMeta() now computes the layout of the flow
20454 (MyStructInfo): This class is now known as `StructInfo' and nested
20455 in `TypeInfo'; we don't access this directly anymore.
20457 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20458 property and removed IsAssigned(), IsFieldAssigned(),
20459 SetAssigned() and SetFieldAssigned(); we now call them on the
20460 VariableInfo so we don't need to duplicate this code everywhere.
20462 * expression.cs (ParameterReference): Added `Block block' argument
20464 (LocalVariableReference, ParameterReference, This): The new
20465 VariableInfo class is now responsible for all the definite
20468 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20469 IsParameterAssigned, SetParameterAssigned): Removed.
20471 2003-05-18 Martin Baulig <martin@ximian.com>
20473 * typemanager.cs (InitCoreTypes): Try calling
20474 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20475 the 3-args-version. Corlib now also needs our `void_type'.
20476 (GetMethod): Added overloaded version which takes an optional
20477 `bool report_errors' to allow lookups of optional methods.
20479 2003-05-12 Martin Baulig <martin@ximian.com>
20481 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20482 only used for locals and not for parameters.
20484 2003-05-12 Miguel de Icaza <miguel@ximian.com>
20486 * support.cs (InternalParameters.ParameterType): Return the
20487 ExternalType of the parameter.
20489 * parameter.cs (Parameter.ExternalType): drop the two arguments,
20492 2003-05-11 Miguel de Icaza <miguel@ximian.com>
20494 * class.cs (MethodData.Define): Do not set the `newslot' on
20495 interface members, if they are also flagged as "override".
20497 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20498 better code for ++i and i++. This only works for static fields
20499 and local variables.
20501 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20502 want to pull the DeclSpace out of the builder_to_declspace instead
20503 of the TypeBuilder (like in TypeContainer.FindMembers).
20505 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20506 instead of LookupTypeContainer. Fixes the crash on .NET for
20507 looking up interface members.
20509 * const.cs: Create our own emit context during the Definition
20510 stage, so that constants are evaluated in the proper context, when
20511 a recursive definition happens.
20513 2003-05-11 Martin Baulig <martin@ximian.com>
20515 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
20516 new block for a switch section.
20517 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20518 the adding/lookup in the switch block. Fixes #39828.
20520 2003-05-09 Miguel de Icaza <miguel@ximian.com>
20522 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20523 functionality: I needed to convert the data after I had performed
20524 the add/sub operation into the operands type size.
20526 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20527 pass the type for the box operation, otherwise the resulting
20528 object would have been of type object.
20530 (BoxedCast): Add constructor to specify the type to box as.
20532 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20534 * iterators.cs: I was reusing the `count' variable inadvertently,
20535 take steps to not allow this to happen.
20537 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20539 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20540 by creating an array at the point where the params starts and
20541 putting all those arguments there, then adjusting the size of the
20544 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20546 * expression.cs (New.AddressOf): Implement interface
20547 IMemoryLocation. This is used when the `new' operator is used in
20548 the context of an invocation to a method on a value type.
20550 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20553 * namespace.cs: Also check the using aliases here.
20555 * driver.cs: Move the test for using validity after the types have
20556 been entered, so we do a single pass that also includes the using
20559 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20560 in the regular case. CreateSiblingForFinally is doing extra
20563 * attribute.cs (GetAttributeArgumentExpression): Store the result
20564 on an out value, and use the return value to indicate failure
20565 instead of using null (which is a valid return for Constant.GetValue).
20567 * statement.cs: Perform the analysis flow for the increment
20568 portion after the statement, because this will be the real flow of
20569 execution. Fixes #42385
20571 * codegen.cs (EmitContext.EmitArgument,
20572 EmitContext.EmitStoreArgument): New helper functions when the
20573 RemapToProxy flag is set.
20575 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20578 Add support for remapping parameters.
20580 * iterators.cs: Propagate parameter values; Store parameter
20581 values in the proxy classes.
20583 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20585 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20586 need a proxy reference; I do not know what I was thinking
20588 * cs-parser.jay (constructor_initializer): catch another error,
20589 and display nice message.
20591 (field_declaration): catch void field declaration
20592 to flag a better error.
20594 * class.cs (MemberBase.CheckBase): Report an error instead of a
20595 warning if a new protected member is declared in a struct.
20596 (Field.Define): catch the error of readonly/volatile.
20598 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20600 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20601 volatile variable is taken
20603 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20605 * statement.cs (Fixed.Resolve): Report an error if we are not in
20608 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20610 * typemanager.cs: reuse the code that handles type clashes for
20611 delegates and enumerations.
20613 * class.cs (Report28): Always report.
20615 * expression.cs (EncodeAsAttribute): Allow nulls here.
20617 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20619 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20620 the functionality for testing whether an expression is valid for
20621 an attribute here. Also handle the case of arrays of elements
20624 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20625 encoding a linear array into an array of objects that are suitable
20626 to be passed to an CustomAttributeBuilder.
20628 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20630 * ecore.cs: (FieldExpr): Handle field remapping here.
20632 * iteratators.cs: Pass the instance variable (if the method is an
20633 instance method) to the constructors, so we can access the field
20634 variables on the class.
20636 TODO: Test this with structs. I think the THIS variable on
20637 structs might have to be a pointer, and not a refenrece
20639 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20641 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20642 local variables to fields in a proxy class.
20644 * iterators.cs (PopulateProxy): Rename our internal fields to
20646 Create a <THIS> field if we are an instance method, so we can
20647 reference our parent container variables.
20648 (MapVariable): Called back from the EmitContext code to enter a
20649 new variable to field mapping into the proxy class (we just create
20653 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20654 for using the remapped locals to fields.
20656 I placed the code here, because that gives the same semantics to
20657 local variables, and only changes the Emit code.
20659 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20660 statements inside iterators.
20661 (VariableInfo): Add a FieldBuilder for the cases when we are
20662 remapping local variables to fields in a proxy class
20664 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20665 current_block != null.
20667 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20668 not cope with strings, as it has been moved to the
20669 TableSwitchEmit. Fixed bug in switch generation.
20671 * expression.cs (New.DoResolve): Provide more context for the user
20672 when reporting an error.
20674 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20677 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20678 check the permissions for it. Note than in a type-resolution
20679 context the check was already present in DeclSpace.ResolveType,
20680 but was missing from the MemberAccess.
20682 (ArrayCreation.CheckIndices): warn if the user has
20683 more nested levels of expressions, but there are no more
20684 dimensions specified. Avoids crash on bug 41906.
20686 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20688 * statement.cs (Block): replace Implicit bool, for a generic
20690 New flag: `Unchecked'. This is used during the EmitMeta phase
20691 (which is out-of-line with the regular Resolve/Emit process for a
20692 statement, as this is done ahead of time, but still gets a chance
20693 to call constant resolve).
20695 (Block.Flags): new enum for adding a new flag.
20697 (Block.EmitMeta): track the state of unchecked.
20699 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20700 to enable constant resolution to work there as well.
20702 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20704 * typemanager.cs (ienumerable_type): Also look up
20705 System.Collections.IEnumerable.
20707 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20709 TODO: Test more than one conditional per method.
20711 * class.cs (Indexer.Define): Report the location where the user is
20712 referencing the unsupported feature.
20714 (MethodData): Overload the use of `conditionals' to
20715 minimize the creation of needless ArrayLists. This saves roughly
20716 212kb on my machine.
20718 (Method): Implement the new IIteratorContainer interface.
20719 (Method.SetYields): Implement the method by setting the ModFlags
20720 to contain METHOD_YIELDS.
20722 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20723 which just got set to null.
20725 * iterators.cs: New file.
20727 (Yield, YieldBreak): New statements.
20729 * statement.cs (Return.Resolve): Flag an error if we are used in
20730 an iterator method.
20732 * codegen.cs (InIterator): New flag set if the code is being
20733 compiled in an iterator method.
20735 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20736 internal modifier, and we just use it to avoid adding extra
20737 fields, as this is seldom used.
20739 * cs-parser.jay: Add yield_statement (yield and yield break).
20741 * driver.cs: New flag -v2 to turn on version 2 features.
20743 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20744 hashtable when v2 is enabled.
20746 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20748 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20749 there is already a namespace defined with this name.
20751 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20752 people upgraded their corlibs.
20754 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20755 always use fully qualified types, no need to use the compiler
20758 (TypeManager.IsNamespace): Use binarysearch.
20760 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20761 AddDelegate): I did not quite use the new IsValid API properly: I
20762 have to pass the short-name and the fullname. I was passing only
20763 the basename instead of the fullname sometimes.
20765 (TypeContainer.DefineType): call NamespaceClash.
20767 * interface.cs (Interface.DefineType): use NamespaceClash before
20770 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20773 * enum.cs: (Enum.DefineType): use NamespaceClash before
20776 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20777 speed increase. First, use the negative_hits cache when we get a
20778 negative. Second, add the type with its full original name
20779 instead of the new . and + encoded name (reflection uses + to
20780 separate type from a nested type). Use LookupTypeReflection
20781 directly which bypasses the type->name hashtable (that we already
20782 know does not contain the type.
20784 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20785 location/container type.
20787 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20789 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20791 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20793 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20794 method is being referenced in the method group from a static
20795 context, and report error 120 if so.
20797 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20800 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20801 is created, we create the A namespace).
20803 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20806 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20808 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20809 invocation to ModuleBuilder.GetType with the same values will
20810 return a new type instance, so we need to cache its return
20813 * expression.cs (Binary.ResolveOperator): Only allow the compare
20814 operators on enums if they are of the same type.
20816 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20817 types of ValueType on their own case. Before we were giving them
20818 the same treatment as objects.
20820 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20821 fullname. Short name is used to compare against container name.
20822 Fullname is used to check against defined namespace names.
20824 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20825 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20827 (Method.CheckBase): Call parent.
20828 (MemberBase.CheckBase): Check for protected members on sealed
20830 (PropertyBase.CheckBase): Call parent.
20831 (Field.Define): Call parent.
20833 * report.cs: Negative error codes are now mapped to 8000 - code,
20834 so that the display is render more nicely.
20836 * typemanager.cs: Do not use try/catch, instead report a regular
20839 (GetPointerType, GetReferenceType): These methods provide
20840 mechanisms to obtain the T* and T& from a T. We had the code
20841 previously scattered around the code base, and it also used
20842 TypeManager.LookupType that would go through plenty of caches.
20843 This one goes directly to the type source.
20845 In some places we did the Type.GetType followed by
20846 ModuleBuilder.GetType, but not in others, so this unifies the
20847 processing as well.
20849 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20850 statements now that we have namespace information.
20852 * typemanager.cs (IsNamespace): New method, returns whether the
20853 string presented is a namespace or not.
20855 (ComputeNamespaces): New public entry point, computes the list of
20856 available namespaces, using the GetNamespaces API call in Mono, or
20857 the slower version in MS.NET.
20859 Now before we start the semantic analysis phase, we have a
20860 complete list of namespaces including everything that the user has
20863 Deleted old code to cache namespaces in .nsc files.
20865 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20867 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20868 class/struct location definition Location for the implicit
20869 constructor location.
20871 (Operator.Define): Use the location of the operator for the
20872 implicit Method definition.
20874 (Constructor.Emit): use the constructor location for the implicit
20875 base initializer constructor.
20877 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20878 and the Expression class now contains two new methods:
20880 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20881 isolate type lookup from the rest of the resolution process.
20883 Since we use Expressions to hold type definitions due to the way
20884 we parse the input we have historically overloaded Resolve to
20885 perform the Type lookups if a special flag is passed. Now this is
20886 eliminated and two methods take their place.
20888 The differences in the two methods between xStep and xTerminal is
20889 that xStep is involved in our current lookup system that uses
20890 SimpleNames to compose a name, while xTerminal is used just to
20891 catch the case where the simplename lookup failed.
20893 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20895 * expression.cs (ResolveMemberAccess): Remove redundant code.
20896 TypeExpr expressions are always born fully resolved.
20898 * interface.cs (PopulateMethod): Do not lookup the types twice.
20899 We were doing it once during SemanticAnalysis and once during
20902 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20903 in local variable type definitions, were being returned as a
20904 SimpleName (we decomposed everything into a string), that is
20905 because primary_expression was being used instead of a type in the
20906 grammar (reduce/reduce conflicts).
20908 The part that was wrong is that we converted the expression into a
20909 string (an oversimplification in one hand, compounded with primary
20910 expressions doing string concatenation).
20916 Would return "A.B.C[]" as a SimpleName. This stopped things like
20917 using clauses from working on this particular context. And a type
20918 was being matched directly against "A.B.C[]".
20920 We now use the correct approach, and allow for ComposedCast to be
20921 part of the unary expression. So the "A.B.C []" become a composed
20922 cast of "A.B.C" (as a nested group of MemberAccess with a
20923 SimpleName at the end) plus the rank composition "[]".
20927 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20929 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20930 for the access level checking.
20932 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20933 `TypeContainer container', because I kept getting confused when I
20934 was debugging this code.
20936 * expression.cs (Indexers): Instead of tracking getters/setters,
20937 we now track them in parallel. We create one arraylist less, but
20938 most importantly it is possible now for the LValue code to find a
20939 matching get for a set.
20941 (IndexerAccess.DoResolveLValue): Update the code.
20942 GetIndexersForType has been modified already to extract all the
20943 indexers from a type. The code assumed it did not.
20945 Also make the code set the correct return type for the indexer.
20946 This was fixed a long time ago for properties, but was missing for
20947 indexers. It used to be void_type.
20949 (Binary.Emit): Test first for doubles instead of
20950 floats, as they are more common.
20952 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20953 when dealing with floats and the <=, >= operators. This fixes bug
20956 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20957 to load the array value by emitting a load on the foreach variable
20958 type. This was incorrect.
20960 We now emit the code to load an element using the the array
20961 variable type, and then we emit the conversion operator.
20965 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
20967 * attribute.cs: Avoid allocation of ArrayLists in the common case.
20969 2003-04-09 Miguel de Icaza <miguel@ximian.com>
20971 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20972 test for protection before we test for signatures.
20974 (MethodSignature.ToString): implement.
20976 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20977 to the case where we reduced into a LongConstant.
20979 * decl.cs (CheckAccessLevel): If the type is an array, we can not
20980 depend on whether the information is acurrate, because the
20981 Microsoft runtime will always claim that the array type is public,
20982 regardless of the real state.
20984 If the type is a pointer, another problem happens: the type is
20985 reported as non-public in Microsoft.
20987 In both cases we have to call CheckAccessLevel recursively with
20988 the underlying type as the argument to be tested.
20990 2003-04-08 Miguel de Icaza <miguel@ximian.com>
20992 * assign.cs (Assign.Emit): If we are dealing with a compound
20993 assignment expression, we should use the code path that stores the
20994 intermediate result in a temporary value. This fixes #40903.
20996 *expression.cs (Indirection.ToString): Provide ToString method for
20999 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
21001 * class.cs: Null out fields holding references to Block objects so
21002 they can be garbage collected.
21004 * expression.cs (OverloadResolve): Remove unused local.
21006 2003-04-07 Martin Baulig <martin@ximian.com>
21008 * codegen.cs (EmitContext.CurrentFile): New public field.
21009 (EmitContext.Mark): Use the CurrentFile to check whether the
21010 location is in the correct file.
21011 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21013 2003-04-07 Martin Baulig <martin@ximian.com>
21015 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21017 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21018 location. [FIXME: The location argument which gets passed to this
21019 method is sometimes wrong!]
21021 2003-04-07 Nick Drochak <ndrochak@gol.com>
21023 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21025 2003-04-07 Miguel de Icaza <miguel@ximian.com>
21027 * expression.cs (Indirection.EmitAssign): We were using the
21028 temporary, but returning immediately instead of continuing the
21031 2003-04-06 Martin Baulig <martin@ximian.com>
21033 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21034 if it's a nested child, but also deriving from the outer class.
21037 * typemanager.cs (IsNestedChildOf): Make this work if it's a
21038 nested child, but also deriving from the outer class. See
21040 (FilterWithClosure): We may access private members of the outer
21041 class if we're a nested child and deriving from the outer class.
21042 (RealMemberLookup): Only set `closure_private_ok' if the
21043 `original_bf' contained BindingFlags.NonPublic.
21045 2003-04-05 Martin Baulig <martin@ximian.com>
21047 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21049 2003-04-02 Miguel de Icaza <miguel@ximian.com>
21051 * class.cs (Event.Define): Do not allow abstract events to have
21054 2003-04-01 Miguel de Icaza <miguel@ximian.com>
21056 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21057 block in event declarations.
21059 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21060 value type, get its address.
21062 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21063 leaving a class on the stack instead of a boolean value (int
21064 0/1). Change the code so we compare against null, and then the
21065 result against zero.
21067 * class.cs (TypeContainer.GetClassBases): We were checking for the
21068 parent class being sealed too late.
21070 * expression.cs (Binary.Emit): For <= and >= when dealing with
21071 floating point values, use cgt.un and clt.un instead of cgt and
21074 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
21076 * statement.cs: Apply the same optimization as MS: skip the
21077 GetEnumerator returning an IEnumerator, and use the one returning a
21078 CharEnumerator instead. This allows us to avoid the try-finally block
21081 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
21083 * cs-parser.jay: Attributes cannot be applied to
21084 namespaces. Fixes #40473
21086 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21089 (Add*): check if the name is valid using the full name for constants,
21090 fields, properties and events.
21092 2003-03-28 Miguel de Icaza <miguel@ximian.com>
21094 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21095 char constants to be part of the enumeration.
21097 * expression.cs (Conditional.DoResolve): Add support for operator
21098 true. Implements the missing functionality from 14.12
21100 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21101 operator true/false as required by the spec.
21103 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21104 implicit conversion to boolean.
21106 * statement.cs (Statement.ResolveBoolean): A boolean expression is
21107 also one where the type implements `operator true'.
21109 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21110 get an expression that will invoke operator true based on an
21113 (GetConversionOperators): Removed the hack that called op_True
21116 (Expression.ResolveBoolean): Move this from Statement.
21118 2003-03-17 Miguel de Icaza <miguel@ximian.com>
21120 * ecore.cs (FieldExpr): do not allow initialization of initonly
21121 fields on derived classes
21123 2003-03-13 Martin Baulig <martin@ximian.com>
21125 * statement.cs (Block.Emit): Call ig.BeginScope() and
21126 ig.EndScope() when compiling with debugging info; call
21127 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21129 2003-03-08 Miguel de Icaza <miguel@ximian.com>
21131 * expression.cs (Indexers): Do not construct immediately, allow
21132 for new members to be appended as we go. Fixes 38143
21134 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21136 * expression.cs: save/restore context when resolving an unchecked
21139 2003-03-05 Miguel de Icaza <miguel@ximian.com>
21141 * cfold.cs: Catch division by zero in modulus operator during
21144 2003-03-03 Miguel de Icaza <miguel@ximian.com>
21146 * interface.cs (Interface.DefineMembers): Avoid defining members
21149 2003-02-27 Miguel de Icaza <miguel@ximian.com>
21151 * driver.cs: handle the +/- options for -noconfig
21153 * statement.cs (Unckeched.Resolve): Also track the state of
21154 unchecked in the Resolve phase.
21156 2003-02-27 Martin Baulig <martin@ximian.com>
21158 * ecore.cs (Expression.MemberLookup): Don't create a
21159 MethodGroupExpr for something which is not a method. Fixes #38291.
21161 2003-02-25 Miguel de Icaza <miguel@ximian.com>
21163 * class.cs (MemberBase.CheckParameters): Also check that the type
21164 is unmanaged if it is a pointer.
21166 * expression.cs (SizeOf.Resolve): Add location information.
21168 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21169 a managed type is declared.
21171 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21172 parameter modifiers as well. Fixes bug 38606
21174 * class.cs: Very sad. Am backing out the speed up changes
21175 introduced by the ArrayList -> Array in the TypeContainer, as they
21176 were not actually that much faster, and introduced a bug (no error
21177 reports on duplicated methods).
21179 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21180 source first, this will guarantee that we have a valid expression
21181 before calling in lower levels functions that will require a
21182 resolved object. Then use this original_source in the
21183 target.ResolveLValue instead of the original source that was
21186 Another change. Use target.Resolve instead of LValueResolve.
21187 Although we are resolving for LValues, we will let the Assign code
21188 take care of that (it will be called again from Resolve). This
21189 basically allows code like this:
21191 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21192 class Y { void A (X x) { x [0] += o; }
21194 The problem was that the indexer was trying to resolve for
21195 set_Item (idx, object o) and never finding one. The real set_Item
21196 was set_Item (idx, X). By delaying the process we get the right
21201 2003-02-23 Martin Baulig <martin@ximian.com>
21203 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21204 while calling DoEmit ().
21206 * codegen.cs (EmitContext.Mark): Don't mark locations in other
21207 source files; if you use the #line directive inside a method, the
21208 compiler stops emitting line numbers for the debugger until it
21209 reaches the end of the method or another #line directive which
21210 restores the original file.
21212 2003-02-23 Martin Baulig <martin@ximian.com>
21214 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21216 2003-02-23 Martin Baulig <martin@ximian.com>
21218 * statement.cs (Block.AddChildVariableNames): We need to call this
21219 recursively, not just for our immediate children.
21221 2003-02-23 Martin Baulig <martin@ximian.com>
21223 * class.cs (Event.Define): Always make the field private, like csc does.
21225 * typemanager.cs (TypeManager.RealMemberLookup): Make events
21226 actually work, fixes bug #37521.
21228 2003-02-23 Miguel de Icaza <miguel@ximian.com>
21230 * delegate.cs: When creating the various temporary "Parameters"
21231 classes, make sure that we call the ComputeAndDefineParameterTypes
21232 on those new parameters (just like we do with the formal ones), to
21233 allow them to be resolved in the context of the DeclSpace.
21235 This fixes the bug that Dick observed in Bugzilla #38530.
21237 2003-02-22 Miguel de Icaza <miguel@ximian.com>
21239 * expression.cs (ResolveMemberAccess): When resolving a constant,
21240 do not attempt to pull a constant if the value was not able to
21241 generate a valid constant.
21243 * const.cs (LookupConstantValue): Do not report more errors than required.
21245 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21247 * expression.cs: fixes bug #38328.
21249 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21251 * class.cs: Changed all the various members that can be part of a
21252 class from being an ArrayList to be an Array of the right type.
21253 During the DefineType type_list, interface_list, delegate_list and
21254 enum_list are turned into types, interfaces, delegates and enums
21257 And during the member population, indexer_list, event_list,
21258 constant_list, field_list, instance_constructor_list, method_list,
21259 operator_list and property_list are turned into their real arrays.
21261 Although we could probably perform this operation earlier, for
21262 good error reporting we need to keep the lists and remove the
21263 lists for longer than required.
21265 This optimization was triggered by Paolo profiling the compiler
21266 speed on the output of `gen-sample-program.pl' perl script.
21268 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21269 not crash in methods like MemberLookupFailed that use this field.
21271 This problem arises when the compiler fails to resolve a type
21272 during interface type definition for example.
21274 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21276 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21277 inherit from System.Object, so we have to stop at null, not only
21278 when reaching System.Object.
21280 2003-02-17 Miguel de Icaza <miguel@ximian.com>
21282 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21283 DeclaredOnly because the parent indexer might have had a different
21284 name, but did not loop until the top of the hierarchy was reached.
21286 The problem this one fixes is 35492: when a class implemented an
21287 indexer from an interface, we were getting the interface method
21288 (which was abstract) and we were flagging an error (can not invoke
21291 This also keeps bug 33089 functioning, and test-148 functioning.
21293 * typemanager.cs (IsSpecialMethod): The correct way of figuring
21294 out if a method is special is to see if it is declared in a
21295 property or event, or whether it is one of the predefined operator
21296 names. This should fix correctly #36804.
21298 2003-02-15 Miguel de Icaza <miguel@ximian.com>
21300 The goal here is to remove the dependency on EmptyCast.Peel ().
21301 Killing it completely.
21303 The problem is that currently in a number of places where
21304 constants are expected, we have to "probe" for an EmptyCast, and
21305 Peel, which is not the correct thing to do, as this will be
21306 repetitive and will likely lead to errors.
21308 The idea is to remove any EmptyCasts that are used in casts that
21309 can be reduced to constants, so we only have to cope with
21312 This bug hunt was triggered by Bug 37363 and the desire to remove
21313 the duplicate pattern where we were "peeling" emptycasts to check
21314 whether they were constants. Now constants will always be
21317 * ecore.cs: Use an enumconstant here instead of wrapping with
21320 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21321 throwing me off. By handling this we can get rid of a few hacks.
21323 * statement.cs (Switch): Removed Peel() code.
21325 2003-02-14 Miguel de Icaza <miguel@ximian.com>
21327 * class.cs: Location information for error 508
21329 * expression.cs (New.DoResolve): Add a guard against double
21330 resolution of an expression.
21332 The New DoResolve might be called twice when initializing field
21333 expressions (see EmitFieldInitializers, the call to
21334 GetInitializerExpression will perform a resolve on the expression,
21335 and later the assign will trigger another resolution
21337 This leads to bugs (#37014)
21339 * delegate.cs: The signature for EndInvoke should contain any ref
21340 or out parameters as well. We were not doing this in the past.
21342 * class.cs (Field.Define): Do not overwrite the type definition
21343 inside the `volatile' group. Turns out that volatile enumerations
21344 were changing the type here to perform a validity test, which
21347 2003-02-12 Miguel de Icaza <miguel@ximian.com>
21349 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21350 and structs, we do not want to load the instance variable
21352 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21353 enum_type has to be handled like an object reference (implicit
21354 conversions exists from this to object), but the regular IsClass
21355 and IsValueType tests will never return true for this one.
21357 Also we use TypeManager.IsValueType instead of type.IsValueType,
21358 just for consistency with the rest of the code (this is only
21359 needed if we ever use the construct exposed by test-180.cs inside
21360 corlib, which we dont today).
21362 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
21364 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21367 2003-02-09 Martin Baulig <martin@ximian.com>
21369 * namespace.cs (Namespace..ctor): Added SourceFile argument.
21370 (Namespace.DefineNamespaces): New static public method; this is
21371 called when we're compiling with debugging to add all namespaces
21372 to the symbol file.
21374 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21375 pass it to the Namespace's .ctor.
21377 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21378 and MethodBase arguments; pass the namespace ID to the symwriter;
21379 pass the MethodBase instead of the token to the symwriter.
21380 (SymbolWriter.DefineNamespace): New method to add a namespace to
21383 2003-02-09 Martin Baulig <martin@ximian.com>
21385 * symbolwriter.cs: New file. This is a wrapper around
21386 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
21387 methods here in near future.
21389 2003-02-09 Martin Baulig <martin@ximian.com>
21391 * codegen.cs (EmitContext.Mark): Just pass the arguments to
21392 ILGenerator.MarkSequencePoint() which are actually used by the
21395 2003-02-09 Martin Baulig <martin@ximian.com>
21397 * location.cs (SourceFile): New public sealed class. This
21398 contains the name and an index which is used in the location's token.
21399 (Location): Reserve an appropriate number of bits in the token for
21400 the source file instead of walking over that list, this gives us a
21401 really huge performance improvement when compiling with debugging.
21403 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21404 `SourceFile' argument instead of a string.
21405 (Driver.ProcessFile): Add all the files via Location.AddFile(),
21406 but don't parse/tokenize here, we need to generate the list of all
21407 source files before we do that.
21408 (Driver.ProcessFiles): New static function. Parses/tokenizes all
21411 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21412 instead of a string.
21414 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21417 2003-02-09 Martin Baulig <martin@ximian.com>
21419 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21420 filename on `#line default'.
21422 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21424 * statement.cs: don't clear the pinned var when the fixed statement
21425 returns from the method (fixes bug#37752).
21427 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21429 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
21432 2003-02-07 Martin Baulig <martin@ximian.com>
21434 * driver.cs: Removed the `--debug-args' command line argument.
21436 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21437 automatically by the AsssemblyBuilder.
21438 (CodeGen.InitializeSymbolWriter): We don't need to call any
21439 initialization function on the symbol writer anymore. This method
21440 doesn't take any arguments.
21442 2003-02-03 Miguel de Icaza <miguel@ximian.com>
21444 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21445 from referenced assemblies as well.
21447 2003-02-02 Martin Baulig <martin@ximian.com>
21449 * class.cs (MethodData.Emit): Generate debugging info for external methods.
21451 2003-02-02 Martin Baulig <martin@ximian.com>
21453 * class.cs (Constructor.Emit): Open the symbol writer before
21454 emitting the constructor initializer.
21455 (ConstructorInitializer.Emit): Call ec.Mark() to allow
21456 single-stepping through constructor initializers.
21458 2003-01-30 Miguel de Icaza <miguel@ximian.com>
21460 * class.cs: Handle error 549: do not allow virtual methods in
21463 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21465 * decl.cs: Check access levels when resolving types
21467 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21469 * statement.cs: Add parameters and locals set in catch blocks that might
21470 return to set vector
21472 2003-01-29 Miguel de Icaza <miguel@ximian.com>
21474 * class.cs (Operator): Set the SpecialName flags for operators.
21476 * expression.cs (Invocation.DoResolve): Only block calls to
21477 accessors and operators on SpecialName methods.
21479 (Cast.TryReduce): Handle conversions from char constants.
21482 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21484 * statement.cs: small memory and time optimization in FlowBranching.
21486 2003-01-28 Pedro Mart <yoros@wanadoo.es>
21488 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21489 problem that the last fix but in the other sid (Set).
21491 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21492 access when there is no indexer in the hierarchy.
21494 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21496 * class.cs: Combine some if statements.
21498 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21500 * driver.cs: fixed bug #37187.
21502 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
21504 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21505 any indexer, it's needed to build a list with all the indexers in the
21506 hierarchy (AllGetters), else we have problems. Fixes #35653.
21508 2003-01-23 Miguel de Icaza <miguel@ximian.com>
21510 * class.cs (MethodData.Define): It is wrong for an interface
21511 implementation to be static in both cases: explicit and implicit.
21512 We were only handling this in one case.
21514 Improve the if situation there to not have negations.
21516 * class.cs (Field.Define): Turns out that we do not need to check
21517 the unsafe bit on field definition, only on usage. Remove the test.
21519 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21521 * driver.cs: use assembly.Location instead of Codebase (the latest
21522 patch made mcs fail when using MS assemblies).
21524 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
21526 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21527 get the path to *corlib.dll.
21529 2003-01-21 Nick Drochak <ndrochak@gol.com>
21533 * typemanager.cs: Remove compiler warnings
21535 2003-01-20 Duncan Mak <duncan@ximian.com>
21537 * AssemblyInfo.cs: Bump the version number to 0.19.
21539 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21541 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21543 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21545 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21547 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21549 * cs-parser.jay: Small fix: we were not comparing the constructor
21550 name correctly. Thanks to Zoltan for the initial pointer.
21552 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21554 * cs-tokenizer.cs: Set file name when specified with #line
21556 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21558 * cs-parser.jay: Only perform the constructor checks here if we
21559 are named like the class; This will help provider a better
21560 error. The constructor path is taken when a type definition is
21561 not found, but most likely the user forgot to add the type, so
21562 report that rather than the constructor error.
21564 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21566 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21569 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21571 * cs-parser.jay: Add cleanup call.
21573 2003-01-13 Duncan Mak <duncan@ximian.com>
21575 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21576 consistent with other methods.
21578 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21580 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21582 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21584 * attribute.cs: only set GuidAttr to true when we have a
21587 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21591 * typemanager.cs: fixes to allow mcs compile corlib with the new
21592 Type.IsSubclassOf fix.
21594 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21596 * expression.cs (LocalVariableReference.DoResolve): Classify a
21597 constant as a value, not as a variable. Also, set the type for
21600 * cs-parser.jay (fixed_statement): take a type instead of a
21601 pointer_type, so we can produce a better error message later.
21603 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21606 (For.DoEmit): Make inifinite loops have a
21607 non-conditional branch back.
21609 (Fixed.DoEmit): First populate the pinned variables, then emit the
21610 statement, then clear the variables. Before I was emitting the
21611 code once for each fixed piece.
21614 2003-01-08 Martin Baulig <martin@ximian.com>
21616 * statement.cs (FlowBranching.MergeChild): A break in a
21617 SWITCH_SECTION does not leave a loop. Fixes #36155.
21619 2003-01-08 Martin Baulig <martin@ximian.com>
21621 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21622 lives in the same number space than `param_map'. Fixes #36154.
21624 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21626 * cs-parser.jay (constructor_declaration): Set the
21627 Constructor.ModFlags before probing for it. This makes the
21628 compiler report 514, 515 and 132 (the code was there, but got
21631 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21632 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21633 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21635 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21637 * enum.cs: create the enum static fields using the enum type.
21639 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21641 * class.cs: don't try to create the ParamBuilder for the return
21642 type if it's not needed (and handle it breaking for the ms runtime
21645 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21647 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21649 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21651 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21652 the command. This showed up while compiling the JANET source
21653 code, which used \r as its only newline separator.
21655 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21657 * class.cs (Method.Define): If we are an operator (because it
21658 reuses our code), then set the SpecialName and HideBySig. #36128
21660 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21662 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21663 exception, report error 120 `object reference required'.
21665 * driver.cs: Add --pause option, used during to measure the size
21666 of the process as it goes with --timestamp.
21668 * expression.cs (Invocation.DoResolve): Do not allow methods with
21669 SpecialName to be invoked.
21671 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21673 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21674 number before adding it.
21676 2002-12-21 Ravi Pratap <ravi@ximian.com>
21678 * ecore.cs (StandardImplicitConversion): When in an unsafe
21679 context, we allow conversion between void * to any other pointer
21680 type. This fixes bug #35973.
21682 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21684 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21685 is not thrown when extensionless outputs are used
21687 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21689 * rootcontext.cs: fixed compilation of corlib.
21691 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21693 * attribute.cs (Attributes.Contains): Add new method.
21695 * class.cs (MethodCore.LabelParameters): if the parameter is an
21696 `out' parameter, check that no attribute `[In]' has been passed.
21698 * enum.cs: Handle the `value__' name in an enumeration.
21700 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21702 * decl.cs: Added special case to allow overrides on "protected
21705 2002-12-18 Ravi Pratap <ravi@ximian.com>
21707 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21708 since it makes much more sense.
21710 (Attributes.ctor): Don't require a Location parameter.
21712 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21714 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21715 since we already have that information per attribute.
21717 * everywhere : make appropriate changes.
21719 * class.cs (LabelParameters): Write the code which actually
21720 applies attributes to the return type. We can't do this on the MS
21721 .NET runtime so we flag a warning in the case an exception is
21724 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21726 * const.cs: Handle implicit null conversions here too.
21728 2002-12-17 Ravi Pratap <ravi@ximian.com>
21730 * class.cs (MethodCore.LabelParameters): Remove the extra
21731 Type [] parameter since it is completely unnecessary. Instead
21732 pass in the method's attributes so that we can extract
21733 the "return" attribute.
21735 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21737 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21738 of ignoring it and letting the compile continue.
21740 * typemanager.cs (ChangeType): use an extra argument to return an
21741 error condition instead of throwing an exception.
21743 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21745 * expression.cs (Unary.TryReduce): mimic the code for the regular
21746 code path. Perform an implicit cast in the cases where we can
21747 implicitly convert to one of the integral types, and then reduce
21748 based on that constant. This fixes bug #35483.
21750 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21752 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21754 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21756 * namespace.cs: fixed bug #35489.
21758 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21760 * class.cs: Remove some dead code.
21762 * cs-parser.jay: Estimate the number of methods needed
21763 (RootContext.MethodCount);
21765 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21766 numbers instead of StringBuilders.
21768 * support.cs (PtrHashtable): Add constructor with initial size;
21769 We can now reduce reallocations of the method table.
21771 2002-12-10 Ravi Pratap <ravi@ximian.com>
21773 * attribute.cs (ApplyAttributes): Keep track of the emitted
21774 attributes on a per-target basis. This fixes bug #35413.
21776 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21778 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21779 default to the Windows 1252 encoding.
21781 (UnixParseOption): Support version, thanks to Alp for the missing
21784 * AssemblyInfo.cs: Add nice assembly information.
21786 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21789 * cs-parser.jay: Allow a trailing comma before the close bracked
21790 in the attribute_section production.
21792 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21793 address of the instance was being taken, I will take this out,
21794 because we take the address of the object immediately here.
21796 2002-12-09 Ravi Pratap <ravi@ximian.com>
21798 * typemanager.cs (AreMultipleAllowed): Take care of the most
21799 obvious case where attribute type is not in the current assembly -
21802 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21804 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21805 definitions, instead of doing that afterwards.
21807 Also we use a nice little hack, depending on the constructor, we
21808 know if we are a "composed" name or a simple name. Hence, we
21809 avoid the IndexOf test, and we avoid
21811 * codegen.cs: Add code to assist in a bug reporter to track down
21812 the source of a compiler crash.
21814 2002-12-07 Ravi Pratap <ravi@ximian.com>
21816 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21817 types have been emitted for a given element and flag an error
21818 if something which does not have AllowMultiple set is used more
21821 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21822 attribute types and their corresponding AllowMultiple properties
21824 (AreMultipleAllowed): Check the property for a given type.
21826 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21827 property in the case we have a TypeContainer.
21829 (Attributes.AddAttribute): Detect duplicates and just skip on
21830 adding them. This trivial fix catches a pretty gross error in our
21831 attribute emission - global attributes were being emitted twice!
21833 Bugzilla bug #33187 is now fixed.
21835 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21837 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21838 instead of pp_and).
21840 * expression.cs (Binary.ResolveOperator): I can only use the
21841 Concat (string, string, string) and Concat (string, string,
21842 string, string) if the child is actually a concatenation of
21845 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21847 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21848 context where we need a 2-character lookahead.
21850 * pending.cs (PendingImplementation): Rework so we can keep track
21851 of interface types all the time, and flag those which were
21852 implemented by parents as optional.
21854 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21856 * expression.cs (Binary.ResolveOperator): Use
21857 String.Concat(string,string,string) or
21858 String.Concat(string,string,string,string) when possible.
21860 * typemanager: More helper methods.
21863 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21865 * pending.cs: remove the bogus return from GetMissingInterfaces()
21866 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21868 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21870 * namespace.cs: avoid duplicated 'using xxx' being added to
21871 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21872 when we get more than one 'using' statement for the same namespace.
21873 Report a CS0105 warning for it.
21875 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21877 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21878 of calling getChar/putback, uses internal knowledge of it.
21880 (xtoken): Reorder tokenizer so most common patterns are checked
21881 first. This reduces the compilation time in another 5% (from 8.11s
21882 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21884 The parsing time is 22% of the compilation in mcs, and from that
21885 64% is spent on the tokenization process.
21887 I tried using a binary search for keywords, but this is slower
21888 than the hashtable. Another option would be to do a couple of
21891 * Not use a StringBuilder, instead use an array of chars,
21892 with a set value. Notice that this way we could catch
21893 the 645 error without having to do it *afterwards*.
21895 * We could write a hand-parser to avoid the hashtable
21896 compares altogether.
21898 The identifier consumption process takes 37% of the tokenization
21899 time. Another 15% is spent on is_number. 56% of the time spent
21900 on is_number is spent on Int64.Parse:
21902 * We could probably choose based on the string length to
21903 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21906 Another 3% is spend on wrapping `xtoken' in the `token' function.
21908 Handle 0xa0 as whitespace (#34752)
21910 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21912 * typemanager.cs (IsCLRType): New routine to tell whether a type
21913 is one of the builtin types.
21915 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21916 typecode in more places instead of doing pointer comparissions.
21917 We could leverage some knowledge about the way the typecodes are
21920 New code to cache namespaces in assemblies, it is currently not
21921 invoked, to be used soon.
21923 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21925 * expression.cs (Binary.ResolveOperator): specially handle
21926 strings, and do not perform user-defined operator overloading for
21929 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21931 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21932 internalcall as it is a pretty simple operation; Avoid whenever
21933 possible to call Char.IsLetter.
21935 (consume_identifier): Cut by half the number of
21936 hashtable calls by merging the is_keyword and GetKeyword behavior.
21938 Do not short-circuit, because if we do, we
21939 report errors (ie, #if false && true would produce an invalid
21943 2002-11-24 Martin Baulig <martin@ximian.com>
21945 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21946 check constant ranges and report a CS0221. Fixes #33186.
21948 2002-11-24 Martin Baulig <martin@ximian.com>
21950 * cs-parser.jay: Make this work for uninitialized variable
21951 declarations in the `for' initializer. Fixes #32416.
21953 2002-11-24 Martin Baulig <martin@ximian.com>
21955 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21956 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21958 2002-11-24 Martin Baulig <martin@ximian.com>
21960 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21961 argument; if true, we also check for user-defined conversions.
21962 This is only needed if both arguments are of a user-defined type.
21963 Fixes #30443, added test-175.cs.
21964 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21966 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21968 2002-11-24 Martin Baulig <martin@ximian.com>
21970 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21971 function to get the store opcode.
21972 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21973 only emit the Ldelema if the store opcode is Stobj. You must run
21974 both test-34 and test-167 to test this. Fixes #34529.
21976 2002-11-23 Martin Baulig <martin@ximian.com>
21978 * ecore.cs (Expression.MemberLookup): Added additional
21979 `qualifier_type' argument which is used when we're being called
21980 from MemberAccess.DoResolve() and null if we're called from a
21982 (Expression.MemberLookupFailed): New method to report errors; this
21983 does the CS1540 check and reports the correct error message.
21985 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21986 argument for the CS1540 check and redone the way how we're dealing
21987 with private members. See the comment in the source code for details.
21988 (FilterWithClosure): Reverted this back to revision 1.197; renamed
21989 `closure_start_type' to `closure_qualifier_type' and check whether
21990 it's not null. It was not this filter being broken, it was just
21991 being called with the wrong arguments.
21993 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21994 and pass it the correct `qualifier_type'; this also does the error
21997 2002-11-22 Miguel de Icaza <miguel@ximian.com>
21999 * expression.cs (Invocation.EmitParams): If the we are dealing
22000 with a non-built-in value type, load its address as well.
22002 (ArrayCreation): Use a a pretty constant instead
22003 of the hardcoded value 2. Use 6 instead of 2 for the number of
22004 static initializers.
22006 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22007 because they are not really value types, just glorified integers.
22009 * driver.cs: Do not append .exe, the CSC compiler does not do it.
22011 * ecore.cs: Remove redundant code for enumerations, make them use
22012 the same code path as everything else, fixes the casting issue
22013 with enumerations in Windows.Forms.
22015 * attribute.cs: Do only cast to string if it is a string, the
22016 validation happens later.
22018 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22019 people upgrade their corlibs.
22021 * ecore.cs: Oops, enumerations were not following the entire code path
22023 2002-11-21 Miguel de Icaza <miguel@ximian.com>
22025 * typemanager.cs (FilterWithClosure): Commented out the test for
22026 1540 in typemanager.cs, as it has problems when accessing
22027 protected methods from a parent class (see test-174.cs).
22029 * attribute.cs (Attribute.ValidateGuid): new method.
22030 (Attribute.Resolve): Use above.
22032 2002-11-19 Miguel de Icaza <miguel@ximian.com>
22034 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22036 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22037 handling for enumerations, as we only needed the TypeContainer
22038 functionality to begin with (this is required for the fix below to
22039 work for enums that reference constants in a container class for
22042 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22044 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22045 a valid TypeBuilder to perform lookups on.o
22047 * class.cs (InheritableMemberSignatureCompare): Use true in the
22048 call to GetGetMethod and GetSetMethod, because we are comparing
22049 the signature, and we need to get the methods *even* if they are
22052 (PropertyBase.CheckBase): ditto.
22054 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22055 GotoCase.Resolve): Use Peel on EmpytCasts.
22057 * ecore.cs (EmptyCast): drop child, add Peel method.
22059 2002-11-17 Martin Baulig <martin@ximian.com>
22061 * ecore.cs (EmptyCast.Child): New public property.
22063 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22064 label resolved to an EmptyCast. Fixes #34162.
22065 (GotoCase.Resolve): Likewise.
22066 (Block.EmitMeta): Likewise.
22068 2002-11-17 Martin Baulig <martin@ximian.com>
22070 * expression.cs (Invocation.BetterConversion): Prefer int over
22071 uint; short over ushort; long over ulong for integer literals.
22072 Use ImplicitConversionExists instead of StandardConversionExists
22073 since we also need to check for user-defined implicit conversions.
22074 Fixes #34165. Added test-173.cs.
22076 2002-11-16 Martin Baulig <martin@ximian.com>
22078 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22079 with the `true' and `false' literals. Fixes #33151.
22081 2002-11-16 Martin Baulig <martin@ximian.com>
22083 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22084 October 22nd; don't do the cs1540 check for static members.
22086 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22087 now using our own filter here and doing the cs1540 check again.
22089 2002-11-16 Martin Baulig <martin@ximian.com>
22091 * support.cs (InternalParameters): Don't crash if we don't have
22092 any fixed parameters. Fixes #33532.
22094 2002-11-16 Martin Baulig <martin@ximian.com>
22096 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22097 when looking up static methods to make this work on Windows.
22100 2002-11-16 Martin Baulig <martin@ximian.com>
22102 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22103 a setter rather than using PropertyInfo.CanWrite.
22105 2002-11-15 Nick Drochak <ndrochak@gol.com>
22107 * class.cs: Allow acces to block member by subclasses. Fixes build
22110 2002-11-14 Martin Baulig <martin@ximian.com>
22112 * class.cs (Constructor.Emit): Added the extern/block check.
22115 2002-11-14 Martin Baulig <martin@ximian.com>
22117 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22118 iteration while looking for indexers, this is needed because the
22119 indexer may have a different name in our base classes. Fixed the
22120 error reporting (no indexers at all, not get accessor, no
22121 overloaded match). Fixes bug #33089.
22122 (IndexerAccess.DoResolveLValue): Likewise.
22124 2002-11-14 Martin Baulig <martin@ximian.com>
22126 * class.cs (PropertyBase.CheckBase): Make this work for multiple
22127 indexers. Fixes the first part of bug #33089.
22128 (MethodSignature.InheritableMemberSignatureCompare): Added support
22131 2002-11-13 Ravi Pratap <ravi@ximian.com>
22133 * attribute.cs (Attribute.Resolve): Catch the
22134 NullReferenceException and report it since it isn't supposed to
22137 2002-11-12 Miguel de Icaza <miguel@ximian.com>
22139 * expression.cs (Binary.EmitBranchable): Also handle the cases for
22140 LogicalOr and LogicalAnd that can benefit from recursively
22141 handling EmitBranchable. The code now should be nice for Paolo.
22143 2002-11-08 Miguel de Icaza <miguel@ximian.com>
22145 * typemanager.cs (LookupType): Added a negative-hit hashtable for
22146 the Type lookups, as we perform quite a number of lookups on
22147 non-Types. This can be removed once we can deterministically tell
22148 whether we have a type or a namespace in advance.
22150 But this might require special hacks from our corlib.
22154 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22155 and double which avoids a conversion from an integer to a double.
22157 * expression.cs: tiny optimization, avoid calling IsConstant,
22158 because it effectively performs the lookup twice.
22160 2002-11-06 Miguel de Icaza <miguel@ximian.com>
22162 But a bogus return here to keep the semantics of the old code
22163 until the Mono runtime is fixed.
22165 * pending.cs (GetMissingInterfaces): New method used to remove all
22166 the interfaces that are already implemented by our parent
22167 classes from the list of pending methods.
22169 * interface.cs: Add checks for calls after ResolveTypeExpr.
22171 2002-11-05 Miguel de Icaza <miguel@ximian.com>
22173 * class.cs (Class.Emit): Report warning 67: event not used if the
22174 warning level is beyond 3.
22176 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22177 being a NullLiteral.
22179 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22182 * class.cs (TypeContainer.GetClassBases): Cover a missing code
22183 path that might fail if a type can not be resolved.
22185 * expression.cs (Binary.Emit): Emit unsigned versions of the
22188 * driver.cs: use error 5.
22190 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22192 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22194 2002-11-01 Miguel de Icaza <miguel@ximian.com>
22196 * cs-parser.jay (switch_section): A beautiful patch from Martin
22197 Baulig that fixed 33094.
22199 2002-10-31 Miguel de Icaza <miguel@ximian.com>
22201 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22202 Check whether the base is abstract and report an error if so.
22204 * expression.cs (IndexerAccess.DoResolveLValue,
22205 IndexerAccess.DoResolve): ditto.
22207 (Invocation.DoResolve): ditto.
22209 (Invocation.FullMethodDesc): Improve the report string.
22211 * statement.cs (Block): Eliminate IsVariableDefined as it is
22212 basically just a wrapper for GetVariableInfo.
22214 * ecore.cs (SimpleName): Use new
22216 * support.cs (ReflectionParamter.ParameterType): We unwrap the
22217 type, as we return the actual parameter ref/unref state on a
22220 2002-10-30 Miguel de Icaza <miguel@ximian.com>
22222 * support.cs: Return proper flags REF/OUT fixing the previous
22225 * expression.cs: Reverted last patch, that was wrong. Is_ref is
22226 not used to mean `ref' but `ref or out' in ParameterReference
22228 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22229 full type signature instead of calling TypeManger.CSharpName
22232 * support.cs (InternalParameters.ParameterDesc): Do not compare
22233 directly to the modflags, because REF/OUT will actually be bitsets
22236 * delegate.cs (VerifyMethod): Check also the modifiers.
22238 * cs-tokenizer.cs: Fix bug where floating point values with an
22239 exponent where a sign was missing was ignored.
22241 * driver.cs: Allow multiple assemblies to be specified in a single
22244 2002-10-28 Miguel de Icaza <miguel@ximian.com>
22246 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
22247 because identifiers after a parenthesis would end up in this kind
22248 of production, and we needed to desamiguate it for having casts
22251 (UserDefinedType *) xxx
22253 2002-10-24 Miguel de Icaza <miguel@ximian.com>
22255 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22256 we should set on the Bindingflags.NonPublic, but not turn on
22257 private_ok. private_ok controls whether a Private member is
22258 returned (this is chekced on the filter routine), while the
22259 BindingFlags.NonPublic just controls whether private/protected
22260 will be allowed. This fixes the problem part of the problem of
22261 private properties being allowed to be used in derived classes.
22263 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22264 so we can call the children DoResolveLValue method (this will
22265 properly signal errors on lvalue assignments to base properties)
22267 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22268 getter are null, and we have a property info, we know that this
22269 happened because the lookup failed, so we report an error 122 for
22270 protection level violation.
22272 We also silently return if setter and getter are null in the
22273 resolve functions, this condition only happens if we have flagged
22274 the error before. This is the other half of the problem.
22276 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22277 not have accessibility information, that is why we were returning
22278 true in the filter function in typemanager.cs.
22280 To properly report 122 (property is inaccessible because of its
22281 protection level) correctly, we report this error in ResolveAccess
22282 by failing if both the setter and the getter are lacking (ie, the
22285 DoResolve and DoLResolve have been modified to check for both
22286 setter/getter being null and returning silently, the reason being
22287 that I did not want to put the knowledge about this error in upper
22290 int old = Report.Errors;
22291 x = new PropertyExpr (...);
22292 if (old != Report.Errors)
22297 So the property expr is returned, but it is invalid, so the error
22298 will be flagged during the resolve process.
22300 * class.cs: Remove InheritablePropertySignatureCompare from the
22301 class, as we no longer depend on the property signature to compute
22302 whether it is possible to implement a method or not.
22304 The reason is that calling PropertyInfo.GetGetMethod will return
22305 null (in .NET, in Mono it works, and we should change this), in
22306 cases where the Get Method does not exist in that particular
22311 class X { public virtual int A { get { return 1; } } }
22313 class Z : Y { public override int A { get { return 2; } } }
22315 Would fail in Z because the parent (Y) would not have the property
22316 defined. So we avoid this completely now (because the alternative
22317 fix was ugly and slow), and we now depend exclusively on the
22320 (PropertyBase.CheckBase): Use a method-base mechanism to find our
22321 reference method, instead of using the property.
22323 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22324 routines are gone now.
22326 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22327 names, they were incorrectly named.
22329 * cs-tokenizer.cs: Return are more gentle token on failure.
22331 * pending.cs (PendingImplementation.InterfaceMethod): This routine
22332 had an out-of-sync index variable, which caused it to remove from
22333 the list of pending methods the wrong method sometimes.
22335 2002-10-22 Miguel de Icaza <miguel@ximian.com>
22337 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22338 CanWrite, because those refer to this particular instance of the
22339 property, and do not take into account the fact that we can
22340 override single members of a property.
22342 Constructor requires an EmitContext. The resolution process does
22343 not happen here, but we need to compute the accessors before,
22344 because the resolution does not always happen for properties.
22346 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22347 subclass, before we did not update this flag, but we did update
22350 (GetAccessors): Drop this routine, as it did not work in the
22351 presence of partially overwritten set/get methods.
22353 Notice that this broke the cs1540 detection, but that will require
22356 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22360 * driver.cs: issue a warning instead of an error if we don't support
22361 debugging for the platform. Also ignore a couple of errors that may
22362 arise when trying to write the symbols. Undo my previous patch.
22364 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22366 * driver.cs: ignore /debug switch except for Unix platforms.
22368 2002-10-23 Nick Drochak <ndrochak@gol.com>
22370 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22372 2002-10-21 Miguel de Icaza <miguel@ximian.com>
22374 * driver.cs: Do not make mcs-debug conditional, so we do not break
22375 builds that use it.
22377 * statement.cs (UsageVector.MergeChildren): I would like Martin to
22378 review this patch. But basically after all the children variables
22379 have been merged, the value of "Breaks" was not being set to
22380 new_breaks for Switch blocks. I think that it should be set after
22381 it has executed. Currently I set this to the value of new_breaks,
22382 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22383 conservative, but I do not understand this code very well.
22385 I did not break anything in the build, so that is good ;-)
22387 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22389 2002-10-20 Mark Crichton <crichton@gimp.org>
22391 * cfold.cs: Fixed compile blocker. Really fixed it this time.
22393 2002-10-20 Nick Drochak <ndrochak@gol.com>
22395 * cfold.cs: Fixed compile blocker.
22397 2002-10-20 Miguel de Icaza <miguel@ximian.com>
22399 * driver.cs: I was chekcing the key, not the file.
22401 2002-10-19 Ravi Pratap <ravi@ximian.com>
22403 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22404 message that we were generating - we just need to silently return
22407 2002-10-19 Miguel de Icaza <miguel@ximian.com>
22409 * class.cs (Event.Define): Change my previous commit, as this
22410 breaks the debugger. This is a temporary hack, as it seems like
22411 the compiler is generating events incorrectly to begin with.
22413 * expression.cs (Binary.ResolveOperator): Added support for
22414 "U operator - (E x, E y)"
22416 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22419 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22420 init-only variables, but this path did not take into account that
22421 there might be also instance readonly variables. Correct this
22424 This fixes bug 32253
22426 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22429 * driver.cs: Change the extension for modules to `netmodule'
22431 * cs-parser.jay: Improved slightly the location tracking for
22432 the debugger symbols.
22434 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22435 modifiers that were specified instead of the hardcoded value
22436 (FamAndAssem). This was basically ignoring the static modifier,
22437 and others. Fixes 32429.
22439 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22440 fixed a bug in the process (32476)
22442 * expression.cs (ArrayAccess.EmitAssign): Patch from
22443 hwang_rob@yahoo.ca that fixes bug 31834.3
22445 2002-10-18 Miguel de Icaza <miguel@ximian.com>
22447 * driver.cs: Make the module extension .netmodule.
22449 2002-10-16 Miguel de Icaza <miguel@ximian.com>
22451 * driver.cs: Report an error if the resource file is not found
22452 instead of crashing.
22454 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22455 false, like Emit does.
22457 2002-10-16 Nick Drochak <ndrochak@gol.com>
22459 * typemanager.cs: Remove unused private member. Also reported mcs
22460 bug to report this as a warning like csc.
22462 2002-10-15 Martin Baulig <martin@gnome.org>
22464 * statement.cs (Statement.Emit): Made this a virtual method; emits
22465 the line number info and calls DoEmit().
22466 (Statement.DoEmit): New protected abstract method, formerly knows
22467 as Statement.Emit().
22469 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22471 2002-10-11 Miguel de Icaza <miguel@ximian.com>
22473 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22474 have fixed a remaining problem: not every AddXXXX was adding a
22475 fully qualified name.
22477 Now everyone registers a fully qualified name in the DeclSpace as
22478 being defined instead of the partial name.
22480 Downsides: we are slower than we need to be due to the excess
22481 copies and the names being registered this way.
22483 The reason for this is that we currently depend (on the corlib
22484 bootstrap for instance) that types are fully qualified, because
22485 we dump all the types in the namespace, and we should really have
22486 types inserted into the proper namespace, so we can only store the
22487 basenames in the defined_names array.
22489 2002-10-10 Martin Baulig <martin@gnome.org>
22491 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22492 from bug #31834, see the bug report for a testcase which is
22495 2002-10-10 Martin Baulig <martin@gnome.org>
22497 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22498 flow analysis code for this.
22500 * statement.cs (Do, While, For): Tell the flow analysis code about
22502 (FlowBranching.UsageVector): Added support for infinite loops.
22503 (Block.Resolve): Moved the dead code elimination here and use flow
22506 2002-10-09 Miguel de Icaza <miguel@ximian.com>
22508 * class.cs (Field.Define): Catch cycles on struct type
22511 * typemanager.cs (IsUnmanagedtype): Do not recursively check
22512 fields if the fields are static. We only need to check instance
22515 * expression.cs (As.DoResolve): Test for reference type.
22517 * statement.cs (Using.ResolveExpression): Use
22518 ConvertImplicitRequired, not ConvertImplicit which reports an
22520 (Using.ResolveLocalVariableDecls): ditto.
22522 * expression.cs (Binary.ResolveOperator): Report errors in a few
22523 places where we had to.
22525 * typemanager.cs (IsUnmanagedtype): Finish implementation.
22527 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22529 * expression.cs: Use StoreFromPtr instead of extracting the type
22530 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22532 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22533 an enumeration value to a System.Enum, but System.Enum is not a
22534 value type, but an class type, so we need to box.
22536 (Expression.ConvertExplicit): One codepath could return
22537 errors but not flag them. Fix this. Fixes #31853
22539 * parameter.cs (Resolve): Do not allow void as a parameter type.
22541 2002-10-06 Martin Baulig <martin@gnome.org>
22543 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22544 if it's a class type and not a struct. Fixes #31815.
22546 2002-10-06 Martin Baulig <martin@gnome.org>
22548 * statement.cs: Reworked the flow analysis code a bit to make it
22549 usable for dead code elimination.
22551 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22553 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22555 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22557 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22558 to fix the test 165, will investigate deeper.
22560 2002-10-04 Martin Baulig <martin@gnome.org>
22562 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22563 finally blocks actually work.
22564 (Try.Resolve): We don't need to create a sibling for `finally' if
22565 there is no finally block.
22567 2002-10-04 Martin Baulig <martin@gnome.org>
22569 * class.cs (Constructor.Define): The default accessibility for a
22570 non-default constructor is private, not public.
22572 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22574 * class.cs (Constructor): Make AllowedModifiers public, add
22577 * cs-parser.jay: Perform the modifiers test here, as the
22578 constructor for the Constructor class usually receives a zero
22579 because of the way we create it (first we create, later we
22580 customize, and we were never checking the modifiers).
22582 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22583 is a version of LookupTypeReflection that includes the type-name
22584 cache. This can be used as a fast path for functions that know
22585 the fully qualified name and are only calling into *.GetType() to
22586 obtain a composed type.
22588 This is also used by TypeManager.LookupType during its type
22591 (LookupType): We now also track the real type name, as sometimes
22592 we can get a quey for the real type name from things like
22593 ComposedCast. This fixes bug 31422.
22595 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22596 complete type fullname, it does not have to go through the type
22597 resolution system to obtain the composed version of the type (for
22598 obtaining arrays or pointers).
22600 (Conditional.Emit): Use the EmitBoolExpression to
22601 generate nicer code, as requested by Paolo.
22603 (ArrayCreation.CheckIndices): Use the patch from
22604 hwang_rob@yahoo.ca to validate the array initializers.
22606 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22608 * class.cs (ConstructorInitializer.Emit): simplify code by using
22609 Invocation.EmitCall, and at the same time, fix the bugs in calling
22610 parent constructors that took variable arguments.
22612 * ecore.cs (Expression.ConvertNumericExplicit,
22613 Expression.ImplicitNumericConversion): Remove the code that
22614 manually wrapped decimal (InternalTypeConstructor call is now gone
22617 * expression.cs (Cast.TryReduce): Also handle decimal types when
22618 trying to perform a constant fold on the type.
22620 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22622 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22623 that only turned off an error report, and did nothing else.
22625 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22627 * driver.cs: Handle and ignore /fullpaths
22629 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22631 * expression.cs (Binary.ResolveOperator): Catch the case where
22632 DoNumericPromotions returns true,
22634 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22636 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22638 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22641 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22643 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22644 conversion exists, but it is also required that the conversion be
22645 performed. This manifested in "(Type64Enum) 2".
22647 * class.cs (TypeManager.AddMethod): The fix is not to change
22648 AddEnum, because that one was using a fully qualified name (every
22649 DeclSpace derivative does), but to change the AddMethod routine
22650 that was using an un-namespaced name. This now correctly reports
22651 the duplicated name.
22653 Revert patch until I can properly fix it. The issue
22654 is that we have a shared Type space across all namespaces
22655 currently, which is wrong.
22657 Options include making the Namespace a DeclSpace, and merge
22658 current_namespace/current_container in the parser.
22660 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22662 * cs-parser.jay: Improve error reporting when we get a different
22663 kind of expression in local_variable_type and
22664 local_variable_pointer_type.
22666 Propagate this to avoid missleading errors being reported.
22668 * ecore.cs (ImplicitReferenceConversion): treat
22669 TypeManager.value_type as a target just like object_type. As
22674 Is valid, and needs to result in the int 1 being boxed before it
22675 is assigned to the value type v.
22677 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22678 to validate the enumeration name.
22680 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22681 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22682 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22684 * ecore.cs (TryImplicitIntConversion): When doing an
22685 implicit-enumeration-conversion, check if the type is 64-bits and
22686 perform a conversion before passing to EnumConstant.
22688 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22690 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22691 report ambiguous type references. Unlike the MS version, we
22692 report what the ambiguity is. Innovation at work ;-)
22694 (DeclSpace.FindType): Require a location argument to
22695 display when we display an ambiguous error.
22697 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22699 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22701 * expression.cs (EmitDynamicInitializers): Apply patch from
22702 hwang_rob@yahoo.ca that fixes the order in which we emit our
22705 2002-09-21 Martin Baulig <martin@gnome.org>
22707 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22708 delegate takes no arguments.
22710 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22712 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22715 * expression.cs: Extract the underlying type.
22717 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22719 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22721 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22723 * class.cs (TypeContainer.DefineType): We can not use the nice
22724 PackingSize with the size set to 1 DefineType method, because it
22725 will not allow us to define the interfaces that the struct
22728 This completes the fixing of bug 27287
22730 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22731 means also structs. This fixes part of the problem.
22732 (Expresion.ImplicitReferenceConversionExists): ditto.
22734 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22735 error if there were no errors reported during the type lookup
22736 process, to avoid duplicates or redundant errors. Without this
22737 you would get an ambiguous errors plus a type not found. We have
22738 beaten the user enough with the first error.
22740 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22743 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22744 during the resolution process, stop the lookup, this avoids
22745 repeated error reports (same error twice).
22747 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22749 * typemanager.cs (LookupType): Redo the type lookup code to match
22750 the needs of System.Reflection.
22752 The issue is that System.Reflection requires references to nested
22753 types to begin with a "+" sign instead of a dot. So toplevel
22754 types look like: "NameSpace.TopLevelClass", and nested ones look
22755 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22758 2002-09-19 Martin Baulig <martin@gnome.org>
22760 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22761 says that a method always returns or always throws an exception,
22762 don't report the CS0161.
22764 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22765 set `Returns = new_returns'.
22767 2002-09-19 Martin Baulig <martin@gnome.org>
22769 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22770 to an enum constant, check for a CS0176.
22772 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22774 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22775 for operators that must be in pairs and report errors.
22777 * ecore.cs (SimpleName.DoResolveType): During the initial type
22778 resolution process, when we define types recursively, we must
22779 check first for types in our current scope before we perform
22780 lookups in the enclosing scopes.
22782 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22784 (Invocation.VerifyArgumentsCompat): Call
22785 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22786 I thought we were supposed to always call this, but there are a
22787 few places in the code where we dont do it.
22789 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22791 * driver.cs: Add support in -linkres and -resource to specify the
22792 name of the identifier.
22794 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22796 * ecore.cs (StandardConversionExists): Sync with the conversion
22797 code: allow anything-* to void* conversions.
22799 (FindMostSpecificSource): Use an Expression argument
22800 instead of a Type, because we might be handed over a Literal which
22801 gets a few more implicit conversions that plain types do not. So
22802 this information was being lost.
22804 Also, we drop the temporary type-holder expression when not
22807 2002-09-17 Martin Baulig <martin@gnome.org>
22809 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22810 this is an explicit interface implementation.
22812 2002-09-17 Martin Baulig <martin@gnome.org>
22814 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22815 different `IndexerName' attributes.
22817 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22818 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22819 virtual CommonResolve().
22821 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22823 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22824 and convert that to the UnderlyingType.
22826 * statement.cs (Foreach.Resolve): Indexers are just like variables
22827 or PropertyAccesses.
22829 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22830 inside quoted strings, we were not doing this before.
22832 2002-09-16 Martin Baulig <martin@gnome.org>
22834 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22835 resolve it. This is needed for the definite assignment check of the
22836 instance expression, fixes bug #29846.
22837 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22839 2002-09-16 Nick Drochak <ndrochak@gol.com>
22841 * parameter.cs: Fix compile error. Cannot reference static member
22842 from an instance object. Is this an mcs bug?
22844 2002-09-14 Martin Baulig <martin@gnome.org>
22846 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22847 multiple times. Fixes bug #30295, added test-166.cs.
22849 2002-09-14 Martin Baulig <martin@gnome.org>
22851 * statement.cs (Block.Emit): Don't emit unreachable code.
22852 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22853 `break' statements.
22854 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22856 2002-09-14 Martin Baulig <martin@gnome.org>
22858 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22861 2002-09-14 Martin Baulig <martin@gnome.org>
22863 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22864 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22865 be false on the ms runtime.
22867 2002-09-13 Martin Baulig <martin@gnome.org>
22869 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22870 the CS0038 error message.
22872 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22874 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22875 constant inside, return it.
22877 2002-09-12 Martin Baulig <martin@gnome.org>
22879 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22880 implicit conversion can be done between enum types.
22882 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22883 check whether an implicit conversion to the current enum's UnderlyingType
22884 exists and report an error if not.
22886 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22887 without debugging support.
22889 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22890 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22892 2002-09-12 Martin Baulig <martin@gnome.org>
22894 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22896 * ecore.cs (IMemberExpr.DeclaringType): New property.
22897 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22898 nonstatic member of an outer type (CS0038).
22900 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22902 * driver.cs: Activate the using-error detector at warning level
22903 4 (at least for MS-compatible APIs).
22905 * namespace.cs (VerifyUsing): Small buglett fix.
22907 * pending.cs (PendingImplementation): pass the container pointer.
22909 * interface.cs (GetMethods): Allow for recursive definition. Long
22910 term, I would like to move every type to support recursive
22911 definitions, not the current ordering mechanism that we have right
22914 The situation is this: Attributes are handled before interfaces,
22915 so we can apply attributes to interfaces. But some attributes
22916 implement interfaces, we will now handle the simple cases
22917 (recursive definitions will just get an error).
22919 * parameter.cs: Only invalidate types at the end if we fail to
22922 2002-09-09 Martin Baulig <martin@gnome.org>
22924 * ecore.cs (PropertyExpr.Emit): Also check for
22925 TypeManager.system_int_array_get_length so this'll also work when
22926 compiling corlib. Fixes #30003.
22928 2002-09-09 Martin Baulig <martin@gnome.org>
22930 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22931 and throw an exception if we can't get the type's size. Fixed #30040,
22934 2002-09-09 Martin Baulig <martin@gnome.org>
22936 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22938 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22939 context. Fixes bug #30027.
22941 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22942 virtual functions. Fixes bug #30043, added test-164.cs.
22944 2002-09-08 Ravi Pratap <ravi@ximian.com>
22946 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22948 2002-09-08 Nick Drochak <ndrochak@gol.com>
22950 * driver.cs: Use an object to get the windows codepage since it's not a
22953 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22955 * statement.cs (For.Emit): for infinite loops (test == null)
22956 return whether there is a break inside, not always "true".
22958 * namespace.cs (UsingEntry): New struct to hold the name of the
22959 using definition, the location where it is defined, and whether it
22960 has been used in a successful type lookup.
22962 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22967 2002-09-06 Ravi Pratap <ravi@ximian.com>
22969 * attribute.cs : Fix incorrect code which relied on catching
22970 a NullReferenceException to detect a null being passed in
22971 where an object was expected.
22973 2002-09-06 Miguel de Icaza <miguel@ximian.com>
22975 * statement.cs (Try): flag the catch variable as assigned
22977 * expression.cs (Cast): Simplified by using ResolveType instead of
22978 manually resolving.
22980 * statement.cs (Catch): Fix bug by using ResolveType.
22982 2002-09-06 Ravi Pratap <ravi@ximian.com>
22984 * expression.cs (BetterConversion): Special case for when we have
22985 a NullLiteral as the argument and we have to choose between string
22986 and object types - we choose string the way csc does.
22988 * attribute.cs (Attribute.Resolve): Catch the
22989 NullReferenceException and report error #182 since the Mono
22990 runtime no more has the bug and having this exception raised means
22991 we tried to select a constructor which takes an object and is
22994 2002-09-05 Ravi Pratap <ravi@ximian.com>
22996 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22997 message (1502, 1503) when we can't locate a method after overload
22998 resolution. This is much more informative and closes the bug
23001 * interface.cs (PopulateMethod): Return if there are no argument
23002 types. Fixes a NullReferenceException bug.
23004 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23005 expressions too. Previously we were checking only in one place for
23006 positional arguments leaving out named arguments.
23008 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23009 type to the enum type is not allowed. Remove code corresponding to
23012 (ConvertNumericExplicit): Allow explicit conversions from
23013 the underlying type to enum type. This precisely follows the spec
23014 and closes a bug filed by Gonzalo.
23016 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23019 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23021 2002-09-03 Miguel de Icaza <miguel@ximian.com>
23023 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23024 it was important that we stored the right value after the
23025 reduction in `converted'.
23027 2002-09-04 Martin Baulig <martin@gnome.org>
23029 * location.cs (Location.SymbolDocument): Use full pathnames for the
23032 2002-08-30 Miguel de Icaza <miguel@ximian.com>
23034 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23035 of the expression resolve mechanism, because that will catch the
23036 SimpleName error failures.
23038 (Conditional): If we can not resolve the
23039 expression, return, do not crash.
23041 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23044 (location): display token name instead of its number.
23046 2002-08-28 Martin Baulig <martin@gnome.org>
23048 * expression.cs (Binary.ResolveOperator): Don't silently return
23049 but return an error if an operator cannot be applied between two
23052 2002-08-28 Martin Baulig <martin@gnome.org>
23054 * class.cs (Constructor.Define): Set the permission attributes
23055 correctly instead of making all constructors public.
23057 2002-08-28 Martin Baulig <martin@gnome.org>
23059 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23060 for private members before reporting a CS0103; if we find anything,
23063 2002-08-28 Martin Baulig <martin@gnome.org>
23065 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23066 to check whether `closure_start_type == closure_invocation_type',
23067 we also need to check whether `m.DeclaringType == closure_invocation_type'
23068 before bypassing the permission checks. We might be accessing
23069 protected/private members from the base class.
23070 (TypeManager.RealMemberLookup): Only set private_ok if private
23071 members were requested via BindingFlags.NonPublic.
23073 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23075 * expression.cs (MemberAccess.ResolveMemberAccess): Set
23076 MethodGroupExpr.IsExplicitImpl if appropriate.
23077 (Invocation.DoResolve): Don't report the CS0120 for explicit
23078 interface implementations.
23080 2002-08-27 Martin Baulig <martin@gnome.org>
23082 * expression.cs (Invocation.DoResolve): If this is a static
23083 method and we don't have an InstanceExpression, we must report
23086 2002-08-25 Martin Baulig <martin@gnome.org>
23088 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23089 `==' between a valuetype and an object.
23091 2002-08-25 Miguel de Icaza <miguel@ximian.com>
23093 * ecore.cs (TypeExpr): Provide a ToString method.
23095 2002-08-24 Martin Baulig <martin@gnome.org>
23097 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23098 now called proggie.dbg and it's a binary file.
23100 2002-08-23 Martin Baulig <martin@gnome.org>
23102 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23104 2002-08-23 Martin Baulig <martin@gnome.org>
23106 * struct.cs (MyStructInfo.ctor): Make this work with empty
23107 structs; it's not allowed to use foreach() on null.
23109 2002-08-23 Martin Baulig <martin@gnome.org>
23111 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23112 writer the full pathname of the generated assembly.
23114 2002-08-23 Martin Baulig <martin@gnome.org>
23116 * statements.cs (FlowBranching.UsageVector.MergeChildren):
23117 A `finally' block never returns or breaks; improved handling of
23120 2002-08-23 Martin Baulig <martin@gnome.org>
23122 * statement.cs (Throw.Resolve): Allow `throw null'.
23124 2002-08-23 Martin Baulig <martin@gnome.org>
23126 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23127 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23128 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
23129 MemberLookup would return a wrong event if this is an explicit
23130 interface implementation and the class has an event with the same
23133 2002-08-23 Martin Baulig <martin@gnome.org>
23135 * statement.cs (Block.AddChildVariableNames): New public method.
23136 (Block.AddChildVariableName): Likewise.
23137 (Block.IsVariableNameUsedInChildBlock): Likewise.
23138 (Block.AddVariable): Check whether a variable name has already
23139 been used in a child block.
23141 * cs-parser.jay (declare_local_variables): Mark all variable names
23142 from the current block as being used in a child block in the
23145 2002-08-23 Martin Baulig <martin@gnome.org>
23147 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23148 find the symbol writer.
23150 * driver.cs: csc also allows the arguments to /define being
23151 separated by commas, not only by semicolons.
23153 2002-08-23 Martin Baulig <martin@gnome.org>
23155 * interface.cs (Interface.GetMembers): Added static check for events.
23157 2002-08-15 Martin Baulig <martin@gnome.org>
23159 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23160 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23162 * ecore.cs (Expression.MemberLookup): Added documentation and explained
23163 why the MethodData.EmitDestructor() change was necessary.
23165 2002-08-20 Martin Baulig <martin@gnome.org>
23167 * class.cs (TypeContainer.FindMembers): Added static check for events.
23169 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23171 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23172 use Type.GetEvents(), not Type.FindMembers().
23174 2002-08-20 Martin Baulig <martin@gnome.org>
23176 * decl.cs (MemberCache): Added a special method cache which will
23177 be used for method-only searched. This ensures that a method
23178 search will return a MethodInfo with the correct ReflectedType for
23181 2002-08-20 Martin Baulig <martin@gnome.org>
23183 * decl.cs (DeclSpace.FindMembers): Made this public.
23185 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23187 * delegate.cs: fixed build on windows.
23188 [FIXME: Filed as bug #29150: MCS must report these errors.]
23190 2002-08-19 Ravi Pratap <ravi@ximian.com>
23192 * ecore.cs (StandardConversionExists): Return a false
23193 if we are trying to convert the void type to anything else
23194 since that is not allowed.
23196 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23197 we flag error 70 in the event an event is trying to be accessed
23198 directly from outside the declaring type.
23200 2002-08-20 Martin Baulig <martin@gnome.org>
23202 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23203 MemberCache from typemanager.cs to decl.cs.
23205 2002-08-19 Martin Baulig <martin@gnome.org>
23207 * class.cs (TypeContainer): Implement IMemberContainer.
23208 (TypeContainer.DefineMembers): Create the MemberCache.
23209 (TypeContainer.FindMembers): Do better BindingFlags checking; only
23210 return public members if BindingFlags.Public was given, check
23211 whether members are static.
23213 2002-08-16 Martin Baulig <martin@gnome.org>
23215 * decl.cs (DeclSpace.Define): Splitted this in Define and
23216 DefineMembers. DefineMembers is called first and initializes the
23219 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
23220 DefineMembers() on all our DeclSpaces.
23222 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23223 but call DefineMembers() on all nested interfaces. We call their
23224 Define() in our new Define() function.
23226 * interface.cs (Interface): Implement IMemberContainer.
23227 (Interface.Define): Moved all code except the attribute stuf to
23229 (Interface.DefineMembers): Initialize the member cache.
23231 * typemanager.cs (IMemberFinder): Removed this interface, we don't
23232 need this anymore since we can use MemberCache.FindMembers directly.
23234 2002-08-19 Martin Baulig <martin@gnome.org>
23236 * typemanager.cs (MemberCache): When creating the cache for an
23237 interface type, add all inherited members.
23238 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23239 to `out bool used_cache' and documented it.
23240 (TypeManager.MemberLookup): If we already used the cache in the first
23241 iteration, we don't need to do the interfaces check.
23243 2002-08-19 Martin Baulig <martin@gnome.org>
23245 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
23246 here from IMemberFinder and don't implement this interface anymore.
23247 (DeclSpace.MemberCache): Moved here from IMemberFinder.
23249 * typemanager.cs (IMemberFinder): This interface is now only used by
23250 classes which actually support the member cache.
23251 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23252 since we only put DeclSpaces into this Hashtable.
23253 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23254 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23256 2002-08-16 Martin Baulig <martin@gnome.org>
23258 * typemanager.cs (ICachingMemberFinder): Removed.
23259 (IMemberFinder.MemberCache): New property.
23260 (TypeManager.FindMembers): Merged this with RealFindMembers().
23261 This function will never be called from TypeManager.MemberLookup()
23262 so we can't use the cache here, just the IMemberFinder.
23263 (TypeManager.MemberLookup_FindMembers): Check whether the
23264 IMemberFinder has a MemberCache and call the cache's FindMembers
23266 (MemberCache): Rewrote larger parts of this yet another time and
23267 cleaned it up a bit.
23269 2002-08-15 Miguel de Icaza <miguel@ximian.com>
23271 * driver.cs (LoadArgs): Support quoting.
23273 (Usage): Show the CSC-like command line arguments.
23275 Improved a few error messages.
23277 2002-08-15 Martin Baulig <martin@gnome.org>
23279 * typemanager.cs (IMemberContainer.Type): New property.
23280 (IMemberContainer.IsInterface): New property.
23282 The following changes are conditional to BROKEN_RUNTIME, which is
23283 defined at the top of the file.
23285 * typemanager.cs (MemberCache.MemberCache): Don't add the base
23286 class'es members, but add all members from TypeHandle.ObjectType
23287 if we're an interface.
23288 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23289 is the current type.
23290 (MemberCache.CacheEntry.Container): Removed this field.
23291 (TypeHandle.GetMembers): Include inherited members.
23293 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23295 * typemanager.cs: fixed compilation and added a comment on a field that
23298 2002-08-15 Martin Baulig <martin@gnome.org>
23300 * class.cs (ConstructorInitializer.Resolve): In the
23301 Expression.MemberLookup call, use the queried_type as
23304 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23305 declared' attribute, it's always true.
23306 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23307 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23308 temporary wrapper for FindMembers which tells MemberLookup whether
23309 members from the base classes are included in the return value.
23310 This will go away soon.
23311 (TypeManager.MemberLookup): Use this temporary hack here; once the
23312 new MemberCache is completed, we don't need to do the DeclaredOnly
23313 looping here anymore since the MemberCache will take care of this.
23314 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23315 (MemberCache): When creating the MemberCache for a class, get
23316 members from the current class and all its base classes.
23317 (MemberCache.CacheEntry.Container): New field. This is a
23318 temporary hack until the Mono runtime is fixed to distinguish
23319 between ReflectedType and DeclaringType. It allows us to use MCS
23320 with both the MS runtime and the unfixed Mono runtime without
23321 problems and without accecting performance.
23322 (MemberCache.SearchMembers): The DeclaredOnly looping from
23323 TypeManager.MemberLookup is now done here.
23325 2002-08-14 Martin Baulig <martin@gnome.org>
23327 * statement.cs (MyStructInfo.MyStructInfo): Don't call
23328 Type.GetFields on dynamic types but get the fields from the
23329 corresponding TypeContainer.
23330 (MyStructInfo.GetStructInfo): Added check for enum types.
23332 * typemanager.cs (MemberList.IsSynchronized): Implemented.
23333 (MemberList.SyncRoot): Implemented.
23334 (TypeManager.FilterWithClosure): No need to check permissions if
23335 closure_start_type == closure_invocation_type, don't crash if
23336 closure_invocation_type is null.
23338 2002-08-13 Martin Baulig <martin@gnome.org>
23340 Rewrote TypeContainer.FindMembers to use a member cache. This
23341 gives us a speed increase of about 35% for the self-hosting MCS
23342 build and of about 15-20% for the class libs (both on GNU/Linux).
23344 * report.cs (Timer): New class to get enhanced profiling. This
23345 whole class is "TIMER" conditional since it remarkably slows down
23348 * class.cs (MemberList): New class. This is an IList wrapper
23349 which we're now using instead of passing MemberInfo[]'s around to
23350 avoid copying this array unnecessarily.
23351 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23352 (ICachingMemberFinder, IMemberContainer): New interface.
23353 (TypeManager.FilterWithClosure): If `criteria' is null, the name
23354 has already been checked, otherwise use it for the name comparision.
23355 (TypeManager.FindMembers): Renamed to RealMemberFinder and
23356 provided wrapper which tries to use ICachingMemberFinder.FindMembers
23357 if possible. Returns a MemberList, not a MemberInfo [].
23358 (TypeHandle): New class, implements IMemberContainer. We create
23359 one instance of this class per type, it contains a MemberCache
23360 which is used to do the member lookups.
23361 (MemberCache): New class. Each instance of this class contains
23362 all members of a type and a name-based hash table.
23363 (MemberCache.FindMembers): This is our new member lookup
23364 function. First, it looks up all members of the requested name in
23365 the hash table. Then, it walks this list and sorts out all
23366 applicable members and returns them.
23368 2002-08-13 Martin Baulig <martin@gnome.org>
23370 In addition to a nice code cleanup, this gives us a performance
23371 increase of about 1.4% on GNU/Linux - not much, but it's already
23372 half a second for the self-hosting MCS compilation.
23374 * typemanager.cs (IMemberFinder): New interface. It is used by
23375 TypeManager.FindMembers to call FindMembers on a TypeContainer,
23376 Enum, Delegate or Interface.
23377 (TypeManager.finder_to_member_finder): New PtrHashtable.
23378 (TypeManager.finder_to_container): Removed.
23379 (TypeManager.finder_to_delegate): Removed.
23380 (TypeManager.finder_to_interface): Removed.
23381 (TypeManager.finder_to_enum): Removed.
23383 * interface.cs (Interface): Implement IMemberFinder.
23385 * delegate.cs (Delegate): Implement IMemberFinder.
23387 * enum.cs (Enum): Implement IMemberFinder.
23389 * class.cs (TypeContainer): Implement IMemberFinder.
23391 2002-08-12 Martin Baulig <martin@gnome.org>
23393 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23395 2002-08-12 Martin Baulig <martin@gnome.org>
23397 * ecore.cs (ITypeExpression): New interface for expressions which
23399 (TypeExpression): Renamed to TypeLookupExpression.
23400 (Expression.DoResolve): If we're doing a types-only lookup, the
23401 expression must implement the ITypeExpression interface and we
23402 call DoResolveType() on it.
23403 (SimpleName): Implement the new ITypeExpression interface.
23404 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23405 hack, the situation that we're only looking up types can't happen
23406 anymore when this method is called. Moved the type lookup code to
23407 DoResolveType() and call it.
23408 (SimpleName.DoResolveType): This ITypeExpression interface method
23409 is now doing the types-only lookup.
23410 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23411 (ResolveFlags): Added MaskExprClass.
23413 * expression.cs (MemberAccess): Implement the ITypeExpression
23415 (MemberAccess.DoResolve): Added support for a types-only lookup
23416 when we're called via ITypeExpression.DoResolveType().
23417 (ComposedCast): Implement the ITypeExpression interface.
23419 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
23420 Expression.Resolve() with ResolveFlags.Type instead.
23422 2002-08-12 Martin Baulig <martin@gnome.org>
23424 * interface.cs (Interface.Define): Apply attributes.
23426 * attribute.cs (Attribute.ApplyAttributes): Added support for
23427 interface attributes.
23429 2002-08-11 Martin Baulig <martin@gnome.org>
23431 * statement.cs (Block.Emit): Only check the "this" variable if we
23432 do not always throw an exception.
23434 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23435 whether the property has a set accessor.
23437 2002-08-11 Martin Baulig <martin@gnome.org>
23439 Added control flow analysis support for structs.
23441 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23442 with control flow analysis turned off.
23443 (IVariable): New interface.
23444 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23445 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23446 (FieldExpr.DoResolve): Resolve the instance expression with flow
23447 analysis turned off and do the definite assignment check after the
23448 resolving when we know what the expression will resolve to.
23450 * expression.cs (LocalVariableReference, ParameterReference):
23451 Implement the new IVariable interface, only call the flow analysis
23452 code if ec.DoFlowAnalysis is true.
23453 (This): Added constructor which takes a Block argument. Implement
23454 the new IVariable interface.
23455 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23456 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23457 This does the definite assignment checks for struct members.
23459 * class.cs (Constructor.Emit): If this is a non-static `struct'
23460 constructor which doesn't have any initializer, call
23461 Block.AddThisVariable() to tell the flow analysis code that all
23462 struct elements must be initialized before control returns from
23465 * statement.cs (MyStructInfo): New public class.
23466 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23467 argument to this indexer. If non-zero, check an individual struct
23468 member, not the whole struct.
23469 (FlowBranching.CheckOutParameters): Check struct members.
23470 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23471 overloaded versions of these methods which take an additional
23472 `int field_idx' argument to check struct members.
23473 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23474 overloaded versions of these methods which take an additional
23475 `string field_name' argument to check struct member.s
23476 (VariableInfo): Implement the IVariable interface.
23477 (VariableInfo.StructInfo): New public property. Returns the
23478 MyStructInfo instance of the variable if it's a struct or null.
23479 (Block.AddThisVariable): New public method. This is called from
23480 Constructor.Emit() for non-static `struct' constructor which do
23481 not have any initializer. It creates a special variable for the
23482 "this" instance variable which will be checked by the flow
23483 analysis code to ensure that all of the struct's fields are
23484 initialized before control returns from the constructor.
23485 (UsageVector): Added support for struct members. If a
23486 variable/parameter is a struct with N members, we reserve a slot
23487 in the usage vector for each member. A struct is considered fully
23488 initialized if either the struct itself (slot 0) or all its
23489 members are initialized.
23491 2002-08-08 Martin Baulig <martin@gnome.org>
23493 * driver.cs (Driver.MainDriver): Only report an error CS5001
23494 if there were no compilation errors.
23496 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23497 `UnsafeContext' property to determine whether the parent is in
23498 unsafe context rather than checking the parent's ModFlags:
23499 classes nested in an unsafe class are unsafe as well.
23501 2002-08-08 Martin Baulig <martin@gnome.org>
23503 * statement.cs (UsageVector.MergeChildren): Distinguish between
23504 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23505 we return. Added test17() and test18() to test-154.cs.
23507 2002-08-08 Martin Baulig <martin@gnome.org>
23509 * typemanager.cs (TypeManager.FilterWithClosure): If we have
23510 Family access, make sure the invoking type isn't a subclass of the
23511 queried type (that'd be a CS1540).
23513 * ecore.cs (Expression.MemberLookup): Added overloaded version of
23514 this method which takes an additional `Type invocation_type'.
23516 * expression.cs (BaseAccess.DoResolve): Use the base type as
23517 invocation and query type.
23518 (MemberAccess.DoResolve): If the lookup failed and we're about to
23519 report a CS0122, try a lookup with the ec.ContainerType - if this
23520 succeeds, we must report a CS1540.
23522 2002-08-08 Martin Baulig <martin@gnome.org>
23524 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23525 (MethodGroupExpr): Implement the IMemberExpr interface.
23527 * expression (MemberAccess.ResolveMemberAccess): No need to have
23528 any special code for MethodGroupExprs anymore, they're now
23531 2002-08-08 Martin Baulig <martin@gnome.org>
23533 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23534 Family, FamANDAssem and FamORAssem permissions.
23535 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23537 2002-08-08 Martin Baulig <martin@gnome.org>
23539 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23540 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23543 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23545 * driver.cs: implemented /resource option to embed managed resources.
23547 2002-08-07 Martin Baulig <martin@gnome.org>
23549 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23550 (FieldBase.HasFieldInitializer): New public property.
23551 (FieldBase.GetInitializerExpression): New public method. Resolves and
23552 returns the field initializer and makes sure it is only resolved once.
23553 (TypeContainer.EmitFieldInitializers): Call
23554 FieldBase.GetInitializerExpression to get the initializer, this ensures
23555 that it isn't resolved multiple times.
23557 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23558 the resolving process (SimpleName/MemberLookup) that we're currently
23559 emitting a field initializer (which must not access any instance members,
23560 this is an error CS0236).
23562 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23563 argument, if the `IsFieldInitializer' flag is set, we must report and
23564 error CS0236 and not an error CS0120.
23566 2002-08-07 Martin Baulig <martin@gnome.org>
23568 * ecore.cs (IMemberExpr): New public interface.
23569 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23570 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23571 if the expression is an IMemberExpr.
23573 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23574 to be null, implicitly default to `this' if we're non-static in
23575 this case. Simplified the code a lot by using the new IMemberExpr
23576 interface. Also fixed bug #28176 here.
23578 2002-08-06 Martin Baulig <martin@gnome.org>
23580 * cs-parser.jay (SimpleLookup): Removed. We need to create
23581 ParameterReferences during semantic analysis so that we can do a
23582 type-only search when resolving Cast, TypeOf and SizeOf.
23583 (block): Pass the `current_local_parameters' to the Block's
23586 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23587 argument to the constructor.
23588 (ConstructorInitializer.Resolve): Create a temporary implicit
23589 block with the parameters.
23591 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23592 references here if we aren't doing a type-only search.
23594 * statement.cs (Block): Added constructor which takes a
23595 `Parameters parameters' argument.
23596 (Block.Parameters): New public property.
23598 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23599 to `Parameters' and made it public readonly.
23601 2002-08-06 Martin Baulig <martin@gnome.org>
23603 * ecore.cs (Expression.Warning): Made this public as well.
23605 * report.cs (Report.Debug): Print the contents of collections.
23607 2002-08-06 Martin Baulig <martin@gnome.org>
23609 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23610 used to tell Resolve() which kinds of expressions it may return.
23611 (Expression.Resolve): Added overloaded version of this method which
23612 takes a `ResolveFlags flags' argument. This can be used to tell
23613 Resolve() which kinds of expressions it may return. Reports a
23615 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23616 ResolveFlags.SimpleName.
23617 (Expression.Error118): Added overloaded version of this method which
23618 takes a `ResolveFlags flags' argument. It uses the flags to determine
23619 which kinds of expressions are allowed.
23621 * expression.cs (Argument.ResolveMethodGroup): New public method.
23622 Resolves an argument, but allows a MethodGroup to be returned.
23623 This is used when invoking a delegate.
23625 * TODO: Updated a bit.
23627 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23629 Fixed compilation with csc.
23631 * ecore.cs: Expression.Error made public. Is this correct? Should
23632 Warning be made public too?
23634 * expression.cs: use ea.Location instead of ea.loc.
23635 [FIXME: Filed as bug #28607: MCS must report these errors.]
23637 2002-08-06 Martin Baulig <martin@gnome.org>
23639 * ecore.cs (Expression.loc): Moved the location here instead of
23640 duplicating it in all derived classes.
23641 (Expression.Location): New public property.
23642 (Expression.Error, Expression.Warning): Made them non-static and
23643 removed the location argument.
23644 (Expression.Warning): Added overloaded version which takes an
23645 `int level' argument.
23646 (Expression.Error118): Make this non-static and removed the
23647 expression and location arguments.
23648 (TypeExpr): Added location argument to the constructor.
23650 * expression.cs (StaticCallExpr): Added location argument to
23652 (Indirection, PointerArithmetic): Likewise.
23653 (CheckedExpr, UnCheckedExpr): Likewise.
23654 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23655 (StringPtr): Likewise.
23658 2002-08-05 Martin Baulig <martin@gnome.org>
23660 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23662 * assign.cs (Assign.DoResolve): Check whether the source
23663 expression is a value or variable.
23665 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23666 while resolving the corresponding blocks.
23668 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23669 an error, don't silently return null.
23671 * statement.cs (Block.AddVariable): Do the error reporting here
23672 and distinguish between CS0128 and CS0136.
23673 (Block.DoResolve): Report all unused labels (warning CS0164).
23674 (LabeledStatement): Pass the location to the constructor.
23675 (LabeledStatement.HasBeenReferenced): New property.
23676 (LabeledStatement.Resolve): Set it to true here.
23678 * statement.cs (Return.Emit): Return success even after reporting
23679 a type mismatch error (CS0126 or CS0127), this is what csc does and
23680 it avoids confusing the users with any consecutive errors.
23682 2002-08-05 Martin Baulig <martin@gnome.org>
23684 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23686 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23688 * expression.cs (MemberAccess.DoResolve): Silently return if an
23689 error has already been reported.
23691 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23692 error has already been reported.
23694 2002-08-05 Martin Baulig <martin@gnome.org>
23696 * statement.cs (UsageVector): Only initialize the `parameters'
23697 vector if we actually have any "out" parameters.
23699 2002-08-05 Martin Baulig <martin@gnome.org>
23701 * expression.cs (Binary.ResolveOperator): When combining delegates,
23702 they must have the same type.
23704 2002-08-05 Martin Baulig <martin@gnome.org>
23706 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23707 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23708 work with the ms runtime and we also don't need it: if we're a
23709 PropertyBuilder and not in the `indexer_arguments' hash, then we
23710 are a property and not an indexer.
23712 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23713 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23714 since the latter one doesn't work with the ms runtime.
23716 2002-08-03 Martin Baulig <martin@gnome.org>
23718 Fixed bugs #27998 and #22735.
23720 * class.cs (Method.IsOperator): New public field.
23721 (Method.CheckBase): Report CS0111 if there's already a method
23722 with the same parameters in the current class. Report CS0508 when
23723 attempting to change the return type of an inherited method.
23724 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23725 and it's not marked abstract or extern.
23726 (PropertyBase): New abstract base class for Property and Indexer.
23727 (PropertyBase.CheckBase): Moved here from Property and made it work
23729 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23730 the same so we can reuse it there.
23731 (Property, Indexer): Derive from PropertyBase.
23732 (MethodSignature.inheritable_property_signature_filter): New delegate
23733 to find properties and indexers.
23735 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23736 argument and improved error reporting.
23738 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23739 EmptyReadOnlyParameters and made it a property.
23741 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23742 version of this method which takes a `PropertyInfo indexer'.
23743 (TypeManager.RegisterIndexer): New method.
23745 * class.cs: Added myself as author of this file :-)
23747 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23749 * class.cs: fixed compilation on windoze.
23751 2002-08-03 Martin Baulig <martin@gnome.org>
23753 * interface.cs (Interface.GetInterfaceBases): Check whether all
23754 base interfaces are at least as accessible than the current one.
23756 * class.cs (TypeContainer.GetClassBases): Check whether base types
23757 are at least as accessible than the current type.
23758 (TypeContainer.AsAccessible): Implemented and made non-static.
23759 (MemberBase.CheckParameters): Report errors if the accessibility
23762 * delegate.cs (Delegate.Delegate): The default visibility is
23763 internal for top-level types and private for nested types.
23764 (Delegate.Define): Report errors if the accessibility checks fail.
23766 * enum.cs (Enum.Enum): The default visibility is internal for
23767 top-level types and private for nested types.
23768 (Enum.DefineType): Compute the correct visibility.
23770 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23771 function which takes a `bool is_toplevel' instead of a TypeContainer.
23773 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23776 2002-08-02 Martin Baulig <martin@gnome.org>
23778 * expression.cs (LocalVariableReferenc): Added constructor which
23779 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23780 (LocalVariableReference.IsReadOnly): New property.
23781 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23782 variable is readonly, use our own readonly flag to do this; you can
23783 use the new constructor to get a writable reference to a read-only
23786 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23787 reference to the local variable.
23789 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23791 * rootcontext.cs (ResolveCore): Also include System.Exception
23793 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23794 we reach an EmptyStatement.
23796 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23799 * expression.cs (Binary.ResolveOperator): Check error result in
23802 use brtrue/brfalse directly and avoid compares to null.
23804 2002-08-02 Martin Baulig <martin@gnome.org>
23806 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23807 Fixes bug #28407, added test-155.cs.
23809 2002-08-01 Martin Baulig <martin@gnome.org>
23811 * class.cs (Event.EmitDefaultMethod): Make this work with static
23812 events. Fixes #28311, added verify-3.cs.
23814 2002-08-01 Martin Baulig <martin@gnome.org>
23816 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23817 `is_disposable' fields.
23818 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23819 `hm.is_disposable' if we're using the collection pattern.
23820 (Foreach.EmitCollectionForeach): Use the correct type for the
23821 enumerator's local variable, only emit the try/finally block if
23822 necessary (fixes #27713).
23824 2002-08-01 Martin Baulig <martin@gnome.org>
23826 * ecore.cs (Expression.report118): Renamed to Error118 and made
23829 * statement.cs (Throw.Resolve): Check whether the expression is of
23830 the correct type (CS0118) and whether the type derives from
23831 System.Exception (CS0155).
23832 (Catch.Resolve): New method. Do the type lookup here and check
23833 whether it derives from System.Exception (CS0155).
23834 (Catch.CatchType, Catch.IsGeneral): New public properties.
23836 * typemanager.cs (TypeManager.exception_type): Added.
23838 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23840 * driver.cs: Updated About function.
23842 2002-07-31 Martin Baulig <martin@gnome.org>
23844 Implemented Control Flow Analysis.
23846 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23847 (EmitContext.CurrentBranching): Added.
23848 (EmitContext.StartFlowBranching): Added.
23849 (EmitContext.EndFlowBranching): Added.
23850 (EmitContext.KillFlowBranching): Added.
23851 (EmitContext.IsVariableAssigned): Added.
23852 (EmitContext.SetVariableAssigned): Added.
23853 (EmitContext.IsParameterAssigned): Added.
23854 (EmitContext.SetParameterAssigned): Added.
23855 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23856 Added control flow analysis stuff here.
23858 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23859 resolve the expression as lvalue.
23860 (LocalVariableReference.DoResolve): Check whether the variable has
23861 already been assigned.
23862 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23863 the parameter as assigned here.
23864 (ParameterReference.DoResolve): Check whether the parameter has already
23866 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23867 expression as lvalue.
23869 * statement.cs (FlowBranching): New class for the flow analysis code.
23870 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23871 (LabeledStatement.IsDefined): New public property.
23872 (LabeledStatement.AddUsageVector): New public method to tell flow
23873 analyis that the label may be reached via a forward jump.
23874 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23876 (VariableInfo.Number): New public field. This is used by flow analysis
23877 to number all locals of a block.
23878 (Block.CountVariables): New public property. This is the number of
23879 local variables in this block (including the locals from all parent
23881 (Block.EmitMeta): Number all the variables.
23883 * statement.cs: Added flow analysis support to all classes.
23885 2002-07-31 Martin Baulig <martin@gnome.org>
23887 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23888 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23889 then use this argument.
23891 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23893 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23894 use this to specify /define options.
23896 2002-07-29 Martin Baulig <martin@gnome.org>
23898 * statement.cs (Fixed): Moved all code that does variable lookups
23899 and resolvings from Emit to Resolve.
23901 * statement.cs (For): Moved all code that does variable lookups
23902 and resolvings from Emit to Resolve.
23904 * statement.cs (Using): Moved all code that does variable lookups
23905 and resolvings from Emit to Resolve.
23907 2002-07-29 Martin Baulig <martin@gnome.org>
23909 * attribute.cs (Attribute.Resolve): Explicitly catch a
23910 System.NullReferenceException when creating the
23911 CustromAttributeBuilder and report a different warning message.
23913 2002-07-29 Martin Baulig <martin@gnome.org>
23915 * support.cs (ParameterData.ParameterName): Added method to
23916 get the name of a parameter.
23918 * typemanager.cs (TypeManager.IsValueType): New public method.
23920 2002-07-29 Martin Baulig <martin@gnome.org>
23922 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23923 is a flag which specifies that it's either ref or out.
23924 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23925 the out parameter to `out Parameter.Modifier mod', also set the
23926 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23928 * support.cs (InternalParameters.ParameterModifier): Distinguish
23929 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23930 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23932 * expression.cs (Argument.GetParameterModifier): Distinguish
23933 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23934 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23936 2002-07-29 Martin Baulig <martin@gnome.org>
23938 * expression.cs (ParameterReference.ParameterReference): Added
23939 `Location loc' argument to the constructor.
23941 * cs-parser.jay: Pass location to ParameterReference.
23943 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23945 * statement.cs (Try): Initialize the location.
23947 * cs-parser.jay: pass location to Try.
23949 * expression.cs (Unary.Reduce): Change the prototype to return
23950 whether a constant fold could be performed or not. The result is
23951 returned in an out parameters. In the case of Indirection and
23952 AddressOf, we want to perform the full tests.
23954 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23956 * statement.cs (Statement.Emit): Flag dead code.
23958 2002-07-27 Andrew Birkett <andy@nobugs.org>
23960 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23962 2002-07-27 Martin Baulig <martin@gnome.org>
23964 * class.cs (MethodData.Define): Put back call to
23965 TypeManager.AddMethod(), accidentally commented this out.
23967 * report.cs (Debug): New public method to print debugging information,
23968 this is `[Conditional ("DEBUG")]'.
23970 2002-07-26 Martin Baulig <martin@gnome.org>
23972 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23973 (switch_statement): Push the current_block to the switch_stack and
23974 pop it again when we're done with the switch.
23975 (switch_section): The new block is a child of the current_block.
23976 Fixes bug #24007, added test-152.cs.
23978 2002-07-27 Martin Baulig <martin@gnome.org>
23980 * expression.cs (Invocation.EmitArguments): When calling a varargs
23981 function with only its fixed arguments, we need to pass an empty
23984 2002-07-27 Martin Baulig <martin@gnome.org>
23986 Mono 0.13 has been released.
23988 2002-07-25 Miguel de Icaza <miguel@ximian.com>
23990 * driver.cs: Rename --resource to --linkres, because that is what
23991 we do currently, we dont support --resource yet.
23993 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23995 2002-07-25 Martin Baulig <martin@gnome.org>
23997 * class.cs (MethodData): New public class. This is a `method builder'
23998 class for a method or one accessor of a Property/Indexer/Event.
23999 (MethodData.GetMethodFlags): Moved here from MemberBase.
24000 (MethodData.ApplyAttributes): Likewise.
24001 (MethodData.ApplyObsoleteAttribute): Likewise.
24002 (MethodData.ApplyConditionalAttribute): Likewise.
24003 (MethodData.ApplyDllImportAttribute): Likewise.
24004 (MethodData.CheckAbstractAndExternal): Likewise.
24005 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24006 (MethodData.Emit): Formerly known as Method.Emit().
24007 (MemberBase): Moved everything which was specific to a single
24008 accessor/method to MethodData.
24009 (Method): Create a new MethodData and call Define() and Emit() on it.
24010 (Property, Indexer, Event): Create a new MethodData objects for each
24011 accessor and call Define() and Emit() on them.
24013 2002-07-25 Martin Baulig <martin@gnome.org>
24015 Made MethodCore derive from MemberBase to reuse the code from there.
24016 MemberBase now also checks for attributes.
24018 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24019 (MemberBase.GetMethodFlags): Moved here from class Method and marked
24021 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24022 `CallingConventions cc' and `Attributes opt_attrs' arguments.
24023 (MemberBase.ApplyAttributes): New virtual method; applies the
24024 attributes to a method or accessor.
24025 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24026 (MemberBase.ApplyConditionalAttribute): Likewise.
24027 (MemberBase.ApplyDllImportAttribute): Likewise.
24028 (MemberBase.CheckAbstractAndExternal): Likewise.
24029 (MethodCore.ParameterTypes): This is now a property instead of a
24030 method, it's initialized from DoDefineParameters().
24031 (MethodCore.ParameterInfo): Removed the set accessor.
24032 (MethodCore.DoDefineParameters): New protected virtual method to
24033 initialize ParameterTypes and ParameterInfo.
24034 (Method.GetReturnType): We can now simply return the MemberType.
24035 (Method.GetMethodFlags): Override the MemberBase version and add
24036 the conditional flags.
24037 (Method.CheckBase): Moved some code from Define() here, call
24038 DoDefineParameters() here.
24039 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24040 here to avoid some larger code duplication.
24041 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24042 ensure that abstract and external accessors don't declare a body.
24044 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24045 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24046 lookup in the attribute's parent classes, so we need to abort as soon
24047 as we found the first match.
24048 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24049 the attribute has no arguments.
24051 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24054 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24056 * cs-parser.jay: reverted previous patch.
24058 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24060 * cs-parser.jay: fixed bug #22119.
24062 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24064 * attribute.cs: fixed compilation. The error was:
24065 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
24066 be assigned to before control leaves the current method."
24067 [FIXME: Filed as bug #28186: MCS must report this error.]
24069 2002-07-25 Martin Baulig <martin@gnome.org>
24071 * attribute.cs (Attribute.Conditional_GetConditionName): New static
24072 method to pull the condition name ouf of a Conditional attribute.
24073 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24074 the obsolete message and error flag out of an Obsolete attribute.
24076 * class.cs (Method.GetMethodFlags): New public method to get the
24077 TypeManager.MethodFlags for this method.
24078 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24080 (Method.Define): Get and apply the Obsolete and Conditional attributes;
24081 if we're overriding a virtual function, set the new private variable
24082 `parent_method'; call the new TypeManager.AddMethod().
24084 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
24085 the MethodBuilder and the Method in a PtrHashtable.
24086 (TypeManager.builder_to_method): Added for this purpose.
24087 (TypeManager.MethodFlags): Added IsObsoleteError.
24088 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
24089 Obsolete and Conditional arguments in MethodBuilders. If we discover
24090 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24091 the message from the attribute.
24093 2002-07-24 Martin Baulig <martin@gnome.org>
24095 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24096 preprocessor directives, ensure that the argument to #define/#undef is
24097 exactly one identifier and that it's actually an identifier.
24099 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24102 2002-07-24 Martin Baulig <martin@gnome.org>
24104 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24105 initialize it to TypeManager.object_type in the constructor.
24106 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24107 of the `hm.get_current' method if we're using the collection pattern.
24108 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24109 for the explicit conversion to make it work when we're using the collection
24110 pattern and the `Current' property has a different return type than `object'.
24113 2002-07-24 Martin Baulig <martin@gnome.org>
24115 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24116 does not match, but don't report any errors. This method is called in
24117 order for all methods in a MethodGroupExpr until a matching method is
24118 found, so we don't want to bail out if the first method doesn't match.
24119 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24120 matches, report the 123. Fixes #28070.
24122 2002-07-24 Martin Baulig <martin@gnome.org>
24124 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24125 TypeManager.TypeToCoreType() to the top of the method so the
24126 following equality checks will work. Fixes #28107.
24128 2002-07-24 Martin Baulig <martin@gnome.org>
24130 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24131 operand is of type uint, and the other operand is of type sbyte,
24132 short or int, the operands are converted to type long." -
24133 Actually do what this comment already told us. Fixes bug #28106,
24136 2002-07-24 Martin Baulig <martin@gnome.org>
24138 * class.cs (MethodBase): New abstract class. This is now a base
24139 class for Property, Indexer and Event to avoid some code duplication
24140 in their Define() and DefineMethods() methods.
24141 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24142 generic methods for Define() and DefineMethods().
24143 (FieldBase): Derive from MemberBase, not MemberCore.
24144 (Property): Derive from MemberBase, not MemberCore.
24145 (Property.DefineMethod): Moved all the code from this method to the
24146 new MethodBase.DefineAccessor(), just call it with appropriate
24148 (Property.Define): Call the new Property.DoDefine(), this does some
24149 sanity checks and we don't need to duplicate the code everywhere.
24150 (Event): Derive from MemberBase, not MemberCore.
24151 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24152 accessors, this will also make them work with interface events.
24153 (Indexer): Derive from MemberBase, not MemberCore.
24154 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24155 (Indexer.Define): Use the new MethodBase functions.
24157 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24158 argument to the constructor.
24159 (Interface.FindMembers): Added support for interface events.
24160 (Interface.PopluateEvent): Implemented.
24162 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
24164 2002-07-22 Miguel de Icaza <miguel@ximian.com>
24166 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24167 but this is required to check for a method name being the same as
24168 the containing class.
24172 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24174 * interface.cs: initialize variable.
24176 2002-07-23 Martin Baulig <martin@gnome.org>
24178 Implemented the IndexerName attribute in interfaces.
24180 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24181 name if this is an explicit interface implementation.
24182 (Indexer.InterfaceIndexerName): New public variable. If we're
24183 implementing an interface indexer, this is the IndexerName in that
24184 interface. Otherwise, it's the IndexerName.
24185 (Indexer.DefineMethod): If we're implementing interface indexer,
24186 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
24187 and Pending.ImplementIndexer methods.
24188 (Indexer.Define): Also define the PropertyBuilder if we're
24189 implementing an interface indexer and this is neither an explicit
24190 interface implementation nor do the IndexerName match the one in
24193 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24194 If a method is defined here, then we always need to create a proxy
24195 for it. This is used when implementing interface indexers.
24196 (Pending.IsInterfaceIndexer): New public method.
24197 (Pending.ImplementIndexer): New public method.
24198 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24199 This is used when implementing interface indexers to define a proxy
24201 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24202 define a proxy if necessary.
24204 * interface.cs (Interface.IndexerName): New public variable.
24205 (Interface.PopulateIndexer): Set the IndexerName.
24206 (Interface.DefineIndexers): New private method. Populate all the
24207 indexers and make sure their IndexerNames match.
24209 * typemanager.cs (IndexerPropertyName): Added support for interface
24212 2002-07-22 Martin Baulig <martin@gnome.org>
24214 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24215 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24216 ret if HasReturnLabel.
24217 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24220 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24221 and set the ec.LoopBeginTryCatchLevel.
24222 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24223 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24224 the current ec.TryCatchLevel, the branch goes out of an exception
24225 block. In this case, we need to use Leave and not Br.
24227 2002-07-22 Martin Baulig <martin@gnome.org>
24229 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24230 block unless the block does not always return or it is contained in
24231 another try { ... } catch { ... } block. Fixes bug #26506.
24232 Added verify-1.cs to the test suite.
24234 2002-07-22 Martin Baulig <martin@gnome.org>
24236 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24237 then we do not always return. Fixes bug #24985.
24239 2002-07-22 Martin Baulig <martin@gnome.org>
24241 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24242 lookup on a per-class level; ie. walk up the class hierarchy until we
24243 found at least one applicable method, then choose the best among them.
24244 Fixes bug #24463 and test-29.cs.
24246 2002-07-22 Martin Baulig <martin@gnome.org>
24248 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24249 return types of the methods. The return type is not part of the
24250 signature and we must not check it to make the `new' modifier work.
24251 Fixes bug #27999, also added test-147.cs.
24252 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24254 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24255 on the method's return type.
24257 2002-07-21 Martin Baulig <martin@gnome.org>
24259 * assign.cs: Make this work if the rightmost source is a constant and
24260 we need to do an implicit type conversion. Also adding a few more tests
24261 to test-38.cs which should have caught this.
24263 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24264 target in the makefile for this. The makefile.gnu is primarily intended
24265 for end-users who don't want to debug the compiler.
24267 2002-07-21 Martin Baulig <martin@gnome.org>
24269 * assign.cs: Improved the Assign class so it can now handle embedded
24270 assignments (X = Y = Z = something). As a side-effect this'll now also
24271 consume less local variables. test-38.cs now passes with MCS, added
24272 a few new test cases to that test.
24274 2002-07-20 Martin Baulig <martin@gnome.org>
24276 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24277 instructions. Fixes bug #27977, also added test-146.cs.
24279 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24281 * cs-tokenizer.cs: fixed getHex ().
24283 2002-07-19 Martin Baulig <martin@gnome.org>
24285 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24286 not Type.GetType() to lookup the array type. This is needed when
24287 we're constructing an array of a user-defined type.
24288 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24289 single-dimensional arrays, but also for single-dimensial arrays of
24292 2002-07-19 Martin Baulig <martin@gnome.org>
24294 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24295 this function is called, it's not allowed to share LocalBuilders
24296 among ILGenerators.
24298 2002-07-19 Martin Baulig <martin@gnome.org>
24300 * expression.cs (Argument.Resolve): Report an error 118 when trying
24301 to pass a type as argument.
24303 2002-07-18 Martin Baulig <martin@gnome.org>
24305 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24306 Conv_R_Un for the signed `long' type.
24308 2002-07-15 Miguel de Icaza <miguel@ximian.com>
24310 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24311 `expr' for the temporary result, as that will fail if we do
24312 multiple resolves on the same expression.
24314 2002-07-05 Miguel de Icaza <miguel@ximian.com>
24316 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24317 ec.TypeContainer for looking up aliases.
24319 * class.cs (TypeContainer): Remove LookupAlias from here.
24321 * decl.cs (DeclSpace); Move here.
24323 2002-07-01 Miguel de Icaza <miguel@ximian.com>
24325 * class.cs (FindMembers): Only call filter if the constructor
24326 bulider is not null.
24328 Also handle delegates in `NestedTypes' now. Now we will perform
24329 type lookups using the standard resolution process. This also
24332 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24333 This uses Expressions (the limited kind that can be parsed by the
24334 tree) instead of strings.
24336 * expression.cs (ComposedCast.ToString): Implement, used to flag
24337 errors since now we have to render expressions.
24339 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
24342 * ecore.cs (SimpleName.ToString): ditto.
24344 * cs-parser.jay: Instead of using strings to assemble types, use
24345 Expressions to assemble the type (using SimpleName, ComposedCast,
24346 MemberAccess). This should fix the type lookups in declarations,
24347 because we were using a different code path for this.
24349 * statement.cs (Block.Resolve): Continue processing statements
24350 even when there is an error.
24352 2002-07-17 Miguel de Icaza <miguel@ximian.com>
24354 * class.cs (Event.Define): Also remove the `remove' method from
24355 the list of pending items.
24357 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24358 generate more compact code.
24360 2002-07-17 Martin Baulig <martin@gnome.org>
24362 * const.cs (Const.LookupConstantValue): Add support for constant
24363 `unchecked' and `checked' expressions.
24364 Also adding test case test-140.cs for this.
24366 2002-07-17 Martin Baulig <martin@gnome.org>
24368 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24369 check whether mi.ReturnType implements the IEnumerator interface; the
24370 `==' and the IsAssignableFrom() will fail in this situation.
24372 2002-07-16 Ravi Pratap <ravi@ximian.com>
24374 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
24377 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24379 * expression.cs: fixed bug #27811.
24381 2002-07-14 Miguel de Icaza <miguel@ximian.com>
24383 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24384 Molaro: when we are a ref, the value already contains a pointer
24385 value, do not take the address of it.
24387 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24388 * removed mb-parser.jay and mb-tokenizer.cs
24390 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24392 * expression.cs: check against the building corlib void type.
24394 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24396 * ecore.cs: fix for valuetype static readonly fields: when
24397 initializing them, we need their address, not the address of a copy.
24399 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24401 * typemanager.cs: register also enum_type in corlib.
24403 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24405 * class.cs: allow calling this (but not base) initializers in structs.
24407 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24409 * ecore.cs: make sure we compare against the building base types
24412 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24414 * typemanager.cs: fix TypeToCoreType() to handle void and object
24415 (corlib gets no more typerefs after this change).
24417 2002-07-12 Miguel de Icaza <miguel@ximian.com>
24419 * expression.cs (ArrayCreation.EmitArrayArguments): use
24420 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24422 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24423 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
24424 array indexes, the runtime actually forbids them.
24426 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24427 for array arguments here.
24429 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24430 instead of the default for ValueTypes.
24432 (New.DoEmit): Use IsValueType instead of
24433 IsSubclassOf (value_type)
24434 (New.DoResolve): ditto.
24435 (Invocation.EmitCall): ditto.
24437 * assign.cs (Assign): ditto.
24439 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24440 Statements *are* currently doing part of their resolution during
24443 Expressions do always resolve during resolve, but statements are
24444 only required to propagate resolution to their children.
24446 2002-07-11 Miguel de Icaza <miguel@ximian.com>
24448 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24450 (LoadAssembly): Do not add the dll if it is already specified
24452 (MainDriver): Add the System directory to the link path at the end,
24453 after all the other -L arguments.
24455 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24456 wrong opcode for loading bytes and bools (ldelem.i1 instead of
24457 ldelem.u1) and using the opposite for sbytes.
24459 This fixes Digger, and we can finally run it.
24461 * driver.cs (UnixParseOption): Move the option parsing here.
24462 (CSCParseOption): Implement CSC-like parsing of options.
24464 We now support both modes of operation, the old Unix way, and the
24465 new CSC-like way. This should help those who wanted to make cross
24466 platform makefiles.
24468 The only thing broken is that /r:, /reference: and /lib: are not
24469 implemented, because I want to make those have the same semantics
24470 as the CSC compiler has, and kill once and for all the confussion
24471 around this. Will be doing this tomorrow.
24473 * statement.cs (Unsafe.Resolve): The state is checked during
24474 resolve, not emit, so we have to set the flags for IsUnsfe here.
24476 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24478 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24479 not catch the Error_ObjectRefRequired in SimpleName (as it is
24480 possible to have a class/instance variable name that later gets
24481 deambiguated), we have to check this here.
24483 2002-07-10 Ravi Pratap <ravi@ximian.com>
24485 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24486 make static and put into Expression.
24488 (Event.Define): Register the private field of the event with the
24489 TypeManager so that GetFieldFromEvent can get at it.
24491 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24492 keep track of the private field associated with an event which
24495 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24498 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24500 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24502 * expression.cs (Binary.EmitBranchable): this routine emits the
24503 Binary expression in a branchable context. This basically means:
24504 we need to branch somewhere, not just get the value on the stack.
24506 This works together with Statement.EmitBoolExpression.
24508 * statement.cs (Statement.EmitBoolExpression): Use
24511 2002-07-09 Miguel de Icaza <miguel@ximian.com>
24513 * statement.cs (For): Reduce the number of jumps in loops.
24515 (For): Implement loop inversion for the For statement.
24517 (Break): We can be breaking out of a Try/Catch controlled section
24518 (foreach might have an implicit try/catch clause), so we need to
24519 use Leave instead of Br.
24521 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24522 now). If the instace expression supports IMemoryLocation, we use
24523 the AddressOf method from the IMemoryLocation to extract the
24524 address instead of emitting the instance.
24526 This showed up with `This', as we were emitting the instance
24527 always (Emit) instead of the Address of This. Particularly
24528 interesting when This is a value type, as we dont want the Emit
24529 effect (which was to load the object).
24531 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24533 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24535 * statement.cs (Checked): Set the CheckedState during the resolve
24536 process too, as the ConvCast operations track the checked state on
24537 the resolve process, and not emit.
24539 * cs-parser.jay (namespace_member_declaration): Flag that we have
24540 found a declaration when we do. This is used to flag error 1529
24542 * driver.cs: Report ok when we display the help only.
24544 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24546 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24548 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24550 * cs-tokenizer.cs (define): We also have to track locally the
24551 defines. AllDefines is just used for the Conditional Attribute,
24552 but we also need the local defines for the current source code.
24554 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24556 * statement.cs (While, For, Do): These loops can exit through a
24557 Break statement, use this information to tell whether the
24558 statement is the last piece of code.
24560 (Break): Flag that we break.
24562 * codegen.cs (EmitContexts): New `Breaks' state variable.
24564 2002-07-03 Martin Baulig <martin@gnome.org>
24566 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24567 modifiers in method declarations in structs. Otherwise, you won't
24568 be able to override things like Object.Equals().
24570 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24572 * class.cs (Method, Property, Indexer): Do not allow the public
24573 modifier to be used in explicit interface implementations.
24575 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24576 override modifiers in method declarations in structs
24578 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24580 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24581 integer or real overflow, report an error
24583 2002-07-02 Martin Baulig <martin@gnome.org>
24585 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24586 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24587 to tell the runtime about our newly created System.Object and
24588 System.ValueType types.
24590 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24592 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24593 struct instead of Ldarg/Starg.
24595 2002-07-02 Martin Baulig <martin@gnome.org>
24597 * expression.cs (Indirection.Indirection): Call
24598 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24600 2002-07-02 Martin Baulig <martin@gnome.org>
24602 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24603 ValueType, call TypeManager.TypeToCoreType() on it.
24604 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24605 the OpCodes.Newarr argument.
24607 2002-07-02 Martin Baulig <martin@gnome.org>
24609 * expression.cs (Invocation.EmitCall): When compiling corlib,
24610 replace all calls to the system's System.Array type to calls to
24611 the newly created one.
24613 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24614 System.Array methods.
24615 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24616 from the system's System.Array type which must be replaced.
24618 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24620 * typemanager.cs: load unverifiable_code_ctor so we can build
24621 corlib using the correct type. Avoid using GetTypeCode() with
24623 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24624 TypeManager.object_type to allow building corlib.
24626 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24628 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24630 2002-07-01 Martin Baulig <martin@gnome.org>
24632 * class.cs: Make the last change actually work, we need to check
24633 whether `ifaces != null' to avoid a crash.
24635 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24637 * class.cs: when we build structs without fields that implement
24638 interfaces, we need to add the interfaces separately, since there is
24639 no API to both set the size and add the interfaces at type creation
24642 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24644 * expression.cs: the dimension arguments to the array constructors
24645 need to be converted if they are a long.
24647 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24649 * class.cs: don't emit ldarg.0 if there is no parent constructor
24650 (fixes showstopper for corlib).
24652 2002-06-29 Martin Baulig <martin@gnome.org>
24654 MCS now compiles corlib on GNU/Linux :-)
24656 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24657 ie. check for MethodImplOptions.InternalCall.
24659 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24660 and TypeManager.attribute_type are null, so we must explicitly check
24661 whether parent is not null to find out whether it's an attribute type.
24662 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24663 and SetBuilder, not only if the property is neither abstract nor external.
24664 This is necessary to set the MethodImplOptions on the accessor methods.
24665 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24666 SetBuilder, see Property.Emit().
24668 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24669 populate "System.Object", "System.ValueType" and "System.Attribute" since
24670 they've already been populated from BootCorlib_PopulateCoreTypes().
24672 2002-06-29 Martin Baulig <martin@gnome.org>
24674 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24675 is the NullLiteral, we also need to make sure that target_type is not
24678 2002-06-29 Martin Baulig <martin@gnome.org>
24680 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24681 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24682 before calling BootstrapCorlib_ResolveDelegate ().
24684 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24686 * statement.cs: fixed build-breaker. All tests passed ok.
24688 2002-06-27 Martin Baulig <martin@gnome.org>
24690 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24691 for System.Decimal when compiling corlib.
24693 2002-06-27 Martin Baulig <martin@gnome.org>
24695 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24696 switch blocks which contain nothing but a default clause.
24698 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24700 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24702 2002-06-27 Martin Baulig <martin@gnome.org>
24704 * ecore.cs (PropertyExpr.PropertyExpr): Call
24705 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24707 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24708 is already a TypeBuilder.
24710 2002-06-27 Martin Baulig <martin@gnome.org>
24712 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24713 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24714 the "from an array-type to System.Array" case. This makes it work
24715 when compiling corlib.
24717 2002-06-27 Martin Baulig <martin@gnome.org>
24719 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24720 non-static PropertyExpr, set its InstanceExpression. This makes
24721 the `ICollection.Count' property work in System/Array.cs.
24723 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24725 * driver.cs: Made error handling more consistent. Errors now
24726 tracked by Report class, so many methods which used to return int
24727 now return void. Main() now prints success/failure and
24728 errors/warnings message.
24730 Renamed '--probe' compiler argument to '--expect-error'. Removed
24731 the magic number return values (123 and 124). Now, if the
24732 expected error occurs, the compiler exits with success (exit value
24733 0). If the compilation completes without seeing that particular
24734 error, the compiler exits with failure (exit value 1). The
24735 makefile in mcs/errors has been changed to handle the new behaviour.
24737 * report.cs: Made 'expected error' number a property and renamed
24738 it from 'Probe' to 'ExpectedError'.
24740 * genericparser.cs: Removed error handling support, since it is
24741 now all done by Report class.
24743 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24744 class, so parse() no longer returns an int.
24746 * namespace.cs: Use Report.Error instead of GenericParser.error
24748 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24750 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24751 TypeContainer.AddOperator): At the front of the list put the
24752 explicit implementations, so they get resolved/defined first.
24754 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24756 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24757 interface type is implemented by this TypeContainer. Used during
24758 explicit interface implementation.
24760 (Property.Define, Indexer.Define, Method.Define): Validate that
24761 the given interface in the explicit implementation is one of the
24762 base classes for the containing type.
24764 Also if we are explicitly implementing an interface, but there is
24765 no match in the pending implementation table, report an error.
24767 (Property.Define): Only define the property if we are
24768 not explicitly implementing a property from an interface. Use the
24769 correct name also for those properties (the same CSC uses,
24770 although that is really not needed).
24772 (Property.Emit): Do not emit attributes for explicitly implemented
24773 properties, as there is no TypeBuilder.
24775 (Indexer.Emit): ditto.
24777 Hiding then means that we do not really *implement* a pending
24778 implementation, which makes code fail.
24780 2002-06-22 Martin Baulig <martin@gnome.org>
24782 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24783 the return value of Object.GetType(). [FIXME: we need to do this whenever
24784 we get a type back from the reflection library].
24786 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24788 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24790 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24792 * attribute.cs: Return null if we can not look up the type.
24794 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24795 the interface types found.
24797 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24798 interface types found.
24800 * typemanager.cs (GetInterfaces): Make this routine returns alll
24801 the interfaces and work around the lame differences between
24802 System.Type and System.Reflection.Emit.TypeBuilder in the results
24803 result for GetInterfaces.
24805 (ExpandInterfaces): Given an array of interface types, expand and
24806 eliminate repeated ocurrences of an interface. This expands in
24807 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24810 2002-06-21 Martin Baulig <martin@gnome.org>
24812 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24815 2002-06-21 Martin Baulig <martin@gnome.org>
24817 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24818 and called with one of the core types, return the corresponding typebuilder for
24821 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24824 2002-06-21 Martin Baulig <martin@gnome.org>
24826 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24827 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24828 (Expression.ConvertReferenceExplicit): Likewise.
24830 * expression.cs (ElementAccess.DoResolve): Likewise.
24831 (ElementAccess.DoResolveLValue): Likewise.
24833 2002-06-10 Martin Baulig <martin@gnome.org>
24835 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24836 add the "value" parameter to the parameter list.
24838 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24841 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24843 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24844 the argument to an int, uint, long or ulong, per the spec. Also
24845 catch negative constants in array creation.
24847 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24849 * class.cs: do not allow the same interface to appear twice in
24850 the definition list.
24852 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24854 * ecore.cs: don't use ldlen with System.Array.
24856 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24858 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24860 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24862 * modifiers.cs: produce correct field attributes for protected
24863 internal. Easy fix so miguel can work on ther harder stuff:-)
24865 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24867 * pending.cs: New file. Move the code from class.cs here.
24868 Support clearning the pending flag for all methods (when not doing
24869 explicit interface implementation).
24871 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24873 * rootcontext.cs: added a couple more types needed to bootstrap.
24875 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24877 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24878 constructor in the type, instead of any constructor in the type
24879 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24880 a bug in the Mono runtime when applying the params attribute).
24882 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24883 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24885 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24887 * expression.cs (Unary.ResolveOperator): Use TypeManager
24888 to resolve the type.
24890 2002-06-13 Ravi Pratap <ravi@ximian.com>
24892 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24895 * enum.cs (AddEnumMember): Add support to store the attributes associated
24896 with each member too.
24898 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24899 field builders too - this takes care of the enum member case.
24901 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24903 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24904 address-of operator on both value types and pointers.
24906 2002-06-10 Martin Baulig <martin@gnome.org>
24908 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24909 PropertyBuilder to the `property_builders' list.
24911 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24912 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24913 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24914 find any indexers which are inherited from an interface.
24916 2002-06-09 Martin Baulig <martin@gnome.org>
24918 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24919 the same type as the constant if necessary. There's also a test-130.cs
24922 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24924 * typemanager.cs (TypeManager.ChangeType): Previously known as
24925 Enum.ChangeEnumType().
24927 2002-06-09 Martin Baulig <martin@gnome.org>
24929 * expression.cs (Cast.TryReduce): Added support for consts.
24931 2002-06-08 Ravi Pratap <ravi@ximian.com>
24933 * class.cs (Accessor): Hold attributes information so we can pass
24936 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24937 Modify to pass in attributes attached to the methods.
24939 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24941 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24942 to handle the Accessor kind :-)
24944 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24946 2002-06-08 Martin Baulig <martin@gnome.org>
24948 * expression.cs (Unary.TryReduceNegative): Added support for
24951 2002-06-08 Martin Baulig <martin@gnome.org>
24953 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24954 name can't be found in the `defined_names' - the caller will do a
24955 MemberLookup in this case and thus find methods in System.Enum
24956 such as Enum.IsDefined().
24958 2002-06-08 Martin Baulig <martin@gnome.org>
24960 * enum.cs (Enum.ChangeEnumType): This is a custom version of
24961 Convert.ChangeType() which works with TypeBuilder created types.
24962 (Enum.LookupEnumValue, Enum.Define): Use it here.
24964 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24965 `TypeBuilder.BaseType != null' check.
24966 (TypeContainer.FindMembers): Only lookup parent members if we
24967 actually have a parent.
24968 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24969 (ConstructorInitializer.Resolve): Likewise.
24971 * interface.cs (Interface.FindMembers): Added
24972 `TypeBuilder.BaseType != null' check.
24974 * rootcontext.cs (RootContext.ResolveCore): Added
24975 "System.Runtime.CompilerServices.IndexerNameAttribute" to
24976 classes_second_stage.
24978 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24979 debug_type and trace_type when compiling with --nostdlib.
24981 2002-06-07 Martin Baulig <martin@gnome.org>
24983 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24984 (AddField): Set it to true when adding a non-static field.
24985 (DefineType): Use `have_nonstatic_fields' to find out whether we
24986 have non-static fields, not `Fields != null'.
24988 2002-06-02 Miguel de Icaza <miguel@ximian.com>
24990 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24991 dereferencing a null on the static-field code path)
24993 2002-05-30 Martin Baulig <martin@gnome.org>
24995 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24996 to take command line arguments. Use reflection to call the new
24997 custom `Initialize' function on the symbol writer and pass it the
24998 command line arguments.
25000 * driver.cs (--debug-args): New command line argument to pass command
25001 line arguments to the symbol writer.
25003 2002-05-28 Miguel de Icaza <miguel@ximian.com>
25005 * assign.cs (DoResolve): Forgot to do the implicit conversion to
25006 the target type for indexers and properties. Thanks to Joe for
25009 2002-05-27 Miguel de Icaza <miguel@ximian.com>
25011 * typemanager.cs (MethodFlags): returns the method flags
25012 (Obsolete/ShouldIgnore) that control warning emission and whether
25013 the invocation should be made, or ignored.
25015 * expression.cs (Invocation.Emit): Remove previous hack, we should
25016 not do this on matching a base type, we should do this based on an attribute
25018 Only emit calls to System.Diagnostics.Debug and
25019 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25020 on the command line.
25022 * rootcontext.cs: Global settings for tracing and debugging.
25024 * cs-tokenizer.cs (define): New utility function to track
25025 defines. Set the global settings for TRACE and DEBUG if found.
25027 2002-05-25 Ravi Pratap <ravi@ximian.com>
25029 * interface.cs (Populate*): Pass in the TypeContainer as well as
25030 the DeclSpace as parameters so that we can create EmitContexts and
25031 then use that to apply attributes etc.
25033 (PopulateMethod, PopulateEvent, PopulateProperty)
25034 (PopulateIndexer): Apply attributes everywhere.
25036 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25039 (ApplyAttributes): Update accordingly.
25041 We now apply interface attributes for all members too.
25043 2002-05-26 Miguel de Icaza <miguel@ximian.com>
25045 * class.cs (Indexer.Define); Correctly check if we are explicit
25046 implementation (instead of checking the Name for a ".", we
25047 directly look up if the InterfaceType was specified).
25049 Delay the creation of the PropertyBuilder.
25051 Only create the PropertyBuilder if we are not an explicit
25052 interface implementation. This means that explicit interface
25053 implementation members do not participate in regular function
25054 lookups, and hence fixes another major ambiguity problem in
25055 overload resolution (that was the visible effect).
25057 (DefineMethod): Return whether we are doing an interface
25060 * typemanager.cs: Temporary hack until we get attributes in
25061 interfaces (Ravi is working on that) and we get IndexerName
25062 support in interfaces.
25064 * interface.cs: Register the indexers as properties.
25066 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25067 warning, I have verified that this is a bug in the .NET runtime
25068 (JavaScript suffers of the same problem).
25070 * typemanager.cs (MemberLookup): When looking up members for
25071 interfaces, the parent of an interface is the implicit
25072 System.Object (so we succeed in searches of Object methods in an
25073 interface method invocation. Example: IEnumerable x; x.ToString
25076 2002-05-25 Miguel de Icaza <miguel@ximian.com>
25078 * class.cs (Event): Events should also register if they do
25079 implement the methods that an interface requires.
25081 * typemanager.cs (MemberLookup); use the new GetInterfaces
25084 (GetInterfaces): The code used to lookup interfaces for a type is
25085 used in more than one place, factor it here.
25087 * driver.cs: Track the errors at the bottom of the file, we kept
25090 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25091 instance if the method we are calling is static!
25093 2002-05-24 Miguel de Icaza <miguel@ximian.com>
25095 * attribute.cs (ApplyAttributes): Make this function filter out
25096 the IndexerName attribute (as that attribute in reality is never
25097 applied) and return the string constant for the IndexerName
25100 * class.cs (TypeContainer.Emit): Validate that all the indexers
25101 have the same IndexerName attribute, and if so, set the
25102 DefaultName attribute on the class.
25104 * typemanager.cs: The return value might contain other stuff (not
25105 only methods). For instance, consider a method with an "Item"
25106 property and an Item method.
25108 * class.cs: If there is a problem with the parameter types,
25111 2002-05-24 Ravi Pratap <ravi@ximian.com>
25113 * ecore.cs (ImplicitConversionExists): Wrapper function which also
25114 looks at user defined conversion after making a call to
25115 StandardConversionExists - we need this for overload resolution.
25117 * expression.cs : Update accordingly the various method calls.
25119 This fixes 2 bugs filed against implicit user defined conversions
25121 2002-05-22 Miguel de Icaza <miguel@ximian.com>
25123 * statement.cs: Track the result of the assignment.
25125 2002-05-21 Miguel de Icaza <miguel@ximian.com>
25127 * expression.cs (MemberAccess): Improved error reporting for
25128 inaccessible members.
25130 2002-05-22 Martin Baulig <martin@gnome.org>
25132 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
25133 itself with debugging support.
25135 2002-05-22 Martin Baulig <martin@gnome.org>
25137 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25138 Removed, this isn't needed anymore.
25140 2002-05-20 Martin Baulig <martin@gnome.org>
25142 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25143 be underlying type for an enum.
25145 2002-05-20 Miguel de Icaza <miguel@ximian.com>
25147 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25148 that splits out the loading of just the core types.
25150 * rootcontext.cs (ResolveCore): Split the struct resolution in
25151 two, so we can load the enumeration underlying types before any
25154 * expression.cs (Is): Bandaid until we fix properly Switch (see
25155 bug #24985 for details).
25157 * typemanager.cs (ImplementsInterface): The hashtable will contain
25158 a null if there are no interfaces implemented.
25160 2002-05-18 Miguel de Icaza <miguel@ximian.com>
25162 * cs-parser.jay (indexer_declarator): It is fine to have array
25165 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25167 * typemanager.cs: (RegisterBuilder): New function used to register
25168 TypeBuilders that implement interfaces. Since
25169 TypeBuilder.GetInterfaces (as usual) does not work with lame
25171 (AddUserType): register interfaces.
25173 (ImplementsInterface): Use the builder_to_ifaces hash if we are
25174 dealing with TypeBuilder. Also, arrays are showing up as
25175 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25176 methods can not be invoked on them!
25178 * ecore.cs (ExplicitReferenceConversionExists): Made public.
25179 (ImplicitReferenceConversionExists): Split out from
25180 StandardConversionExists.
25182 * expression.cs (As): We were only implementing one of the three
25183 cases for the as operator. We now implement them all.
25184 (Is): Implement the various other cases for Is as well.
25186 * typemanager.cs (CACHE): New define used to control if we want or
25187 not the FindMembers cache. Seems to have a negative impact on
25188 performance currently
25190 (MemberLookup): Nested types have full acess to
25191 enclosing type members
25193 Remove code that coped with instance/static returns for events, we
25194 now catch this in RealFindMembers.
25196 (RealFindMembers): only perform static lookup if the instance
25197 lookup did not return a type or an event.
25199 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25201 * assign.cs (CompoundAssign): We pass more semantic information
25202 now to Compound Assignments than we did before: now we have all
25203 the information at hand, and now we resolve the target *before* we
25204 do the expression expansion, which allows the "CacheValue" method
25205 to have the effect we intended (before, a [x] += 1 would generate
25206 two differen ArrayAccess expressions from the ElementAccess,
25207 during the resolution process).
25209 (CompoundAssign.DoResolve): Resolve target and original_source here.
25211 2002-05-16 Miguel de Icaza <miguel@ximian.com>
25213 * expression.cs (ArrayAccess): dropped debugging information.
25215 * typemanager.cs: Small bug fix: I was always returning i_members,
25216 instead of one of i_members or s_members (depending on which had
25219 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
25220 method is invoked before any code generation takes place, and it
25221 is a mechanism to inform that the expression will be invoked more
25222 than once, and that the method should use temporary values to
25223 avoid having side effects
25225 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25227 * ecore.cs (Expression.CacheTemporaries): Provide empty default
25230 * expression.cs (Indirection, ArrayAccess): Add support for
25231 CacheTemporaries in these two bad boys.
25233 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25234 ldobj or ldind_ref.
25235 (StoreFromPtr): Handle stobj as well.
25237 * expression.cs (UnaryMutator): Share more code.
25239 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25240 down: I was not tracking the Filter function as well, which
25241 was affecting the results of the cache.
25243 2002-05-15 Miguel de Icaza <miguel@ximian.com>
25245 * attribute.cs: Remove the hack to handle the CharSet property on
25248 2002-05-14 Miguel de Icaza <miguel@ximian.com>
25250 * attribute.cs (DoResolve): More uglyness, we now only try to
25251 resolve the attribute partially, to extract the CharSet
25252 information (only if we are a StructLayout attribute). Otherwise
25254 (GetExtraTypeInfo): Add some code to conditionally kill in the
25255 future this. I am more and more convinced that the .NET
25256 framework has special code to handle the attribute setting on
25259 * expression.cs (IsParamsMethodApplicable): Revert my previous
25260 foreach change here, it was wrong.
25262 2002-05-13 Miguel de Icaza <miguel@ximian.com>
25264 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25265 (pp_expr): do not abort on unknown input, just return.
25266 (eval): abort if there are pending chars.
25268 * attribute.cs (Attribute.Resolve): Positional parameters are
25269 optional. Deal with that case.
25271 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25272 the Ansi/Unicode/Auto information for the type.
25274 (TypeContainer.DefineType): instantiate the EmitContext here, as
25275 we will be using it during the type definition (to resolve
25276 attributes) and during the emit phase.
25278 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25279 to pull type information out of the attributes
25281 (Attribute.Resolve): track the constructor builder, and allow for
25282 multiple invocations (structs and classes will use this).
25284 * ecore.cs (MemberLookupFinal): new version with all the
25285 parameters customizable.
25287 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25288 constructors. Return if the result value is null (as the error
25289 would have been flagged already by MemberLookupFinal)
25291 Do not allow instances of abstract classes or interfaces to be
25294 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25295 We have to compare the assembly property here when dealing with
25296 FamANDAssem and Assembly access modifiers, because we might be
25297 creating an assembly from *modules* (that means that we are not
25298 getting TypeBuilders for types defined in other modules that are
25299 part of this assembly).
25301 (Method.Emit): If the method is marked abstract and has a body,
25304 (TypeContainer.DefineMembers): If both the defined member and the
25305 parent name match are methods, then do not emit any warnings: let
25306 the Method.Define routine take care of flagging warnings. But if
25307 there is a mismatch (method overrides something else, or method is
25308 overriwritten by something, then emit warning).
25310 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25311 set to null, this means `do not check for the return type on the
25314 (Method.Define): set the return type for the method signature to
25315 null, so that we get methods with the same name and parameters and
25316 different return types. This is used to flag warning 114 (you are
25317 hiding a method, and you probably want to use the new/override
25320 * typemanager.cs (MemberLookup): Implemented proper access
25321 control, closing a long standing set of bug reports. The problem
25322 was that the Framework only has two bits: Public and NonPublic,
25323 and NonPublic includes private and protected methods, but we need
25324 to enforce the FamANDAssem, FamOrAssem and Family.
25326 2002-05-11 Miguel de Icaza <miguel@ximian.com>
25328 * statement.cs (GotoCase): Return true: Ammounts to giving up
25329 knowledge on whether we return or not, and letting the other case
25330 be responsible for it.
25332 2002-05-10 Miguel de Icaza <miguel@ximian.com>
25334 * driver.cs: Do not load directories for each file processed, only
25335 do it if there is a pattern.
25337 * ecore.cs: Report readonly assigns here as well, as we might have
25338 been resolved only by MemberAccess.
25340 (SimpleName.SimpleNameResolve): Also be useful for LValue
25341 resolution. We need this to propagate assign to local readonly variables
25343 * typemanager.cs: Use a ptrhashtable for the criteria, because we
25344 do not want to reuse potential criteria memory.
25346 * class.cs (MyEventBuilder): Set reflected_type;
25348 * ecore.cs (Constantify): Added support for constifying bools.
25350 (RootContext.LookupType): Added a cache for values looked up in
25351 the declaration space.
25353 * typemanager.cs (FindMembers): Now is a front-end to
25354 RealFindMembers, and provides a two-level hashtable-based cache to
25357 15% performance improvement: from 22.5 to 19.2 seconds.
25359 * expression.cs (IsParamsMethodApplicable): use foreach.
25360 (Invocation.DoResolve): ditto.
25361 (New.DoResolve): ditto.
25362 (ArrayCreation.DoResolve): ditto.
25364 * ecore.cs (FindMostEncompassingType): use foreach.
25366 * delegate.cs (NewDelegate.DoResolve): Use foreach
25368 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25369 (RemoveMethods): use foreach.
25371 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25372 nested foreach statements instead of for, and also break out of
25373 the inner loop once a match is found.
25375 (Invocation.OverloadResolve): Use foreach, simplify the code.
25377 2002-05-08 Miguel de Icaza <miguel@ximian.com>
25379 * cfold.cs (BinaryFold): During an enumeration evaluation context,
25380 we actually unwrap the expression to allow for extra information
25383 * expression.cs: Use Shr_Un on unsigned operations.
25385 2002-05-08 Ravi Pratap <ravi@ximian.com>
25387 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
25388 applicable operators was not being considered correctly. This closes
25389 the bug Miguel reported.
25391 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25393 * attribute.cs: check that the type derives from System.Attribute
25394 and report the correct error in that case (moved the duplicate code to
25395 its own method, too).
25397 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25399 * attribute.cs: lookup attribute type name as the spec says: first the
25400 bare attribute name and then name + "Attribute" (nant compiles with
25401 mcs after this fix).
25403 2002-05-07 Miguel de Icaza <miguel@ximian.com>
25405 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
25406 Because of the way we parse things, we should try to see if a
25407 UIntConstant can fit in an integer.
25409 2002-05-07 Ravi Pratap <ravi@ximian.com>
25411 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25412 when we are in an explicit context.
25414 (ConvertReferenceExplicit): When converting from Iface type S to Class
25415 T make sure the rules are implemented as an OR.
25417 * parameter.cs (ParameterType): Make it a property for now although the
25418 purpose really isn't anything immediate.
25420 * expression.cs (Is*Applicable): Do better checking on the parameter type
25421 of a ref/out parameter. The ones from the system assemblies are already
25422 marked with the correct type so we don't need to do any correction.
25424 * ecore.cs (StandardConversionExists): Conversion from Interface types to
25425 the object type is standard too so include that.
25427 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25429 * ecore.cs (StandardConversionExists): Augment with missing code:
25430 deal with IntConstant, LongConstants and Enumerations.
25432 * assign.cs: Report the error, instead of failing silently
25434 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25435 typecontainer that they are declared, because the
25436 typecontainer/namespace will have the list of using clauses that
25437 need to be applied.
25439 Assembly Attributes were escaping the normal registration
25442 (EmitCode): Apply attributes within an EmitContext that represents
25443 the container they were declared on.
25445 * cs-parser.jay: Track bases for structs. How did I get this wrong?
25447 2002-05-06 Ravi Pratap <ravi@ximian.com>
25449 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25450 Revamp completely - make much cleaner as we now operate only
25453 (FindMostSpecificSource, FindMostSpecificTarget): New methods
25454 to implement the logic detailed in the spec more correctly.
25456 (UserDefinedConversion): Update accordingly.
25458 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25460 * statement.cs: Return flow analysis information up.
25462 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25465 (token): Do not consume an extra character before calling
25468 2002-05-06 Piers Haken <piersh@friskit.com>
25470 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25472 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25474 * class.cs (Constructor.Emit): Set the IsStatic flag in the
25475 EmitContext during the instance constructor initializer
25476 resolution, to stop access to instance variables.
25478 This is mandated by the spec, last paragraph of the `constructor
25479 initializers' section.
25481 2002-05-05 Miguel de Icaza <miguel@ximian.com>
25483 * cs-parser.jay, class.cs (Accessor): new class used to represent
25484 an accessor (get or set). In the past we used `null' to represent
25485 a missing accessor. But this is ambiguous because there was no
25486 way to tell in abstract indexers/properties if one of them was
25489 Now there is a way of addressing that.
25491 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25492 instead of FindMembers.
25494 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25495 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25497 * attribute.cs: Treat indexers and properties as the same in terms
25498 of applying attributes
25500 * ecore.cs (FindMostEncompassedType): Use statically initialized
25501 EmptyExpressions()s like we do elsewhere to avoid creating useless
25502 objects (and we take this out of the tight loop).
25504 (GetConversionOperators): Move the code to extract the actual
25505 operators to a separate routine to clean things up.
25507 2002-05-04 Miguel de Icaza <miguel@ximian.com>
25509 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25510 events are always registered FieldBuilders.
25512 * class.cs (FieldBase): New class shared by Fields
25514 * delegate.cs: If we are a toplevel delegate, use our full name.
25515 If we are a nested delegate, then only use our tail name.
25517 2002-05-02 Ravi Pratap <ravi@ximian.com>
25519 * expression.cs (IsApplicable): Ensure that we add the "&" to
25520 ref/out types before comparing it with the type of the argument.
25522 (IsParamsMethodApplicable): Ditto.
25524 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
25527 * delegate.cs : Handle the case when we have more than one applicable
25528 method. Flag an error only when we finish checking all.
25530 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25532 * expression.cs: Add support for boolean static initializers.
25534 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25536 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25538 * parameter.cs (ComputeParameterTypes,
25539 ComputeAndDefineParameterTypes): Better error handling: now we
25540 clear the `types' cache if we fail during any of the type lookups.
25541 We also return the status code correctly to our caller
25543 * delegate.cs: If we fail to define a delegate, abort the extra
25546 * expression.cs (Binary.ResolveOperator): for
25547 operator==(object,object) and operator !=(object, object) we also
25548 have to verify that there is an implicit conversion from one to
25551 (ArrayAccess.DoResolve): Array Access can operate on
25554 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25556 * assign.cs (CompoundAssign): A new class used as a "flag" that
25557 the assignment actually is happening as part of a compound
25558 assignment operator.
25560 During compound assignment, a few new rules exist to enable things
25567 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25568 to the type of x) if y is implicitly convertible to the type of x,
25569 and the operator is a builtin operator and the return type of the
25570 operator is explicitly convertible to the type of x.
25572 * rootcontext.cs: Reset warning level to 2. 4 catches various
25573 "interesting" features in mcs, we must clean this up at some
25574 point, but currently am trying to kill other bugs ;-)
25576 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25577 in container classes as well.
25579 * expression.cs (Binary.ResolveOperator): Handle string case
25580 before anything else (as operator overloading does emit an error
25581 before doing anything else).
25583 This code could go away when we move to a table driven model, but
25584 i could not come up with a good plan last night.
25586 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25588 * typemanager.cs (CSharpName): reimplementation using regex.
25589 * class.cs: added null check for fields in Emit
25590 * rootcontext.cs: set warninglevel to 4
25592 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25594 * typemanager.cs (CSharpName): reimplemented with Lupus
25597 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25599 * statement.cs (If): correclty implement Resolve, because we were
25600 not catching sem errors in there. The same process is needed
25602 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25605 (Statement.Warning_DeadCodeFound): Factorize code.
25606 (While): Report dead code here too.
25608 (Statement): Added Resolve virtual method to allow
25609 for resolution split from the emit code.
25611 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25613 * statement.cs (EmitBoolExpression): No longer try to resolve the
25615 (MakeBoolean): New utility function that resolve, implicitly
25616 converts to boolean and tags the expression.
25619 (If, Do): Implement dead code elimination.
25620 (While): Implement loop inversion
25622 (Do, While, For, If): Resolve the expression prior to calling our
25625 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25628 - added method Report28 (warning: program has more than one entry point)
25629 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25630 - modified method Method.Define, the part at the end of the method
25632 * rootcontext.cs: added static public Location EntryPointLocation;
25634 * ../errors/cs0028.cs : Add test case for the above warning.
25637 - modified method CSharpName to allow arrays of primitive type to
25638 be printed nicely (e.g. instead of System.Int32[][] it now prints
25640 - added method CSharpSignature: returns the signature of a method
25641 in string format to be used in reporting errors, warnings, etc.
25643 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25646 2002-04-26 Ravi Pratap <ravi@ximian.com>
25648 * delegate.cs (Define): Fix extremely silly bug where I was
25649 setting the type of the 'object' parameter of the BeginInvoke
25650 method to System.IAsyncResult instead of System.Object ;-)
25652 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25654 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25657 (Constructor.Emit): return if we fail to initialize the
25658 constructor. Another door closed!
25660 * expression.cs (New.DoResolve): Improve error message (from -6 to
25661 1501). Use DeclaredOnly lookup to find the exact constructor.
25663 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25664 loop. This is useful.
25666 * cs-parser.jay: Adjust the default parameters so that destructors
25667 have the proper signature.
25669 2002-04-26 Martin Baulig <martin@gnome.org>
25671 * driver.cs (LoadAssembly): If `assembly' contains any characters
25672 which are only valid in path names and not in assembly names
25673 (currently slash, backslash and point), use Assembly.LoadFrom ()
25674 instead of Assembly.Load () on the `assembly' (before iteration
25675 over the link_paths).
25677 2002-04-26 Martin Baulig <martin@gnome.org>
25679 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25681 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25683 * class.cs (Property): use the new typemanager.MemberLookup
25685 (TypeContainer.MemberLookup): Implement using the
25686 TypeManager.MemberLookup now.
25688 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25689 and return MemberInfos, so that these can be used without an
25690 EmitContext (what we had before).
25692 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25694 * expression.cs: Fix the case where the argument to params if the
25695 type of the params. I omitted handling this before. Fixed
25697 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25699 * driver.cs: Call BootCorlib_PopulateCoreType
25701 * class.cs (Property.CheckBase): Check for properties only, not
25704 * interface.cs: Temporary hack: try/catch around the
25705 CustomAttributeBuilder, because I am getting an exception that I
25708 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25709 types whose definitions are required to be there (attributes are
25710 defined before standard types).
25712 Compute definitions as we boot the various types, as they are used
25713 immediately (value_type class will need object_type, but if we do
25714 not initialize object_type, we will pass a null, which will let
25715 the runtime pick the System.Object from the existing corlib, which
25716 is not what we want).
25718 2002-04-22 Patrik Torstensson <totte@labs2.com>
25720 * cs-tokenizer.cs: fixed a number of trim() issues.
25722 2002-04-22 Ravi Pratap <ravi@ximian.com>
25724 * expression.cs (Argument.Type): Ensure that we return the correct
25725 type when we have out or ref parameters [in which case we
25728 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25730 * class.cs (Property, Indexer): Allow extern modifier in there.
25732 * typemanager.cs (InitBaseTypes): Initializes object_type and
25733 value_type, since those will be used early on during the bootstrap
25734 process to compile corlib.
25736 (InitCoreTypes): Move code from here to InitBaseTypes.
25738 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25740 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25741 single-dimension arrays as using the ldlen opcode.
25743 Daniel Lewis discovered this optimization.
25745 * typemanager.cs: Add signature for System.Array::get_Length
25747 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25749 * statement.cs: report the error when the foreach does not apply to an
25750 array nor a collection.
25752 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25754 * expression.cs: Add implicit conversions to the operator ~.
25756 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25758 * typemanager.cs: Locate the decimal constructor.
25760 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25762 * attribute.cs: use the new property of TypeOf.
25763 * expression.cs: added 'get' property around typearg.
25765 These changes fix a build breaker reported by NickD. Is this the
25766 correct way to fix? If not, please, revert my changes and make it
25769 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25771 * attribute.cs: Add support for typeof in attribute invocations.
25772 I am not sure that this is right though.
25774 2002-04-14 Duncan Mak <duncan@ximian.com>
25776 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25777 Binary.Operator.Division case.
25779 2002-04-13 Ravi Pratap <ravi@ximian.com>
25781 * class.cs (DefineType): Ensure that we do a proper check on
25782 attribute types and also register it with the TypeManager.
25784 (TypeContainer.Targets): The default for attribute types is
25785 AttributeTargets.All.
25787 * attribute.cs (ApplyAttributes): Registering the attribute type
25788 is done elsewhere, not when we discover we have a Usage attribute.
25790 2002-04-12 Ravi Pratap <ravi@ximian.com>
25792 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25793 and get rid of is_delegate parameter.
25795 * everywhere : update.
25797 2002-04-12 Ravi Pratap <ravi@ximian.com>
25799 * cs-parser.jay (compilation_unit): Revamp completely to use
25800 some new ideas that I got from Rhys' grammar to solve the problems
25801 with assembly level attributes.
25803 (outer_declaration): New grammar production.
25805 (attribute_sections): Add.
25807 (opt_attributes): Base on attribute_sections
25809 (namespace_declaration): Allow opt_attributes to tackle the case
25810 when we have assembly level attributes - we are clever in this
25813 * attribute.cs (ApplyAttributes): Do not worry about assembly
25814 attributes in the non-global context.
25816 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25817 instead of SetGlobalAttributes.
25819 * class.cs, rootcontext.cs : Ensure we define and generate
25820 attribute types before anything else.
25822 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25823 and flag the new error -20 for the case when the attribute type
25824 does not have valid targets specified. csc does not catch this.
25826 * ../errors/errors.txt : update for error # -20
25828 2002-04-11 Ravi Pratap <ravi@ximian.com>
25830 * support.cs (InternalParameters.ParameterModifier): Do some null
25831 checking and return sane values.
25833 * class.cs (Method.Define): If we are a PInvoke method, ensure
25834 that we are static and extern. Report error # 601
25836 * ../errors/cs0601.cs : Add test case for the above error.
25838 2002-04-07 Ravi Pratap <ravi@ximian.com>
25840 * rootcontext.cs (attribute_types): We need to keep type of
25841 all attribute types separately and emit code for them first.
25843 (RegisterAttribute) : Implement.
25845 * class.cs (DefineType): Check if the current Type is a custom
25846 attribute type and register it accordingly.
25848 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25849 adding the first attribute twice and rename to
25851 (SetGlobalAttributes): this.
25853 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25856 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25857 if we are processing global arguments. Hmm, I am unsure of this.
25859 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25861 * expression.cs: added static array of strings to avoid calling
25862 Enum.ToString () for Operator in Binary. Significant recover of
25865 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25867 * class.cs (FindMembers): Allow the Builders of the various
25868 members to be null. If they are skip them. This only happens
25869 during the PInvoke declaration.
25871 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25873 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25874 failure, so we do not keep going afterwards.
25876 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25877 wanted to pass `false' as the `is_delegate' argument. If this is
25878 the case, why not use delegate_type == null to mean `is_delegate =
25879 false' and anything else as is_delegate = true.
25881 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25883 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25884 code for the section, not the beginning of the tests.
25886 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25888 * cfold.cs: Handle operator + (Enum x, Underlying x)
25890 * expression.cs (Binary): same. Warn about errors where we have
25891 Enum/Enum in operator + as well.
25893 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25896 - added support for switch(bool)
25897 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25898 - add TableSwitchEmit() to handle table-based switch statements
25900 2002-04-05 Ravi Pratap <ravi@ximian.com>
25902 * expression.cs (Invocation.OverloadResolve): Factor out code which
25903 does parameter compatibility checking with arguments so that we can
25904 re-use the code even from Delegate.VerifyApplicability
25906 (VerifyArgumentsCompat): Move above code here.
25908 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25909 and instead make a call to the above method.
25911 2002-03-31 Ravi Pratap <ravi@ximian.com>
25913 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25914 We use it to keep track of classes which are attribute types.
25916 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25918 * delegate.cs (Delegate.Define): Correctly define the types in the
25919 presence of fixed and array parameters.
25921 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25924 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25925 include NonPublic after the first iteration.
25927 * class.cs (Indexer.CheckBase): Only check if both parents are
25930 * cs-parser.jay (accessor_body): If empty, set to null.
25932 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25933 same code path here to resolve constants names that we did have in
25934 MemberAccess.DoResolve. There is too much code duplicated here.
25936 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25938 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25940 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25943 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25944 tokens, numbers and strings.
25946 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25949 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25950 asyncronous parameters and the regular parameters.
25952 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25953 specify the target directory.
25955 * expression.cs: (This.DoResolve): Simplify
25956 (As.Emit): Optimize, do not generate IsInst if the expression is
25957 always of the given type.
25959 (Is.DoResolve): Bug fix, we were reporting both always/never for
25962 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25963 creating too many unnecessary arrays.
25965 2002-03-31 Miguel de Icaza <miguel@ximian.com>
25967 * class.cs (EmitFieldInitializer): Use Assign expression to assign
25968 fields instead of rolling our own initializer. Takes care of all
25969 implicit conversions, and drops unnecessary static checks/argument.
25971 2002-03-31 Dick Porter <dick@ximian.com>
25973 * driver.cs: use the GetDirectories() return values properly, and
25974 use "/" as path separator.
25976 2002-03-30 Miguel de Icaza <miguel@ximian.com>
25978 * expression.cs (Unary): Optimize - - expr into expr.
25979 (Binary): Optimize a + (-b) into a -b.
25981 * codegen.cs (CodeGen): Made all methods static.
25983 2002-03-29 Miguel de Icaza <miguel@ximian.com>
25987 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25988 TypeBuilder property.
25990 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25993 * tree.cs: Removed the various RecordXXXX, and replaced with a
25994 single RecordDecl. Removed all the accessor methods, and just
25995 left a single access point Type
25997 * enum.cs: Rename DefineEnum to DefineType.
25999 * decl.cs: New abstract method `DefineType' used to unify the
26000 Defines for Enumerations, Interfaces, TypeContainers and
26003 (FindType): Moved LookupInterfaceOrClass here. Moved the
26004 LookupBaseClasses method that used to live in class.cs and
26005 interface.cs here, and renamed to FindType.
26007 * delegate.cs: Implement DefineType. Take advantage of the
26008 refactored pattern for locating the parent builder without taking
26009 the parent_builder argument (which we know does not work if we are
26010 nested, and triggering a toplevel definition).
26012 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26014 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26015 accessibility of a member has changed during override and report
26018 * class.cs (Method.Define, Property.Define): Only complain on
26019 overrides if the method is private, any other accessibility is
26020 fine (and since we just checked the permission is the same, we are
26023 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26024 and elif are processed always. The other pre-processing
26025 directives are only processed if we are "taking" the path
26027 2002-03-29 Martin Baulig <martin@gnome.org>
26029 * class.cs (Method.Emit): Only emit symbolic debugging info if the
26030 current location is not Null.
26032 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26033 a separate method so we can profile it.
26035 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26036 `span.Seconds' are just seconds, but no minutes or hours.
26037 (MainDriver): Profile the CodeGen.SaveSymbols calls.
26039 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26041 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26042 Remove the gratuitous set of Final:
26044 // If an interface implementation, then we can set Final.
26045 if (((flags & MethodAttributes.Abstract) == 0) &&
26046 implementing.DeclaringType.IsInterface)
26047 flags |= MethodAttributes.Final;
26049 I do not know what I was smoking when I used that.
26052 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26053 step into fixing the name resolution issues for delegates and
26054 unifying the toplevel name resolution.
26056 2002-03-28 Martin Baulig <martin@gnome.org>
26058 * class.cs (Method.Emit): If we have a symbol writer, call its
26059 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26060 tell it about the current method.
26062 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26063 writer that we're going to emit the first byte of IL code for a new
26064 statement (a new source line).
26065 (EmitContext.EmitTopBlock): If we have a symbol writer, call
26066 EmitContext.Mark() before emitting any code.
26068 * location.cs (SymbolDocument): Return null when we're Null.
26070 * statement.cs (Statement): Moved the `Location loc' variable here.
26071 (Statement.EmitBoolExpression): If we have a symbol writer, call
26072 ec.Mark() before emitting any code to tell it that we're at the
26073 beginning of a new statement.
26074 (StatementExpression): Added `Location' argument to the constructor.
26075 (Block): Added public readonly variable `StartLocation' and public
26076 variable `EndLocation'. The latter is to be set using SetEndLocation().
26077 (Block): Added constructor which takes a start and end location.
26078 (Block.SetEndLocation): New method. This sets the end location.
26079 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26080 local variables we create.
26081 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26082 each statement and do also mark the begin and end of the block.
26084 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26085 tell it the current lexer.Location, use Location.Null for the end of the
26087 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26088 current block, set its end location using SetEndLocation().
26089 (statement_expression): StatementExpression constructor now takes the
26090 lexer.Location as additional argument.
26091 (for_statement, declare_local_variables): Likewise.
26092 (declare_local_variables): When creating a new implicit block, use the
26093 new Block constructor and pass it the lexer.Location.
26095 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26097 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26098 members also on the parent interfaces recursively.
26100 2002-03-27 Miguel de Icaza <miguel@ximian.com>
26102 * report.cs: Use new formats, since Gonzalo finished the missing
26105 * expression.cs (Binary.ResolveOperator): added missing operator|
26106 operator& and operator^ for bool/bool.
26108 * cs-parser.jay: CheckDef now takes a Location argument that is
26109 used to report errors more precisly (instead of reporting the end
26110 of a definition, we try to track something which is a lot closer
26111 to the source of the problem).
26113 * cs-tokenizer.cs: Track global token use, so we can properly flag
26114 the use of #define/#undef after the first token has been seen.
26116 Also, rename the reportXXXX to Error_DescriptiveName
26118 * decl.cs (DeclSpace.IsTopLevel): Move property here from
26119 TypeContainer, so that Enum and Interface can use this too.
26121 * class.cs (TypeContainer.LookupInterfaceOrClass,
26122 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26123 `builder' argument. Typically this was used to pass the parent
26124 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26127 The problem is that a nested class could trigger the definition of
26128 a toplevel class, and the builder would be obviously wrong in that
26131 So we drop this argument, and we compute dynamically the
26132 TypeBuilder/ModuleBuilder (the correct information was available
26133 to us anyways from DeclSpace.Parent)
26135 * interface.cs (Interface.DefineInterface): Drop builder
26136 parameter cleanup like class.cs
26138 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
26141 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26144 (Try.Emit): Propagate the returns value from the statement.
26146 (Return.Emit): Even if we are leavning
26148 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26150 * modifiers.cs: Fix the computation of MethodAttributes flags.
26152 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26154 * driver.cs: allow compilation of files that start with '/'.
26155 Add a default case when checking the argument of --target.
26157 2002-03-25 Miguel de Icaza <miguel@ximian.com>
26159 * interface.cs: Implement the same search algorithm for types in
26160 the interface code.
26162 * delegate.cs: Do not allow multiple definition.
26164 * Recovered ChangeLog that got accidentally amputated
26166 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26168 * rootcontext.cs: Load manually enum to allow core classes to
26169 contain enumerations.
26171 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26172 Update to new static methods in TypeManager.
26174 * typemanager.cs (GetMethod, GetConstructor): Use our
26175 implementation of FindMembers to find the members, since during
26176 corlib compilation, the types are TypeBuilders and GetMethod and
26177 GetConstructor do not work.
26179 Make all methods in TypeManager static.
26181 (InitCodeHelpers): Split the functionality from
26182 the InitCodeTypes function.
26184 * driver.cs: Call InitCodeHelpers after we have populated the
26187 * cs-parser.jay (delegate_declaration): we did not used to compute
26188 the delegate name correctly for void delegates.
26190 2002-03-24 Miguel de Icaza <miguel@ximian.com>
26192 * rootcontext.cs (RootContext): Init the interface_resolve_order
26193 and type_container_resolve_order always.
26195 (ResolveCore, BootstrapCorlib_ResolveClass,
26196 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26197 compiler when compiling with --nostdlib
26199 * class.cs (TypeContainer.DefineType): Check that our parent is
26200 not null. This test is most important when we are bootstraping
26203 * codegen.cs: Split out the symbol writing code.
26205 2002-03-25 Martin Baulig <martin@gnome.org>
26207 * driver.cs (-g): Made -g an alias for --debug.
26209 2002-03-24 Martin Baulig <martin@gnome.org>
26211 * codegen.cs (SymbolWriter): New public variable. Returns the
26212 current symbol writer.
26213 (CodeGen): Added `bool want_debugging_support' argument to the
26214 constructor. If true, tell the ModuleBuild that we want debugging
26215 support and ask it for the ISymbolWriter.
26216 (Save): If we have a symbol writer, call it's Close() method after
26217 saving the assembly.
26219 * driver.c (--debug): New command line argument to create a
26220 debugger information file.
26222 * location.cs (SymbolDocument): New public property. Returns an
26223 ISymbolDocumentWriter object for the current source file or null
26224 if we don't have a symbol writer.
26226 2002-03-21 Miguel de Icaza <miguel@ximian.com>
26228 * driver.cs (LoadAssembly): Correctly return when all the paths
26229 have been tried and not before.
26231 * statement.cs (Switch.Emit): return the actual coverage for this
26232 statement (returns/not-returns)
26234 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26235 switch of the statement if we are the last switch section. That
26236 kills two problems: try/catch problems (we used to emit an empty
26237 nop at the end) and switch statements where all branches would
26240 2002-03-19 Miguel de Icaza <miguel@ximian.com>
26242 * driver.cs: Add default assemblies (the equivalent to the
26243 Microsoft CSC.RSP file)
26245 * cs-tokenizer.cs: When updating `cols and setting it to zero,
26246 also update tokens_seen and set it to false.
26248 * driver.cs: Implement --recurse for Mike.
26250 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26251 correctly splitting out the paths.
26253 2002-03-18 Miguel de Icaza <miguel@ximian.com>
26255 * interface.cs (Interface.PopulateProperty): Instead of using
26256 `parent' as the declaration space for the set parameters, use
26259 * support.cs (InternalParameters): InternalParameters constructor
26260 takes a DeclSpace instead of a TypeContainer.
26262 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26263 types are being initialized, load the address of it before calling
26266 (New): Provide a mechanism to disable the generation of local
26267 value type temporaries when the caller will be providing us with
26268 an address to store it.
26270 (ArrayCreation.EmitDynamicInitializers): Use it.
26272 2002-03-17 Miguel de Icaza <miguel@ximian.com>
26274 * expression.cs (Invocation.EmitArguments): Only probe for array
26275 property if there is more than one argument. Sorry about that.
26277 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26278 empty param arrays.
26280 * class.cs (Method.LabelParameters): Fix incorrect code path that
26281 prevented the `ParamArrayAttribute' from being applied to the
26284 2002-03-16 Miguel de Icaza <miguel@ximian.com>
26286 * support.cs (ReflectionParameters): Correctly compute whether the
26287 last argument is a params array. Fixes the problem with
26290 * typemanager.cs: Make the assemblies array always be non-null
26291 (empty, but non-null)
26293 * tree.cs (RecordDecl): New function that abstracts the recording
26294 of names. This reports error 101, and provides a pointer to the
26295 previous declaration. Fixes a crash in the compiler.
26297 * cs-parser.jay (constructor_declaration): Update to new grammar,
26298 and provide a constructor_body that can be empty.
26300 2002-03-15 Miguel de Icaza <miguel@ximian.com>
26302 * driver.cs: Add support for --resources.
26304 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26305 Make all types for the various array helper methods be integer.
26307 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26308 CheckState to ConvCast.
26310 (ConvCast): Now it takes a `checked' state argument, to avoid
26311 depending on the emit context for the conversion, and just using
26312 the resolve time setting.
26314 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26315 instead of Invocation.EmitArguments. We do not emit the original
26316 arguments, instead we emit those which have been converted to
26317 unsigned int expressions.
26319 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26321 * codegen.cs: ditto.
26323 * expression.cs (LocalVariableReference): Drop the use of the
26324 Store function that depended on the variable index.
26326 * statement.cs (VariableInfo): Drop the `Idx' property from this
26327 class, as this is not taking into account the indexes for
26328 temporaries tat we generate during the execution, getting the
26331 * class.cs: First emit class initializers, then call the parent
26334 * expression.cs (Binary): Fix opcode emision.
26335 (UnaryMutator.EmitCode): Support checked code generation
26337 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26338 matches for events for both the Static and Instance scans,
26339 pointing to the same element. Fix that.
26341 2002-03-14 Miguel de Icaza <miguel@ximian.com>
26343 * rootcontext.cs (ResolveTree): Always set the
26344 interface_resolve_order, because nested interfaces will be calling
26347 * class.cs (GetInterfaceOrClass): Track the same resolution
26348 process used by TypeManager.LookupType. This fixes the nested
26349 type lookups in class declarations (separate path from
26352 (TypeContainer.DefineType): Also define nested interfaces.
26353 (TypeContainer.RegisterOrder): New public function used to
26354 register the order in which child interfaces need to be closed.
26356 Nested interfaces need to be closed after their parents have been
26359 * interface.cs (InterfaceAttr): Put all the logic for computing
26360 the interface attribute here.
26362 (DefineInterface): Register our interface order with the
26363 RootContext or with the TypeContainer depending on the case.
26365 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26367 * cs-parser.jay: rework foreach statement to work with the new
26368 changes to the policy on SimpleNames.
26370 * report.cs: support Stacktrace on warnings as well.
26372 * makefile: drop --unsafe and /unsafe from the compile.
26374 2002-03-13 Ravi Pratap <ravi@ximian.com>
26376 * ecore.cs (StandardConversionExists): Modify to take an Expression
26377 as the first parameter. Ensure we do null -> reference type conversion
26380 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26381 temporary Expression objects.
26383 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26385 * interface.cs: workaround bug in method overloading resolution
26386 (there is already a bugzilla bug for it).
26388 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26390 We could also solve this problem by having a separate path for
26391 performing type lookups, instead of DoResolve, we could have a
26392 ResolveType entry point, and only participating pieces of the
26393 production (simplename, deref, array) would implement this.
26395 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26396 signal SimpleName to only resolve type names and not attempt to
26397 resolve anything else.
26399 * expression.cs (Cast): Set the flag.
26401 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26403 * class.cs: Only report 108 if there is no `new' modifier.
26405 * cs-parser.jay: rework foreach statement to work with the new
26406 changes to the policy on SimpleNames.
26408 * report.cs: support Stacktrace on warnings as well.
26410 * makefile: drop --unsafe and /unsafe from the compile.
26412 2002-03-11 Miguel de Icaza <miguel@ximian.com>
26414 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26415 lookups here, instead of doing that at parse time. This means
26416 that our grammar will not introduce `LocalVariableReferences' as
26417 expressions at this point. That solves the problem of code like
26421 static void Main ()
26425 This is only half the fix. The full fix requires parameters to
26426 also be handled in this way.
26428 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26429 makes the use more obvious of the DeclSpace. The
26430 ec.TypeContainer.TypeBuilder is now only used to pull the
26431 TypeBuilder for it.
26433 My theory is that I can get rid of the TypeBuilder completely from
26434 the EmitContext, and have typecasts where it is used (from
26435 DeclSpace to where it matters).
26437 The only pending problem is that the code that implements Aliases
26438 is on TypeContainer, and probably should go in DeclSpace.
26440 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26441 lookups here, instead of doing that at parse time. This means
26442 that our grammar will not introduce `LocalVariableReferences' as
26443 expressions at this point. That solves the problem of code like
26447 static void Main ()
26451 This is only half the fix. The full fix requires parameters to
26452 also be handled in this way.
26454 * class.cs (Property.DefineMethod): When implementing an interface
26455 method, set newslot, when implementing an abstract method, do not
26456 set the flag (before we tried never setting it, or always setting
26457 it, which is the difference).
26458 (Indexer.DefineMethod): same.
26459 (Method.DefineMethod): same.
26461 * ecore.cs: Only set the status used flag if we get back a Field.
26463 * attribute.cs: Temporary hack, so Paolo can keep working.
26465 2002-03-08 Ravi Pratap <ravi@ximian.com>
26467 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26468 the unmanaged type in the case we have a MarshalAs attribute.
26470 (Resolve): Handle the case when we are parsing the special MarshalAs
26471 attribute [we need to store the unmanaged type to use later]
26473 * typemanager.cs (marshal_as_attr_type): Built in type for the
26474 MarshalAs Attribute.
26476 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
26477 on parameters and accordingly set the marshalling info.
26479 2002-03-09 Miguel de Icaza <miguel@ximian.com>
26481 * class.cs: Optimizing slightly by removing redundant code after
26482 we switched to the `NoTypes' return value.
26483 (Property.DefineMethod): use NoTypes here too.
26485 This fixes the bug I introduced in my last batch of changes.
26487 2002-03-05 Ravi Pratap <ravi@ximian.com>
26489 * tree.cs (RecordEnum): Add. We now keep track of enums too.
26491 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26492 Enums since those are types too.
26494 * cs-parser.jay (enum_declaration): Record enums as we parse them.
26496 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
26497 thanks to a call during the lookup process.
26499 2002-03-07 Miguel de Icaza <miguel@ximian.com>
26501 * statement.cs (Foreach): Lots of work to accomodate a particular
26502 kind of foreach statement that I had not kept in mind. It is
26503 possible to have foreachs on classes that provide a GetEnumerator
26504 method that return objects that implement the "pattern" for using
26505 a foreach, there is no need to support GetEnumerator
26508 This is needed to compile nant.
26510 * decl.cs: Only report 114 if the member is not `Finalize' and if
26511 the warning level is at least 2.
26513 * class.cs: Moved the compare function from Method to
26516 (MethodSignature.InheritableMemberSignatureCompare): Add new
26517 filter function that is used to extract inheritable methods from a
26520 (Method.Define): Use the new `inheritable_method_signature_filter'
26523 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26526 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26528 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26530 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26532 * expression.cs: Pass location information to
26533 ConvertImplicitStandard.
26535 * class.cs: Added debugging code to track return values from
26538 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26540 * expression.cs (Is.DoResolve): If either side of the `is' is an
26541 interface, do not flag the warning.
26543 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26546 * report.cs: Allow for --fatal to be used with --probe.
26548 * typemanager.cs (NoTypes): Move the definition for the empty Type
26551 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26553 (TypeContainer.DefineProxy): New function used to proxy to parent
26554 implementations when implementing interfaces.
26555 (TypeContainer.ParentImplements): used to lookup if our parent
26556 implements a public function that is required by an interface.
26557 (TypeContainer.VerifyPendingMethods): Hook this up.
26559 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26560 `modules' and `assemblies' arraylists into arrays. We only grow
26561 these are the very early start up of the program, so this improves
26562 the speedof LookupType (nicely measured).
26564 * expression.cs (MakeByteBlob): Replaced unsafe code with
26565 BitConverter, as suggested by Paolo.
26567 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26568 folding of string concatenation, but if either side is a string,
26569 and the other is not, then return null, and let the runtime use
26570 the concatenation on the string plus the object (using
26571 `Object.ToString').
26573 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26575 Constant Folding has been implemented now.
26577 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26578 the error instead on types that are not supported in one's
26581 * constant.cs (Constant and all children): New set of functions to
26582 perform implict and explicit conversions.
26584 * ecore.cs (EnumConstant): Implement the new functions to perform
26585 conversion by proxying to the child expression.
26587 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26588 own separate setting that can not be turned off from the command
26589 line using --unchecked or --checked and is only controlled using
26590 the checked/unchecked statements and expressions. This setting is
26591 used by the constant folder to flag errors.
26593 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26594 ConstantCheckState as well.
26596 During Resolve, they also have to flag the state, because the
26597 constant folder runs completely in the Resolve phase.
26599 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26602 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26604 * cfold.cs: New file, this file contains the constant folder.
26606 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26607 argument to track whether we are using the resulting address to
26608 load or store a value and provide better error messages.
26610 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26611 new AddressOf arguments.
26613 * statement.cs (Foreach.EmitCollectionForeach): Update
26615 * expression.cs (Argument.Emit): Call AddressOf with proper
26616 arguments to track usage.
26618 (New.DoEmit): Call AddressOf with new arguments.
26620 (Unary.Emit): Adjust AddressOf call.
26622 2002-03-01 Ravi Pratap <ravi@ximian.com>
26624 * cs-parser.jay (member_access): Change the case for pre-defined types
26625 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26628 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26631 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26632 essentially like methods and apply attributes like MethodImplOptions to them too.
26634 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26637 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26638 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26641 * Update code everywhere accordingly.
26643 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26645 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26647 2002-02-28 Ravi Pratap <ravi@ximian.com>
26649 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26650 try performing lookups against those instead of jumping straight into using
26651 the 'using' clauses.
26653 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26655 (LookupType): Perform lookups in implicit parents too.
26657 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26658 sequence as RootContext.LookupType.
26660 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26661 the various cases of namespace lookups into this method.
26663 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26665 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26666 in positional arguments)
26668 * class.cs (Operator): Update the AllowedModifiers to contain
26671 * cs-parser.jay: Update operator declaration to allow for the
26672 operator body to be empty.
26674 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26677 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26679 * class.cs (Method.Emit): Label parameters.
26681 * driver.cs: Return 1 or 0 as the program exit code.
26683 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26685 * expression.cs: Special case the `null' object when trying to
26686 auto-compute the type, as anything can be explicitly converted to
26689 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26690 spotting this Paolo.
26692 (Expression.ImplicitNumericConversion): Perform comparissions of
26693 the type using the underlying type in the case of an enumeration
26694 rather than using the enumeration type for the compare.
26696 Cope with the underlying == type case, which is not possible to
26699 (Expression.ConvertNumericExplicit): Perform comparissions of
26700 the type using the underlying type in the case of an enumeration
26701 rather than using the enumeration type for the compare.
26703 * driver.cs: If the user does not supply an extension, assume .exe
26705 * cs-parser.jay (if_statement): Rewrote so that we can track the
26706 location for the if statement.
26708 * expression.cs (Binary.ConstantFold): Only concat strings when
26709 the operation is "+", not everything ;-)
26711 * statement.cs (Statement.EmitBoolExpression): Take a location
26713 (If, While, Do): Track location.
26715 * expression.cs (Binary.ResolveOperator): In the object + string
26716 case, I was missing a call to ConvertImplicit
26718 2002-02-25 Ravi Pratap <ravi@ximian.com>
26720 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26721 Location arguments. Ensure we use RootContext.LookupType to do our work
26722 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26724 * interface.cs (PopulateMethod): Handle the type of the parameter being
26727 * expression.cs (Invocation.BetterFunction): Handle the case when we
26728 have a params method with no fixed arguments and a call is made with no
26731 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26733 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26734 the verbatim-string-literal
26736 * support.cs (InternalParameters.ParameterModifier): handle null
26738 (InternalParameters.ParameterType): ditto.
26740 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26741 duplicating the name of the variable parameter.
26742 (GetParameterByName): Fix bug where we were not looking up array
26743 paramters if they were the only present (thanks Paolo!).
26744 (GetParameterInfo): We only have an empty set of types if both
26745 fixed and array are set to null.
26746 (GetParameterInfo-idx): Handle FixedParameter == null
26748 * cs-parser.jay: Handle the case where there is no catch
26749 statements (missing null test).
26751 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26753 * driver.cs (MainDriver): Be conservative on our command line
26756 Catch DirectoryNotFoundException when calling GetFiles.
26758 (SplitPathAndPattern): Used to split the input specification into
26759 a path and a pattern that we can feed to Directory.GetFiles.
26761 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26763 * statement.cs (Fixed): Implement the last case of the Fixed
26764 statement (string handling).
26766 * expression.cs (StringPtr): New class used to return a char * to
26767 a string; Used by the Fixed statement.
26769 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26771 * expression.cs (Binary.ResolveOperator): Remove redundant
26772 MemberLookup pn parent type.
26773 Optimize union call, we do not need a union if the types are the same.
26774 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26777 Specialize the use of MemberLookup everywhere, instead of using
26778 the default settings.
26780 (StackAlloc): Implement stackalloc keyword.
26782 * cs-parser.jay: Add rule to parse stackalloc.
26784 * driver.cs: Handle /h, /help, /?
26786 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26787 before we supported unsafe code.
26789 * makefile: add --unsafe to the self compilation of mcs.
26791 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26793 * expression.cs (PointerArithmetic): New class that is used to
26794 perform pointer arithmetic.
26795 (Binary.Resolve): Handle pointer arithmetic
26796 Handle pointer comparission.
26797 (ArrayPtr): Utility expression class that is used to take the
26798 address of an array.
26800 (ElementAccess): Implement array access for pointers
26802 * statement.cs (Fixed): Implement fixed statement for arrays, we
26803 are missing one more case before we are done.
26805 * expression.cs (Indirection): Implement EmitAssign and set the
26806 ExprClass to Variable. This allows pointer dereferences to be
26807 treated as variables, and to have values assigned to them.
26809 * ecore.cs (Expression.StoreFromPtr): New utility function to
26810 store values dereferencing.
26812 2002-02-20 Ravi Pratap <ravi@ximian.com>
26814 * expression.cs (Binary.ResolveOperator): Ensure that we are
26815 not trying to operate on a void type - this fixes the reported
26818 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26819 the parent implementation is sealed.
26821 * ../errors/cs0239.cs : Add.
26823 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26825 * typemanager.cs (unverifiable_code_type): Corresponds to
26826 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26827 which have unsafe code in them.
26829 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26832 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26834 * cs-tokenizer.cs: Add support for @"litreal strings"
26836 Make tokenizer accept pre-processor directives
26837 on any column (remove the old C-like limitation).
26839 * rootcontext.cs (EmitCode): Emit any global attributes.
26840 (AddGlobalAttributes): Used to keep track of assembly attributes.
26842 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26844 * cs-parser.jay: Add support for global attributes.
26846 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26848 * expression.cs (Indirection): New helper class. Unary will
26849 create Indirection classes to be able to implement the
26850 IMemoryLocation interface on it.
26852 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26854 * cs-parser.jay (fixed_statement): reference the right statement.
26856 * statement.cs (Fixed.Emit): Finish implementing the fixed
26857 statement for the &x case.
26859 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26861 * class.cs (Property.Define, Method.Define): Remove newslot when
26864 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26865 wrong. NewSlot should only be used if the `new' keyword is present.
26867 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26868 locating our system dir. Sorry about this.
26870 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26872 * driver.cs (GetSystemDir): Compute correctly the location of our
26873 system assemblies. I was using the compiler directory instead of
26874 the library directory.
26876 2002-02-13 Ravi Pratap <ravi@ximian.com>
26878 * expression.cs (BetterFunction): Put back in what Miguel commented out
26879 since it is the correct fix. The problem is elsewhere ;-)
26881 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26882 parameters of the parms method are themselves compatible or not !
26884 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26885 to check that a class implements an interface before saying that an implicit
26886 conversion was allowed. Use ImplementsInterface to do the checking.
26888 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26890 * class.cs (Method.Define): Track whether we are an explicit
26891 implementation or not. And only call DefineMethodOverride if we
26892 are an explicit implementation.
26894 (Property.DefineMethod): Ditto.
26896 2002-02-11 Ravi Pratap <ravi@ximian.com>
26898 * expression.cs (BetterFunction): Catch hideous bug which was
26899 preventing us from detecting ambiguous calls due to implicit casts i.e
26902 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26904 * support.cs (Pair): Remove un-needed method. I figured why I was
26905 getting the error in cs-parser.jay, the variable in a foreach loop
26906 is readonly, and the compiler does not really treat this as a variable.
26908 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26909 instead of EQUALS in grammar.
26911 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26913 * expression.cs (Unary.DoResolve): Check whether the argument is
26916 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26918 * support.cs: Api for Pair to set a value. Despite the fact that
26919 the variables are public the MS C# compiler refuses to compile
26920 code that accesses the field if the variable is part of a foreach
26923 * statement.cs (Fixed): Begin implementation of the fixed
26926 (Block.AddVariable): Return the VariableInfo on success and null
26927 on failure instead of true/false.
26929 * cs-parser.jay (foreach): Catch errors on variables already
26930 defined (we were ignoring this value before) and properly unwind
26931 the block hierarchy
26933 (fixed_statement): grammar for the fixed statement.
26935 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26937 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26938 pointer types to be incretemented.
26940 (SizeOf): Implement.
26942 * cs-parser.jay (pointer_member_access): Implement
26943 expr->IDENTIFIER production.
26945 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26946 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26949 (Unary): Implement indirection.
26951 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26952 use in non-unsafe context).
26954 (SimpleName.DoResolve): Check for pointers in field access on safe
26957 (Expression.LoadFromPtr): Factor the load-indirect code in this
26958 function. This was duplicated in UnboxCast and ParameterReference
26960 2002-01-24 Miguel de Icaza <miguel@ximian.com>
26962 * expression.cs (ComposedCast): report an error if a pointer cast
26963 is used in a safe region.
26965 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26966 pointer type casts in unsafe context.
26968 * codegen.cs (EmitContext): Set up IsUnsafe.
26970 * cs-parser.jay (non_expression_type): Add productions for pointer
26973 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26974 code. We should not use force into static mode if the method is
26975 not virtual. Fixes bug in MIS
26977 * statement.cs (Do.Emit, While.Emit, For.Emit,
26978 Statement.EmitBoolExpression): Add support to Do and While to
26979 propagate infinite loop as `I do return' semantics.
26981 Improve the For case to also test for boolean constants.
26983 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26984 to the list of attributes we can add.
26986 Remove `EmitContext' argument.
26988 * class.cs (Method.Define): Apply parameter attributes.
26989 (Constructor.Define): Apply parameter attributes.
26990 (MethodCore.LabelParameters): Move here the core of labeling
26993 * support.cs (ReflectionParameters.ParameterModifier,
26994 InternalParameters.ParameterModifier): Use IsByRef on the type and
26995 only return the OUT bit for these parameters instead of in/out/ref
26998 This is because I miss-understood things. The ParameterInfo.IsIn
26999 and IsOut represent whether the parameter has the [In] and [Out]
27002 2002-01-22 Miguel de Icaza <miguel@ximian.com>
27004 * ecore.cs (FieldExpr.Emit): Release temporaries.
27006 * assign.cs (LocalTemporary.Release): new function.
27008 * codegen.cs (EmitContext.GetTemporaryStorage,
27009 EmitContext.FreeTemporaryStorage): Rework the way we deal with
27010 temporary storage. Now we can "put back" localbuilders when we
27013 2002-01-21 Miguel de Icaza <miguel@ximian.com>
27015 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27016 need to make a copy of the variable to generate verifiable code.
27018 2002-01-19 Miguel de Icaza <miguel@ximian.com>
27020 * driver.cs: Compute dynamically the system directory.
27022 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27023 Slower, but more generally useful. Used by the abstract
27024 registering implementation.
27026 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27027 the rules for the special rule on Type/instances. First check if
27028 we have the same name, and if so, try that special static path
27029 rather than the instance path.
27031 2002-01-18 Miguel de Icaza <miguel@ximian.com>
27033 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27036 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27037 Enum, ValueType, Delegate or Array for non-corlib compiles.
27039 * cs-tokenizer.cs: Catch long identifiers (645)
27041 * typemanager.cs (IndexerPropetyName): Ravi never tested this
27044 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27045 fix, we were returning too early, so we were not registering
27046 pending methods from abstract classes.
27048 Do not register pending methods if the class is abstract.
27050 * expression.cs (Conditional.DoResolve): Report circular implicit
27051 conversions when we neecd to compute it for conditional
27054 (Is.DoResolve): If the expression is always of the provided type,
27055 flag warning 183. If the expression can not ever be of the
27056 provided type flag warning 184.
27058 * class.cs: Catch 169 as well.
27060 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27063 2002-01-18 Nick Drochak <ndrochak@gol.com>
27065 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
27067 2002-01-17 Miguel de Icaza <miguel@ximian.com>
27069 * interface.cs: (PopulateMethod): Check for pointers being defined
27070 only if the unsafe context is active.
27071 (PopulateProperty): ditto.
27072 (PopulateIndexer): ditto.
27074 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27075 specified. If pointers are present, make sure that they are
27076 present in an unsafe context.
27077 (Constructor, Constructor.Define): ditto.
27078 (Field, Field.Define): ditto.
27079 (Property, Property.Define): ditto.
27080 (Event, Event.Define): ditto.
27082 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27083 hashtable if there are classes or structs defined.
27085 * expression.cs (LocalVariableReference.DoResolve): Simplify this
27086 code, as the constant resolution moved.
27088 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27089 the metadata, so we can flag error 133.
27091 * decl.cs (MemberCore.UnsafeOK): New function to test that a
27092 pointer is being declared in an unsafe context.
27094 2002-01-16 Miguel de Icaza <miguel@ximian.com>
27096 * modifiers.cs (Modifiers.Check): Require a Location argument.
27097 Report error 227 for Unsafe use.
27099 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27101 * statement.cs (For.Emit): If the test is null, then report that
27102 we do `return', as we wont reach anything afterwards.
27104 (Switch.SwitchGoverningType): Track the expression that matched
27107 * driver.cs: Allow negative numbers as an error code to flag.
27109 * cs-parser.jay: Handle 1551.
27111 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27113 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27115 * cs-parser.jay: Report 1518 (type declaration can only contain
27116 class, struct, interface, enum or delegate)
27118 (switch_label): Report 1523 (keywords `case' or `default' must
27121 (opt_switch_sections): Report 1522 (empty switch)
27123 * driver.cs: Report 1515 (response file specified multiple times)
27124 Report 1516 (Source file specified multiple times).
27126 * expression.cs (Argument.Resolve): Signal 1510
27128 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27129 access not allowed in static code)
27131 2002-01-11 Ravi Pratap <ravi@ximian.com>
27133 * typemanager.cs (IsPointerType): Utility method which we are going
27136 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27137 the object type, so we take care of that.
27139 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27141 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27142 added to non-params parameters :-)
27144 * typemanager.cs (CSharpName): Include 'void' type too.
27146 (void_ptr_type): Include in the set of core types.
27148 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
27151 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
27154 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
27155 completely forgotten about it.
27157 2002-01-10 Ravi Pratap <ravi@ximian.com>
27159 * cs-parser.jay (pointer_type): Add. This begins our implementation
27160 of parsing rules for unsafe code.
27162 (unsafe_statement): Implement.
27164 (embedded_statement): Modify to include the above.
27166 * statement.cs (Unsafe): Implement new class for unsafe blocks.
27168 * codegen.cs (EmitContext.InUnsafe): Add. This determines
27169 if the current context is an unsafe one.
27171 * cs-parser.jay (local_variable_pointer_type): Since local variable types
27172 are handled differently, we need separate rules for them.
27174 (local_variable_declaration): Update to use local_variable_pointer_type
27175 to allow variable declarations of unmanaged pointer types.
27177 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27178 in unsafe contexts.
27180 * ../errors/cs0214.cs : Add.
27182 2002-01-16 Nick Drochak <ndrochak@gol.com>
27184 * makefile: remove 'response' file when cleaning.
27186 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27188 * cs-parser.jay: Report 1524.
27190 2002-01-14 Miguel de Icaza <miguel@ximian.com>
27192 * typemanager.cs (RegisterMethod): drop checking if we have
27193 registered this from here
27195 2002-01-12 Miguel de Icaza <miguel@ximian.com>
27197 * class.cs (Method.EmitDestructor): Implement calling our base
27200 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27201 value of InFinally.
27203 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27204 this routine and will wrap the call in a try/catch block. Deal
27207 2002-01-11 Miguel de Icaza <miguel@ximian.com>
27209 * ecore.cs (Expression.MemberLookup): instead of taking a
27210 parameter `same_type' that was used to tell whether we could
27211 access private members we compute our containing type from the
27214 (FieldExpr): Added partial support for volatile fields. This does
27215 not work for volatile fields exposed from assemblies, as I can not
27216 figure out how to extract the modreq from it.
27218 Updated all the source files to use this.
27220 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27221 because it is referenced by MemberLookup very often.
27223 2002-01-09 Ravi Pratap <ravi@ximian.com>
27225 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27226 TypeBuilder.GetCustomAttributes to retrieve what we need.
27228 Get rid of redundant default_member_attr_type as this is the same as
27229 default_member_type which already exists.
27231 * interface.cs, attribute.cs : Update accordingly.
27233 2002-01-08 Miguel de Icaza <miguel@ximian.com>
27235 * typemanager.cs: Enable IndexerPropertyName again. It does not
27236 work for TYpeBuilders though. Ravi, can you please fix this?
27238 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27240 * expression.cs (Argument.Emit): Handle the case of ref objects
27241 being passed to ref functions;
27243 (ParameterReference.EmitLoad): Loads the content of the pointer
27244 without dereferencing.
27246 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27248 * cs-tokenizer.cs: Implemented the pre-processing expressions.
27250 2002-01-08 Ravi Pratap <ravi@ximian.com>
27252 * class.cs (Indexer.DefineMethod): Incorporate the interface
27253 type in the name of the method if we are doing explicit interface
27256 * expression.cs (ConversionExists): Remove as it is completely obsolete.
27258 (BetterConversion): Fix extremely trivial bug where we were referring to
27259 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27262 * ../errors/bug16.cs : Add although we have fixed it.
27264 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27266 * expression.cs (BaseIndexer): Begin implementation.
27268 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27270 * cs-parser.jay (indexer_declarator): Use qualified_identifier
27271 production directly to remove a shift/reduce, and implement
27272 explicit interface implementation.
27274 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27275 after a floating point suffix.
27277 * expression.cs (DoNumericPromotions): Improved the conversion for
27278 uint/uint. If we have a constant, we avoid doing a typecast to a
27281 * class.cs (Indexer): Implement explicit interface implementation
27284 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27286 * class.cs: make the default instance constructor public and hidebysig.
27288 2001-01-03 Ravi Pratap <ravi@ximian.com>
27290 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27291 so we can call it from elsewhere.
27293 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27294 we emit it internally if the class has a defined indexer; otherwise the user
27295 emits it by decorating the class definition with the DefaultMemberAttribute.
27297 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27298 attribute is not used on a type which defines an indexer.
27300 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27301 character when we skip whitespace.
27303 * ../errors/cs0646.cs : Add.
27305 2002-01-03 Miguel de Icaza <miguel@ximian.com>
27307 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27310 * makefile: Add practical target `mcs3.exe' which builds the third
27311 generation compiler.
27313 * expression.cs (New): Fix structures constructor calling.
27315 * class.cs (Property, Method, Indexer): Emit Final flag on the
27316 method if we are an interface implementation and we are not
27319 * ecore.cs (PropertyExpr): New public field `IsBase', tells
27320 whether this property is referencing a `base' method.
27322 * expression.cs (Invocation.EmitCall): take an extra argument:
27323 is_base, this is used to determine whether the `call' or
27324 `callvirt' opcode should be used.
27327 * delegate.cs: update EmitCall.
27329 * class.cs (Method.Define): Set NewSlot for the cases where we are
27330 not implementing an interface method.
27332 (Property.Define): ditto.
27334 2002-01-02 Miguel de Icaza <miguel@ximian.com>
27336 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27337 'r'. Allows mcs to parse itself fully.
27339 2002-01-02 Ravi Pratap <ravi@ximian.com>
27341 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27342 of the number of initializers that require the InitializeArray method.
27344 (CheckIndices): Store the Expression in all cases - not the plain value. Also
27345 update the above field where necessary.
27347 (MakeByteBlob): Update accordingly.
27349 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
27352 (EmitDynamicInitializers): Update in accordance with the new optimization.
27354 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27355 same OpCode applies.
27357 * cs-parser.jay : Fix some glaring errors I introduced.
27359 2002-01-01 Ravi Pratap <ravi@ximian.com>
27361 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27362 so that we can check for name clashes there too.
27364 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27365 for interface indexers.
27367 * interfaces.cs (Define): Emit the default member attribute.
27369 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27370 variable was being referred to while setting the value ;-)
27372 2002-01-01 Miguel de Icaza <miguel@ximian.com>
27374 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27375 byte-by-byte information when we know the data is zero.
27377 Make the block always a multiple of 4, because
27378 DefineInitializedData has a bug.
27380 * assign.cs: Fix, we should assign from the temporary, not from
27383 * expression.cs (MakeByteBlob): Fix my incorrect code.
27385 2001-12-31 Miguel de Icaza <miguel@ximian.com>
27387 * typemanager.cs (EnumToUnderlying): This function is used to get
27388 the underlying type from an enumeration, because it does not
27391 * constant.cs: Use the I4_S form for values between -128 and 127.
27393 * statement.cs (Block.LookupLabel): Looks up a label.
27394 (Block): Drop support for labeled blocks.
27396 (LabeledStatement): New kind of statement that represents a label
27399 (Goto): Finally implement this bad boy.
27401 * cs-parser.jay: Update to reflect new mechanism to implement
27404 2001-12-30 Miguel de Icaza <miguel@ximian.com>
27406 * codegen.cs (EmitContext.This): a codegen property that keeps the
27407 a single instance of this instead of creating many different this
27410 * delegate.cs (Delegate.DoResolve): Update to use the property;
27412 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27414 * expression.cs (BaseAccess.DoResolve): Ditto.
27416 2001-12-29 Ravi Pratap <ravi@ximian.com>
27418 * typemanager.cs (methodimpl_attr_type): Add to hold the type
27419 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27421 (InitCoreTypes): Update accordingly.
27423 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27424 so we can quickly store the state.
27426 (ApplyAttributes): Set the correct implementation flags
27427 for InternalCall methods.
27429 2001-12-29 Miguel de Icaza <miguel@ximian.com>
27431 * expression.cs (EmitCall): if a method is not virtual, then do
27432 not use callvirt on it.
27434 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27435 user defined stuff) requires the use of stobj, which takes an
27436 address on the stack instead of an array and an index. So emit
27437 the Ldelema operation for it.
27439 (EmitStoreOpcode): Use stobj for valuetypes.
27441 (UnaryMutator.EmitCode): Use the right 1 value depending on
27442 whether we are dealing with int64/uint64, float or doubles.
27444 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27445 constructors that I implemented last night.
27447 (Constructor.IsDefault): Fix to work properly for static
27450 * cs-parser.jay (CheckDef): report method signature errors.
27451 Update error number 103 to be 132.
27453 * decl.cs: New AdditionResult enumeration value: MethodExists.
27454 Although we do this check for methods later on in the semantic
27455 analysis, catching repeated default constructors is so easy that
27456 we catch these here.
27458 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27461 (ParameterReference.EmitAssign, Emit): handle
27464 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27465 (ArrayAccess.EmitStoreOpcode): ditto.
27467 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27469 * expression.cs (MakeByteBlob): Complete all the missing types
27470 (uint, short, ushort, byte, sbyte)
27472 * class.cs: Only init instance field initializers on instance
27475 Rename `constructors' to instance_constructors.
27477 (TypeContainer.AddConstructor): Only add constructors to the list
27478 if it is not static.
27480 Make sure that we handle default_static_constructor independently
27481 everywhere where we handle instance_constructors
27483 2001-12-28 Miguel de Icaza <miguel@ximian.com>
27485 * class.cs: Do not lookup or create a base initializer for a
27486 static constructor.
27488 (ConstructorInitializer.Resolve): use the proper type to lookup
27491 * cs-parser.jay: Report error 1585 (modifiers between type and name).
27493 * enum.cs, interface.cs: Remove CloseType, this is taken care by
27496 * decl.cs: CloseType is now an virtual method, the default
27497 implementation just closes this type.
27499 2001-12-28 Ravi Pratap <ravi@ximian.com>
27501 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27502 to PreserveSig by default. Also emit HideBySig on such methods.
27504 Basically, set the defaults to standard values.
27506 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27507 argument, if candidate is better, it can't be worse than the best !
27509 (Invocation): Re-write bits to differentiate between methods being
27510 applicable in their expanded form and their normal form - for params
27513 Get rid of use_standard everywhere as only standard conversions are allowed
27514 in overload resolution.
27516 More spec conformance.
27518 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27520 * driver.cs: Add --timestamp, to see where the compiler spends
27523 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27524 `this' in static code.
27526 (SimpleName.DoResolve): Implement in terms of a helper function
27527 that allows static-references to be passed upstream to
27530 (Expression.ResolveWithSimpleName): Resolve specially simple
27531 names when called by MemberAccess to implement the special
27534 (Expression.ImplicitReferenceConversion): Handle conversions from
27535 Null to reference types before others, as Null's type is
27538 * expression.cs (Invocation.EmitCall): Handle the special case of
27539 calling methods declared on a reference type from a ValueType
27540 (Base classes System.Object and System.Enum)
27542 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27543 the left hand side is a TypeExpr, not on every enumeration.
27545 (Binary.Resolve): If types are reference types, then do a cast to
27546 object on operators != and == of both arguments.
27548 * typemanager.cs (FindMembers): Extract instance and static
27549 members if requested.
27551 * interface.cs (PopulateProperty): Use void_type instead of null
27552 as the return type for the setter method.
27554 (PopulateIndexer): ditto.
27556 2001-12-27 Ravi Pratap <ravi@ximian.com>
27558 * support.cs (ReflectionParameters): Fix minor bug where we
27559 were examining the wrong parameter for the ParamArray attribute.
27561 Cope with requests for the type of the parameter at position
27562 greater than the params parameter's. We now return the element
27563 type of the params array as that makes more sense.
27565 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27566 accordingly as we no longer have to extract the element type
27569 (Invocation.OverloadResolve): Update.
27571 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27573 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27574 against IEnumerator, test whether the return value is a descendant
27575 of the IEnumerator interface.
27577 * class.cs (Indexer.Define): Use an auxiliary method to implement
27578 the other bits of the method definition. Begin support for
27579 explicit interface implementation.
27581 (Property.DefineMethod): Use TypeManager.void_type instead of null
27582 for an empty return value.
27584 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27586 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27587 dealing with a FieldExpr which is composed of a FieldBuilder, in
27588 the code path we did extract the constant, but we should have
27589 obtained the underlying value to be able to cast it (otherwise we
27590 end up in an infinite loop, this is what Ravi was running into).
27592 (ArrayCreation.UpdateIndices): Arrays might be empty.
27594 (MemberAccess.ResolveMemberAccess): Add support for section
27595 14.5.4.1 that deals with the special case of E.I when E is a type
27596 and something else, that I can be a reference to a static member.
27598 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27599 handle a particular array type to create byte blobs, it is just
27600 something we dont generate byteblobs for.
27602 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27605 * location.cs (Push): remove the key from the hashtable that we
27606 are about to add. This happens for empty files.
27608 * driver.cs: Dispose files after we have parsed them.
27610 (tokenize): new function that only runs the tokenizer on its
27611 input, for speed testing.
27613 2001-12-26 Ravi Pratap <ravi@ximian.com>
27615 * class.cs (Event.Define): Define the private field only if there
27616 are no accessors defined.
27618 * expression.cs (ResolveMemberAccess): If there is no associated
27619 field with the event, that means we have an event defined with its
27620 own accessors and we should flag error cs0070 since transforming
27621 ourselves into a field is not valid in that case.
27623 * ecore.cs (SimpleName.DoResolve): Same as above.
27625 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27626 and charset to sane values.
27628 2001-12-25 Ravi Pratap <ravi@ximian.com>
27630 * assign.cs (DoResolve): Perform check on events only if they
27631 are being accessed outside the declaring type.
27633 * cs-parser.jay (event_declarations): Update rules to correctly
27634 set the type of the implicit parameter etc.
27636 (add_accessor, remove_accessor): Set current local parameters.
27638 * expression.cs (Binary): For delegate addition and subtraction,
27639 cast the return value from the method into the appropriate delegate
27642 2001-12-24 Ravi Pratap <ravi@ximian.com>
27644 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27645 of these as the workaround is unnecessary.
27647 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27648 delegate data - none of that is needed at all.
27650 Re-write bits to extract the instance expression and the delegate method
27653 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27656 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27657 of attaching attributes instead of duplicating code everywhere.
27659 * everywhere : Update code to do attribute emission using the above method.
27661 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27663 * expression.cs (IsParamsMethodApplicable): if there are not
27664 parameters, return immediately.
27666 * ecore.cs: The 0 literal can be implicity converted to an enum
27669 (SimpleName.DoResolve): First lookup the type, then lookup the
27672 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27673 want to get its address. If the InstanceExpression is not
27674 addressable, store the result in a temporary variable, then get
27677 * codegen.cs: Only display 219 errors on warning level or above.
27679 * expression.cs (ArrayAccess): Make it implement the
27680 IMemoryLocation interface.
27682 (Binary.DoResolve): handle the operator == (object a, object b)
27683 and operator != (object a, object b) without incurring into a
27684 BoxedCast (because 5 != o should never be performed).
27686 Handle binary enumerator operators.
27688 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27689 value type, otherwise use Ldelem_ref.
27691 Use precomputed names;
27693 (AddressOf): Implement address of
27695 * cs-parser.jay (labeled_statement): Fix recursive block
27696 addition by reworking the production.
27698 * expression.cs (New.DoEmit): New has a special case:
27700 If we are dealing with a ValueType, we have a few
27701 situations to deal with:
27703 * The target of New is a ValueType variable, that is
27704 easy, we just pass this as the variable reference
27706 * The target of New is being passed as an argument,
27707 to a boxing operation or a function that takes a
27710 In this case, we need to create a temporary variable
27711 that is the argument of New.
27714 2001-12-23 Ravi Pratap <ravi@ximian.com>
27716 * rootcontext.cs (LookupType): Check that current_type is not null before
27717 going about looking at nested types.
27719 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27720 not implement the IAssignMethod interface any more.
27722 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27723 where we tranform them into FieldExprs if they are being resolved from within
27724 the declaring type.
27726 * ecore.cs (SimpleName.DoResolve): Do the same here.
27728 * assign.cs (DoResolve, Emit): Clean up code considerably.
27730 * ../errors/bug10.cs : Add.
27732 * ../errors/cs0070.cs : Add.
27734 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27736 * assign.cs : Get rid of EventIsLocal everywhere.
27738 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27740 * ecore.cs (ConvertIntLiteral): finished the implementation.
27742 * statement.cs (SwitchLabel): Convert the value we are using as a
27743 key before looking up the table.
27745 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27747 * codegen.cs (EmitTopBlock): Require a Location argument now.
27749 * cs-parser.jay (constructor_declarator): We need to setup
27750 current_local_parameters before we parse the
27751 opt_constructor_initializer, to allow the variables to be bound
27752 to the constructor arguments.
27754 * rootcontext.cs (LookupType): First lookup nested classes in our
27755 class and our parents before we go looking outside our class.
27757 * expression.cs (ConstantFold): Extract/debox the values at the
27760 * rootcontext.cs (EmitCode): Resolve the constants first before we
27761 resolve the types. This is not really needed, but it helps debugging.
27763 * statement.cs: report location.
27765 * cs-parser.jay: pass location to throw statement.
27767 * driver.cs: Small bug fix.
27769 * report.cs: Updated format to be 4-zero filled digits.
27771 2001-12-22 Ravi Pratap <ravi@ximian.com>
27773 * expression.cs (CheckIndices): Fix minor bug where the wrong
27774 variable was being referred to ;-)
27776 (DoEmit): Do not call EmitStaticInitializers when the
27777 underlying type is System.Object.
27779 2001-12-21 Ravi Pratap <ravi@ximian.com>
27781 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27782 and do the usual workaround for SRE.
27784 * class.cs (MyEventBuilder.EventType): New member to get at the type
27785 of the event, quickly.
27787 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27789 * assign.cs (Assign.DoResolve): Handle the case when the target
27790 is an EventExpr and perform the necessary checks.
27792 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27795 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27797 (EventExpr): Set the type in the constructor itself since we
27798 are meant to be born fully resolved.
27800 (EventExpr.Define): Revert code I wrote earlier.
27802 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27803 instance expression is null. The instance expression is a This in that case
27804 or a null, depending on whether it is a static method or not.
27806 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27807 refers to more than one method.
27809 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27810 and accordingly flag errors.
27812 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27814 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27816 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27818 * location.cs (ToString): Provide useful rutine.
27820 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27822 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27823 objects, return the actual integral boxed.
27825 * statement.cs (SwitchLabel): define an ILLabel for each
27828 (Switch.CheckSwitch): If the value is a Literal, extract
27829 the underlying literal.
27831 Also in the unused hashtable we had, add the SwitchLabel so we can
27832 quickly look this value up.
27834 * constant.cs: Implement a bunch of new constants. Rewrite
27835 Literal based on this. Made changes everywhere to adapt to this.
27837 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27838 dereferencing array only once, and also copes with enumrations.
27840 bytes are two bytes wide, not one.
27842 (Cast): Perform constant conversions.
27844 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27845 wrappers to the literals here.
27847 * expression.cs (DoNumericPromotions): long literals can converted
27848 to ulong implicity (this is taken care of elsewhere, but I was
27849 missing this spot).
27851 * ecore.cs (Expression.Literalize): Make the return type Literal,
27852 to improve type checking.
27854 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27856 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27858 * literal.cs: Revert code from ravi that checked the bounds. The
27859 bounds are sane by the definition of the type itself.
27861 * typemanager.cs: Fix implementation of ImplementsInterface. We
27862 need to actually look up in our parent hierarchy for interfaces
27865 * const.cs: Use the underlying type for enumerations
27867 * delegate.cs: Compute the basename for the delegate creation,
27868 that should fix the delegate test case, and restore the correct
27869 Type Lookup semantics in rootcontext
27871 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27872 referencing a nested type with the Reflection API is using the "+"
27875 * cs-parser.jay: Do not require EOF token at the end.
27877 2001-12-20 Ravi Pratap <ravi@ximian.com>
27879 * rootcontext.cs (LookupType): Concatenate type names with
27880 a '.' instead of a '+' The test suite passes again.
27882 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27883 field of the enumeration.
27885 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27886 the case when the member is an EventExpr.
27888 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27889 static has an associated instance expression.
27891 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27893 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27895 * class.cs (Event.Define): Register event and perform appropriate checks
27898 We define the Add and Remove methods even if the use provides none because
27899 in that case, we provide default implementations ourselves.
27901 Define a private field of the type of the event. This is done by the CSC compiler
27902 and we should be doing it too ;-)
27904 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27905 More methods we use in code we generate.
27907 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27910 (InitCoreTypes): Update accordingly for the above.
27912 * class.cs (Event.Emit): Generate code for default accessors that we provide
27914 (EmitDefaultMethod): Do the job in the above.
27916 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27919 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27921 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27922 builders even if we were missing one.
27924 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27925 pass the Basename as our class name instead of the Name. The
27926 basename will be correctly composed for us.
27928 * parameter.cs (Paramters): Now takes a Location argument.
27930 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27931 make all the code call directly LookupType in RootContext and take
27932 this chance to pass the Location information everywhere.
27934 * Everywhere: pass Location information.
27936 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27938 * class.cs (Constructor.Define): Updated way of detecting the
27939 length of the parameters.
27941 (TypeContainer.DefineType): Use basename as the type name for
27944 (TypeContainer.Define): Do not recursively define types here, as
27945 definition is taken care in order by the RootContext.
27947 * tree.cs: Keep track of namespaces in a per-file basis.
27949 * parameter.cs (Parameter.ComputeSignature): Update to use
27952 (Parameters.GetSignature): ditto.
27954 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27955 instead of a TypeContainer.
27957 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27958 resolve names. Because we need to be resolve in our context, not
27961 * driver.cs: Implement response files.
27963 * class.cs (TypeContainer.DefineType): If we are defined, do not
27964 redefine ourselves.
27966 (Event.Emit): Emit the code for add/remove handlers.
27967 (Event.Define): Save the MethodBuilders for add/remove.
27969 * typemanager.cs: Use pair here too.
27971 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27972 DictionaryEntry requires the first argument to be non-null.
27974 (enum_declaration): Compute full name for registering the
27977 (delegate_declaration): Instead of using
27978 formal_parameter_list, use opt_formal_parameter_list as the list
27981 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27982 (EventParsing): New property that controls whether `add' and
27983 `remove' are returned as tokens or identifiers (for events);
27985 2001-12-19 Ravi Pratap <ravi@ximian.com>
27987 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27988 use MyEventBuilder only and let it wrap the real builder for us.
27990 (MyEventBuilder): Revamp constructor etc.
27992 Implement all operations that we perform on EventBuilder in precisely the same
27995 (FindMembers): Update to use the EventBuilder member.
27997 (Event.Emit): Update accordingly.
27999 2001-12-18 Ravi Pratap <ravi@ximian.com>
28001 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28002 by calling the appropriate methods.
28004 (GetCustomAttributes): Make stubs as they cannot possibly do anything
28007 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28009 2001-12-17 Ravi Pratap <ravi@ximian.com>
28011 * delegate.cs (Delegate.Populate): Check that the return type
28012 and various parameters types are indeed accessible.
28014 * class.cs (Constructor.Define): Same here.
28016 (Field.Define): Ditto.
28018 (Event.Define): Ditto.
28020 (Operator.Define): Check that the underlying Method defined itself
28021 correctly - so it's MethodBuilder should not be null.
28023 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28024 expression happens to be null.
28026 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28027 members but as of now we don't seem to be able to do anything really useful with it.
28029 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28030 not the EventBuilder.
28032 2001-12-18 Miguel de Icaza <miguel@ximian.com>
28034 * cs-tokenizer.cs: Add support for defines.
28035 Add support for #if, #elif, #else, #endif
28037 (eval_var): evaluates a variable.
28038 (eval): stubbed for evaluating functions.
28040 * cs-parser.jay: Pass the defines information
28042 * driver.cs: Add --define command line option.
28044 * decl.cs: Move MemberCore here.
28046 Make it the base class for DeclSpace. This allows us to catch and
28047 report 108 and 109 for everything now.
28049 * class.cs (TypeContainer.Define): Extract all the members
28050 before populating and emit the warning 108 (new keyword required
28051 to override) instead of having each member implement this.
28053 (MemberCore.Define): New abstract method, we will be using this in
28054 the warning reporting engine in Populate.
28056 (Operator.Define): Adjust to new MemberCore protocol.
28058 * const.cs (Const): This does not derive from Expression, it is a
28059 temporary object we use to create fields, it is a MemberCore.
28061 * class.cs (Method.Define): Allow the entry point to be in a
28064 * driver.cs: Rewrite the argument handler to clean it up a bit.
28066 * rootcontext.cs: Made it just an auxiliary namespace feature by
28067 making everything static.
28069 * driver.cs: Adapt code to use RootContext type name instead of
28072 * delegate.cs: Remove RootContext argument.
28074 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28077 * class.cs (Event.Define): The lookup can fail.
28079 * cs-tokenizer.cs: Begin implementation of pre-procesor.
28081 * expression.cs: Resolve the this instance before invoking the code.
28083 2001-12-17 Miguel de Icaza <miguel@ximian.com>
28085 * cs-parser.jay: Add a production in element_access that allows
28086 the thing to become a "type" reference. This way we can parse
28087 things like "(string [])" as a type.
28089 Note that this still does not handle the more complex rules of
28093 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
28095 * ecore.cs: (CopyNewMethods): new utility function used to
28096 assemble the list of methods from running FindMembers.
28098 (MemberLookup): Rework FindMembers so that
28100 2001-12-16 Miguel de Icaza <miguel@ximian.com>
28102 * class.cs (TypeContainer): Remove Delegates who fail to be
28105 * delegate.cs (Populate): Verify that we dont get null return
28106 values. TODO: Check for AsAccessible.
28108 * cs-parser.jay: Use basename to emit error 574 (destructor should
28109 have the same name as container class), not the full name.
28111 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28112 possible representation.
28114 Also implements integer type suffixes U and L.
28116 2001-12-15 Miguel de Icaza <miguel@ximian.com>
28118 * expression.cs (ArrayCreation.DoResolve): We need to do the
28119 argument resolution *always*.
28121 * decl.cs: Make this hold the namespace. Hold the root context as
28123 (LookupType): Move here.
28125 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28127 * location.cs (Row, Name): Fixed the code, it was always returning
28128 references to the first file.
28130 * interface.cs: Register properties defined through interfaces.
28132 * driver.cs: Add support for globbing on the command line
28134 * class.cs (Field): Make it derive from MemberCore as well.
28137 2001-12-15 Ravi Pratap <ravi@ximian.com>
28139 * class.cs (Event::Define): Check that the type of the event is a delegate
28140 type else flag error #66.
28142 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28145 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28146 values of EntryPoint, CharSet etc etc.
28148 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28150 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28151 be null and we should ignore this. I am not sure if this is really clean. Apparently,
28152 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28153 which needs this to do its work.
28155 * ../errors/cs0066.cs : Add.
28157 2001-12-14 Miguel de Icaza <miguel@ximian.com>
28159 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28162 * class.cs: (MethodSignature.MethodSignature): Removed hack that
28163 clears out the parameters field.
28164 (MemberSignatureCompare): Cleanup
28166 (MemberCore): New base class used to share code between MethodCore
28169 (RegisterRequiredImplementations) BindingFlags.Public requires
28170 either BindingFlags.Instace or Static. Use instance here.
28172 (Property): Refactored code to cope better with the full spec.
28174 * parameter.cs (GetParameterInfo): Return an empty array instead
28177 * class.cs (Property): Abstract or extern properties have no bodies.
28179 * parameter.cs (GetParameterInfo): return a zero-sized array.
28181 * class.cs (TypeContainer.MethodModifiersValid): Move all the
28182 method modifier validation to the typecontainer so we can reuse
28183 this on properties.
28185 (MethodCore.ParameterTypes): return an empty sized array of types.
28187 (Property.Define): Test property modifier validity.
28189 Add tests for sealed/override too.
28191 (Method.Emit): abstract or extern methods have no bodies.
28193 2001-12-14 Ravi Pratap <ravi@ximian.com>
28195 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28198 (Method::Define, ::Emit): Modify accordingly.
28200 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28202 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28204 * makefile: Pass in /unsafe.
28206 2001-12-13 Miguel de Icaza <miguel@ximian.com>
28208 * class.cs (MakeKey): Kill routine.
28210 * class.cs (TypeContainer.Define): Correctly define explicit
28211 method implementations (they require the full interface name plus
28214 * typemanager.cs: Deply the PtrHashtable here and stop using the
28215 lame keys. Things work so much better.
28217 This of course broke everyone who depended on `RegisterMethod' to
28218 do the `test for existance' test. This has to be done elsewhere.
28220 * support.cs (PtrHashtable): A hashtable that avoid comparing with
28221 the object stupid Equals method (because, that like fails all over
28222 the place). We still do not use it.
28224 * class.cs (TypeContainer.SetRequiredInterface,
28225 TypeContainer.RequireMethods): Killed these two routines and moved
28226 all the functionality to RegisterRequiredImplementations.
28228 (TypeContainer.RegisterRequiredImplementations): This routine now
28229 registers all the implementations required in an array for the
28230 interfaces and abstract methods. We use an array of structures
28231 which can be computed ahead of time to reduce memory usage and we
28232 also assume that lookups are cheap as most classes will not
28233 implement too many interfaces.
28235 We also avoid creating too many MethodSignatures.
28237 (TypeContainer.IsInterfaceMethod): Update and optionally does not
28238 clear the "pending" bit if we find that there are problems with
28241 (TypeContainer.VerifyPendingMethods): Update to report errors of
28242 methods that look like implementations but are not.
28244 (TypeContainer.Define): Add support for explicit interface method
28247 2001-12-12 Miguel de Icaza <miguel@ximian.com>
28249 * typemanager.cs: Keep track of the parameters here instead of
28250 being a feature of the TypeContainer.
28252 * class.cs: Drop the registration of parameters here, as
28253 InterfaceMethods are also interface declarations.
28255 * delegate.cs: Register methods with the TypeManager not only with
28256 the TypeContainer. This code was buggy.
28258 * interface.cs: Full registation here.
28260 2001-12-11 Miguel de Icaza <miguel@ximian.com>
28262 * expression.cs: Remove reducer for binary expressions, it can not
28265 * const.cs: Put here the code that used to go into constant.cs
28267 * constant.cs: Put here the code for constants, this is a new base
28268 class for Literals.
28270 * literal.cs: Make Literal derive from Constant.
28272 2001-12-09 Miguel de Icaza <miguel@ximian.com>
28274 * statement.cs (Return.Emit): Report error 157 if the user
28275 attempts to return from a finally block.
28277 (Return.Emit): Instead of emitting a return, jump to the end of
28280 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28281 LocalBuilder to store the result of the function. ReturnLabel is
28282 the target where we jump.
28285 2001-12-09 Radek Doulik <rodo@ximian.com>
28287 * cs-parser.jay: remember alias in current namespace
28289 * ecore.cs (SimpleName::DoResolve): use aliases for types or
28292 * class.cs (LookupAlias): lookup alias in my_namespace
28294 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28296 (LookupAlias): lookup alias in this and if needed in parent
28299 2001-12-08 Miguel de Icaza <miguel@ximian.com>
28303 * rootcontext.cs: (ModuleBuilder) Made static, first step into
28304 making things static. I need this to avoid passing the
28305 TypeContainer when calling ParameterType.
28307 * support.cs (InternalParameters.ParameterType): Remove ugly hack
28308 that did string manipulation to compute the type and then call
28309 GetType. Use Parameter.ParameterType instead.
28311 * cs-tokenizer.cs: Consume the suffix for floating values.
28313 * expression.cs (ParameterReference): figure out whether this is a
28314 reference parameter or not. Kill an extra variable by computing
28315 the arg_idx during emission.
28317 * parameter.cs (Parameters.GetParameterInfo): New overloaded
28318 function that returns whether a parameter is an out/ref value or not.
28320 (Parameter.ParameterType): The type of the parameter (base,
28321 without ref/out applied).
28323 (Parameter.Resolve): Perform resolution here.
28324 (Parameter.ExternalType): The full type (with ref/out applied).
28326 * statement.cs (Using.Emit, Using.EmitExpression): Implement
28327 support for expressions on the using statement.
28329 2001-12-07 Miguel de Icaza <miguel@ximian.com>
28331 * statement.cs (Using.EmitLocalVariableDecls): Split the
28332 localvariable handling of the using statement.
28334 (Block.EmitMeta): Keep track of variable count across blocks. We
28335 were reusing slots on separate branches of blocks.
28337 (Try.Emit): Emit the general code block, we were not emitting it.
28339 Check the type of the declaration to be an IDisposable or
28340 something that can be implicity converted to it.
28342 Emit conversions if required.
28344 * ecore.cs (EmptyExpression): New utility class.
28345 (Expression.ImplicitConversionExists): New utility function.
28347 2001-12-06 Miguel de Icaza <miguel@ximian.com>
28349 * statement.cs (Using): Implement.
28351 * expression.cs (LocalVariableReference): Support read only variables.
28353 * statement.cs: Remove the explicit emit for the Leave opcode.
28354 (VariableInfo): Add a readonly field.
28356 2001-12-05 Miguel de Icaza <miguel@ximian.com>
28358 * ecore.cs (ConvCast): new class used to encapsulate the various
28359 explicit integer conversions that works in both checked and
28360 unchecked contexts.
28362 (Expression.ConvertNumericExplicit): Use new ConvCast class to
28363 properly generate the overflow opcodes.
28365 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28367 * statement.cs: The correct type for the EmptyExpression is the
28368 element_type, not the variable type. Ravi pointed this out.
28370 2001-12-04 Ravi Pratap <ravi@ximian.com>
28372 * class.cs (Method::Define): Handle PInvoke methods specially
28373 by using DefinePInvokeMethod instead of the usual one.
28375 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28376 above to do the task of extracting information and defining the method.
28378 2001-12-04 Ravi Pratap <ravi@ximian.com>
28380 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28381 of the condition for string type.
28383 (Emit): Move that here.
28385 (ArrayCreation::CheckIndices): Keep string literals in their expression
28388 (EmitDynamicInitializers): Handle strings appropriately.
28390 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28392 * codegen.cs (EmitContext): Replace multiple variables with a
28393 single pointer to the current Switch statement.
28395 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28398 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28402 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28405 (Foreach.Emit): Foreach on arrays was not setting
28406 up the loop variables (for break/continue).
28408 (GotoCase): Semi-implented.
28410 2001-12-03 Ravi Pratap <ravi@ximian.com>
28412 * attribute.cs (CheckAttribute): Handle system attributes by using
28413 Attribute.GetAttributes to examine information we need.
28415 (GetValidPlaces): Same here.
28417 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28419 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28421 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28423 (Method::Define): Set appropriate flags if we have a DllImport attribute.
28425 (Method::Emit): Handle the case when we are a PInvoke method.
28427 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28429 * expression.cs: Use ResolveWithSimpleName on compound names.
28431 2001-12-02 Ravi Pratap <ravi@ximian.com>
28433 * constant.cs (EmitConstant): Make sure we resolve the associated expression
28434 before trying to reduce it.
28436 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28438 * constant.cs (LookupConstantValue): Implement.
28440 (EmitConstant): Use the above in emitting the constant.
28442 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28443 that are user-defined by doing a LookupConstantValue on them.
28445 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28448 2001-11-29 Miguel de Icaza <miguel@ximian.com>
28450 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28452 (BaseAccess.DoResolve): Implement.
28454 (MemberAccess.DoResolve): Split this routine into a
28455 ResolveMemberAccess routine that can be used independently
28457 2001-11-28 Miguel de Icaza <miguel@ximian.com>
28459 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28460 As that share bits of the implementation. Is returns a boolean,
28461 while As returns the Type that is being probed.
28463 2001-12-01 Ravi Pratap <ravi@ximian.com>
28465 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28466 instead of a Literal - much easier.
28468 (EnumInTransit): Remove - utterly useless :-)
28470 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28472 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28474 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28475 chain when we have no associated expression.
28477 2001-11-30 Ravi Pratap <ravi@ximian.com>
28479 * constant.cs (Define): Use Location while reporting the errror.
28481 Also emit a warning when 'new' is used and there is no inherited
28484 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
28487 (LookupEnumValue): Implement to lookup an enum member's value and define it
28490 (Populate): Re-write accordingly to use the above routine.
28492 2001-11-27 Miguel de Icaza <miguel@ximian.com>
28494 * expression.cs (This): Fix prototype for DoResolveLValue to
28495 override the base class DoResolveLValue.
28497 * cs-parser.cs: Report errors cs574 and cs575 (destructor
28500 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28501 (we need to load the address of the field here). This fixes
28504 (FieldExpr.DoResolveLValue): Call the DoResolve
28505 function to initialize the Instance expression.
28507 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28508 correctly the GetEnumerator operation on a value type.
28510 * cs-parser.jay: Add more simple parsing error catches.
28512 * statement.cs (Switch): Add support for string switches.
28513 Handle null specially.
28515 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
28517 2001-11-28 Ravi Pratap <ravi@ximian.com>
28519 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28521 (declare_local_constant): New helper function.
28523 * statement.cs (AddConstant): Keep a separate record of constants
28525 (IsConstant): Implement to determine if a variable is a constant.
28527 (GetConstantExpression): Implement.
28529 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28531 * statement.cs (IsVariableDefined): Re-write.
28533 2001-11-27 Ravi Pratap <ravi@ximian.com>
28535 * class.cs (TypeContainer::FindMembers): Look for constants
28536 in the case when we are looking for MemberTypes.Field
28538 * expression.cs (MemberAccess::DoResolve): Check that in the
28539 case we are a FieldExpr and a Literal, we are not being accessed
28540 by an instance reference.
28542 * cs-parser.jay (local_constant_declaration): Implement.
28544 (declaration_statement): Implement for constant declarations.
28546 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28548 * statement.cs (Switch): Catch double defaults.
28550 (Switch): More work on the switch() statement
28551 implementation. It works for integral values now, need to finish
28555 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28557 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28558 integer literals into other integer literals. To be used by
28561 2001-11-24 Ravi Pratap <ravi@ximian.com>
28563 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28566 (EmitDynamicInitializers): Cope with the above since we extract data
28567 directly from ArrayData now.
28569 (ExpectInitializers): Keep track of whether initializers are mandatory
28572 (Bounds): Make it a hashtable to prevent the same dimension being
28573 recorded for every element in that dimension.
28575 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28578 Also fix bug which was causing the indices to be emitted in the reverse
28581 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28583 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28584 unfinished. They do not work, because the underlying code is
28587 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28589 * cs-parser.jay: Remove bogus fixme.
28591 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28592 on Switch statement.
28594 2001-11-23 Ravi Pratap <ravi@ximian.com>
28596 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28599 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28600 parameter. Apparently, any expression is allowed.
28602 (ValidateInitializers): Update accordingly.
28604 (CheckIndices): Fix some tricky bugs thanks to recursion.
28606 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28607 I was being completely brain-dead.
28609 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28610 and re-write acordingly.
28612 (DelegateInvocation): Re-write accordingly.
28614 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28616 (MakeByteBlob): Handle types more correctly.
28618 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28619 initialization from expressions but it is incomplete because I am a complete
28622 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28624 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28625 on If. Basically, we have to return `true' (ie, we do return to
28626 our caller) only if both branches of the if return.
28628 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28629 short-circuit operators, handle them as short circuit operators.
28631 (Cast.DoResolve): Resolve type.
28632 (Cast.Cast): Take an expression as the target type.
28634 * cs-parser.jay (cast_expression): Remove old hack that only
28635 allowed a limited set of types to be handled. Now we take a
28636 unary_expression and we resolve to a type during semantic
28639 Use the grammar productions from Rhys to handle casts (this is
28640 not complete like Rhys syntax yet, we fail to handle that corner
28641 case that C# has regarding (-x), but we will get there.
28643 2001-11-22 Ravi Pratap <ravi@ximian.com>
28645 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28646 field which is an array type.
28648 * cs-parser.jay (declare_local_variables): Support array initialization too.
28650 * typemanager.cs (MakeKey): Implement.
28652 (everywhere): Use the above appropriately.
28654 * cs-parser.jay (for_statement): Update for array initialization while
28655 declaring variables.
28657 * ecore.cs : The error message was correct, it's the variable's names that
28658 were misleading ;-) Make the code more readable.
28660 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28661 the correct type etc.
28663 (ConvertExplicit): Handle Enum types by examining the underlying type.
28665 2001-11-21 Ravi Pratap <ravi@ximian.com>
28667 * parameter.cs (GetCallingConvention): Always return
28668 CallingConventions.Standard for now.
28670 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28672 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28673 and `r' after calling DoNumericPromotions.
28675 * ecore.cs: Fix error message (the types were in the wrong order).
28677 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28678 BindingFlags.Instance as well
28680 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28681 implicit int literal conversion in an empty cast so that we
28682 propagate the right type upstream.
28684 (UnboxCast): new class used to unbox value types.
28685 (Expression.ConvertExplicit): Add explicit type conversions done
28688 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28689 the target type before applying the implicit LongLiterals to ULong
28692 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28694 * cs-parser.jay (for_statement): Reworked the way For works: now
28695 we declare manually any variables that are introduced in
28696 for_initializer to solve the problem of having out-of-band code
28697 emition (that is what got for broken).
28699 (declaration_statement): Perform the actual variable declaration
28700 that used to be done in local_variable_declaration here.
28702 (local_variable_declaration): Do not declare anything, just pass
28703 the information on a DictionaryEntry
28705 2001-11-20 Ravi Pratap <ravi@ximian.com>
28707 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28708 re-write of the logic to now make it recursive.
28710 (UpdateIndices): Re-write accordingly.
28712 Store element data in a separate ArrayData list in the above methods.
28714 (MakeByteBlob): Implement to dump the array data into a byte array.
28716 2001-11-19 Ravi Pratap <ravi@ximian.com>
28718 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28721 * constant.cs (Define): Implement.
28723 (EmitConstant): Re-write fully.
28725 Pass in location info.
28727 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28730 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28731 DictionaryEntry since we need location info too.
28733 (constant_declaration): Update accordingly.
28735 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28736 code into another method : UpdateIndices.
28738 2001-11-18 Ravi Pratap <ravi@ximian.com>
28740 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28741 some type checking etc.
28743 2001-11-17 Ravi Pratap <ravi@ximian.com>
28745 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28746 bits to provide dimension info if the user skips doing that.
28748 Update second constructor to store the rank correctly.
28750 2001-11-16 Ravi Pratap <ravi@ximian.com>
28752 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28753 and try to implement.
28755 * ../errors/cs0150.cs : Add.
28757 * ../errors/cs0178.cs : Add.
28759 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28761 * statement.cs: Implement foreach on multi-dimensional arrays.
28763 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28764 name of the params argument.
28766 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28767 initializing the array.
28769 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28770 we can use this elsewhere.
28772 * statement.cs: Finish implementation of foreach for single
28775 * cs-parser.jay: Use an out-of-band stack to pass information
28776 around, I wonder why I need this.
28778 foreach_block: Make the new foreach_block the current_block.
28780 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28781 function used to return a static Parameters structure. Used for
28782 empty parameters, as those are created very frequently.
28784 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28786 2001-11-15 Ravi Pratap <ravi@ximian.com>
28788 * interface.cs : Default modifier is private, not public. The
28789 make verify test passes again.
28791 2001-11-15 Ravi Pratap <ravi@ximian.com>
28793 * support.cs (ReflectionParameters): Fix logic to determine
28794 whether the last parameter is a params one. Test 9 passes again.
28796 * delegate.cs (Populate): Register the builders we define with
28797 RegisterParameterForBuilder. Test 19 passes again.
28799 * cs-parser.jay (property_declaration): Reference $6 instead
28800 of $$ to get at the location.
28802 (indexer_declaration): Similar stuff.
28804 (attribute): Ditto.
28806 * class.cs (Property): Register parameters for the Get and Set methods
28807 if they exist. Test 23 passes again.
28809 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28810 call to EmitArguments as we are sure there aren't any params arguments.
28811 Test 32 passes again.
28813 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28814 IndexOutOfRangeException.
28816 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28817 Test 33 now passes again.
28819 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28821 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28822 broke a bunch of things. Will have to come up with a better way
28823 of tracking locations.
28825 * statement.cs: Implemented foreach for single dimension arrays.
28827 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28829 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28830 an error. This removes the lookup from the critical path.
28832 * cs-parser.jay: Removed use of temporary_loc, which is completely
28835 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28837 * support.cs (ReflectionParameters.ParameterModifier): Report
28838 whether the argument is a PARAMS argument or not.
28840 * class.cs: Set the attribute `ParamArrayAttribute' on the
28841 parameter argument.
28843 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28844 and cons_param_array_attribute (ConstructorInfo for
28845 ParamArrayAttribute).,
28847 * codegen.cs: Emit the return using the `Return' statement, that
28848 way we can report the error correctly for missing return values.
28850 * class.cs (Method.Emit): Clean up.
28852 * expression.cs (Argument.Resolve): Take another argument: the
28853 location where this argument is used. Notice that this is not
28854 part of the "Argument" class as to reduce the size of the
28855 structure (we know the approximate location anyways).
28857 Test if the argument is a variable-reference, if not, then
28858 complain with a 206.
28860 (Argument.Emit): Emit addresses of variables.
28862 (Argument.FullDesc): Simplify.
28864 (Invocation.DoResolve): Update for Argument.Resolve.
28866 (ElementAccess.DoResolve): ditto.
28868 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28869 method should be virtual, as this method is always virtual.
28871 (NewDelegate.DoResolve): Update for Argument.Resolve.
28873 * class.cs (ConstructorInitializer.DoResolve): ditto.
28875 * attribute.cs (Attribute.Resolve): ditto.
28877 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28879 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28881 * expression.cs (ParameterReference): Drop IStackStorage and implement
28882 IAssignMethod instead.
28884 (LocalVariableReference): ditto.
28886 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28887 IAssignMethod instead.
28889 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28891 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28892 enumerations that are used in heavily used structures derive from
28893 byte in a laughable and pathetic attempt to reduce memory usage.
28894 This is the kind of pre-optimzations that you should not do at
28895 home without adult supervision.
28897 * expression.cs (UnaryMutator): New class, used to handle ++ and
28898 -- separatedly from the other unary operators. Cleans up the
28899 code, and kills the ExpressionStatement dependency in Unary.
28901 (Unary): Removed `method' and `Arguments' from this class, making
28902 it smaller, and moving it all to SimpleCall, so I can reuse this
28903 code in other locations and avoid creating a lot of transient data
28904 strucutres when not required.
28906 * cs-parser.jay: Adjust for new changes.
28908 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28910 * enum.cs (Enum.Populate): If there is a failure during
28913 * cs-parser.jay (opt_enum_base): we used to catch type errors
28914 here, but this is really incorrect. The type error should be
28915 catched during semantic analysis.
28917 2001-12-11 Ravi Pratap <ravi@ximian.com>
28919 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28920 current_local_parameters as expected since I, in my stupidity, had forgotten
28923 * attribute.cs (GetValidPlaces): Fix stupid bug.
28925 * class.cs (Method::Emit): Perform check on applicability of attributes.
28927 (Constructor::Emit): Ditto.
28929 (Field::Emit): Ditto.
28931 (Field.Location): Store location information.
28933 (Property, Event, Indexer, Operator): Ditto.
28935 * cs-parser.jay (field_declaration): Pass in location for each field.
28937 * ../errors/cs0592.cs : Add.
28939 2001-11-12 Ravi Pratap <ravi@ximian.com>
28941 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28943 (InitCoreTypes): Update accordingly.
28945 (RegisterAttrType, LookupAttr): Implement.
28947 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28948 info about the same.
28950 (Resolve): Update to populate the above as necessary.
28952 (Error592): Helper.
28954 (GetValidPlaces): Helper to the above.
28956 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28958 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28960 2001-11-12 Ravi Pratap <ravi@ximian.com>
28962 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28964 * ../errors/cs0617.cs : Add.
28966 2001-11-11 Ravi Pratap <ravi@ximian.com>
28968 * enum.cs (Emit): Rename to Populate to be more consistent with what
28969 we expect it to do and when exactly it is called.
28971 * class.cs, rootcontext.cs : Update accordingly.
28973 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28974 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28976 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28978 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28979 of a fieldinfo using the above, when dealing with a FieldBuilder.
28981 2001-11-10 Ravi Pratap <ravi@ximian.com>
28983 * ../errors/cs0031.cs : Add.
28985 * ../errors/cs1008.cs : Add.
28987 * ../errrors/cs0543.cs : Add.
28989 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28992 (FindMembers): Implement.
28994 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28995 enums and delegates too.
28997 (enum_types): Rename to builder_to_enum.
28999 (delegate_types): Rename to builder_to_delegate.
29001 * delegate.cs (FindMembers): Implement.
29003 2001-11-09 Ravi Pratap <ravi@ximian.com>
29005 * typemanager.cs (IsEnumType): Implement.
29007 * enum.cs (Emit): Re-write parts to account for the underlying type
29008 better and perform checking etc.
29010 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29011 of the underlying type.
29013 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29016 * enum.cs (error31): Helper to report error #31.
29018 * cs-parser.jay (enum_declaration): Store location of each member too.
29020 * enum.cs (member_to_location): New hashtable.
29022 (AddEnumMember): Update location hashtable.
29024 (Emit): Use the location of each member while reporting errors.
29026 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29028 * cs-parser.jay: A for_initializer if is a
29029 local_variable_declaration really ammount to have an implicit
29030 block with the variable declaration and no initializer for for.
29032 * statement.cs (For.Emit): Cope with null initializers.
29034 This fixes the infinite loop on for initializers.
29036 2001-11-08 Miguel de Icaza <miguel@ximian.com>
29038 * enum.cs: More cleanup.
29040 * ecore.cs: Remove dead code.
29042 * class.cs (Property.Emit): More simplification.
29043 (Event.Emit): ditto.
29045 Reworked to have less levels of indentation.
29047 2001-11-08 Ravi Pratap <ravi@ximian.com>
29049 * class.cs (Property): Emit attributes.
29059 * enum.cs (Emit): Ditto.
29061 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29064 * class.cs (Field, Event, etc.): Move attribute generation into the
29065 Emit method everywhere.
29067 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29068 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29069 as we had no way of defining nested enums !
29071 * rootcontext.cs : Adjust code accordingly.
29073 * typemanager.cs (AddEnumType): To keep track of enum types separately.
29075 2001-11-07 Ravi Pratap <ravi@ximian.com>
29077 * expression.cs (EvalConstantExpression): Move into ecore.cs
29079 * enum.cs (Enum): Rename some members and make them public and readonly
29080 according to our convention.
29082 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29085 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29087 (Enum::Emit): Write a simple version for now which doesn't try to compute
29088 expressions. I shall modify this to be more robust in just a while.
29090 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29092 (TypeContainer::CloseType): Create the Enum types too.
29094 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29096 * expression.cs (EvalConstantExpression): Get rid of completely.
29098 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29099 user-defined values and other cases.
29101 (IsValidEnumLiteral): Helper function.
29103 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
29104 out there in the case we had a literal FieldExpr.
29106 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29108 (Literalize): Revamp a bit to take two arguments.
29110 (EnumLiteral): New class which derives from Literal to wrap enum literals.
29112 2001-11-06 Ravi Pratap <ravi@ximian.com>
29114 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29116 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29118 (Resolve): Use the above to ensure we have proper initializers.
29120 2001-11-05 Ravi Pratap <ravi@ximian.com>
29122 * expression.cs (Expression::EvalConstantExpression): New method to
29123 evaluate constant expressions.
29125 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29127 2001-11-07 Miguel de Icaza <miguel@ximian.com>
29129 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29132 (Binary.ResolveOperator): Handle operator != (object a, object b)
29133 and operator == (object a, object b);
29135 (Binary.DoNumericPromotions): Indicate whether the numeric
29136 promotion was possible.
29138 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29141 Made the ArrayAccess implement interface IAssignMethod instead of
29142 IStackStore as the order in which arguments are passed reflects
29145 * assign.cs: Instead of using expr.ExprClass to select the way of
29146 assinging, probe for the IStackStore/IAssignMethod interfaces.
29148 * typemanager.cs: Load InitializeArray definition.
29150 * rootcontext.cs (RootContext.MakeStaticData): Used to define
29151 static data that can be used to initialize arrays.
29153 2001-11-05 Miguel de Icaza <miguel@ximian.com>
29155 * expression.cs: Handle operator== and operator!= for booleans.
29157 (Conditioal.Reduce): Implement reducer for the ?: operator.
29159 (Conditional.Resolve): Implement dead code elimination.
29161 (Binary.Resolve): Catch string literals and return a new
29162 concatenated string.
29164 (Unary.Reduce): Implement reduction of unary expressions.
29166 * ecore.cs: Split out the expression core handling here.
29168 (Expression.Reduce): New method used to perform constant folding
29169 and CSE. This is needed to support constant-expressions.
29171 * statement.cs (Statement.EmitBoolExpression): Pass true and false
29172 targets, and optimize for !x.
29174 2001-11-04 Ravi Pratap <ravi@ximian.com>
29176 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29177 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29178 set custom atttributes.
29180 * literal.cs (Literal::GetValue): New abstract method to return the actual
29181 value of the literal, cast as an object.
29183 (*Literal): Implement GetValue method.
29185 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29186 expressions to the arraylist but objects of type Argument.
29188 * class.cs (TypeContainer::Emit): Emit our attributes too.
29190 (Method::Emit, Constructor::Emit): Ditto.
29192 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29193 to be ignoring earlier.
29195 2001-11-03 Ravi Pratap <ravi@ximian.com>
29197 * attribute.cs (AttributeSection::Define): Implement to do the business
29198 of constructing a CustomAttributeBuilder.
29200 (Attribute): New trivial class. Increases readability of code.
29202 * cs-parser.jay : Update accordingly.
29204 (positional_argument_list, named_argument_list, named_argument): New rules
29206 (attribute_arguments): Use the above so that we are more correct.
29208 2001-11-02 Ravi Pratap <ravi@ximian.com>
29210 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29211 to perform all checks for a method with a params parameter.
29213 (Invocation::OverloadResolve): Update to use the above method and therefore
29214 cope correctly with params method invocations.
29216 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
29219 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29220 constructors in our parent too because we can't afford to miss out on
29223 * attribute.cs (AttributeSection): New name for the class Attribute
29225 Other trivial changes to improve readability.
29227 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29228 use the new class names.
29230 2001-11-01 Ravi Pratap <ravi@ximian.com>
29232 * class.cs (Method::Define): Complete definition for params types too
29234 (Indexer::Define): Ditto.
29236 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29237 Cope everywhere with a request for info about the array parameter.
29239 2001-11-01 Ravi Pratap <ravi@ximian.com>
29241 * tree.cs (RecordNamespace): Fix up to check for the correct key.
29243 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
29244 local_variable_type to extract the string corresponding to the type.
29246 (local_variable_type): Fixup the action to use the new helper method.
29248 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
29251 * expression.cs : Clean out code which uses the above.
29253 2001-10-31 Ravi Pratap <ravi@ximian.com>
29255 * typemanager.cs (RegisterMethod): Check if we already have an existing key
29256 and bale out if necessary by returning a false.
29258 (RegisterProperty): Ditto.
29260 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29261 and print out appropriate error messages.
29263 * interface.cs (everywhere): Ditto.
29265 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29266 location to constructor.
29268 * class.cs (Property, Event, Indexer): Update accordingly.
29270 * ../errors/cs111.cs : Added.
29272 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29273 of a method, as laid down by the spec.
29275 (Invocation::OverloadResolve): Use the above method.
29277 2001-10-31 Ravi Pratap <ravi@ximian.com>
29279 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29280 now take a TypeContainer and a Parameters object.
29282 (ParameterData): Modify return type of ParameterModifier method to be
29283 Parameter.Modifier and not a string.
29285 (ReflectionParameters, InternalParameters): Update accordingly.
29287 * expression.cs (Argument::GetParameterModifier): Same here.
29289 * support.cs (InternalParameters::ParameterType): Find a better way of determining
29290 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29291 symbol in it at all so maybe this is only for now.
29293 2001-10-30 Ravi Pratap <ravi@ximian.com>
29295 * support.cs (InternalParameters): Constructor now takes an extra argument
29296 which is the actual Parameters class.
29298 (ParameterDesc): Update to provide info on ref/out modifiers.
29300 * class.cs (everywhere): Update call to InternalParameters to pass in
29301 the second argument too.
29303 * support.cs (ParameterData): Add ParameterModifier, which is a method
29304 to return the modifier info [ref/out etc]
29306 (InternalParameters, ReflectionParameters): Implement the above.
29308 * expression.cs (Argument::ParameterModifier): Similar function to return
29309 info about the argument's modifiers.
29311 (Invocation::OverloadResolve): Update to take into account matching modifiers
29314 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29315 a new SetFormalParameters object which we pass to InternalParameters.
29317 2001-10-30 Ravi Pratap <ravi@ximian.com>
29319 * expression.cs (NewArray): Merge into the ArrayCreation class.
29321 2001-10-29 Ravi Pratap <ravi@ximian.com>
29323 * expression.cs (NewArray): Merge classes NewBuiltinArray and
29324 NewUserdefinedArray into one as there wasn't much of a use in having
29327 * expression.cs (Argument): Change field's name to ArgType from Type.
29329 (Type): New readonly property which returns the proper type, taking into
29330 account ref/out modifiers.
29332 (everywhere): Adjust code accordingly for the above.
29334 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29335 whether we are emitting for a ref or out parameter.
29337 * expression.cs (Argument::Emit): Use the above field to set the state.
29339 (LocalVariableReference::Emit): Update to honour the flag and emit the
29342 * parameter.cs (Attributes): Set the correct flags for ref parameters.
29344 * expression.cs (Argument::FullDesc): New function to provide a full desc.
29346 * support.cs (ParameterData): Add method ParameterDesc to the interface.
29348 (ReflectionParameters, InternalParameters): Implement the above method.
29350 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29353 (Invocation::FullMethodDesc): Ditto.
29355 2001-10-29 Miguel de Icaza <miguel@ximian.com>
29357 * cs-parser.jay: Add extra production for the second form of array
29360 * expression.cs (ArrayCreation): Update to reflect the above
29363 * Small changes to prepare for Array initialization.
29365 2001-10-28 Miguel de Icaza <miguel@ximian.com>
29367 * typemanager.cs (ImplementsInterface): interface might be null;
29368 Deal with this problem;
29370 Also, we do store negative hits on the cache (null values), so use
29371 this instead of calling t.GetInterfaces on the type everytime.
29373 2001-10-28 Ravi Pratap <ravi@ximian.com>
29375 * typemanager.cs (IsBuiltinType): New method to help determine the same.
29377 * expression.cs (New::DoResolve): Get rid of array creation code and instead
29378 split functionality out into different classes.
29380 (New::FormArrayType): Move into NewBuiltinArray.
29382 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29385 (NewBuiltinArray): New class to handle creation of built-in arrays.
29387 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29388 account creation of one-dimensional arrays.
29390 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29392 (NewUserdefinedArray::DoResolve): Implement.
29394 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29396 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29397 we maintain inside the TypeManager. This is necessary to perform lookups on the
29400 (LookupType): Update to perform GetType on the module builders too.
29402 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29404 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29406 2001-10-23 Ravi Pratap <ravi@ximian.com>
29408 * expression.cs (New::DoResolve): Implement guts of array creation.
29410 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29412 2001-10-27 Miguel de Icaza <miguel@ximian.com>
29414 * expression.cs: Fix bug I introduced lsat night that broke
29417 (Expression.Resolve): Report a 246 error (can not resolve name)
29418 if we find a SimpleName in the stream.
29420 (Expression.ResolveLValue): Ditto.
29422 (Expression.ResolveWithSimpleName): This function is a variant of
29423 ResolveName, this one allows SimpleNames to be returned without a
29424 warning. The only consumer of SimpleNames is MemberAccess
29426 2001-10-26 Miguel de Icaza <miguel@ximian.com>
29428 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29429 might arrive here. I have my doubts that this is correct.
29431 * statement.cs (Lock): Implement lock statement.
29433 * cs-parser.jay: Small fixes to support `lock' and `using'
29435 * cs-tokenizer.cs: Remove extra space
29437 * driver.cs: New flag --checked, allows to turn on integer math
29440 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29441 Threading.Monitor.Exit
29443 2001-10-23 Miguel de Icaza <miguel@ximian.com>
29445 * expression.cs (IndexerAccess::DoResolveLValue): Set the
29446 Expression Class to be IndexerAccess.
29448 Notice that Indexer::DoResolve sets the eclass to Value.
29450 2001-10-22 Miguel de Icaza <miguel@ximian.com>
29452 * class.cs (TypeContainer::Emit): Emit code for indexers.
29454 * assign.cs (IAssignMethod): New interface implemented by Indexers
29455 and Properties for handling assignment.
29457 (Assign::Emit): Simplify and reuse code.
29459 * expression.cs (IndexerAccess, PropertyExpr): Implement
29460 IAssignMethod, clean up old code.
29462 2001-10-22 Ravi Pratap <ravi@ximian.com>
29464 * typemanager.cs (ImplementsInterface): New method to determine if a type
29465 implements a given interface. Provides a nice cache too.
29467 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29470 (ConvertReferenceExplicit): Ditto.
29472 * delegate.cs (Delegate::Populate): Update to define the parameters on the
29473 various methods, with correct names etc.
29475 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
29476 Operator.UnaryNegation.
29478 * cs-parser.jay (operator_declarator): Be a little clever in the case where
29479 we have a unary plus or minus operator.
29481 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
29484 * everywhere : update accordingly.
29486 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29489 * class.cs (Method::Define): For the case where we are implementing a method
29490 inherited from an interface, we need to set the MethodAttributes.Final flag too.
29491 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29493 2001-10-21 Ravi Pratap <ravi@ximian.com>
29495 * interface.cs (FindMembers): Implement to work around S.R.E
29498 * typemanager.cs (IsInterfaceType): Implement.
29500 (FindMembers): Update to handle interface types too.
29502 * expression.cs (ImplicitReferenceConversion): Re-write bits which
29503 use IsAssignableFrom as that is not correct - it doesn't work.
29505 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29506 and accordingly override EmitStatement.
29508 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29509 using the correct logic :-)
29511 2001-10-19 Ravi Pratap <ravi@ximian.com>
29513 * ../errors/cs-11.cs : Add to demonstrate error -11
29515 2001-10-17 Miguel de Icaza <miguel@ximian.com>
29517 * assign.cs (Assign::Resolve): Resolve right hand side first, and
29518 then pass this as a hint to ResolveLValue.
29520 * expression.cs (FieldExpr): Add Location information
29522 (FieldExpr::LValueResolve): Report assignment to readonly
29525 (Expression::ExprClassFromMemberInfo): Pass location information.
29527 (Expression::ResolveLValue): Add new method that resolves an
29530 (Expression::DoResolveLValue): Default invocation calls
29533 (Indexers): New class used to keep track of indexers in a given
29536 (IStackStore): Renamed from LValue, as it did not really describe
29537 what this did. Also ResolveLValue is gone from this interface and
29538 now is part of Expression.
29540 (ElementAccess): Depending on the element access type
29542 * typemanager.cs: Add `indexer_name_type' as a Core type
29543 (System.Runtime.CompilerServices.IndexerNameAttribute)
29545 * statement.cs (Goto): Take a location.
29547 2001-10-18 Ravi Pratap <ravi@ximian.com>
29549 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29550 if two delegates are compatible.
29552 (NewDelegate::DoResolve): Update to take care of the case when
29553 we instantiate a delegate from another delegate.
29555 * typemanager.cs (FindMembers): Don't even try to look up members
29556 of Delegate types for now.
29558 2001-10-18 Ravi Pratap <ravi@ximian.com>
29560 * delegate.cs (NewDelegate): New class to take care of delegate
29563 * expression.cs (New): Split the delegate related code out into
29564 the NewDelegate class.
29566 * delegate.cs (DelegateInvocation): New class to handle delegate
29569 * expression.cs (Invocation): Split out delegate related code into
29570 the DelegateInvocation class.
29572 2001-10-17 Ravi Pratap <ravi@ximian.com>
29574 * expression.cs (New::DoResolve): Implement delegate creation fully
29575 and according to the spec.
29577 (New::DoEmit): Update to handle delegates differently.
29579 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29580 because of which we were printing out arguments in reverse order !
29582 * delegate.cs (VerifyMethod): Implement to check if the given method
29583 matches the delegate.
29585 (FullDelegateDesc): Implement.
29587 (VerifyApplicability): Implement.
29589 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29590 delegate invocations too.
29592 (Invocation::Emit): Ditto.
29594 * ../errors/cs1593.cs : Added.
29596 * ../errors/cs1594.cs : Added.
29598 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29600 2001-10-16 Ravi Pratap <ravi@ximian.com>
29602 * typemanager.cs (intptr_type): Core type for System.IntPtr
29604 (InitCoreTypes): Update for the same.
29606 (iasyncresult_type, asynccallback_type): Ditto.
29608 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29611 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29614 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29615 the builders for the 4 members of a delegate type :-)
29617 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29620 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29622 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29624 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29626 * statement.cs (Break::Emit): Implement.
29627 (Continue::Emit): Implement.
29629 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29630 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29631 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29632 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29635 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29636 properties that track the label for the current loop (begin of the
29637 loop and end of the loop).
29639 2001-10-15 Ravi Pratap <ravi@ximian.com>
29641 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29642 use of emitting anything at all.
29644 * class.cs, rootcontext.cs : Get rid of calls to the same.
29646 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29648 (Populate): Define the constructor correctly and set the implementation
29651 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29654 (AddDelegateType): Implement.
29656 (IsDelegateType): Implement helper method.
29658 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29660 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29661 and accordingly handle it.
29663 * delegate.cs (Populate): Take TypeContainer argument.
29664 Implement bits to define the Invoke method. However, I still haven't figured out
29665 how to take care of the native int bit :-(
29667 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29668 Qualify the name of the delegate, not its return type !
29670 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29673 (StandardConversionExists): Checking for array types turns out to be recursive.
29675 (ConvertReferenceExplicit): Implement array conversion.
29677 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29679 2001-10-12 Ravi Pratap <ravi@ximian.com>
29681 * cs-parser.jay (delegate_declaration): Store the fully qualified
29682 name as it is a type declaration.
29684 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29687 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29688 as TypeContainer::DefineType.
29690 (Populate): Method in which all the definition of the various methods (Invoke)
29693 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29696 (CloseDelegate): Finally creates the delegate.
29698 * class.cs (TypeContainer::DefineType): Update to define delegates.
29699 (Populate, Emit and CloseType): Do the same thing here too.
29701 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29702 delegates in all these operations.
29704 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29706 * expression.cs: LocalTemporary: a new expression used to
29707 reference a temporary that has been created.
29709 * assign.cs: Handle PropertyAccess back here, so that we can
29710 provide the proper semantic access to properties.
29712 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29713 a few more explicit conversions.
29715 * modifiers.cs: `NEW' modifier maps to HideBySig.
29717 * expression.cs (PropertyExpr): Make this into an
29718 ExpressionStatement, and support the EmitStatement code path.
29720 Perform get/set error checking, clean up the interface.
29722 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29723 them into toplevel access objects.
29725 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29727 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29730 * typemanager.cs: Keep track here of our PropertyBuilders again to
29731 work around lameness in SRE.
29733 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29735 * expression.cs (LValue::LValueResolve): New method in the
29736 interface, used to perform a second resolution pass for LValues.
29738 (This::DoResolve): Catch the use of this in static methods.
29740 (This::LValueResolve): Implement.
29742 (This::Store): Remove warning, assigning to `this' in structures
29745 (Invocation::Emit): Deal with invocation of
29746 methods on value types. We need to pass the address to structure
29747 methods rather than the object itself. (The equivalent code to
29748 emit "this" for structures leaves the entire structure on the
29749 stack instead of a pointer to it).
29751 (ParameterReference::DoResolve): Compute the real index for the
29752 argument based on whether the method takes or not a `this' pointer
29753 (ie, the method is static).
29755 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29756 value types returned from functions when we need to invoke a
29757 method on the sturcture.
29760 2001-10-11 Ravi Pratap <ravi@ximian.com>
29762 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29763 defining the type in the Modulebuilder or Typebuilder. This is to take
29764 care of nested types which need to be defined on the TypeBuilder using
29765 DefineNestedMethod.
29767 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29768 methods in RootContext, only ported to be part of TypeContainer.
29770 (TypeContainer::GetInterfaceOrClass): Ditto.
29772 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29774 * interface.cs (Interface::DefineInterface): New method. Does exactly
29775 what RootContext.CreateInterface did earlier, only it takes care of nested types
29778 (Interface::GetInterfaces): Move from RootContext here and port.
29780 (Interface::GetInterfaceByName): Same here.
29782 * rootcontext.cs (ResolveTree): Re-write.
29784 (PopulateTypes): Re-write.
29786 * class.cs (TypeContainer::Populate): Populate nested types too.
29787 (TypeContainer::Emit): Emit nested members too.
29789 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29790 instead just use the name argument passed in as it is already fully
29793 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29794 to TypeContainer mapping to see if a type is user-defined.
29796 * class.cs (TypeContainer::CloseType): Implement.
29798 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29799 the default constructor.
29801 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29804 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29806 * interface.cs (CloseType): Create the type here.
29808 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29811 Remove all the methods which are now in TypeContainer.
29813 2001-10-10 Ravi Pratap <ravi@ximian.com>
29815 * delegate.cs (Define): Re-write bits to define the delegate
29818 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29820 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29822 * expression.cs (ImplicitReferenceConversion): handle null as well
29823 as a source to convert to any reference type.
29825 * statement.cs (Return): Perform any implicit conversions to
29826 expected return type.
29828 Validate use of return statement.
29830 * codegen.cs (EmitContext): Pass the expected return type here.
29832 * class.cs (Method, Constructor, Property): Pass expected return
29833 type to EmitContext.
29835 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29837 * expression.cs: Make DoResolve take an EmitContext instead of a
29840 Replaced `l' and `location' for `loc', for consistency.
29842 (Error, Warning): Remove unneeded Tc argument.
29844 * assign.cs, literal.cs, constant.cs: Update to new calling
29847 * codegen.cs: EmitContext now contains a flag indicating whether
29848 code is being generated in a static method or not.
29850 * cs-parser.jay: DecomposeQI, new function that replaces the old
29851 QualifiedIdentifier. Now we always decompose the assembled
29852 strings from qualified_identifier productions into a group of
29855 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29857 * rootcontext.cs: Deal with field-less struct types correctly now
29858 by passing the size option to Define Type.
29860 * class.cs: Removed hack that created one static field.
29862 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29864 * statement.cs: Moved most of the code generation here.
29866 2001-10-09 Ravi Pratap <ravi@ximian.com>
29868 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29871 (ElementAccess): Remove useless bits for now - keep checks as the spec
29874 2001-10-08 Ravi Pratap <ravi@ximian.com>
29876 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29877 and start performing checks according to the spec.
29879 2001-10-07 Ravi Pratap <ravi@ximian.com>
29881 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29882 rank_specifiers instead.
29884 (rank_specifiers): Change the order in which the rank specifiers are stored
29886 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29888 * expression.cs (ElementAccess): Implement the LValue interface too.
29890 2001-10-06 Ravi Pratap <ravi@ximian.com>
29892 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29893 except that user defined conversions are not included.
29895 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29896 perform the conversion of the return type, if necessary.
29898 (New::DoResolve): Check whether we are creating an array or an object
29899 and accordingly do the needful.
29901 (New::Emit): Same here.
29903 (New::DoResolve): Implement guts of array creation.
29905 (New::FormLookupType): Helper function.
29907 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29909 * codegen.cs: Removed most of the code generation here, and move the
29910 corresponding code generation bits to the statement classes.
29912 Added support for try/catch/finalize and throw.
29914 * cs-parser.jay: Added support for try/catch/finalize.
29916 * class.cs: Catch static methods having the flags override,
29917 virtual or abstract.
29919 * expression.cs (UserCast): This user cast was not really doing
29920 what it was supposed to do. Which is to be born in fully resolved
29921 state. Parts of the resolution were being performed at Emit time!
29925 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29927 * expression.cs: Implicity convert the result from UserCast.
29929 2001-10-05 Ravi Pratap <ravi@ximian.com>
29931 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29932 prevented it from working correctly.
29934 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29935 merely ConvertImplicit.
29937 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29939 * typemanager.cs: Make the LookupTypeContainer function static,
29940 and not per-instance.
29942 * class.cs: Make static FindMembers (the one that takes a Type
29945 * codegen.cs: Add EmitForeach here.
29947 * cs-parser.jay: Make foreach a toplevel object instead of the
29948 inline expansion, as we need to perform semantic analysis on it.
29950 2001-10-05 Ravi Pratap <ravi@ximian.com>
29952 * expression.cs (Expression::ImplicitUserConversion): Rename to
29953 UserDefinedConversion.
29955 (Expression::UserDefinedConversion): Take an extra argument specifying
29956 whether we look for explicit user conversions too.
29958 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29960 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29962 (ExplicitUserConversion): Make it a call to UserDefinedConversion
29963 with the appropriate arguments.
29965 * cs-parser.jay (cast_expression): Record location too.
29967 * expression.cs (Cast): Record location info.
29969 (Expression::ConvertExplicit): Take location argument.
29971 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29972 to determine if we are doing explicit conversions.
29974 (UserCast::Emit): Update accordingly.
29976 (Expression::ConvertExplicit): Report an error if everything fails.
29978 * ../errors/cs0030.cs : Add.
29980 2001-10-04 Miguel de Icaza <miguel@ximian.com>
29982 * modifiers.cs: If the ABSTRACT keyword is present, also set the
29983 virtual and newslot bits.
29985 * class.cs (TypeContainer::RegisterRequiredImplementations):
29986 Record methods we need.
29988 (TypeContainer::MakeKey): Helper function to make keys for
29989 MethodBases, since the Methodbase key is useless.
29991 (TypeContainer::Populate): Call RegisterRequiredImplementations
29992 before defining the methods.
29994 Create a mapping for method_builders_to_methods ahead of time
29995 instead of inside a tight loop.
29997 (::RequireMethods): Accept an object as the data to set into the
29998 hashtable so we can report interface vs abstract method mismatch.
30000 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30002 * report.cs: Make all of it static.
30004 * rootcontext.cs: Drop object_type and value_type computations, as
30005 we have those in the TypeManager anyways.
30007 Drop report instance variable too, now it is a global.
30009 * driver.cs: Use try/catch on command line handling.
30011 Add --probe option to debug the error reporting system with a test
30014 * report.cs: Add support for exiting program when a probe
30015 condition is reached.
30017 2001-10-03 Ravi Pratap <ravi@ximian.com>
30019 * expression.cs (Binary::DoNumericPromotions): Fix the case when
30020 we do a forcible conversion regardless of type, to check if
30021 ForceConversion returns a null.
30023 (Binary::error19): Use location to report error.
30025 (Unary::error23): Use location here too.
30027 * ../errors/cs0019.cs : Check in.
30029 * ../errors/cs0023.cs : Check in.
30031 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30032 case of a non-null MethodInfo object with a length of 0 !
30034 (Binary::ResolveOperator): Flag error if overload resolution fails to find
30035 an applicable member - according to the spec :-)
30036 Also fix logic to find members in base types.
30038 (Unary::ResolveOperator): Same here.
30040 (Unary::report23): Change name to error23 and make first argument a TypeContainer
30041 as I was getting thoroughly confused between this and error19 :-)
30043 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30044 (::FindMostEncompassedType): Implement.
30045 (::FindMostEncompassingType): Implement.
30046 (::StandardConversionExists): Implement.
30048 (UserImplicitCast): Re-vamp. We now need info about most specific
30049 source and target types so that we can do the necessary conversions.
30051 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30052 mathematical union with no duplicates.
30054 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30056 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30057 in order from base classes to child classes, so that we can in
30058 child classes look up in our parent for method names and
30059 attributes (required for handling abstract, virtual, new, override
30060 constructs: we need to instrospect our base class, and if we dont
30061 populate the classes in order, the introspection might be
30062 incorrect. For example, a method could query its parent before
30063 the parent has any methods and would determine that the parent has
30064 no abstract methods (while it could have had them)).
30066 (RootContext::CreateType): Record the order in which we define the
30069 2001-10-02 Miguel de Icaza <miguel@ximian.com>
30071 * class.cs (TypeContainer::Populate): Also method definitions can
30072 fail now, keep track of this.
30074 (TypeContainer::FindMembers): Implement support for
30075 DeclaredOnly/noDeclaredOnly flag.
30077 (Constructor::Emit) Return the ConstructorBuilder.
30079 (Method::Emit) Return the MethodBuilder.
30080 Check for abstract or virtual methods to be public.
30082 * rootcontext.cs (RootContext::CreateType): Register all the
30083 abstract methods required for the class to be complete and the
30084 interface methods that must be implemented.
30086 * cs-parser.jay: Report error 501 (method requires body if it is
30087 not marked abstract or extern).
30089 * expression.cs (TypeOf::Emit): Implement.
30091 * typemanager.cs: runtime_handle_type, new global type.
30093 * class.cs (Property::Emit): Generate code for properties.
30095 2001-10-02 Ravi Pratap <ravi@ximian.com>
30097 * expression.cs (Unary::ResolveOperator): Find operators on base type
30098 too - we now conform exactly to the spec.
30100 (Binary::ResolveOperator): Same here.
30102 * class.cs (Operator::Define): Fix minor quirk in the tests.
30104 * ../errors/cs0215.cs : Added.
30106 * ../errors/cs0556.cs : Added.
30108 * ../errors/cs0555.cs : Added.
30110 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30112 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30113 single integer which is really efficient
30115 2001-10-01 Ravi Pratap <ravi@ximian.com>
30117 * expression.cs (Expression::ImplicitUserConversion): Use location
30118 even in the case when we are examining True operators.
30120 * class.cs (Operator::Define): Perform extensive checks to conform
30121 with the rules for operator overloading in the spec.
30123 * expression.cs (Expression::ImplicitReferenceConversion): Implement
30124 some of the other conversions mentioned in the spec.
30126 * typemanager.cs (array_type): New static member for the System.Array built-in
30129 (cloneable_interface): For System.ICloneable interface.
30131 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30132 we start resolving the tree and populating types.
30134 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30136 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30138 * expression.cs (Expression::ExprClassFromMemberInfo,
30139 Expression::Literalize): Create literal expressions from
30140 FieldInfos which are literals.
30142 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30143 type casts, because they were wrong. The test suite in tests
30146 (ImplicitNumericConversion): ushort to ulong requires a widening
30149 Int32 constant to long requires widening cast as well.
30151 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30152 for integers because the type on the stack is not i4.
30154 2001-09-30 Miguel de Icaza <miguel@ximian.com>
30156 * expression.cs (report118): require location argument.
30158 * parameter.cs: Do not dereference potential null value.
30160 * class.cs: Catch methods that lack the `new' keyword when
30161 overriding a name. Report warnings when `new' is used without
30162 anything being there to override.
30164 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30166 * class.cs: Only add constructor to hashtable if it is non-null
30167 (as now constructors can fail on define).
30169 (TypeManager, Class, Struct): Take location arguments.
30171 Catch field instance initialization in structs as errors.
30173 accepting_filter: a new filter for FindMembers that is static so
30174 that we dont create an instance per invocation.
30176 (Constructor::Define): Catch errors where a struct constructor is
30179 * cs-parser.jay: Pass location information for various new
30182 * delegate.cs (Delegate): take a location argument.
30184 * driver.cs: Do not call EmitCode if there were problesm in the
30185 Definition of the types, as many Builders wont be there.
30187 * decl.cs (Decl::Decl): Require a location argument.
30189 * cs-tokenizer.cs: Handle properly hex constants that can not fit
30190 into integers, and find the most appropiate integer for it.
30192 * literal.cs: Implement ULongLiteral.
30194 * rootcontext.cs: Provide better information about the location of
30195 failure when CreateType fails.
30197 2001-09-29 Miguel de Icaza <miguel@ximian.com>
30199 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30202 * expression.cs (Binary::CheckShiftArguments): Add missing type
30204 (Binary::ResolveOperator): Add type to the logical and and logical
30205 or, Bitwise And/Or and Exclusive Or code paths, it was missing
30208 (Binary::DoNumericPromotions): In the case where either argument
30209 is ulong (and most signed types combined with ulong cause an
30210 error) perform implicit integer constant conversions as well.
30212 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30214 * expression.cs (UserImplicitCast): Method should always be
30216 (Invocation::BetterConversion): Simplified test for IntLiteral.
30218 (Expression::ImplicitNumericConversion): Split this routine out.
30219 Put the code that performs implicit constant integer conversions
30222 (Expression::Resolve): Become a wrapper around DoResolve so we can
30223 check eclass and type being set after resolve.
30225 (Invocation::Badness): Remove this dead function
30227 (Binary::ResolveOperator): Do not compute the expensive argumnets
30228 unless we have a union for it.
30230 (Probe::Emit): Is needs to do an isinst and then
30231 compare against null.
30233 (::CanConvert): Added Location argument. If the Location argument
30234 is null (Location.Null), then we do not report errors. This is
30235 used by the `probe' mechanism of the Explicit conversion. We do
30236 not want to generate an error for something that the user
30237 explicitly requested to be casted. But the pipeline for an
30238 explicit cast first tests for potential implicit casts.
30240 So for now, if the Location is null, it means `Probe only' to
30241 avoid adding another argument. Might have to revise this
30244 (ClassCast): New class used to type cast objects into arbitrary
30245 classes (used in Explicit Reference Conversions).
30247 Implement `as' as well.
30249 Reverted all the patches from Ravi below: they were broken:
30251 * The use of `level' as a mechanism to stop recursive
30252 invocations is wrong. That was there just to catch the
30253 bug with a strack trace but not as a way of addressing
30256 To fix the problem we have to *understand* what is going
30257 on and the interactions and come up with a plan, not
30258 just get things going.
30260 * The use of the type conversion cache that I proposed
30261 last night had an open topic: How does this work across
30262 protection domains. A user defined conversion might not
30263 be public in the location where we are applying the
30264 conversion, a different conversion might be selected
30265 (ie, private A->B (better) but public B->A (worse),
30266 inside A, A->B applies, but outside it, B->A will
30269 * On top of that (ie, even if the above is solved),
30270 conversions in a cache need to be abstract. Ie, `To
30271 convert from an Int to a Short use an OpcodeCast', not
30272 `To convert from an Int to a Short use the OpcodeCast on
30273 the variable 5' (which is what this patch was doing).
30275 2001-09-28 Ravi Pratap <ravi@ximian.com>
30277 * expression.cs (Invocation::ConversionExists): Re-write to use
30278 the conversion cache
30280 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30281 cache all conversions done, not just user-defined ones.
30283 (Invocation::BetterConversion): The real culprit. Use ConversionExists
30284 to determine if a conversion exists instead of acutually trying to
30285 perform the conversion. It's faster too.
30287 (Expression::ConvertExplicit): Modify to use ConversionExists to check
30288 and only then attempt the implicit conversion.
30290 2001-09-28 Ravi Pratap <ravi@ximian.com>
30292 * expression.cs (ConvertImplicit): Use a cache for conversions
30293 already found. Check level of recursion and bail out if necessary.
30295 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30297 * typemanager.cs (string_concat_string_string, string_concat_object_object):
30298 Export standard methods that we expect for string operations.
30300 * statement.cs (Block::UsageWarning): Track usage of variables and
30301 report the errors for not used variables.
30303 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30306 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30308 * codegen.cs: remove unnneded code
30310 * expression.cs: Removed BuiltinTypeAccess class
30312 Fix the order in which implicit conversions are
30315 The previous fixed dropped support for boxed conversions (adding a
30316 test to the test suite now)
30318 (UserImplicitCast::CanConvert): Remove test for source being null,
30319 that code is broken. We should not feed a null to begin with, if
30320 we do, then we should track the bug where the problem originates
30321 and not try to cover it up here.
30323 Return a resolved expression of type UserImplicitCast on success
30324 rather than true/false. Ravi: this is what I was talking about,
30325 the pattern is to use a static method as a "constructor" for
30328 Also, do not create arguments until the very last minute,
30329 otherwise we always create the arguments even for lookups that
30330 will never be performed.
30332 (UserImplicitCast::Resolve): Eliminate, objects of type
30333 UserImplicitCast are born in a fully resolved state.
30335 * typemanager.cs (InitCoreTypes): Init also value_type
30336 (System.ValueType).
30338 * expression.cs (Cast::Resolve): First resolve the child expression.
30340 (LValue): Add new method AddressOf to be used by
30343 Change the argument of Store to take an EmitContext instead of an
30344 ILGenerator, because things like FieldExpr need to be able to call
30345 their children expression to generate the instance code.
30347 (Expression::Error, Expression::Warning): Sugar functions for
30350 (Expression::MemberLookup): Accept a TypeContainer instead of a
30351 Report as the first argument.
30353 (Expression::ResolvePrimary): Killed. I still want to improve
30354 this as currently the code is just not right.
30356 (Expression::ResolveMemberAccess): Simplify, but it is still
30359 (Unary::Resolve): Catch errors in AddressOf operators.
30361 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30362 index to a byte for the short-version, or the compiler will choose
30363 the wrong Emit call, which generates the wrong data.
30365 (ParameterReference::Emit, ::Store): same.
30367 (FieldExpr::AddressOf): Implement.
30369 * typemanager.cs: TypeManager: made public variable instead of
30372 * driver.cs: document --fatal.
30374 * report.cs (ErrorMessage, WarningMessage): new names for the old
30375 Error and Warning classes.
30377 * cs-parser.jay (member_access): Turn built-in access to types
30378 into a normal simplename
30380 2001-09-27 Ravi Pratap <ravi@ximian.com>
30382 * expression.cs (Invocation::BetterConversion): Fix to cope
30383 with q being null, since this was introducing a bug.
30385 * expression.cs (ConvertImplicit): Do built-in conversions first.
30387 2001-09-27 Ravi Pratap <ravi@ximian.com>
30389 * expression.cs (UserImplicitCast::Resolve): Fix bug.
30391 2001-09-27 Ravi Pratap <ravi@ximian.com>
30393 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30394 I had introduced long ago (what's new ?).
30396 * expression.cs (UserImplicitCast::CanConvert): Static method to do
30397 the work of all the checking.
30398 (ConvertImplicit): Call CanConvert and only then create object if necessary.
30399 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30401 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30402 that is the right way.
30404 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
30405 overloading resolution. Use everywhere instead of cutting and pasting code.
30407 (Binary::ResolveOperator): Use MakeUnionSet.
30409 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
30410 we have to convert to bool types. Not complete yet.
30412 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30414 * typemanager.cs (TypeManager::CSharpName): support ushort.
30416 * expression.cs (Expression::TryImplicitIntConversion): Attempts
30417 to provide an expression that performsn an implicit constant int
30418 conversion (section 6.1.6).
30419 (Expression::ConvertImplicitRequired): Reworked to include
30420 implicit constant expression conversions.
30422 (Expression::ConvertNumericExplicit): Finished.
30424 (Invocation::Emit): If InstanceExpression is null, then it means
30425 that we perform a call on this.
30427 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30429 * expression.cs (Unary::Emit): Remove some dead code.
30430 (Probe): Implement Resolve and Emit for `is'.
30431 (Expression::ConvertImplicitRequired): Attempt to do constant
30432 expression conversions here. Maybe should be moved to
30433 ConvertImplicit, but I am not sure.
30434 (Expression::ImplicitLongConstantConversionPossible,
30435 Expression::ImplicitIntConstantConversionPossible): New functions
30436 that tell whether is it possible to apply an implicit constant
30437 expression conversion.
30439 (ConvertNumericExplicit): Started work on explicit numeric
30442 * cs-parser.jay: Update operator constants.
30444 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30445 (Parameters::GetSignature): Hook up VerifyArgs here.
30446 (Parameters::VerifyArgs): Verifies that no two arguments have the
30449 * class.cs (Operator): Update the operator names to reflect the
30450 ones that the spec expects (as we are just stringizing the
30453 * expression.cs (Unary::ResolveOperator): Fix bug: Use
30454 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30455 previous usage did only work for our methods.
30456 (Expression::ConvertImplicit): Handle decimal implicit numeric
30457 conversions as well.
30458 (Expression::InternalTypeConstructor): Used to invoke constructors
30459 on internal types for default promotions.
30461 (Unary::Emit): Implement special handling for the pre/post
30462 increment/decrement for overloaded operators, as they need to have
30463 the same semantics as the other operators.
30465 (Binary::ResolveOperator): ditto.
30466 (Invocation::ConversionExists): ditto.
30467 (UserImplicitCast::Resolve): ditto.
30469 2001-09-26 Ravi Pratap <ravi@ximian.com>
30471 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30472 operator, return after emitting body. Regression tests pass again !
30474 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30475 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30476 (Invocation::OverloadResolve): Ditto.
30477 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30479 * everywhere : update calls to the above methods accordingly.
30481 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30483 * assign.cs (Assign): Make it inherit from ExpressionStatement.
30485 * expression.cs (ExpressionStatement): New base class used for
30486 expressions that can appear in statements, so that we can provide
30487 an alternate path to generate expression that do not leave a value
30490 (Expression::Emit, and all the derivatives): We no longer return
30491 whether a value is left on the stack or not. Every expression
30492 after being emitted leaves a single value on the stack.
30494 * codegen.cs (EmitContext::EmitStatementExpression): Use the
30495 facilties of ExpressionStatement if possible.
30497 * cs-parser.jay: Update statement_expression.
30499 2001-09-25 Miguel de Icaza <miguel@ximian.com>
30501 * driver.cs: Change the wording of message
30503 2001-09-25 Ravi Pratap <ravi@ximian.com>
30505 * expression.cs (Binary::ResolveOperator): Had forgottten to set
30506 the type of the expression to the return type of the method if
30507 we have an overloaded operator match ! The regression tests pass again !
30508 (Unary::ResolveOperator): Ditto.
30510 * expression.cs (Invocation::ConversionExists): Correct the member lookup
30511 to find "op_Implicit", not "implicit" ;-)
30512 (UserImplicitCast): New class to take care of user-defined implicit conversions.
30513 (ConvertImplicit, ForceConversion): Take TypeContainer argument
30515 * everywhere : Correct calls to the above accordingly.
30517 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30518 (ConvertImplicit): Do user-defined conversion if it exists.
30520 2001-09-24 Miguel de Icaza <miguel@ximian.com>
30522 * assign.cs: track location.
30523 (Resolve): Use implicit conversions on assignment.
30525 * literal.cs: Oops. Not good, Emit of short access values should
30526 pass (Bytes) or the wrong argument will be selected.
30528 * expression.cs (Unary::Emit): Emit code for -expr.
30530 (Unary::ResolveOperator): Handle `Substract' for non-constants
30531 (substract from zero from the non-constants).
30532 Deal with Doubles as well.
30534 (Expression::ConvertImplicitRequired): New routine that reports an
30535 error if no implicit conversion exists.
30537 (Invocation::OverloadResolve): Store the converted implicit
30538 expressions if we make them
30540 2001-09-24 Ravi Pratap <ravi@ximian.com>
30542 * class.cs (ConstructorInitializer): Take a Location argument.
30543 (ConstructorBaseInitializer): Same here.
30544 (ConstructorThisInitializer): Same here.
30546 * cs-parser.jay : Update all calls accordingly.
30548 * expression.cs (Unary, Binary, New): Take location argument.
30549 Update accordingly everywhere.
30551 * cs-parser.jay : Update all calls to the above to take a location
30554 * class.cs : Ditto.
30556 2001-09-24 Ravi Pratap <ravi@ximian.com>
30558 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30559 (Invocation::BetterConversion): Same here
30560 (Invocation::ConversionExists): Ditto.
30562 (Invocation::ConversionExists): Implement.
30564 2001-09-22 Ravi Pratap <ravi@ximian.com>
30566 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30567 Also take an additional TypeContainer argument.
30569 * All over : Pass in TypeContainer as argument to OverloadResolve.
30571 * typemanager.cs (CSharpName): Update to check for the string type and return
30574 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30577 2001-09-21 Ravi Pratap <ravi@ximian.com>
30579 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30580 (Invocation::BetterFunction): Implement.
30581 (Invocation::BetterConversion): Implement.
30582 (Invocation::ConversionExists): Skeleton, no implementation yet.
30584 Okay, things work fine !
30586 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30588 * typemanager.cs: declare and load enum_type, delegate_type and
30591 * expression.cs (Expression::Emit): Now emit returns a value that
30592 tells whether a value is left on the stack or not. This strategy
30593 might be reveted tomorrow with a mechanism that would address
30594 multiple assignments.
30595 (Expression::report118): Utility routine to report mismatches on
30598 (Unary::Report23): Report impossible type/operator combination
30601 (Unary::IsIncrementableNumber): Whether the type can be
30602 incremented or decremented with add.
30603 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30605 (Unary::ResolveOperator): Implement ++, !, ~,
30607 (Invocation::Emit): Deal with new Emit convetion.
30609 * All Expression derivatives: Updated their Emit method to return
30610 whether they leave values on the stack or not.
30612 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30613 stack for expressions that are statements.
30615 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30617 * expression.cs (LValue): New interface. Must be implemented by
30619 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30622 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30623 interface for generating code, simplifies the code.
30625 2001-09-20 Ravi Pratap <ravi@ximian.com>
30627 * expression.cs (everywhere): Comment out return statements in ::Resolve
30628 methods to avoid the warnings.
30630 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30632 * driver.cs (parse): Report error 2001 if we can not open the
30635 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30638 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30641 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30642 otherwise nested blocks end up with the same index.
30644 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30646 * expression.cs: Instead of having FIXMEs in the Resolve
30647 functions, throw exceptions so it is obvious that we are facing a
30650 * cs-parser.jay (invocation_expression): Pass Location information.
30652 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30653 Use a basename for those routines because .NET does not like paths
30656 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30659 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30661 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30662 are loading the correct data types (throws an exception if not).
30663 (TypeManager::InitCoreTypes): Use CoreLookupType
30665 * expression.cs (Unary::ResolveOperator): return the child
30666 expression for expressions which are just +expr.
30667 (Unary::ResolveOperator): Return negative literals for -LITERAL
30668 expressions (otherwise they are Unary {Literal}).
30669 (Invocation::Badness): Take into account `Implicit constant
30670 expression conversions'.
30672 * literal.cs (LongLiteral): Implement long literal class.
30673 (IntLiteral): export the `Value' of the intliteral.
30675 2001-09-19 Ravi Pratap <ravi@ximian.com>
30677 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30679 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30680 instead of 'Operator'
30682 * expression.cs (Binary::ResolveOperator): Update accordingly.
30683 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30686 * cs-parser.jay (unary_expression): Update to use the new names.
30688 * gen-treedump.cs (GetUnary): Same here.
30690 * expression.cs (Unary::Resolve): Implement.
30691 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30692 operators are found instead of making noise ;-)
30693 (Unary::ResolveOperator): New method to do precisely the same thing which
30694 Binary::ResolveOperator does for Binary expressions.
30695 (Unary.method, .Arguments): Add.
30696 (Unary::OperName): Implement.
30697 (Unary::ForceConversion): Copy and Paste !
30699 * class.cs (Operator::Define): Fix a small bug for the case when we have
30702 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30703 for the inbuilt operators. Only overloading works for now ;-)
30705 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30707 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30708 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30710 * expression.cs (This::Emit): Implement.
30711 (This::Resolve): Implement.
30712 (TypeOf:Resolve): Implement.
30713 (Expression::ResolveSimpleName): Add an implicit this to instance
30715 (MemberAccess::Resolve): Deal with Parameters and Fields.
30716 Bind instance variable to Field expressions.
30717 (FieldExpr::Instance): New field used to track the expression that
30718 represents the object instance.
30719 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30721 (FieldExpr::Emit): Implement.
30723 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30724 the last instruction contains a return opcode to avoid generating
30725 the last `ret' instruction (this generates correct code, and it is
30726 nice to pass the peverify output).
30728 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30729 initializer for static and instance variables.
30730 (Constructor::Emit): Allow initializer to be null in the case of
30731 static constructors. Only emit initializer for instance
30734 (TypeContainer::FindMembers): Return a null array if there are no
30737 Also fix the code for the MemberTypes.Method branch, as it was not
30738 scanning that for operators (or tried to access null variables before).
30740 * assign.cs (Assign::Emit): Handle instance and static fields.
30744 * driver.cs: Stop compilation if there are parse errors.
30746 * cs-parser.jay (constructor_declaration): Provide default base
30747 initializer for non-static constructors.
30748 (constructor_declarator): Do not provide a default base
30749 initializers if none was specified.
30750 Catch the fact that constructors should not have parameters.
30752 * class.cs: Do not emit parent class initializers for static
30753 constructors, that should be flagged as an error.
30755 2001-09-18 Ravi Pratap <ravi@ximian.com>
30757 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30758 Move back code into TypeContainer::Populate.
30760 2001-09-18 Ravi Pratap <ravi@ximian.com>
30762 * class.cs (TypeContainer::AddConstructor): Fix the check to
30763 compare against Name, not Basename.
30764 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30766 * cs-parser.jay : Update accordingly.
30768 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30769 for methods, don't forget to look into the operators too.
30770 (RegisterMethodBuilder): Helper method to take care of this for
30771 methods, constructors and operators.
30772 (Operator::Define): Completely revamp.
30773 (Operator.OperatorMethod, MethodName): New fields.
30774 (TypeContainer::Populate): Move the registering of builders into
30775 RegisterMethodBuilder.
30776 (Operator::Emit): Re-write.
30778 * expression.cs (Binary::Emit): Comment out code path to emit method
30779 invocation stuff for the case when we have a user defined operator. I am
30780 just not able to get it right !
30782 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30784 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30787 (Expression::MemberLookup): Provide a version that allows to
30788 specify the MemberTypes and BindingFlags.
30790 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30791 so it was not fetching variable information from outer blocks.
30793 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30794 Beforefieldinit as it was buggy.
30796 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30797 that Ravi put here.
30799 * class.cs (Constructor::Emit): Only emit if block is not null.
30800 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30801 deal with this by semantically definining it as if the user had
30804 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30805 constructors as we now "emit" them at a higher level.
30807 (TypeContainer::DefineDefaultConstructor): Used to define the
30808 default constructors if none was provided.
30810 (ConstructorInitializer): Add methods Resolve and Emit.
30812 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30814 2001-09-17 Ravi Pratap <ravi@ximian.com>
30816 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30817 the default constructor builder with our hashtable for methodbuilders
30820 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30821 and argument_count is 0 in which case we have a match.
30822 (Binary::ResolveOperator): More null checking and miscellaneous coding
30825 2001-09-17 Ravi Pratap <ravi@ximian.com>
30827 * rootcontext.cs (IsNameSpace): Compare against null.
30829 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30831 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30832 and Unary::Operator.
30834 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30837 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30838 we have overloaded operators.
30839 (Binary::ResolveOperator): Implement the part which does the operator overload
30842 * class.cs (Operator::Emit): Implement.
30843 (TypeContainer::Emit): Emit the operators we have too.
30845 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30846 the case when we have a user-defined operator.
30848 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30850 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30852 2001-09-16 Ravi Pratap <ravi@ximian.com>
30854 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30855 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30856 (Constructor::Emit): Implement.
30857 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30858 if we have no work to do.
30859 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30862 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30863 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30865 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30868 2001-09-15 Ravi Pratap <ravi@ximian.com>
30870 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30872 (Tree::RecordNamespace): Method to do what the name says ;-)
30873 (Tree::Namespaces): Property to get at the namespaces hashtable.
30875 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30878 * rootcontext.cs (IsNamespace): Fixed it :-)
30880 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30882 * class.cs (TypeContainer::FindMembers): Add support for
30884 (MethodCore): New class that encapsulates both the shared aspects
30885 of a Constructor and a Method.
30886 (Method, Constructor): Factored pieces into MethodCore.
30888 * driver.cs: Added --fatal which makes errors throw exceptions.
30889 Load System assembly as well as part of the standard library.
30891 * report.cs: Allow throwing exceptions on errors for debugging.
30893 * modifiers.cs: Do not use `parent', instead use the real type
30894 container to evaluate permission settings.
30896 * class.cs: Put Ravi's patch back in. He is right, and we will
30897 have to cope with the
30899 2001-09-14 Ravi Pratap <ravi@ximian.com>
30901 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30902 FamORAssem, not FamANDAssem.
30904 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30906 * driver.cs: Added --parse option that only parses its input files
30909 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30910 incorrect. IsTopLevel is not used to tell whether an object is
30911 root_types or not (that can be achieved by testing this ==
30912 root_types). But to see if this is a top-level *class* (not
30913 necessarly our "toplevel" container).
30915 2001-09-14 Ravi Pratap <ravi@ximian.com>
30917 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30918 parent instead of a direct call to GetType.
30920 2001-09-14 Ravi Pratap <ravi@ximian.com>
30922 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30923 Modifiers.TypeAttr. This should just be a call to that method.
30925 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30926 object so that we can determine if we are top-level or not.
30928 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30931 * enum.cs (Enum::Define): Ditto.
30933 * modifiers.cs (FieldAttr): Re-write.
30935 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30936 (TypeContainer::HaveStaticConstructor): New property to provide access
30937 to precisely that info.
30939 * modifiers.cs (MethodAttr): Re-write.
30940 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30942 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30943 of top-level types as claimed.
30945 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30947 * expression.cs (MemberLookup): Fruitless attempt to lookup
30948 constructors. Maybe I need to emit default constructors? That
30949 might be it (currently .NET emits this for me automatically).
30950 (Invocation::OverloadResolve): Cope with Arguments == null.
30951 (Invocation::EmitArguments): new function, shared by the new
30952 constructor and us.
30953 (Invocation::Emit): Handle static and instance methods. Emit
30954 proper call instruction for virtual or non-virtual invocations.
30955 (New::Emit): Implement.
30956 (New::Resolve): Implement.
30957 (MemberAccess:Resolve): Implement.
30958 (MethodGroupExpr::InstanceExpression): used conforming to the spec
30959 to track instances.
30960 (FieldExpr::Resolve): Set type.
30962 * support.cs: Handle empty arguments.
30964 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30965 SimpleLookup): Auxiliary routines to help parse a qualifier
30968 Update qualifier_identifier rule.
30970 * codegen.cs: Removed debugging messages.
30972 * class.cs: Make this a global thing, this acts just as a "key" to
30973 objects that we might have around.
30975 (Populate): Only initialize method_builders_to_methods once.
30977 * expression.cs (PropertyExpr): Initialize type from the
30980 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30981 Resolve pattern. Attempt to implicitly convert value to boolean.
30984 * expression.cs: Set the type for the int32/int32 argument case.
30985 (Binary::ResolveOperator): Set the return type to boolean for
30986 comparission operators
30988 * typemanager.cs: Remove debugging print code.
30990 (Invocation::Resolve): resolve type.
30992 * class.cs: Allocate a MemberInfo of the correct size, as the code
30993 elsewhere depends on the test to reflect the correct contents.
30995 (Method::) Keep track of parameters, due to System.Reflection holes
30997 (TypeContainer::Populate): Keep track of MethodBuilders to Method
31000 (TypeContainer::FindMembers): Use ArrayList and then copy an array
31001 of the exact size and return that.
31003 (Class::LookupMethodByBuilder): New function that maps
31004 MethodBuilders to its methods. Required to locate the information
31005 on methods because System.Reflection bit us again.
31007 * support.cs: New file, contains an interface ParameterData and
31008 two implementations: ReflectionParameters and InternalParameters
31009 used to access Parameter information. We will need to grow this
31012 * expression.cs (Invocation::GetParameterData): implement a cache
31013 and a wrapper around the ParameterData creation for methods.
31014 (Invocation::OverloadResolve): Use new code.
31016 2001-09-13 Ravi Pratap <ravi@ximian.com>
31018 * class.cs (TypeContainer::EmitField): Remove and move into
31019 (Field::Define): here and modify accordingly.
31020 (Field.FieldBuilder): New member.
31021 (TypeContainer::Populate): Update accordingly.
31022 (TypeContainer::FindMembers): Implement.
31024 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31026 * statement.cs: (VariableInfo::VariableType): New field to be
31027 initialized with the full type once it is resolved.
31029 2001-09-12 Miguel de Icaza <miguel@ximian.com>
31031 * parameter.cs (GetParameterInfo): Use a type cache to compute
31032 things only once, and to reuse this information
31034 * expression.cs (LocalVariableReference::Emit): Implement.
31035 (OpcodeCast::Emit): fix.
31037 (ParameterReference::Resolve): Implement.
31038 (ParameterReference::Emit): Implement.
31040 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31041 that are expressions need to stay as Expressions.
31043 * typemanager.cs (CSharpName): Returns the C# name of a type if
31046 * expression.cs (Expression::ConvertImplicit): New function that
31047 implements implicit type conversions.
31049 (Expression::ImplicitReferenceConversion): Implements implicit
31050 reference conversions.
31052 (EmptyCast): New type for transparent casts.
31054 (OpcodeCast): New type for casts of types that are performed with
31055 a sequence of bytecodes.
31057 (BoxedCast): New type used for casting value types into reference
31058 types. Emits a box opcode.
31060 (Binary::DoNumericPromotions): Implements numeric promotions of
31061 and computation of the Binary::Type.
31063 (Binary::EmitBranchable): Optimization.
31065 (Binary::Emit): Implement code emission for expressions.
31067 * typemanager.cs (TypeManager): Added two new core types: sbyte
31070 2001-09-12 Ravi Pratap <ravi@ximian.com>
31072 * class.cs (TypeContainer::FindMembers): Method which does exactly
31073 what Type.FindMembers does, only we don't have to use reflection. No
31074 implementation yet.
31076 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31077 typecontainer objects as we need to get at them.
31078 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31080 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31081 typecontainer object.
31083 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31084 of just a Report object.
31086 2001-09-11 Ravi Pratap <ravi@ximian.com>
31088 * class.cs (Event::Define): Go back to using the prefixes "add_" and
31090 (TypeContainer::Populate): Now define the delegates of the type too.
31091 (TypeContainer.Delegates): Property to access the list of delegates defined
31094 * delegates.cs (Delegate::Define): Implement partially.
31096 * modifiers.cs (TypeAttr): Handle more flags.
31098 2001-09-11 Ravi Pratap <ravi@ximian.com>
31100 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31102 (Operator::Define): Re-write logic to get types by using the LookupType method
31103 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31104 (Indexer::Define): Ditto.
31105 (Event::Define): Ditto.
31106 (Property::Define): Ditto.
31108 2001-09-10 Ravi Pratap <ravi@ximian.com>
31110 * class.cs (TypeContainer::Populate): Now define operators too.
31111 (TypeContainer.Operators): New property to access the list of operators
31113 (Operator.OperatorMethodBuilder): New member to hold the method builder
31114 for the operator we are defining.
31115 (Operator::Define): Implement.
31117 2001-09-10 Ravi Pratap <ravi@ximian.com>
31119 * class.cs (Event::Define): Make the prefixes of the accessor methods
31120 addOn_ and removeOn_
31122 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31123 of the location being passed in too. Ideally, this should go later since all
31124 error reporting should be done through the Report object.
31126 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31127 (Populate): Iterate thru the indexers we have and define them too.
31128 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31129 for the get and set accessors.
31130 (Indexer::Define): Implement.
31132 2001-09-09 Miguel de Icaza <miguel@ximian.com>
31134 * expression.cs (Binary::Resolve): Beginning of it. I scratched
31135 my previous implementation, did not work.
31137 * typemanager.cs: Add a couple of missing types (the longs).
31139 * literal.cs: Use TypeManager.bool_type instead of getting it.
31141 * expression.cs (EventExpr): New kind of expressions.
31142 (Expressio::ExprClassFromMemberInfo): finish
31144 2001-09-08 Miguel de Icaza <miguel@ximian.com>
31146 * assign.cs: Emit stores to static fields differently.
31148 2001-09-08 Ravi Pratap <ravi@ximian.com>
31150 * Merge in changes and adjust code to tackle conflicts. Backed out my
31151 code in Assign::Resolve ;-)
31153 2001-09-08 Ravi Pratap <ravi@ximian.com>
31155 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31156 instead Report.Error and also pass in the location.
31157 (CSharpParser::Lexer): New readonly property to return the reference
31158 to the Tokenizer object.
31159 (declare_local_variables): Use Report.Error with location instead of plain
31163 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31164 (Operator.CheckBinaryOperator): Ditto.
31166 * cs-parser.jay (operator_declarator): Update accordingly.
31168 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31169 (CheckBinaryOperator): Same here.
31171 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31172 on the name without any prefixes of namespace names etc. This is because we
31173 already might have something already fully qualified like
31174 'System.Console.WriteLine'
31176 * assign.cs (Resolve): Begin implementation. Stuck ;-)
31178 2001-09-07 Ravi Pratap <ravi@ximian.com>
31180 * cs-tokenizer.cs (location): Return a string which also contains
31183 * expression.cs (ElementAccess): New class for expressions of the
31184 type 'element access.'
31185 (BaseAccess): New class for expressions of the type 'base access.'
31186 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31189 * cs-parser.jay (element_access): Implement action.
31190 (base_access): Implement actions.
31191 (checked_expression, unchecked_expression): Implement.
31193 * cs-parser.jay (local_variable_type): Correct and implement.
31194 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31196 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31198 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31199 name and the specifiers.
31201 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31203 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
31204 making them all public ;-)
31206 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31209 2001-09-07 Miguel de Icaza <miguel@ximian.com>
31211 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31213 (FieldExpr, PropertyExprs): New resolved expressions.
31214 (SimpleName::MemberStaticCheck): Perform static checks for access
31215 to non-static fields on static methods. Maybe this should be
31216 generalized for MemberAccesses.
31217 (SimpleName::ResolveSimpleName): More work on simple name
31220 * cs-parser.jay (primary_expression/qualified_identifier): track
31221 the parameter index.
31223 * codegen.cs (CodeGen::Save): Catch save exception, report error.
31224 (EmitContext::EmitBoolExpression): Chain to expression generation
31225 instead of temporary hack.
31226 (::EmitStatementExpression): Put generic expression code generation.
31228 * assign.cs (Assign::Emit): Implement variable assignments to
31229 local variables, parameters and fields.
31231 2001-09-06 Miguel de Icaza <miguel@ximian.com>
31233 * statement.cs (Block::GetVariableInfo): New method, returns the
31234 VariableInfo for a variable name in a block.
31235 (Block::GetVariableType): Implement in terms of GetVariableInfo
31237 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31238 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31240 2001-09-06 Ravi Pratap <ravi@ximian.com>
31242 * cs-parser.jay (operator_declaration): Continue on my quest : update
31243 to take attributes argument.
31244 (event_declaration): Ditto.
31245 (enum_declaration): Ditto.
31246 (indexer_declaration): Ditto.
31248 * class.cs (Operator::Operator): Update constructor accordingly.
31249 (Event::Event): Ditto.
31251 * delegate.cs (Delegate::Delegate): Same here.
31253 * enum.cs (Enum::Enum): Same here.
31255 2001-09-05 Ravi Pratap <ravi@ximian.com>
31257 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31259 * ../tests/cs0658.cs : New file to demonstrate error 0658.
31261 * attribute.cs (Attributes): New class to encapsulate all attributes which were
31262 being passed around as an arraylist.
31263 (Attributes::AddAttribute): Method to add attribute sections.
31265 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31266 (struct_declaration): Update accordingly.
31267 (constant_declaration): Update.
31268 (field_declaration): Update.
31269 (method_header): Update.
31270 (fixed_parameter): Update.
31271 (parameter_array): Ditto.
31272 (property_declaration): Ditto.
31273 (destructor_declaration): Ditto.
31275 * class.cs (Struct::Struct): Update constructors accordingly.
31276 (Class::Class): Ditto.
31277 (Field::Field): Ditto.
31278 (Method::Method): Ditto.
31279 (Property::Property): Ditto.
31280 (TypeContainer::OptAttribute): update property's return type.
31282 * interface.cs (Interface.opt_attributes): New member.
31283 (Interface::Interface): Update to take the extra Attributes argument.
31285 * parameter.cs (Parameter::Parameter): Ditto.
31287 * constant.cs (Constant::Constant): Ditto.
31289 * interface.cs (InterfaceMemberBase): New OptAttributes field.
31290 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
31291 the attributes as a parameter.
31292 (InterfaceProperty): Update constructor call.
31293 (InterfaceEvent): Ditto.
31294 (InterfaceMethod): Ditto.
31295 (InterfaceIndexer): Ditto.
31297 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
31298 pass the attributes too.
31299 (interface_event_declaration): Ditto.
31300 (interface_property_declaration): Ditto.
31301 (interface_method_declaration): Ditto.
31302 (interface_declaration): Ditto.
31304 2001-09-05 Miguel de Icaza <miguel@ximian.com>
31306 * class.cs (Method::Define): Track the "static Main" definition to
31307 create an entry point.
31309 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31310 EntryPoint if we find it.
31312 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31313 (EmitContext::ig): Make this variable public.
31315 * driver.cs: Make the default output file be the first file name
31316 with the .exe extension.
31318 Detect empty compilations
31320 Handle various kinds of output targets. Handle --target and
31321 rename -t to --dumper.
31323 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31324 methods inherited from Expression return now an Expression. This
31325 will is used during the tree rewriting as we resolve them during
31328 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31329 the spec. Missing entirely is the information about
31330 accessability of elements of it.
31332 (Expression::ExprClassFromMemberInfo): New constructor for
31333 Expressions that creates a fully initialized Expression based on
31334 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31337 (Invocation::Resolve): Begin implementing resolution of invocations.
31339 * literal.cs (StringLiteral): Implement Emit.
31341 2001-09-05 Ravi Pratap <ravi@ximian.com>
31343 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31346 2001-09-04 Ravi Pratap <ravi@ximian.com>
31348 * cs-parser.jay (attribute_arguments): Implement actions.
31349 (attribute): Fix bug in production. Implement action.
31350 (attribute_list): Implement.
31351 (attribute_target): Implement.
31352 (attribute_target_specifier, opt_target_specifier): Implement
31353 (CheckAttributeTarget): New method to check if the attribute target
31355 (attribute_section): Implement.
31356 (opt_attributes): Implement.
31358 * attribute.cs : New file to handle attributes.
31359 (Attribute): Class to hold attribute info.
31361 * cs-parser.jay (opt_attribute_target_specifier): Remove production
31362 (attribute_section): Modify production to use 2 different rules to
31363 achieve the same thing. 1 s/r conflict down !
31364 Clean out commented, useless, non-reducing dimension_separator rules.
31366 * class.cs (TypeContainer.attributes): New member to hold list
31367 of attributes for a type.
31368 (Struct::Struct): Modify to take one more argument, the attribute list.
31369 (Class::Class): Ditto.
31370 (Field::Field): Ditto.
31371 (Method::Method): Ditto.
31372 (Property::Property): Ditto.
31374 * cs-parser.jay (struct_declaration): Update constructor call to
31375 pass in the attributes too.
31376 (class_declaration): Ditto.
31377 (constant_declaration): Ditto.
31378 (field_declaration): Ditto.
31379 (method_header): Ditto.
31380 (fixed_parameter): Ditto.
31381 (parameter_array): Ditto.
31382 (property_declaration): Ditto.
31384 * constant.cs (Constant::Constant): Update constructor similarly.
31385 Use System.Collections.
31387 * parameter.cs (Parameter::Parameter): Update as above.
31389 2001-09-02 Ravi Pratap <ravi@ximian.com>
31391 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31392 (TypeContainer.delegates): New member to hold list of delegates.
31394 * cs-parser.jay (delegate_declaration): Implement the action correctly
31395 this time as I seem to be on crack ;-)
31397 2001-09-02 Miguel de Icaza <miguel@ximian.com>
31399 * rootcontext.cs (RootContext::IsNamespace): new function, used to
31400 tell whether an identifier represents a namespace.
31402 * expression.cs (NamespaceExpr): A namespace expression, used only
31403 temporarly during expression resolution.
31404 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31405 utility functions to resolve names on expressions.
31407 2001-09-01 Miguel de Icaza <miguel@ximian.com>
31409 * codegen.cs: Add hook for StatementExpressions.
31411 * class.cs: Fix inverted test for static flag in methods.
31413 2001-09-02 Ravi Pratap <ravi@ximian.com>
31415 * class.cs (Operator::CheckUnaryOperator): Correct error number used
31416 to make it coincide with MS' number.
31417 (Operator::CheckBinaryOperator): Ditto.
31419 * ../errors/errors.txt : Remove error numbers added earlier.
31421 * ../errors/cs1019.cs : Test case for error # 1019
31423 * ../errros/cs1020.cs : Test case for error # 1020
31425 * cs-parser.jay : Clean out commented cruft.
31426 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31427 used anywhere - non-reducing rule.
31428 (namespace_declarations): Non-reducing rule - comment out.
31430 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31431 with TypeContainer::AddEnum.
31433 * delegate.cs : New file for delegate handling classes.
31434 (Delegate): Class for declaring delegates.
31436 * makefile : Update.
31438 * cs-parser.jay (delegate_declaration): Implement.
31440 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
31442 * class.cs (Event::Define): Implement.
31443 (Event.EventBuilder): New member.
31445 * class.cs (TypeContainer::Populate): Update to define all enums and events
31447 (Events): New property for the events arraylist we hold. Shouldn't we move to using
31448 readonly fields for all these cases ?
31450 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31452 * class.cs (Property): Revamp to use the convention of making fields readonly.
31453 Accordingly modify code elsewhere.
31455 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31456 the Define method of the Property class.
31458 * class.cs : Clean up applied patch and update references to variables etc. Fix
31460 (TypeContainer::Populate): Update to define all the properties we have. Also
31461 define all enumerations.
31463 * enum.cs (Define): Implement.
31465 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31467 * cs-parser.jay (overloadable_operator): The semantic value is an
31468 enum of the Operator class.
31469 (operator_declarator): Implement actions.
31470 (operator_declaration): Implement.
31472 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31473 validity of definitions.
31474 (Operator::CheckBinaryOperator): Static method to check for binary operators
31475 (TypeContainer::AddOperator): New method to add an operator to a type.
31477 * cs-parser.jay (indexer_declaration): Added line to actually call the
31478 AddIndexer method so it gets added ;-)
31480 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
31481 already taken care of by the MS compiler ?
31483 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31485 * class.cs (Operator): New class for operator declarations.
31486 (Operator::OpType): Enum for the various operators.
31488 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31490 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31491 ostensibly handle this in semantic analysis.
31493 * cs-parser.jay (general_catch_clause): Comment out
31494 (specific_catch_clauses, specific_catch_clause): Ditto.
31495 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31496 (catch_args, opt_catch_args): New productions.
31497 (catch_clause): Rewrite to use the new productions above
31498 (catch_clauses): Modify accordingly.
31499 (opt_catch_clauses): New production to use in try_statement
31500 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31501 and re-write the code in the actions to extract the specific and
31502 general catch clauses by being a little smart ;-)
31504 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31505 Hooray, try and catch statements parse fine !
31507 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31509 * statement.cs (Block::GetVariableType): Fix logic to extract the type
31510 string from the hashtable of variables.
31512 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31513 I end up making that mistake ;-)
31514 (catch_clauses): Fixed gross error which made Key and Value of the
31515 DictionaryEntry the same : $1 !!
31517 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31519 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31521 * cs-parser.jay (event_declaration): Correct to remove the semicolon
31522 when the add and remove accessors are specified.
31524 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31526 * cs-parser.jay (IndexerDeclaration): New helper class to hold
31527 information about indexer_declarator.
31528 (indexer_declarator): Implement actions.
31529 (parsing_indexer): New local boolean used to keep track of whether
31530 we are parsing indexers or properties. This is necessary because
31531 implicit_parameters come into picture even for the get accessor in the
31532 case of an indexer.
31533 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31535 * class.cs (Indexer): New class for indexer declarations.
31536 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31537 (TypeContainer::indexers): New member to hold list of indexers for the
31540 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31542 * cs-parser.jay (add_accessor_declaration): Implement action.
31543 (remove_accessor_declaration): Implement action.
31544 (event_accessors_declaration): Implement
31545 (variable_declarators): swap statements for first rule - trivial.
31547 * class.cs (Event): New class to hold information about event
31549 (TypeContainer::AddEvent): New method to add an event to a type
31550 (TypeContainer::events): New member to hold list of events.
31552 * cs-parser.jay (event_declaration): Implement actions.
31554 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31556 * cs-parser.jay (dim_separators): Implement. Make it a string
31557 concatenating all the commas together, just as they appear.
31558 (opt_dim_separators): Modify accordingly
31559 (rank_specifiers): Update accordingly. Basically do the same
31560 thing - instead, collect the brackets here.
31561 (opt_rank_sepcifiers): Modify accordingly.
31562 (array_type): Modify to actually return the complete type string
31563 instead of ignoring the rank_specifiers.
31564 (expression_list): Implement to collect the expressions
31565 (variable_initializer): Implement. We make it a list of expressions
31566 essentially so that we can handle the array_initializer case neatly too.
31567 (variable_initializer_list): Implement.
31568 (array_initializer): Make it a list of variable_initializers
31569 (opt_array_initializer): Modify accordingly.
31571 * expression.cs (New::NType): Add enumeration to help us
31572 keep track of whether we have an object/delegate creation
31573 or an array creation.
31574 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31575 members to hold data about array creation.
31576 (New:New): Modify to update NewType
31577 (New:New): New Overloaded contructor for the array creation
31580 * cs-parser.jay (array_creation_expression): Implement to call
31581 the overloaded New constructor.
31583 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31585 * class.cs (TypeContainer::Constructors): Return member
31586 constructors instead of returning null.
31588 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31590 * typemanager.cs (InitCoreTypes): Initialize the various core
31591 types after we have populated the type manager with the user
31592 defined types (this distinction will be important later while
31593 compiling corlib.dll)
31595 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31596 on Expression Classification. Now all expressions have a method
31597 `Resolve' and a method `Emit'.
31599 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31600 generation from working. Also add some temporary debugging
31603 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31605 * codegen.cs: Lots of code generation pieces. This is only the
31606 beginning, will continue tomorrow with more touches of polish. We
31607 handle the fundamentals of if, while, do, for, return. Others are
31608 trickier and I need to start working on invocations soon.
31610 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31613 * codegen.cs (EmitContext): New struct, used during code
31614 emission to keep a context. Most of the code generation will be
31617 * cs-parser.jay: Add embedded blocks to the list of statements of
31618 this block. So code generation proceeds in a top down fashion.
31620 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31622 * statement.cs: Add support for multiple child blocks.
31624 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31626 * codegen.cs (EmitCode): New function, will emit the code for a
31627 Block of code given a TypeContainer and its ILGenerator.
31629 * statement.cs (Block): Standard public readonly optimization.
31630 (Block::Block constructors): Link children.
31631 (Block::Child): Child Linker.
31632 (Block::EmitVariables): Emits IL variable declarations.
31634 * class.cs: Drop support for MethodGroups here, delay until
31636 (Method::): Applied the same simplification that I did before, and
31637 move from Properties to public readonly fields.
31638 (Method::ParameterTypes): Returns the parameter types for the
31639 function, and implements a cache that will be useful later when I
31640 do error checking and the semantic analysis on the methods is
31642 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31643 and made a method, optional argument tells whether this is a class
31644 or a structure to apply the `has-this' bit.
31645 (Method::GetCallingConvention): Implement, returns the calling
31647 (Method::Define): Defines the type, a second pass is performed
31648 later to populate the methods.
31650 (Constructor::ParameterTypes): implement a cache similar to the
31651 one on Method::ParameterTypes, useful later when we do semantic
31654 (TypeContainer::EmitMethod): New method. Emits methods.
31656 * expression.cs: Removed MethodGroup class from here.
31658 * parameter.cs (Parameters::GetCallingConvention): new method.
31660 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31662 * class.cs (TypeContainer::Populate): Drop RootContext from the
31665 (Constructor::CallingConvention): Returns the calling convention.
31666 (Constructor::ParameterTypes): Returns the constructor parameter
31669 (TypeContainer::AddConstructor): Keep track of default constructor
31670 and the default static constructor.
31672 (Constructor::) Another class that starts using `public readonly'
31673 instead of properties.
31675 (Constructor::IsDefault): Whether this is a default constructor.
31677 (Field::) use readonly public fields instead of properties also.
31679 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31680 track of static constructors; If none is used, turn on
31681 BeforeFieldInit in the TypeAttributes.
31683 * cs-parser.jay (opt_argument_list): now the return can be null
31684 for the cases where there are no arguments.
31686 (constructor_declarator): If there is no implicit `base' or
31687 `this', then invoke the default parent constructor.
31689 * modifiers.cs (MethodAttr): New static function maps a set of
31690 modifiers flags into a MethodAttributes enum
31691 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31692 MethodAttr, TypeAttr to represent the various mappings where the
31693 modifiers are used.
31694 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31696 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31698 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31701 * interface.cs (PopulateIndexer): Implemented the code generator
31702 for interface indexers.
31704 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31706 * interface.cs (InterfaceMemberBase): Now we track the new status
31709 (PopulateProperty): Implement property population. Woohoo! Got
31710 Methods and Properties going today.
31712 Removed all the properties for interfaces, and replaced them with
31713 `public readonly' fields.
31715 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31717 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31718 initialize their hashtables/arraylists only when they are needed
31719 instead of doing this always.
31721 * parameter.cs: Handle refs and out parameters.
31723 * cs-parser.jay: Use an ArrayList to construct the arguments
31724 instead of the ParameterCollection, and then cast that to a
31727 * parameter.cs: Drop the use of ParameterCollection and use
31728 instead arrays of Parameters.
31730 (GetParameterInfo): Use the Type, not the Name when resolving
31733 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31735 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31736 and instead use public readonly fields.
31738 * class.cs: Put back walking code for type containers.
31740 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31742 * class.cs (MakeConstant): Code to define constants.
31744 * rootcontext.cs (LookupType): New function. Used to locate types
31747 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31749 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31750 this System.Reflection code is. Kudos to Microsoft
31752 * typemanager.cs: Implement a type cache and avoid loading all
31753 types at boot time. Wrap in LookupType the internals. This made
31754 the compiler so much faster. Wow. I rule!
31756 * driver.cs: Make sure we always load mscorlib first (for
31757 debugging purposes, nothing really important).
31759 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31760 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31762 * rootcontext.cs: Lookup types on their namespace; Lookup types
31763 on namespaces that have been imported using the `using' keyword.
31765 * class.cs (TypeContainer::TypeAttr): Virtualize.
31766 (Class::TypeAttr): Return attributes suitable for this bad boy.
31767 (Struct::TypeAttr): ditto.
31768 Handle nested classes.
31769 (TypeContainer::) Remove all the type visiting code, it is now
31770 replaced with the rootcontext.cs code
31772 * rootcontext.cs (GetClassBases): Added support for structs.
31774 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31776 * interface.cs, statement.cs, class.cs, parameter.cs,
31777 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31778 Drop use of TypeRefs, and use strings instead.
31780 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31784 * class.cs (Struct::Struct): set the SEALED flags after
31785 checking the modifiers.
31786 (TypeContainer::TypeAttr): new property, returns the
31787 TypeAttributes for a class.
31789 * cs-parser.jay (type_list): Oops, list production was creating a
31790 new list of base types.
31792 * rootcontext.cs (StdLib): New property.
31793 (GetInterfaceTypeByName): returns an interface by type name, and
31794 encapsulates error handling here.
31795 (GetInterfaces): simplified.
31796 (ResolveTree): Encapsulated all the tree resolution here.
31797 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31800 * driver.cs: Add support for --nostdlib, to avoid loading the
31801 default assemblies.
31802 (Main): Do not put tree resolution here.
31804 * rootcontext.cs: Beginning of the class resolution.
31806 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31808 * rootcontext.cs: Provide better error reporting.
31810 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31812 * rootcontext.cs (CreateInterface): Handle the case where there
31813 are no parent interfaces.
31815 (CloseTypes): Routine to flush types at the end.
31816 (CreateInterface): Track types.
31817 (GetInterfaces): Returns an array of Types from the list of
31818 defined interfaces.
31820 * typemanager.c (AddUserType): Mechanism to track user types (puts
31821 the type on the global type hash, and allows us to close it at the
31824 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31826 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31827 RecordInterface instead.
31829 * cs-parser.jay: Updated to reflect changes above.
31831 * decl.cs (Definition): Keep track of the TypeBuilder type that
31832 represents this type here. Not sure we will use it in the long
31833 run, but wont hurt for now.
31835 * driver.cs: Smaller changes to accomodate the new code.
31837 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31840 * rootcontext.cs (CreateInterface): New method, used to create
31841 the System.TypeBuilder type for interfaces.
31842 (ResolveInterfaces): new entry point to resolve the interface
31844 (CodeGen): Property, used to keep track of the code generator.
31846 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31848 * cs-parser.jay: Add a second production for delegate_declaration
31851 (enum_body): Put an opt_comma here instead of putting it on
31852 enum_body or enum_member_declarations so we can handle trailing
31853 commas on enumeration members. Gets rid of a shift/reduce.
31855 (type_list): Need a COMMA in the middle.
31857 (indexer_declaration): Tell tokenizer to recognize get/set
31859 * Remove old targets.
31861 * Re-add the parser target.
31863 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31865 * cs-parser.jay: Add precendence rules for a number of operators
31866 ot reduce the number of shift/reduce conflicts in the grammar.
31868 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31870 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31873 Get rid of old crufty code.
31875 * rootcontext.cs: Use this to keep track of the parsed
31876 representation and the defined types available to the program.
31878 * gen-treedump.cs: adjust for new convention.
31880 * type.cs: Split out the type manager, and the assembly builder
31883 * typemanager.cs: the type manager will live here now.
31885 * cil-codegen.cs: And the code generator here.
31887 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31889 * makefile: Fixed up for easy making.
31891 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31893 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31896 (unary_expression): Expand pre_increment_expression and
31897 post_decrement_expression to reduce a shift/reduce.
31899 2001-07-11 Simon Cozens
31901 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31903 Improve allow_keyword_as_indent name.
31905 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31907 * Adjustments for Beta2.
31909 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31911 * decl.cs: Added `Define' abstract method.
31912 (InTransit): new property, used to catch recursive definitions.
31914 * interface.cs: Implement `Define'.
31916 * modifiers.cs: Map Modifiers.constants to
31917 System.Reflection.TypeAttribute flags.
31919 * class.cs: Keep track of types and user-defined types.
31920 (BuilderInit): New method for creating an assembly
31921 (ResolveType): New function to launch the resolution process, only
31922 used by interfaces for now.
31924 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31925 that are inserted into the name space.
31927 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31929 * ARGH. I have screwed up my tree so many times due to the use of
31930 rsync rather than using CVS. Going to fix this at once.
31932 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31935 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31937 * Experiment successful: Use System.Type rather that our own
31940 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31942 * cs-parser.jay: Removed nsAliases from here.
31944 Use new namespaces, handle `using XXX;'
31946 * namespace.cs: Reimplemented namespace handling, use a recursive
31947 definition of the class. Now we can keep track of using clauses
31948 and catch invalid using clauses.
31950 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31952 * gen-treedump.cs: Adapted for all the renaming.
31954 * expression.cs (Expression): this class now has a Type property
31955 which returns an expression Type.
31957 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31958 `Type', as this has a different meaning now in the base
31960 2001-05-22 Miguel de Icaza <miguel@ximian.com>
31962 * interface.cs, class.cs: Removed from all the sources the
31963 references to signature computation, as we can not do method
31964 signature computation during the parsing time, as we are not
31965 trying to solve at that point distinguishing:
31969 void a (NS.Blah x) {}
31972 Which depending on the context might be valid or not, as we do not
31973 know if Blah is the same thing as NS.Blah at that point.
31975 * Redid everything so the code uses TypeRefs now instead of
31976 Types. TypeRefs are just temporary type placeholders, that need
31977 to be resolved. They initially have a pointer to a string and the
31978 current scope in which they are used. This is used later by the
31979 compiler to resolve the reference to an actual Type.
31981 * DeclSpace is no longer a CIR.Type, and neither are
31982 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
31983 are all DeclSpaces, but no Types.
31985 * type.cs (TypeRefManager): This implements the TypeRef manager,
31986 which keeps track of all the types that need to be resolved after
31987 the parsing has finished.
31989 2001-05-13 Miguel de Icaza <miguel@ximian.com>
31991 * ARGH. We are going to have to store `foreach' as a class rather
31992 than resolving it, as we need to verify error 1579 after name
31993 resolution. *OR* we could keep a flag that says `This request to
31994 IEnumerator comes from a foreach statement' which we can then use
31995 to generate the error.
31997 2001-05-10 Miguel de Icaza <miguel@ximian.com>
31999 * class.cs (TypeContainer.AddMethod): we now add methods to the
32000 MethodGroup instead of the method hashtable.
32002 * expression.cs: Add MethodGroup abstraction, which gets us one
32003 step closer to the specification in the way we handle method
32006 * cs-parser.jay (primary_expression): qualified_identifier now
32007 tried to match up an identifier to a local variable reference or
32008 to a parameter reference.
32010 current_local_parameters is now a parser global variable that
32011 points to the current parameters for the block, used during name
32014 (property_declaration): Now creates an implicit `value' argument to
32017 2001-05-09 Miguel de Icaza <miguel@ximian.com>
32019 * parameter.cs: Do not use `param' arguments as part of the
32020 signature, per the spec.
32022 2001-05-08 Miguel de Icaza <miguel@ximian.com>
32024 * decl.cs: Base class for classes, structs and interfaces. This
32025 is the "Declaration Space"
32027 * cs-parser.jay: Use CheckDef for checking declaration errors
32028 instead of having one on each function.
32030 * class.cs: Factor out some code for handling error handling in
32031 accordance to the "Declarations" section in the "Basic Concepts"
32032 chapter in the ECMA C# spec.
32034 * interface.cs: Make all interface member classes derive from
32035 InterfaceMemberBase.
32037 2001-05-07 Miguel de Icaza <miguel@ximian.com>
32039 * Many things: all interfaces are parsed and generated in
32040 gen-treedump. Support for member variables, constructors,
32041 destructors, properties, constants is there.
32043 Beginning of the IL backend, but very little done, just there for
32046 2001-04-29 Miguel de Icaza <miguel@ximian.com>
32048 * cs-parser.jay: Fix labeled statement.
32050 * cs-tokenizer.cs (escape): Escape " and ' always.
32051 ref_line, ref_name: keep track of the line/filename as instructed
32052 by #line by the compiler.
32055 2001-04-27 Miguel de Icaza <miguel@ximian.com>
32057 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32058 to match the values in System.CodeDOM.
32060 Divid renamed to Divide.
32062 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32064 (Statements.set): remove.
32066 * System.CodeDOM/CodeCatchClause.cs: always have a valid
32069 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32070 falseStatements always have valid values.
32072 * cs-parser.jay: Use System.CodeDOM now.