1 2009-05-21 Marek Safar <marek.safar@gmail.com>
3 * class.cs: Don't report wrong warnings for event fields.
5 2009-05-21 Marek Safar <marek.safar@gmail.com>
8 * class.cs: Check for static class using parent container instead of
11 2009-05-08 Marek Safar <marek.safar@gmail.com>
14 * expression.cs: Always use temporary variable when using object
17 2009-04-28 Marek Safar <marek.safar@gmail.com>
20 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
23 2009-04-27 Miguel de Icaza <miguel@novell.com>
25 * driver.cs: Add a flag to work as a replacement for CSC in VS.
27 2009-04-24 Miguel de Icaza <miguel@novell.com>
29 * complete.cs: No idea how gonzalo got a null in the list, but
32 2009-04-24 Miguel de Icaza <miguel@novell.com>
34 * complete.cs (CompletionElementInitializer): New completion class
35 to support completing inside a C# 3 element initializer, so this
36 allows completion for Silverlight situations where it is very
39 new TextBlock () { Fo<TAB>
41 (CompletionSimpleName): Expose the prefix that was
42 passed to the simple name.
44 * cs-parser.jay (object_or_collection_initializer): Add support
45 for element_initializers.
47 * expression.cs (CollectionOrObjectInitializers.DoResolve):
48 special case completion expressions as this method aggressively
49 collects data before it operates, and errors were being thrown
50 earlier than we were able to complete.
52 2009-04-23 Miguel de Icaza <miguel@novell.com>
54 * eval.cs: Make getcompletions silent and enable debugging output
55 if the -v option is passed.
57 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
58 Consider looking up the namespace that matches the prefix being
61 This is part of the support for allowing completions like:
62 `System.Co<TAB>' to complete to System.Console.
64 * complete.cs (CompletionSimpleName.AppendResults): Make this
67 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
69 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
70 COMPLETE_COMPLETION as internal.
72 2009-04-17 Miguel de Icaza <miguel@novell.com>
74 * complete.cs: Include namespace resolution in simple names as
75 well as global types and types in the using scope in the
78 * namespace.cs: Supporting infrastrcture to provide completions
79 based on the current using scope.
81 * eval.cs: Introduce an entry point that allows for initialization
82 to return a list of the files passed on the command line.
84 2009-04-14 Marek Safar <marek.safar@gmail.com>
87 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
89 2009-04-13 Marek Safar <marek.safar@gmail.com>
92 * statement.cs: Don't skip string multi-section with default or
93 null label when populating string hashtable.
95 2009-04-06 Marek Safar <marek.safar@gmail.com>
98 * expression.cs (New): Load variable when assigning type parameter
101 2009-04-06 Marek Safar <marek.safar@gmail.com>
103 A fix for bug #488960
104 * decl.cs: Compare MVAR types using non-null values.
106 2009-03-27 Marek Safar <marek.safar@gmail.com>
108 * typemanager.cs, expression.cs: Removed unused nullable checks.
110 2009-03-27 Marek Safar <marek.safar@gmail.com>
112 * *.cs: Removed some gmcs conditionals.
114 2009-03-26 Marek Safar <marek.safar@gmail.com>
116 * generic.cs, support.cs: Moved generics stuff out of support.cs
118 2009-03-24 Marek Safar <marek.safar@gmail.com>
120 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
123 2009-03-23 Marek Safar <marek.safar@gmail.com>
125 * attribute.cs: Consider all members for error reporting when
126 checking named arguments.
128 2009-03-23 Marek Safar <marek.safar@gmail.com>
130 A fix for bug #487625
131 * namespace.cs: Use a warning for all predefined type conflicts.
133 2009-03-23 Marek Safar <marek.safar@gmail.com>
135 A fix for bug #485706
136 * statement.cs: Explicitly type catch type argument to pass verifier
139 2009-03-22 Miguel de Icaza <miguel@novell.com>
141 Initial support to provide code completion facilities to consumers
142 of the evaluator API.
144 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
145 support the completion engine. When we reach the end of the
146 input stream instead of returning EOF, when this flag is true the
147 tokenizer instead produces:
149 One GENERATE_COMPLETION token: this token then must be
150 handled in the grammar at every point where the user
151 would likely request a completion.
153 As many COMPLETE_COMPLETION tokens as necessary. These
154 tokens are generated to assist the parser in unwinding and
155 producing a valid parse tree.
157 The parser rules do not have to be perfect, the parser needs to be
158 augmented with judicious use of GENERATE_COMPLETION tokens to
159 improve the areas where we can provide completion and the parser
160 needs to add support for COMPLETE_COMPLETION tokens in productions
163 It is common to not have enough support for COMPLETE_COMPLETION
164 under certain rules and that even if we generated the
165 GENERATE_COMPLETION token that the resulting tree will be invalid
166 due to the missing rules that support COMPLETE_COMPLETION.
168 The final EOF token is produced by having the parser notify the
169 tokenizer when it reaches the root production that the next token
172 * support.cs (CompletionResult): New Exception. This exception
173 is thrown to return the completion results when one of the special
174 completion expressions is reached.
176 This exception is thrown by the completing ExpressionStatements
177 classes that live in complete.cs
179 * complete.cs (CompletingExpression): a new base class for
180 completing expressions. This derives from the
181 ExpressionStatement class and not from Expression as it allows
182 completion to happen not only where expressions are expected in
183 the grammar, but also where statements are expected.
185 (CompletionSimpleName): A new class used to provide completions
186 for SimpleNames. This currently only resolves to local
187 variables from the evaluator context (GetVars call).
189 (CompletionMemberAccess): Implements support for completing member
192 * cs-parser.jay: Add support for completion in a few places.
194 * eval.cs (GetCompletions): New public API for the evaluator that
195 returns a list of possible completions given the input. The
196 return value is an array of completions
198 * anonymous.cs (Compatible): If the exception thrown from the
199 resolved expression is a CompletionResult exception let that one
200 through instead of printing a diagnostic error in the try/catch.
202 2009-03-22 Miguel de Icaza <miguel@novell.com>
206 * driver.cs (Main): Use Environment.Exit to quit quickly and
207 prevent the compiler from doing the usual wait for helper thread
210 This is to prevent a slowdown that was reported by Gonzalo on
213 2009-03-19 Marek Safar <marek.safar@gmail.com>
215 * ecore.cs: Load build-in types directly instead of accessing
218 2009-03-18 Marek Safar <marek.safar@gmail.com>
220 * ecore.cs: Always use unbox.any when available.
222 2009-03-18 Marek Safar <marek.safar@gmail.com>
224 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
226 2009-03-17 Marek Safar <marek.safar@gmail.com>
228 * generic.cs: Removed obsolete version of type inference.
230 2009-03-16 Marek Safar <marek.safar@gmail.com>
232 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
233 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
234 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
235 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
237 2009-03-11 Marek Safar <marek.safar@gmail.com>
239 A fix for bug #482996
240 * anonymous.cs: Make sure we are not infering return type when
241 checking type compatibility.
243 2009-03-11 Marek Safar <marek.safar@gmail.com>
245 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
246 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
247 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
248 attributes in their own structure. Needed when accessing their
249 properties before they are resolved.
251 2009-03-09 Marek Safar <marek.safar@gmail.com>
253 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
254 hashtable (~10x faster).
256 * driver.cs: Removed wrong Reset.
258 2009-03-08 Marek Safar <marek.safar@gmail.com>
260 * class.cs: Use correct common base type for unmanaged delayed
263 * rootcontext.cs: Wrap unhandled exception.
265 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
267 Make SeekableStreamReader self-tuning and arbitrarily seekable
268 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
270 (SeekableStreamReader.Position.set): Use it. Simplify logic
271 which, as a side-effect, makes it arbitrarily-seekable. Tune the
272 buffer size when the stream needs to be re-read from the beginning.
274 2009-03-05 Marek Safar <marek.safar@gmail.com>
276 A fix for bug #480100
277 * parameter.cs: A parameter is not hoisted when used directly as ET.
279 2009-03-04 Marek Safar <marek.safar@gmail.com>
281 * statement.cs: Fixed an issue when using variable is of interface
284 2009-03-03 Marek Safar <marek.safar@gmail.com>
286 A fix for bug #480319
287 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
289 2009-03-03 Marek Safar <marek.safar@gmail.com>
291 A fix for bug #480867
292 * typemanager.cs, expression.cs, ecore.cs: Changed method group
293 expression to have no valid type.
295 2009-03-03 Marek Safar <marek.safar@gmail.com>
297 A fix for bug #481258
298 * class.cs: Set extension method flag in partial container.
300 2009-03-03 Marek Safar <marek.safar@gmail.com>
302 * statement.cs, typemanager.cs: Use expression for StringEmitter.
304 * attribute.cs: Add sanity check.
306 2009-02-27 Marek Safar <marek.safar@gmail.com>
308 * class.cs: Add external constructor error.
310 2009-02-26 Marek Safar <marek.safar@gmail.com>
312 A fix for bug #475354
313 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
314 correctly user defined nullable equality operators.
316 2009-02-25 Marek Safar <marek.safar@gmail.com>
318 A fix for bug #479532
319 * expression.cs: Implement NewInitialize::AddressOf.
321 2009-02-25 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #413633
324 * expression.cs: Iterate all base class-constraint types.
326 2009-02-24 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #479209
329 * literal.cs: Mutate null underlying type.
331 2009-02-24 Marek Safar <marek.safar@gmail.com>
333 A fix for bug #476295
334 * convert.cs: Avoid wrapping implicitly convertible reference type.
336 2009-02-23 Marek Safar <marek.safar@gmail.com>
338 * iterators.cs: Create MemberName correctly.
340 2009-02-23 Marek Safar <marek.safar@gmail.com>
342 A fix for bug #478655
343 * literal.cs: Check also underlying null type conversion.
345 2009-02-21 Marek Safar <marek.safar@gmail.com>
347 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
349 2009-02-20 Marek Safar <marek.safar@gmail.com>
351 A fix for bug #477447
352 * statement.cs: Add reference to correct parent storey when this
353 is accessible from deep children storey (more than 1 level).
355 2009-02-19 Marek Safar <marek.safar@gmail.com>
357 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
358 * class.cs: Define base type members before setting up member cache.
360 2009-02-18 Marek Safar <marek.safar@gmail.com>
362 A fix for bug #477378
363 * nullable.cs, expression.cs, statement.cs: More precise null type
366 2009-02-18 Marek Safar <marek.safar@gmail.com>
368 A fix for bug #472805
369 * typemanager.cs, namespace.cs: Import only visible extension method
372 2009-02-18 Marek Safar <marek.safar@gmail.com>
374 A fix for bug #476895
375 * attribute.cs: Use correct resolve context for attribute type.
377 2009-02-18 Marek Safar <marek.safar@gmail.com>
379 A fix for bug #476266
380 * anonymous.cs: Mutate multi-dimensional arrays.
382 2009-02-18 Marek Safar <marek.safar@gmail.com>
384 A fix for bug #476400
385 * statement.cs, expression.cs: Removed wrong Dispose optimization.
387 2009-02-18 Marek Safar <marek.safar@gmail.com>
389 A fix for bug #476811
390 * generics.cs: Fixed null-literal check.
392 2009-02-17 Marek Safar <marek.safar@gmail.com>
394 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
395 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
396 messing with static variables.
398 2009-02-16 Marek Safar <marek.safar@gmail.com>
400 A fix for bug #475965
401 * generics.cs: Check generic parameter type after extracting from
404 2009-02-16 Marek Safar <marek.safar@gmail.com>
406 A fix for bug #475823
407 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
410 2009-02-14 Marek Safar <marek.safar@gmail.com>
412 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
413 Simplified event field definition using backing field and not
414 field builder directly.
416 * expression.cs (EmitLdArg): Optimize fast paths.
418 2009-02-13 Marek Safar <marek.safar@gmail.com>
420 A fix for bug #475327
421 * expression.cs (ArrayCreation): Don't mutate values optimized away.
423 2009-02-13 Marek Safar <marek.safar@gmail.com>
425 A fix for bug #475342
426 * cs-parser.jay: Using 'super' instead of 'base' to call base
427 constructor crashes compiler.
429 2009-02-13 Marek Safar <marek.safar@gmail.com>
431 A fix for bug #475354
432 * expression.cs (Constantify): Add nullable types.
434 * const.cs (EmitDecimalConstant): Avoid explicit cast.
436 2009-02-12 Marek Safar <marek.safar@gmail.com>
438 A fix for bug #475246
439 * expression.cs: More broken flowanalysis hacking needed.
441 2009-02-12 Marek Safar <marek.safar@gmail.com>
443 * attribute.cs: Compare only ref/out array modifiers.
445 2009-02-11 Marek Safar <marek.safar@gmail.com>
447 * statement.cs: Use member cache when looking for foreach members.
449 2009-02-11 Marek Safar <marek.safar@gmail.com>
451 * expression.cs: Don't expose internal initializer types.
453 * statement.cs: Check also explicit conversions for goto case.
455 2009-02-11 Marek Safar <marek.safar@gmail.com>
457 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
459 2009-02-10 Marek Safar <marek.safar@gmail.com>
461 * *.cs: Replace null-type with NullLiteral where appropriate.
463 2009-02-09 Marek Safar <marek.safar@gmail.com>
465 * expression.cs: Initializer of reference argument use temporary
466 variable to be verifiable.
468 * parameter.cs: Share EmitLdArg.
470 2009-02-09 Marek Safar <marek.safar@gmail.com>
472 A fix for bug #473559
473 * class.cs: Fixed: Not reporting error about nested class with the
476 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
478 Contributed under the MIT/X11 license.
480 * generic.cs: Added VerifyVariantTypeParameters which performs new
481 variance verification logic. The old logic, based on the spec, was
482 wrong because the spec is full of LIES!
484 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
486 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
489 * ecore.cs: Added calls to the new variance verification logic.
492 * delegate.cs: Removed calls to the old variance verification logic.
494 2009-02-06 Marek Safar <marek.safar@gmail.com>
496 * delegate.cs: Use cached Invoke method directly.
498 2009-02-06 Marek Safar <marek.safar@gmail.com>
500 * expression.cs: Emit expression tree for hoisted variable access.
502 2009-02-04 Marek Safar <marek.safar@gmail.com>
504 * namespace.cs: Add better extension class check.
506 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
508 * generic.cs: Fixed typeo (TypeParameter.Variacne).
510 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
512 This patch adds initial generic variance support to the compiler.
513 It is contributed under the MIT/X11 license.
515 * typemanager.cs: Modified ImplementsInterface to check variance.
516 Added VerifyVariantTypeParameters which checks the specified type to see
517 if it uses a variant type parameter as a type argument (which is not
518 allowed). Added IsVariantOf which determins if the first type is a
519 variant of the second. NOTE: This only supports reference types at
520 the moment to conform with the current level of VM support. When the
521 VM supports value types, this will follow step.
523 * generic.cs: Added the Variance enum. Added a Variance property to
524 TypeParameter and added variance support to definition phase. Added a
525 Variance property to TypeParameterName. Also check to make sure that
526 no variant types appear in generic method parameters.
528 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
529 keywords if the langversion supports it.
531 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
532 that variant types are only used in legal positions. Also added
533 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
536 * decl.cs: Construct TypeParameter with the variance information.
538 * convert.cs: Checks variance in ImplicitReferenceConversionExists
539 and ImplicitConversionStandard.
541 * rootcontext.cs: Added new "Future" language version.
543 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
544 type parameters are not used as type arguments in interface inheritance.
545 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
546 parameters are not used as method return types. In MemberBase.
547 ResolveMemberType, ensure that variant type parameters are not used
548 as type arguments. Also call VerifyNoVariantTypeParameters on every
549 set of parameters which are resolved.
551 * delegate.cs: Modified Delegate.Define to ensure that variant
552 parameters are not used as type arguments and that a contravariant
553 parameter is not used as the return type. Also call
554 VerifyNoVariantTypeParameters on the delegate parameters.
556 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
557 to specify generic variance.
559 * driver.cs: Added support for LanguageVersion.Future in the form of
560 "-langversion:future".
562 * generic-mcs.cs: Stubbed out new members in generic.cs.
564 2009-02-03 Marek Safar <marek.safar@gmail.com>
566 * class.cs, generic.cs: Emit type parameter constraints for nested
569 2009-02-02 Marek Safar <marek.safar@gmail.com>
571 A fix for bug #471213
572 * class.cs: Avoid emitting backing field for abstract event fields.
574 2009-02-01 Marek Safar <marek.safar@gmail.com>
576 A fix for bug #359731
577 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
580 2009-01-30 Marek Safar <marek.safar@gmail.com>
582 A fix for bug #470767
583 * statement.cs: Introduced BlockScopeExpression, needed when
584 expression tree conversion has to emit scope variables.
586 2009-01-29 Marek Safar <marek.safar@gmail.com>
588 * class.cs: Remove duplicate CallingConvention.
590 2009-01-29 Marek Safar <marek.safar@gmail.com>
592 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
593 when I finally found the right naming convention.
595 2009-01-29 Marek Safar <marek.safar@gmail.com>
597 * cs-tokenizer.cs: Put back different open parens optimization.
599 2009-01-28 Marek Safar <marek.safar@gmail.com>
601 A fix for bug #470227
602 * cs-tokenizer.cs: Remove too agressive parser optimization.
604 2009-01-28 Marek Safar <marek.safar@gmail.com>
606 A fix for bug #324319
607 * class.cs: Remove too early base type resolve.
609 2009-01-27 Marek Safar <marek.safar@gmail.com>
611 A fix for bug #324319
612 * ecore.cs: Explicitly type null when assigning to type argument to
613 make pass verifier check.
615 2009-01-27 Marek Safar <marek.safar@gmail.com>
617 * anonymous.cs: Fixed recent regression when initializing captured
620 2009-01-26 Marek Safar <marek.safar@gmail.com>
622 A fix for bug #469019
623 * anonymous.cs: Use all parent type parameters when instantiating
624 nested generic storey.
626 2009-01-26 Marek Safar <marek.safar@gmail.com>
628 * expression.cs: Check for null instance methodgroup expression.
630 2009-01-26 Marek Safar <marek.safar@gmail.com>
632 A fix for bug #469244
633 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
634 instance inside a conditional expression.
636 2009-01-23 Marek Safar <marek.safar@gmail.com>
638 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
639 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
640 GetElementType and HasElementType. IsValueType clean up.
642 2009-01-23 Marek Safar <marek.safar@gmail.com>
644 * nullable.cs: Use common EmitCall.
646 * expression.cs: Emit constraint. for virtual calls only.
648 2009-01-23 Marek Safar <marek.safar@gmail.com>
650 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
651 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
652 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
655 2009-01-22 Jb Evain <jbevain@novell.com>
657 * anonymous.cs: make anonymous types' ToString implementation
658 match what csc outputs.
660 2009-01-21 Marek Safar <marek.safar@gmail.com>
662 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
665 2009-01-17 Marek Safar <marek.safar@gmail.com>
667 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
670 2009-01-16 Marek Safar <marek.safar@gmail.com>
672 * nullable.cs (LiftedBinaryOperator): Check for all possible null
675 2009-01-15 Marek Safar <marek.safar@gmail.com>
677 A fix for bug #466634
678 * statement.cs: Add reference for nested storey when only this
681 2009-01-15 Marek Safar <marek.safar@gmail.com>
683 A fix for bug #466474
684 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
687 2009-01-15 Marek Safar <marek.safar@gmail.com>
689 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
690 Fixed nested stories parent referencing process. Also fixes #463985.
692 2009-01-06 Marek Safar <marek.safar@gmail.com>
694 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
695 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
696 implementation. Also fixes #463108.
698 2009-01-05 Marek Safar <marek.safar@gmail.com>
700 A fix for bug #416109
701 * decl.cs: Issue correct CLSAttribute warning location.
703 2009-01-05 Marek Safar <marek.safar@gmail.com>
705 A fix for bug #456775
706 * attribute.cs: Use attribute owner scope when resolving attribute
709 2009-01-05 Marek Safar <marek.safar@gmail.com>
711 A fix for bug #457257
712 * decl.cs: Fixed incorrect member declaring type comparison.
714 2009-01-05 Marek Safar <marek.safar@gmail.com>
716 A fix for bug #460896
717 * driver.cs: Handle /RES resources as embeddable.
719 2009-01-05 Marek Safar <marek.safar@gmail.com>
721 A fix for bug #462515
722 * ecore.cs: Report inacessible members upwards.
724 2009-01-05 Marek Safar <marek.safar@gmail.com>
726 A fix for bug #463190, #463192
727 * decl.cs, namespace.cs: Also import internal extension classes.
729 2009-01-04 Marek Safar <marek.safar@gmail.com>
731 A fix for bug #463415
732 * generic.cs: Use right index for RemoveDependentTypes.
734 2009-01-02 Marek Safar <marek.safar@gmail.com>
736 A fix for bug #463196
737 * expression.cs: Fixed enum to null comparison.
739 2009-01-02 Marek Safar <marek.safar@gmail.com>
741 A fix for bug #463121
742 * nullable.cs: Fixed nullable user equality operator comparison.
744 2009-01-02 Marek Safar <marek.safar@gmail.com>
746 A fix for bug #462950
747 * class.cs, decl.cs: Use full explicit name when defining automatic
748 property backing field.
750 2009-01-02 Marek Safar <marek.safar@gmail.com>
752 A fix for bug #462592
753 * pending.cs: Emit type arguments for generic proxy method.
755 2008-12-30 Marek Safar <marek.safar@gmail.com>
757 * expression.cs (As): Mutate all type arguments.
759 2008-12-29 Marek Safar <marek.safar@gmail.com>
761 A fix for bug #462622
762 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
765 2008-12-29 Marek Safar <marek.safar@gmail.com>
767 A fix for bug #450782
768 * ecore.cs: Consider more variables of form V.I to be fixed.
770 2008-12-29 Marek Safar <marek.safar@gmail.com>
772 A fix for bug #460712
773 * typemanager.cs: Core types could be imported.
775 2008-12-28 Marek Safar <marek.safar@gmail.com>
777 A fix for bugs #460847, #460772, #458049, #457339, #447807
778 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
779 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
780 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
781 user lambdas used inside query clauses.
783 2008-12-18 Marek Safar <marek.safar@gmail.com>
785 A fix for bug #460229
786 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
788 2008-12-18 Marek Safar <marek.safar@gmail.com>
790 A fix for bug #459952
791 * decl.cs, namespace.cs: Use common CheckAccessLevel.
793 2008-12-18 Marek Safar <marek.safar@gmail.com>
795 A fix for bug #459630
796 * convert.cs: Enum to valuetype conversion is not allowed.
798 2008-12-18 Marek Safar <marek.safar@gmail.com>
800 A fix for bug #457087
801 * generic.cs: Don't crash when constraint comes from type
804 2008-12-16 Marek Safar <marek.safar@gmail.com>
806 A fix for bug #459221
807 * anonymous.cs, statement.cs: Delay only captured this
810 2008-12-12 Marek Safar <marek.safar@gmail.com>
812 A fix for bug #457489
813 * anonymous.cs, statement.cs: Split anonymous storey instantiation
814 and initialization to capture scope initializers correctly.
816 2008-12-11 Marek Safar <marek.safar@gmail.com>
818 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
819 ParameterReference refactoring.
821 2008-12-03 Marek Safar <marek.safar@gmail.com>
823 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
824 to be imported from any assembly.
826 2008-12-03 Marek Safar <marek.safar@gmail.com>
828 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
829 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
830 from anonymous method and lambda expression.
832 2008-12-01 Marek Safar <marek.safar@gmail.com>
834 A fix for bug #448560
835 * expression.cs (As): Box any generic type arguments to be
838 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
840 Add tripwire for implicit conversion bugs
841 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
843 (MethodGroupExpr.OverloadResolve): Add sanity check between
844 IsApplicable and VerifyArgumentsCompat.
845 (VerifyArgumentsCompat): Report CS1501 where appropriate.
847 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
849 Fix build break in System.Data_test
850 * convert.cs (ImplicitConversionExists): Move NullLiteral
852 (ImplicitStandardConversionExists): ... here.
854 2008-11-28 Marek Safar <marek.safar@gmail.com>
856 * literal.cs: Emit correctly explicit null to nullable cast.
858 2008-11-28 Marek Safar <marek.safar@gmail.com>
860 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
863 2008-11-28 Marek Safar <marek.safar@gmail.com>
865 A fix for bug #449005
866 * convert.cs, nullable.cs: Use only one implicit nullable
869 2008-11-27 Marek Safar <marek.safar@gmail.com>
871 * convert.cs, literal.cs: More Convert cleanup is needed.
873 2008-11-27 Marek Safar <marek.safar@gmail.com>
875 * decl.cs, class.cs: Fixed misleading error message.
877 2008-11-26 Marek Safar <marek.safar@gmail.com>
879 A fix for bug #449005
880 * nullable.cs (EmitEquality): Disable optimization for user operator
883 2008-11-25 Marek Safar <marek.safar@gmail.com>
885 A fix for bug #447027
886 * anonymous.cs (HoistedVariable): Cache also outer access to deal
887 with context variables stored as expression instances.
889 2008-11-25 Marek Safar <marek.safar@gmail.com>
891 A fix for bug #447027
892 * delegate.cs: Fixed delegate VerifyMethod logic.
894 2008-11-24 Marek Safar <marek.safar@gmail.com>
896 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
899 2008-11-21 Marek Safar <marek.safar@gmail.com>
901 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
902 member type resolve to follow normal flow, instead of random
905 2008-11-21 Marek Safar <marek.safar@gmail.com>
907 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
910 2008-11-21 Marek Safar <marek.safar@gmail.com>
912 * const.cs: Emit decimal array constant as literal.
914 2008-11-20 Marek Safar <marek.safar@gmail.com>
916 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
918 2008-11-19 Marek Safar <marek.safar@gmail.com>
920 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
921 into real property (saves 8 MB for corlib compilation).
923 2008-11-19 Marek Safar <marek.safar@gmail.com>
925 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
926 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
927 generic-mcs.cs: Small cleanup of TypeArguments.
929 2008-11-18 Marek Safar <marek.safar@gmail.com>
931 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
932 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
933 of ConstructedType expression, renamed to GenericTypeExpr.
935 2008-11-17 Marek Safar <marek.safar@gmail.com>
937 A fix for bug #445303
938 * location.cs (IsConditionalDefined): Handle undefined global
941 2008-11-17 Marek Safar <marek.safar@gmail.com>
943 A fix for bug #444678
944 * expression.cs (TryReduceConstant): Always create new constant
947 2008-11-17 Marek Safar <marek.safar@gmail.com>
949 A fix for bug #444673
950 * ecore.cs: Ignore open generic types when used as generic type
953 2008-11-17 Marek Safar <marek.safar@gmail.com>
955 A fix for bug #445458
956 * expression.cs, cs-parser.jay: Don't crash when an expression
959 2008-11-17 Marek Safar <marek.safar@gmail.com>
961 A fix for bug #445464
962 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
965 2008-11-14 Jb Evain <jbevain@novell.com>
967 * driver.cs: ignore empty -nowarn argument such as
968 the one in -nowarn:12,13,,.
970 2008-11-13 Marek Safar <marek.safar@gmail.com>
972 A fix for bug #444271
973 * anonymous.cs: Rescan parent storeys when best candidate was
976 2008-11-13 Marek Safar <marek.safar@gmail.com>
978 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
979 useless UnboundTypeExpression.
981 * attribute.cs: Do check obsolete attribute on generic types.
983 2008-11-12 Marek Safar <marek.safar@gmail.com>
985 A fix for bugs #425680, #400139
986 * ecore.cs, expression.cs: Trying to do some almost_matched_members
989 2008-11-11 Marek Safar <marek.safar@gmail.com>
991 A fix for bug #435747
992 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
993 compound value types assignment. Few micro optimizations added.
995 2008-11-10 Marek Safar <marek.safar@gmail.com>
997 A fix for bug #442610
998 * anonymous.cs (MutateConstructor): More SRE hacking.
1000 2008-11-10 Marek Safar <marek.safar@gmail.com>
1002 A fix for bug #442579
1003 * ecore.cs: Also initialize expanded form of a method with 1 params
1006 2008-11-06 Marek Safar <marek.safar@gmail.com>
1008 * expression.cs (UnaryMutator): Do early l-side check.
1010 2008-11-05 Miguel de Icaza <miguel@novell.com>
1012 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1013 Init, otherwise we would crash later on when checking for friend
1016 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1017 Otherwise we never get any meaningful information as to what
1020 2008-11-05 Marek Safar <marek.safar@gmail.com>
1022 A fix for bug #436318
1023 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1025 2008-11-05 Miguel de Icaza <miguel@novell.com>
1027 * namespace.cs: Turns out that it was a really bad idea to hide
1028 the errors for namespaces not found here in eval mode.
1030 * eval.cs: When we process using clauses, only enter those into
1031 the list of valid using clauses after they have been validated.
1033 The above change gives the proper semantics: it does not
1034 senselessly report the same errors with broken using statements by
1035 never storing them in the first place when they are invalid.
1037 2008-11-05 Marek Safar <marek.safar@gmail.com>
1039 A fix for bug #421839
1040 * cs-parser.jay: Remove expression from coalesce rule to force lower
1041 priority than the assignment operator.
1043 2008-11-05 Marek Safar <marek.safar@gmail.com>
1045 A fix for bug #437875
1046 * nullable.cs: Compile correctly method group operand used with null
1047 coalescing operator.
1049 2008-11-04 Marek Safar <marek.safar@gmail.com>
1051 A fix for bug #434589
1052 * expression.cs (Binary): Ignore lifted conversions when at least
1053 one operand is of reference type.
1055 2008-11-04 Marek Safar <marek.safar@gmail.com>
1057 * cs-parser.jay: Better syntax error report.
1059 2008-11-03 Marek Safar <marek.safar@gmail.com>
1061 A fix for bug #436792
1062 * cs-parser.jay: Use GetLocation to access location.
1064 2008-11-03 Marek Safar <marek.safar@gmail.com>
1066 A fix for bug #440774
1067 * cs-parser.jay: Also set current_array_type when parsing local
1070 2008-11-03 Marek Safar <marek.safar@gmail.com>
1072 A fix for bug #440785
1073 * expression.cs (As): Don't resolve self modifing expression
1076 2008-11-03 Marek Safar <marek.safar@gmail.com>
1078 A fix for bug #439447
1079 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1081 2008-11-03 Marek Safar <marek.safar@gmail.com>
1083 A fix for bug #437571
1084 * cs-parser.jay: Fixes internal error for invalid expression
1087 2008-10-17 Marek Safar <marek.safar@gmail.com>
1089 * ecore.cs: Resolve correctly ambiguous params delegate methods.
1091 2008-10-17 Marek Safar <marek.safar@gmail.com>
1093 * generic.cs, anonymous.cs: Simplified GetDeclarations.
1095 2008-10-17 Marek Safar <marek.safar@gmail.com>
1097 * cs-tokenizer.cs: More precise cast parsing.
1099 2008-10-16 Martin Baulig <martin@ximian.com>
1101 * anonymous.cs (AnonymousMethodStorey): Put back the
1102 `hoisted_locals' hashtable and use it in EmitType().
1104 2008-10-15 Marek Safar <marek.safar@gmail.com>
1106 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1107 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1110 2008-10-14 Marek Safar <marek.safar@gmail.com>
1112 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1114 2008-10-14 Marek Safar <marek.safar@gmail.com>
1116 * statement.cs: Mutate scope initializers.
1118 2008-10-14 Marek Safar <marek.safar@gmail.com>
1120 * expression.cs: Use typeless value for This constant.
1122 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1124 2008-10-14 Marek Safar <marek.safar@gmail.com>
1126 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1129 2008-10-13 Marek Safar <marek.safar@gmail.com>
1131 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1134 2008-10-13 Marek Safar <marek.safar@gmail.com>
1136 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1137 parser and tokenizer. Fixes many ambiguities including #433258.
1139 2008-10-10 Marek Safar <marek.safar@gmail.com>
1141 * cs-parser.jay: Fixed missing accessor recovery.
1143 2008-10-10 Marek Safar <marek.safar@gmail.com>
1145 A fix for bug #433701
1146 * expression.cs: Better error message.
1148 2008-10-10 Marek Safar <marek.safar@gmail.com>
1150 * cs-parser.jay, expression.cs: Start reporting real parser errors.
1152 * Makefile: Disabled unused debug symbols.
1154 Also fixes: #320556, #321097, #321656, #321876, #351316
1156 2008-10-09 Miguel de Icaza <miguel@novell.com>
1158 * eval.cs: rename "<interactive>" to "{interactive}", to work
1159 around a requirement in the compiler that this be a valid
1160 filename, and in Windows it is not (433886).
1162 2008-10-09 Marek Safar <marek.safar@gmail.com>
1164 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1166 2008-10-08 Marek Safar <marek.safar@gmail.com>
1168 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1169 cs-parser.jay: Generic type declaration and type arguments cleanup.
1171 2008-10-05 Marek Safar <marek.safar@gmail.com>
1173 * cs-parser.jay: Allow parsing weird array creation construct.
1175 2008-10-05 Marek Safar <marek.safar@gmail.com>
1177 * cs-parser.jay: Conflicts reduction.
1179 2008-10-04 Marek Safar <marek.safar@gmail.com>
1181 * cs-parser.jay: Conflicts reduction.
1183 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
1186 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1187 property. Add a 'count' hint about the use of the shared vector.
1188 Ensure that we don't leak out dirty bits.
1189 (UsageVector.MergeChild): Throw away information about variables
1191 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1193 2008-10-03 Marek Safar <marek.safar@gmail.com>
1195 A fix for bug #431746
1196 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1197 parameters when iterator is created.
1199 2008-10-03 Marek Safar <marek.safar@gmail.com>
1201 A fix for bug #431827
1202 * expression.cs: Fixed right based pointer arithmetic operations
1205 2008-10-03 Marek Safar <marek.safar@gmail.com>
1207 A fix for bug #353779
1208 * assign.cs, expression.cs: Fixed compound assignment conversions.
1210 2008-10-02 Marek Safar <marek.safar@gmail.com>
1212 A fix for bug #375262
1213 * statement.cs: Refactor ArrayForeach to be usable with string
1214 indexer. Optimized single dimentional arrays foreach.
1216 2008-10-02 Marek Safar <marek.safar@gmail.com>
1218 A fix for bug #431255
1219 * anonymous.cs, expression.cs: Removed broken optimization.
1221 2008-10-01 Marek Safar <marek.safar@gmail.com>
1223 * anonymous.cs: Use full type parameters of parent generic
1224 containers. Removed unnecessary AddParentStoreyReference call.
1226 2008-10-01 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #324702
1229 * class.cs: Use better shorter names for explicit interface member
1232 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1234 2008-10-01 Marek Safar <marek.safar@gmail.com>
1236 * expression.cs: Use new interface to check fixed expression.
1238 2008-10-01 Marek Safar <marek.safar@gmail.com>
1240 A fix for bug #421101
1241 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1242 interface to check for fixed fixed-buffers.
1244 2008-10-01 Marek Safar <marek.safar@gmail.com>
1246 A fix for bug #429264
1247 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1249 * delegate.cs: Removed unnecessary casts.
1251 2008-09-30 Marek Safar <marek.safar@gmail.com>
1253 A fix for bug #352151
1254 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1255 class.cs: Fixed already defined explicit interface members check.
1257 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
1259 cs-tokenizer.cs: Fix typo.
1261 2008-09-28 Miguel de Icaza <miguel@novell.com>
1263 * eval.cs (InteractiveBase): The quit command now just sets a
1264 flag, instead of calling Environment.Exit(), it is milder on
1267 CompiledMethod is now in Mono.CSharp, not nested inside
1268 the Evaluator, it was inconvenient to use.
1270 2008-09-27 Miguel de Icaza <miguel@novell.com>
1272 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1273 code to be invoked without having to reparse.
1275 2008-09-27 Miguel de Icaza <miguel@novell.com>
1277 * ecore.cs: The recent changes to FieldExpr broke this as well.
1278 Fixes LINQ queries in the interactive shell.
1280 * Multiple files: indentation fixing for the Mono coding
1281 guidelines for the switch statement.
1283 * eval.cs: Make the Evaluator API thread safe.
1285 2008-09-26 Marek Safar <marek.safar@gmail.com>
1287 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1288 constructor parsing.
1290 2008-09-26 Marek Safar <marek.safar@gmail.com>
1292 A fix for bug #325326
1293 * statement.cs: Check possible mistaken empty statement using
1294 explicit blocks only.
1296 2008-09-25 Miguel de Icaza <miguel@novell.com>
1298 * eval.cs (LoadAssembly, ReferenceAssembly): Call
1299 RootNamespace.ComputeNamespaces to update the internal list of
1300 namespaces, this is no longer done for us.
1302 (InteractiveBase): Use the Evaluator APIs instead of calling into
1305 2008-09-25 Marek Safar <marek.safar@gmail.com>
1307 A fix for bug #429264
1308 * expression.cs: Missing mutator for access to multidimensional
1311 2008-09-25 Marek Safar <marek.safar@gmail.com>
1313 * class.cs, statement: Emit DebuggerHidden attribute for iterator
1316 * driver.cs: Missing input argument check.
1318 2008-09-25 Marek Safar <marek.safar@gmail.com>
1320 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1321 expression.cs, statement.cs, rootcontext.cs, class.cs,
1322 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1325 2008-09-24 Miguel de Icaza <miguel@novell.com>
1327 * ecore.cs (FieldExpr): Only initialize eclass when we return a
1328 fully constructed FieldExpr, fixes the regression introduced in
1331 * ecore.cs, expression.cs: Plug back the eclass initialization as
1332 otherwise it regresses `csharp'.
1334 2008-09-24 Marek Safar <marek.safar@gmail.com>
1336 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1337 ecore.cs, attribute.cs: Moved obsolete method checks from emit
1338 phase to resolve phase. It resolves problems with expression trees
1339 and fixes bugs #323796, #325156.
1341 2008-09-23 Marek Safar <marek.safar@gmail.com>
1343 * codegen.cs: Report better error when symbol writer is missing.
1345 2008-09-23 Marek Safar <marek.safar@gmail.com>
1347 * codegen.cs: Set .NET symbol writer.
1349 * decl.cs: Guard against null generic arguments.
1351 * report.cs: Don't report exactly same additional details.
1353 2008-09-22 Marek Safar <marek.safar@gmail.com>
1355 A fix for bug #324917
1356 * cs-parser.jay: Add missing multidimensional non-expression type
1359 2008-09-22 Marek Safar <marek.safar@gmail.com>
1361 A fix for bug #428191
1362 * anonymous.cs: Create an outer generic fields also for non-storey
1365 2008-09-22 Marek Safar <marek.safar@gmail.com>
1367 A fix for bug #378294
1368 * class.cs: Make fixed size buffers gmcs feature only.
1370 2008-09-22 Marek Safar <marek.safar@gmail.com>
1372 A fix for bug #355622, #324993
1373 * assign.cs, const.cs, class.cs: Create new EmitContext for each
1376 2008-09-19 Marek Safar <marek.safar@gmail.com>
1378 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1381 2008-09-19 Marek Safar <marek.safar@gmail.com>
1383 A fix for bug #416110
1384 * generic.cs: Struct constraint results in default ctor and
1385 ValueType base type constraint to be set.
1387 2008-09-19 Marek Safar <marek.safar@gmail.com>
1389 A fix for bug #423791
1390 * generic.cs: Fixed params output type type-inference.
1392 2008-09-19 Marek Safar <marek.safar@gmail.com>
1394 * cs-parser.jay, expression.cs: Fixed few expression crashes.
1396 2008-09-19 Marek Safar <marek.safar@gmail.com>
1398 * cs-tokenizer.cs: Don't break on extra partial modifier.
1400 2008-09-19 Marek Safar <marek.safar@gmail.com>
1402 A fix for bug #427592
1403 * generic.cs: Use common parameter resolve method.
1405 2008-09-18 Marek Safar <marek.safar@gmail.com>
1407 A fix for bug #414758
1408 * expression.cs, ecore.cs: Fixed crash when accessing non-static
1411 2008-09-18 Marek Safar <marek.safar@gmail.com>
1413 * driver.cs, namespace.cs: Read types and namespaces after all
1414 requested assemblies are loaded, fixes issues with System.Core
1415 auto-reference, and #419888.
1417 2008-09-18 Marek Safar <marek.safar@gmail.com>
1419 A fix for bug #417705
1420 * cs-parser.jay: Fixed as/is operator expression split.
1422 2008-09-18 Marek Safar <marek.safar@gmail.com>
1424 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1425 Fixed expression tree representation of empty new expression and
1426 new initializer expression.
1428 2008-09-18 Miguel de Icaza <miguel@novell.com>
1430 * eval.cs: Remove warning, keep reference to driver around.
1432 * Hide fields that do not need to be public.
1434 2008-09-17 Marek Safar <marek.safar@gmail.com>
1436 A fix for bug #426385
1437 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1438 conversion for array elements.
1440 2008-09-17 Marek Safar <marek.safar@gmail.com>
1442 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1443 void parsing conflicts.
1445 2008-09-15 Marek Safar <marek.safar@gmail.com>
1447 A fix for bug #425601
1448 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1449 System.Core only when there is no custom ExtensionAttribute
1452 2008-09-15 Miguel de Icaza <miguel@novell.com>
1454 * namespace.cs: Do not report CS0246 (name
1456 2008-09-12 Marek Safar <marek.safar@gmail.com>
1458 A fix for bug #425669
1459 * generic.cs: Don't cache generic static anonymous method
1462 2008-09-12 Marek Safar <marek.safar@gmail.com>
1464 * generic.cs, class.cs, delegate.cs: Check recursive inherited
1465 conflicting constraints.
1467 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
1469 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1472 2008-09-12 Marek Safar <marek.safar@gmail.com>
1474 * literal.cs, convert.cs, expression.cs, statement.cs: More null
1475 to null pointer conversion fixes.
1477 2008-09-11 Marek Safar <marek.safar@gmail.com>
1479 * cs-parser.jay, expression.cs: An implicitly typed local variable
1480 declarator cannot use an array initializer.
1482 2008-09-11 Marek Safar <marek.safar@gmail.com>
1484 * cs-parser.jay: Reduced number of printed tokens, add sorting.
1486 2008-09-11 Marek Safar <marek.safar@gmail.com>
1488 * generic.cs (InflatedConstraints): Don't crash when constraints
1491 * cs-parser.jay: const_declarator is a block.
1493 * constant.cs: Check for not allowed NaN conversions.
1495 2008-09-10 Miguel de Icaza <miguel@novell.com>
1497 * driver.cs: Drop --shell argument, the compiler is no longer a
1500 * eval.cs: Move most of the code that deals with evaluation into
1501 this file and document the public API from repl.cs
1503 * repl.cs: Remove from here.
1505 2008-09-10 Marek Safar <marek.safar@gmail.com>
1507 A fix for bug #424684
1508 * generic.cs: Generic class constraints must come first.
1510 2008-09-09 Miguel de Icaza <miguel@novell.com>
1512 * cs-parser.jay: Improve error reporting for syntax errors in
1513 statements and expressions, we now report the expected tokens
1514 instead of reporting the useless "; expected".
1516 Drop the strings from the token declaration, it turns out that
1517 they did not do what I thought they did. Instead they were adding
1518 two sets of tokens to the tables.
1520 2008-09-09 Marek Safar <marek.safar@gmail.com>
1522 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1523 delegate.cs: Share special type check.
1525 2008-09-09 Marek Safar <marek.safar@gmail.com>
1527 A fix for bug #423981
1528 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1530 2008-09-09 Marek Safar <marek.safar@gmail.com>
1532 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1535 2008-09-09 Marek Safar <marek.safar@gmail.com>
1537 A fix for bugs: #324750, #335946
1538 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
1539 lookup rule to determine ?-based tokens.
1541 2008-09-08 Miguel de Icaza <miguel@novell.com>
1543 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1544 expressions (like event adding or removing) end up here, so we
1545 need to treat those as statements.
1547 Add LoadAssembly method.
1549 2008-09-04 Miguel de Icaza <miguel@novell.com>
1551 * repl.cs: Add Time method.
1553 2008-09-05 Marek Safar <marek.safar@gmail.com>
1555 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1557 2008-09-05 Miguel de Icaza <miguel@novell.com>
1559 * repl.cs: Add workaround for old compilers.
1561 2008-09-04 Jb Evain <jbevain@novell.com>
1563 * repl.cs (PrettyPrint): pretty print everything that
1564 implements IDictionary, as well as IEnumerables. Also,
1565 add a quit helper property.
1567 2008-09-04 Marek Safar <marek.safar@gmail.com>
1569 * constant.cs: Better error reporting for decimal literals.
1571 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1574 2008-09-04 Marek Safar <marek.safar@gmail.com>
1575 Miguel de Icaza <miguel@novell.com>
1577 A fix for bug #422951
1578 * assign.cs (Assign.DoResolve): Perform the type conversions
1579 checks before we attempt to initialize `New' initializers.
1581 2008-09-04 Marek Safar <marek.safar@gmail.com>
1583 A fix for bug #422853
1584 * delegate.cs (DelegateCreation): Add special handling for
1585 EmptyExpression.Null instance expression which is just another
1586 hack for undecided member instance exression.
1588 2008-09-04 Marek Safar <marek.safar@gmail.com>
1590 * expression.cs, ecore.cs: Emit full expression tree for reduced
1593 2008-09-04 Marek Safar <marek.safar@gmail.com>
1595 * expression.cs (This): Guard against multi-resolving.
1597 * ecore.cs, statement.cs (Throw): Simplified.
1599 * flowanalysis.cs: Also verify event fields.
1601 2008-09-04 Miguel de Icaza <miguel@novell.com>
1603 * assign.cs (Assign.DoResolve): Perform the type conversions
1604 checks before we attempt to initialize `New' initializers.
1606 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1608 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1611 * repl.cs: Update help.
1613 2008-09-03 Miguel de Icaza <miguel@novell.com>
1615 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1616 handling of the default config handling, including the special
1617 treatment of System.Core assembly.
1619 Fixes the REPL processing for LINQ.
1621 2008-09-03 Marek Safar <marek.safar@gmail.com>
1623 A fix for bug #422507
1624 * expression.cs (UnboxCast): Add missing child expression mutator.
1626 2008-09-03 Marek Safar <marek.safar@gmail.com>
1628 * driver.cs: Don't self reference System.Core assembly.
1630 2008-09-03 Marek Safar <marek.safar@gmail.com>
1632 A fix for bug #422507
1633 * expression.cs (StringConcat): Add missing type mutator.
1635 2008-09-03 Marek Safar <marek.safar@gmail.com>
1637 * generic.cs (TypeInferenceContext): Follow equality rule for
1638 constructed type lower bound type inference.
1640 2008-09-02 Miguel de Icaza <miguel@novell.com>
1642 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1643 <dblank@cs.brynmawr.edu> which updates the cursor position on
1646 2008-09-02 Marek Safar <marek.safar@gmail.com>
1648 A fix for bug #367145
1649 * driver.cs: Fixed import of extension methods when using -noconfig
1652 2008-09-02 Marek Safar <marek.safar@gmail.com>
1654 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1655 version from non-generic implementation instead.
1657 2008-09-01 Marek Safar <marek.safar@gmail.com>
1659 A fix for bug #418908
1660 * class.cs: Use AddScopeStatement for field initializers.
1662 2008-09-01 Marek Safar <marek.safar@gmail.com>
1664 A fix for bug #415385
1665 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1667 2008-09-01 Marek Safar <marek.safar@gmail.com>
1669 A fix for bug #421736
1670 * iterators.cs: Don't crash on unreachable iterators.
1672 2008-09-01 Marek Safar <marek.safar@gmail.com>
1674 A fix for bug #421628
1675 * parameter.cs, attribute.cs: Clone also parameter attributes.
1677 2008-08-30 Miguel de Icaza <miguel@novell.com>
1679 * namespace.cs (LookupType): In EvalMode, try to replace
1680 the TypeBuilder from our cache with a Type as Reflection.Emit does
1681 not like to mix code from older assemblies emitted and new
1684 This sounds like a serious Mono bug that prevents multiple
1685 assemblies to be generated and consumed at the same time.
1687 * cs-parser.jay (push_current_class): Do not make interactive
1688 classes internal or private, make them public as we currently
1689 generate each new class in a new assembly.
1691 2008-08-29 Miguel de Icaza <miguel@novell.com>
1693 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1694 remove types that are entered into the global namespace during
1695 parsing so that we can remove them on failure.
1697 * cs-parser.jay: Parsing: we now keep track of types that are
1698 entered into global variables and queue those in case the parsing
1701 This happens in a few situations: during partial-input, we invoke
1702 the parser repeatedly for example with the string "class X", this
1703 would cause X to be registed, and we need to remove this
1704 registration so that another parse attempt later with say "class X {"
1705 would actually work.
1707 Additionally, if there is an error in the resolution phase, for
1708 example: "class X : NonExistant {}" th
1710 * cs-parser.jay: Be more precise with the errors being raised,
1711 instead of flagging all exceptions during parsing to be attributed
1712 to the parsing process, distinguish those from errors happening in
1713 the actions and hint that using -v would produce the actual
1716 * repl.cs: Do not load all compiler references on each reset,
1717 doing the partial reset takes care of this.
1719 2008-08-28 Miguel de Icaza <miguel@novell.com>
1721 * repl.cs: Add support for loading all the files from
1722 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1725 Introduce a micro-parser that is able to deambiguate on its input
1726 whether we are dealing with a compilation unit (namespace, class,
1727 interface, struct, delegate) declaration or a statement. This
1728 allows both declarations and statements to be entered.
1730 Set history size by default to 300 lines.
1732 Instead of distinguishing based on the parser.InteractiveResult,
1733 have only two cases: statements were parsed, or a compilation unit
1734 was. Always pull the Using statement additions from the
1735 compilation unit parse.
1737 * cs-tokenizer.cs: Rename tokens to better describe their intent
1738 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1740 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1741 EvalMode is used to trigger the lookup of global variables while
1742 StatementMode is used turn variable declarations into static
1745 * getline.cs: Allow history size to be set.
1747 2008-08-29 Marek Safar <marek.safar@gmail.com>
1749 A fix for bug #360755
1750 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1752 2008-08-29 Marek Safar <marek.safar@gmail.com>
1754 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1756 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1757 member name, it is too confusing
1759 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1761 * rootcontext.cs: Finally default to warning level 4.
1763 2008-08-28 Marek Safar <marek.safar@gmail.com>
1765 * class.cs (CheckBase): Ignore overloaded operators.
1767 2008-08-28 Marek Safar <marek.safar@gmail.com>
1769 A fix for bug #420830
1770 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1772 2008-08-28 Marek Safar <marek.safar@gmail.com>
1774 A fix for bug #420832
1775 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1777 2008-08-28 Marek Safar <marek.safar@gmail.com>
1779 A fix for bug #420386
1780 * nullables.cs: Fixed logic of nullable user comparison operators involving
1783 2008-08-28 Marek Safar <marek.safar@gmail.com>
1785 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1787 2008-08-27 Miguel de Icaza <miguel@novell.com>
1789 * repl.cs: Add support for aborting the running code with C-c.
1791 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1793 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1795 2008-08-27 Miguel de Icaza <miguel@novell.com>
1797 * cs-parser.jay (interactive_statement_list): A new set of rules
1798 for hosting statements that uses the "interactive_" prefix.
1800 * repl.cs: Add support for parsing `using' as a statement or as a
1801 directive. Deambiguating before passing this to the parser.
1803 We need to distinguish statement_expressions that occur at the
1804 toplevel vs those that occur embedded into expressions.
1806 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1807 that fixes the cursor key handling, and a history bug.
1809 2008-08-26 Miguel de Icaza <miguel@novell.com>
1811 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1812 limitations in Console, instead the 2.0 bootstrap libraries now
1813 include the Console bits.
1815 Also, remove the use of Nullables from getline.cs
1819 Interactive support for the C# compiler. Use gmcs --shell to
1820 enter a read-eval-print loop shell.
1822 Docs: http://www.mono-project.com/CsharpRepl
1824 * sources: include repl.cs here and getline.cs for gmcs.exe,
1825 everything else is getline.cs impaired.
1827 * Makefile: when bootstrapping pass a special flag
1828 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1829 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1830 This distinguishes those two cases.
1832 * repl.cs: Support for a read-eval-print loop. Will be soon
1833 refactored into eval support and then REPL on top of it.
1835 * ecore.cs: If a simplename lookup fails, before erroring out,
1836 if we are in EvalMode to resolve the name to a declaration in the
1839 This means that variable declarations that happened in previous
1840 classes (as repl puts every statement in a separate class) are
1841 made visible in this way.
1843 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1844 triggered an error due to the end of file being reached. This is
1845 used to do multi-line input, and notify the caller that the user
1846 needs to provide more text before a successful parse.
1848 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1849 to drive the evaluation with a custom wrapper.
1851 * driver.cs: Add support for --shell, and refactor some code to be
1854 * namespace.cs: Add support for serializing the contents of the
1855 namespaces and reloading them.
1857 * getline.cs: A managed implementation of ReadLine under
1858 X11/Apache2 license terms. Easy to embed in other applications as
1861 * namespace.cs: Add some functions to save and restore the
1864 * rootcontext.cs: New public field.
1866 * cs-tokenizer.cs: Add support for one of the possible characters
1867 we introduce into the token stream.
1869 This patch does not affect the regular tokenization process, the
1870 only performance hit would happen if there is an invalid character
1871 on the input string.
1873 * support.cs: Move isatty helper routine here.
1875 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1876 code generator for in-memory assemblies.
1878 2008-08-26 Marek Safar <marek.safar@gmail.com>
1880 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1881 parameter cannot be always used as a type.
1883 2008-08-21 Marek Safar <marek.safar@gmail.com>
1885 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1887 2008-08-21 Marek Safar <marek.safar@gmail.com>
1889 * convert.cs: Implement explicit array to IList<T> conversion.
1891 2008-08-20 Marek Safar <marek.safar@gmail.com>
1893 A fix for bug #362740
1894 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1896 2008-08-20 Marek Safar <marek.safar@gmail.com>
1898 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1899 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1900 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1901 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1902 handling to use just one type of infrastructure and deal with generics
1905 2008-07-23 Martin Baulig <martin@ximian.com>
1907 *** Merged this from trunk revision 108527 ***
1910 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1911 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1914 2008-08-15 Marek Safar <marek.safar@gmail.com>
1916 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1919 2008-08-15 Marek Safar <marek.safar@gmail.com>
1921 * delegate.cs: Fixed compiler crash when creating delegate using partial
1924 * typemanager.cs: MulticastDelegate is not a delegate.
1926 2008-08-14 Marek Safar <marek.safar@gmail.com>
1928 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1931 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1933 * cs-parser.jay (type): Allow 'var' in mcs too.
1934 (local_variable_type): Likewise.
1936 2008-08-14 Marek Safar <marek.safar@gmail.com>
1938 * driver.cs: Removed broken -noconfig variants.
1940 2008-08-14 Marek Safar <marek.safar@gmail.com>
1942 A fix for bug #417078
1943 * expression.cs: Emit correctly left side pointer operators.
1945 2008-08-13 Marek Safar <marek.safar@gmail.com>
1947 * generic.cs, lambda.cs: Inflate method generic arguments only.
1949 2008-08-12 Marek Safar <marek.safar@gmail.com>
1951 * class.cs: Fixed struct layout check regression.
1953 2008-08-12 Marek Safar <marek.safar@gmail.com>
1955 * cs-parser.jay, enum.cs: Simplified enum parsing.
1957 * decl.cs: Check all type parameters conflicts.
1959 * expression.cs, statement.cs, attribute.cs: More expression checks.
1961 2008-08-11 Marek Safar <marek.safar@gmail.com>
1963 * generic.cs: Add type inference types restriction.
1965 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1966 anonymous.cs, expression.cs: Allocate less accessor parameters.
1968 2008-08-08 Marek Safar <marek.safar@gmail.com>
1970 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1973 2008-08-08 Marek Safar <marek.safar@gmail.com>
1975 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1977 2008-08-07 Marek Safar <marek.safar@gmail.com>
1979 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1980 Also fixes #362146 and #381592.
1982 2008-08-07 Marek Safar <marek.safar@gmail.com>
1984 * ecore.cs: Reduced constant cannot be used as an attribute value.
1986 * cs-parser.jay: Base expression has to be a type.
1988 * expression.cs (Conditional): Uses ReducedExpression.
1990 2008-08-06 Marek Safar <marek.safar@gmail.com>
1992 A fix for bug #376826
1993 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1994 address of hoisted local variable or parameter cannot be taken.
1996 2008-08-05 Marek Safar <marek.safar@gmail.com>
1998 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1999 anonymous method inside checked/unchecked expression.
2001 2008-08-05 Marek Safar <marek.safar@gmail.com>
2003 * typemanager.cs (IsEqual): Guard against null.
2005 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2006 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2007 routine. Fixed few misleading conversion errors.
2009 2008-08-04 Marek Safar <marek.safar@gmail.com>
2011 * class.cs: Consider generics when checking cycles in struct layout.
2013 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
2015 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
2017 2008-08-04 Marek Safar <marek.safar@gmail.com>
2019 A fix for bug #414165
2020 * anonymous.cs: Use same anonymous implementation method for all anonymous
2023 2008-08-04 Marek Safar <marek.safar@gmail.com>
2025 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2028 2008-08-04 Marek Safar <marek.safar@gmail.com>
2030 * cs-parser.jay: Typeof argument has to be a type expression.
2032 * namespace.cs: Check alias and namespace definitions collisions.
2034 * class.cs, pending.cs: Moved explicit interface accessor implementation
2037 * delegate.cs, expression.cs: Verify special name invocations.
2039 2008-08-01 Marek Safar <marek.safar@gmail.com>
2041 * cs-parser.jay: Don't choke on empty generic type arguments.
2043 * cs-tokenizer.cs: Handle escaped preprocessor directives.
2045 * expression.cs, ecore.cs: Minor expressions bugs.
2047 2008-08-01 Marek Safar <marek.safar@gmail.com>
2049 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2050 and added more error handling.
2052 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2054 * modifiers.cs, enum.cs: Fixed.
2056 2008-07-31 Jb Evain <jbevain@novell.com>
2058 * driver.cs: remove -pkg ability of smcs.
2060 2008-07-30 Marek Safar <marek.safar@gmail.com>
2062 * statement.cs (Switch): Correctly set empty default target for single
2065 2008-07-30 Marek Safar <marek.safar@gmail.com>
2067 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2068 string switch statement implementation to use string dictionary which
2069 significantly (2-8x) improves performance of generated code.
2071 2008-07-29 Marek Safar <marek.safar@gmail.com>
2073 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2074 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2076 2008-07-29 Marek Safar <marek.safar@gmail.com>
2078 A fix for bug #412595
2079 * typemanager.cs, convert.cs, expression.cs: Some types are never
2080 convertible to each other.
2082 2008-07-29 Marek Safar <marek.safar@gmail.com>
2084 * nullable.cs (CreateNullConstant): An error messages update.
2086 2008-07-29 Marek Safar <marek.safar@gmail.com>
2088 A fix for bug #412595
2089 * cfold.cs: Don't cast undefined bool constant.
2091 2008-07-29 Martin Baulig <martin@ximian.com>
2094 (SymbolWriter.Reset): New public static method.
2097 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2099 2008-07-28 Marek Safar <marek.safar@gmail.com>
2101 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2103 * expression.cs (ElementAccess): Exact size allocation.
2105 2008-07-26 Marek Safar <marek.safar@gmail.com>
2107 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2109 2008-07-25 Marek Safar <marek.safar@gmail.com>
2111 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2113 * class.cs: Removed $PRIVATE$ field hack which caused problems during
2116 2008-07-25 Marek Safar <marek.safar@gmail.com>
2118 A fix for bug #412217
2119 * assign.cs: Mutate also assignment type.
2121 2008-07-25 Marek Safar <marek.safar@gmail.com>
2123 A fix for bug #323644
2124 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2127 2008-07-25 Marek Safar <marek.safar@gmail.com>
2129 A fix for bug #412134
2130 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2131 non-enumerable operands when overloading equality or bitwise operators.
2133 2008-07-25 Marek Safar <marek.safar@gmail.com>
2135 * anonymous.cs: Cache closed generic anonymous method delegates.
2137 2008-07-24 Marek Safar <marek.safar@gmail.com>
2139 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
2140 anonymous.cs, statement.cs: Always emit anonymous method as static method
2141 when is instance free. Use nesting for nested anynomous methods blocks.
2143 2008-07-23 Marek Safar <marek.safar@gmail.com>
2145 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2148 2008-07-23 Marek Safar <marek.safar@gmail.com>
2150 * expression.cs: Removed MakeSimpleCall.
2152 2008-07-23 Marek Safar <marek.safar@gmail.com>
2154 A fix for bug #323012
2155 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2156 Base method implementing interface has to be public.
2158 2008-07-23 Marek Safar <marek.safar@gmail.com>
2160 * cs-parser.jay: Don't break on missing argument.
2162 2008-07-22 Marek Safar <marek.safar@gmail.com>
2164 A fix for bug #320993
2165 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2166 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2168 2008-07-22 Marek Safar <marek.safar@gmail.com>
2170 A fix for bug #320748
2171 * convert.cs: Implicit user operators cannot convert to interfaces
2173 2008-07-22 Marek Safar <marek.safar@gmail.com>
2175 A fix for bug #312686
2176 * driver.cs: Ignore empty assembly references.
2178 2008-07-22 Marek Safar <marek.safar@gmail.com>
2180 A fix for bug #387040
2181 * ecore.cs: Skip constrains check for an explicit implementation.
2183 2008-07-21 Marek Safar <marek.safar@gmail.com>
2185 A fix for bug #409045
2186 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2187 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2188 identifiers are file specific unless passed as input arguments.
2190 2008-07-21 Marek Safar <marek.safar@gmail.com>
2192 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2193 to emit UnmanagedMarshal data under 2.0 profile.
2195 2008-07-21 Marek Safar <marek.safar@gmail.com>
2197 A fix for bug #410369
2198 * parameter.cs: Clone correctly ParamsParameter.
2200 2008-07-21 Marek Safar <marek.safar@gmail.com>
2202 * expression.cs (Argument): Always report type for type based expressions
2205 2008-07-18 Marek Safar <marek.safar@gmail.com>
2207 A fix for bug #410666
2208 * anonymous.cs: Correctly initialize generic storey reference.
2210 2008-07-18 Marek Safar <marek.safar@gmail.com>
2212 * convert.cs: Don't box same type arguments.
2214 2008-07-18 Marek Safar <marek.safar@gmail.com>
2216 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2217 Finished missing generic type mutators.
2219 2008-07-18 Marek Safar <marek.safar@gmail.com>
2221 * iterators.cs, statement.cs: Finished statements CloneTo.
2223 2008-07-18 Marek Safar <marek.safar@gmail.com>
2225 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2227 * expression.cs: Emit optimized default value expressions in expression tree
2230 2008-07-18 Marek Safar <marek.safar@gmail.com>
2232 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2234 2008-07-17 Marek Safar <marek.safar@gmail.com>
2236 A fix for bug #367536
2237 * cs-parser.jay: Check static constructor of generic types for an access
2240 2008-07-17 Marek Safar <marek.safar@gmail.com>
2242 A fix for bug #353800
2243 * lambda.cs: Emit ret for contextual statements.
2245 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2246 up emitting redundant ret for all anonymous methods with return.
2248 2008-07-17 Marek Safar <marek.safar@gmail.com>
2250 A fix for bug #365188
2251 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2252 create anonymous method storey in unreachable block.
2254 2008-07-17 Marek Safar <marek.safar@gmail.com>
2256 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2257 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2258 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2259 statement.cs: Fixed relevant defects found by Gendarme.
2261 2008-07-17 Marek Safar <marek.safar@gmail.com>
2263 A fix for bug #325291
2264 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
2265 statement.cs: Replaced IAnonymousHost with top level block flag.
2267 2008-07-17 Marek Safar <marek.safar@gmail.com>
2269 * cs-parser.jay: Clean up unused open_parens.
2271 2008-07-17 Marek Safar <marek.safar@gmail.com>
2273 * ecore.cs: Custom error message for a range variable assignment.
2275 2008-07-16 Marek Safar <marek.safar@gmail.com>
2277 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2280 2008-07-16 Marek Safar <marek.safar@gmail.com>
2282 * literal.cs: Null literal is of object type.
2284 2008-07-16 Marek Safar <marek.safar@gmail.com>
2286 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2287 expression of nullable equality comparison.
2289 2008-07-15 Marek Safar <marek.safar@gmail.com>
2291 * expression.cs(PointerArithmetic): Removed redundant assignment.
2293 2008-07-15 Marek Safar <marek.safar@gmail.com>
2295 * decl.cs (GetSignatureForError): Report full namespace name for containers.
2297 2008-07-14 Marek Safar <marek.safar@gmail.com>
2299 A fix for bug #408361
2300 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2301 they are replaced by GetMethod.
2303 2008-07-14 Marek Safar <marek.safar@gmail.com>
2305 A fix for bug #408721 by jeremie.laval@gmail.com
2306 * expression.cs (Indirection): Implemented CloneTo.
2308 2008-07-14 Marek Safar <marek.safar@gmail.com>
2310 * statement.cs (AssignableSlots): Temporary disabled variable initialization
2313 2008-07-14 Marek Safar <marek.safar@gmail.com>
2315 * report.cs (EnableReporting): Don't reinitialize 0-based values.
2317 2008-07-11 Marek Safar <marek.safar@gmail.com>
2319 * linq.cs: Reset tranparent parameter counter in probing mode.
2321 2008-07-11 Marek Safar <marek.safar@gmail.com>
2323 * anonymous.cs: Mutate anonymous method type.
2325 2008-07-11 Marek Safar <marek.safar@gmail.com>
2327 * ecore.cs, anonymous.cs: Mutate field expressions.
2329 2008-07-10 Marek Safar <marek.safar@gmail.com>
2331 A fix for bug #369670
2332 * linq.cs, statement.cs: Use explicit block for query expressions variables.
2334 2008-07-10 Marek Safar <marek.safar@gmail.com>
2336 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2338 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
2341 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2342 only one '>', and finds a '>>', abort the generic lookahead.
2344 2008-07-10 Marek Safar <marek.safar@gmail.com>
2346 A fix for bug #319902
2347 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
2349 2008-07-10 Marek Safar <marek.safar@gmail.com>
2351 A fix for bug #406371
2352 * statement.cs: Moved EmitSymbolInfo to Block.
2354 2008-07-09 Marek Safar <marek.safar@gmail.com>
2356 * ecore.cs: Report better error for extension method overload failures.
2358 2008-07-09 Marek Safar <marek.safar@gmail.com>
2360 * expression.cs (Is): No need to box reference values.
2362 2008-07-09 Marek Safar <marek.safar@gmail.com>
2364 * class.cs: Use event resolve context when initializing CreateEmitContext.
2366 2008-07-09 Marek Safar <marek.safar@gmail.com>
2368 A fix for bug #394436
2369 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2370 method used inside expression trees. Added more LINQ to expression tree
2373 2008-07-08 Marek Safar <marek.safar@gmail.com>
2375 A fix for bug #378189, #370577
2376 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2379 2008-07-08 Marek Safar <marek.safar@gmail.com>
2381 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2384 2008-07-08 Marek Safar <marek.safar@gmail.com>
2386 A fix for bug #406702
2387 * anonymous.cs: Always park anonymous method in the nearest parent storey.
2389 2008-07-07 Marek Safar <marek.safar@gmail.com>
2391 A fix for bug #406648
2392 * cs-parser.jay: Report nullable use in mcs for some cases.
2394 2008-07-07 Marek Safar <marek.safar@gmail.com>
2396 * ecore.cs: Improved argument mismatch error messages.
2398 2008-07-07 Marek Safar <marek.safar@gmail.com>
2400 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2402 2008-07-07 Marek Safar <marek.safar@gmail.com>
2404 * expression.cs (TypeOf): Mutate type argument.
2406 2008-07-04 Marek Safar <marek.safar@gmail.com>
2408 * class.cs: Report missing partial modifier for correct type.
2410 2008-07-04 Marek Safar <marek.safar@gmail.com>
2412 * ecore.cs, expression.cs (VariableReference): Variable property is
2415 2008-07-04 Marek Safar <marek.safar@gmail.com>
2417 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2419 2008-07-04 Marek Safar <marek.safar@gmail.com>
2421 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2424 2008-07-04 Marek Safar <marek.safar@gmail.com>
2426 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2427 anonymous method storey to an instance method when only "this" is hoisted.
2429 2008-07-03 Marek Safar <marek.safar@gmail.com>
2431 A fix for bug #321615
2432 * expression.cs: Pointer comparisons use unsigned operator.
2434 2008-07-03 Marek Safar <marek.safar@gmail.com>
2436 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2438 2008-07-02 Marek Safar <marek.safar@gmail.com>
2440 A fix for bug #404905
2441 * class.cs: Always initialize local unsafe variables.
2443 2008-06-30 Marek Safar <marek.safar@gmail.com>
2445 A fix for bug #396987
2446 * expression.cs (NewInitialize): Clear local temporary variable for next run
2448 2008-06-27 Marek Safar <marek.safar@gmail.com>
2450 A fix for bug #401020
2451 * ecore.cs: Both types and modifiers have to match for ref and out arguments
2453 2008-06-27 Marek Safar <marek.safar@gmail.com>
2455 A fix for bug #398319
2456 * cs-parser.jay: Implemented undocumented base access expression inside
2459 2008-06-26 Marek Safar <marek.safar@gmail.com>
2461 A fix for bug #404227
2462 * cs-parser.jay: Parse namespace declaration using qualified identifier.
2464 2008-06-26 Marek Safar <marek.safar@gmail.com>
2466 A fix for bug #404227
2467 * convert.cs: Fixed explicit array to interface cast.
2469 2008-06-26 Marek Safar <marek.safar@gmail.com>
2471 A fix for bug #403894
2472 * delegate.cs: Mutate DelegateInvocation type.
2474 2008-06-26 Marek Safar <marek.safar@gmail.com>
2476 A fix for bug #379348
2477 * delegate.cs: Box a load of generic parameters.
2479 2008-06-26 Marek Safar <marek.safar@gmail.com>
2481 * expression.cs: Add an array creation arguments mutate.
2483 2008-06-26 Marek Safar <marek.safar@gmail.com>
2485 A fix for bug #386068
2486 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2489 2008-06-25 Marek Safar <marek.safar@gmail.com>
2491 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2494 2008-06-25 Marek Safar <marek.safar@gmail.com>
2496 A fix for bug #403518
2497 * delegate.cs: Type correctly anonymous method new invocation.
2499 2008-06-24 Marek Safar <marek.safar@gmail.com>
2501 A fix for bug #394826
2502 * anonymous.cs: Fully qualify members when resolving anonymous type internal
2505 2008-06-24 Marek Safar <marek.safar@gmail.com>
2507 A fix for bug #394826
2508 * anonymous.cs, iterators.cs: Construct generic storey only when is really
2511 2008-06-24 Marek Safar <marek.safar@gmail.com>
2513 * class.cs: Clone indexer parameters for localized capturing.
2515 2008-06-24 Marek Safar <marek.safar@gmail.com>
2517 A fix for bug #402379
2518 * expression.cs: Don't crash when an object initializer resolve fails.
2520 2008-06-24 Marek Safar <marek.safar@gmail.com>
2522 A fix for bug #402888
2523 * expression.cs: Mutate conditional expression.
2525 2008-06-24 Marek Safar <marek.safar@gmail.com>
2527 A fix for bug #401012
2528 * class.cs: Keep StructLayout in shared container.
2530 2008-06-24 Marek Safar <marek.safar@gmail.com>
2532 A fix for bug #400438
2533 * decl.cs, class.cs: Only properties can be automatically implemented.
2535 2008-06-24 Marek Safar <marek.safar@gmail.com>
2537 * statement.cs (ChangeToIterator): Copy also labels.
2539 2008-06-23 Marek Safar <marek.safar@gmail.com>
2541 * ecore.cs: Pass type argument details to parent extension method.
2543 2008-06-23 Marek Safar <marek.safar@gmail.com>
2545 A fix for bug #375966
2546 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2548 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
2550 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2552 2008-06-22 Marek Safar <marek.safar@gmail.com>
2554 A fix for bug #394347
2555 * anonymous.cs: Cache compatible delegates as compatibility check produces
2556 a new method every time.
2558 2008-06-20 Marek Safar <marek.safar@gmail.com>
2560 * anonymous.cs: Propagate storey reference for single references.
2562 2008-06-20 Marek Safar <marek.safar@gmail.com>
2564 A fix for bug #387615
2565 * assign.cs, expression.cs: Correctly clone compound assignment.
2567 2008-06-19 Marek Safar <marek.safar@gmail.com>
2569 A fix for bug #359611, #359604
2570 * anonymous.cs: Mutate all types of hoisted parameters.
2572 2008-06-19 Marek Safar <marek.safar@gmail.com>
2574 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2575 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2576 expression.cs, codegen.cs, statement.cs
2578 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2579 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2581 ** Anonymous methods, lambda expressions rewrite **
2583 Anonymous expressions are now resolved when an explicit block is resolved
2584 and they don't require any registration procedure anymore. Further,
2585 anonymous methods are defined when explicit block is emitted which allows
2586 better control of whole process and opens possibilities for more
2587 optimizations as well as alternative to reverse whole process.
2589 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2590 process consistent and to correctly emit hoisted generic methods when they
2591 have at least 1 hoisted variable.
2593 2008-06-17 Martin Baulig <martin@ximian.com>
2595 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2597 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2598 virtual property; check it in Emit().
2599 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2601 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2603 (Indexer.Define): Likewise.
2605 2008-06-17 Marek Safar <marek.safar@gmail.com>
2607 * convert.cs: Don't use IsInterface on type arguments.
2609 * delegate.cs: DelegateInvocation uses MethodInfo.
2611 * parameter.cs: Removed IsTypeParameter.
2613 * generic-mcs.cs: More missing stuff.
2615 2008-06-16 Martin Baulig <martin@ximian.com>
2618 (Modifiers.DEBUGGER_HIDDEN): New public const.
2621 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2624 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2625 (AbstractPropertyEventMethod): Likewise.
2626 (Constructor.Emit): Likewise.
2627 (SourceMethod.SetCompilerGenerated): Removed.
2629 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2633 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2634 if we're an `IteratorHost'.
2635 (AnonymousMethodMethod..ctor): Don't set
2636 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2639 2008-06-16 Marek Safar <marek.safar@gmail.com>
2641 * statement.cs: Clean-up foreach statements.
2643 2008-06-12 Marek Safar <marek.safar@gmail.com>
2645 * class.cs: Stop using public method which should not exist
2646 (MethodBuilder.SetGenericMethodSignature).
2648 2008-06-11 Martin Baulig <martin@ximian.com>
2651 (Location.LookupFile): Add `CompilationUnit' argument; when given
2652 a relative file name, make it relative to the directory the .cs
2653 file is located in instead of using the current directory.
2655 2008-06-11 Martin Baulig <martin@ximian.com>
2658 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2659 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2660 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2661 (SourceMethod.SetCompilerGenerated): Likewise.
2663 2008-06-11 Marek Safar <marek.safar@gmail.com>
2665 * codegen.cs, driver: Only write symbol file when it's asked for.
2667 2008-06-11 Marek Safar <marek.safar@gmail.com>
2669 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2671 2008-06-10 Martin Baulig <martin@ximian.com>
2673 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2675 2008-06-09 Marek Safar <marek.safar@gmail.com>
2677 A fix for bug #316290
2678 * expression.cs: Include decimal operators in predefined table.
2680 * parameters.cs: More readonlyness.
2682 2008-06-09 Marek Safar <marek.safar@gmail.com>
2684 A fix for bug #397213
2685 * cs-parser.jay: One more missing current_local_parameters reset.
2687 2008-06-09 Marek Safar <marek.safar@gmail.com>
2689 A fix for bug #396633
2690 * class.cs: Host backing field in partial container.
2692 2008-06-09 Marek Safar <marek.safar@gmail.com>
2694 A fix for bug #397068
2695 * expression.cs: Check both operand types when predefined operator is used.
2697 2008-06-05 Martin Baulig <martin@ximian.com>
2699 Merged the `debugger-kahalo' branch.
2702 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2703 we're an iterator method.
2704 (SourceMethod): Reflect latest symbol writer changes;
2705 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2706 now `start_row' and `end_row'.
2707 (Constructor.Emit): Fix the logic whether to emit symbol information.
2709 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2713 (CompilationUnit): New public class; derives from `SourceFile'.
2714 (SourceFileEntry.DefineSymbolInfo): New public method.
2715 (SourceFileEntry.SetChecksum): New public method.
2716 (Location): Encode hidden line numbers by using `column == 255';
2717 the .ctor now accepts `column == -1' to mark a hidden line number.
2718 (Location.Hidden): New public property.
2719 (Location.CheckPoint): Add `CompilationUnit'.
2720 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2721 (Location.Push): Add `CompilationUnit compile_unit' argument.
2722 (Location.CompilationUnit): New public property.
2725 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2727 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2729 * driver.cs: `SourceFile' -> `CompilationUnit'.
2731 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2733 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2735 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2739 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2740 new symbol writer API to also pass the file.
2742 2008-06-05 Marek Safar <marek.safar@gmail.com>
2744 * statement.cs: Emit catch variable assignment using variable expression.
2746 2008-06-05 Marek Safar <marek.safar@gmail.com>
2748 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2749 with other variable types.
2751 2008-06-04 Marek Safar <marek.safar@gmail.com>
2753 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2754 GetLength method emit, it breaks resolve rules.
2756 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2757 Marek Safar <marek.safar@gmail.com>
2759 A fix for bug #395542
2760 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2763 2008-06-02 Marek Safar <marek.safar@gmail.com>
2765 A fix for bug #395287
2766 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2768 2008-05-31 Marek Safar <marek.safar@gmail.com>
2770 A fix for bug #395845
2771 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2772 non-nullable parameter type.
2774 2008-05-31 Marek Safar <marek.safar@gmail.com>
2776 * class.cs: Handle contructor initializer as a statement in top-level block.
2778 2008-05-30 Marek Safar <marek.safar@gmail.com>
2780 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2781 security attributes.
2783 2008-05-24 Marek Safar <marek.safar@gmail.com>
2785 * ecore.cs, expression.cs: Small IVariable refactoring.
2787 2008-05-22 Marek Safar <marek.safar@gmail.com>
2789 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2791 2008-05-21 Marek Safar <marek.safar@gmail.com>
2793 * cs-parser.jay: Removed redundant catch type check.
2795 2008-05-21 Marek Safar <marek.safar@gmail.com>
2797 A fix for bug #390372
2798 * nullable.cs: Set correct return type.
2800 2008-05-21 Marek Safar <marek.safar@gmail.com>
2802 A fix for bug #391062
2803 * typemanager.cs: Fixed crash when comparing null types.
2805 2008-05-21 Marek Safar <marek.safar@gmail.com>
2807 A fix for bug #391871
2808 * cs-parser.jay: Better error handling for invalid catch type.
2810 2008-05-20 Marek Safar <marek.safar@gmail.com>
2812 A fix for bug #392155
2813 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2815 2008-05-15 Marek Safar <marek.safar@gmail.com>
2817 A fix for bug #390666
2818 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2821 2008-05-15 Marek Safar <marek.safar@gmail.com>
2823 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2826 2008-05-13 Marek Safar <marek.safar@gmail.com>
2828 A fix for bug #389625
2829 * delegate.cs, generic.cs: Some progress on method group return type
2832 2008-05-13 Marek Safar <marek.safar@gmail.com>
2834 A fix for bug #378419
2835 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2837 2008-05-12 Marek Safar <marek.safar@gmail.com>
2839 * class.cs (Constructor): Added IsCompilerGenerated.
2841 2008-05-12 Marek Safar <marek.safar@gmail.com>
2843 * expression.cs: Enum binary operators can accept non-enum operand only when
2844 is implicitly convertible to underlying type.
2846 2008-05-12 Marek Safar <marek.safar@gmail.com>
2848 A fix for bug #389272
2849 * support.cs: Workaround System.InvalidOperationException for enums.
2851 2008-05-12 Marek Safar <marek.safar@gmail.com>
2853 A fix for bug #389073
2854 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2856 2008-05-10 Marek Safar <marek.safar@gmail.com>
2858 * driver.cs: Split Parse.
2860 * location.cs (LookupFile): Uses string.Empty.
2862 2008-05-07 Marek Safar <marek.safar@gmail.com>
2864 * expression.cs, parameter.cs: Small ParameterReference clean up.
2866 2008-05-07 Marek Safar <marek.safar@gmail.com>
2868 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2869 hack. Fixes #387502.
2871 2008-05-06 Martin Baulig <martin@ximian.com>
2873 * class.cs (Constructor.Emit): Fix the logic whether to emit
2876 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2879 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2880 InvalidOperationException when the iterator is before the start or
2883 2008-05-06 Marek Safar <marek.safar@gmail.com>
2885 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2886 when left is nullable type.
2888 2008-05-06 Marek Safar <marek.safar@gmail.com>
2890 A fix for bug #386628
2891 * expression.cs (LocalVariableReference): Continue in resolving when
2892 variable is not assigned.
2894 2008-05-05 Marek Safar <marek.safar@gmail.com>
2896 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2897 nullable operations.
2899 2008-05-04 Marek Safar <marek.safar@gmail.com>
2901 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2902 it saves many redundant temporary variables for nullable operations.
2904 2008-05-03 Marek Safar <marek.safar@gmail.com>
2906 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2908 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2911 * nullable.cs: Constant coalescing operator optimizations.
2913 2008-05-03 Marek Safar <marek.safar@gmail.com>
2915 * constant.cs: Use unsigned conversion for values which are unsigned only.
2917 2008-05-03 Marek Safar <marek.safar@gmail.com>
2919 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2920 coalescing operator as it should be.
2922 2008-05-02 Marek Safar <marek.safar@gmail.com>
2924 A fix for bug #371016
2925 * expression.cs: All predefined delegate operators require implicit method
2928 2008-05-02 Marek Safar <marek.safar@gmail.com>
2930 * constant.cs: Emit long constant as uint when fits the range.
2932 * convert.cs, expression.cs: Fixed few unsafe conversions.
2934 2008-05-02 Marek Safar <marek.safar@gmail.com>
2936 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2938 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2941 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2943 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2945 2008-05-01 Marek Safar <marek.safar@gmail.com>
2947 * constant.cs, literal.cs: IsLiteral property for error reporting.
2949 * ecore.cs, expression.cs: Implemented Property expression.
2951 2008-05-01 Marek Safar <marek.safar@gmail.com>
2953 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2955 * nullable.cs: Implemented nullable coalescing null operator.
2957 * ecore.cs, expression.cs: Expression trees work.
2959 2008-05-01 Marek Safar <marek.safar@gmail.com>
2961 * ecore.cs: CreateExpressionTree is finally abstract.
2963 * expression.cs, linq.cs: Updated.
2965 2008-05-01 Marek Safar <marek.safar@gmail.com>
2967 * expression.cs, ecore.cs: Block base access expression inside expression
2970 2008-05-01 Marek Safar <marek.safar@gmail.com>
2972 A fix for bug #385058
2973 * expression.cs: User-defined operator implementations always take
2974 precedence over predefined operator implementations.
2976 2008-04-30 Marek Safar <marek.safar@gmail.com>
2978 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2979 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2980 expression tree conversions.
2982 2008-04-30 Marek Safar <marek.safar@gmail.com>
2984 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2985 operators method details to Operator class.
2987 2008-04-30 Marek Safar <marek.safar@gmail.com>
2989 * anonymous.cs: Pass unsafe flags to anonymous container.
2991 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2992 inside expression tree.
2994 2008-04-29 Martin Baulig <martin@ximian.com>
2996 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2997 (Tokenizer.PopPosition): Also restore the `line'.
2999 2008-04-29 Marek Safar <marek.safar@gmail.com>
3001 * delegate.cs: Implemented Invoke expression.
3003 2008-04-29 Marek Safar <marek.safar@gmail.com>
3005 * expression.cs: Fixed equality reference comparison regression.
3007 2008-04-29 Marek Safar <marek.safar@gmail.com>
3009 * ecore.cs: Clean up EmptyCast hack.
3011 * expression.cs, nullable.cs: Implemented enum binary and unary operations
3012 using correct conversion rules. Also fixes #383993.
3014 2008-04-28 Martin Baulig <martin@ximian.com>
3016 * class.cs (Constructor.Emit): Don't emit debugging information
3017 for generated default .ctor's.
3019 2008-04-28 Marek Safar <marek.safar@gmail.com>
3021 * convert.cs: Empty-cast ushort to int conversion.
3023 2008-04-28 Marek Safar <marek.safar@gmail.com>
3025 A fix for bug #384191
3026 * ecore.cs, expression.cs: Fixed expression cloning.
3028 2008-04-28 Marek Safar <marek.safar@gmail.com>
3030 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3032 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
3034 Fix #381559, test-638.cs, test-639.cs
3035 * assign.cs (CompoundAssign.Helper): New wrapper.
3036 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3038 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3039 Pass unconverted expressions to the params array creation expression.
3040 (FieldExpr.EmitAssign): Don't special-case StringConcat.
3041 (PropertyExpr.EmitAssign): Likewise.
3042 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3043 element if it is of kind CompoundAssign.Helper.
3044 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3045 first before anything else.
3046 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3047 (ArrayAccess.LoadArrayAndArguments): Simplify.
3049 2008-04-27 Marek Safar <marek.safar@gmail.com>
3051 * expression.cs: Fixed cloning of typeof(void).
3053 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
3055 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3056 (Assign.Emit): Likewise. Move it to ...
3057 (CompoundAssign.DoResolve): ... here and ...
3058 (CompoundAssign.Emit): ... here.
3059 (EventAddOrRemove): New helper to handle += and -= on events, and
3060 avoid the use of BinaryDelegates.
3061 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3062 (EventExpr.EmitAddOrRemove): Improve.
3063 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3065 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3066 create VarExprs for 'foo.bar.var'.
3067 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3068 is a highly inappropriate name for its functionality.
3070 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3072 Simplify handling of multiple assignments
3073 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
3075 (SimpleAssign): New. Class to be used for normal assignments.
3076 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3077 * expression.cs, parameter.cs, statement.cs: Likewise.
3079 2008-04-25 Marek Safar <marek.safar@gmail.com>
3081 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3082 for incompatible underlying types, more to come, uff.
3084 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3087 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3088 Handle 'leave_copy'.
3090 2008-04-25 Marek Safar <marek.safar@gmail.com>
3092 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3094 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
3096 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
3097 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3098 * statement.cs (While, Do, For): Allow test to have side effects.
3099 (For.DoEmit): Always emit InitStatement.
3102 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3103 Always create SideEffectConstant.
3104 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3105 of type EnumConstant.
3107 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3108 Handle 'right' being SideEffectConstant of type 'bool'.
3110 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3111 Use left.EmitBranchable instead of open coding it, so as to
3112 improve optimization opportunities.
3114 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3116 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3118 (Expression.EmitSideEffect): Document.
3120 2008-04-23 Marek Safar <marek.safar@gmail.com>
3122 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3124 2008-04-23 Marek Safar <marek.safar@gmail.com>
3126 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3128 2008-04-23 Marek Safar <marek.safar@gmail.com>
3130 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3131 conversion to expression tree.
3133 2008-04-23 Marek Safar <marek.safar@gmail.com>
3135 * ecore.cs: Removed unused expression.
3137 2008-04-22 Marek Safar <marek.safar@gmail.com>
3139 * expression.cs: Implemented NegateChecked and New expressions.
3141 2008-04-22 Marek Safar <marek.safar@gmail.com>
3143 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3145 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
3148 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3149 needing final 'ret' instruction.
3151 2008-04-22 Marek Safar <marek.safar@gmail.com>
3153 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3155 2008-04-21 Marek Safar <marek.safar@gmail.com>
3157 * expression.cs: Emit ldnull and not null expression as an instance argument
3158 of static method expression calls.
3160 2008-04-21 Marek Safar <marek.safar@gmail.com>
3162 A fix for bug #378200
3163 * expression.cs: Fixed crash when creating parameterless expression tree
3166 2008-04-21 Marek Safar <marek.safar@gmail.com>
3168 A fix for bug #375297
3169 * anonymous.cs: Fixed crash when inferring from null argument anonymous
3172 2008-04-21 Marek Safar <marek.safar@gmail.com>
3174 A fix for bug #377596
3175 * decl.cs, class.cs: Emit delegate type argument attributes.
3177 2008-04-21 Marek Safar <marek.safar@gmail.com>
3179 A fix for bug #365314
3180 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3182 2008-04-21 Marek Safar <marek.safar@gmail.com>
3184 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3187 2008-04-21 Marek Safar <marek.safar@gmail.com>
3189 * generic.cs (TypeParameter): Removed redundant location.
3191 2008-04-19 Marek Safar <marek.safar@gmail.com>
3193 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3194 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3195 FullNamedExpression in all declaration type expression, statements will come
3198 2008-04-18 Marek Safar <marek.safar@gmail.com>
3200 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3201 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3203 2008-04-18 Marek Safar <marek.safar@gmail.com>
3205 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3208 2008-04-17 Marek Safar <marek.safar@gmail.com>
3210 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3213 2008-04-17 Marek Safar <marek.safar@gmail.com>
3215 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3219 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
3221 Hook up 'EmitSideEffect'
3222 * constant.cs (Constant.EmitSideEffect): New.
3223 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
3224 (SideEffectConstant.EmitSideEffect): New.
3225 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
3226 unconditional branch in EmitBranchable.
3227 (FieldExpr.EmitBranchable): New.
3228 * expression.cs (Unary.EmitSideEffect): New.
3229 (Binary.EmitSideEffect): New.
3230 (VariableReference.EmitSideEffect): New. Do nothing.
3232 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3234 Introduce 'EmitSideEffect'
3235 * ecore.cs (Expression.EmitSideEffect): New.
3236 (TypeCast): Rename from EmptyCast.
3238 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3239 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3240 * convert.cs, nullable.cs: Update to changes.
3242 2008-04-16 Marek Safar <marek.safar@gmail.com>
3244 * class.cs, cs-parser.jay: Early check for base types expression.
3246 2008-04-16 Marek Safar <marek.safar@gmail.com>
3248 * decl.cs (MemberName): Declare PrettyName as obsolete.
3250 2008-04-16 Marek Safar <marek.safar@gmail.com>
3252 * namespace.cs: Use MemberName comparison.
3254 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3257 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
3259 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3260 (MemberName.FullyQualifiedName): New. Provides the functionality
3261 that users assume FullName would have.
3262 * ecore.cs, namespace.cs: Update to changes.
3264 * statement.cs (Using.assign): Make into ExpressionStatement.
3265 (Using.EmitPreTryBody): Simplify.
3267 2008-04-16 Marek Safar <marek.safar@gmail.com>
3269 * report.cs: ColorFormat is protected.
3271 * rootcontext.cs: Unused fields clean-up.
3273 * namespace.cs: Made UsingEntry name private.
3275 2008-04-16 Marek Safar <marek.safar@gmail.com>
3277 * cs-tokenizer.cs, location.cs: Removed unused field.
3279 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
3280 Raja R Harinath <harinath@hurrynot.org>
3283 * constant.cs (SideEffectConstant.value): Rename from 'left'.
3284 (SideEffectConstant.side_effect): Rename from 'right'.
3285 (SideEffectConstant..ctor): Normalize 'side_effect'.
3286 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3287 value of this constant.
3288 * cfold.cs: Update to changes.
3290 2008-04-15 Marek Safar <marek.safar@gmail.com>
3292 * cs-paser.jay: Removed unused variable.
3294 * driver.cs: Made Compile instance method.
3296 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
3298 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3300 2008-04-15 Marek Safar <marek.safar@gmail.com>
3302 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
3304 2008-04-13 Jb Evain <jbevain@novell.com>
3306 * namespace.cs: update the System.Core fullname for 2.1
3307 * driver.cs: update the list of required assemblies for 2.1.
3308 Merged from the Moonlight 2 branch.
3310 2008-04-11 Marek Safar <marek.safar@gmail.com>
3312 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3313 types and user defined operators. User operators arguments has to be checked
3314 for null value before invocation, which also means no operator is called
3315 when any argument is not convertible to unwrapped nullable type.
3317 2008-04-09 Marek Safar <marek.safar@gmail.com>
3319 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3320 of Unary expressions to follow operator overloading rules precisely.
3321 Also fixes #321794, #323794
3323 2008-04-08 Marek Safar <marek.safar@gmail.com>
3325 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3328 2008-04-08 Marek Safar <marek.safar@gmail.com>
3330 * expression.cs, ecore.cs: Implemented MemberInit expression.
3332 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
3334 Fix mono/tests/exception4.cs
3335 * statement.cs (ExceptionStatement, TryCatch): Revert to using
3336 ec.NeedReturnLabel () rather emitting a 'nop'.
3338 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3340 (TryCatch.SomeCodeFollows): Likewise.
3341 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3342 for 'break', 'continue' and 'return' statements inside a try.
3343 We're fairly sure that the generated IL stream will have more
3344 instructions textually following the try.
3345 (FlowBranchingTryCatch): Likewise.
3347 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3348 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3351 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3352 wrapper -- forward everything to CollectionForeach.
3353 (CollectionForeach.NonDisposableWrapper): New.
3354 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3355 instead of a pop + branch to end.
3357 2008-04-07 Marek Safar <marek.safar@gmail.com>
3359 A fix for bug #377485
3360 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
3361 Propagate location for extension method groups. Report conversion failure at
3364 2008-04-07 Marek Safar <marek.safar@gmail.com>
3366 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3367 ListInit and Field expressions.
3369 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
3371 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3372 Since $PC is always -1 inside the body of MoveNext, the fault
3374 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3375 * statement.cs (ExceptionStatement.emit_finally): Likewise.
3376 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3378 The denouement! Fix #324708
3379 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3380 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3381 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3382 'finally' inside the finally clause.
3384 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3385 inside an iterator. Don't emit the body of the 'finally' inside
3386 the finally clause yet.
3388 Use the ResumableStatement infrastructure for MoveNext ()
3389 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3390 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
3391 'old_resume_points'. Move dispatcher upfront.
3392 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3393 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3394 in an enumerator. This encodes the main fix in this patch series
3395 -- we can only jump into the first instruction of a try from the
3396 outside, but we want to emit try/finally regions in iterators and
3397 resume in the middle of them.
3399 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
3401 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3402 of NeedReturnLabel here.
3404 Introduce a common point for emitting try/finally to IL
3405 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
3406 features of the various subclasses, which are now driven by ...
3407 (ExceptionStatement.EmitPreTryBody): ... this and ...
3408 (ExceptionStatement.EmitTryBody): ... this and the original
3410 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3411 Remove DoEmit and update to follow above protocol.
3413 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3414 of the dispatcher are the same, skip emitting the 'switch'.
3415 * iterator.cs (Iterator.EmitDispose): Update to changes.
3417 Clean up handling of 'using' statement
3418 * statement.cs (UsingTemporary): New. Carved out of ...
3419 (Using): ... this. Simplify drastically. Handle exactly
3421 * cs-parser.jay (using_statement): Split. Create UsingTemporary
3422 or Using as appropriate. If there are multiple variable declared,
3423 create nested Using statements.
3424 (resource_acquisition): Kill.
3426 * statement.cs (ExceptionStatement.EmitForDispose): Use
3427 EmitFinallyBody, not EmitFinally.
3429 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3430 * iterator.cs: Update to changes.
3432 Start using the ResumableStatement infrastructure
3433 * statement.cs (ResumeableStatement.PrepareForDispose): New.
3434 (ResumableStatement.EmitForDispose): New.
3435 (ExceptionStatement): Override them.
3436 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3437 EmitForDispose to create the body of the Dispose method. Don't
3440 * iterator.cs (Iterator.AddResumePoint): Move here from ...
3441 * statement.cs (Toplevel.AddResumePoint): ... here.
3442 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3443 * flowanalysis.cs (FlowBranchingIterator): New.
3444 * codegen.cs (EmitContext): Update to changes.
3446 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3447 (Iterator.old_resume_points): Rename from 'resume_points'.
3448 (Iterator.MoveNextStatement): Remove unused class.
3450 New infrastructure for try/finally in iterators (still unused)
3451 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3452 (FlowBranchingToplevel.AddResumePoint): Hook into
3453 ToplevelBlock.AddResumePoint.
3454 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3455 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3456 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
3457 resume points and assign program-counter values.
3458 (ExceptionBlock.AddResumePoint): Collect resume points for
3459 de-muxer at the top of try block.
3460 * iterators.cs (Yield.CheckContext): Simplify.
3461 (Yield.Resolve): Use FlowBranching.AddResumePoint.
3463 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
3465 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3466 argument to an ExitStatement.
3467 (FlowBranchingException): Refactor saved origins code.
3468 * statement.cs (ExitStatement): Update to cahges.
3469 * iterator.cs (YieldBreak): Likewise.
3471 * statement.cs (ResumableStatement): New. Common base class for
3472 YieldReturn and ExceptionStatement.
3473 (ExitStatement): New. Common base class for Return and YieldBreak.
3474 (Return): Update to changes.
3475 * iterator.cs (YieldBreak): Likewise.
3476 * lambda.cs (ContextualReturn): Likewise.
3479 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3480 emit a meaningful error message.
3482 Fix #324765, #319508
3483 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3484 (VariableInfo.SetAssigned): Set it.
3485 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3486 determine if CS0219 or CS0168 is appropriate. Don't use
3487 flow-analysis information.
3488 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3489 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
3490 (EmitContext.EndFlowBranching): ... this.
3492 2008-04-03 Marek Safar <marek.safar@gmail.com>
3494 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3496 2008-04-03 Marek Safar <marek.safar@gmail.com>
3498 A fix for bug #376508
3499 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3500 ImplicitConversionExists.
3502 2008-04-03 Marek Safar <marek.safar@gmail.com>
3504 * expression.cs (Binary): Added remaining binary operators to expression
3507 * nullable.cs: Optimize shift with null argument.
3509 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
3511 Fix minor IL regression
3512 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3513 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3514 * cs-parser.jay (try_statement): Update to changes.
3516 * statement.cs (TryFinally.need_exc_block): Delete.
3517 (TryFinally): Update to changes.
3519 Now all ExceptionStatements are unconditional
3520 * statement.cs (CollectionForeach.DisposableWrapper): New.
3521 Extract out the try/finally code into a new wrapper.
3522 (CollectionForeach.Resolve): Use it to simplify the code.
3524 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
3526 Start at simplifying ExceptionStatement semantics a bit
3527 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3528 * cs-parser.jay (try_statement): Update to changes.
3529 (opt_catch_clauses): Remove.
3530 * flowanalysis.cs: Update to changes.
3531 (FlowBranching.BranchingType.TryCatch): New.
3532 (FlowBranchingTryCatch): New.
3534 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3535 (FlowBranching.CreateBranching): Update to changes.
3536 (FlowBranchingBlock.AddSibling): Add sanity check.
3537 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3540 * iterators.cs (Iterator.MarkFinally): Remove.
3541 * statement.cs (ExceptionStatement): Update to changes.
3543 Add support for skipping over finally blocks at runtime. First
3544 in a series to fix #324708
3545 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3546 (Iterator.EmitMoveNext): Initialize it.
3547 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3548 branch over the body of the 'finally' clause.
3550 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
3552 Avoid lopsided use of Foo/DoFoo names
3553 * statement.cs (ExpressionStatement.EmitFinallyBody):
3554 Rename from EmitFinally.
3555 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3556 * iterator.cs: Update to changes.
3558 2008-04-02 Marek Safar <marek.safar@gmail.com>
3560 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3561 based on UserOperatorCall. More binary nullable operators clean up.
3563 2008-04-02 Martin Baulig <martin@ximian.com>
3565 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3567 2008-04-02 Marek Safar <marek.safar@gmail.com>
3569 * nullable.cs: Merge user and empty conversions when lifting expression
3572 * expression.cs (StringConcat): Implemented expression tree representation.
3574 2008-04-01 Marek Safar <marek.safar@gmail.com>
3576 * nullable.cs: When lifting null literal and a user operator exists, no call
3579 2008-04-01 Marek Safar <marek.safar@gmail.com>
3581 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3584 2008-04-01 Marek Safar <marek.safar@gmail.com>
3586 * nullable.cs, expression.cs: Use namespace instead heavily nested
3587 monster abstract class.
3589 2008-04-01 Marek Safar <marek.safar@gmail.com>
3591 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3592 lifting of null literal and user operators. Clean up of some temporary
3595 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3597 Fix #368224, test-629.cs
3598 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3599 if it crossed an unwind-protect boundary.
3600 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3601 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3602 inside an unwind-protected region.
3603 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3604 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3605 'leave' instead of a 'br' if unwind-protected.
3606 (Iterator.EmitYieldBreak): Likewise.
3608 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3610 * driver.cs: Only define versioninfo resources if no win32 resource
3613 2008-03-28 Marek Safar <marek.safar@gmail.com>
3615 A fix for bug #372375
3616 * convert.cs: Fixed boxing of nullable types.
3618 2008-03-28 Marek Safar <marek.safar@gmail.com>
3620 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3623 2008-03-28 Marek Safar <marek.safar@gmail.com>
3625 A fix for bug #374619
3626 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3628 2008-03-27 Marek Safar <marek.safar@gmail.com>
3630 * lambda.cs: Check return type only for invocation.
3632 2008-03-27 Marek Safar <marek.safar@gmail.com>
3634 A fix for bug #374214
3635 * ecore.cs: Correctly report argument type mismatch.
3637 2008-03-27 Marek Safar <marek.safar@gmail.com>
3639 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3640 and not rely on broken IsEnum.
3642 2008-03-27 Marek Safar <marek.safar@gmail.com>
3644 * nullable.cs: New file, extracted from generic.cs.
3646 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3648 2008-03-27 Marek Safar <marek.safar@gmail.com>
3650 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3651 predefined comparison operators and null literals.
3653 * report.cs: New warning ID.
3655 2008-03-25 Marek Safar <marek.safar@gmail.com>
3657 A fix for bug #370577
3658 * lambda.cs: Check return type too.
3660 2008-03-25 Marek Safar <marek.safar@gmail.com>
3662 A fix for bug #372846
3663 * class.cs: Automatic properties can be declared as unsafe.
3665 2008-03-20 Marek Safar <marek.safar@gmail.com>
3667 * location.cs: Use string based concatenation.
3669 * expression.cs: LiftedBinaryOperator is gmcs only.
3671 2008-03-20 Marek Safar <marek.safar@gmail.com>
3673 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3674 conversions rules and expression trees.
3676 2008-03-19 Marek Safar <marek.safar@gmail.com>
3678 * delegate.cs: Use extension method source as delegate target.
3680 2008-03-19 Marek Safar <marek.safar@gmail.com>
3682 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3683 binary operations to be purely based on binary operations and optimized
3684 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3685 and other ET refactoring.
3687 * typemanager.cs: Fixed warning.
3689 2008-03-17 Marek Safar <marek.safar@gmail.com>
3691 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3693 * symbolwriter.cs: Fixed.
3695 2008-03-17 Marek Safar <marek.safar@gmail.com>
3697 * anonymous.cs, driver.cs: Reset anonymous types counters.
3699 2008-03-17 Marek Safar <marek.safar@gmail.com>
3701 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3703 * class.cs: Use fullname for all type member definitions.
3705 2008-02-19 Martin Baulig <martin@ximian.com>
3708 (IMethodData.EmitExtraSymbolInfo): New interface method.
3709 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3710 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3711 interface method here as an empty public virtual method.
3714 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3715 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3716 CodeGen.SymbolWriter.SetRealMethodName().
3718 2008-02-18 Martin Baulig <martin@ximian.com>
3721 (ScopeInfo.EmitType): Override this and emit debugging
3722 information for captured variables.
3723 (RootScopeInfo.EmitType): Override this and emit symbol
3724 information for a captured `this'.
3726 2008-02-15 Martin Baulig <martin@ximian.com>
3728 * iterators.cs: Emit debugging info.
3731 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3732 (EmitContext.OmitDebuggingInfo): New public property.
3735 (While): Override Emit() and don't emit symbol info there; do it
3736 inside DoEmit() instead.
3737 (Block.Emit): Omit symbol information while emitting the scope
3738 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3740 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3741 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3742 .ctor to make `IsIterator' work.
3744 2008-03-14 Martin Baulig <martin@ximian.com>
3746 * symbolwriter.cs: Added the new symbol writer function from the
3747 debugger's `terrania' branch; temporarily enclose them inside
3748 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3751 2008-03-14 Martin Baulig <martin@ximian.com>
3754 (SymbolWriter): Make this a public static class.
3757 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3758 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3760 2008-03-14 Marek Safar <marek.safar@gmail.com>
3762 A fix for bug #370577
3763 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3766 2008-03-14 Marek Safar <marek.safar@gmail.com>
3768 * typemanager.cs (CSharpName): Made 250 times faster.
3770 2008-03-13 Marek Safar <marek.safar@gmail.com>
3772 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3774 2008-03-12 Marek Safar <marek.safar@gmail.com>
3776 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3777 crash when predefined field does not exist.
3779 2008-03-12 Marek Safar <marek.safar@gmail.com>
3781 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3783 2008-03-12 Marek Safar <marek.safar@gmail.com>
3785 * class.cs (FixedField): Don't crash when contructors are missing.
3787 2008-03-11 Marek Safar <marek.safar@gmail.com>
3789 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3790 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3791 check internal types accessibility for internal and external types.
3792 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3794 2008-03-11 Marek Safar <marek.safar@gmail.com>
3796 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3797 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3798 attribute.cs, statement: Use corect instance of predefined types (work
3799 related to #364674).
3801 2008-03-07 Marek Safar <marek.safar@gmail.com>
3803 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3805 2008-03-07 Marek Safar <marek.safar@gmail.com>
3807 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3808 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3809 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3810 predefined types clean up, delayed predefined types members initialization
3811 (work related to #364674).
3813 2008-03-05 Marek Safar <marek.safar@gmail.com>
3815 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3817 2008-03-05 Marek Safar <marek.safar@gmail.com>
3819 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3820 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3821 predefined types clean up (work related to #364674).
3823 2008-03-04 Marek Safar <marek.safar@gmail.com>
3825 * ecore.cs: Print an error message instead of throwing exception.
3827 2008-03-04 Marek Safar <marek.safar@gmail.com>
3829 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3830 expression.cs, statement.cs: Unififed null literal representation.
3832 2008-03-03 Marek Safar <marek.safar@gmail.com>
3834 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3835 expression.cs: Refactored binary operators resolve phase and improved speed.
3836 The nullable code is still missing and won't work correctly, more fixes
3839 It also fixes #323726, #324312, #324248, and many other unreported issues.
3841 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3843 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3846 2008-02-27 Marek Safar <marek.safar@gmail.com>
3848 * ecore.cs: Clean-up and split BetterConversion.
3850 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3853 * enum.cs (EnumMember.Value): Only access 'value' if
3854 ResolveValue says it's ok.
3855 (EnumMember.DoResolveValue): Don't set prev_member.value.
3856 (Enum.GetDefinition): Reverse arguments of Equals --
3857 EnumMember.Value can return 'null'.
3859 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3861 2008-02-22 Marek Safar <marek.safar@gmail.com>
3863 * generic.cs, expression.cs: More ongoing work on expression trees.
3865 2008-02-21 Marek Safar <marek.safar@gmail.com>
3867 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3868 handle missing matches when mutiple operators exist.
3870 2008-02-20 Marek Safar <marek.safar@gmail.com>
3872 A fix for bug #363218
3873 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3876 2008-02-20 Marek Safar <marek.safar@gmail.com>
3878 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3879 update. This time to deal correctly with SideEffectConstant expression used
3880 as an argument for another constant folding.
3882 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3884 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3887 2008-02-19 Marek Safar <marek.safar@gmail.com>
3889 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3891 2008-02-19 Marek Safar <marek.safar@gmail.com>
3893 A fix for bug #328136
3894 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3895 side is a false constant, because we still need to evaluate the right-hand
3898 * statement.cs (If): Emit two types of boolean constants (simple constant,
3899 side-effect constant).
3901 2008-02-19 Marek Safar <marek.safar@gmail.com>
3903 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3905 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3908 2008-02-18 Marek Safar <marek.safar@gmail.com>
3910 A fix for bug #361457
3911 * ecore.cs (IsApplicable): Params methods have lower priority.
3913 * support.cs: Return correct parameter modifier for params types.
3915 2008-02-18 Marek Safar <marek.safar@gmail.com>
3917 * generic.cs (TypeParameter): Cache attribute target name.
3919 * support.cs: Removed unused variable.
3921 * typemanager.cs: Removed debugging leftover.
3923 * ecore.cs: Use local type instead of a property;
3925 * class.cs (VerifyMembers): Consider also parent to test whether type member
3928 * expression.cs (FullMethodDesc): Removed.
3930 * attribute.cs (IsValidArgumentType): Made static.
3932 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3934 Cleanup to be more readable.
3935 * Makefile (GMCS_PROFILE): Remove.
3936 (COMPILER_NAME): New helper.
3938 2008-02-15 Miguel de Icaza <miguel@novell.com>
3940 * cs-tokenizer.cs: if a conditional expression happens inside a
3941 (...) this also means that we do not need to de-ambiguate between
3942 an parenthesized expression and a cast.
3946 * constant.cs (SideEffectConstant): a constant value that happens
3947 to have a side effect.
3949 Fixes the build regressions introduced by the fix for #359789
3951 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3953 * expression.cs (Conditional.Emit): when emitting the ternary
3954 operator, use local variables to generate code verifiable code.
3956 The verifier cannot infer that the type on stack before the
3957 stloc.0 is executed is of type ParentB. This happens because the
3958 stack merge algorithm uses only parent types when deciding which
3959 is the common type. This is described in Part III 1.8.1.3 of ECMA
3962 This code compiled with mcs is not verifiable under MS. The MS
3963 verifier picks the first common interface of Foo and Bar, which is
3964 wrong, but doesn't use a full join type of the 2 interfaces.
3966 CSC uses a clever hack to compile such code in a verifiable
3967 way. It stores the intermediate values in a local variable with
3972 2008-02-14 Miguel de Icaza <miguel@novell.com>
3974 * expression.cs: Do not fold BitwiseAnd operators when the left
3975 side is a false constant, because we still need to evaluate the
3980 * support.cs: Instead of throwing an InternalErrorException when
3981 the position of the stream is outside the boundary of our buffer,
3982 reset the state of the reader, and restart the reading from the
3983 beginning of the file.
3985 2008-02-14 Marek Safar <marek.safar@gmail.com>
3987 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3989 2008-02-14 Marek Safar <marek.safar@gmail.com>
3991 A fix for bug #361686
3992 * decl.cs: A protected types used inside a private class which parents
3993 derives from the protected class are accessible.
3995 2008-02-13 Marek Safar <marek.safar@gmail.com>
3997 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3998 the parameterless constructor.
4000 2008-02-13 Marek Safar <marek.safar@gmail.com>
4002 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4003 lookup methods to use standard member cache when doing member lookup.
4005 2008-02-12 Marek Safar <marek.safar@gmail.com>
4007 * driver.cs: Don't report full path for referenced module as assembly error.
4009 2008-02-12 Marek Safar <marek.safar@gmail.com>
4011 * Makefile: Fixed `qh' target to work on all machines.
4013 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4014 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4015 and HasElementType with TypeManager implementation.
4017 2008-02-08 Marek Safar <marek.safar@gmail.com>
4019 A fix for bugs #325134, #359749
4020 * expression.cs, ecore.cs: Try to resolve an extension method even if the
4021 first binds point to non-method member expression.
4023 2008-02-08 Marek Safar <marek.safar@gmail.com>
4025 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4027 2008-02-08 Marek Safar <marek.safar@gmail.com>
4029 A fix for bugs #321394, #323028
4030 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4031 Reworked naive IsAccessibleAs implementation to handle nested types.
4033 2008-02-05 Jb Evain <jbevain@novell.com>
4035 * class.cs: use generic type comparison for parameters
4038 2008-02-05 Marek Safar <marek.safar@gmail.com>
4040 A fix for bug #325372
4041 * class.cs: Use generic type comparison when testing method signatures.
4043 2008-02-05 Marek Safar <marek.safar@gmail.com>
4045 A fix for bug #357047
4046 * ecore.cs: Applied C# 3.0 changes to better conversion.
4048 2008-02-05 Marek Safar <marek.safar@gmail.com>
4050 A fix for bug #358374
4051 * cs-parser.jay: Correctly set modifiers for all constructor types.
4053 2008-02-04 Marek Safar <marek.safar@gmail.com>
4055 A fix for bug #355251
4056 * generic.cs: Added base class constraint based type inference.
4058 2008-02-01 Marek Safar <marek.safar@gmail.com>
4060 A fix for bug #357255
4061 * decl.cs: One more missing visibility check.
4063 2008-02-01 Marek Safar <marek.safar@gmail.com>
4065 * support.cs: Fixed broken return.
4067 2008-01-25 Marek Safar <marek.safar@gmail.com>
4069 * report.cs: Correctly reset warnings count after probing.
4071 2008-01-25 Martin Baulig <martin@ximian.com>
4074 (NamespaceEntry.SymbolFileID): Make this work again after
4075 MemberName.ToString() is gone.
4077 2008-01-25 Marek Safar <marek.safar@gmail.com>
4079 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4082 2008-01-25 Marek Safar <marek.safar@gmail.com>
4084 * generic.cs: Use full implicit conversion for type inference fixing.
4086 2008-01-24 Marek Safar <marek.safar@gmail.com>
4088 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4089 Fixed user operator conversions.
4091 2008-01-24 Marek Safar <marek.safar@gmail.com>
4093 * generic.cs: Do nullable type to null comparison optimization during
4096 2008-01-24 Marek Safar <marek.safar@gmail.com>
4098 A fix for bug #355163
4099 * generic.cs: Enabled l-value resolve on nullable expressions.
4101 2008-01-24 Marek Safar <marek.safar@gmail.com>
4103 A fix for bug #353986
4104 * class.cs: Ingore static ctors with parameters for any further checks.
4106 2008-01-24 Marek Safar <marek.safar@gmail.com>
4108 A fix for bug #354310
4109 * namespace.cs: Removed redundant check.
4111 2008-01-24 Marek Safar <marek.safar@gmail.com>
4113 A fix for bug #354928
4114 * expression.cs: ElementInitializers can be resolved only once.
4116 2008-01-24 Marek Safar <marek.safar@gmail.com>
4118 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4119 Condition expressions.
4121 2008-01-23 Marek Safar <marek.safar@gmail.com>
4123 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4125 2008-01-22 Marek Safar <marek.safar@gmail.com>
4127 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4130 * generic.cs: Implemented coalesce expression.
4132 2008-01-22 Marek Safar <marek.safar@gmail.com>
4134 A fix for bug #355145
4135 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4136 expression tree type inference.
4138 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
4141 * expression.cs (Binary.IsUnsignedType): Fix typo.
4143 2008-01-22 Marek Safar <marek.safar@gmail.com>
4145 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4147 2008-01-22 Marek Safar <marek.safar@gmail.com>
4149 A fix for bug #355161
4150 * ecore.cs, expression.cs: Wider range of extension method supported
4153 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
4155 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4156 AssemblyBuilder to operate in compiler context. Fixes mcs part of
4159 2008-01-22 Marek Safar <marek.safar@gmail.com>
4161 A fix for bug #355148
4162 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4164 2008-01-22 Miguel de Icaza <miguel@novell.com>
4166 * expression.cs (CreateExpressionTree): Add support for or and
4167 logical or, and indent following the coding conventions.
4169 * typemanager.cs (LinqExpression): renamed from
4170 ExpressionTreeManager, for a shorter name.
4172 Use TypeManager.CoreLookupType to lookup types from our core
4173 assemblies and turn those into "Type" variables.
4175 Consumers that previously used "Namespace" and "Type" from this
4176 class should instead use the TypeExpression which is a type that
4177 is fully resolved (without involving the regular C# resolution
4180 This typically looks like this:
4182 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4183 new MemberAccess (texpr, name, type_arguments, loc)
4185 This avoids the problem in: #355178
4187 2008-01-21 Marek Safar <marek.safar@gmail.com>
4189 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4190 feature in parser only as we do in other cases.
4192 2008-01-21 Marek Safar <marek.safar@gmail.com>
4194 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4195 typemanager.cs: A refactoring of params arguments to reuse existing
4196 expressions (params -> array initializer) to emit params argument instead
4197 of specialized handling.
4198 It was required by expression tree implementation and it has other benefits
4199 as well, we now apply same optimization for params arguments as we do for
4202 2008-01-18 Marek Safar <marek.safar@gmail.com>
4204 A fix for bug #353526
4205 * generic.cs: A type inference of params arguments may not required any
4206 temporary array creation.
4208 2008-01-18 Marek Safar <marek.safar@gmail.com>
4210 A fix for bug #353534
4211 * generic.cs, ecore.cs, expression.cs: A method group type inference is
4212 supported for delegates only.
4214 2008-01-18 Marek Safar <marek.safar@gmail.com>
4216 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4217 type for more than 1 candidates.
4219 2008-01-18 Marek Safar <marek.safar@gmail.com>
4221 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4224 2008-01-16 Marek Safar <marek.safar@gmail.com>
4226 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4227 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4228 operator) expressions.
4230 2008-01-16 Zoltan Varga <vargaz@gmail.com>
4232 * statement.cs: Avoid declaring an IL variable for this_variable since it is
4233 not accessed from the generated IL.
4235 2008-01-14 Marek Safar <marek.safar@gmail.com>
4237 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4238 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4239 statement.cs: The first expression tree implementation drop, mostly
4240 infrastructure work.
4242 2008-01-14 Marek Safar <marek.safar@gmail.com>
4244 * ecore.cs (IsNestedChild): Refactored.
4246 2008-01-11 Marek Safar <marek.safar@gmail.com>
4248 * lambda.cs: Don't use a cast on unknown expression statement.
4250 2008-01-10 Geoff Norton <gnorton@novell.com>
4252 * cs-tokenizer.cs: One more token to distinguish between method and lambda
4255 2008-01-09 Marek Safar <marek.safar@gmail.com>
4257 * doc.cs: Report better /doc crash details.
4259 2008-01-09 Marek Safar <marek.safar@gmail.com>
4261 A fix for bug #352536
4262 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4264 2008-01-08 Marek Safar <marek.safar@gmail.com>
4266 A fix for bug #352287
4267 * ecore.cs, expression.cs: Do `this' access checking in all member access
4270 2008-01-08 Marek Safar <marek.safar@gmail.com>
4272 * rootcontext.cs, driver.cs: Switch to linq mode by default.
4274 * report.cs: Reset message stacks.
4276 2008-01-08 Marek Safar <marek.safar@gmail.com>
4278 * generic.cs (InferInPhases): Correctly calculate params position.
4280 2008-01-08 Marek Safar <marek.safar@gmail.com>
4282 * cs-tokenizer.cs: No need to parse full string when parsing lambda
4285 2008-01-07 Marek Safar <marek.safar@gmail.com>
4287 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4289 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4291 * driver.cs: Updated --help option.
4293 2008-01-07 Marek Safar <marek.safar@gmail.com>
4295 * generic.cs (InferParamsTypeArguments): Removed.
4296 (InferInPhases): Add params type inference.
4297 (LowerBoundInference): Fixed scoring mechanism.
4299 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4301 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
4303 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4304 byte array for unsigned "baked" assemblies.
4306 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
4308 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4309 array for assemblies that are not strongnamed.
4311 2008-01-04 Marek Safar <marek.safar@gmail.com>
4313 A fix for bug #351481
4314 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4315 declaring type for nested generic types.
4317 2008-01-04 Marek Safar <marek.safar@gmail.com>
4319 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4320 instead of ToString.
4322 2008-01-03 Marek Safar <marek.safar@gmail.com>
4324 A fix for bug #351047
4325 * expression.cs (Binary.ResolveOperator): Allow equality operators between
4326 null and structs only when equality and inequality operators are defined
4327 either as an user-operators or predefined operators.
4329 2008-01-03 Marek Safar <marek.safar@gmail.com>
4331 A fix for bug #351047
4332 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4334 2008-01-03 Marek Safar <marek.safar@gmail.com>
4336 A fix for bug #351257
4337 * cs-tokenizer.cs: Advance line number for '\r' correctly.
4339 2008-01-03 Marek Safar <marek.safar@gmail.com>
4341 A fix for bug #351157
4342 * class.cs (Using): Fixed yet another broken cloning.
4344 (Block): Put back more sensible default value for statements.
4346 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
4348 * codegen.cs: Allow AssemblyVersion with only major version component.
4351 2007-12-29 Marek Safar <marek.safar@gmail.com>
4353 A fix for bug #324654
4354 * class.cs: Use FullName property as member name.
4356 2007-12-28 Marek Safar <marek.safar@gmail.com>
4358 A fix for bug #342117
4359 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4360 constructor constraint.
4362 2007-12-28 Marek Safar <marek.safar@gmail.com>
4364 A fix for bug #338273
4365 * class.cs (ProbertyBase): Access modifier checks are required for overrides
4368 2007-12-28 Marek Safar <marek.safar@gmail.com>
4370 A fix for bug #350839
4371 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4373 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4375 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4378 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4380 * statement.cs: Changed some Hashtables to use HybridDictionaries
4381 instead. It was observed that some HashTables only contained a few
4382 items in the vast majority of cases. Since HybridDictionary is
4383 more efficient on small sets (<10 elements), "known_variables"
4384 from class ExplicitBlock as well as "labels" and "constants " from
4385 class Block were changed to HybridDictionaries.
4387 Atsai results: (56216kb->54987kb)
4389 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4392 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4394 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4397 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4399 * expression.cs: foreach loop to for loop, saved on allocation of
4400 enumerator (59333kb->59141kb)
4402 * statement.cs. Changed foreach loops to for loops, saved on
4403 allocation of enumerator (59141kb->59006kb)
4405 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4406 when constructed with no specified capacity. This was causing a
4407 few ArrayLists to allocate more memory than they would potentially
4408 need in the Block class and MemberCache class. Setting the
4409 ArrayLists to construct with a capacity of 1 saves some
4410 memory. (56216kb->55585kb)
4412 2007-12-27 Marek Safar <marek.safar@gmail.com>
4414 A fix for bug #347189 (2nd issue)
4415 * expression.cs (MemberAccess): Nested type can be found in base non-generic
4418 2007-12-27 Miguel de Icaza <miguel@novell.com>
4420 * report.cs: Do not use colors if stdout and stderr are not a
4423 2007-12-27 Marek Safar <marek.safar@gmail.com>
4425 A fix for bug #346998
4426 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4429 2007-12-27 Marek Safar <marek.safar@gmail.com>
4431 A fix for bug #343465
4432 * class.cs: Explicit method name for nested types uses dots only.
4434 2007-12-27 Marek Safar <marek.safar@gmail.com>
4436 A fix for bug #343707
4437 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4439 2007-12-27 Marek Safar <marek.safar@gmail.com>
4441 * ecore.cs: Report type inference errors only when arguments count matches
4444 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4446 * expression.cs, report.cs: New warning.
4448 * typemanager.cs: Catch anonymous method type too.
4450 2007-12-23 Marek Safar <marek.safar@gmail.com>
4452 A fix for bug #346379
4453 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4455 2007-12-23 Marek Safar <marek.safar@gmail.com>
4457 A fix for bug #347359
4458 * expression.cs (Invocation): Don't resolve already resolved expression.
4460 2007-12-23 Marek Safar <marek.safar@gmail.com>
4462 A fix for bug #347189
4463 * class.cs (FixedField): Use non-dependent code only in the define phase.
4465 2007-12-23 Marek Safar <marek.safar@gmail.com>
4467 A fix for bug #348076
4468 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4470 2007-12-22 Marek Safar <marek.safar@gmail.com>
4472 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4473 discovered extension methods.
4475 2007-12-22 Marek Safar <marek.safar@gmail.com>
4477 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4480 2007-12-21 Miguel de Icaza <miguel@novell.com>
4482 * report.cs (ErrorMessage): Add support for using colors on
4483 terminals that support it.
4485 2007-12-21 Marek Safar <marek.safar@gmail.com>
4487 * ecore.cs: Use information about expanded params for error reporting.
4489 2007-12-21 Marek Safar <marek.safar@gmail.com>
4491 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4492 and logic for params overloads.
4494 2007-12-15 Miguel de Icaza <miguel@novell.com>
4496 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4497 as this is also created from the parser. Fixes #349034
4499 2007-12-12 Miguel de Icaza <miguel@novell.com>
4501 * statement.cs (Throw.CloneTo): it is valid to have empty
4502 expressions for throw.
4504 2007-12-03 Marek Safar <marek.safar@gmail.com>
4506 * cs-parser.jay: Set delegate constraint parsing region correctly.
4508 2007-12-03 Marek Safar <marek.safar@gmail.com>
4510 A fix for bug #345467
4511 * typemanager.cs (IsEqual): Compare generic parameters position only.
4513 2007-11-28 Marek Safar <marek.safar@gmail.com>
4515 * expression.cs (BaseAccess): Type arguments can be null.
4517 2007-11-27 Raja R Harinath <harinath@gmail.com>
4519 * statement.cs (Block.Resolve): Ensure flow-branching tree is
4520 consistent even when an error has occured.
4521 (Switch.Resolve): Likewise.
4523 2007-11-22 Marek Safar <marek.safar@gmail.com>
4525 A fix for bug #334505
4526 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4529 2007-11-22 Marek Safar <marek.safar@gmail.com>
4531 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
4532 refactorings required to resolve extension methods correctly when mixing
4533 generics and non-generics members.
4535 2007-11-20 Marek Safar <marek.safar@gmail.com>
4537 A fix for bug #342584
4538 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4541 2007-11-19 Marek Safar <marek.safar@gmail.com>
4543 A fix for bug #342512
4544 * delegate.cs: Use delegate argument expression when is available. Don't
4545 emit virtual call when class is sealed.
4547 2007-11-16 Marek Safar <marek.safar@gmail.com>
4549 A fix for bug #325423
4550 * assign.cs (FieldInitializer): Use resolved expression for emit.
4552 * class.cs: Print less confusing error message.
4554 2007-11-16 Marek Safar <marek.safar@gmail.com>
4556 * cs-tokenizer.cs: Removed GMCS ifdefs.
4558 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4561 * cs-parser.jay: Disabled nullable check.
4563 * generic-mcs: Copied more generic stuff.
4565 2007-11-16 Marek Safar <marek.safar@gmail.com>
4567 * gcs-parser.jay: Merged to cs-parser.jay.
4569 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4570 * *.csproj, *.sources: Updated to use only jay parser file.
4572 2007-11-16 Marek Safar <marek.safar@gmail.com>
4574 * gcs-parser.jay: Added nullable and default expression feature checks.
4576 2007-11-16 Marek Safar <marek.safar@gmail.com>
4578 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4579 it fixes many TODOs and hidden bugs.
4581 * expression: Removed duplicate error check.
4583 2007-11-15 Marek Safar <marek.safar@gmail.com>
4585 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4586 implicitly type local variable only when it is used in a declaration.
4588 2007-11-15 Marek Safar <marek.safar@gmail.com>
4590 * attribute.cs: Use CS0612 for empty strings.
4592 2007-11-14 Marek Safar <marek.safar@gmail.com>
4594 * lambda.cs, statement.cs: Contextual return may act as a statement.
4596 2007-11-14 Marek Safar <marek.safar@gmail.com>
4598 A fix for a regression cause by #324222
4599 * class.cs: Don't report unused even when it implements an interface.
4601 2007-11-13 Marek Safar <marek.safar@gmail.com>
4603 A fix for bug #341205
4604 * ecore.cs, expression.cs: Method group expression cannot do static
4605 method access with an instance reference check before overloading takes
4608 2007-11-13 Marek Safar <marek.safar@gmail.com>
4610 A fix for bug #325359
4611 * class.cs: Use predictable name for automatically generated property.
4613 2007-11-12 Marek Safar <marek.safar@gmail.com>
4615 A fix for bug #324996
4616 * expression.cs (Is): Handle case where D is nullable and T is not
4619 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4621 2007-11-12 Marek Safar <marek.safar@gmail.com>
4623 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4624 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4625 Flush small error reporting changes.
4627 2007-11-09 Marek Safar <marek.safar@gmail.com>
4629 A fix for bug #324996
4630 * expression.cs: Rewrote Is expression implementation to work with
4631 generics, nullable types, anonymous method. A const result expression
4632 uses existing infrastructure instead of custom not fully-featured one.
4634 2007-11-08 Marek Safar <marek.safar@gmail.com>
4636 A fix for bug #340202
4637 * class.cs: Consider generics for volatile field.
4639 2007-11-08 Marek Safar <marek.safar@gmail.com>
4641 A fix for bug #335594
4642 * expression.cs: Use conversion rules when handling string addition.
4644 2007-11-07 Marek Safar <marek.safar@gmail.com>
4646 A fix for bug #336651
4647 * expression.cs: Fixed a crash when probing is on.
4649 2007-11-07 Marek Safar <marek.safar@gmail.com>
4651 A fix for bug #324242
4652 * covert.cs: Added a conversion from any nullable-type with an
4653 underlying enum-type to the type System.Enum.
4655 2007-11-07 Marek Safar <marek.safar@gmail.com>
4657 A fix for bug #324222
4658 * class.cs: Report all non-used event fields.
4660 2007-11-07 Marek Safar <marek.safar@gmail.com>
4662 A fix for bug #325161
4663 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4664 qualifier for generic types.
4666 2007-11-07 Marek Safar <marek.safar@gmail.com>
4668 A fix for bug #322971
4669 * expression.cs, ecore.cs: Added intermediate result value check for
4672 2007-11-07 Marek Safar <marek.safar@gmail.com>
4674 A fix for bug #324754
4675 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4676 when it was requested.
4678 2007-11-07 Marek Safar <marek.safar@gmail.com>
4680 A fix for bug #325101
4681 * expression.cs: Do type not value comparison for `is' expression.
4683 2007-11-07 Marek Safar <marek.safar@gmail.com>
4685 A fix for bug #320236
4686 * convert.cs: Don't apply user conversion on underlying target type.
4688 2007-11-06 Marek Safar <marek.safar@gmail.com>
4690 * expression.cs: Don't use unresolved expression for error reporting.
4692 2007-11-06 Marek Safar <marek.safar@gmail.com>
4694 A fix for bugs #337712, #324490
4695 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4696 overloading resolution too.
4698 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4699 the process consistent and more robust.
4701 * expression.cs, linq.cs, report.cs: Update.
4703 2007-11-02 Marek Safar <marek.safar@gmail.com>
4705 A fix for bug #332909
4706 * attribute.cs: Resolve attributes in correct context using error
4709 * rootcontext.cs: Define Obsolete attribute members as core members.
4711 2007-11-02 Marek Safar <marek.safar@gmail.com>
4713 * statement.cs: Removed unused methods.
4715 2007-10-31 Wade Berrier <wberrier@novell.com>
4717 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4718 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4721 2007-10-31 Marek Safar <marek.safar@gmail.com>
4723 A fix for bug #338102
4724 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4725 methods registered as non-generics.
4727 2007-10-31 Marek Safar <marek.safar@gmail.com>
4729 A fix for bugs #337712, #324490
4730 * delegate.cs: Delegate covariance and contravariance is not allowed for
4733 2007-10-31 Marek Safar <marek.safar@gmail.com>
4735 A fix for bug #337719
4736 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4739 2007-10-30 Marek Safar <marek.safar@gmail.com>
4741 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4743 2007-10-29 Marek Safar <marek.safar@gmail.com>
4745 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4748 2007-10-29 Raja R Harinath <rharinath@novell.com>
4750 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4752 2007-10-29 Marek Safar <marek.safar@gmail.com>
4754 A fix for bug #334652
4755 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4756 extension methods when we have not found the best candidate in normal
4759 2007-10-27 Marek Safar <marek.safar@gmail.com>
4761 * AssemblyInfo.cs: Keep up-to-date.
4763 2007-10-27 Marek Safar <marek.safar@gmail.com>
4765 * Makefile: Fixed generics compiler name.
4767 2007-10-27 Marek Safar <marek.safar@gmail.com>
4769 * lambda.test: removed, lambda parsing is done differently.
4771 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4773 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4775 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4777 2007-10-27 Marek Safar <marek.safar@gmail.com>
4779 * Makefile, *.sources : All C# compilers are in mcs folder.
4781 * *.cs: Use existing 2_1 define for smcs.
4783 2007-10-26 Marek Safar <marek.safar@gmail.com>
4785 A fix for bug #335847
4786 * assign.cs, expression.cs: Couple of changes to avoid creating a
4787 temporary variable for each object initializer assignment statement. It
4788 simplifies struct initialization too, otherwise two temporary variables
4790 Implemented optimization of redundant default element initializers.
4792 2007-10-25 Marek Safar <marek.safar@gmail.com>
4794 A fix for bug #336766
4795 * expression.cs (Class.CheckBase): Use generic name when method is
4798 2007-10-25 Marek Safar <marek.safar@gmail.com>
4800 A fix for bug #334737
4801 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4802 variable and not variable argument for prepared copies.
4804 2007-10-24 Marek Safar <marek.safar@gmail.com>
4806 A fix for bug #325110
4807 * class.cs, expression.cs, attribute.cs: Use open generic method when
4808 checking conditional attribute.
4810 2007-10-24 Marek Safar <marek.safar@gmail.com>
4812 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4813 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4814 FeatureIsNotAvailable.
4816 2007-10-24 Marek Safar <marek.safar@gmail.com>
4818 ** C# 3.0 Partial methods
4820 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4821 methods support. Because of member cache issue with generics only
4822 non-generics partial methods are fully supported.
4824 2007-10-23 Marek Safar <marek.safar@gmail.com>
4826 * class.cs, decl.cs: Rewrote member overloads check to cope with
4827 generics and to use member cache for member checking. It also improves
4828 performance and fixes remaining overloads issues.
4830 2007-10-20 Marek Safar <marek.safar@gmail.com>
4832 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4833 roottypes.cs, typemanager.cs:
4835 A member cache creation logic changed to add members immediately and
4836 not rely on fallback. The member cache is now only prefered way
4837 how to access and find type declaration members. It saves 5 MB of memory
4838 during MWF compilation and makes code ready for more optimizations and
4839 clean-ups, it's also a pre-requirement for partial methods.
4841 2007-10-18 Raja R Harinath <harinath@gmail.com>
4843 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4844 handling for generic parameters.
4846 2007-10-15 Marek Safar <marek.safar@gmail.com>
4848 * class.cs (FixedField): Removed redundant volatile check.
4850 2007-10-15 Marek Safar <marek.safar@gmail.com>
4852 * class.cs, decl.cs: Fixed overload members verification to do only one
4853 check per possible collision.
4855 2007-10-13 Marek Safar <marek.safar@gmail.com>
4857 A fix for bug #325478
4858 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4859 and create only one disposable flags container.
4861 2007-10-12 Marek Safar <marek.safar@gmail.com>
4863 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4864 * statement.cs (Fixed): Fixed variables cloning.
4866 2007-10-12 Marek Safar <marek.safar@gmail.com>
4868 A fix for bug #333342
4869 * class.cs (EventField): Don't mark value type event as synchronized.
4871 2007-10-12 Marek Safar <marek.safar@gmail.com>
4873 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4874 inference to identify best candidate method correctly.
4875 (ProperyExpr): A range variable is read only and cannot be modified.
4877 2007-10-11 Marek Safar <marek.safar@gmail.com>
4879 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4880 logic to identify best candidate method correctly.
4882 2007-10-11 Marek Safar <marek.safar@gmail.com>
4884 * location.cs (Equals, GetHashCode): Removed.
4886 2007-10-11 Marek Safar <marek.safar@gmail.com>
4888 * report.cs: Implemented message recorder. It is used mainly for lambda
4889 expressions to capture otherwise swallowed error messages.
4891 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4893 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4895 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4897 * expression.cs (MemberAccess): Always report lookup failure.
4899 * location.cs: Implemented Equals, GetHashCode.
4901 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4903 2007-10-10 Jb Evain <jbevain@novell.com>
4905 * codegen.cs: re-enable assembly version check.
4907 2007-10-09 Marek Safar <marek.safar@gmail.com>
4909 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4912 * namespace.cs (UsingAlias): Do correct version check.
4914 2007-10-08 Marek Safar <marek.safar@gmail.com>
4916 * expresison.cs, ecore.cs: Issue extension method error message when
4919 * rootcontext.cs: Added ISO_2 compiler mode option.
4921 2007-10-08 Marek Safar <marek.safar@gmail.com>
4923 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4926 2007-10-08 Marek Safar <marek.safar@gmail.com>
4928 * attribute.cs (GetString, GetBoolean): Work with both literal and
4931 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4932 Moved method overload specific methods to MethodGroupExpr.
4934 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4935 it should be less memory consuming.
4937 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4939 * codegen.cs: remove the assembly version check until the buildbot is
4942 2007-10-07 Jb Evain <jbevain@novell.com>
4944 * attribute.cs (Attribute.GetString): if the value
4945 expression is a StringConstant, return its string value.
4947 2007-10-07 Jb Evain <jbevain@novell.com>
4949 * typemanager.cs: add `assembly_version_attribute_type`.
4950 * codegen.cs: on attribute emission, check that the
4951 AssemblyVersionAttribute doesn't overflow.
4953 2007-10-05 Marek Safar <marek.safar@gmail.com>
4955 A fix for bug #324677
4956 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4957 parent container of a scope container with currently resolved one.
4959 2007-10-05 Marek Safar <marek.safar@gmail.com>
4961 A fix for bug #325534
4962 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4965 2007-10-05 Marek Safar <marek.safar@gmail.com>
4967 A fix for bug #327504
4968 * class.cs (Operator.Define): Refactored implicit and explicit user
4969 operator conversion rules.
4971 2007-10-05 Marek Safar <marek.safar@gmail.com>
4973 A fix for bug #327520
4974 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4976 2007-10-04 Marek Safar <marek.safar@gmail.com>
4978 A fix for bug #328022
4979 * class.cs (MethodData.Define): Use correct method to check whether
4980 a method implementents an accessor.
4982 2007-10-04 Marek Safar <marek.safar@gmail.com>
4984 A fix for bug #330069
4985 * statement.cs (Fixed.Resolve): Read the first array element only when
4986 an array is instantiated.
4988 2007-10-04 Marek Safar <marek.safar@gmail.com>
4990 * expression.cs, assign.cs, generics.cs: Print correct operator when
4991 compound assignment is used.
4993 2007-10-04 Marek Safar <marek.safar@gmail.com>
4995 A fix for bug #325841
4996 * expression.cs (ArrayAccess): Use full argument cloning only for
4997 string compound concatenation.
4999 2007-10-03 Marek Safar <marek.safar@gmail.com>
5001 A fix for bug #328774
5002 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5004 (PropertyExpr.EmitAssign): Fixed string concatenation compound
5007 2007-10-03 Raja R Harinath <rharinath@novell.com>
5010 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5011 Event accessibility checks here. Remove some bogus code that
5012 accidently made GenericMethods work.
5013 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5015 2007-09-25 Marek Safar <marek.safar@gmail.com>
5017 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5019 * statement.cs (Block): Refactored AddVariable to allow error handling
5022 * generic.cs: New stub.
5024 2007-09-23 Marek Safar <marek.safar@gmail.com>
5026 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5029 2007-09-17 Marek Safar <marek.safar@gmail.com>
5031 * class.cs: Use partial container to record whether any partial part
5032 contains static field initializer and therefore default contructor has
5035 2007-09-14 Marek Safar <marek.safar@gmail.com>
5037 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5038 mono-list when only one of two partial parts has defined accessibility
5041 2007-09-14 Marek Safar <marek.safar@gmail.com>
5043 A fix for bug #82845
5045 * class.cs (TypeContainer): Set correct resolve context for all field
5048 2007-09-13 Marek Safar <marek.safar@gmail.com>
5050 * assign.cs: Fixed a crash when field is resolved twice with an error.
5052 * codegen.cs: Changed InFieldInitializer to be flag.
5054 * anonymous.cs, ecore.cs, expression.cs: Update after
5055 IsInFieldInitializer rename.
5057 * const.cs: Removed unused parameter.
5059 * class.cs: Changed the way how we resolve and emit field initializers.
5060 The field initilizers have to have access to contructor block to emit
5061 compiler generated code.
5063 2007-09-13 Marek Safar <marek.safar@gmail.com>
5065 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5066 generics use TypeContainer instead.
5068 2007-09-12 Marek Safar <marek.safar@gmail.com>
5070 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5072 * lambda.cs (ResolveParameters): Use more powerful
5073 InflateGenericArgument.
5075 * parameters.cs: Better exception message.
5077 2007-09-10 Marek Safar <marek.safar@gmail.com>
5079 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5080 correct expression block type.
5082 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5084 * expression.cs (Invocation): Extracted method group resolve to
5087 2007-09-07 Marek Safar <marek.safar@gmail.com>
5089 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5090 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5092 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5093 generic extension methods.
5095 2007-09-06 Marek Safar <marek.safar@gmail.com>
5097 A fix for bug #82676 (Do I get it right now?)
5098 * convert.cs (Binary.ResolveOperator): An interface is converted to the
5099 object before a standard conversion is applied.
5101 2007-09-06 Marek Safar <marek.safar@gmail.com>
5103 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5106 2007-09-05 Marek Safar <marek.safar@gmail.com>
5108 A fix for bug #82676
5109 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5110 non-generic interface types.
5112 2007-09-05 Marek Safar <marek.safar@gmail.com>
5114 A fix for bug #82690
5115 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5117 2007-09-05 Marek Safar <marek.safar@gmail.com>
5119 A fix for bug #82571
5120 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
5121 modifier for container based methods.
5123 2007-09-05 Marek Safar <marek.safar@gmail.com>
5125 A fix for bug #82676
5126 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5127 any interface-type T means to any of interface type T.
5129 2007-09-04 Marek Safar <marek.safar@gmail.com>
5131 * namespace.cs: We have 2 versions of System.Core assembly.
5133 2007-09-04 Marek Safar <marek.safar@gmail.com>
5135 A fix for bug #82652
5136 * class.cs (Class.GetClassBases): Compare types and not expressions.
5138 2007-09-04 Marek Safar <marek.safar@gmail.com>
5140 A fix for bug #82620
5141 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5142 actually never worked before.
5143 (IndexerAccess): Emit prepared arguments before they are modified.
5145 2007-09-04 Marek Safar <marek.safar@gmail.com>
5147 A fix for bug #82563
5148 * assign.cs: Revert wrong fix.
5150 * expression.cs (VariableReference.EmitAssign): Handle ref reference
5152 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5153 Instead of ldelema/stdind we have to use temporary variables to handle
5154 cases like String.Concat (params string[]).
5156 2007-08-31 Marek Safar <marek.safar@gmail.com>
5158 * class.cs: EmitAttributes to Emit rename.
5160 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5162 (MemberCore.HasClsCompliantAttribute): Don't depend on
5163 GetClsCompliantAttributeValue execution.
5165 2007-08-31 Marek Safar <marek.safar@gmail.com>
5167 * anonymous.cs: Use shorter type prefix.
5169 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5172 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5173 variables when probing is on.
5175 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
5176 unresolved variables.
5177 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5178 handle transparent identifiers.
5180 2007-08-26 Marek Safar <marek.safar@gmail.com>
5182 * attribute.cs (IsClsCompliant): Add nullable types test.
5184 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
5186 * doc.cs : catch other types of exception than XmlException to
5187 report CS1570. Fixed bug #82565.
5189 2007-08-23 Marek Safar <marek.safar@gmail.com>
5191 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
5192 The number of delegate parameters has to match.
5193 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5196 2007-08-21 Marek Safar <marek.safar@gmail.com>
5198 * anonymous.cs (AnonymousMethod): Generate private anonymous method
5199 to fix problem with private arguments.
5201 2007-08-20 Marek Safar <marek.safar@gmail.com>
5203 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5205 * decl.cs (MemberName): Ignore generic type with no generic arguments.
5207 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5208 empty. Add cloning suport.
5210 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5212 2007-08-20 Marek Safar <marek.safar@gmail.com>
5214 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
5215 to create EmptyCast. It handles EmptyConstantCast specialization for
5218 2007-08-18 Marek Safar <marek.safar@gmail.com>
5220 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5221 (EmitArrayArgument): One routine for array arguments.
5222 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
5224 2007-08-17 Marek Safar <marek.safar@gmail.com>
5226 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5228 2007-08-17 Marek Safar <marek.safar@gmail.com>
5230 * anonymous.cs: MemberLookupFinal update.
5232 * class.cs (ConstructorInitializer): Is expression based.
5234 * delegate.cs: MethodGroupExpr update.
5236 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
5238 (Error_MemberLookupFailed): Customizable error override.
5239 (MethodGroupExpr): Keep queried type for later usage.
5240 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5243 * expression.cs: Error_MemberLookupFailed refactoring.
5244 (New.DoResolve): Resolve as much as possible.
5245 (ElementInitializer.Error_MemberLookupFailed): Object initializer
5246 customization for invalid member types.
5248 * statement.cs: MethodGroupExpr update.
5250 2007-08-16 Marek Safar <marek.safar@gmail.com>
5252 * modifier.cs (Check): Check all modifiers and not only accessibility
5255 2007-08-16 Marek Safar <marek.safar@gmail.com>
5257 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5258 type and not an expression.
5260 2007-08-16 Marek Safar <marek.safar@gmail.com>
5262 * statement.cs (Catch.Clone): Type and variable can be null.
5264 2007-08-16 Marek Safar <marek.safar@gmail.com>
5266 A fix for bug #81979
5267 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5268 I am really not sure whether this is the best fix.
5270 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5273 2007-08-14 Marek Safar <marek.safar@gmail.com>
5275 ** C# 3.0 Object and collection initializers (major re-write)
5277 * assign.cs (DoResolve): Initializers are not assign related.
5279 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5280 used during collection or object initialization.
5282 * expression.cs (Error_InvalidArguments): Add initializers specific
5283 messages. More will come later because it requires some general
5285 (New.DoResolve): Better error handling for unsafe types.
5286 (EmptyExpressionStatement): New class.
5287 (ElementInitializer): An object initializer expression.
5288 (CollectionElementInitializer): A collection initializer expression.
5289 (CollectionOrObjectInitializers): A block of object or collection
5291 (NewInitialize): New expression with element/object initializers.
5293 * statement.cs: Reverted object/collection initializer hacks.
5295 * typemanager.cs (CSharpName): Filter __arglist type.
5297 2007-08-09 Marek Safar <marek.safar@gmail.com>
5299 ** C# 3.0 Anonymous Types (update to the latest standard)
5301 * expression.cs (Binary.ResolveOperator): Threat all null based types
5303 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5304 (AnonymousTypeParameter): Updated.
5306 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5307 (AnonymousTypeClass): New anonymous type container.
5309 * class.cs (AddField): Return operation result.
5311 * generic.cs: Another empty TypeArguments overload.
5313 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5314 are stored at top of normal hierarchy.
5316 * typemanager.cs (CSharpName): Filter anonymous types.
5318 2007-08-09 Marek Safar <marek.safar@gmail.com>
5320 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5321 as single Concat call. How could we miss that :-(
5323 2007-08-08 Marek Safar <marek.safar@gmail.com>
5325 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5327 2007-08-07 Miguel de Icaza <miguel@novell.com>
5329 * expression.cs: Fix the previous commit, the creation of the
5330 arguments array list needs also to be conditional on the arguments
5333 * class.cs: Add a little bit of help to help narrow down problems.
5335 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5336 not try to copy in that case.
5338 * driver.cs: When building SMCS, include a new different set of
5339 default assemblies here. Do this here so we can control whether
5340 to include the default assemblies with /noconfig.
5342 2007-08-03 Marek Safar <marek.safar@gmail.com>
5344 A fix for bug #81979
5345 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5348 2007-08-03 Marek Safar <marek.safar@gmail.com>
5350 A fix for bug #82300
5352 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5353 we are in probing scope.
5355 2007-08-03 Marek Safar <marek.safar@gmail.com>
5357 A fix for bug #82301
5359 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5360 (Statement.CloneTo): Clone and not map children blocks.
5362 2007-08-03 Marek Safar <marek.safar@gmail.com>
5364 A fix for bug #82299
5366 * expression.cs (LocalVariableReference.CloneTo): Remap local info
5369 * statement.cs (Statement.CloneTo): Clone variables before statements
5370 to allow remaping of local variables.
5372 2007-08-03 Marek Safar <marek.safar@gmail.com>
5374 A fix for bug #82296
5377 * report.cs: Log crash details for future clone problems.
5379 * statement.cs (Return.Clone): Don't clone non-existent expression.
5381 2007-08-03 Raja R Harinath <harinath@gmail.com>
5383 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5384 (Class.AddBasesForPart): Move CS0537 check here from ...
5385 * cs-parser.jay (class_declaration): ... here. Move calling of
5386 'AddBasesForPart' to ...
5387 (class_bases): ... here.
5388 (struct_declaration, interface_declaration): Update to changes.
5390 2007-08-02 Marek Safar <marek.safar@gmail.com>
5392 A fix for bug #81923
5394 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5395 conversion is allowed.
5397 2007-08-02 Marek Safar <marek.safar@gmail.com>
5399 A fix for bug #81564
5401 * ecore.cs (EventExpr): Add IsBase handling.
5403 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5406 2007-08-02 Raja R Harinath <harinath@gmail.com>
5408 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5409 * cs-parser.jay: Some whitespace cleanups.
5410 (current_delegate): New.
5412 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5413 a dummy code block, and use 'type_name' instead of 'member_name'.
5414 (interface_declaration, class_declaration): Likewise.
5415 (delegate_declaration): Likewise. Rearrange slightly and use
5417 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5418 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
5420 2007-08-02 Marek Safar <marek.safar@gmail.com>
5422 A fix for bug #82039
5424 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5427 * typemanager.cs (CSharpName): Split to string overload.
5429 2007-08-02 Marek Safar <marek.safar@gmail.com>
5432 * report.cs: Updated warning CS0472.
5434 2007-08-01 Marek Safar <marek.safar@gmail.com>
5436 A fix for bug #82181
5438 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5440 2007-08-01 Marek Safar <marek.safar@gmail.com>
5442 A fix for bug #82277
5443 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5445 2007-08-01 Marek Safar <marek.safar@gmail.com>
5447 ** C# 3.0 Type Inference (major bits are working)
5449 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5450 (.ImplicitStandardConversionExists): Uses compatible.
5451 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5452 (.InferReturnType): New method.
5453 (.Compatible): Refactored.
5454 (.ResolveParameters): Uses factory to create resolved parameters.
5455 (.CompatibleMethod): Add probing mode support.
5456 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5457 clearly distinguish between 2 different operations.
5458 (LambdaMethod): Moved to lambda.cs.
5459 (AnonymousMethod): Removed unused fields and methods.
5460 (AnonymousDelegate): Simplified.
5462 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5464 * convert. cs (ImplicitConversionStandard): Compatible works differently.
5466 * delegate.cs (Delegate): New mehods to reduce code duplication.
5467 (.GetConstructor): New method.
5468 (.GetInvokeMethod): New method.
5469 (DelegateCreation): Updated.
5471 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5473 (OverloadResolve): Made probing little bit faster.
5475 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5478 * generic.cs (TypeInferenceContext): Dummy implementation.
5480 * iterators.cs: Updated after Resolve/Define rename.
5482 * lambda.cs (LambdaExpression)
5483 (.ResolveParameters): Handles both type of arguments and type inference too.
5485 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5486 (InflateTypes): Updated.
5488 * support.cs (InflateTypes): Changed signature and updated.
5490 * typemanager.cs (LookupMemberCache): Better dynamic type check.
5491 (MemberLookup_FindMembers): More MS tricks.
5492 (GetParameterData): Ditto.
5493 (GetDelegateParameters): Uses quick path for dynamic types.
5495 2007-08-01 Marek Safar <marek.safar@gmail.com>
5497 * class.cs (MethodData.Define): EmitContext is required for generic stuff
5500 2007-07-31 Marek Safar <marek.safar@gmail.com>
5502 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5505 2007-07-26 Jb Evain <jbevain@novell.com>
5507 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5508 which takes a boolean 'report_errors', similar to the GetMethod.
5509 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5510 in .net 2.1, do not report errors here.
5512 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5513 System.Runtime.CompilerServices.RequiredAttributeAttribute and
5514 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5517 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5518 of the type InternalsVisibleToAttribute before the first call
5519 to CoreLookupType which is allowed to fail (third boolean parameter
5520 to true). Because, during the resolution for a type that is not
5521 immediately found, we try to check if the type is not defined in
5522 a friend assembly, and to do so, we need the
5523 InternalVisibleToAttribute.
5525 2007-07-23 Miguel de Icaza <miguel@novell.com>
5527 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5528 feature that allows structs to be compared against null and inline
5529 the result as true or false.
5531 Notice that the same code is not permitted inside a generic block
5532 of code that would do:
5534 class Foo<T> where T : struct {
5541 It is only allowed if the type of T is not bound (no where
5542 clause). In my opinion, this CSC 2 behavior is broken but people
5543 seem to be using it (IronRuby does, a few bug reports on bugzilla
5544 have it and some people have complained about it).
5546 All of the users that depend on this behavior have code that is
5549 * report.cs (Warning, Error): make these take object arguments,
5550 not strings, as that allows us to take advantage of Format.
5552 2007-07-20 William Holmes <billholmes54@gmail.com>
5554 * decl.cs: Changed MemberName.CountTypeArguments to also check the
5555 Left member variable for the Count.
5556 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
5557 MemberName.CountTypeArguments to avoid a NRE.
5559 This code is contributed under the MIT X11 license
5561 2007-07-18 Marek Safar <marek.safar@gmail.com>
5563 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5565 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5567 * doc.cs : generic method arguments are written as ``x while generic
5568 type arguments are `x. Combined with the previous change, fixed bug
5571 2007-07-18 Raja R Harinath <rharinath@novell.com>
5574 * expression.cs (Binary.ResolveOperator): When converting
5575 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5577 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5579 * doc.cs : when T: or whatever x: is specified, it does not really
5580 check the doc comment's syntax correctness. Fixed bug #82006.
5582 2007-07-18 Marek Safar <marek.safar@gmail.com>
5584 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5585 LambdaExpression better.
5587 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5589 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5591 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5592 as it can be generated.
5594 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5597 * lambda.cs (LambdaExpression): Refactored to share same code with
5598 AnonymousMethodExpression.
5600 2007-07-17 Marek Safar <marek.safar@gmail.com>
5602 * anonymous.cs (MakeName): Include host name for easier debugging.
5603 (LambdaMethod): New class for lambda spcecific stuff.
5605 * attribute.cs: Set EmitContext return type.
5607 * class.cs: Set EmitContext return type.
5609 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5610 with null/void meaning.
5612 * iterators.cs (ContainerType): Implemented.
5614 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5616 * statement.cs (Return): Updated to lambda expressions.
5617 (Block.CloneTo): Parent can be null.
5619 2007-07-13 Marek Safar <marek.safar@gmail.com>
5621 A fix for bug #81917
5622 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5624 * class.cs (FixedField): Check whether field is in unsafe scope.
5626 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5627 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5629 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5632 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5634 2007-07-13 Marek Safar <marek.safar@gmail.com>
5636 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5637 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5640 2007-07-13 Marek Safar <marek.safar@gmail.com>
5642 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5644 2007-07-13 Marek Safar <marek.safar@gmail.com>
5646 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5647 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5649 * codegen.cs(EmitContext): Add ProbingMode flag.
5651 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5653 * driver.cs: For now set both warning values.
5655 * ecore.cs (SimpleName): Name is readonly.
5656 (MethodGroup.OverloadResolve): One quick path for probing.
5658 * expression.cs (Unary): Set Oper r/o.
5659 (Binary): Set Oper r/o.
5660 (ParameterReference): Set few instance variables as r/o.
5661 (ParameterReference.DoResolveBase): Don't capture aruments when
5663 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5664 (Arglist): arguments are private.
5665 (SizeOf): type is private and r/o.
5666 (MemberAccess): arguments are private.
5668 * report.cs: Enhanced reporting on/off capabilities.
5670 * lambda.cs: Uses ec.IsInProbingMode.
5671 (ContextualReturn): Derives from return.
5673 * rootcontext.cs: For now set both warning values.
5675 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5677 (Return.Resolve): Don't die immediately.
5678 (Block.Resolve): Speed-up probing.
5679 (Block.CloneTo): Clone only child blocks.
5681 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5683 * iterators.cs: reverted Miguel's latest change (r81925) as it
5684 breaks the build in System.
5686 2007-07-13 Miguel de Icaza <miguel@novell.com>
5688 * iterators.cs (Yield.CheckContext): Check for the iterator type
5689 also here as we can call into Yield even in codepaths that are not
5691 (MethodOrOperator is the only path that was checked).
5693 In addition to the standard check, use a more specific check for
5694 constructors to report a more verbose error.
5696 2007-07-12 Miguel de Icaza <miguel@novell.com>
5698 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5699 report the warning and continue
5701 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5702 values on the stack on the call to Emit. Use EmitStatement if
5703 possible, or using Emit + Pop if not possible. Fixes #82064
5705 2007-07-12 Raja R Harinath <rharinath@novell.com>
5707 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5708 avoid try...finally in some cases.
5710 2007-07-10 Marek Safar <marek.safar@gmail.com>
5712 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5714 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5715 instead of method. Re-use standard error handling.
5716 (ConstructorInitializer.Emit): Simplified.
5718 * delegate.cs: Updated after Invocation.EmitCall change.
5720 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5721 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5722 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5723 method and don't permanently changing input arguments.
5724 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5725 is resolved it has one of the candidates is the best one which is later
5726 used to emit. Removed a few unused method.
5727 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5729 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5730 (Binary.ResolveOperator): Ditto.
5731 (ConditionalLogicalOperator.DoResolve): Ditto.
5732 (Invocation): Uses method group.
5733 (Invocation.DoResolve): Simplified.
5734 (Invocation.EmitCall): Removed useless is_static.
5735 (Invocation.Emit): Delegate to method group.
5736 (Invocation.EmitStatement): Simplified.
5737 (New): Uses method group.
5738 (MemberAccess.DoResolve): Don't destroy original expression.
5740 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5742 2007-07-04 Marek Safar <marek.safar@gmail.com>
5744 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5747 * lambda.cs: Add custom error message type.
5749 2007-07-03 Marek Safar <marek.safar@gmail.com>
5751 * lambda.cs: Simplified little bit.
5753 * parameter.cs: Introduced ImplicitLambdaParameter.
5754 (Parameters.CreateFullyResolved): New factory instead of ctor.
5758 * delegate.cs: Updated parameter creation.
5760 2007-07-03 Marek Safar <marek.safar@gmail.com>
5762 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5765 * generic.cs: Synchronized with gmcs.
5767 2007-07-03 Marek Safar <marek.safar@gmail.com>
5769 * class.cs (Indexer): Check return type as soon as possible.
5771 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5774 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5776 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5778 * parameter.cs (Parameter): Use expression type when it is available.
5780 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5781 method modifier for the first parameter only.
5783 2007-06-24 Marek Safar <marek.safar@gmail.com>
5785 A fix for bug #81938
5786 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5788 * constant.cs: Tide up an exception message.
5790 2007-06-22 Marek Safar <marek.safar@gmail.com>
5792 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5793 an uninitialized variable is used.
5795 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5797 2007-06-22 Marek Safar <marek.safar@gmail.com>
5799 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5800 not found error handling.
5802 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5804 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5805 (ArrayCreation.DoResolve): Simplified.
5806 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5807 its own resolve process.
5808 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5810 2007-06-20 Marek Safar <marek.safar@gmail.com>
5812 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5815 2007-06-20 Marek Safar <marek.safar@gmail.com>
5817 * cs-tokenizer.cs: Removed var related stuff.
5819 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5820 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5821 a type and a keyword at same time.
5823 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5826 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5827 implicitly typed arrays, more changes will follow.
5829 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5831 2007-06-19 Marek Safar <marek.safar@gmail.com>
5833 * ecore.cs (VarExpr): Removed Handled field.
5835 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5836 build-in assign functionality.
5837 (ForEach.Resolve): Removed all implicitly typed local variable code and
5839 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5840 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5842 2007-06-18 Marek Safar <marek.safar@gmail.com>
5844 * assign.cs: Removed implicitly typed local variable check.
5846 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5847 referencing implicitly typed local variable.
5848 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5851 * statement.cs (Fixed): Removed unsupported implicitly typed local
5854 2007-06-15 Marek Safar <marek.safar@gmail.com>
5856 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5858 2007-06-14 Marek Safar <marek.safar@gmail.com>
5860 A fix for bugs #81855 and #76274
5861 * attribute.cs (AttachTo): Always set owner for global attributes to
5864 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5867 * cs-parser.jay: Assembly and module attributes must precede all other
5868 elements except using clauses and extern alias declarations.
5870 2007-06-13 Marek Safar <marek.safar@gmail.com>
5872 A fix for bug #81748
5874 * expression.cs: More checks for non ISO-1 features.
5876 2007-06-12 Marek Safar <marek.safar@gmail.com>
5878 A fix for bug #81807
5879 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5880 present inside switch statement and it is required by nullable check.
5882 2007-06-12 Marek Safar <marek.safar@gmail.com>
5884 A fix for bug #81840
5885 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5886 when type matching fails.
5888 * namespace.cs: Tiny error message change.
5890 2007-06-12 Marek Safar <marek.safar@gmail.com>
5892 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5893 reporting. Added automatic property check.
5895 * class.cs: Updated after CheckAbstractAndExtern relocation.
5896 (AEventPropertyAccessor.GetSignatureForError): Customized.
5898 2007-06-11 Marek Safar <marek.safar@gmail.com>
5900 * class.cs (DefineBaseTypes): Base type can be undefined.
5902 * ecore.cs (TypeLookup): Minor refactoring.
5903 (DoResolveAsTypeStep): Removed redundant check.
5905 * namespace.cs (Lookup): Removed redundant check.
5907 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5908 ResolveAsTypeTerminal step.
5909 (BootstrapCorlib_*): Simplified.
5910 (PopulateCoreType): Core types can be now external.
5912 2007-06-07 Marek Safar <marek.safar@gmail.com>
5914 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5916 (InferTypeArguments): Infers anonymous expression type arguments.
5917 (Compatible): Split to Compatible and InferTypeArguments.
5919 * lambda.cs: Updated.
5921 2007-06-08 Marek Safar <marek.safar@gmail.com>
5923 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5925 2007-06-07 Raja R Harinath <harinath@gmail.com>
5927 Fix #80477, cs0135-2.cs, cs0135-3.cs
5928 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5929 names to the "known" variables list.
5930 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5931 parameter names are also "known".
5932 (Block.CheckError136): Remove.
5933 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5936 2007-06-07 Marek Safar <marek.safar@gmail.com>
5938 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5940 2007-06-06 Marek Safar <marek.safar@gmail.com>
5942 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5943 internal error not an user error.
5945 * expression.cs (IsApplicable): Refactored to make debugging easier.
5947 * support.cs: More tricks for non-mono runtimes.
5949 * typemanager.cs (CoreLookupType): Made public.
5950 (InitSystemCore): All linq specific stuff moved to linq.cs
5952 2007-06-05 Marek Safar <marek.safar@gmail.com>
5954 * typemanager.cs (CSharpSignature): One more missing build-in types
5956 More tricks for non-mono runtime.
5958 2007-06-05 Raja R Harinath <harinath@gmail.com>
5960 * statement.cs (Block.CheckError136_InParents): Remove.
5961 (Block.AddVariable): Use GetParameterInfo instead.
5962 (ToplevelBlock.ProcessArguments): Likewise.
5964 2007-06-04 Raja R Harinath <rharinath@novell.com>
5966 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5968 (ToplevelBlock.GetParameterInfo): Split out of ...
5969 (ToplevelBlock.GetParameterRefernce): ... this.
5970 (ToplevelBlock.ParameterMap): Remove.
5971 * expression.cs (ParameterReference): Update to use
5972 ToplevelParameterInfo.
5974 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5977 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5978 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5980 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5981 (ToplevelBlock.ProcessParameters) ... here.
5982 (ToplevelBlock..ctor): Invoke it.
5984 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5987 * statement.cs (IKnownVariable): New interface.
5988 (LocalInfo): Implement it.
5989 (ToplevelParameterInfo): New class.
5990 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5991 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5992 GetKnownVariableInfo.
5994 2007-06-03 Raja R Harinath <harinath@gmail.com>
5996 Partly speed up CS0136 error checks.
5997 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5998 'recurse' parameter.
5999 (Block.DoCheckError136): Only check errors in parameters. Move
6000 local variable checks ...
6001 (Block.AddVariable): ... here, and ...
6002 (ToplevelBlock.ResolveMeta): ... here.
6004 2007-06-02 Raja R Harinath <harinath@gmail.com>
6006 * statement.cs (Block.IsChildOf): Remove.
6008 * statement.cs (Statement.Clone): Move special case code ...
6009 (Block.CloneTo): ... here.
6011 2007-05-29 Raja R Harinath <rharinath@novell.com>
6013 * statement.cs (ToplevelBlock.container): Remove field. It's
6014 redundant with 'Parent'.
6015 (ToplevelBlock.ContainerBlock): Remove accessor.
6016 (ToplevelBlock..ctor): Update to changes. Register anonymous
6017 child with parent here, ...
6018 * cs-parser.jay (end_anonymous): ... not here. Don't modify
6020 (start_anonymous): Don't save current_block.
6021 (top_current_block): Remove.
6023 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6024 (Block.Resolve): Update to changes.
6025 (Block..ctor): Move setting of "correct" 'Toplevel'
6026 and 'Explicit' fields to ...
6027 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6029 2007-05-27 Raja R Harinath <harinath@gmail.com>
6032 * statement.cs (Block.Implicit): Remove.
6033 (Block): Update to changes.
6034 * flowanalysis.cs: Likewise.
6036 Mildly speed up CheckInvariantMeaningInBlock
6037 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6038 Recursively call AddKnownVariable to all enclosing blocks.
6039 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6040 Remove recursive calls.
6041 (Block): Update to changes.
6043 New ExplicitBlock invariants
6044 * statement.cs (Block.Explicit): New field. It points to the
6045 immediately enclosing non-implicit block.
6046 (Block..ctor): Maintain the invariant.
6047 * cs-parser.jay: Take advantage of invariant.
6049 Introduce ExplicitBlock
6050 * statement.cs (ExplicitBlock): New.
6051 (ToplevelBlock): Derive from it.
6052 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6054 (Block.Implicit): Update to changes.
6055 * cs-parser.jay: Update to changes.
6058 * codegen.cs (EmitContext.IsLastStatement): Remove.
6059 * statement.cs (Block.DoEmit): Update to changes.
6061 2007-05-25 Raja R Harinath <rharinath@novell.com>
6063 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6064 modifying current_block directly.
6066 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
6068 * class.cs: Implemented automatic properties (C# 3.0)
6069 Thanks to Marek for the help.
6071 2007-05-23 Raja R Harinath <rharinath@novell.com>
6073 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6074 variable as assigned, note also that all its components are
6076 (MyBitVector.SetRange): New. Function to set multiple bits to true.
6078 2007-05-19 Marek Safar <marek.safar@gmail.com>
6080 * anonymous.cs, class.cs: Emit Compiler generated attribute when
6081 member is marked as compiler generated.
6083 * decl.cs (MemberCore): Refactored ModFlags into property.
6085 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6086 (Check): Check only accessibility modifiers.
6088 2007-05-18 Raja R Harinath <rharinath@novell.com>
6090 Track all assignable slots in one bit array
6091 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6092 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
6093 logic from VariableMap constructor here. Use the same 'offset'
6094 variable that's later used for computing offsets of local
6096 * flowanalysis.cs (UsageVector.parameters): Remove.
6097 (UsageVector): Update to changes.
6098 (VariableMap): Remove.
6100 Avoid creating ParameterMap in every block
6101 * statement.cs (Block.ParameterMap): Move ...
6102 (ToplevelBlock.ParameterMap): ... here.
6103 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6105 * flowanalysis.cs (FlowBranching.param_map): Remove.
6106 (FlowBranching.UsageVector): Update to changes.
6107 (FlowBranchingToplevel.CheckOutParameters): Likewise.
6109 * statement.cs (Block.CloneTo): Clone Toplevel field too.
6111 * expression.cs (ParameterReference): Distinguish between block
6112 where parameter was referenced and declared.
6114 2007-05-18 Marek Safar <marek.safar@gmail.com>
6116 * flowanalysis.cs, statement.cs: Put back improved error handling.
6118 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
6122 Imporved object and collection initialization (C# 3.0).
6124 2007-05-15 Marek Safar <marek.safar@gmail.com>
6126 A fix for bug #81380
6127 * expression.cs (Is.DoResolve): Only value types have constant `is'
6130 2007-05-15 Raja R Harinath <rharinath@novell.com>
6132 * statement.cs (ToplevelBlock.child): Remove.
6134 2007-05-15 Raja R Harinath <harinath@gmail.com>
6136 Rationalize ResolveMeta: refactoring
6137 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
6138 out constant handling code into ...
6139 (Block.DoResolveConstants): ... this.
6141 Rationalize ResolveMeta: kill local_map
6142 * statement.cs (Block.local_map, Block.LocalMap): Remove.
6143 (Block.AssignableSlots): New.
6144 (Block.ResolveMeta): Make protected. Don't create a VariableMap
6145 for locals -- move code from VariableMap here. Avoid unnecessary
6147 * flowanalysis.cs (FlowBranching.local_map): Remove.
6148 (FlowBranching..ctor): Use Block.AssignableSlots.
6149 (VariableMap): Remove unused constructors.
6151 2007-05-11 Raja R Harinath <rharinath@novell.com>
6153 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6155 2007-05-11 Marek Safar <marek.safar@gmail.com>
6157 * typemanager.cs (IsFriendAssembly): Should not be called for building
6160 2007-05-09 Marek Safar <marek.safar@gmail.com>
6162 * literal.cs (NullConstant): Print null in all cases.
6164 * expression.cs (Binary.ResolveOperator): Implemented delegate
6165 comparison based on C# 2.0 changes.
6167 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
6169 This code is contributed under the MIT X11 license
6171 The following enables support for several C# 3.0 language features:
6173 * cs-tokenizer.cs: Added support for the "var" keyword.
6175 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6176 Added VarExpr class to facilitate type inferencing.
6178 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6179 to support anonymous types.
6181 * assign.cs: Added support for type inferencing and initialization.
6183 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6185 * expression.cs: Added implicit array support to ArrayCreation.
6186 Added 5 types and 1 interface:
6188 IInitializable Implementing classes can inject initializing
6189 statements after object instantiation.
6191 Initializer Stores data for object initialization.
6193 AnonymousType An expression for anonymous types.
6195 AnonymousTypeParameter Stores data about an anonymous type's field.
6197 NewInitialize An expression for object initialization.
6199 CollectionInitialize An expression for collection initialization.
6201 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6204 2007-05-06 Marek Safar <marek.safar@gmail.com>
6206 A fix for bug #81500
6207 * cs-tokenizer.cs: Add special handling for coalescing operator.
6209 2007-05-06 Marek Safar <marek.safar@gmail.com>
6211 A fix for bug #81529
6212 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6213 its value from base class until it is redefined.
6215 2007-05-02 Raja R Harinath <rharinath@novell.com>
6217 Fix regression in cs0631-3.cs
6218 * cs-parser.jay (operator_declarator): Add opt_attributes to error
6219 fallback. Make error fallback catch more cases.
6221 2007-05-01 Miguel de Icaza <miguel@novell.com>
6223 * cs-parser.jay: Allow parameters in operator declarations to have
6226 2007-04-27 Miguel de Icaza <miguel@novell.com>
6228 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6231 * lambda.cs (ContextualReturn.Resolve): An expression is valid
6232 inside the ContextualReturn, it does not have to be an
6233 ExpressionStatement.
6235 2007-04-24 Miguel de Icaza <miguel@novell.com>
6237 * lambda.cs (ContextualReturn.Resolve): if the return type is not
6240 2007-04-23 Miguel de Icaza <miguel@novell.com>
6242 * anonymous.cs (AnonymousContainer): split the virtual Resolve
6243 method in two methods: ResolveNoDefine and Resolve.
6245 ResolveNoDefine will stop just after ResolveTopBlock has been
6248 Resolve will then continue by creating a method and issuing the
6249 call to method.Define ().
6251 (AnonymousMethod): Split and implement the new Resolve and
6252 ResolveNoDefine as well.
6254 * lambda.cs (LambdaExpression): Split the anonymous method
6255 resolution code into a separate routine (CoreCompatibilityTest)
6256 from DoCompatibleTest.
6258 (LambdaExpression.TryBuild): New method, this method tries to
6259 build the LambdaExpression with the given set of types to be used
6260 as the types for the various parameters of the lambda expression.
6262 If the compilation succeed with the given types, the infered type
6263 of the Anonymous method is returned, otherwise null is returned.
6265 2007-04-23 Marek Safar <marek.safar@gmail.com>
6267 A fix for bug #81414
6268 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6270 2007-04-22 Miguel de Icaza <miguel@novell.com>
6272 * cs-tokenizer.cs: Change various identifiers here from the
6273 camelCasing to the recommended Linux-like style for instance
6274 variables from the Coding Guidelines.
6276 2007-04-19 Martin Baulig <martin@ximian.com>
6279 (Convert.ImplicitReferenceConversionCore): Allow conversions from
6280 System.Enum to System.ValueType.
6282 2007-04-13 Martin Baulig <martin@ximian.com>
6284 Rewrote implicit reference conversions. We need to distinguish
6285 between implicit reference conversions (13.1.4) and implicit
6286 boxing conversions (13.1.5).
6288 According to the spec, there's an an implicit conversion
6289 "From a one-dimensional array-type S[] to IList<T> and base
6290 interfaces of this interface, provided there is an implicit
6291 reference conversion from S to T." Note that this does not
6292 include boxing conversions.
6295 (Convert.ImplicitTypeParameterBoxingConversion): New method.
6296 (Convert.ImplicitReferenceConversion): Split into
6297 ImplicitReferenceConversionCore() and
6298 ImplicitBoxingConversionExist().
6299 (Convert.ImplicitReferenceConversionExists): Use the new
6300 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6302 2007-04-12 Martin Baulig <martin@ximian.com>
6304 * convert.cs (Convert.ImplicitReferenceConversion): Move the
6305 `TypeManager.null_type' checks up to the top of the method.
6307 2007-04-11 Marek Safar <marek.safar@gmail.com>
6309 A fix for bug #81350
6310 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6313 2007-04-11 Martin Baulig <martin@ximian.com>
6315 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6316 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6317 to make this work for generic classes; fixes #79561.
6319 2007-04-11 Martin Baulig <martin@ximian.com>
6321 * expression.cs (As): Add support for nullable types; fixes #79371.
6323 2007-04-11 Martin Baulig <martin@ximian.com>
6325 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6326 `type.FullName' is null; fixes #80243.
6328 2007-04-11 Martin Baulig <martin@ximian.com>
6330 * expression.cs (Invocation.IsApplicable): Don't modify the method
6331 if type inference succeeded, but the method was not applicable.
6334 2007-04-10 Marek Safar <marek.safar@gmail.com>
6336 A fix for bug #81324
6337 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6338 internal and external namespaces containers.
6340 2007-04-10 Martin Baulig <martin@ximian.com>
6342 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6343 TypeManager.DropGenericMethodArguments() so we also call
6344 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
6346 2007-04-10 Martin Baulig <martin@ximian.com>
6348 * iterators.cs (Iterator.CreateIterator): Don't crash if
6349 `method.ReturnType' is null. This happens if something went wrong
6350 while resolving that typ (we already reported an error in this case).
6352 2007-04-10 Martin Baulig <martin@ximian.com>
6354 * expression.cs (New.DoResolve): Don't call CheckComImport() on
6355 generic interfaces; report the CS0144 directly.
6357 2007-04-10 Martin Baulig <martin@ximian.com>
6359 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6360 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6362 2007-04-10 Martin Baulig <martin@ximian.com>
6364 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6366 2007-04-09 Raja R Harinath <rharinath@novell.com>
6369 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6370 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6373 * statement.cs (For.Resolve): If resolution fails, use
6376 2007-04-08 Marek Safar <marek.safar@gmail.com>
6378 * anonymous.cs (MakeName): Make faster and zero-based.
6379 (VerifyExplicitParameterCompatibility): Back to mode where generic
6380 parameter is ignored.
6381 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6383 * class.cs (EmitType): Method can emit another new method.
6385 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6387 * driver.cs: Updated.
6389 * lambda.cs: Reuse predefined empty parameters.
6391 * parameter.cs: Updated
6393 * support.cs: Implemented InflateTypes.
6395 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6396 (InitSystemCore): Introduced to isolate 3.0 dependencies.
6398 2007-04-03 Martin Baulig <martin@ximian.com>
6402 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6403 version of TypeManager.IsOverride() which also works with generic
6406 2007-04-03 Martin Baulig <martin@ximian.com>
6411 (Convert.ExplicitReferenceConversion): We need to cast when
6412 converting from IList<T> to S[].
6414 2007-04-01 Marek Safar <marek.safar@gmail.com>
6416 * decl.cs (FindExtensionMethods): Consider all candidates with same name
6419 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6421 2007-03-31 Marek Safar <marek.safar@gmail.com>
6423 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6424 argument and return type inferring.
6426 * codegen.cs (InferReturnType): Flag whether return can be inferred.
6427 (ReturnType): Turned to property.
6429 * statement.cs (Return): Implemented return type inferring.
6431 * support.cs (ReflectionParameters): Use local types if possible.
6433 2007-03-30 Raja R Harinath <rharinath@novell.com>
6435 * flowanalysis.cs (FlowBranching.Reachability): Remove.
6436 (FlowBranching.UsageVector): Update to changes.
6438 Prepare to kill 'Reachability'
6439 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6440 argument of constructor.
6442 2007-03-29 Raja R Harinath <rharinath@novell.com>
6444 Prepare to kill 'Reachability'
6445 * flowanalysis.cs (UsageVector.is_unreachable): New.
6446 (UsageVector): Update to maintain 'is_unreachable' in parallel to
6447 'reachability', and verify they're consistent.
6450 * expression.cs (New.EmitStatement): Handle type parameters here too.
6452 2007-03-29 Martin Baulig <martin@ximian.com>
6457 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6458 CompilerGeneratedClass.
6459 (ScopeInfo.EmitScopeInstance): Make this protected.
6460 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6461 `ec.CurrentAnonymousMethod.Scope == Scope'.
6463 * statement.cs (Block.ScopeInfo): Make this a property.
6465 2007-03-27 Raja R Harinath <harinath@gmail.com>
6467 Prepare to kill 'Reachability'
6468 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6469 (FlowBranching.UsageVector.Reachability): Remove property.
6470 (FlowBranching.UsageVector.IsUnreachable): New property.
6471 (FlowBranching.UsageVector.ResetBarrier): New.
6472 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6473 * codegen.cs, statement.cs: Update to changes.
6475 2007-03-27 Martin Baulig <martin@ximian.com>
6480 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6483 2007-03-26 Raja R Harinath <rharinath@novell.com>
6485 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6486 instead of TriState. Remove all mention of TriState.
6488 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6489 replaced by a boolean. Add boolean 'is_unreachable' field, check
6490 and maintain invariants.
6492 2007-03-25 Marek Safar <marek.safar@gmail.com>
6494 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6496 2007-03-25 Marek Safar <marek.safar@gmail.com>
6498 * expression.cs: Stop using obsolete 2.0 opcodes.
6500 2007-03-25 Marek Safar <marek.safar@gmail.com>
6502 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6503 one of the latests Martin's fixes.
6505 2007-03-23 Miguel de Icaza <miguel@novell.com>
6507 * expression.cs: On BigEndian systems, swap the bytes, temporary
6508 solution until we get a new bitconverter class.
6510 2007-03-23 Martin Baulig <martin@ximian.com>
6514 * decl.cs (MemberCache.AddMembers): Add generic methods both as
6515 "Method" and "Method`1". Normally, a cache lookup is done on the
6516 "Method" form (ie. without the generic arity), but this one makes
6517 lookups on the full form work as well.
6519 2007-03-22 Raja R Harinath <rharinath@novell.com>
6521 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6524 2007-03-20 Bill Holmes <billholmes54@gmail.com>
6526 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6527 ordered_member_list, to TypeBuilder to store members to be defined
6528 in the order they were parsed in.
6529 - ordered_explicit_member_list contains all properties indexers
6530 and methods that are defined as explicit implementation of an
6531 interface or base class.
6532 - ordered_member_list contains all properties indexers and methods
6533 that are not defined as explicit implementation of an interface
6536 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
6537 functionality in these removed classes has been replaced with
6538 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
6539 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6541 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6542 to CheckForDuplications inside GetMethod and SetMethod Define Method
6543 to handle method property and indexer name conflicts.
6547 All code is contributed under the MIT/X11 license.
6549 2007-03-20 Martin Baulig <martin@ximian.com>
6551 * class.cs (TypeContainer.Interfaces): Removed; they're now
6552 included in `TypeContainer.Types'.
6554 2007-03-20 Martin Baulig <martin@ximian.com>
6556 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
6558 * class.cs (TypeContainer.CreateType): New public method. This is
6559 now called before DefineType() to create the TypeBuilders.
6560 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6561 has already been created by CreateType().
6562 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6563 don't resolve our base classes here; this has been moved into
6564 DefineBaseTypes(). We're now called from CreateType().
6565 (TypeContainer.DefineBaseTypes): New private method; resolve our
6566 base classes here. We're now called from DefineType().
6569 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6570 our types first to create all the TypeBuilders. After that, call
6571 TypeContainer.DefineType() on all the types which'll resolve their
6572 base classes and setup the resolve order.
6574 2007-03-20 Martin Baulig <martin@ximian.com>
6576 * class.cs (TypeContainer.Enums): Removed; they're now included in
6577 `TypeContainer.Types'.
6579 2007-03-20 Martin Baulig <martin@ximian.com>
6582 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6583 (TypeContainer.DoResolveMembers): Call DefineType() on our
6584 `compiler_generated' classes; moved here from DefineNestedTypes().
6587 (RootContext.ResolveTree): Call ResolveMembers() on all
6588 TypeContainer's in the `type_container_resolve_order'.
6590 2007-03-19 Marek Safar <marek.safar@gmail.com>
6592 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6594 2007-03-17 Marek Safar <marek.safar@gmail.com>
6596 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6597 implementation flags.
6599 2007-03-17 Marek Safar <marek.safar@gmail.com>
6601 * class.cs: More optimizations for type parameters.
6603 2007-03-15 Marek Safar <marek.safar@gmail.com>
6605 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6607 * ecore.cs, parameter.cs: More common code for both corlibs.
6609 * typemanager.cs (IsGenericMethod): Simplified.
6611 2007-03-15 Raja R Harinath <rharinath@novell.com>
6613 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6615 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6617 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6618 unconditionally. Simplify explanation.
6619 (Try.Resolve, Using.Resolve): Likewise.
6621 2007-03-15 Martin Baulig <martin@ximian.com>
6625 * decl.cs (DeclSpace): If we're a partial class, use our
6626 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6628 2007-03-15 Raja R Harinath <rharinath@novell.com>
6630 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6632 (FlowBranching.UsageVector): Update to changes.
6633 (FlowBranching.MergeSiblings): Likewise.
6634 * statement.cs: Likewise.
6636 2007-03-15 Martin Baulig <martin@ximian.com>
6641 (MemberCache): Added a special .ctor for type parameters.
6644 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6647 2007-03-09 Martin Baulig <martin@ximian.com>
6649 * enum.cs (Enum): Make this a TypeContainer.
6650 (EnumMember): Derive from `Const'.
6653 (Const.DoResolveValue): New protected virtual method; move most of
6654 the functionality of ResolveValue() here so we can override it in
6656 (Const.CreateConstantReference): Make this virtual.
6658 * class.cs (Kind): Add `Kind.Enum'.
6659 (TypeContainer.Emit): Don't emit the enums here; they're already
6660 in the `RootContext.typecontainer_resolve_order'.
6662 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6663 here; they're already in the `typecontainer_resolve_order'.
6665 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6666 TypeManager.DropGenericTypeArguments().
6669 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6670 (TypeManager.IsEnumType): Likewise.
6671 (TypeManager.EnumToUnderlying): Likewise.
6672 (TypeManager.IsEqual): Add support for enums.
6674 2007-03-12 Raja R Harinath <rharinath@novell.com>
6676 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6677 DefaultParameterValueAttribute to be undefined, say if System.dll
6680 2007-03-11 Marek Safar <marek.safar@gmail.com>
6682 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6685 2007-03-10 Marek Safar <marek.safar@gmail.com>
6687 * class.cs, parameter.cs: Unified parameters verification.
6689 2007-03-08 Martin Baulig <martin@ximian.com>
6691 * cs-parser.jay (constructor_header): Pass the location to the
6692 newly created TopLevelBlock.
6694 2007-03-07 Martin Baulig <martin@ximian.com>
6696 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6698 2007-03-06 Miguel de Icaza <miguel@novell.com>
6700 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6701 with the changes from David, fixes the build.
6703 2007-03-05 David Mitchell <dmitchell@logos.com>
6705 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6706 and its base interfaces to a one-dimensional array type S[],
6707 provided there is an implicit or explicit reference conversion
6710 2007-03-03 Marek Safar <marek.safar@gmail.com>
6712 * cs-tokenizer.cs: Implemented basic linq grammar.
6714 * driver.cs: Set linq lang version on demand.
6716 2007-02-26 Marek Safar <marek.safar@gmail.com>
6718 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6720 2007-02-25 Marek Safar <marek.safar@gmail.com>
6722 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6725 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6727 Check property and event extern attributes.
6729 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6732 2007-02-24 Marek Safar <marek.safar@gmail.com>
6734 A fix for bug #80407
6735 * ecore.cs: Don't report ambiguity error when methods have same parent.
6737 2007-02-23 Marek Safar <marek.safar@gmail.com>
6739 A fix for bug #80878
6740 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6742 2007-02-22 Marek Safar <marek.safar@gmail.com>
6744 * attribute.cs: Enable ExtensionAttribute presence test.
6746 2007-02-22 Marek Safar <marek.safar@gmail.com>
6748 * class.cs: Warn about missing GetHashCode only when Equals is override.
6750 * decl.cs: Check accessibility of type arguments.
6752 * typemanager.cs: Correctly report nullable array.
6754 2007-02-20 Marek Safar <marek.safar@gmail.com>
6756 * class.cs, report.cs: Capture more details when things go wrong.
6758 2007-02-20 Marek Safar <marek.safar@gmail.com>
6760 A fix for bug #80650
6761 * cs-parser.jay: Anonymous container starts at constructor declaration
6762 and not at block beginning because it has to be usable in constructor
6765 * statement.cs: Use context location and not block one for error reporting.
6767 2007-02-18 Marek Safar <marek.safar@gmail.com>
6769 A fix for bug #78712
6770 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6773 2007-02-18 Marek Safar <marek.safar@gmail.com>
6775 A fix for bug #80493 by Atsushi Enomoto
6776 * cs-parser.jay: Ignore invalid attribute target.
6778 2007-02-18 Marek Safar <marek.safar@gmail.com>
6780 * cs-tokenizer.cs: Ignore '\0' as white space character.
6782 2007-02-17 Miguel de Icaza <miguel@novell.com>
6784 * cs-parser.jay: Add support for lambda expressions to the mcs
6787 * lambda.cs: Only clone when we are probing, not on the final call
6788 (Compatible is the final call).
6790 * statement.cs (CloneContext): Introduce class to provide block
6791 remapping during clone.
6793 All statements Clone themselves now.
6795 (Clone): special handling for blocks, when we clone a block, we
6796 register the block inside this routine, as children of the block
6797 might trigger a lookup.
6799 * expression.cs: Add support for CloneContext in all expressions.
6801 2007-02-17 Marek Safar <marek.safar@gmail.com>
6803 A fix for bug #80493
6804 * statement.cs: Report ambiguous warning when interfaces are not related.
6806 2007-02-15 Marek Safar <marek.safar@gmail.com>
6808 C# 3.0 extension methods.
6810 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6811 cannot be used directly.
6813 * class.cs (Class.Emit): Emit extension attribute if any class method
6814 is extension method.
6815 (Method.Define): Add basic extension method validation conditions.
6816 (Method.Emit): Emit extension attribute for method.
6818 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6819 extension method exists. Currently we follow same approach as Microsoft
6820 does, emit even if a method or a class are private but this can change
6823 * cs-parser.jay: Add handling of `this' keyword in method parameters
6826 * decl.cs (DeclSpace.IsStaticClass): New property.
6827 (MemberCache.FindExtensionMethods): Looks for extension methods with
6828 defined name and extension type.
6830 * doc.cs: Updated after OverloadResolve changes.
6832 * driver.cs: Add new soft reference to System.Core.dll.
6834 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6835 (ExtensionMethodGroupExpr): Represents group of extension methods.
6837 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6838 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6839 to MethodGroupExpr and made non-static for easier customization.
6840 (Invocation.DoResolve): Add extension method lookup when no standard
6842 (MemberAccess.DoResolve): Try extension methods if no member exists.
6844 * modifiers.cs: Add METHOD_EXTENSION modifier.
6846 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6847 as well as candidate extension type.
6848 (ComputeNamespaces): When assembly constains extension methods registers
6850 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6851 extension method lookup.
6852 (Namespace.LookupExtensionMethod): Looks for extension method in this
6854 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6855 find a method which matches name and extensionType.
6857 * parameter.cs (Parameter): Add This modifer.
6858 (HasExtensionMethodModifier): New property.
6859 (Resolve): Add extension parameter check.
6860 (ModFlags): turned to property to exclude this modifier as it is not real
6862 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6864 * support.cs (ParameterData): Add ExtensionMethodType.
6865 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6867 * typemanager.cs: Add type and ctor extension attribute type.
6869 2007-02-15 Miguel de Icaza <miguel@novell.com>
6871 * report.cs (DisableErrors, EnableErrors): used to prevent error
6872 output when we are "trying" to compile various methods with
6875 * ecore.cs (Expression): Add Clone method that calls the virtual
6876 CloneTo method. The current CloneTo method in Expression throws
6877 an exception so we can track down all the places where this must
6878 be implemented (not using abstract, because that would be a lot of
6879 up-front-work before we can start testing the implementation
6882 Important: we only need Clone capabilities for expressions created
6883 by the parser, as the expressions we will be cloning are
6884 expressions in the pre-resolved state. This vastly simplifies
6887 (SimpleName): Add CloneTo that does nothing.
6888 (EmptyCast): Add CloneTo.
6890 * expression.cs (Binary): Implement CloneTo.
6891 (Invocation.IsApplicable): Store the current ec in
6892 EmitContext.TempEc and restore it on return. This is used so we
6893 do not have to sprinkle hundres of methods with an extra
6894 EmitContext, we know that the only user is the lambda expression
6895 ImplicitConversionExists code.
6897 (Argument): Add Cloning capabilities.
6898 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6899 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6900 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6901 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6902 IndexerAccess): Add Clone capability.
6904 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6906 (Argument): Add cloning capability.
6908 * assign.cs (Assign): Implement CloneTo.
6910 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6912 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6913 version by calling Convert with the EmitContext (that we are
6914 currently storing in ec, this is not great, but will do for now,
6915 to avoid passing EmitContext parameters to hundreds of functions
6916 that do not need them now).
6918 (SetExpression): Remove, it is not needed.
6920 (ContextualReturn): Implement CloneTo.
6922 * statement.cs (Statement): Implement cloning infrastructure,
6923 similar to expressions.
6925 (Block): Partial implementation of Clone for statements.
6927 (Return): Implement clone.
6929 * constant.cs (Constant.CloneTo): New method, does nothing.
6931 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6932 solution, until we decide how to exactly do this.
6934 2007-02-14 Marek Safar <marek.safar@gmail.com>
6936 A fix for bug #80493
6937 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6938 a property is override we need to use second accessor.
6940 2007-02-13 Marek Safar <marek.safar@gmail.com>
6942 A fix for bug #80418
6943 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6946 2007-02-13 Marek Safar <marek.safar@gmail.com>
6948 Another fix for bug #80749
6949 * pending.cs: Abstract class has priority over interfaces.
6951 2007-02-13 Marek Safar <marek.safar@gmail.com>
6953 Another fix for bug #80749
6954 * pending.cs: Abstract class has priority over interfaces.
6956 2007-02-13 Marek Safar <marek.safar@gmail.com>
6958 Another fix for bug #80749
6959 * pending.cs: Abstract class has priority over interfaces.
6961 2007-02-13 Marek Safar <marek.safar@gmail.com>
6963 Another fix for bug #80749
6964 * pending.cs: Abstract class has priority over interfaces.
6966 2007-02-13 Marek Safar <marek.safar@gmail.com>
6968 * class.cs Better error message.
6970 * driver.cs: Add shorter versions of -optimize option.
6972 2007-02-13 Martin Baulig <martin@ximian.com>
6974 * class.cs (Constructor.Emit): Check the return value of
6975 ec.ResolveTopBlock() and return on error.
6977 2007-02-13 Raja R Harinath <rharinath@novell.com>
6979 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6980 message to fix error message regression.
6982 2007-02-12 Marek Safar <marek.safar@gmail.com>
6984 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6986 2007-02-12 Marek Safar <marek.safar@gmail.com>
6988 A fix for bug #80749
6989 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6990 its parent container.
6992 * class.cs (DefineFieldInitializers): Each initializer can has different
6995 * const.cs: Updated.
6997 2007-02-11 Miguel de Icaza <miguel@novell.com>
6999 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7000 now all the heavy lifting to check that embedded statements or
7001 expressions have the right form is done in the ContextualReturn.
7003 (ContextualReturn): New class.
7005 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7006 method that can be invoked to report 201, so we do not replicate
7009 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7011 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7012 treating tabs as spaces.
7014 2007-02-09 Marek Safar <marek.safar@gmail.com>
7016 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7017 * assign.cs: Use full implicit conversion for right side check.
7019 2007-02-09 Marek Safar <marek.safar@gmail.com>
7021 * statement.cs (Switch): Switch over boolean type is not standardized.
7023 2007-02-08 Marek Safar <marek.safar@gmail.com>
7025 A fix for bug #80755
7026 * decl.cs (FindBaseEvent): Don't use method cache for events.
7028 2007-02-07 Marek Safar <marek.safar@gmail.com>
7030 * cs-parser.jay: Better syntax error handling.
7032 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7033 instead of underlying type value.
7035 2007-02-06 Marek Safar <marek.safar@gmail.com>
7037 * driver.cs: Check define identifier before is registered.
7039 * namespace.cs: Use existing error message.
7041 * report.cs: New warning.
7043 2007-02-06 Marek Safar <marek.safar@gmail.com>
7045 A fix for bug #80742
7046 * expression.cs: Delegate Invoke method can be called directly.
7048 2007-02-06 Marek Safar <marek.safar@gmail.com>
7050 A fix for bug #80676
7051 * class.cs (IsEntryPoint): The Main method can have params modifier.
7053 2007-02-04 Miguel de Icaza <miguel@novell.com>
7055 * parameter.cs (Parameter, Parameters): Add Clone method.
7057 * anonymous.cs (Compatible): Turn method into virtual method, so
7058 LambdaExpression can implement a different behavior.
7060 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7061 out the basic checking here, so it can be used by
7064 * lambda.cs: Introduce "Compatible" function that will do the
7067 2007-02-02 Marek Safar <marek.safar@gmail.com>
7069 * attribute.cs: Unified one error message.
7071 * class.cs (Class): Use type attributes and not properties to test static
7073 (IsEntryPoint): Don's pass local variable.
7075 * convert.cs: Removed duplicate check.
7077 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7079 * driver.cs: Don't crash when soft reference does not exist.
7081 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7082 (UsingEntry): Removed redundant allocation.
7084 * parameter.cs: Add fast path for type parameters.
7086 * support.cs: Don't allocate attribute when it's not used.
7088 2007-01-30 Miguel de Icaza <miguel@novell.com>
7091 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7092 this into a virtual method, so we can override it in LambdaExpression.
7094 * driver.cs: Improve diagnostics in case of failure.
7096 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7097 write a function that is slightly more complex and that parses:
7099 type identifier [, type identifier]* )
7101 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7104 (canEmpty ? i >= 0 : i > 0)
7106 2007-01-30 Raja R Harinath <rharinath@novell.com>
7108 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7109 exception on possibly valid code.
7111 2007-01-29 Raja R Harinath <rharinath@novell.com>
7113 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7115 (parse_opt_type_arguments): Remove. It's almost the same as
7117 (parse_namespace_or_typename): Use parse_less_than.
7119 2007-01-28 Miguel de Icaza <miguel@novell.com>
7121 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7122 this bug took a few hours to find, because the state saved and
7123 restored by PushPosition and PopPosition was ignoring the state of
7124 parse_generic_less_than.
7126 I can also now remove the handling of OP_LT and OP_GT, this solves
7129 * cs-tokenizer.cs: store the location for the ARROW token, we use
7132 (PushPosition, PopPosition): save/restore also `current_token',
7133 restore `parse_generic_less_than' (was missing).
7135 (parse_opt_type_arguments): use parse_type, not
7136 parse_namespace_or_typename to parse types.
7138 * lambda.cs: Empty new file, will eventually have the lambda
7139 expression implementation.
7141 * lambda.test: used to test the internal tokenizer.
7143 * report.cs (FeatureIsNotISO1): Rename from
7144 FeatureIsNotStandardized, because it was about the language level
7145 (1 vs 2) it was not about standarization.
7147 (FeatureRequiresLINQ): New.
7149 * support.cs (SeekableStreamReader): Only require that the reader
7150 is a TextReader, not a StreamReader, so we can plug StringReader.
7152 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7153 given position in the input stream the following tokens can be
7154 parsed as a type followed by an identifier.
7156 (is_punct): after a '(' if parse_type_and_parameter returns true,
7157 then return a special token OPEN_PARENS_LAMBDA which is used to
7158 avoid reduce/reduce errors in the grammar for the
7159 lambda_expression rules.
7161 (parse_type): implement a type parser inside the
7162 tokenizer, the parser only returns true or false depending on
7163 whether the input at a given position can be parsed as a type.
7165 (peek_token): new method used during type parsing.
7167 2007-01-28 Raja R Harinath <rharinath@novell.com>
7170 * anonymous.cs (ScopeInfo.InflateParameters): New.
7171 (AnonymousContainer.Resolve): Use it to redirect types of
7172 delegate parameters.
7174 2007-01-27 Raja R Harinath <rharinath@novell.com>
7177 * expression.cs (Error_InvalidArguments): Don't use two different
7178 messages for CS1503. Use ExtraInformation and
7179 SymbolRelatedToPreviousError instead.
7182 * decl.cs (DeclSpace.initialize_type_params): Don't access
7183 'type_params' of a partial class directly.
7185 2007-01-26 Miguel de Icaza <miguel@novell.com>
7187 * constant.cs: Removed a handful of out-of-range checks that were
7190 2007-01-25 Marek Safar <marek.safar@gmail.com>
7192 * expression.cs (CheckUselessComparison): Add additional check for char
7195 * namespace.cs: Fixed typo.
7197 2007-01-23 Miguel de Icaza <miguel@novell.com>
7199 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7200 gone, instead we inline the test, preventing the needless casts to
7201 longs, ulongs and doubles for the parameters, avoiding calls to
7202 methods that overchecked stuff, and instead inlined things
7205 2007-01-20 Marek Safar <marek.safar@gmail.com>
7207 * cs-parser.jay: Better parameter error handling.
7209 2007-01-17 Marek Safar <marek.safar@gmail.com>
7211 A fix for bug #80368, #80522
7212 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7213 whether array initializer contains constants only.
7214 (ArrayCreation.Emit): Use better formula to decide when
7215 are array initializers for static initialization.
7216 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7217 have to emit even constants otherwise they are pre-initialized.
7219 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
7220 Raja R Harinath <rharinath@novell.com>
7222 Fix emit order of 'get' vs. 'set'.
7223 * support.cs (Accessors): New.
7224 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7225 Note the order in which accessors are declared in the source.
7226 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7227 Refactored from Property.Define and Indexer.Define.
7228 (PropertyBase.DefineAccessors): New helper that calls the above in
7229 appropriate order as noted by the parser.
7230 (Property.Define, Indexer.Define): Update to changes.
7231 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7233 2007-01-17 Raja R Harinath <rharinath@novell.com>
7235 Fix cs0029-6.cs and gcs0029-2.cs (regression)
7236 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7237 there's an implicit conversion from the current type to the target
7238 type before converting the underlying constant.
7240 2007-01-16 Marek Safar <marek.safar@gmail.com>
7242 * const.cs (ResolveValue): Updated after constant conversion was made more
7245 * constant.cs (GetAttributableValue): constant to object conversion is
7246 used for attributes only.
7247 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7248 constant conversions.
7249 (LongConstant.ConvertImplicitly): Ditto.
7251 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7252 (ImplicitConversionStandard): Handle constant conversion as extra step.
7253 It solves the issue when constant conversion was called indirectly like
7254 inside array initializer and constant folding was skipped.
7256 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7259 * statement.cs(ImplicitConversionStandard): Updated after constant
7260 conversion was made more generic.
7262 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
7264 * expression.cs (As.DoResolve): Use GenericConstraints instead of
7265 Constraints, solves the problem where the compiler incorrectly
7266 reported that a type parameter was not constrained to a class (Bug
7269 2007-01-14 Marek Habersack <grendello@gmail.com>
7271 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7273 2007-01-14 Marek Safar <marek.safar@gmail.com>
7275 A fix for bug #80368
7276 * assign.cs (FieldInitializer): New class implements field
7277 initializer statement.
7279 * attribute.cs: Update after FieldMember rename.
7281 * class.cs (PropertyBasedMember): New common class for property based
7283 (InterfaceMemberBase): New base class for all members which can be used as
7284 an interface members.
7285 (MethodCore): Moved really common code to InterfaceMemberBase.
7286 (Method.Define): Equal and GetHasCode detection is relevant for methods
7288 (MethodData.Define): Don't assume that public event implements an
7289 interface automatically.
7290 (MethodData.DefineMethodBuilder): Issue an error even if only extern
7292 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7293 (FieldMember): Merged with FieldBase.
7294 (EventProperty.AEventPropertyAccessor): New specialization to check whether
7295 event extern modifier can be used.
7296 (EventField.EventFieldAccessor): Moved event field specific code here.
7297 (Event.AllowedModifiers): Even event can be extern.
7298 (Event.FindOutBaseMethod): New override specific to events.
7299 (Indexer.parameters): Reintroduce parameters because base class holds
7300 only properties common data.
7301 (Indexer.CheckForDuplications): Indexers are threated as methods so we
7302 need do extra parameters check.
7304 * const.cs: Update after FieldMember rename.
7306 * decl.cs (MemberCache.FindBaseEvent): New method.
7308 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7309 to reflect that indexer is now derived from PropertyBased.
7311 * ecore.cs (GetMemberType): Made public.
7312 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7315 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7317 * typemanager.cs (CSharpSignature): Correctly print event accessors.
7318 (RegisterEvent): Removed.
7319 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7320 (GetPrivateFieldOfEvent): Renamed to GetEventField.
7322 2007-01-11 Raja R Harinath <rharinath@novell.com>
7325 * statement.cs (CollectionForeach.TryType): Prefer generic
7326 GetEnumerator over non-generic variant. Fix code to follow comments.
7328 2007-01-09 Raja R Harinath <rharinath@novell.com>
7331 * support.cs (ReflectionParameter): Don't use an invalid index on
7332 the generic parameter data.
7334 2007-01-08 Miguel de Icaza <miguel@novell.com>
7336 * driver.cs: Just add a tiny bit of infrastructure.
7338 2007-01-02 Marek Safar <marek.safar@gmail.com>
7340 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7341 where field type is struct from current assembly.
7343 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7346 2007-01-02 Marek Safar <marek.safar@gmail.com>
7348 A fix for bug #80381
7349 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7352 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7354 (Namespace.LookupType): Always use core types from corlib when speficied.
7356 * report.cs: A new warning.
7358 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7359 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7360 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7362 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7363 (InitCoreTypes): Set expression type of object_type and value_type
7364 immediately after lookup.
7366 2007-01-01 Miguel de Icaza <miguel@novell.com>
7368 * cs-tokenizer.cs: Accept Pc class characters (Connector
7369 Punctuation) as valid identifiers. Fixes #78259
7371 * expression.cs (Invocation.DoResolve): Moved the check for the
7372 use of `this' for doing method calls to the Invocation resolution
7373 step, after overload resolution has taken place instead of doing
7374 the check at the low-level `This.DoResolve' level.
7376 The `This.DoResolve'(appens before overload resolution, so it has
7377 no way of knowing if the method that will be called will be
7378 instace or static, triggering an erroneous report for cs0188 (Bug
7381 We now do the check for instance method invocations after we know
7382 what method will be called.
7384 (This.CheckThisUsage): Move the actual use of this structure
7385 checking into its own method and expose it.
7387 * Everywhere that called Error_ValueCannotBeConverted: pass a new
7390 Exceptions: Null.ConvertImplicitly,
7391 Constant.ImplicitConversionRequired as there are too many call
7392 sites for passing the ec.
7394 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7395 EmitContext, if the value is null, then we do not try to provide
7396 the extra information from the error (If a userdefined conversion
7397 exists, as UserDefinedConversion requires a non null-EmitContext).
7401 2006-12-30 Raja R Harinath <rharinath@novell.com>
7403 * flowanalysis.cs (MyBitVector): Document some invariants.
7404 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7405 introduced below, and add a couple of others,
7407 2006-12-30 Marek Safar <marek.safar@gmail.com>
7409 * attribute.cs (GetMethodObsoleteAttribute): Uses new
7410 GetPropertyFromAccessor and GetEventFromAccessor.
7412 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7413 overrides non-obsolete one.
7414 (Indexer.Define): Error message has been moved to the parser.
7416 * cs-parser.jay: Better syntax errors handling.
7418 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7419 when an invocation has no arguments.
7421 * ecore.cs: Removed not used caching.
7423 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7426 * report.cs: Add a new warning.
7428 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7430 * typemanager.cs (enumeration_type): Removed.
7431 (CSharpSignature): Reuses IsSpecialMethod.
7432 (IsEqual): Hack for MS BCL.
7433 (GetPropertyFromAccessor): New method.
7434 (GetEventFromAccessor): New method.
7435 (IsSpecialMethod): Fixed to handle more cases.
7437 2006-12-30 Marek Safar <marek.safar@gmail.com>
7439 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7440 Made white spaces array static.
7442 * ecore.cs (RemoveGenericArity): Optimized.
7444 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7446 (MyBitVector.initialize_vector): Simplified.
7448 2006-12-22 Miguel de Icaza <miguel@novell.com>
7450 * ecore.cs: Am not entirely happy with this hack, but it seems to
7451 address the issue in 80257 (a small test case for
7454 I set the MethodGroupExpr.Type to an internal compiler type
7455 (itself in this case) to force the resolution to take place. Why
7456 it does not take place with a null is beyond me.
7458 2006-12-20 Marek Safar <marek.safar@gmail.com>
7460 A fix for bug #80288
7461 * expression.cs (ResolveOperator): Consider user defined conversion for
7462 logical and operator too.
7463 (EmitBranchable): Optimization for logical and when full constant folding
7464 could not be applied but one operand is constant.
7466 2006-12-19 Marek Safar <marek.safar@gmail.com>
7468 * class.cs (GetClassBases): Write 5 times every day, will never use
7469 FullName for error reporting.
7471 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7473 2006-12-19 Martin Baulig <martin@ximian.com>
7475 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7476 the symbol file info here.
7478 2006-12-18 Marek Safar <marek.safar@gmail.com>
7480 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7481 of `elseif' is taking then following sections are not taking.
7482 Fixes an issue reported on mono mailing list.
7484 2006-12-18 Marek Safar <marek.safar@gmail.com>
7486 A fix for bug #80300
7487 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7488 a caller is not taking.
7490 2006-12-18 Raja R Harinath <rharinath@novell.com>
7492 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7493 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7494 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7495 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7496 * class.cs: Update to changes.
7498 2006-12-17 Marek Safar <marek.safar@gmail.com>
7500 A fix for bug #79934
7501 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7504 * class.cs (ResolveMembers): Register an iterator in current container and
7507 2006-12-16 Raja R Harinath <rharinath@novell.com>
7510 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7511 satisfy a params annotated parameter.
7513 2006-12-16 Marek Safar <marek.safar@gmail.com>
7515 A fix for bug #77014
7516 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7517 paramters correctly and not rely on hacks in Parameters class.
7518 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7520 (Invocation.VerifyArgumentsCompat): Ditto.
7521 (Invocation.EmitArguments): Changed to correctly emit params arguments at
7524 * parameter.cs (HasParams): Don't assume that params is the last one.
7526 * support.cs (ReflectionParameters.ctor): Look for params attribute
7528 (ReflectionParameters.ParameterType): Removed hack when we returned last
7529 parameter for out of range parameters.
7530 (ParameterName, ParameterModifier): Ditto.
7532 2006-12-14 Marek Safar <marek.safar@gmail.com>
7534 A fix for bug #79987
7535 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7536 when assembly is not CLS compliant but type is. I have no idea why is this
7539 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7541 2006-12-13 Miguel de Icaza <miguel@novell.com>
7543 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7544 in struct constructors, they are basically no-ops.
7546 2006-12-12 Marek Safar <marek.safar@gmail.com>
7548 * cs-tokenizer.cs (Position): Save preprocessor status too.
7550 2006-12-12 Marek Safar <marek.safar@gmail.com>
7552 A fix for bug #77794
7553 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7555 2006-12-12 Marek Safar <marek.safar@gmail.com>
7557 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7559 (pp_expr): Report error for an invalid expression.
7560 (handle_preprocessing_directive): Simplified; add more error checking.
7562 2006-12-11 Marek Safar <marek.safar@gmail.com>
7564 A fix for bug #74939
7565 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7566 directives handling.
7568 2006-12-10 Marek Safar <marek.safar@gmail.com>
7570 A fix for bugs #80093, and #75984
7571 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7572 logic, it seems to me as it worked before "by coincidence".
7573 (xtoken): Simplified to use reworked handle_preprocessing_directive.
7574 (cleanup): Enabled endif check.
7576 2006-12-09 Marek Safar <marek.safar@gmail.com>
7578 A fix for bug #80162
7579 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7580 enumerators are never ambiguous.
7582 2006-12-08 Raja R Harinath <rharinath@novell.com>
7585 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7587 2006-12-06 Marek Safar <marek.safar@gmail.com>
7589 A fix for bug #80144
7590 * class.cs (EventProperty.Define): Explicit implementation means
7591 that an even is used.
7593 2006-12-06 Marek Safar <marek.safar@gmail.com>
7595 Fixes the operators implementation (part II)
7597 * cfold.cs (DoConstantNumericPromotions): Renamed to
7598 DoBinaryNumericPromotions and simplified.
7599 (BinaryFold): Couple of conversion fixes; simplified.
7601 * constant.cs, ecore.cs, literal.cs
7602 (ToType): Renamed to ConvertImplicitly.
7603 (Reduce): Renamed to ConvertExplicitly.
7605 * class.cs, convert.cs: Updated.
7607 * expression.cs: TryReduce doesn't throw an exception.
7609 2006-12-01 Marek Safar <marek.safar@gmail.com>
7611 A fix for bug #80108
7612 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7615 2006-11-30 Marek Safar <marek.safar@gmail.com>
7617 Fixes unary operators implementation (part I)
7620 * cfold.cs (Error_CompileTimeOverflow): Made internal
7622 * const.cs (IConstant): Changed to use reference to constant and
7623 not constant itself.
7624 Updated IConstant implementations.
7626 * constant.cs (CreateConstant): New factory method.
7627 Updated IConstant implementation.
7629 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7631 * ecore.cs: Updated to use CreateConstantReference.
7633 * enum.cs: Reflects IConstant changes.
7635 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7637 * literal.cs (NullConstant): Change to be independently usable.
7639 2006-11-29 Martin Baulig <martin@ximian.com>
7641 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7642 we need to emit the scope initializer before calling the base .ctor.
7644 * anonymous.cs: Merged back from the new anonymous methods branch.
7645 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7647 * expression.cs (ParameterReference.DoResolveBase): Create a
7648 "normal" ScopeInfo when capturing parameters rather than using the
7649 root scope; this makes things work with anonymous methods having
7653 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7655 2006-11-22 Marek Safar <marek.safar@gmail.com>
7657 A fix for bug #79987
7658 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7659 check to a base class.
7660 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7661 only when assembly has missing attribute.
7662 * report.cs: Update.
7664 2006-11-21 Marek Safar <marek.safar@gmail.com>
7666 * cs-tokenizer.cs: Merged with gmcs version.
7668 2006-11-20 Marek Safar <marek.safar@gmail.com>
7671 * cs-parser.jay: Better error message when partial keyword is misplaced.
7673 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7675 A fix for bug #79810
7676 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7677 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7678 a RuntimeWrappedException by default.
7680 2006-11-18 Marek Safar <marek.safar@gmail.com>
7682 A fix for bug #79843
7683 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7685 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7687 2006-11-18 Marek Safar <marek.safar@gmail.com>
7689 * driver.cs, namespace.cs: Uses faster IndexOf version.
7691 2006-11-17 Marek Safar <marek.safar@gmail.com>
7693 A fix for bug #79941
7694 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7696 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7697 even if internal name is different.
7698 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7699 (UserDefinedConversion): Simplified as the operators cannot be internal.
7700 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7702 (MethodLookup): Replaced EmitContext with parentType.
7703 * expression.cs: Updated.
7705 2006-11-09 Raja R Harinath <rharinath@novell.com>
7707 * driver.cs (BadAssembly): Handle all the ugliness of
7708 DefineDynamicAssembly.
7710 2006-11-08 Raja R Harinath <rharinath@novell.com>
7712 Address parts of #58244 -- most of what's left is in the runtime
7713 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7714 CS1509 error checks, and handle them for all assembly loads, not
7715 just the first invocation.
7716 (LoadModule): Likewise. Move handling of 'adder_method' ...
7717 * codegen.cs (AssemblyClass.AddModule): ... here.
7719 2006-11-02 Marek Safar <marek.safar@gmail.com>
7721 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7722 IEnumerable<T> is ambiguous.
7724 2006-10-31 Marek Safar <marek.safar@gmail.com>
7726 A fix for bug #67689
7727 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7728 GetEnumerator is ambiguous.
7730 * report.cs: Add new warning.
7732 2006-10-29 Marek Safar <marek.safar@gmail.com>
7734 A fix for bug #78602
7735 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7736 to protected member can be nested type.
7738 2006-10-28 Marek Safar <marek.safar@gmail.com>
7740 A fix for bug #78965
7741 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7742 to protected member must derive from current type.
7744 2006-10-27 Marek Safar <marek.safar@gmail.com>
7746 assign.cs: Reuses error method.
7748 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7749 instead of type for constants.
7750 (Expression.Error_ValueAssignment): Common error method.
7752 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7755 2006-10-27 Marek Safar <marek.safar@gmail.com>
7757 A fix for bug #79081
7758 * expression.cs (MemberAccess.DoResolve): Check nested type
7761 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7763 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7765 2006-10-26 Marek Safar <marek.safar@gmail.com>
7767 A fix for bug #76591
7768 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7770 2006-10-26 Marek Safar <marek.safar@gmail.com>
7772 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7773 type forwarder of the same type multiple times.
7775 2006-10-26 Raja R Harinath <rharinath@novell.com>
7778 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7779 instance as an rvalue, even when we later resolve as an lvalue.
7781 2006-10-25 Martin Baulig <martin@ximian.com>
7783 * anonymous.cs: Fix #79673.
7785 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7787 A fix for bug #79666
7788 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7789 ignored when is optimized (= default value) as its value is already set.
7791 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7793 A fix for bug #79724
7794 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7795 TypeContainer for type lookup.
7797 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7799 A fix for bug #79231
7800 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7801 * expression.cs (OverloadResolve): Always convert type name for
7803 (ResolveNamespaceOrType): Don't confuse a nested type with any
7806 2006-10-18 Martin Baulig <martin@ximian.com>
7808 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7810 2006-10-17 Miguel de Icaza <miguel@novell.com>
7812 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7813 an int32, but requesting an int64 from the conversion
7815 2006-10-12 Martin Baulig <martin@ximian.com>
7818 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7820 2006-10-12 Martin Baulig <martin@ximian.com>
7823 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7825 2006-10-11 Miguel de Icaza <miguel@novell.com>
7827 * convert.cs: Remove broken code: I was doing the "Existance"
7828 tests for Implicit conversions.
7830 2006-10-10 Miguel de Icaza <miguel@novell.com>
7832 * convert.cs: Added one missing case in
7833 ImplicitStandardConversionExists uint64 to intptr.
7837 * typemanager.cs (uintptr_type): another core known type.
7839 * ecore.cs (OperatorCast): routine used to do cast operations that
7840 depend on op_Explicit. We could change some of the Decimal
7841 conversions to use this.
7843 This one has a probe mechanism that checks both types for an op_
7844 which it coudl be used to eliminate two classes: CastToDecimal
7845 and CastFromDecimal.
7847 * convert.cs: Implement the conversions documented in #59800
7849 2006-10-10 Martin Baulig <martin@ximian.com>
7851 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7852 before RootScope.ResolveMembers().
7854 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7855 `CurrentType' if appropriate.
7857 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7859 A fix for bug #78568
7860 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7861 when contains binary operators.
7862 * cs-parser.jay: Updated.
7864 2006-10-09 Martin Baulig <martin@ximian.com>
7867 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7868 moved that into Define() and also do the other type parameter
7869 checks there. Fixes #79094. Added gtest-292.cs.
7872 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7873 since that doesn't include type parameters; don't use `Ldelema'
7874 for type parameters. Fixes #78980. Added gtest-293.cs.
7876 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7879 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7880 conversion is allowed.
7882 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7884 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7885 error reporting when no error occurs.
7887 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7889 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7892 2006-10-06 Raja R Harinath <rharinath@novell.com>
7895 * class.cs (DefineTypeBuilder): Check circular dependencies before
7896 setting the parent of the TypeBuilder.
7897 (CheckRecursiveDefinition): Don't use 'BaseType', since
7898 it may not be valid until after DefineTypeBuilder. Use
7899 'base_type' instead.
7901 2006-10-04 Martin Baulig <martin@ximian.com>
7903 Merged the Anonymous Methods patch.
7905 * anonymous.cs, iterators.cs: The new anonymous methods code.
7907 * statement.cs (Variable): New public abstract class.
7908 (LocalInfo.Variable): New public property.
7909 (LocalInfo.ResolveVariable): New public method.
7910 (Block.Flags): Add `IsIterator'.
7911 (Block.AddVariable): Improved the CS0136 check.
7912 (Block.AnonymousChildren): New public property.
7913 (Block.AddAnonymousChild): New public method.
7914 (ToplevelBlock): Update to use the new anonymous method framework.
7915 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7916 `ToplevelBlock'; this is required to correctly implement the
7918 (Fixed, Using): Use `TemporaryVariable' instead of directly
7919 creating the `LocalBuilder'.
7921 * parameter.cs (Parameter.ResolveVariable): New public method.
7922 (Parameters.ResolveVariable): Likewise.
7924 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7926 * class.cs (TypeContainer): Replaced the `iterators' list and
7927 corresponding methods with a list of `CompilerGeneratedClass'es.
7928 (TypeContainer.ResolveMembers): New public method.
7929 (Method): `IIteratorContainer' has been replaced by
7932 * expression.cs (VariableReference): New public abstract base
7933 class for `LocalVariableReference', `ParameterReference' and
7936 * codegen.cs (EmitContext): Removed `capture_context',
7937 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7938 (EmitContext.EmitThis): Removed.
7940 * cs-parser.jay: Replace `iterator_container' with
7943 2006-10-04 Martin Baulig <martin@ximian.com>
7945 * generic.cs (GenericMethod): Don't make this abstract.
7946 (Constraints.Clone): Added dummy implementation.
7948 2006-10-04 Raja R Harinath <harinath@gmail.com>
7951 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7952 'declspaces'. Avoid allocating arrays willy-nilly.
7955 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7956 cases out of the switch.
7958 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7960 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7961 message when non-generic type is used with the type arguments.
7962 * expression.cs: Updated.
7964 2006-09-28 Raja R Harinath <rharinath@novell.com>
7967 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7968 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7969 Change semantics slightly. Don't insist on having only one
7970 temporary EmptyExpression -- just throttle the creation of new ones.
7973 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7974 non-interfaces too. If no methods are found, don't try to create
7977 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7979 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7982 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7983 us produce better error message.
7985 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7987 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7988 of the `|' operator.
7990 * report.cs: A new warning added.
7992 2006-09-27 Martin Baulig <martin@ximian.com>
7994 * generic.cs (GenericMethod): Don't make this abstract.
7996 2006-09-27 Martin Baulig <martin@ximian.com>
7999 (InternalErrorException): Added overloaded ctor taking a params array.
8001 2006-09-26 Marek Safar <marek.safar@seznam.cz>
8003 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8004 Fixed the cases when same error was reported twice.
8006 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8007 now report symbol information.
8009 2006-09-25 Martin Baulig <martin@ximian.com>
8011 * class.cs: Completely unified with the gmcs version.
8013 2006-09-25 Martin Baulig <martin@ximian.com>
8015 * typemanager.cs (TypeManager.IsNullableType): New public function.
8016 (TypeManager.IsNullableTypeOf): Likewise.
8017 (TypeManager.IsNullableValueType): Likewise.
8019 * class.cs (MethodCore): Added the `GenericMethod' argument from
8020 gmcs and also unified all classes derived from `MethodCore' with gmcs.
8022 2006-09-24 Raja R Harinath <harinath@gmail.com>
8024 * convert.cs: Unify with gmcs version.
8026 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8028 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8029 verify them as well.
8031 * report.cs: New warning.
8033 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8035 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8036 for anonymous block with out argument.
8038 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8040 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8041 not used private events only.
8043 2006-09-23 Marek Safar <marek.safar@seznam.cz>
8045 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8047 * const.cs (Const.Define): Check for constant type.
8048 (Const.IsConstantTypeValid): Looks for valid constant types.
8050 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8052 * ecore.cs (EmptyConstantCast): New common class for all constant based
8055 * expression.cs (Is.DoResolve): Handle null constant especially.
8056 (New.DoResolve): Check for new void().
8057 (MemberAccess.DoResolve): Cope with all kind of nulls.
8059 * literal.cs (NullConstant): Uses EmptyConstantCast.
8060 (NullDefault): Based on EmptyConstantCast.
8061 (NullLiteral): Uses EmptyConstantCast.
8063 * statement.cs (Block.ResolveMeta): Check for constant type.
8065 2006-09-22 Martin Baulig <martin@ximian.com>
8067 * delegate.cs, attribute.cs: Merged with the gmcs versions.
8069 2006-09-22 Raja R Harinath <rharinath@novell.com>
8071 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8075 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8076 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
8079 2006-09-22 Martin Baulig <martin@ximian.com>
8081 * ecore.cs: Merged with the gmcs version.
8083 * generic.cs (ConstructedType): New dummy class.
8084 (TypeArguments): Don't make this abstract.
8087 (TypeManager.IsGenericTypeDefinition): New method.
8088 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8090 2006-09-22 Raja R Harinath <rharinath@novell.com>
8092 * expression.cs (ComposedCast): Check for arrays of TypedReference
8093 before creating the type, not after.
8095 2006-09-21 Marek Safar <marek.safar@seznam.cz>
8097 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8098 after ToType change.
8100 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8101 when constant must be implicitly convertible.
8103 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8105 * ecore.cs (NullCast): Derives from NullConstant.
8107 * expression.cs (Is.DoResolve): Removed useless variables.
8108 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8109 (New.Constantify): Add enum support.
8110 (MemberAccess.DoResolve): Add warning when accessing null constant or
8113 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8116 * literal.cs (NullConstant): New abstract class with common
8117 functionality for all null specializations.
8118 (NullDefault): Represents default(X) when result can be
8120 (NullLiteral): Updated.
8122 * report.cs: Add new warning.
8124 2006-09-21 Martin Baulig <martin@ximian.com>
8126 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8128 2006-09-21 Martin Baulig <martin@ximian.com>
8130 * generic.cs (GenericConstraints): New dummy class.
8131 (Constraints): Likewise.
8132 (TypeParameter): Likewise.
8133 (TypeParameterName): Likewise.
8134 (GenericMethod): Likewise.
8136 * typemanager.cs (TypeManager.GetGenericArguments): New method.
8138 * decl.cs: Merged with the gmcs version.
8140 2006-09-21 Raja R Harinath <rharinath@novell.com>
8142 * generic.cs (TypeParameter): Implement IMemberContainer.
8143 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
8145 * rootcontext.cs: Unify with gmcs version.
8147 * report.cs: Unify with gmcs version.
8148 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8149 from gmcs/generics.cs.
8150 * generics.cs (TypeParameter): New dummy class.
8152 * support.cs: Unify with gmcs version.
8154 2006-09-20 Raja R Harinath <rharinath@novell.com>
8156 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8157 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8159 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8160 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8161 * mcs.exe.sources: Add generic.cs.
8163 * codegen.cs: Unify with gmcs version.
8165 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8166 (EmitContext): Add GenericDeclContainer implementation.
8167 * decl.cs (MemberCore, DeclSpace): Likewise.
8168 * namespace.cs: Remove #ifdef GMCS_SOURCE.
8170 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8171 MCS TypeManager has a corresponding dummy method.
8173 2006-09-19 Martin Baulig <martin@ximian.com>
8175 * expression.cs: Completely merged with the gmcs version.
8177 2006-09-19 Martin Baulig <martin@ximian.com>
8179 * expression.cs (Invocation): Merged with the gmcs version.
8180 (ArrayAccess.GetStoreOpcode): Likewise.
8182 2006-09-19 Martin Baulig <martin@ximian.com>
8185 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8186 (TypeManager.IsGenericMethodDefinition): Likewise.
8188 2006-09-19 Martin Baulig <martin@ximian.com>
8191 (TypeManager.IsEqual): Moved the gmcs implementation here.
8192 (TypeManager.DropGenericTypeArguments): Likewise.
8193 (TypeManager.DropGenericMethodArguments): Likewise.
8194 (TypeManager.GetTypeArguments): Moved here from gmcs.
8195 (TypeManager.HasGenericArguments): Likewise.
8197 2006-09-19 Martin Baulig <martin@ximian.com>
8199 * expression.cs (Binary): Merged with the gmcs version.
8201 2006-09-19 Martin Baulig <martin@ximian.com>
8203 * expression.cs (Probe, As, Is): Merged with the gmcs version.
8205 2006-09-19 Martin Baulig <martin@ximian.com>
8207 * typemanager.cs: Merged with the gmcs version.
8209 2006-09-16 Raja R Harinath <rharinath@novell.com>
8211 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8212 * driver.cs: Likewise.
8214 2006-09-16 Marek Safar <marek.safar@seznam.cz>
8217 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8218 only if parent type is class.
8219 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8222 2006-09-15 Marek Safar <marek.safar@seznam.cz>
8225 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8227 * typemanager.cs(CSharpName): Converts NullType to null.
8229 2006-09-15 Martin Baulig <martin@ximian.com>
8232 (TypeManager.GetMethodName): Added mcs implementation.
8233 (TypeManager.IsEqual): Likewise.
8236 (SimpleName.RemoveGenericArity): Added dummy implementation.
8238 * pending.cs: Merged with the gmcs version.
8240 2006-09-15 Martin Baulig <martin@ximian.com>
8242 * statement.cs: Merge with the gmcs version.
8244 2006-09-15 Martin Baulig <martin@ximian.com>
8246 * statement.cs (Switch): Merge with the gmcs implementation
8247 (without nullables), which is newer.
8249 2006-09-15 Martin Baulig <martin@ximian.com>
8251 * statement.cs (Block.Variables): Make this public.
8252 (ToplevelBlock.Parameters): Make this a property.
8253 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8255 2006-09-15 Martin Baulig <martin@ximian.com>
8257 * namespace.cs: Merge with the gmcs version.
8259 2006-09-15 Martin Baulig <martin@ximian.com>
8261 * decl.cs (MemberName): Minor code cleanups.
8263 2006-09-15 Martin Baulig <martin@ximian.com>
8265 * parameter.cs: Merge with the gmcs version.
8267 2006-09-15 Martin Baulig <martin@ximian.com>
8269 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8270 and an error in mcs.
8272 2006-09-15 Martin Baulig <martin@ximian.com>
8274 * flowanalysis.cs: Merged from GMCS; added the generics code into
8275 a `GMCS_SOURCE' conditional so we can share this file.
8277 2006-09-08 Martin Baulig <martin@ximian.com>
8279 * typemanager.cs (TypeManager.interlocked_type): New public field.
8280 (TypeManager.int_interlocked_compare-exchange): New public field.
8281 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8282 enumerator types here and call InitGenericCoreTypes().
8283 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8284 after calling InitEnumUnderlyingTypes().
8287 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8288 `classes_second_stage'.
8290 2006-09-14 Marek Safar <marek.safar@seznam.cz>
8292 * assign.cs, ecore.cs, expression.cs: Share error message text.
8293 * class.cs (FieldMember.Define): Check for varible of static type.
8294 * driver.cs (LoadAssembly): Uses error output for errors.
8295 * statement.cs: Updated.
8297 2006-09-08 Marek Safar <marek.safar@seznam.cz>
8299 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8302 2006-09-07 Martin Baulig <martin@ximian.com>
8305 (MainDriver): Revert r62663 from Marek; see #70506 for details.
8307 2006-08-29 Miguel de Icaza <miguel@novell.com>
8309 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8311 2006-08-17 Miguel de Icaza <miguel@novell.com>
8313 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8314 #52019 and #79064, the use of the \uXXXX sequence in source code
8315 to represent unicode characters.
8317 2006-08-15 Marek Safar <marek.safar@seznam.cz>
8319 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8321 * class.cs, ecore.cs, statement.cs: Merged to one error message.
8323 2006-08-13 Miguel de Icaza <miguel@novell.com>
8325 * assign.cs: Catch attempts to assign to a method groups in += and
8328 2006-08-13 Marek Safar <marek.safar@seznam.cz>
8331 * cs-parser.jay: Don't destroy current array type by typeof of array's.
8333 2006-08-12 Marek Safar <marek.safar@seznam.cz>
8335 * class.cs (Method.Define): Issue a warning when generic method looks like
8337 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8340 2006-08-09 Marek Safar <marek.safar@seznam.cz>
8342 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8344 * decl.cs (MemberCache.FindMembers): When container is interface we need to
8345 search all base interfaces as a member can be ambiguous.
8346 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8347 Constructor member type filter.
8348 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8349 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8350 reporting for returned memberinfos.
8351 * report.cs: Updated.
8352 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8353 version to work on all runtimes.
8354 (TypeManager.RealMemberLookup): Removed members filtering.
8356 2006-08-08 Raja R Harinath <rharinath@novell.com>
8358 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8359 (PropertyExpr.EmitAssign): Likewise.
8360 * expression.cs (Indirection.EmitAssign): Likewise.
8361 (LocalVariableReference.EmitAssign): Likewise.
8362 (ParameterReference.EmitAssign): Likewise.
8363 (Invocation.EmitArguments): Likewise.
8364 (ArrayAccess.EmitAssign): Likewise.
8365 (IndexerAccess.EmitAssign): Likewise.
8366 (This.EmitAssign): Likewise.
8367 (ConditionalLogicalOperator.Emit): Likewise.
8370 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
8371 instead of ArrayList. If the hashtable has a LocalBuilder, don't
8372 leave it in after returning it.
8373 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
8375 2006-08-06 Marek Safar <marek.safar@seznam.cz>
8377 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8380 2006-08-03 Raja R Harinath <rharinath@novell.com>
8382 Fix cs0146-3.cs and cs0146-4.cs.
8383 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8384 enclosing types don't depend on the current type.
8386 2006-08-02 Raja R Harinath <rharinath@novell.com>
8389 * class.cs (TypeContainer.DoDefineMembers): Use
8390 FindBaseMemberWithSameName on Parent, since we're interested in
8391 whether we hide inherited members or not.
8392 (FindBaseMemberWithSameName): Make slightly more robust.
8394 Fix the non-generic testcase from #77396
8395 * decl.cs (DeclSpace.DeclContainer): Remove override.
8397 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8398 declspaces for doppelgangers too.
8399 (UsingEntry): Implement IResolveContext.
8400 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
8401 'this' as the resolve context.
8402 (LocalAliasEntry): Likewise.
8404 Implement parts of #77403
8405 * roottypes.cs (RootDeclSpace): New. Used to represent the
8406 toplevel declaration space. Each namespace declaration introduces
8407 a "partial" root declaretion space.
8408 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8409 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8410 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8411 from 'current_namespace.SlaveDeclSpace'.
8412 (namespace_declaration): Likewise.
8413 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8414 check. It can't happen now.
8415 * decl.cs (DeclSpace.LookupType): Likewise.
8416 * driver.cs (MainDriver): Sanity check.
8418 2006-08-01 Raja R Harinath <rharinath@novell.com>
8420 * decl.cs (DeclSpace.FindNestedType): Remove.
8421 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8422 LookupTypeContainer to get the container of the nested type.
8423 * class.cs (TypeContainer.FindNestedType): Make non-override.
8425 2006-07-31 Raja R Harinath <rharinath@novell.com>
8427 * decl.cs (DeclSpace.PartialContainer): Move field from ...
8428 * class.cs (TypeContainer.PartialContainer): ... here.
8429 (TypeContainer.AddBasesForPart): New helper.
8430 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
8432 * cs-parser.jay (current_class): Convert to DeclSpace.
8433 (struct_declaration, interface_declaration, class_declaration):
8434 Use AddBasesForPart instead of .Bases directly.
8435 * const.cs, iterators.cs: Update to changes.
8437 2006-07-28 Raja R Harinath <rharinath@novell.com>
8439 * class.cs (TypeContainer.AddMemberType): Rename from
8441 (TypeContainer.AddMember): Rename from AddToMemberContainer.
8442 (AddTypeContainer): New. Combine AddClassOrStruct and
8444 (AddPartial): Update. Add 'is_partial' argument.
8445 * roottypes.cs: Update to changes.
8446 * cs-parser.jay (push_current_class): New helper for handling
8447 current_container and current_class.
8448 (struct_declaration, interface_declaration, class_declaration):
8451 2006-07-26 Raja R Harinath <rharinath@novell.com>
8453 * roottypes.cs: Rename from tree.cs.
8455 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8456 * tree.cs (Tree, ITreeDump): Remove types.
8457 * rootcontext.cs (tree, Tree): Remove fields.
8458 (root, ToplevelTypes): New.
8459 * *.cs: Update to rename.
8461 * tree.cs (Tree.RecordDecl): Remove.
8462 (RootTypes.AddToTypeContainer): Record the toplevel type in its
8464 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8466 2006-07-23 Raja R Harinath <harinath@gmail.com>
8468 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8469 DoFlowAnalysis and OmitStructFlowAnalysis here.
8470 (ec.With): Rename from WithUnsafe and generalize.
8471 (ec.WithCheckState): Remove. All users can be handled by 'With'.
8472 (ec.WithFlowAnalyis): New.
8473 * ecore.cs, expression.cs, statement.cs: Update.
8475 2006-07-22 Raja R Harinath <harinath@gmail.com>
8477 * statement.cs (Block.ResolveMeta): Simplify slightly.
8479 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
8480 multiple boolean fields. Convert InUnsafe, constant_check_state,
8481 check_state to flags.
8482 (CheckState, ConstantCheckState): Update.
8483 (InUnsafe): New read-only property.
8484 (FlagsHandle): Rename from CheckStateHandle and convert to handle
8486 (WithUnsafe): New helper similar to WithCheckState.
8487 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8488 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8490 2006-07-21 Raja R Harinath <rharinath@novell.com>
8492 Make comparisons use the same IL irrespective of whether they're
8493 in a 'checked' or 'unchecked' context: one of the issues in #78899
8494 * codegen.cs (EmitContext.CheckState): Make read-only property.
8495 (EmitContext.ConstantCheckState): Likewise.
8496 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8497 helper that implement a save/restore stack for CheckState
8498 values. This is the only way to change check-state.
8499 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8500 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8501 (CheckedExpr.EmitBranchable): New forwarding method.
8502 (UnCheckedExpr): Likewise.
8503 * statement.cs (Block.ResolveMeta): Use WithCheckState.
8504 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8505 (Checked.Resolve, checked.DoEmit): Likewise.
8507 2006-07-20 Miguel de Icaza <miguel@novell.com>
8509 * anonymous.cs: Cache the resolved anonymous delegate, and return
8510 this so that the ResolveTopBlock is only triggered once, not
8513 Currently we trigger ResolvetopBlock twice due to a first pass of
8514 argument check compatibility, and a second pass that does the
8517 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8519 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8521 * rootcontext.cs (Reset): Add helper_classes.
8523 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8526 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8529 2006-07-13 Miguel de Icaza <miguel@novell.com>
8531 * statement.cs (Lock): Handle expressions of type
8532 TypeManager.null_type specially. Fixes #78770
8534 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8536 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8539 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8541 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8542 for accessors as well.
8543 * ecore.cs (EventExpr): Add AccessorTable.
8545 2006-07-01 Marek Safar <marek.safar@seznam.cz>
8548 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8549 for CS0122 where appropriate.
8550 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8552 (Filter): Assembly can be null in the case of top level attributes.
8554 2006-06-25 Marek Safar <marek.safar@seznam.cz>
8558 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8559 is done at global level.
8561 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8563 A fix for #77002, Implemented TypeForwarder support.
8565 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8566 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8567 * typemanager.cs (): Add type_forwarder_attr_type.
8569 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8571 * report.cs: Add CS0469 warning.
8573 2006-06-21 Martin Baulig <martin@ximian.com>
8575 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8576 the `try'-block, so we also report CS0016 etc. there.
8578 2006-06-21 Martin Baulig <martin@ximian.com>
8581 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8583 2006-06-21 Martin Baulig <martin@ximian.com>
8585 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8586 also report CS1686 for parameters.
8588 2006-06-21 Martin Baulig <martin@ximian.com>
8590 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8591 instead of an error if the value is not implicitly convertible to
8592 the switch types; fixes #77964.
8594 2006-06-21 Raja R Harinath <rharinath@novell.com>
8597 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8598 FieldBuilder is null.
8601 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8602 'left' and 'right' before error-checking.
8604 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8606 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8608 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8609 (FieldExpr.DoResolve): likewise.
8610 (PropertyExpr.InstanceResolve): likewise.
8611 (EventExpr.InstanceResolve): likewise.
8613 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8615 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8616 attribute applicable tests for attribute argument.
8618 2006-06-02 Raja R Harinath <rharinath@novell.com>
8621 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8622 (Binary.OverloadResolve_PredefinedIntegral): New.
8623 (Binary.OverloadResolve_PredefinedFloating): New.
8624 (Binary.OverloadResolve_PredefinedString): New.
8625 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8626 Follow the standard more closely, and treat numeric promotions in
8627 terms of overload resolution.
8628 (Binary.CheckShiftArguments): Simplify.
8630 2006-06-01 Raja R Harinath <rharinath@novell.com>
8632 * flowanalysis.cs (MyBitVector): Simplify representation.
8633 (MyBitVector.Clone): Avoid allocating BitArray.
8634 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8635 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8636 (*): Update. Change all references to MyBitVector.And and
8637 MyBitVector.Or to &= and |=.
8639 2006-05-29 Raja R Harinath <rharinath@novell.com>
8642 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8643 to param arguments too.
8645 2006-05-26 Miguel de Icaza <miguel@novell.com>
8647 * cs-parser.jay: Catch another parsing form for arglist being
8648 followed by other arguments. Fixes #78313.
8650 2006-05-24 Raja R Harinath <rharinath@novell.com>
8652 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8653 checking of out parameters to ...
8654 (FlowBranchingToplevel.Merge): ... here.
8655 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8656 set, propagate the origin upward, and only complain if there was
8658 (FlowBranchingException.AddContinueOrigin): Likewise.
8659 (FlowBranchingException.AddReturnOrigin): Likewise.
8660 (FlowBranchingException.AddGotoOrigin): Likewise.
8662 2006-05-23 Raja R Harinath <rharinath@novell.com>
8664 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8665 unreachable, skip it.
8666 (FlowBranchingException.Merge): Always propagate jumps, even if
8667 the finally block renders subsequent code unreachable.
8669 2006-05-18 Raja R Harinath <rharinath@novell.com>
8672 * statement.cs (Goto.Resolve): Move responsibility for resolving
8673 'goto' to FlowBranching.AddGotoOrigin.
8674 (Goto.SetResolvedTarget): New. Callback to set the
8675 LabeledStatement that's the target of the goto.
8676 (Goto.DoEmit): Use Leave instead of Br when crossing an
8677 unwind-protect boundary.
8678 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8679 LookupLabel and adjust to new semantics.
8680 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8681 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8682 Goto.SetResolvedTarget to update target.
8683 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8684 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8685 AddBreakOrigin & co. Delay propagation until ...
8686 (FlowBranchingException.Merge): ... this.
8688 * statement.cs (Block.Resolve): Always depend on flow-branching to
8689 determine unreachability. Kill workaround that originally emitted
8690 only one statement after an "unreachable" label (see infloop in
8693 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8694 This is still "wrong", but anything better would probably need a
8695 multi-pass algorithm.
8696 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8697 usage vector. Force current usage vector to be reachable, to
8698 optimistically signify backward jumps.
8699 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8701 (FlowBranchingLabeled.Merge): New. If no backward jump was
8702 detected, return the original salted-away usage vector instead,
8703 updated with appropriate changes. Print unreachable warning if
8705 * statement.cs (Block.Resolve): Don't print unreachable warning on
8706 a labeled statement.
8708 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8710 * driver.cs: Pass filename without path to AssemblyBuilder's
8711 AddResourceFile. Fixes bug #78407.
8713 2006-05-17 Raja R Harinath <rharinath@novell.com>
8715 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8716 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8717 (FlowBranching.MergeChild): Overwrite
8718 reachability information from Labeled branchings too.
8720 2006-05-16 Raja R Harinath <rharinath@novell.com>
8722 * statement.cs (Goto.Resolve): Merge jump origins here ...
8723 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8725 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8726 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8727 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8728 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8730 * statement.cs (Goto.Resolve): ... not here.
8731 (Goto.Emit): Remove CS1632 check.
8733 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8735 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8738 2006-05-11 Raja R Harinath <rharinath@novell.com>
8740 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8741 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8742 (FlowBranchingException.Label): Likewise.
8744 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8746 (MyBitVector.Or): Use it to avoid losing information (Count).
8747 (FlowBranching.MergeOrigins): Likewise.
8749 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8750 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8751 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8752 (UsageVector.ToString): Simplify.
8753 (UsageVector.MergeSiblings): Move here from ...
8754 (FlowBranching.Merge): ... here.
8755 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8758 2006-05-10 Raja R Harinath <rharinath@novell.com>
8760 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8761 null bitvector is treated as all-true.
8763 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8764 (MyBitVector): Rationalize invariants. 'vector != null' implies
8765 that we have our own copy of the bitvector. Otherwise,
8766 'InheritsFrom == null' implies all inherited bits are true.
8768 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8770 * statement.cs (LocalInfo): Add IsConstant.
8771 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8772 local variable for constants.
8774 2006-05-09 Raja R Harinath <rharinath@novell.com>
8776 * flowanalysis.cs (MyBitVector.Empty): New.
8777 (MyBitVector): Don't allow InheritedFrom to be null.
8778 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8779 (UsageVector, FlowBranching): Update to changes.
8781 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8782 recursion. The 'Parent == null' condition isn't sufficient for
8784 (FlowBranching.AddBreakOrigin): Likewise.
8785 (FlowBranching.AddContinueOrigin): Likewise.
8786 (FlowBranching.AddReturnOrigin): Likewise.
8787 (FlowBranching.StealFinallyClauses): Likewise.
8788 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8789 (FlowBranching.CheckOutParameters): Likewise.
8790 (FlowBranchingToplevel): Terminate all the above recursions here.
8791 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8792 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8794 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8796 (FlowBranchingToplevel): New. Empty for now.
8797 (FlowBranching.MergeTopBlock): Update.
8798 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8799 branching for the anonymous delegate.
8800 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8802 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8803 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8804 information at the start of the merge. Reorganize.
8806 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8808 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8810 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8812 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8813 to newly introduced ctor.
8815 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8816 message to one place.
8817 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8820 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8822 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8824 * ecore.cs (Expression.ResolveAsConstant): Updated.
8826 * statement.cs (ResolveMeta): Updated.
8828 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8830 * cs-parser.jay: __arglist cannot be used in initializer.
8832 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8835 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8838 2006-05-05 Raja R Harinath <rharinath@novell.com>
8840 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8841 (LabeledStatement): Add 'name' parameter.
8842 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8843 (Block.AddLabel): Update to changes.
8844 * cs-parser.jay (labeled_statement): Likewise.
8846 * flowanalysis.cs (BranchingType.Labeled): New.
8847 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8848 (FlowBranchingLabeled): New. Does nothing for now, but will
8849 eventually handle 'goto' flows.
8850 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8851 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8852 that's terminated ...
8853 (Block.Resolve): ... here.
8855 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8856 (UsageVector.MergeFinallyOrigins): Likewise.
8857 (FlowBranching.InTryOrCatch): Likewise.
8858 (FlowBranching.AddFinallyVector): Likewise.
8859 (FlowBranchingException): Update to changes.
8862 * statement.cs (Return.Resolve): Move error checking to ...
8863 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8864 (FlowBranchingException): Handle return origins like break and
8866 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8868 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8871 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8874 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8877 * class.cs (MethodData.Define): Do public accessor check only when method
8878 implements an interface.
8880 2006-05-04 Raja R Harinath <rharinath@novell.com>
8882 Remove special handling of 'break'
8883 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8884 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8885 (UsageVector.Break): Remove.
8886 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8888 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8890 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8891 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8893 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8896 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8897 be the interface member.
8899 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8902 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8903 for emitting small (int) values.
8905 2006-05-03 Raja R Harinath <rharinath@novell.com>
8908 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8909 control-flow passes through the 'finally' after merging-in all the
8910 control-flows from 'try' and the 'catch' clauses.
8912 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8913 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8914 always true at the only non-recursive entry point.
8915 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8916 FlowBranchingBreakable.
8917 (FlowBranchingLoop): Remove.
8918 * statement.cs (Return.DoResolve): Update to changes.
8921 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8922 (FlowBranching.CreateBranching): Handle it: create a
8923 FlowBranchingContinuable.
8924 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8925 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8926 except that it handles the 'continue' command.
8927 (FlowBranching.UsageVector.MergeOrigins): Rename from
8929 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8930 except that it overrides AddContinueOrigin.
8931 (FlowBranchingException): Override AddContinueOrigin, similar to
8933 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8934 Create a new branching around the embedded statement.
8935 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8936 control flow after the embedded statement.
8937 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8939 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8940 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8941 FlowBranchingBreakable.
8942 (FlowBranchingSwitch): Remove.
8945 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8946 error reporting to ...
8947 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8948 Rename from 'AddBreakVector'. Add new location argument. Return
8949 a bool indicating whether the 'break' crosses an unwind-protect.
8950 (FlowBranchingException.AddBreakOrigin): Add.
8951 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8952 flowbranching after updating with the effects of the 'finally'
8954 (FlowBranchingBreakable): New common base class for
8955 FlowBranchingLoop and FlowBranchingSwitch.
8957 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8959 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8961 2006-05-02 Raja R Harinath <rharinath@novell.com>
8963 * statement.cs (Do.Resolve): If the loop is infinite, set the
8965 (While.Resolve, For.Resolve): Set a barrier after the embedded
8966 statement. There's no direct control flow that goes from the end
8967 of the embedded statement to the end of the loop.
8968 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8969 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8970 above ensure that the reachability is correctly computed.
8972 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8973 (UsageVector.MergeBreakOrigins): If the current path is
8974 unreachable, treat it as if all parameters/locals are initialized.
8975 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8976 infinite loops before merging-in break origins.
8978 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8979 (Reachability.Reachable): Split part into ...
8980 (Reachability.Unreachable): ... this. Simplify.
8981 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8983 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8984 (Reachability.SetThrowsSometimes): Likewise.
8985 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8986 TriState.Always, use corresponding property.
8987 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8988 (Block.Resolve): Likewise. Remove some redundant checks.
8990 2006-05-02 Raja R Harinath <harinath@gmail.com>
8992 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8993 (Reachability.Meet): Don't bother checking AlwaysThrows --
8994 barrier is always set.
8995 (FlowBranchingBlock.Merge): Likewise.
8997 2006-05-01 Raja R Harinath <harinath@gmail.com>
8999 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9000 checks for unreachable.
9002 2006-05-01 Marek Safar <marek.safar@seznam.cz>
9005 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9007 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9008 whether field is really assigned.
9010 2006-04-30 Raja R Harinath <harinath@gmail.com>
9012 * flowanalysis.cs (Reachability): Make 4-argument constructor
9014 (Reachability.Meet): Rename from 'And'. Remove static variant.
9015 (Reachability.Always): Rename from the highly misleading
9016 'Reachability.Never'.
9017 (FlowBranching.Merge): Update to changes. Mark an impossible
9018 situation with a 'throw'.
9019 (*): Update to changes.
9021 2006-04-29 Raja R Harinath <harinath@gmail.com>
9023 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9025 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9026 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9027 (*): Update to changes.
9028 * statement.cs: Update to changes.
9030 2006-04-28 Marek Safar <marek.safar@seznam.cz>
9033 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9035 2006-04-28 Raja R Harinath <harinath@gmail.com>
9037 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9040 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9041 argument to two arguments: an usage-vector and a bool. Move call
9042 to FlowBranching.Merge () ...
9043 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9045 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9046 handling of loop and switch reachability to ...
9047 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9049 2006-04-27 Raja R Harinath <harinath@gmail.com>
9051 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9052 handling to FlowBranchingLoop.InLoop.
9053 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9055 2006-04-26 Marek Safar <marek.safar@seznam.cz>
9058 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9059 anonymous method is allowed from AnonymousContainer here.
9061 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9063 2006-04-24 Raja R Harinath <rharinath@novell.com>
9066 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9068 2006-04-23 Marek Safar <marek.safar@seznam.cz>
9071 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9072 (DoubleConstant.Reduce): Ditto.
9074 2006-04-23 Raja R Harinath <rharinath@novell.com>
9076 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9077 Remove 'lvalue_right_side' argument. Move parts to ...
9078 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9079 (LocalVariable.DoResolveLValue): ... these.
9081 2006-04-21 Raja R Harinath <rharinath@novell.com>
9084 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9085 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9086 (LocalVariableReference.DoResolveBase): Use it to implement new
9088 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9089 (Argument.Resolve): Simplify. Move CS1510 check ...
9090 * ecore.cs (Expression.ResolveLValue): ... here.
9091 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9092 (PropertyExpr.DoResolveLValue): Likewise.
9093 (FieldExpr.Report_AssignToReadonly): Likewise.
9094 (FieldExpr.DoResolve): Add 'out_access' argument. Use
9095 LValueMemberAccess or LValueMemberOutAccess on instance depending
9097 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9098 DoResolve as appropriate.
9100 2006-04-20 Raja R Harinath <rharinath@novell.com>
9103 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9104 implicit conversions on 'out' and 'ref' arguments.
9106 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9107 improve clarity. Remove dead code.
9110 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9111 (Catch.Resolve): Resolve VarBlock if it exists.
9113 2006-04-19 Miguel de Icaza <miguel@novell.com>
9115 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9116 twice, this was some residual code, the enumerator was emitted
9117 properly in the two branche of if later.
9119 2006-04-19 Raja R Harinath <rharinath@novell.com>
9121 * expression.cs (Cast.ResolveLValue): Remove. The result of a
9122 cast is never an lvalue.
9123 (Cast.DoResolve, Cast.ResolveRest): Combine.
9124 (Argument.Emit): Simplify slightly. Move 'Expr is
9125 IMemoryLocation' check ...
9126 (Argument.Resolve): ... here.
9127 (Argument.Error_LValueRequired): Remove. Inline into only user.
9129 Simplifications. Fix cs0191-2.cs
9130 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9131 CS1649 and CS1651 to ...
9132 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
9133 the actual selection of the error code and message to a lookup
9134 table. Add a dummy return value to simplify callsites.
9135 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9136 readonly fields of other instances of the same type. Move CS0197
9138 * expression.cs (Argument.Resolve): ... here. Simplify code.
9139 Ensure that ec.InRefOutArgumentResolving is only set during LValue
9140 resolution of an out or ref argument. The code simplification
9141 above uses this invariant.
9143 2006-04-18 Raja R Harinath <rharinath@novell.com>
9145 Possibly fix #77752. Fix cs1690-[4-7].cs.
9146 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9147 CheckMarshallByRefAccess. Drop parameter.
9148 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
9150 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9152 * report.cs (AllWarnings): Add CS1690.
9153 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9155 (LocalVariableReference.DoResolveBase): Update.
9157 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9159 * class.cs (MethodOrOperator): Moved common parts from method class.
9160 detect obsolete attributes.
9161 (Method.Define): Simplified as it reuses code from base.
9162 (Constructor.ValidAttributeTargets): Fixed issue found during
9164 (Destructor.ValidAttributeTargets): Fixed issue found during
9166 (Operator): Finished refactoring set off by #78020. Operator class is now
9167 ordinary method class.
9169 * anonymous.cs: Updated.
9171 * decl.cs (DeclSpace): Add IsGeneric
9173 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9175 * class.cs (Constructor.Emit): Don't emit the attributes twice.
9177 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9179 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9180 detect obsolete attributes.
9181 (Method.CreateEmitContext): Moved to MethodOrOperator.
9183 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9186 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9187 customized exception to make crash detection easier.
9188 (MethodOrOperator): Started to work on new base class for methods and
9190 (Method): Derives from MethodOrOperator.
9191 (Constructor.Emit): Emits its own attributes.
9192 (AbstractPropertyEventMethod.Emit): Ditto.
9193 (Operator): Derives from MethodOrOperator, will refactor fully in extra
9195 (Operator.Emit): It's temporary more tricky than should be.
9197 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9199 * report.cs (InternalErrorException): Add ctor with inner exception.
9201 2006-04-08 Marek Safar <marek.safar@seznam.cz>
9204 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9207 2006-04-07 Marek Safar <marek.safar@seznam.cz>
9210 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9213 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9215 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9216 attribute is present and Guid not.
9217 (Interface.ApplyAttributeBuilder): Ditto.
9219 * attribute.cs: Add error message.
9221 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9225 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9226 sources (it's composite) so hold them in extra array as they are used in
9227 Emit phase only. It worked in the previous versions by mistake.
9228 (Attribute.Emit): Emit attribute for more owners when exist.
9230 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9231 it has now different behaviour.
9233 2006-04-04 Marek Safar <marek.safar@seznam.cz>
9235 * constant.cs (Constant.IsDefaultInitializer): New method.
9237 * class.cs: Updated.
9239 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9240 re-initialize default values. It saves KBs almost for every assembly.
9241 Thanks Zoltan for the idea.
9242 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9243 (ArrayCreation.DoResolve): Resolve only once.
9244 (ArrayCreation.Emit): Emit static initializer only when it is faster.
9245 (ArrayCreation.GetAttributableValue): Cope with optimized values.
9247 2006-04-03 Zoltan Varga <vargaz@gmail.com>
9249 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9252 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9254 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9255 in an embedded statement too.
9257 2006-04-01 Raja R Harinath <rharinath@novell.com>
9260 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9262 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9266 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9269 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9271 2006-03-31 Marek Safar <marek.safar@seznam.cz>
9273 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9276 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9277 LocalTemporary change.
9279 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9281 (ClassOrStruct.DefineFieldInitializers): Implemented static field
9282 initializers optimization.
9283 (ClassOrStruct.TypeAttr): Moved from modifiers.
9284 (Constructor.CheckBase): Don't crash when static ctor has parameters.
9285 (FieldBase.ResolveInitializer): Resolves initializer.
9286 (FieldBase.HasDefaultInitializer): New property.
9288 * cs-parser.jay: Removed message.
9290 * expression.cs (CompilerGeneratedThis): New specialization.
9292 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9294 2006-03-28 Marek Safar <marek.safar@seznam.cz>
9296 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9298 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9300 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9301 be now EnumConstants only.
9303 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9305 * attribute.cs, driver.cs: Reset more caches.
9307 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9309 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9311 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9313 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9314 for easier reuse. Updated all overrides.
9315 (IntegralConstant): New base class for all integral constants.
9316 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9317 of the constant range, report custom error.
9318 (UIntConstant.Reduce): Fixed uint conversion.
9320 * ecore.cs, literal.cs: Reduce updates.
9322 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9326 * class.cs (Constructor.Define): Removed extra if for default ctors.
9327 A patch from Atsushi Enomoto.
9329 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9331 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9332 GetAttributableValue.
9334 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9337 * convert.cs (ImplicitConversionRequired): Error message moved to
9340 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9341 automatic implicit conversion of an output value.
9342 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9344 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9346 (TypeOf.GetAttributableValue): Add extra handling for object type.
9348 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9349 special error message.
9351 2006-03-25 Marek Safar <marek.safar@seznam.cz>
9353 * class.cs (Constructor.Emit): Don't crash when struct ctor is
9355 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9356 compatible with MS runtime.
9358 2006-03-23 Marek Safar <marek.safar@seznam.cz>
9360 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9361 attribute arguments here.
9363 * class.cs (Indexer.Define): The check was moved to attribute class.
9365 2006-03-22 Marek Safar <marek.safar@seznam.cz>
9367 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9368 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9371 2006-03-22 Raja R Harinath <rharinath@novell.com>
9373 Support ParameterDefaultValueAttribute in gmcs. Also applied to
9374 mcs to keep code differences small.
9375 * attribute.cs (Attribute.GetParameterDefaultValue): New.
9376 * typemanager.cs (parameter_default_value_attribute_type): New.
9377 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
9380 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9382 * expression.cs (StringConcat.Append): Reverted back to no warning state.
9384 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9386 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9388 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9391 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
9393 * doc-bootstrap.cs : fix build.
9395 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9397 * expression.cs (StringConcat.Append): Issue a warning when empty string
9400 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9402 * assign.cs (CompoundAssign.ResolveSource): Removed.
9404 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9407 * class.cs (TypeContainer.FindMethods): Removed.
9408 (TypeContainer.CheckMemberUsage): Made static.
9410 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9412 * constant.cs (CheckRange): Removed unused type argument.
9413 (CheckUnsigned): Removed unused type argument.
9415 * cs-parser.jay: Updated after MemberAccess clean up.
9416 Uses Length for empty string test.
9418 * cs-tokenizer.cs: Uses Length for empty string test.
9419 (IsCastToken): Made static.
9420 (is_hex): Made static.
9421 (real_type_suffix): Made static.
9423 * decl.cs (SetupCache): Made static.
9424 (OnGenerateDocComment): Removed unused ds argument.
9426 * delegate.cs (VerifyDelegate): Removed unused argument.
9428 * doc.cs: Uses Length for empty string test.
9430 * driver.cs: Uses Length for empty string test.
9432 * enum.cs (IsValidEnumType): Made static
9434 * expression.cs (EnumLiftUp): Removed unused argument.
9435 (ResolveMethodGroup): Ditto.
9436 (BetterConversion): Ditto.
9437 (GetVarargsTypes): Ditto.
9438 (UpdateIndices): Ditto.
9439 (ValidateInitializers): Ditto.
9440 (MemberAccess.ctor): Ditto.
9441 (GetIndexersForType): Ditto.
9443 * flowanalysis.cs: (MergeFinally): Removed unused argument.
9445 * iterators.cs: Updated after MemberAccess clean up.
9447 * location.cs: Uses Length for empty string test.
9449 * namespace.cs: Uses Length for empty string test.
9451 * report.cs (CheckWarningCode): Made static.
9453 * statement.cs (LabeledStatement): Removed unused argument.
9455 * typemanager.cs (FilterNone): Removed.
9457 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9459 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9462 * class.cs: Updated.
9464 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9466 * cs-parser.jay.cs: __arglist is not allowed for delegates.
9468 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9472 * expression.cs (VerifyArgumentsCompat): Reverted to double error
9473 reporting, it's more tricky than I thought.
9475 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9479 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
9481 (AnonymousMethod.ImplicitStandardConversionExists): New method.
9482 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9483 Add more error reporting; Fixed issue with params.
9485 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9487 * cs-parser.jay: AnonymousMethod requires host container.
9489 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9491 2006-03-18 Raja R Harinath <harinath@gmail.com>
9493 * class.cs: Change 'TypeContainer ds' constructor argument to
9494 'DeclSpace parent'. Some classes were missed below due to
9495 different naming convention.
9497 * class.cs (MemberCore.Parent): Delete. This makes the
9498 ParentContainer changes below enforceable by the compiler.
9500 Treat pointers to enclosing declaration space as 'DeclSpace', not
9502 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9503 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9505 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9507 (Block.AddThisVariable): Likewise.
9508 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9509 (AbstractPropertyEventMethod.Emit): Likewise.
9510 (AbstractPropertyEventMethod.EmitMethod): Likewise.
9511 (GetMethod.Define, SetMethod.Define): Likewise.
9512 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9513 (DelegateMethod.EmitMethod): Likewise.
9515 Fix regression test-partial-13.cs.
9516 Rationalize use of PartialContainer. Ensure that the partial
9517 class semantics can be tied to type-correctness, i.e., any
9518 violation will cause a compile error.
9519 * class.cs, const.cs: Access all fields that belong to class
9520 TypeContainer via ParentContainer. Arguments of EmitContexts and
9521 Resolve()-like functions still use 'Parent'.
9523 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9524 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9525 (PropertyMethod.CheckModifiers): Remove unused argument.
9526 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9529 2006-03-17 Raja R Harinath <harinath@gmail.com>
9531 Make semantics of PartialContainer simpler.
9532 * decl.cs (DeclSpace.IsPartial): Remove.
9533 * class.cs (TypeContainer.IsPartial): Likewise.
9534 (TypeContainer..ctor): Set PartialContainer to point to self.
9535 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9536 (TypeContainer.FindNestedType): Likewise.
9537 (MemberCore.ParentContainer): Simplify. Remove deprecation.
9539 2006-03-17 Marek Safar <marek.safar@seznam.cz>
9541 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9543 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9545 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9548 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9550 * class.cs (Operator.Define): An error for base conversion was not
9553 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
9555 * iterator.cs : yield break is allowed in try statement which has
9556 catch clauses. Fixed bug #77767.
9558 2006-03-13 Marek Safar <marek.safar@seznam.cz>
9560 A fix for #77593, #77574.
9562 * class.cs (MethodCore.CheckBase): Another if for operator.
9564 2006-03-09 Marek Safar <marek.safar@seznam.cz>
9566 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9569 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9570 (DelegateCreation.ImplicitStandardConversionExists): New method for just
9573 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9576 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9577 Updated after another emitcontext usage was clean up. It should help us to
9578 synchronize with gmcs easier.
9580 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9584 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9585 (Event.Define): ditto
9586 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9588 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9589 Removed redundant code and set NewSlot for Invoke method too.
9591 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9592 (Parameters.MergeGenerated): New method. Use this method when you merge
9593 compiler generated argument with user arguments.
9595 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9597 * attribute.cs (ResolveAsTypeTerminal): Removed.
9599 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9600 specialization for predefined types; 30% speed up.
9601 Finally placed obsolete check to right place.
9602 (Expression.ResolveType): Removed.
9604 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9605 Updated after ResolveType was removed.
9607 * expression.cs (Cast.ctor): Check void cast.
9608 (Binary.ResolveAsTypeTerminal): Is never type.
9609 (Conditional.ResolveAsTypeTerminal): Is never type.
9611 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9613 2006-03-01 Raja R Harinath <rharinath@novell.com>
9616 * expression.cs (ParameterReference.DoResolveBase): Change return
9618 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9622 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9625 * typemanager.cs (GetFullNameSignature): Don't nullref on
9626 protected accessors.
9628 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9630 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9631 these two separated members to simplify the code.
9632 (Attribute.Resolve): Refactored to use new fields and methods.
9633 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9634 implemented obsolete attribute checking.
9635 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9636 implemented obsolete checking again. It look line never ending quest ;-)
9637 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9639 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9641 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9643 *class.cs (Property.Define): Add RegisterProperty call.
9645 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9646 argument groups (only 2).
9648 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9649 encoding expression to arguments.
9650 (Expression.ExprClassToResolveFlags): Just turned to property.
9652 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9653 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9654 optimized as well as implemented support for zero-length attributes.
9656 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9657 Add caching of PropertyInfo's.
9659 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9661 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9662 error multiple times.
9664 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9666 New partial class implementation.
9667 A fix for #77027, #77029, #77403
9669 * attribute.cs (Attributable): Made attributes protected.
9671 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9672 the replacements of ClassPart and PartialContainer.
9673 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9674 (TypeContainer.AddInterface): Ditto.
9675 (TypeContainer.AddPartial): The main method for partial classes. It checks
9676 for errors and merges ModFlags and attributes. At the end class is added to
9678 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9680 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9681 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9682 from the rest of partial classes.
9683 (TypeContainer.GetClassBases): Simplified.
9684 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9686 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9687 (TypeContainer.HasExplicitLayout): Uses Flags now.
9688 (PartialContainer): Removed.
9689 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9690 (StaticClass): Was merged with Class.
9691 (Class.GetClassBases): class and static class bases are verified here.
9692 (Class.TypeAttr): Added static attributes when class is static.
9693 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9694 (MemberBase): In some cases we need to call parent container for partial
9695 class. It should be eliminated but it's not easy now.
9697 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9699 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9700 partial classed to accumulate class comments.
9701 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9703 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9705 * driver.cs (MainDriver): Tree.GetDecl was removed.
9707 * modifiers.cs (Modifiers): Add partial modifier.
9709 * tree.cs (Tree.decl): Removed.
9710 (RootTypes): Started to use this class more often for root types
9713 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9717 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9718 external interface does not have an attribute.
9720 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9722 Another prerequisites for new partial classs implementation.
9724 * attribute.cs (Attribute.Equal): Implemented.
9725 (Attribute.Emit): Changed as attributes can be applied more than twice.
9726 (Attributes.Emit): Check for duplicate attributes here.
9728 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9729 as a parameter, clean-up.
9731 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9735 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9736 contains obsolete attribute check which can in some cases look for base
9737 type of current class which is not initialized yet.
9738 (TypeContainer.BaseType): Replacement of ptype.
9740 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9742 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9744 First of prerequisites for new partial classs implemention.
9746 * attribute.cs (Attributable): Extended by ResolveContext;
9747 Attributes finally have correct context for resolving in all cases.
9748 (AttachTo): Attribute owner is assigned here.
9750 * codegen.cs (IResolveContext): Introduce new interface to hold
9751 all information needed in resolving phase.
9752 (EmitContext): Implements IResolveContext; more clean-up needed here.
9754 * decl.cs (MemberCore): Implemented IResolveContext.
9756 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9757 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9758 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9759 Refactored to use new IResolveContext instead of EmitContext; cleanup
9761 2006-02-06 Miguel de Icaza <miguel@novell.com>
9763 * codegen.cs (EmitScopeInitFromBlock): check here the
9764 capture_context, there is no need to make two calls to the
9767 * anonymous.cs: Add some debugging messages that might help me
9768 track other instances of this problem in the future (the
9769 regression of test 467).
9771 * cs-parser.jay: track the variable block, as we need to initalize
9772 any captured variables declared in this block for the "catch"
9773 portion of the "Try" statement.
9775 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9776 scope initialization for captured variables.
9778 Also, move the emit for the variables after the block location has
9781 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9783 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9785 2006-02-02 Miguel de Icaza <miguel@novell.com>
9787 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9788 commit yesterday, the initialization for the roots is necessary.
9789 What is not necessary is the scope activation.
9791 2006-02-02 Raja R Harinath <rharinath@novell.com>
9793 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9794 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9796 (Argument.Resolve): Remove CS0206 checks.
9798 2006-02-01 Miguel de Icaza <miguel@novell.com>
9800 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9801 scopes for all the roots, the scopes will now be emitted when the
9802 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9804 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9805 code. This reduces a lot of existing cruft.
9807 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9808 that the ScopeInfo is generated as we enter the scope, not at the
9809 time of use, which is what we used to do before.
9811 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9812 every time a Block is about to be emitted if we have a
9815 2006-02-01 Raja R Harinath <rharinath@novell.com>
9817 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9819 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9821 * typemanager.cs (cons_param_array_attribute): Make private.
9822 (Reset): Set it to null.
9823 (InitCoreHelpers): Don't initialize it.
9824 (ConsParamArrayAttribute): New. Initialize it as needed.
9825 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9827 2006-01-31 Miguel de Icaza <miguel@novell.com>
9829 * expression.cs: There might be errors reported during the
9830 selection of applicable methods. If there are errors, do not
9831 continue execution as it will lead the compiler to crash.
9833 2006-01-30 Miguel de Icaza <miguel@novell.com>
9835 * expression.cs: Member access is not allowed on anonymous
9836 methods. Fixes #77402.
9838 2006-01-30 Raja R Harinath <rharinath@novell.com>
9841 * cs-parser.jay (VariableDeclaration): Don't set
9842 current_array_type to null.
9843 (field_declaration, event_declaration, declaration_statement):
9844 Set it to null here.
9846 2006-01-28 Raja R Harinath <harinath@gmail.com>
9848 * typemanager.cs (GenericParameterPosition): New.
9851 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9853 * doc.cs : To process "include" elements, first we should create
9854 another list than XmlNodeList, because it could result in node
9855 removal, which could result in that the XmlNodeList gives up
9858 (Also made code identical to gmcs again.)
9860 2006-01-25 Miguel de Icaza <miguel@novell.com>
9862 * ecore.cs: Introduce an error report that we were not catching
9863 before, if not silent, we must report the error. Gonzalo ran into
9866 2006-01-23 Miguel de Icaza <miguel@novell.com>
9868 A fix for bug: #76957
9870 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9871 ComputeMethodHost before creating the method, this is a new
9874 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9875 that this method references (RegisterScope). The actual scope
9876 where the method is hosted is computed with the ComputeMethodHost
9877 before we create the method.
9879 Moved the Deepest routine here.
9881 (AnonymousContainer.ComputeMethodHost): New routine used to
9882 compute the proper ScopeInfo that will host the anonymous method.
9884 (ScopeInfo): Deal with multiple roots. The problem was that we
9885 did not have a unique root where all ScopeInfos could be hanged
9886 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9889 Remove AdjustMethodScope which is now computed at the end. Remove
9890 LinkScope which did a partial link, instead link all ScopeInfos
9891 before code generation from the new "LinkScopes" routine.
9893 Simplify all the Add* routines as they no longer need to maintain
9894 the tree, they just need to record that they are using variables
9897 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9898 routines to produce the forest of ScopeInfo trees.
9900 * class.cs (TypeContainer.AppendMethod): This is just like
9901 AddMethod, but ensures that an interface implementation method
9902 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9903 methods, but at the end.
9905 We use this functionality to ensure that the generated MoveNext
9906 method in the iterator class is resolved/emitted before the
9907 enumerator methods created.
9909 This is required because the MoveNext method computes the right
9910 ScopeInfo for the method. And the other methods will eventually
9911 need to resolve and fetch information computed from the anonymous
9914 2006-01-21 Raja R Harinath <harinath@gmail.com>
9915 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9918 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9920 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9921 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9923 2006-01-18 Raja R Harinath <rharinath@novell.com>
9925 Fix #76656, cs0231-2.cs.
9926 * cs-parser.jay (formal_parameter_list): Make error case catch
9928 (parenthesized_expression_0): Add CS1026 check.
9929 (invocation_expression): Remove unused { $$ = lexer.Location }.
9931 2006-01-17 Raja R Harinath <rharinath@novell.com>
9934 * cs-parser.jay (statement_expression): Don't list out the
9935 individual statement-expressions. Convert syntax error into
9938 2006-01-16 Raja R Harinath <rharinath@novell.com>
9941 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9942 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9943 CheckIntermediateModification.
9944 (FieldExpr.DoResolve): Add new two-argument version that
9945 allows us to resolve the InstanceExpression as an lvalue.
9946 The one-argument variant is now just a wrapper.
9947 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9948 Resolve the lhs as an lvalue if the it has a value type.
9949 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9950 from Assign.DoResolve.
9951 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9952 resolved as an lvalue.
9953 (PropertyExpr.DoResolve): Update.
9954 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9955 has a value type. Move CS1612 check here from
9956 CheckIntermediateModification.
9957 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9958 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9959 'right_side' of a ResolveLValue on an 'out' argument.
9960 (EmptyExpression.LValueMemberAccess): New. Used as the
9961 'right_side' of a propagated ResolveLValue on a value type.
9962 (LocalVariableReference.DoResolveBase): Recognize
9963 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9965 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9966 EmptyExpression.Null.
9968 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9970 * typemanager.cs : added IsGenericParameter(). In mcs it always
9972 * doc.cs : for generic parameters, use GenericParameterPosition,
9975 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9977 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9979 2006-01-12 Miguel de Icaza <miguel@novell.com>
9981 This fixes the problem where we used ldfld instead of ldflda to
9982 load the "THIS" pointer on captured parameters, when THIS is a
9983 value type. See bug #77205.
9985 * iterators.cs (CapturedThisReference.Emit): Pass false to
9986 EmitThis (we do not need the address).
9988 * codegen.cs (EmitThis): it needs to know whether we need the
9989 address of `this' or not. This is used by value types.
9991 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9992 every other call passes false.
9994 2006-01-12 Raja R Harinath <rharinath@novell.com>
9997 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9999 * expression.cs (Invocation.OverloadResolve): Update.
10000 (Invocation.DoResolve): Avoid double resolution of invocation.
10002 2006-01-11 Raja R Harinath <rharinath@novell.com>
10005 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10006 unary negation of floating point types as 0-expr; negation cannot
10007 overflow in floating point types.
10010 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10011 on operands of 'void' type.
10014 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10015 and ExclusiveOr for boolean constants too.
10017 2006-01-09 Raja R Harinath <rharinath@novell.com>
10020 * expression.cs (Invocation.OverloadResolve): Replace reflected
10021 override methods with their base virtual methods, rather than
10022 skipping over them.
10023 * typemanager.cs (TypeManager.GetOverride): New.
10025 2006-01-05 Jb Evain <jbevain@gmail.com>
10027 * class.cs (Property.Define, Indexer.Define): do not tag the
10028 properties as SpecialName | RTSpecialName.
10030 2006-01-04 Miguel de Icaza <miguel@novell.com>
10032 * class.cs (MethodCore.IsDuplicateImplementation): This method was
10033 doing a low-level comparission of parameter types. It was lacking
10034 a check for __argslist.
10036 2005-12-30 Miguel de Icaza <miguel@novell.com>
10038 * expression.cs (ParameterReference.DoResolveBase): Allow
10039 reference parameters if they are local to this block.
10041 This allows the ref and out parameters of a delegate to be used in
10042 an anonymous method, for example:
10044 delegate void set (out int x);
10046 set s = delegate (out int x){
10050 This is used by functionality introduced late in the C# language.
10052 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10053 method that take ref and out parameters.
10055 Fixes #77119 which was a late change in the spec.
10057 2005-12-23 Miguel de Icaza <miguel@novell.com>
10059 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10060 parent if its the same scope. Fixes #77060.
10062 2005-12-21 Miguel de Icaza <miguel@novell.com>
10064 * driver.cs: Report the case of no source files and no -out:
10067 2005-12-20 Raja R Harinath <rharinath@novell.com>
10070 * expression.cs (ComposedCast.GetSignatureForError): Define.
10072 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10076 * namespace.cs (NamespaceEntry): Add extern_aliases as a
10077 ListDictionary, to contain the ExternAliasEntry entries (in
10078 addition to the NamespaceEntry.aliases hashtable). This field is
10079 shared between the original entry and its doppelganger (bodyless
10081 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10082 extern_aliases field.
10083 (NamespaceEntry.Lookup): Move the IsImplicit check after the
10084 lookup in extern_aliases.
10086 2005-12-16 Raja R Harinath <rharinath@novell.com>
10089 * class.cs (TypeContainer.Mark_HasEquals): New.
10090 (TypeContainer.Mark_HasGetHashCode): New.
10091 (ClassPart): Override them.
10092 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10095 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10096 'parent' argument to the base constructor.
10098 Remove all mention of TypeContainer from decl.cs.
10099 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10100 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10101 (DeclSpace.DeclSpace): Likewise.
10102 (DeclSpace.DefineMembers): Remove unused argument.
10103 * cs-parser.jay (pop_current_class): Update to changes. Simplify
10104 debugging check -- we don't care if the debug code throws an
10105 InvalidCastException instead of an InternalErrorException.
10106 * class.cs (TypeContainer.DefineMembers): Update to changes.
10107 (TypeContainer.DoDefineMembers): Likewise.
10108 (TypeContainer.GetMethods): Likewise.
10109 (PropertyMember.Define): Likewise.
10110 (MemberBase.Parent): New property that forwards to
10111 MemberCore.Parent, but ensures that we get a TypeContainer.
10112 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10113 (RootContext.PopulateTypes): Likewise. Remove special case code
10114 for !RootContext.StdLib: DefineMembers is idempotent.
10116 2005-12-14 Miguel de Icaza <miguel@novell.com>
10118 * convert.cs (ExplicitConversionCore): Check the return value from
10119 ExplicitConversionCore which can return null on failure. Fixes #76914
10121 2005-12-13 Marek Safar <marek.safar@seznam.cz>
10123 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10125 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
10127 * doc.cs : The search for referenced namespace was insufficient to
10128 get global one as it used to do. Fixed bug #76965.
10130 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
10132 * doc.cs : check name in cref in the last phase that whether it is
10135 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10137 * cs-tokenizer.cs : reverted the latest change: it somehow broke
10140 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10142 * doc.cs : so it turned out that we cannot skip override check for
10143 interface members. Fixed bug #76954.
10145 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10147 * cs-tokenizer.cs : fixed bug #75984:
10148 - #warning and #error should not be handled when the source line
10150 - #line is not checked strictly when the source line is disabled.
10151 - #define and #undef is on the other hand checked strictly at any
10154 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
10156 * cs-tokenizer.cs : missing Location (actually, filename) in one of
10159 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10161 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10163 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10164 event initializers.
10165 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10166 (FieldBase.Initializer): Initializer is now optional.
10167 (EventField.Define): Only event field can have initializer.
10169 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10171 * const.cs (Const): Reuse initializer.
10173 * cs-parser.jay: Updated after FieldBase changes.
10174 Added current_array_type to simplify array initializers.
10176 * ecore.cs (NullCast.IsDefaultValue): Implemented.
10178 * expression.cs, iterators.cs: Updated.
10180 * namespace.cs (NamespaceEntry): Made UsingFound private.
10182 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10184 * parameterCollection.cs: Obsolete, removed.
10185 * parser.cs: Obsolete, removed.
10187 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10190 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10192 * enum.cs (Enum.Define): Set obsolete context here.
10194 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10197 - FindDocumentedMember() now expects 1) paramList as null
10198 when "we don't have to check the number of parameters" and
10199 2) Type.EmptyTypes when "there is no arguments".
10200 - Introduced FoundMember struct to hold the exact type which was
10201 used to find the documented member (the above change broke
10202 test-xml-044; it might be better just to use DeclaringType than
10203 what MS does, like this change does, but it depends on usage.)
10205 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10207 * doc.cs : documented member might be from DeclaringType for nested
10208 types. Fixed bug #76782.
10210 2005-12-03 Ben Maurer <bmaurer@ximian.com>
10212 * anonymous.cs: Have the param code handle leaving copies on the
10213 stack etc. Allows anonymous params to take part in the assignment
10214 code (++, +=, etc). Fixes bug #76550
10216 * expression.cs: Handle the prepare_for_load/leave_copy by passing
10217 it down to the anon code.
10219 * iterators.cs: Use dummy var here
10221 * codegen.cs: Handle new vars
10223 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10226 * class.cs (MethodData.Define): Set proper Obsolete context.
10228 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10230 (FieldExpr.DoResolve): Ditto.
10232 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10235 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10236 parent is not obsolete.
10238 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
10240 * doc.cs : (FindDocumentedMember) find parameterless members first
10241 and get CS0419 in the early stage. Fixed first case of bug #76727.
10243 2005-11-30 Marek Safar <marek.safar@seznam.cz>
10246 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10247 no error was reported.
10249 *expression.cs (Binary.DoResolve): left can be null.
10251 2005-11-22 Marek Safar <marek.safar@seznam.cz>
10254 * class.cs (MethodData.Emit): Parameters should be labeled first.
10256 2005-11-21 Marek Safar <marek.safar@seznam.cz>
10259 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10261 2005-11-18 Marek Safar <marek.safar@seznam.cz>
10263 * attribute.cs (AreParametersCompliant): Moved to Parameter.
10265 * class.cs (MethodCore): Parameter clean up.
10266 (IMethodData): Added ParameterInfo.
10267 (MethodData): Parameter clean up.
10268 (Indexer.Define): Parameter clean up.
10280 * typemanager.cs: Parameter clean up.
10282 * delegate.cs (Define): Get rid of duplicated code.
10284 * expression.cs (ParameterReference): Removed useless parameters
10286 (Invocation): Ditto.
10288 * parameter.cs (ParamsParameter): New class, params specialization.
10289 (ArglistParameter): Attemp to separate arglist.
10290 (Parameter): Refactored to be reusable and faster.
10291 (Parameter.Modifier): Made understandable.
10292 (Parameters): Changed to be used as a class for `this' assembly
10293 parameters. Refactored to use new specialized classes.
10295 * support.cs (ParameterData): Added Types property.
10296 (InternalParameters): Deleted.
10298 2005-08-20 Martin Baulig <martin@ximian.com>
10300 Merging this patch from GMCS to fix #75867.
10302 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10303 scope if we don't already have it.
10305 2005-11-17 Martin Baulig <martin@ximian.com>
10308 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10309 inherit the scope from our parent. Fixes #76653.
10311 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10313 * doc.cs : the previous patch does not actually fix the bug.
10314 PropertyInfo override check is now implemented and really fixed it.
10315 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10317 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10319 * doc.cs : apply "override filter" also to properties.
10322 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10324 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10325 no need to check overrides. For classes, omit those results from
10326 interfaces since they must exist in the class. Fixed bug #76726.
10328 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10330 * typemanager.cs : (GetFullNameSignature) differentiate indexers
10331 with different parameters. Fixed the second problem in #76685.
10333 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10335 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10336 get expected 'protected' access in CheckValidFamilyAccess()).
10339 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10341 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10342 Fixed bug #76705. CS1569 was incorrectly commented out.
10344 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10346 * doc.cs : use Invocation.IsOverride() to do real override check.
10347 * expression.cs : made Invocation.IsOverride() internal.
10349 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10351 * doc.cs : use TypeManager.FindMembers() instead of (possible)
10352 TypeBuilder.FindMembers() and filter overriden base members out.
10355 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10357 * doc.cs : ref/out parameters are represented as '@' (instead of
10358 '&' in type FullName). Fixed bug #76630 (additionally crefs).
10360 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10362 * doc.cs : when there was no '.' in cref to methods in doc comment,
10363 then parameters were missing in the output. Fixed bug #76691.
10365 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10367 * driver.cs : don't output docs when there is an error.
10370 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10373 Now it should detect indexers. Fixed primary concern in bug #76685.
10374 Fixed CS0419 message to not show the identical member signature in
10377 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10379 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10380 instead of Type.FindMembers() since it does not handle events.
10383 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
10385 * codegen.cs: Fixed typo (speficied -> specified).
10387 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10390 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10392 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10394 * attribute.cs: Changed error message.
10396 * cs-tokenizer.cs: One more check.
10398 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10400 * statement.cs (Block.Resolve): Ignore empty statement.
10402 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10404 * report.cs: Made error/warning methods more strict to avoid
10407 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10408 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10409 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10410 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10412 2005-11-08 Marek Safar <marek.safar@seznam.cz>
10414 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10415 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10417 * class.cs (TypeContainer.IsComImport): New property.
10418 (Constructor.Define): Create proper ctor for ComImport types.
10420 * expression.cs (New.CheckComImport): Fixed.
10422 2005-11-07 Miguel de Icaza <miguel@novell.com>
10424 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10425 that a parameter has been captured does not mean that we do not
10426 have to do the rest of the processing. This fixes the second part
10427 of #76592. If there was another anonymous method capturing
10428 values in the past, the Scope would never be set for the second
10429 method that captured the same parameter.
10431 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10432 properly manipulate the stack. Second part of fix for #76592.
10434 * expression.cs (New): Add support for invoking "new" on
10435 interfaces that have been flagged with the ComImport attribute and
10436 the CoClass. Fixes #76637
10438 * statement.cs (Try.DoEmit): When a variable is captured, do not
10439 try to emit the vi.LocalBuilder variable as it has been captured.
10440 Create a temporary variable and store the results on the
10441 FieldBuilder. Fixes #76642
10443 2005-11-07 Marek Safar <marek.safar@seznam.cz>
10445 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10447 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10449 * expression.cs (Binary.DoResolve): Added && optimalization.
10451 * typemanager.cs (AddUserType): Removed useless argument.
10453 2005-11-04 Marek Safar <marek.safar@seznam.cz>
10455 * statement.cs (Block.variables): Uses ListDictionary.
10457 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10460 * class.cs (PartialContainer.EmitType): Customized to emit
10461 security attributes.
10462 (ClassPart.ApplyAttributeBuilder): Transform security attribute
10463 for partial classes.
10465 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10468 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10469 access has to be fixed.
10471 * typemanager.cs (IsUnmanagedType): Wrong common field type.
10473 2005-11-01 Marek Safar <marek.safar@seznam.cz>
10476 * ecore.cs (NullCast.Reduce): Implemented.
10478 * expression.cs (ArrayCreation.CheckIndices): Correcly check
10481 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10483 (Foreach.Resolve): Catch null properly.
10485 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10487 * cs-tokenizer.cs: Warning text fix.
10489 * driver.cs: AllWarningNumbers exposed on public interface.
10491 * report.cs (): Reviewed warning numbers.
10492 (IsValidWarning): Use binary search.
10494 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10496 * driver.cs: Implemeted resource visibility.
10497 (Resources): New class for code sharing between /res: and
10500 2005-10-28 Marek Safar <marek.safar@seznam.cz>
10503 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10506 * convert (Convert.ImplicitReferenceConversion): NullCast holds
10509 * ecore.cs (NullCast): Child is contant only.
10511 * literal.cs (NullLiteral.Reduce): null can be converted to any
10514 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
10516 * driver.cs: Use Encoding.Default as default code page instead
10519 2005-10-27 Raja R Harinath <rharinath@novell.com>
10522 * expression.cs (Invocation.Error_InvalidArguments): Handle
10523 __arglist parameters.
10524 (Invocation.VerifyArgumentsCompat): Likewise.
10525 * support.cs (ReflectionParameters.GetSignatureForError): Print
10526 __arglist parameters.
10527 (InternalParamters.GetSignatureForError): Likewise.
10528 * parameter.cs (Parameters.GetSignatureForError): Likewise.
10530 2005-10-26 Marek Safar <marek.safar@seznam.cz>
10532 * attribute.cs (GetPropertyValue): Made public.
10534 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10536 Add new property WrapNonExceptionThrows to handle 2.0 assembly
10538 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10541 * driver.cs: Reflect method name change.
10543 * statement.cs (Try.Resolve): Warn when try has both general
10544 exception handlers.
10546 * typemanager.cs: runtime_compatibility_attr_type new predefined
10549 2005-10-26 Raja R Harinath <harinath@gmail.com>
10552 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10553 treat it as an empty parameter list.
10555 2005-10-26 Raja R Harinath <rharinath@novell.com>
10558 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
10559 ResolveAsTypeStep silent.
10560 * statement.cs (Block.AddConstant): Mark block as used.
10561 (Block.ResolveMeta): Avoid piling on error messages
10562 if a constant initializer resolution fails.
10564 2005-10-25 Raja R Harinath <rharinath@novell.com>
10566 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10568 (NamespaceEntry.VerifyAllUsing): New.
10569 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
10570 behaviour. Delegates actual resolution of alias to ...
10571 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
10572 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10574 * driver.cs (Driver.MainDriver): Update.
10576 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10577 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10579 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10581 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10582 RootNamespace.DefineNamespacesForAll.
10584 2005-10-24 Raja R Harinath <harinath@gmail.com>
10586 * typemanager.cs (assemblies, external_aliases, modules)
10587 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10588 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10589 overhead. Move resposibility ...
10590 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10591 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10593 2005-10-23 Raja R Harinath <harinath@gmail.com>
10595 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10596 cached_namespaces. Improve usage.
10597 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10598 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10599 Move from GlobalRootNamespace and simplify.
10600 (RootNamespace.Global): Make instance variable.
10601 (RootNamespace.RootNamespace): Add "alias name" parameter.
10602 (GlobalRootNamespace): Simplify drastically.
10603 (Namespace.Lookup): Don't use GetNamespace.
10604 * typemanager.cs (GetRootNamespace): Rename from
10605 ComputeNamespaceForAlias.
10606 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10608 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10610 * anonymous.cs (AnonymousContainer): Don't crash when container
10613 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10615 * expression.cs (Binary.DoResolve): Warn when comparing same
10618 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10621 * expression.cs (Binary.DoResolve): It looks like there are no
10622 convetsion rules in enum context.
10624 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10626 Add support for extern alias qualifiers.
10627 * typemanager.cs: Move some LookupTypeReflection code
10628 to namespace.cs, to have cleaner code. Added some methods
10629 to help us keep track of the extern aliased references.
10630 * driver.cs: Add suport for extern alias assemblies on command
10631 line and check for their warnings/errors. Also keep track of the
10632 extern aliased assemblies.
10633 * namespace.cs: Move the global functionality of Namespace
10634 to GlobalRootNamespace/RootNamespace. Now the global namespace
10635 is GlobalRootNamespace.Globa. Also the code moved from
10636 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10637 Finally added LocalAliasEntry (AliasEntry before) and
10638 ExternAliasEntry, to handle alias statements.
10639 * cs-parser.jay: Add support in the grammar for extern alias
10641 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10642 Update callings to Namespace (now in GlobalRootNamespace).
10644 2005-10-18 Raja R Harinath <rharinath@novell.com>
10647 * class.cs (TypeContainer.DefineType): Move updating of
10648 topological sort earlier in the code.
10649 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10651 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10654 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10656 * constant.cs (Constant.TryReduce): Moved from Cast class.
10657 (Reduce): Made little bit more OO and fixed missing conversions.
10659 * ecore.cs (Reduce): Implemented.
10660 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10662 * literal.cs (Reduce): Implemented.
10664 * class.cs: Reverted Miguel's wrong commit.
10666 2005-10-14 Miguel de Icaza <miguel@novell.com>
10668 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10670 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10672 * cs-parser.jay, expression.cs : CS0214 was missing error location
10673 for constants. Fixed bug #76404.
10675 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10678 * convert.cs (ExplicitConversionCore): Fixed object->enum
10681 2005-10-10 Raja R Harinath <rharinath@novell.com>
10683 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10684 InstanceExpression.
10685 (PropertyExpr.EmitCall): Likewise.
10686 * expression.cs (Invocation.EmitArguments): Handle case where
10688 (Invocation.EmitCall): Avoid allocating temporary variable if
10689 there are no arguments.
10691 2005-10-07 Raja R Harinath <rharinath@novell.com>
10694 * convert.cs (ImplicitConversionStandard): Move conversion of
10695 void* to arbitrary pointer types ...
10696 (ExplicitConversionStandard): .. here.
10697 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10698 error to always print typenames.
10700 2005-10-07 Raja R Harinath <rharinath@novell.com>
10702 * convert.cs (GetConversionOperator): Rename from
10703 GetConversionOperators. Move operator selection code from ...
10704 (UserDefinedConversion): ... here.
10706 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10708 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10711 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10713 * assign.cs (Assign.DoResolve): Error method changed.
10715 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10717 * const.cs (ResolveValue): Reset in_transit immediately.
10719 * constant.cs: Error method changed.
10721 * convert.cs: Removed useless location parameter.
10722 (ExplicitNumericConversion): Don't do double enum check.
10723 (ExplicitConversionCore): Renamed from ExplicitConversion.
10724 (ExplicitUnsafe): Extracted from ExplicitConversion.
10725 (ExplicitConversion): Uses for error reporting.
10727 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10729 (ResolveBoolean): Uses common error method.
10730 (CastToDecimal): Get rid of ec.
10731 (CastFromDecimal): Optimized.
10732 (ConvCast): Get rid of ec.
10734 * enum.cs (ResolveValue): Reset in_transit immediately.
10735 (Emit): Return after first error.
10737 * expression.cs: Convert changes.
10739 * literal.cs: Error method changed.
10741 * statement.cs: Error method changed.
10743 2005-10-03 Raja R Harinath <rharinath@novell.com>
10745 * support.cs (SeekableStreamReader.Position): Don't error out when
10746 the requested position is just beyond the end of the current
10749 2005-09-28 Raja R Harinath <rharinath@novell.com>
10751 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10752 try to keep in sync with the byte count of the underlying Stream.
10753 However, this limits us to a window size of 2048 characters: i.e.,
10754 the maximum lookahead of our lexer/parser can be 2048 characters.
10756 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10759 * driver.cs: Fix compilation files with full root path.
10761 2005-09-25 Miguel de Icaza <miguel@novell.com>
10763 * report.cs (SymbolRelatedToPreviousError): Format the output so
10764 it does not use an open parenthesis that is never closed.
10766 * driver.cs: Follow coding guidelines
10768 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10771 * const.cs (Const.ResolveValue): Check for assigning non-null
10772 value to reference type.
10774 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10776 * anonymous.cs: Implemented ExprClassName.
10778 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10781 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10784 * class.cs (StaticClass.DefineContainerMembers): Report protected
10787 * codegen.cs: if(ed) PRODUCTION.
10789 * convert.cs (Error_CannotImplicitConversion): Better error
10792 * cs-parser.jay: More error checks.
10794 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10796 * driver.cs (CSCParseOption): Enabled wrong option check.
10798 * ecore.cs (Expression.ExprClassName): Turned to property.
10799 (MemberExpr.CheckIntermediateModification): For checking boxed
10800 value types modification.
10802 * statement.cs (Fixed.Resolve): Expression type must be
10803 convertible to fixed type.
10804 (CollectionForeach.GetEnumeratorFilter,TryType):
10805 Small refactoring for easier error checking.
10807 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10809 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10812 * class.cs (GeneratedBaseInitializer): New class for customization
10813 compiler generated initializers.
10814 (MemberBase.DoDefine): Check Obsolete attribute here.
10815 (FieldMember.DoDefine): Ditto.
10817 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10820 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10821 (MemberCore.GetObsoleteAttribute): Removed argument.
10822 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10823 (MemberCore.CheckObsoleteType): New helper.
10827 * statement.cs: Updates after MemberCore changes.
10829 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10830 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10832 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10833 obsolete attribute for compiler construct.
10834 (As.DoResolve): Cache result.
10836 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10838 2005-09-26 Raja R Harinath <rharinath@novell.com>
10841 * expression.cs (This.VerifyFixed): In a value type T, the type of
10842 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10843 value type R, 'this' is treated as a value parameter.
10845 2005-09-22 Miguel de Icaza <miguel@novell.com>
10847 * statement.cs (Lock): Use the TemporaryVariable class instead of
10848 manually using local variables as those do not work when variables
10851 * ecore.cs: Moved the TemporaryVariable class from being a nested
10852 class inside Foreach to be a public class that can be employed in
10855 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10857 * cs-parser.jay: interface_accessors replaced by
10858 accessor_declarations.
10860 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10863 * statement.cs (GotoCase.Resolve): Convert null constant to
10865 (SwitchLabel.ResolveAndReduce): Ditto.
10866 (SwitchLabel.NullStringCase): Custom null stamp.
10867 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10869 typemanager.cs (CSharpSignature): Don't skip first argument
10872 2005-09-18 Miguel de Icaza <miguel@novell.com>
10874 * driver.cs: Set InEmacs based on the environment variable EMACS.
10876 * location.cs (InEmacs): in this mode, do not report column
10877 location as it confuses Emacs.
10879 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10881 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10882 expression.cs, iterators.cs, literal.cs: Store constants and
10885 * class.cs (MemberBase.ShortName): Pass location.
10887 * cs-parser.jay: Some location fixes.
10889 * ecore.cs (Expression.Location): Made virtual.
10891 2005-09-05 Miguel de Icaza <miguel@novell.com>
10893 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10894 if the underlying types are the same, otherwise we need to produce
10895 code that will do the proper cast.
10897 This was exposed by Marek's constant rewrite which produced
10898 invalid code for the call site:
10900 enum X : long { a }
10901 void Method (X v) {}
10905 This fixes test-49.cs
10907 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10909 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10910 Type/Object should be allowed as well. Fixed bug #75968.
10912 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10914 * expression.cs : (Binary.DoResolve): when one is enum constant and
10915 another is constant 0, then return enum one *as enum type*.
10918 2005-09-02 Raja R Harinath <rharinath@novell.com>
10920 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10924 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10925 flow-branching for LocalVariableReferences in case we were invoked
10926 from a MemberAccess.
10927 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10929 (LocalVariableReference.DoResolveBase): ... this.
10930 (MemberAccess.Resolve): Do the check that was disabled during
10933 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10936 (PartialContainer.Create): check abstract/sealed/static strictly
10937 but abstract/sealed can exist only at one side. Fixed bug #75883.
10939 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10942 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10943 specified, don't default to UnmanagedType.I4.
10945 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10947 * expression.cs : conditional operator should check possibly
10948 incorrect assign expression. Fixed bug #75946.
10950 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10952 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10953 Reverting the change. gmcs is much complex than mcs on this matter.
10955 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10957 * cs-tokenizer.cs : To read another token ahead of the actual
10958 consumption, use new SavedToken and cache token instead of moving
10959 back the stream with SeekableStreamReader (it seemed problematic).
10961 driver.cs : Thus use StreamReader directly.
10962 * support.cs : Thus removed SeekableStreamReader.
10964 2005-08-30 Raja R Harinath <rharinath@novell.com>
10967 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10968 (ScopeInfo.EmitScopeType): Use it to construct field names from
10969 names of captured locals.
10972 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10973 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10974 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10975 (ExplicitConversion): Remove enum cases already handled by
10976 implicit conversion. Move implicit conversion check to the beginning.
10977 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10978 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10979 Don't treat System.Enum as a struct.
10981 2005-08-30 Jb Evain <jbevain@gmail.com>
10983 * attribute.cs: handles as expression in parameters.
10985 2005-08-30 Raja R Harinath <rharinath@novell.com>
10988 * class.cs (TypeContainer.VerifyClsName): Don't use a
10989 PartialContainer when verifying CLS compliance.
10990 (AbstractPropertyEventMethod): Set Parent here, ...
10991 (PropertyMethod): ... not here.
10993 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10995 * attribute.cs : escaped attribute name should not be allowed to be
10996 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10998 2005-08-29 Raja R Harinath <rharinath@novell.com>
11001 * convert.cs (ImplicitStandardConversionExists): Allow zero also
11002 when converting a long constant to unsigned long.
11003 * expression.cs (Invocation.OverloadResolve): Add sanity check to
11004 detect where IsApplicable and VerifyArgumentsCompat disagree.
11006 2005-08-29 Raja R Harinath <rharinath@novell.com>
11007 and Carlos Alberto Cortez <carlos@unixmexico.org>
11010 * class.cs (TypeContainer.CanElideInitializer): New helper.
11011 (TypeContainer.EmitFieldInitializers): Use it to determine if we
11012 can safely emitting the initializer of a field.
11014 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11016 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11017 allowed inside a switch (without loop). Fixed bug #75433.
11019 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
11021 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11022 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11024 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11026 * driver.cs : kinda reverting the default encoding changes (not exact
11027 revert since I noticed that "codepage:reset" might not work fine).
11029 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11031 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11032 Location. Now getter and setter store location correctly.
11033 (errors/cs0111-12.cs now reports the expected location.)
11035 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11037 * driver.cs : Use default encoding on the environment.
11038 Removed (now that) extra parameter for SeekableStreamReader.
11039 * support.cs : (SeekableStreamReader) third .ctor() argument for
11040 StreamReader is not required (always true). preamble size could
11041 be acquired in simpler and safe way.
11043 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
11045 * cs-parser.jay: report CS0642 at warning level 3
11046 and report CS0642 for an if else statement also
11047 fixes bug #74745. Patch by John Luke (and a bit
11049 Removed extra CS0642 warning check for "while",
11051 * statement.cs: In Block.Resolve(), CS0642 check
11052 is reimplemented to check a sequence of an empty
11053 statement and a block.
11055 Both fix bug #66777.
11057 2005-08-24 Marek Safar <marek.safar@seznam.cz>
11059 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11060 detection until I fix it.
11062 * cs-tokenizer.cs: Changed error message.
11064 * cs-parser.jay: Fixed 2 error locations.
11066 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11067 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11070 * enum.cs (GetSignatureForError): Fixed.
11072 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11076 * typemanager.cs (RegisterProperty): Removed.
11078 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11080 2005-08-24 Raja R Harinath <rharinath@novell.com>
11083 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11084 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11086 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11088 * expression.cs : tiny fix is required for not warning positive ulong.
11091 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11093 * expression.cs : add CS0652 check for constant and integral
11094 expression. Fixed bug #53974.
11096 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11098 * expression.cs : in DoNumericPromotions(), check if there is implicit
11099 conversion overload for string (to check CS0034). Fixed bug #52492.
11101 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11103 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11105 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11107 * ecore.cs : report location when it is *not* Null.
11109 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11115 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11116 correctly. Fixed bug #75721.
11118 2005-08-23 Raja R Harinath <rharinath@novell.com>
11120 * support.cs (SeekableStreamReader.Position): Avoid an expensive
11121 loop that performs 'min (pos, char_count)'.
11124 * expression.cs (Unary.ResolveOperator): Don't discard implicit
11125 converted value in Operator.OnesComplement.
11127 2005-08-22 Ben Maurer <bmaurer@ximian.com>
11129 * anonymous.cs: If the anon method is pulled into a helper class,
11130 it needs to be `internal' not `private'. Fixes runtime behavior on
11133 2005-08-20 Martin Baulig <martin@ximian.com>
11135 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11136 scope if we don't already have it.
11138 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11139 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11142 2005-08-17 Marek Safar <marek.safar@seznam.cz>
11145 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11146 is a partial class.
11148 2005-08-16 Marek Safar <marek.safar@seznam.cz>
11150 The big constants rewrite
11151 Fix #75746, #75685 and more
11152 As a side effect saved 1MB for MWF ;-)
11154 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11155 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11156 enum based for corlib compilation.
11158 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11161 * class.cs (FixedField.Define): Use ResolveAsConstant.
11163 * const.cs (IConstant): Interface constants and enums.
11164 (Const.ResolveValue): New method for constant resolvning.
11165 (ExternalConstant): Constants from imported assemblies.
11167 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11168 conversion; like enums.
11169 (Constant.ToType): Converts this constant to different type.
11170 (Constant.Increment): Adds 1.
11172 * convert.cs (ImplicitConversionRequired): Simplified.
11174 * cs-parser.jay: Create EnumMember directly.
11176 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11178 * doc.cs (GenerateEnumDocComment): Removed.
11180 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11181 (ConvertIntLiteral): Removed.
11182 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11184 * enum.cs (EnumMember): Implement IConstant.
11185 (Enum.IsValidEnumConstant): Removed.
11186 (Enum.GetNextDefaultValue): Removed.
11187 (Enum.FindMembers): Updated.
11188 (Enum.GenerateDocComment): Iterate enum members.
11190 * expression.cs (Cast.TryReduce): Handle enums correctly.
11191 (New.Constantify): Made public.
11192 (MemberAccess.DoResolve): Removed contant specific if(s).
11194 * literal.cs (NullLiteral): Implement new abstract methods.
11196 * statement.cs (GotoCase.Resolve): Use new constant methods.
11197 (SwitchLabel.ResolveAndReduce): Use new constant methods.
11199 * typemanager.cs (LookupEnum): Removed.
11200 (IsEnumType): Fixed to work with corlib.
11201 (RegisterConstant): Removed.
11202 (LookupConstant): Removed.
11203 (GetConstant): Changed to work with IConstant.
11205 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
11207 * location.cs : Fixed overflown (>255) column number.
11209 2005-08-03 Raja R Harinath <rharinath@novell.com>
11211 First cut of the qualified-alias-member feature.
11212 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11214 * cs-parser.jay (DOUBLE_COLON): New token.
11215 (namespace_or_type_name): Add rule for recognizing
11216 qualified-alias-members.
11217 (primary_expression): Likewise.
11218 (element_access): Allow QualifiedAliasMember as a possible
11219 type-bearing expression.
11220 (local_variable_type, local_variable_pointer_type): Likewise.
11221 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
11222 aliases in the current and enclosing namespace declarations.
11223 (NamespaceEntry.UsingAlias): Add CS0440 warning.
11224 * decl.cs (MemberName.is_double_colon): New.
11225 (MemberName.MemberName): Add new constructor for alias-member.
11226 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11227 * expression.cs (QualifiedAliasMember): New expression type.
11229 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11231 * location.cs : it borked when no argument was specified.
11233 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11235 * location.cs : tiny ToString() format fix.
11237 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11239 * statement.cs : oops, it was missing.
11241 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11243 A set of fixes for precise line/column location.
11246 "token" field now holds a file/line "delta", a line number offset
11247 from the segment, and a column number. See also:
11248 http://lists.ximian.com/pipermail/mono-devel-list/2004-
11249 December/009508.html
11250 Removed static IsNull. Use instance IsNull property instead.
11251 * cs-tokenizer.cs :
11252 For some tokens it stores Location. For Identifier it stores
11253 LocatedToken which is a pair of string name and location.
11254 Column numbers are adjusted only at getChar().
11256 Use Location.ToString() for reporting (it now contains column).
11258 Largely modified to use LocatedToken instead of
11259 string (IDENTIFIER), and to acquire Location from some tokens.
11260 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11261 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11263 Now MemberName holds Location. DeclSpace.ctor() receives Location
11264 as a parameter. Removed extra parameters to all derived classes.
11265 Replaced Location.IsNull() with instance property.
11266 * assign.cs, expression.cs :
11267 Added .ctor() overload that omits Location.
11269 Added "nameEscaped" flag that indicates the identifier was escaped
11270 in the source file. This fixes bug #57047.
11272 2005-08-02 Marek Safar <marek.safar@seznam.cz>
11274 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11275 New method, looking for lo-case imported cls type.
11277 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11280 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11282 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11284 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11285 all_imported_types.
11286 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11288 Optimized to save 3.5 MB for SWF compilation.
11290 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11292 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11293 (PartialContainer.Create): Moved logic AddToContainer.
11294 (PartialContainer.MarkForDuplicationCheck): Shares name.
11296 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11299 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11301 (Namespace.GetSignatureForError): New method.
11303 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11304 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11306 2005-08-01 Raja R Harinath <rharinath@novell.com>
11309 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11310 member lookup rather than qualifier_type, since qualifier_type can
11313 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11315 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11318 2005-07-31 Miguel de Icaza <miguel@novell.com>
11320 * statement.cs: Copy the local exception into the exception
11321 captured local. Fixes 75674
11323 2005-07-31 Raja R Harinath <harinath@gmail.com>
11326 * expression.cs (Invocation.OverloadResolve): Don't report error
11327 CS1501 if error CS1502 has been reported.
11328 (New.DoResolve): Delegate CS1501 reporting to
11329 Invocation.OverloadResolve.
11332 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11333 invariant-meaning-in-block property in an enclosing block if
11336 2005-07-29 Marek Safar <marek.safar@seznam.cz>
11338 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11339 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11340 (Switch.CheckSwitch): Just save 50kb for SWF.
11342 2005-07-27 Martin Baulig <martin@ximian.com>
11344 * anonymous.cs (CaptureContext.AddField): Added
11345 `AnonymousContainer am' argument; compute its toplevel scope if
11346 it's not already computed. Fixes #75649.
11348 2005-07-26 Raja R Harinath <rharinath@novell.com>
11351 * class.cs (Constructor.Emit): Reset block to null if the block
11354 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11356 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11358 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11360 * class.cs (MethodData.Define): Check whether accessor implementing
11361 interface is public.
11363 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11365 2005-07-22 Marek Safar <marek.safar@seznam.cz>
11368 * namespace.cs (LookupType): Moved same type check to...
11370 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11371 with the same name.
11373 2005-07-21 Raja R Harinath <rharinath@novell.com>
11375 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11376 already found a typebuilder.
11377 * class.cs (MethodCore.IsDuplicateImplementation): Compare
11378 MemberNames, not strings.
11380 * const.cs (Error_ExpressionMustBeConst):
11381 Rename from Error_EpressionMustBeConst.
11382 * const.cs, class.cs, statement.cd: Update.
11384 2005-07-21 Marek Safar <marek.safar@seznam.cz>
11388 * const.cs (Const.LookupConstantValue): Report missing contant expression
11390 (Error_EpressionMustBeConstant): Only one error method.
11392 * class.cs, statement.c: Updated.
11394 2005-07-20 Raja R Harinath <rharinath@novell.com>
11396 * statement.cs (Block.Flags): Add back HasVarargs.
11397 (Block.flags): Make protected.
11398 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11400 * typemanager.cs (types, typecontainers, user_types): Remove.
11401 (UserTypes, TypeContainers): Likewise.
11402 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11403 (CleanUp, Reset): Update.
11404 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
11405 (GetNestedType): Use Type.GetNestedType.
11406 (CoreLookupType): Take two arguments, the namespace and the
11407 basename of the type. Update to use the Namespace.Lookup
11409 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11410 (RealMemberLookup): Use IsNestedChildOf instead of playing with
11411 string concatenation and substring matches.
11412 * class.cs, enum.cs, delegate.cs: Update to changes.
11414 2005-07-20 Marek Safar <marek.safar@seznam.cz>
11416 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11417 Expression and made virtual.
11419 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11420 (ImplicitStandardConversionExists): Fixed `byte' typo ?
11422 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11424 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11427 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11430 2005-07-18 Marek Safar <marek.safar@seznam.cz>
11433 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11434 AssemblyCultureAttribute is not used on executable.
11437 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11439 2005-07-16 Raja R Harinath <rharinath@novell.com>
11442 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11443 New. Reports CS0252/CS0253.
11444 Mostly taken from preliminary patch by Duncak Mak.
11445 (Binary.DoResolveOperator): Store results of operator lookup.
11446 Use them to detect if we need to warn about unintended reference
11449 2005-07-15 Raja R Harinath <rharinath@novell.com>
11452 * namespace.cs (Namespace.Lookup): Add back location parameter.
11453 (Namespace.LookupType): Add CS0436 report. Add location parameter.
11454 * delegate.cs, ecore.cs, expression.cs: Update to changes.
11456 * codegen.cs (EmitContext.DeclSpace): Make readonly.
11457 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11458 (Namespace.LookupType): ... this.
11459 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11461 * typemanager.cs (LookupTypeReflection): Remove buggy code that
11462 purported to handle pointers.
11463 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11466 2005-07-15 Marek Safar <marek.safar@seznam.cz>
11468 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11471 2005-07-15 Raja R Harinath <rharinath@novell.com>
11473 * namespace.cs (Namespace.Lookup): Drop location parameter.
11474 (NamespaceEntry.LookupAlias): Remove. Merge into ...
11475 (NamespaceEntry.Lookup): ... this.
11476 (NamespaceEntry.Error_AmbiguousTypeReference):
11477 Move here from DeclSpace.
11478 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11480 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11481 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11482 Move to NamespaceEntry.
11483 * delegate.cs, expression.cs: Update to changes.
11485 2005-07-14 Marek Safar <marek.safar@seznam.cz>
11487 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11488 CheckAttributeType and refactored.
11489 (Attribute.ResolvePossibleAttributeType): Changed to reuse
11490 ResolveAsTypeTerminal error handling.
11491 (ResolveAsTypeTerminal): Introduced because of global attributes extra
11493 (GetSignatureForError): Print errors in same way.
11496 * codegen.cs: Reflect attribute GetSignatureForError change.
11499 * expression.cs: Add silent parameter to ResolveAsTypeStep.
11501 * namespace.cs (UsingEntry): Refactored to make fields private.
11504 statement.cs: Error_UnexpectedKind has extra parameter.
11506 2005-07-14 Raja R Harinath <rharinath@novell.com>
11508 * ecore.cs (IAlias): Remove.
11509 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
11510 that implement the interface.
11511 * namespace.cs (Namespace): Likewise.
11512 (Namespace.declspaces): Renamed from 'defined_names'.
11513 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
11514 DeclSpace instead of an IAlias.
11515 * tree.cs (Tree.AddDecl): Update.
11517 2005-07-12 Raja R Harinath <rharinath@novell.com>
11519 * statement.cs (Block.Flags); Remove HasVarargs.
11520 (Block.HasVarargs): Move to ToplevelBlock.
11521 (Block.ThisVariable, Block.AddThisVariable): Likewise.
11522 (Block.Variables): Make protected. Initialize variable hashtable
11524 (Block.AddVariable): Update.
11525 (Block.Resolve): Update to changes.
11526 (ToplevelBlock.HasVarargs): New boolean.
11527 (ToplevelBlock.ThisVariable): Move here from Block.
11528 (ToplevelBlock.AddThisVariable): Likewise.
11529 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
11530 * expression.cs (This.ResolveBase): Update to changes.
11531 (ArglistAccess.DoResolve): Likewise.
11533 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11536 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11538 * class.cs (TypeContainer.VerifyMembers): Distinguish between
11539 not used and not used & assigned.
11540 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11542 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11545 * expression.cs (Is.DoResolve): null is never provided type.
11547 2005-07-08 Marek Safar <marek.safar@seznam.cz>
11550 * cs-parser.jay: Less strict event error rule to catch more errors.
11552 2005-07-08 Martin Baulig <martin@ximian.com>
11554 Fix test-iter-10.cs - distinguish whether we `yield' in a property
11555 gettter (allowed) or setter (not allowed).
11557 * class.cs (Accessor): Implement IIteratorContainer.
11558 (Accessor.Yields): New public field.
11559 (PropertyBase.PropertyMethod.Define): Handle iterators on a
11560 per-accessor basis.
11563 (get_accessor_declaration, set_accessor_declaration): Set the
11564 `yields' flag on the accessor, not the property.
11565 (property_declaration): Do the iterators check on a per-accessor
11566 basis and not for the whole property.
11568 2005-07-08 Martin Baulig <martin@ximian.com>
11570 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11571 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11573 2005-07-07 Marek Safar <marek.safar@seznam.cz>
11576 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11577 (ExtractSecurityPermissionSet): Cope with self referencing security
11578 attributes properly.
11580 * driver.cs (SetOutputFile): Made public property OutputFile.
11582 2005-07-07 Raja R Harinath <rharinath@novell.com>
11585 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11586 has_nonstatic_fields. Make into a FieldBase pointer.
11587 (TypeContainer.AddField): Add CS0282 check.
11588 (TypeContainer.EmitType): Update.
11590 2005-07-06 Miguel de Icaza <miguel@novell.com>
11592 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11593 compare if they start with __.
11595 2005-07-06 Raja R Harinath <rharinath@novell.com>
11597 * statement.cs (Switch.SwitchGoverningType): Only look at
11598 UserCasts that don't need implicit standard conversions to one of
11599 the allowed switch types (Fixes test-322.cs).
11600 (LocalInfo.Resolve): Re-enable sanity-test.
11602 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11604 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11606 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11608 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11610 2005-07-06 Raja R Harinath <rharinath@novell.com>
11613 * ecore.cs (SimpleName.GetSignatureForError): Add.
11614 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11615 (MemberAccess.GetSignatureForError): Add.
11617 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11619 The big error and warning messages review.
11649 * typemanager.cs: Updated.
11651 * class.cs: (MethodCore.SetYields): Moved here to share.
11652 (PropertyMethod.Define): Moved iterator setup here.
11654 * iterators.cs: Add orig_method to have full access to parent
11657 2005-07-05 Raja R Harinath <rharinath@novell.com>
11659 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11660 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11661 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11662 variable of struct type.
11663 * expression.cs (Unary.ResolveOperator): Update to change.
11664 (Indirection.VerifyFixed): Likewise.
11665 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11666 (ParameterReference.VerifyFixed): Value parameters are fixed.
11667 (This.VerifyFixed): Treat 'this' as a value parameter.
11668 * statement.cs (LocalInfo.IsFixed): Remove.
11670 2005-07-01 Martin Baulig <martin@ximian.com>
11672 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11673 `ec.EmitThis ()' to get the correct scope.
11675 2005-07-01 Martin Baulig <martin@ximian.com>
11677 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11678 instance is a ParameterReference; fixes #75299.
11680 2005-07-01 Martin Baulig <martin@ximian.com>
11682 Reverted Marek's latest patch (r46725):
11683 - it contains structural changes which are neither mentioned in
11684 the ChangeLog nor explained anywhere; for example the additional
11685 argument of EmitContext's and Iterator's .ctor's and the
11686 TypeContainer.DefineMembers() change.
11687 - structural changes like this should go in in seperate patches
11688 and not be hidden in a huge patch which just seems to affect
11689 warnings and errors.
11690 a big and hard to understand patch.
11691 - it breaks iterators and causes regressions, for instance in
11694 2005-06-30 Raja R Harinath <rharinath@novell.com>
11697 * expression.cs (Indexers.map): Remove.
11698 (Indexers.Append): Filter out inaccessible setters and getters.
11699 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11702 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11703 Refactored from ...
11704 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11705 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11706 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11707 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11709 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11712 * class.cs (FieldBase.GetInitializerExpression): One more field
11715 2005-06-28 Miguel de Icaza <miguel@novell.com>
11717 * pending.cs: Do not define a proxy if the base method is virtual,
11718 it will be picked up by the runtime (bug 75270).
11720 2005-06-08 Martin Baulig <martin@ximian.com>
11722 The big Iterators rewrite :-)
11724 * iterators.cs: Rewrite this to use the anonymous methods framework.
11726 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11727 before the TypeContainers; see 2test-21.cs.
11730 (TypeContainer.DefineType): Don't create a new EmitContext if we
11731 already have one (this only happens if we're an Iterator).
11732 (TypeContainer.Define): Also call Define() on all our iterators.
11733 (Method.CreateEmitContext): Added support for iterators.
11736 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11737 (AnonymousContainer.CreateMethodHost): Moved here from
11738 AnonymousMethod and made abstract.
11739 (AnonymousContainer.CreateScopeType): New abstract method.
11740 (AnonymousContainer.IsIterator): New public property.
11741 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11742 get the ScopeTypeBuilder rather than manually defining it here.
11743 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11746 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11747 before RootContext.DefineTypes().
11749 * codegen.cs (EmitContext.RemapToProxy): Removed.
11750 (EmitContext.CurrentAnonymousMethod): Changed type from
11751 AnonymousMethod -> AnonymousContainer.
11752 (EmitContext.ResolveTopBlock): Protect from being called twice.
11753 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11754 (EmitContext.EmitThis): Removed the iterators hacks; use the
11755 anonymous methods framework for that.
11758 (ToplevelBlock.Container): Make this a property, not a field.
11759 (ToplevelBlock.ReParent): New public method; move the
11760 ToplevelBlock into a new container.
11761 (Foreach.TemporaryVariable): Simplify.
11763 2005-06-05 Martin Baulig <martin@ximian.com>
11765 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11766 (Block.AddTemporaryVariable): New public method; creates a new
11767 `LocalInfo' for a temporary variable.
11768 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11770 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11771 non-iterator variables.
11773 2005-06-05 Martin Baulig <martin@ximian.com>
11775 * statement.cs (Foreach.TemporaryVariable): Create the
11776 LocalBuilder in the Emit phase and not in Resolve since in some
11777 situations, we don't have an ILGenerator during Resolve; see
11778 2test-19.cs for an example.
11780 2005-06-04 Martin Baulig <martin@ximian.com>
11782 **** Merged r45395 from GCS ****
11784 The big Foreach rewrite - Part II.
11786 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11787 with `PropertyInfo ienumerator_getcurrent'.
11789 * codegen.cs (VariableStorage): Removed.
11792 (Foreach): Derive from Statement, not ExceptionStatement.
11793 (Foreach.CollectionForeach): New nested class. Moved all the code
11794 dealing with collection foreach here.
11795 (Foreach.ForeachHelperMethods): Removed.
11796 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11798 2005-05-23 Martin Baulig <martin@ximian.com>
11800 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11801 don't need to. Fix #75014.
11803 2005-05-20 Martin Baulig <martin@ximian.com>
11805 Merged r44808 from GMCS.
11807 * class.cs (TypeContainer.CircularDepException): Removed.
11808 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11809 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11810 (CS0146) and interface (CS0529) dependencies here.
11812 2005-06-21 Raja R Harinath <rharinath@novell.com>
11814 * expression.cs (Invocation.EmitCall): Fix initialization
11815 'this_call' to reflect current behaviour. Fix indentation.
11817 * convert.cs (FindMostEncompassedType): Add two trivial special
11818 cases (number_of_types == 0 || number_of_types == 1).
11819 (FindMostEncompasingType): Likewise.
11821 2005-06-17 Raja R Harinath <rharinath@novell.com>
11823 Some cleanups preparing for the fix of #75283.
11824 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11826 (EventExpr.InstanceResolve): Likewise.
11827 (EventExpr.DoResolve): Remove redundant checks.
11829 2005-06-10 Duncan Mak <duncan@novell.com>
11831 * cs-tokenizer.cs (process_directives): New flag for controlling
11832 the processing of preprocessor directives.
11833 (x_token): After seeing a '#', return Token.NONE instead of going
11834 to handle_preprocessing_directive() when not processing
11835 directives. This avoids unnecessary processing during the token peek in
11840 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11841 the existing error reporting methods instead of Report.Error.
11843 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11844 after Raja's rewrite.
11846 2005-06-08 Miguel de Icaza <miguel@novell.com>
11848 * class.cs: Small fix.
11850 2005-06-08 Raja R Harinath <rharinath@novell.com>
11853 * class.cs (GetPartialBases): Fix return value check of
11854 part.GetClassBases.
11856 2005-06-07 Raja R Harinath <rharinath@novell.com>
11858 Ensure that partial classes are registered in their enclosing
11859 namespace. Initial part of fix of #75160.
11860 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11861 Register declspace with namespace here, not in
11862 DeclSpace.RecordDecl.
11863 * cs-parser.jay: Pass namespace to RecordDecl.
11864 * class.cs (PartialContainer.Create): Likewise.
11865 (ClassPart.DefineType): New sanity-check. Throws an exception if
11867 * decl.cs (Declspace.RecordDecl): Remove.
11868 * namespace.cs (NamespaceEntry.DefineName): Remove.
11870 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11872 * rootcontext.cs: Reset TargetExt as well.
11874 2005-06-03 Raja R Harinath <rharinath@novell.com>
11876 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11877 -langversion:ISO-1.
11879 2005-06-02 Raja R Harinath <rharinath@novell.com>
11881 Fix #75080, cs0119.cs.
11882 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11884 (Expression.Resolve): ... this. Use it. Remove bogus code
11885 allowing ExprClass.Type and ExprClass.Namespace for
11886 ResolveFlags.VariableOrValue.
11887 (Expression.Resolve) [1-argument variant]: Change default resolve
11888 flags based on language version.
11889 (Expression.Error_UnexpectedKind): Use a simple string array
11890 rather than an ArrayList.
11891 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11892 not ExprClass.Type.
11893 (TypeOfVoid.DoResolve): Likewise.
11894 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11895 flags argument -- it always has the same value.
11897 2005-05-31 Raja R Harinath <rharinath@novell.com>
11900 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11901 Use it in the error message.
11902 * assign.cs, expression.cs, statement.cs: Update.
11904 2005-05-30 Raja R Harinath <rharinath@novell.com>
11907 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11908 the "almostMatchedMember" case too.
11909 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11910 that failed the accessibility checks to 'almost_match'.
11912 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11914 * attribute.cs: Use internal MethodBuilder methods to set
11915 ExactSpelling and SetLastError on PInvoke methods, instead
11916 of passing them via charset. Fixes #75060.
11918 2005-05-27 Raja R Harinath <rharinath@novell.com>
11920 * parameter.cs (Parameter): Remove TODO comment.
11921 (Parameter.DefineParameter): Remove Location parameter.
11922 (Parameters.LabelParameters): Likewise.
11923 * class.cs (Constructor.Emit): Update to change.
11924 (MethodData.Emit): Likewise.
11925 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11926 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11928 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11931 Removed Parameters.Location and added Parameter.Location instead.
11932 Removed Location parameter from Emit() and GetSignature().
11939 Modified all related calls.
11941 2005-05-26 Raja R Harinath <rharinath@novell.com>
11943 Improve user-defined conversion handling.
11944 * convert.cs (GetConversionOperators): Rewrite. Return only the
11945 applicable operators.
11946 (AddConversionOperators): New. Helper for GetConversionOperators.
11947 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11948 there is only one most encompassed/encompassing type.
11949 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11950 "applicable operator" handling.
11951 (UserConversion): Move cache here from GetConversionOperators.
11952 Directly cache the chosen operator, rather than the whole
11954 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11955 case. Allow conversion of decimal to sbyte and byte too.
11956 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11957 New static methods. Used to avoid allocating EmptyExpressions in
11960 2005-05-24 Duncan Mak <duncan@novell.com>
11962 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11963 another class, used in Convert.ExplicitNumericConversion.
11964 (CastToDecimal): New class, similar to above, but casts to
11965 System.Decimal, used in Convert.ImplicitNumericConversion and also
11966 in explicit convesion from double/float to decimal.
11968 * convert.cs (ImplicitNumericConversion): Handle implicit
11969 conversions to System.Decimal.
11970 (ExplicitNumericConversion): handle explicit conversions to
11975 2005-05-20 Miguel de Icaza <miguel@novell.com>
11977 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11978 know the type at this stage, just break through. Fixes #75008
11980 2005-05-19 Martin Baulig <martin@ximian.com>
11983 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11984 to disable error reporting.
11986 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11987 here since we don't want to report an error; see the new test-336.cs.
11989 2005-05-19 Raja R Harinath <rharinath@novell.com>
11991 * statement.cs (ToplevelBlock.GetParameterReference)
11992 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11993 Move here from class Block.
11994 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11995 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11997 2005-05-18 Martin Baulig <martin@ximian.com>
12002 (FlowBranching.Reachability): Add non-static public And() and Or()
12004 (FlowBranchingSwitch): New class; do the `break_origins' thing
12005 like in FlowBranchingLoop.
12006 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12007 reachability, not just locals and parameters.
12008 (FlowBranching.MergeChild): Remove some of the hacks for loop and
12009 switch; MergeBreakOrigins() now takes care of that.
12011 2005-05-18 Martin Baulig <martin@ximian.com>
12013 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12014 a loop and may leave it, reset the barrier; fixes #74974.
12016 2005-05-17 Marek Safar <marek.safar@seznam.cz>
12018 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12021 * cs-parser.jay: Catch more lexical errors.
12023 * report.cs: Add one more Error method.
12026 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12028 2005-05-17 Martin Baulig <martin@ximian.com>
12030 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12033 2005-05-16 Raja R Harinath <rharinath@novell.com>
12035 Fix test-382.cs. Emit values of decimal constants.
12036 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12038 (TypeContainer.AddField): ... this.
12039 (TypeContainer.EmitFieldInitializers): Allow the list of fields
12040 with initializers to include 'Const's.
12041 (ClassPart.RegisterFieldForInitialization): Forward to
12043 * const.cs (Const.Const): Pass initializer to base class.
12044 (Const.Define): In case of decimal constants, register them for
12045 initialization in a static constructor.
12047 2005-05-14 Martin Baulig <martin@ximian.com>
12049 * statement.cs (Block.Resolve): Correctly handle unreachable code;
12050 do not call ResolveUnreachable() on unreachable statements in
12051 here, see the comment in the source code.
12053 2005-05-13 Raja R Harinath <rharinath@novell.com>
12056 * expression.cs (BinaryResolveOperator): If one of the operands of
12057 an equality comparison is 'null' and the other is a pointer type,
12058 convert the null to a NullPointer.
12059 * convert.cs (ImplicitReferenceConversion): If the expression is a
12060 NullLiteral and the target type is a pointer type, return a
12061 NullPointer instead.
12062 (ImplicitConversionStandard): Likewise.
12064 2005-05-13 Marek Safar <marek.safar@seznam.cz>
12066 * cs-parser.jay: Set readonly context based on special constructs.
12068 * expression.cs (LocalVariableReference.DoResolveBase): Improved
12069 readonly variable error handling.
12071 * rootcontext.cs (EmitCode): Don't verify members when error
12074 * statement.cs (LocalInfo): Add reaodnly context information.
12075 (SetReadOnlyContext, GetReadOnlyContext): New methods.
12077 2005-05-13 Raja R Harinath <rharinath@novell.com>
12079 * statement.cs (Block.Resolve): Revert change below. Modify fix
12080 for #74041 to initialize 'resolved' to false only for explicit
12081 blocks. Fixes #74873.
12083 2005-05-12 Raja R Harinath <harinath@gmail.com>
12086 * typemanager.cs (unmanaged_enclosing_types): New.
12087 (IsUnmanagedType): Avoid infloops by using
12088 'unmanaged_enclosing_types' to talk with recursive invocations.
12090 2005-05-13 Martin Baulig <martin@ximian.com>
12092 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12093 instance variable, not a local. Fix #74873.
12094 (Block.ResolveUnreachable): Set it to true here.
12096 2005-05-11 Duncan Mak <duncan@novell.com>
12098 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12099 continuing to process for 'arg'.
12100 (handle_preprocessing_directive): Check the argument of the #endif
12101 directive and report error CS1025 if there are any trailing
12104 According to the C# spec, having even whitespace after the #endif
12105 directive is illegal; however, because we call arg.TrimEnd ()
12106 beforehand, we have the same behavior as csc, allowing whitespace
12107 after the directive.
12111 2005-05-11 Marek Safar <marek.safar@seznam.cz>
12115 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12116 (Constructor.GetObsoleteAttribute): Implemented correctly.
12118 2005-05-10 Martin Baulig <martin@ximian.com>
12120 * support.cs (ReflectionParameters.ParameterModifier): Use
12121 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12122 and `ParameterAttributes.In'. Fixes #74884.
12124 2005-05-10 Marek Safar <marek.safar@seznam.cz>
12126 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12128 * expression.cs (Argument.GetParameterModifier): Turned to property.
12129 (Invocation.Error_InvalidArguments): Add more descriptive errors.
12131 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12134 2005-05-09 Raja R Harinath <rharinath@novell.com>
12137 * decl.cs (MemberCache.AddMethods): Register override methods,
12138 rather than non-override methods.
12139 * typemanager.cs (RegisterOverride): New.
12140 (IsOverride): Update.
12142 2005-05-09 Marek Safar <marek.safar@seznam.cz>
12146 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12147 recursive declaration.
12149 * statement.cs (Block.ResolveMeta): Report any error in resolving.
12151 2005-05-06 Marek Safar <marek.safar@seznam.cz>
12153 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12155 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12157 2005-05-05 Raja R Harinath <rharinath@novell.com>
12160 * decl.cs (DeclSpace.FamilyAccessible):
12161 Use TypeManager.IsNestedFamilyAccessible.
12163 Fix reopened #64812.
12164 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12167 2005-05-04 Raja R Harinath <rharinath@novell.com>
12168 Abin Thomas <projectmonokochi@rediffmail.com>
12169 Anoob V E <projectmonokochi@rediffmail.com>
12170 Harilal P R <projectmonokochi@rediffmail.com>
12173 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12174 allow access to all static members.
12176 2005-05-04 Martin Baulig <martin@ximian.com>
12178 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12180 2005-05-04 Martin Baulig <martin@ximian.com>
12184 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12185 section at the end; make things work if `default' is not the last
12188 2005-05-04 Martin Baulig <martin@ximian.com>
12192 * statement.cs (Switch): Replaced the `got_default' field with a
12193 `default_section' one.
12194 (Switch.CheckSwitch): Set `default_section' here.
12195 (Switch.Resolve): If we're a constant switch and the constant is
12196 not found, use the default section.
12198 2005-05-03 Martin Baulig <martin@ximian.com>
12200 * expression.cs (ArrayAccess.EmitGetLength): New public method.
12202 * statement.cs (Foreach.ArrayForeach): New nested class.
12203 (Foreach.TemporaryVariable): New nested class.
12204 (Foreach.EmitArrayForeach): Removed; this is now in the new
12205 ArrayForeach class.
12207 2005-05-03 Raja R Harinath <rharinath@novell.com>
12209 * pending.cs (BaseImplements): Move the #74773 fix here. This is
12211 (VerifyPendingMethods): Revert change below.
12213 * typemanager.cs (IsOverride, RegisterNonOverride): New.
12214 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12215 that used to trigger warning -28. Remove warning -28.
12216 * expression.cs (Invocation.OverloadResolve): Use
12217 TypeManager.IsOverride to distinguish override methods.
12220 * pending.cs (VerifyPendingMethods): If a base type implements the
12221 requested interface, don't bother checking individual methods of
12222 the base type. As a side-effect, this prevents the creation of
12223 unnecessary proxies.
12225 2005-05-02 Martin Baulig <martin@ximian.com>
12229 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12230 Also `And' the locals if the old vector is null.
12231 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12232 null; in this case we basically reset all the variables.
12234 2005-05-02 Martin Baulig <martin@ximian.com>
12238 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12239 Added `FlowBranching branching' argument; always `and' the
12240 variables instead of `or'ing them unless we're an infinite loop.
12242 * statement.cs (While.Resolve): Create a new sibling unless we're
12245 2005-05-02 Martin Baulig <martin@ximian.com>
12249 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12250 arguments; use it instead of creating a new TopLevelBlock.
12251 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12252 our ConstructorInitializer.
12255 (TopLevelBlock.TopLevelBranching): New public property.
12256 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12257 and create our `TopLevelBranching'.
12259 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12260 anonymous method host, use `block.TopLevelBranching' rather than
12261 creating a new branching.
12263 2005-04-20 Miguel de Icaza <miguel@novell.com>
12265 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12266 a ScopeInfo, if any of the current children is a child of the new
12267 entry, move those children there.
12269 2005-04-30 Martin Baulig <martin@ximian.com>
12271 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12272 at the beginning of a SwitchSection. Fix #73335.
12274 2005-04-27 Marek Safar <marek.safar@seznam.cz>
12277 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12279 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12280 (FieldExpr.DoResolve): Obsolete members are ignored for field
12283 2005-04-26 Marek Safar <marek.safar@seznam.cz>
12285 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12286 of arrays detection.
12288 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12290 (Field.VerifyClsCompliance): Volatile fields are not compliant.
12292 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12295 2005-04-25 Ben Maurer <bmaurer@ximian.com>
12297 * cs-parser.jay: Use the prefered version of -unsafe in error
12300 2005-04-22 Marek Safar <marek.safar@seznam.cz>
12302 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12305 2005-04-20 John Luke <john.luke@gmail.com>
12307 * driver.cs: fix typo in error message, --outout to --output
12309 2005-04-20 Marek Safar <marek.safar@seznam.cz>
12311 * codegen.cs (InRefOutArgumentResolving): New field.
12313 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12314 fields outside contructor.
12316 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12318 2005-04-19 Miguel de Icaza <miguel@novell.com>
12320 * anonymous.cs (CaptureContext.EmitParameterInstance): The
12321 parameter code was not completed ever, so it was not as up-to-date
12322 as local variables. Must finish it.
12324 The bug fix was to compare the Toplevel of the block, not the
12325 current block. Thanks for Ben for pointing this out.
12327 2005-04-19 Raja R Harinath <rharinath@novell.com>
12329 * decl.cs (AddMethods): Use the declaring type of the problem
12330 method to determine if we want to squash a warning.
12332 2005-04-19 Marek Safar <marek.safar@seznam.cz>
12334 * attribute.cs: Removed debug output.
12336 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12338 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12341 2005-04-18 Raja R Harinath <rharinath@novell.com>
12344 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12345 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12346 all null comparisons against reference types.
12348 2005-04-18 Marek Safar <marek.safar@seznam.cz>
12351 * class.cs (TypeContainer.CircularDepException) New nested
12353 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12354 (TypeContainer.DefineType): Removed error, reset InTransit before
12356 (Class.DefineType): Throw exception when is in Transit.
12357 Catch exception and report error.
12358 (Struct.DefineType): Throw exception when is in Transit.
12359 Catch exception and report error.
12360 (Interface.DefineType): Throw exception when is in Transit.
12361 Catch exception and report error.
12363 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12364 handle nested exception handlers.
12366 * flowanalysis.cs (InTryWithCatch): New method, search for try with
12369 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12370 InFinally and InCatch storage.
12372 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12373 (Catch.Resolve): Set and Restore ec.InCatch.
12374 (Try.Resolve): Set and Restore ec.InFinally.
12375 (Try.HasCatch): True when try has catch.
12377 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
12379 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12380 for the same event member, so exclude such cases from warning 419.
12383 2005-04-16 Miguel de Icaza <miguel@novell.com>
12385 * expression.cs (Binary.ResolveOperator): Apply patch from John
12386 Luke to fix bug 59864: operators &, | and ^ on enumerations
12387 require that the same enum type on both sides.
12389 * driver.cs: Add warnings to old flag usage, this is to assist
12390 people who produce Makefiles and hope that the Makefiles will be
12393 * class.cs (TypeContainer.EmitType): Moved the definition of the
12394 special $PRIVATE$ field from the resolve phase to the Emit phase.
12395 During resolve we do not know if we are a struct with
12396 HasExplicitLayout, we know this only after the attributes for the
12399 Set the FieldOffset to zero on the dummy field that we create for
12400 the class. Fixes 74590.
12402 2005-04-16 Raja R Harinath <rharinath@novell.com>
12405 * ecore.cs (PropertyExpr.resolved): New.
12406 (DoResolve): Use it to handle a case of double resolution here.
12407 Handle a case of identical-name-and-type-name.
12408 * expression.cs (ArrayCreation.CheckIndices): Avoid double
12409 resolution by storing the results of expression resolution back
12410 into the "probes" array.
12412 2005-04-15 Raja R Harinath <rharinath@novell.com>
12414 Fix cs0208-7.cs and cs0208-8.cs.
12415 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12416 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
12417 error reporting to point out the reason a struct is not unmanaged.
12419 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12421 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
12422 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12424 2005-04-13 Raja R Harinath <rharinath@novell.com>
12427 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12428 IdenticalNameAndTypeName here.
12429 (EventExpr.InstanceResolve): Likewise.
12431 2005-04-13 Marek Safar <marek.safar@seznam.cz>
12433 C# 2.0 DefaultCharSetAttribute implementation
12435 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12436 which allows us to set GlobalNamespace for every resolve.
12437 (Attribute.ResolveArguments): Cut from Resolve.
12438 (Attribute.GetCharSetValue): Returns CharSet named argument.
12439 (Attribute.DefinePInvokeMethod): Gets default charset from
12441 (GlobalAttribute.ResolveAsTypeStep): Override.
12442 (GlobalAttribute.ResolveArguments): Override.
12444 * class.cs (TypeAttr): Is protected.
12446 * codegen.cs (ModuleClass.DefaultCharSet): New member.
12447 (ModuleClass.DefaultCharSetType): New memeber.
12448 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12450 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12451 charset from module.
12453 * delegate.cs (TypeAttr): Override.
12454 (Delegate.DefineType): Use this TypeAttr.
12456 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12457 at very early stage (before types are defined) to resolve model
12458 module attributes. It will probably not work with corlib but it
12461 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12462 charset from module.
12464 * typemanager.cs (default_charset_type): New type.
12466 2005-04-13 Raja R Harinath <rharinath@novell.com>
12468 * decl.cs (MemberCache.AddMethods): Don't warn if
12469 System.Object.Finalize has buggy MethodAttributes.
12471 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12474 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12476 * doc.cs : detect ambiguous reference to overloaded members.
12477 Fixed bug #71603. MS 1.1 csc does not detect it.
12479 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12481 * doc.cs : delegates must not be referenced with parameters.
12484 2005-04-12 Miguel de Icaza <miguel@novell.com>
12486 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12488 2005-04-10 Miguel de Icaza <miguel@novell.com>
12490 * driver.cs (MainDriver): Stop processing if the CLS stage found
12493 (CompilerCallableEntryPoint.InvokeCompiler): Always
12494 reset after execution; Take a TextWriter argument for the
12497 * report.cs: Use the error stream instead of hardcoding stderr.
12499 2005-04-09 Miguel de Icaza <miguel@novell.com>
12501 * class.cs: Reduce code paths to test, too small of an
12502 optimization to make it worth the extra testing. Always perform
12505 2005-04-08 Raja R Harinath <rharinath@novell.com>
12508 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12509 operators that had errors reported on them.
12511 2005-04-08 Marek Safar <marek.safar@seznam.cz>
12513 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12515 (Attribute.Resolve): Add named argument type checking.
12517 * class.cs (FixedField.Define): Use IsPrimitiveType
12519 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12521 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12522 unsafe parameter types.
12524 * statement.cs (Using.ResolveExpression): Add better error description.
12526 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12528 2005-04-08 Raja R Harinath <rharinath@novell.com>
12531 * attribute.cs (Attribute.GetAttributeUsage): Resolve
12532 AttributeUsageAttribute in the emitcontext of the attribute class,
12533 not in the emitcontext of the attributable entity it was attached to.
12534 * cs-parser.jay: Use 'current_class', not 'current_container',
12535 when creating a GlobalAttribute.
12537 2005-04-08 Alp Toker <alp@atoker.com>
12539 * pending.cs: The fix to #58413 failed to compile methods implementing
12540 interfaces with/without params modifiers and vice versa, even though
12541 params modifiers aren't part of the signature. Make the modifier check
12542 less strict as in csc.
12544 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
12545 Anoob V E <projectmonokochi@rediffmail.com>
12546 Harilal P R <projectmonokochi@rediffmail.com>
12549 * pending.cs (TypeAndMethods.mods): New. Store the parameter
12550 modifiers of pending methods.
12551 (PendingImplementation.PendingImplementation): Initialize it.
12552 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12553 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12554 with ParameterData. Add check for modifiers.
12555 * class.cs (MethodData.Define): Update to changes.
12557 2005-04-07 Raja R Harinath <rharinath@novell.com>
12559 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12561 2005-04-07 Marek Safar <marek.safar@seznam.cz>
12563 * class.cs (PropertyMethod.Define): Check private accessor in abstract
12566 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12569 * typemanager.cs: Registered RequiredAttributeAttribute.
12571 2005-04-06 Marek Safar <marek.safar@seznam.cz>
12573 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12574 Warning CS0169 is back at level 3.
12575 (IMethodData.SetMemberIsUsed): New method.
12577 * decl.cs (IsUsed): New value; moved from FieldBase.Status
12578 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12580 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12582 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12584 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12587 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12590 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12591 to avoid the problems with nested types.
12593 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12594 Anoob V.E <projectmonokochi@rediffmail.com>
12595 Harilal P.R <projectmonokochi@rediffmail.com>
12596 Raja R Harinath <rharinath@novell.com>
12599 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12601 * typemanager (GetConstructor): Make public.
12603 2005-04-05 John Luke <john.luke@gmail.com>
12604 Raja R Harinath <rharinath@novell.com>
12607 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12608 struct too. Return false quicker in a few cases.
12609 (VerifyUnManaged): Use it.
12611 2005-04-05 Raja R Harinath <rharinath@novell.com>
12614 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12615 not 'unreachable_seen'.
12617 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12619 * attribute.cs (Attribute.GetValue): Removed unused.
12621 * codegen.cs (CodeGen.TrimExt): Removed unused.
12623 * cs-parser.jay (output): Removed unused.
12625 * cs-tokenizer.cs (hex_digits): Removed unused.
12627 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12629 * expression.cs (Indirection.LoadExprValue): Removed unused.
12630 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12632 * iterators.cs (Iterator.param_types): Removed unused.
12634 * statement.cs (Goto.block): Removed unused.
12635 (ToplevelBlock.did): Removed unused.
12636 (Switch.ResolveConstantSwitch): Removed unused.
12638 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12640 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12643 2005-04-01 Raja R Harinath <rharinath@novell.com>
12645 Fix #74232 and cs0208-3.cs.
12646 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12647 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12648 unmanaged type. Don't use FieldBuilders when 't' is a
12649 TypeBuilder. Use ModFlags and MemberType fields.
12650 * class.cs (MemberBase.member_type): Rename from MemberType.
12651 (MemberBase.MemberType): New property. Determines member_type on
12653 (MemberBase.DoDefine): Don't initialize MemberType here.
12654 (FieldMember.Define): Likewise.
12656 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12659 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12660 Attributes are emitted there.
12662 2005-04-01 Raja R Harinath <rharinath@novell.com>
12664 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12665 keyword in 'partial enum' too.
12666 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12668 Report from Kamil Skalski <nazgul@omega.pl>.
12671 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12672 have partial containers too.
12674 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12675 in block' checks to Block.CheckInvariantMeaningInBlock.
12676 * statement.cs (Block.GetKnownVariableInfo): Make private.
12677 (Block.IsVariableUsedInChildBlock): Remove.
12678 (Block.IsVariableUsedInBlock): Likewise.
12679 (Block.CheckInvariantMeaningInBlock): New. Show location of
12680 conflicting declaration.
12681 (Block.AddVariable): Make error messages less long-winded and more
12682 specific. Show location of conflicting declaration.
12683 * parameter.cs (Parameters.Location): New readonly property.
12685 2005-03-31 Raja R Harinath <rharinath@novell.com>
12687 Clean up semantics of invoking ResolveMemberAccess.
12688 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12689 can have an instance, ensure that we pass in a non-TypeExpression
12690 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12691 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12692 argument. Update to changes and simplify.
12693 (FieldExpr.Emitinstance): Remove CS0120 check.
12694 (PropertyExpr.EmitInstance): Likewise.
12695 * expression.cs (Argument.Resolve): Likewise.
12696 (Invocation.DoResolve): Update to changes in semantics of
12697 InstanceExpression.
12699 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12702 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12705 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12707 2005-03-31 Raja R Harinath <rharinath@novell.com>
12709 Fix difference in behaviour with commandline invocation.
12710 * driver.cs (Driver.Reset): New.
12711 (CompilerCallableEntryPoint): Call it.
12713 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12714 variable" warnings if the boolean expression failed to resolve.
12716 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12718 * attribute.cs: Fix the union of several permissions when some of them
12719 are unrestricted (so the result isn't an unrestricted permission set).
12722 2005-03-30 Raja R Harinath <rharinath@novell.com>
12724 * ecore.cs (MemberExpr): New class. Convert from interface
12726 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12727 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12729 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12730 (MethodGroupExpr.IsExplicitImpl): Remove.
12731 (Expression.GetFieldFromEvent): Remove.
12732 (SimpleName.MemberStaticCheck): Remove.
12733 (SimpleName.DoSimpleNameResolve): Update to changes.
12734 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12735 (MemberAccess.IdenticalNameAndTypeName): Remove.
12736 (MemberAccess.error176): Move to MemberExpr.
12737 (MemberAccess.DoResolve): Update to changes.
12738 (BaseAccess.DoResolve): Likewise.
12740 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12742 C# 2.0 Conditional attribute class implementation
12744 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12745 Analyzes class whether it has attribute which has ConditionalAttribute
12746 and its condition is not defined.
12748 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12749 (Class.IsExcluded): New method. Search for at least one defined
12750 condition in ConditionalAttribute of attribute class.
12752 2005-03-30 Raja R Harinath <rharinath@novell.com>
12754 * ecore.cs (PropertyExpr): Derive from Expression, not
12755 ExpressionStatement.
12756 (PropertyExpr.EmitStatement): Remove.
12758 2005-03-29 Raja R Harinath <rharinath@novell.com>
12761 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12762 internal field "value__" of an enum be private. The examples for
12763 "value__" that I found on MSDN all used FieldAttributes.Private.
12765 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12766 Don't mention IL method attribute names.
12768 Fix #47991. Remove a TODO.
12769 * statement.cs (Block.Toplevel): Make into a field.
12770 (Block.Parameters): Move into ToplevelBlock.
12771 (Block.known_variables): Rename from child_variable_names.
12772 (Block.Block): Remove variants that take Parameters. Initialize
12773 'Toplevel' with the immediately surrounding toplevel block.
12774 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12775 LocalInfo parameter.
12776 (Block.GetKnownVariableInfo): New.
12777 (Block.IsVariableNameUsedInChildBlock): Update.
12778 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12779 the block, even though it may not be in scope.
12780 (Block.AddVariable): Remove Parameters parameter. Use
12781 Toplevel.Parameters instead.
12782 (Block.AddConstant): Remove Parameters parameter.
12783 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12784 (Block.IsParamaterReference): Likewise.
12785 (Block.IsLocalParameter): Likewise. Simplify a lot.
12786 (ToplevelBlock.Parameters): New. Moved from Block.
12787 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12788 initialize Parameters to a non-null value.
12789 * cs-parser.jay: Update to changes.
12790 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12791 simple names that mean different things in the same block. Use
12792 Block.IsVariableNameUsedInBlock.
12794 2005-03-28 Raja R Harinath <rharinath@novell.com>
12796 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12797 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12798 GetTypeHandle. It is possible for a reflected type to derive from
12799 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12800 System.Array during mscorlib compilation).
12801 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12802 contain a method_hash, don't create one either. Don't create a
12803 deep copy of the base cache's method_hash.
12804 (MemberCache.SetupCache): Rename back from DeepCopy.
12805 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12806 already initialized. If we see an override function, add its
12807 underlying base virtual function to the member_hash too.
12809 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12811 2005-03-26 Raja R Harinath <harinath@acm.org>
12814 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12815 fails to resolve, ensure that the LHS is still resolved as an
12818 2005-03-25 Raja R Harinath <harinath@acm.org>
12820 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12822 (Enum.current_ec): Remove.
12823 (Enum.LookupEnumValue): Remove EmitContext argument.
12824 Just uses the one created during DefineType.
12825 (Enum.FindMembers): Update.
12826 * expression.cs (MemberAccess.DoResolve): Update.
12828 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12830 * assign.cs (Assign.DoResolve): Check for CS1717 when
12831 source and target are same (uses Equals).
12833 * expression.cs (LocalVariableReference, ParameterReference,
12834 This): Implemented Equals, GetHashCode.
12836 * statement.cs (Block.GetParameterReference): Removed useless
12839 2005-03-22 Raja R Harinath <rharinath@novell.com>
12842 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12843 blocks before deciding whether the error is cs0136 or cs0128.
12845 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12846 (using_alias_directive, using_namespace_directive): Pass
12847 MemberName, not an expression to Namespace.UsingAlias and
12849 (MakeName): Use the MemberName of the namespace.
12850 * namespace.cs (Namespace.MemberName): New.
12851 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12852 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12854 * decl.cs (MemberName.Name): Make readonly.
12855 (MemberName.FromDotted): New "constructor".
12856 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12857 (MemberCore.Name): Compute from MemberName on demand.
12858 (MemberCore.SetMemberName): Provide a way to change the
12860 (MemberCore.AddToContainer): Don't take a fullname parameter.
12861 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12862 fully qualified name of the container to the member name.
12863 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12864 only if the type is a member of the root container.
12865 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12866 MemberName.Left rather than searching for an embedded ".".
12867 (PartialContainer.CreatePart): Update to changes in RootContext.
12868 (MemberBase.ShortName): Turn into a property. Use
12869 MemberCore.SetMemberName.
12870 (MemberBase.ExplicitInterfaceName): Remove.
12871 (MemberBase.UpdateMemberName): Remove.
12872 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12873 (PropertyBase.SetMemberName): New override.
12874 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12875 (Tree.GetDecl): New.
12876 (Tree.AllDecls): Rename from Decls.
12877 * attribute.cs, enum.cs, report.cs: Update to changes.
12878 * driver.cs (MainDriver): Use MemberName.FromDotted on
12879 RootContext.MainClass.
12881 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12883 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12886 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12888 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12890 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12891 property accessor modifiers.
12893 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12894 fixed buffer attribute (CS1716).
12895 (PropertyMethod.HasCustomAccessModifier): When property accessor
12896 has custom modifier.
12898 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12900 (PropertyExpr.DoResolveLValue): Add CS0272.
12902 2005-03-17 Miguel de Icaza <miguel@novell.com>
12904 * convert.cs: When converting to a pointer, use the proper Conv.U
12905 or Conv.I depending on the source data type.
12907 * cs-tokenizer.cs: Make the size for large decimal constants,
12910 2005-03-17 Martin Baulig <martin@ximian.com>
12912 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12913 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12915 2005-03-17 Martin Baulig <martin@ximian.com>
12917 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12918 to bool so we can return an error condition.
12919 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12922 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12924 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12927 2005-03-16 Raja R Harinath <rharinath@novell.com>
12929 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12930 Refactor to avoid traversing the list of assemblies, and to avoid
12931 string concatenation.
12932 * typemanager.cs (guid_attr_type): Remove.
12933 (negative_hits, pointers, references): Remove hashes.
12935 (GetConstructedType): New. Uses type_hash to handle constructed
12936 types (arrays, references, pointers).
12937 (GetReferenceType, GetPointerType): Use it.
12938 (GetNestedType): New. Uses type_hash to handle nested types of
12940 (LookupType, LookupTypeDirect): Remove.
12941 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12942 'types' hash and LookupTypeReflection directly.
12943 (params_string, params_object): Use GetConstructedType.
12944 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12946 (Namespace.Lookup): Use cached_types.
12947 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12948 provided by old TypeManager.LookupType.
12949 * rootcontext.cs (MakeFQN): Remove.
12950 * decl.cs (DeclSpace.MakeFQN): Likewise.
12951 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12952 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12953 TypeManager.GetConstructedType.
12954 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12956 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12958 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12961 * cs-parser.jay: Reports CS1527 for any namespace element.
12963 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12966 * expression.cs (ParameterReference.IsAssigned): Changed error to
12968 (Error_WrongNumArguments): Moved CS0245 detection here.
12970 * statement.cs (Return.Resolve): Add CS1622 report.
12972 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12974 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12976 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12978 * attribute.cs expression.cs: Get rid of some allocations.
12980 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12982 * doc.cs : just eliminate the latest change.
12984 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12986 * doc.cs : commented out the latest change. It breaks xml-030.cs
12988 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12990 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12991 fail. So invoke CreateType() in FindDocumentedType().
12993 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12995 * cs-tokenizer.cs : added IsKeyword().
12996 * doc.cs : Detect keyword incorrectly used as identifier.
12997 Allow identifiers prefixed by @.
12999 2005-03-10 Marek Safar <marek.safar@seznam.cz>
13001 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13002 It caused exception in namespace resolving (again!).
13004 * class.cs (Class.ctor): Removed exit.
13005 (PropertyMethod.ctor): ditto.
13007 * codegen.cs (Codegen.Reset): Reset static data.
13008 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13010 * cs-tokenizer.cs (Cleanup): Removed.
13012 * driver.cs (GetSystemDir): Rewrote to one line command.
13013 It caused problem with unloaded dynamic modules.
13014 (UnixParseOption): Removed Exit.
13015 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13016 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13017 Now can be mcs used as library.
13019 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13022 * location.cs (Reset): Reset static data.
13024 * namespace.cs (Reset): Reset static data.
13026 * report.cs (Report.Reset): Reset static data.
13028 * rootcontext.cs (RootContext.Reset): Reset static data.
13030 * tree.cs (RootTypes.ctor): Use Location.Null
13032 * typemanager.cs (TypeManager.Reset): Reset static data.
13033 (CoreLookupType): Removed Exit.
13034 (TypeHandle.Reset): Reset static data.
13036 2005-03-10 Raja R Harinath <rharinath@novell.com>
13039 * typemanager.cs (ComputeNamespaces): Import namespaces from
13040 referenced modules too.
13042 2005-03-09 Raja R Harinath <rharinath@novell.com>
13044 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13047 2005-03-09 Raja R Harinath <rharinath@novell.com>
13049 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13050 enclosing DeclSpace. This ensures that a name-lookup populates
13051 more caches and there are fewer 'TypeExpression's. Carve out
13052 nested type lookup into ...
13053 (LookupNestedTypeInHierarchy): ... this.
13055 2005-03-09 Raja R Harinath <rharinath@novell.com>
13057 Clean up a few partial-class semantics.
13058 Fixes test-357.cs and cs1618-2.cs.
13059 * cs-parser.jay (struct_declaration): Use 'current_class' as
13060 parent of newly-created struct. Remove call to Register ().
13061 Use 'pop_current_class' to complete handing the current struct.
13062 (interface_declaration): Likewise.
13063 (class_declaration): Likewise.
13064 (enum_declaration): Use 'current_class' as parent of newly created
13066 (delegate_declaration): Likewise.
13067 (pop_current_class): New function. This is used to handle closing
13068 up the 'current_class' and 'current_container', and pointing them
13069 to the enclosing class/container.
13070 (CSharpParser): Initialize 'current_class' too.
13071 * decl.cs (MemberCore): Add check for invariant: a partial
13072 container is not a parsed entity, and thus does not enclose any
13074 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13075 (DeclSpace.BaseTypeExpr): Use it.
13076 (DeclSpace.LookupType): Add check for invariant.
13077 * class.cs (TypeContainer): Add check for invariant: a nested
13078 class should have the same NamespaceEntry as its enclosing class.
13079 (TypeContainer.EmitFieldInitializers): Make virtual.
13080 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13082 (TypeContainer.Register): Remove.
13083 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13084 null. Use TypeResolveEmitContext for resolving base types and
13085 interfaces. Move initialization of Parts.TypeBuilder here from
13087 (TypeContainer.DefineNestedTypes): ... here.
13088 (PartialContainer): Take a Namespace not a NamespaceEntry.
13089 (PartialContainer.Create): Don't use Register. Call the
13090 appropriate Add... function directly.
13091 (ClassPart): Take both the PartialContainer and the enclosing
13092 class as constructor arguments.
13093 (ClassPart.EmitFieldInitializers): Override.
13094 (ClassPart.PartFindNestedTypes): Remove.
13095 (FieldBase.GetInitializerExpression): Resolve the initializer
13096 expression in the emit context of the enclosing class.
13097 * tree.cs (RootTypes): Remove Register ().
13099 2005-03-08 Marek Safar <marek.safar@seznam.cz>
13101 * cs-parser.jay: Removed CS0134.
13103 * driver.cs: Removed CS1901.
13105 * expression.cs (SizeOf.DoResolve): Don't report CS0233
13106 for predefined types.
13108 2005-03-07 Duncan Mak <duncan@novell.com>
13110 * codegen.cs (Save): Catch UnauthorizedAccessException as
13111 well. Fixes bug #73454.
13113 2005-03-07 Marek Safar <marek.safar@seznam.cz>
13115 * cs-tokenizer.cs (xtoken): Add CS1035.
13117 * class.cs (MethodData.Define): Add CS0683.
13118 (FieldMember.ctor): Add CS0681.
13120 2005-03-07 Raja R Harinath <rharinath@novell.com>
13122 * ecore.cs (SimpleName.DoResolve): Rename from
13123 SimpleName.DoResolveAllowStatic.
13124 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13125 Pass 'intermediate' flag to MemberStaticCheck.
13126 (SimpleName.MemberStaticCheck): Skip "static check" only in case
13127 of "intermediate" lookups via MemberAccess.
13128 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
13129 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13131 2005-03-07 Raja R Harinath <rharinath@novell.com>
13134 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13135 slipped in because of variable names that are identical to a
13136 builtin type's BCL equivalent ('string String;', 'int Int32;').
13137 (PropertyExpr.EmitInstance): Likewise.
13139 2005-03-04 Marek Safar <marek.safar@seznam.cz>
13141 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13143 * report.cs (warning_ignore_table): Made public.
13145 2005-03-04 Raja R Harinath <rharinath@novell.com>
13148 * class.cs (MethodData.Emit): Pass 'container' to
13149 container.GetObsoleteAttribute instead of 'container.Parent'.
13151 2005-03-03 Marek Safar <marek.safar@seznam.cz>
13153 * cs-parser.jay: Add 1534 error test.
13155 * iterators.cs (Yield.CheckContext): Add error 1629.
13156 (Iterator.ctor): Save unsafe modifier.
13157 (MoveNextMethod.DoEmit): Restore unsafe context.
13159 * namespace.cs (UsingAlias): Better error message.
13161 2005-03-03 Dan Winship <danw@novell.com>
13163 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13164 the warning message [#73219]
13166 2005-03-03 Raja R Harinath <rharinath@novell.com>
13168 Fix compile with MCS 1.0.0.0.
13169 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13170 w_restore to not depend on string constant folding.
13172 2005-03-03 Raja R Harinath <rharinath@novell.com>
13174 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
13175 CS0246 check to users who passed 'silent = false'.
13176 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13178 (SimpleName.SimpleNameResolve): Update.
13179 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13180 (MemberAccess.IdenticalNameAndTypeName): Update.
13181 * doc.cs (FindDocumentedTypeNonArray): Update.
13183 2005-03-03 Raja R Harinath <rharinath@novell.com>
13185 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13186 * parameters.cs (ComputeAndDefineParameters): Remove.
13187 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13188 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13189 Use GetParameterInfo.
13191 2005-03-02 Marek Safar <marek.safar@seznam.cz>
13193 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13195 2005-03-02 Raja R Harinath <rharinath@novell.com>
13197 Unify DeclSpace.LookupType and DeclSpace.FindType.
13198 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
13199 is in charge of defining nested types on demand.
13200 (DeclSpace.LookupType): Use it when the current_type is a
13201 TypeBuilder. Use LookupTypeDirect for reflected types.
13202 (DeclSpace.FindType): Remove.
13203 (DeclSpace.LookupInterfaceOrClass): Likewise.
13204 (DeclSpace.DefineTypeAndParents): Likewise.
13205 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13206 DeclSpace.LookupType.
13207 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13208 * typemanager.cs (LookupType): Simplify.
13209 (AddUserType): Remove type from negative_hits.
13210 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13211 * class.cs (TypeContainer.FindMembers): Move handling of nested
13213 (TypeContainer.FindMembers_NestedTypes): ... here.
13214 (TypeContainer.FindNestedType): Implement override.
13215 (ClassPart.FindNestedType): Delegate to PartialContainer.
13216 (ClassPart.PartFindNestedType): Looks up the nested types of the
13219 2005-03-02 Martin Baulig <martin@ximian.com>
13221 * class.cs (TypeContainer.DoDefineMembers): We also need a default
13222 static constructor in static classes.
13224 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
13226 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13227 sizeParamIndex is not specified.
13229 2005-03-01 Marek Safar <marek.safar@seznam.cz>
13232 * report.cs (WarningMessage.IsEnabled): Missing null check.
13234 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13236 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13237 in the fields and not in the properties.
13239 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
13241 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
13244 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13246 * attribute.cs: Small refactoring (improved robustness).
13247 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13248 (ValidateGuid): Removed.
13249 (Resolve): Removed referenced to above mentioned.
13250 (GetAttributeUsage): Made private and changed to work without
13252 (GetIndexerAttributeValue): Don't crash.
13253 (GetConditionalAttributeValue): Ditto.
13254 (GetClsCompliantAttributeValue): Ditto.
13255 (ExtractSecurityPermissionSet): All attributes exceptions are
13257 (GetPropertyValue): New helper.
13258 (GetMethodImplOptions): New method.
13259 (DefinePInvokeMethod): Reuse common code. Implemented handling of
13260 some missing properties.
13262 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13263 (Method.ApplyAttributeBuilder): Updated.
13265 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13268 2005-02-28 Raja R Harinath <rharinath@novell.com>
13271 * report.cs (Report.SymbolRelatedToPreviousError): Handle
13272 non-simple types (array, pointer, reference).
13274 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13276 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13278 * class.cs (MethodCore.IsDuplicateImplementation): Special error
13280 (Method.CheckBase): Catch wrong destructor here.
13281 (MethodData.Define): Add errors 550, 668.
13283 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13285 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13287 * pending.cs (VerifyPendingMethods): Add error 551.
13289 * typemanager.cs (CSharpName): Next error report helper.
13291 2005-02-25 Marek Safar <marek.safar@seznam.cz>
13293 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13294 attributes. Removed useless attribute double check.
13295 It saves almost 2MBs for corlib.
13297 2005-02-25 Raja R Harinath <rharinath@novell.com>
13300 * statement.cs (ExpressionStatement.Resolve): Make robust to being
13301 called twice in case of error.
13303 2005-02-23 Chris Toshok <toshok@ximian.com>
13305 Fix compiler portions of #72827.
13306 * statement.cs (Block.Emit): call Begin/EndScope on the
13307 EmitContext instead of the ILGenerator.
13309 * codegen.cs (EmitContext.BeginScope): new method, call
13310 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13312 (EmitContext.BeginScope): same, but EndScope and CloseScope
13314 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13315 offset and call the superclass's OpenScope(int) with it.
13316 (SymbolWriter.CloseScope): get the current il
13317 offset and call superclass's CloseScope(int) with it.
13319 2005-02-23 Marek Safar <marek.safar@seznam.cz>
13321 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13322 CS1677 for out and ref as well.
13324 * class.cs (Method.Define): Add error CS1599 detection.
13326 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13328 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13330 * delegate.cs (Delegate.Define): Add error CS1599 detection.
13332 * support.cs.cs (ModifierDesc): New helper method.
13334 2005-02-23 Raja R Harinath <rharinath@novell.com>
13335 Abin Thomas <projectmonokochi@rediffmail.com>
13336 Anoob V E <projectmonokochi@rediffmail.com>
13337 Harilal P R <projectmonokochi@rediffmail.com>
13339 Fix #57851, #72718.
13340 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13341 MemberLookup (used for error reporting) actually returns a result.
13342 Fix error report number (122, not 112).
13344 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
13345 Anoob V E <projectmonokochi@rediffmail.com>
13346 Harilal P R <projectmonokochi@rediffmail.com>
13349 * pending.cs (PendingImplementation.GetAbstractMethods):
13350 Find NonPublic members too.
13352 2005-02-22 Marek Safar <marek.safar@seznam.cz>
13354 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13357 * class.cs (MethodCore.CheckMethodAgainstBase):
13358 Add error 239 report.
13360 2005-02-21 Raja R Harinath <rharinath@novell.com>
13363 * expression.cs (Invocation.IsApplicable): Make public.
13364 (Invocation.IsParamsMethodApplicable): Likewise.
13365 * delegate.cs (Delegate.VerifyApplicability): Don't use
13366 Invocation.VerifyArgumentCompat for parameter applicability
13367 testing. Use Invocation.IsApplicable and
13368 Invocation.IsParamsMethodApplicable.
13370 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13372 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13374 * class.cs (Operator.Define): Add error 217 report.
13376 2005-02-21 Raja R Harinath <rharinath@novell.com>
13378 * namespace.cs (UsingEntry.Resolve): Undo change below.
13380 2005-02-21 Raja R Harinath <rharinath@novell.com>
13383 * ecore.cs (Expression.MemberLookupFailed): Add argument to
13384 disable the error message when the extended MemberLookup also
13386 (Expression.MemberLookupFinal): Update.
13387 (SimpleName.DoSimpleNameResolve): Update.
13388 * expression.cs (MemberAccess.ResolveNamespaceOrType):
13389 Don't use MemberLookupFinal.
13390 (New.DoResolve): Update.
13391 (BaseAccess.CommonResolve): Update.
13393 2005-02-21 Raja R Harinath <rharinath@novell.com>
13396 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13397 occured previously, don't resolve again.
13399 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13402 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13403 argument. Call ResolveAttributeUsage for unresolved.
13404 when types doesn't match ctor arguments.
13406 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13407 for nested attribute classes.
13408 (Class.attribute_usage): Removed.
13409 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13410 for attribute class.
13412 * ecore.cs (IsAttribute): Removed.
13414 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13416 * rootcontext.cs (RegisterAttribute): Removed, attributes are
13418 (attribute_types): Removed.
13419 (EmitCode): Global attributes are emited as the latest.
13421 2005-02-18 Marek Safar <marek.safar@seznam.cz>
13423 * class.cs (EmitFieldInitializers): Don't emit field initializer
13424 for default values when optimilization is on.
13426 * constant.cs (Constant.IsDefaultValue): New property.
13428 * driver.cs: Add /optimize handling.
13432 * literal.cs: Implement new IsDefaultValue property.
13434 * rootcontext.cs (Optimize): New field, holds /optimize option.
13436 2005-02-18 Raja R Harinath <rharinath@novell.com>
13438 Fix crasher in re-opened #72347.
13439 * namespace.cs (Namespace.Lookup): Return null if
13440 DeclSpace.DefineType returns null.
13443 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13445 2005-02-18 Raja R Harinath <rharinath@novell.com>
13447 Fix remainder of #63202. Change semantics of DoResolveLValue: it
13448 now returns null if it cannot resolve to an lvalue.
13449 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13450 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13451 returned null. Remove check for SimpleName.
13452 (EventExpr.DoResolveLValue): New.
13453 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13454 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
13456 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
13457 avoid CS0131 error.
13458 (Unary.ResolveOperator): Move CS0211 check ...
13459 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
13461 (Unary.DoResolveLValue): Simplify.
13462 (AddressOf.DoResolveLValue): New.
13463 (ArrayAccess.DoResolveLValue): New.
13465 2005-02-16 Marek Safar <marek.safar@seznam.cz>
13467 * attribute.cs (Attribute.Resolve): Add arguments casting for
13468 when types doesn't match ctor arguments.
13470 2005-02-16 Raja R Harinath <rharinath@novell.com>
13472 Fix parts of #63202.
13473 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13474 lookup of operator in base type. Ensure that all checks happen
13475 when the operator resolves to an "op_..." method.
13477 2005-02-15 Raja R Harinath <rharinath@novell.com>
13480 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13481 'ignore_cs0104' parameter. Pass it to ...
13482 (NamespaceEntry.Lookup): ... this.
13483 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13484 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13485 (TypeLookupExpression.DoResolveAsTypeStep): Update.
13486 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13487 Update. Request that cs0104 errors be ignored.
13488 (ComposedCast.ResolveAsTypeStep): Update.
13490 2005-02-14 Raja R Harinath <rharinath@novell.com>
13493 * expression.cs (Invocation.BetterFunction): Remove support for
13494 comparing virtual functions and their overrides.
13495 (Invocation.IsOverride): New.
13496 (Invocation.OverloadResolve): Don't consider 'override' functions
13497 during candidate selection. Store them in a lookaside list.
13498 If the selected method is a 'virtual' function, use the list to
13499 find any overrides that are closer to the LHS type.
13501 2005-02-14 Marek Safar <marek.safar@seznam.cz>
13503 * expression.cs (New.DoResolve): Add complex core type reduction.
13504 (New.Constantify): Converts complex core type syntax like 'new int ()'
13505 to simple constant.
13507 2005-02-14 Raja R Harinath <rharinath@novell.com>
13509 * decl.cs (EntryType.EntryType): New constructor to create an
13510 updated copy of a cache entry.
13511 (MemberCache.AddMethods): Use it.
13512 (MemberCache.ClearDeclaredOnly): Remove.
13513 (MemberCache.MemberCache): Update.
13515 2005-02-11 Miguel de Icaza <miguel@novell.com>
13517 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13518 variable. This one is represents the actual low-level declaration
13519 of the method, as opposed to the semantic level `IsStatic'.
13521 An anonymous method which is hosted into a static method might be
13522 actually an instance method. IsStatic would reflect the
13523 container, while MethodIsStatic represents the actual code
13526 * expression.cs (ParameterReference): Use the new MethodIsStatic
13527 instead of IsStatic.
13529 * anonymous.cs (AnonymousMethod.Compatible): Pass the
13530 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13531 set on the current EmitContext.
13533 * expression.cs (Cast): Overload DoResolveLValue so we can pass
13534 resolve our casted expression as an LValue. This triggers the
13535 proper LValue processing that is later required by Assign.
13539 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13541 2005-02-11 Marek Safar <marek.safar@seznam.cz>
13543 C# 2.0 Fixed buffer implementation
13545 * anonymous.cs: Update after RegisterHelperClass renaming.
13547 * attribute.cs (AttributeTester.fixed_buffer_cache):
13548 Cache of external fixed buffers.
13549 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13550 implementation if field is fixed buffer else null.
13553 (TypeContainer.AddField): Accept FieldMember instead of Field.
13554 (FieldBase.IsFieldClsCompliant): Extracted code from
13555 VerifyClsCompliance descendant customization.
13556 (FixedField): New class handles fixed buffer fields.
13557 (FixedFieldExternal): Keeps information about imported fixed
13559 (IFixedField): Make access to internal or external fixed buffer
13562 * cs-parser.jay: Add fixed buffer parsing.
13564 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13567 * expression.cs (Indirection): Extended implementation to accept
13568 fixed buffer field.
13569 (PointerArithmetic.Emit): Get element from fixed buffer as well.
13570 (ElementAccess.MakePointerAccess): Get type as parameter.
13571 (DoResolve): Add fixed buffer field expression conversion.
13572 (DoResolveLValue): Ditto.
13573 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13574 (ArrayPtr): Derives from FixedBufferPtr.
13575 (ArrayPtr.Emit): Add extra emit for array elements.
13577 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13579 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13580 for compiler generated types.
13581 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13583 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13584 and consume less memory.
13585 (Fixed.Resolve): Add fixed buffer case.
13587 * typemanager.cs (compiler_generated_attr_ctor,
13588 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13589 (HasElementType): Add our own implementation to work on every
13592 2005-02-11 Miguel de Icaza <miguel@novell.com>
13594 * anonymous.cs (CaptureContext): Track whether `this' has been
13597 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13598 only captured `this' if it was implicitly done (instance
13599 methods/variables were used).
13601 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13602 `this' must be captured.
13604 2005-01-30 Miguel de Icaza <miguel@novell.com>
13606 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13607 is null it means that there has been no need to capture anything,
13608 so we just create a sibling.
13610 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13612 Just a partial fix. The other half is fairly elusive.
13614 2005-02-10 Raja R Harinath <rharinath@novell.com>
13616 Fix #52586, cs0121-4.cs.
13617 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13618 and return a hashtable.
13619 (MemberCache.ClearDeclaredOnly): New.
13620 (MemberCache.MemberCache): Update to change. Make a deep copy of
13621 the method_hash of a base type too.
13622 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13623 type methods. Overwrite entries with the same MethodHandle so
13624 that the ReflectedType is correct. The process leaves in base
13625 virtual functions and their overrides as distinct entries.
13626 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13627 matters since it was boxed in a ArrayList before.
13628 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13630 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13631 case of a virtual function and its override (choose the overload
13633 (Invocation.OverloadResolve): Avoid 'override' members during
13634 'applicable_type' calculation.
13636 2005-02-09 Raja R Harinath <rharinath@novell.com>
13638 Combine two near-redundant caches.
13639 * typemanager.cs (method_params): Rename from method_internal_params.
13640 (TypeManager.GetParameterData): New. Replace
13641 Invocation.GetParameterData.
13642 (TypeManager.LookupParametersByBuilder): Remove.
13643 * expression.cs (Invocation.method_parameter_cache): Remove.
13644 (Invocation.GetParameterData): Remove.
13646 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13649 2005-02-08 Raja R Harinath <rharinath@novell.com>
13652 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13653 TypeManager.multicast_delegate_type is null, resolve it by looking
13654 up "System.MulticastDelegate".
13655 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13657 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13658 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13659 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13662 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13663 (LabeledStatement.AddReference): New. Set 'referenced'.
13664 (Goto.Resolve): Use it.
13666 2005-02-05 John Luke <john.luke@gmail.com>
13668 * driver.cs: remove duplicate -doc line in Usage ()
13670 2005-02-04 Raja R Harinath <rharinath@novell.com>
13672 * location.cs (Location.AddFile): Fix CS2002 error report.
13674 2005-02-02 Martin Baulig <martin@ximian.com>
13676 * delegate.cs (Delegate.DefineType): Report an internal error if
13677 TypeManager.multicast_delegate_type is null. See bug #72015 for
13680 2005-02-02 Raja R Harinath <rharinath@novell.com>
13682 Fix a crasher in a variant of #31984.
13683 * const.cs (Constant.CheckBase): New override that defers the
13684 new-or-override check in case the base type hasn't been populated
13686 (Constant.Define): Ensure the new-or-override check is performed.
13688 2005-02-01 Duncan Mak <duncan@ximian.com>
13690 * const.cs (LookupConstantValue): Check that `ce' is not null
13691 before calling GetValue ().
13693 2005-02-01 Raja R Harinath <rharinath@novell.com>
13695 Fix test-334.cs (#69519).
13696 * cs-parser.jay (using_alias_directive): Pass in an expression to
13697 NamespaceEntry.UsingAlias.
13698 (using_namespace_directive): Pass in an expression to
13699 NamespaceEntry.Using.
13700 (namespace_name): Don't flatten to a string.
13701 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13702 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13704 (NamespaceEntry.UsingEntry): Likewise.
13705 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13707 (NamespaceEntry.LookupForUsing): Remove.
13708 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13710 (NamespaceEntry.Lookup): Remove support for dotted names.
13712 2005-02-01 Raja R Harinath <rharinath@novell.com>
13714 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13716 (NamespaceEntry.ImplicitParent): Compute on demand.
13717 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13718 parallels the current.
13719 (NamespaceEntry.LookupForUsing): Use it.
13720 (NamespaceEntry.Lookup): If the current namespace-entry is
13721 implicit, don't search aliases and using tables.
13723 2005-02-01 Raja R Harinath <rharinath@novell.com>
13726 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13728 (TypeContainer.BaseCache): Compute on demand.
13729 (TypeContainer.FindMembers): Define constants and types if they're
13730 not already created.
13731 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13733 * const.cs (Constant.Define): Make idempotent.
13735 2005-01-29 Miguel de Icaza <miguel@novell.com>
13737 * pending.cs: Produce better code (no nops produced by using Ldarg
13740 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13741 i - 1' it should be arg + 1.
13745 2005-01-28 Raja R Harinath <rharinath@novell.com>
13747 * attribute.cs (Attribute.CheckAttributeType): Make private
13749 (Attribute.ResolveType): Make virtual.
13750 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13751 handling of RootContext.Tree.Types.
13753 2005-01-27 Raja R Harinath <rharinath@novell.com>
13755 Update attribute-handling to use the SimpleName/MemberAccess
13757 * cs-parser.jay (attribute): Pass in an expression to the
13758 constructors of Attribute and GlobalAttribute.
13759 * attribute.cs (Attribute): Take an expression for the name.
13760 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13761 passed in attribute name expression.
13762 (Attribute.CheckAttributeType): Use it.
13763 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13764 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13765 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13766 argument to prevent error messages if the lookup fails.
13768 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13770 * expression.cs (Indirection): Implemented IVariable interface
13771 to support indirection in AddressOf operator.
13772 (PointerArithmetic.Emit): Add optimalization for case where
13773 result can be precomputed.
13775 2005-01-26 Martin Baulig <martin@ximian.com>
13777 * class.cs (TypeContainer.AttributeTargets): Return the correct
13778 AttributeTargets depending on our `Kind' instead of throwing an
13779 exception; fixes #71632.
13781 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13784 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13787 2005-01-25 Raja R Harinath <rharinath@novell.com>
13790 * expression.cs (MemberAccess.DoResolve): Don't complain with
13791 cs0572 when the LHS of a member access has identical name and type
13794 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13797 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13799 Create custom PermissionSet only for PermissionSetAttribute.
13801 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13804 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13805 delegates in static class.
13807 2005-01-24 Martin Baulig <martin@ximian.com>
13809 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13810 merging an implicit block, just use its reachability.
13812 * statement.cs (Block.Resolve): Make the unreachable code check
13813 work wrt. implicit blocks; see test-337 from #63842.
13815 2005-01-21 Alp Toker <alp@atoker.com>
13817 * cs-parser.jay: destructor_declaration's container is PartialContainer
13818 not Class when partial types are used, so use Kind prop instead of
13821 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13823 * cs-parser.jay: Improve error reporting when an interface
13824 declares new types.
13826 2005-01-20 Dick Porter <dick@ximian.com>
13828 * support.cs: SeekableStreamReader fix from Sandor Dobos
13829 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13830 chars are read. Fixes bug 70369.
13832 2005-01-20 Raja R Harinath <rharinath@novell.com>
13834 * cs-parser.jay (catch_clause): Simplify current_block handling
13837 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13839 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13840 code with ImplicitStandardConversion to handle the implicit
13841 conversion of method groups into valid delegate invocations.
13843 The problem is that in parameter handling we were using this code
13844 path. Fixes bug #64698
13846 2005-01-19 Raja R Harinath <rharinath@novell.com>
13848 * cs-parser.jay: Fix several infelicities.
13849 - Avoid assigning to the parser value stack. Code like
13850 '$3 = null' is unclean. Synthesize a value for the code block
13852 - Avoid using oob_stack for storing location information. Use ...
13853 (_mark_): ... this. New (empty) rule. Saves the current location
13855 (foreach_statement): Avoid using oob_stack for current_block
13856 handling. Use technique used in for_statement and
13857 using_statement. Synthesize a value for the code block to store
13858 additional intermediate information.
13860 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13862 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13863 of a different type is only allowed to private fields of a
13864 containing type, not on fields of a base class.
13866 See test-174.cs and error cs0122-9.cs
13868 2005-01-13 Raja R Harinath <rharinath@novell.com>
13870 Fix test-335.cs (bug #58126).
13871 * cs-parser.jay (argument): Split out non-expression parts of the
13872 rule into 'non_simple_argument'.
13873 (invocation_expression): Support parenthesized invocations with
13874 multiple arguments, and with single non-simple arguments.
13876 2005-01-13 Raja R Harinath <rharinath@novell.com>
13878 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13881 2005-01-12 Raja R Harinath <rharinath@novell.com>
13883 Fix cs0038-1.cs, cs1640-6.cs.
13884 * ecore.cs (Expression.Resolve): Remove special-case for
13885 SimpleName in error-handling.
13886 (Expression.almostMatchedMembers): Relax access permission to
13888 (Expression.MemberLookupFailed): Handle duplicates in
13889 almostMatchedMembers list.
13890 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13891 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13892 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13893 overload if the passed in MemberInfo is a MethodBase.
13895 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13898 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13899 for non-CAS & merge permission sets properly.
13901 2005-01-11 Raja R Harinath <rharinath@novell.com>
13903 Improve standard-compliance of simple name and member access
13904 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13905 * ecore.cs (FullNamedExpression): New abstract base class
13906 for Namespaces and TypeExpressions.
13907 (ResolveFlags.SimpleName): Remove.
13908 (SimpleName): Remove support for dotted names.
13909 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13910 DeclSpace.FindType and DeclSpace.LookupType.
13911 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13912 (Expression.ExprClassName): Make member function.
13913 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13914 a namespace. Remove creation of dotted "SimpleName"s.
13915 (MemberAccess.DoResolve): Likewise.
13916 * decl.cs (DeclSpace.Cache): Make private.
13917 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13918 (DeclSpace.FindType): Update.
13919 (DeclSpace.LookupType): Move here from RootContext. Return a
13920 FullNamedExpression.
13921 * namespace.cs (Namespace): Derive from FullNamedExpression
13922 so that it can be part of expression resolution.
13923 (Namespace.Lookup): Return an FullNamedExpression.
13924 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13926 * rootcontext.cs (NamespaceLookup): Remove.
13927 (LookupType): Move to DeclSpace.
13928 * attribute.cs (CheckAttributeType): Update.
13929 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13930 (FindDocumentedTypeNonArray): Likewise.
13932 2005-01-11 Raja R Harinath <rharinath@novell.com>
13934 Fix cs0509.cs, cs1632.cs.
13935 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13936 is the same as IsInterface.
13937 (TypeContainer.GetClassBases): Likewise.
13938 * statement.cs (LabeledStatement.ig): New field.
13939 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13941 (LabeledStatement.DoEmit): Check that the label was created with
13942 the same ILGenerator.
13944 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13947 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13948 accessors to its properties.
13950 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13951 from accessors to property.
13953 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13956 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13957 only for overrides.
13959 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13961 * attribute.cs: Check for null and empty strings.
13963 I have lost another battle to Paolo.
13965 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13968 * class.cs (PropertyMethod): Set Parent field in ctors.
13969 (SetMethod.InternalParameters): Add unsafe switch hack.
13970 Override MarkForDuplicationCheck where it is appropriate.
13972 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13973 It says whether container allows members with the same name.
13974 Base default is no.
13975 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13976 Removed is_method parameter.
13978 2005-01-06 Duncan Mak <duncan@ximian.com>
13980 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13981 because the previous change led to incorrect reporting of CS1032
13982 ("Cannot define/undefine preprocessor symbols after first token in
13983 file"). Instead of using `tokens_seen' as the only flag that
13984 triggers CS1040, introduce `comments_seen'. This new flag is used
13985 to signify having seen comments on the current line, so it is
13986 unset after a newline.
13988 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13990 * doc.cs : When searching for a type, find nested type too.
13991 This fixes bug #71040.
13993 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13996 - Warn missing member comment on those classes which also does not
13997 have doc comments. Fixed bug #71041.
13998 - Don't warn missing doc comment on default constructor.
14001 2005-01-06 Duncan Mak <duncan@ximian.com>
14003 * cs-tokenizer.cs (xtoken): After handling traditional C-style
14004 comments, set `tokens_seen' to true. This allows us to detect
14005 misplaced preprocessor directives (i.e. not at the beginning of
14006 the a line, nor after whitespaces). In that case, report error
14007 CS1040. This fixes bug #56460.
14009 * cs-parser.jay (interface_member_declaration): Add checks for
14010 IsExplicitImpl, and report CS0541 error if an interface member is
14011 defined as an explicit interface declaration.
14013 2005-01-06 Marek Safar <marek.safar@seznam.cz>
14016 * class.cs (PropertyMethod): Set Parent field in ctors.
14017 (SetMethod.InternalParameters): Add unsafe switch hack.
14019 * decl.cs (MemberCore.Parent): Cannot be readonly.
14021 2005-01-06 Raja R Harinath <rharinath@novell.com>
14023 * decl.cs (DeclSpace.ResolveType): Remove.
14024 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14025 Merge in code from ...
14026 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
14027 * class.cs, enum.cs: Update to changes.
14029 2005-01-06 Miguel de Icaza <miguel@ximian.com>
14031 * anonymous.cs: Ensure that we init the scope of our parent if it
14032 has not been initialized yet.
14034 2004-12-30 Duncan Mak <duncan@ximian.com>
14036 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14037 if field.FieldBuilder is null. Fixes #70758.
14039 * convert.cs: Fixed some typos and updated some of the comments.
14040 (ImplicitStandardConversionExists):
14041 (TryImplicitIntConversion): If `target_type' is an interface and
14042 the type of `ic' implements this interface, return true or a new
14043 BoxedCast instead of null. This fixes #70468.
14045 2004-12-29 Duncan Mak <duncan@ximian.com>
14047 * expression.cs (Argument.Emit): Check that Expr is
14048 IMemoryLocation before casting to it, and report CS1510 otherwise.
14052 2004-12-21 Ben Maurer <bmaurer@ximian.com>
14054 * statement.cs (Block.ThisVariable): remove the recursion here, to
14055 make the --profile more sane.
14057 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
14059 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14060 assembly, by JB Evain.
14062 2004-12-17 Raja R Harinath <rharinath@novell.com>
14064 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
14065 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14066 "parent" refers to enclosing type/class. "base" refers to superclass.
14068 2004-12-17 Raja R Harinath <rharinath@novell.com>
14070 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14071 Ensure that we only have GlobalAttributes.
14072 * attribute.cs (Attribute.Emit): Make non-virtual.
14073 (GlobalAttribute.Emit): Remove.
14074 (Attribute.Resolve): Make virtual.
14075 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
14076 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14077 the argument. Don't create one.
14078 (Attribute.GetObsoleteAttribute): Likewise.
14079 (Attribute.GetClsCompliantAttributeValue): Likewise.
14080 * class.cs, decl.cs: Update to changes.
14082 2004-12-17 Marek Safar <marek.safar@seznam.cz>
14084 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14086 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14088 * statement.cs (Foreach.Resolve): Add error 186 report.
14090 2004-12-16 Marek Safar <marek.safar@seznam.cz>
14092 * expression.cs (Conditional.DoResolve): Add warning 429.
14094 * statement.cs (If.Resolve): Add warning 665.
14096 2004-12-16 Raja R Harinath <rharinath@novell.com>
14098 New invariant: RootContext.Tree.Types.NamespaceEntry == null
14099 except when in the parser, and in GlobalAttribute.
14100 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14101 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14102 RootContext.Tree.Types.NamespaceEntry once work is done.
14103 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
14104 and resets RootContext.Tree.Types.NamespaceEntry.
14106 2004-12-15 Marek Safar <marek.safar@seznam.cz>
14108 * cs-parser.jay: Don't create a block for every variable.
14110 2004-12-14 Miguel de Icaza <miguel@ximian.com>
14112 * location.cs: Provide extra information.
14114 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14115 variables from the captured environment, it is the ldarg_0.
14117 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14119 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14122 * class.cs: Changed warning level for 169 to avoid developer
14123 displeasure from warning flooding. It will be changed back when they
14124 fix most of current BCL warnings.
14126 * RootContext.cs: Pushed default WarningLevel to 3.
14128 * statement.cs: Removed unused variable.
14130 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14132 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14133 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14134 Add error 502 report.
14135 (StaticClass.DefineType): Add error 441 report.
14136 (Class.AllowedModifiersProp): New virtual property as temporary
14137 extension to AllowedModifiers.
14138 (Class.DefineType): Add error 418 report. Moved ModFlags check here
14139 to share implementation with StaticClass and don't call virtual
14142 * driver.cs (MainDriver): Add error 1558 test.
14144 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14145 report. Moved error 36 test here.
14147 * statement.cs (Throw.Resolve): Add error 724 report.
14149 * typemanager.cs: Add out_attribute_type core type.
14151 2004-12-13 Marek Safar <marek.safar@seznam.cz>
14153 * class.cs (TypeContainer.VerifyClsCompliance): Add error
14155 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14157 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14160 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14162 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
14163 Add error 3023 report.
14164 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14166 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14169 2004-12-12 John Luke <john.luke@gmail.com>
14171 * driver.cs (AddArgs): take -- into account when
14172 adding arguments, fixes bug 65710
14174 2004-12-12 Martin Baulig <martin@ximian.com>
14176 * expression.cs (Unary.TryReduceNegative): Added support for
14177 SByteConstant and ByteConstant.
14178 (Unary.Reduce): Check error values from TryReduceNegative().
14180 2004-12-10 Marek Safar <marek.safar@seznam.cz>
14182 * attributes.cs (Attribute.Resolve): Avoid multiple error report
14183 and report exception as error 182.
14185 2004-12-10 Raja R Harinath <rharinath@novell.com>
14187 * driver.cs (Main): Fix message when there are warnings.
14189 2004-12-09 Miguel de Icaza <miguel@ximian.com>
14191 * delegate.cs: Fixed my fix from yesterday, sorry about that.
14193 2004-12-09 Marek Safar <marek.safar@seznam.cz>
14195 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
14196 Reduced number of warnings.
14198 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14200 2004-12-08 Miguel de Icaza <miguel@ximian.com>
14202 * driver.cs: Removed message.
14204 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14206 2004-12-08 <vargaz@freemail.hu>
14208 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14210 2004-12-08 Martin Baulig <martin@ximian.com>
14212 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14213 instead of a CS3002 for properties and indexer.
14215 2004-12-08 Martin Baulig <martin@ximian.com>
14217 * decl.cs (MemberName.ToString): Make this work again.
14219 2004-12-08 Marek Safar <marek.safar@seznam.cz>
14221 * attribute.cs (Resolve): Add error 591 detection.
14223 * class.cs (FieldMember.Define): Add error 1547 detection.
14224 (Indexer.Define): Add error 620 detection.
14225 (Operator.Define): Add error 590 detection.
14227 * ecore.cs: Missing argument for error 79.
14229 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14232 2004-12-07 Marek Safar <marek.safar@seznam.cz>
14235 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14238 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
14240 * cs-parser.jay : handle doc comments on implicit/explicit operators.
14241 Some operator comments were suppressed.
14242 * doc.cs : Implicit/explicit operator name in doc comments are like
14243 "op_Explicit(type)~returnType", so added suffix handling.
14245 2004-12-07 Martin Baulig <martin@ximian.com>
14248 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14249 (MemberCore.GetClsCompliantAttributeValue): Likewise.
14250 (DeclSpace.ec): New protected field; store the EmitContext here.
14251 (DeclSpace.EmitContext): New public property; moved here from
14253 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14256 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14257 (Enum.Emit): Don't create a new EmitContext.
14259 * delegate.cs (Delegate.DefineType): Always create the
14262 * iterators.cs (Iterators.DefineIterator): Create a new
14263 EmitContext and store it in `ec'.
14265 2004-08-24 Martin Baulig <martin@ximian.com>
14268 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14269 this for accessibility checks.
14270 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14271 IsNestedFamilyAccessible.
14272 (TypeManager.IsSubclassOf): New method, do what the name actually
14275 2004-12-06 Raja R Harinath <rharinath@novell.com>
14277 Fix crash on cs0657-17.cs.
14278 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14279 Use RootContext.Tree.Types, not 'new RootTypes ()'.
14280 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14281 the case where the NamespaceEntry gets overwritten.
14283 2004-12-06 Marek Safar <marek.safar@seznam.cz>
14285 Fixed #69195, #56821
14286 * ecore.cs (ResolveBoolean): Tiny refactoring.
14288 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14289 of right expression resolving when left is false constant and
14290 operator is LogicalAnd OR true constant and operator is LogicalOr.
14292 * statement.cs (ResolveUnreachable): Always reports warning.
14294 2004-12-05 Miguel de Icaza <miguel@ximian.com>
14296 * class.cs: Distinguish between 1721 and 1722 (just a little help
14297 for the programmer).
14299 2004-12-03 Miguel de Icaza <miguel@ximian.com>
14301 * delegate.cs: Only allow this on new versions of the language.
14303 2004-12-02 Duncan Mak <duncan@ximian.com>
14305 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14307 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14308 here as a static method. Take an additional bool out parameter
14309 `must_do_cs1540_check' for signaling to InstanceResolve.
14310 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14311 member field from PropertyExpr class and made it an argument of
14312 the method instead.
14313 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14314 check for MarshalByRefObject, and report CS0122 instead of CS1540.
14315 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14316 and `remove_accessor' as well as InstanceResolve: report CS0122
14321 2004-12-03 Raja R Harinath <rharinath@novell.com>
14323 Fix test-327.cs, test-328.cs, and put in early infrastructure
14324 for eventually fixing #52697.
14325 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14326 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14327 from other methods.
14328 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14329 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14330 (VerifyUsing, error246): Update.
14331 * rootcontext.cs (RootContext.NamespaceLookup): Just use
14332 'NamespaceEntry.LookupNamespaceOrType'.
14334 2004-12-03 Martin Baulig <martin@ximian.com>
14336 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14337 method as our child, call AnonymousMethod.Compatible() on it.
14339 2004-12-03 Raja R Harinath <rharinath@novell.com>
14341 Disable XML documentation support in 'basic' profile.
14342 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14343 Redirect XmlElement to System.Object.
14344 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14345 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14346 * mcs.exe.sources: Add doc-bootstrap.cs.
14347 * doc-bootstrap.cs: New file. Contains empty stub implementation
14350 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
14352 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14353 comments are allowed.
14355 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14357 * delegate.cs: Add checks for subtypes in paramaters and return values
14358 in VerifyMethod () to add support for Covariance/Contravariance
14361 2004-12-02 Miguel de Icaza <miguel@ximian.com>
14363 * report.cs: Remove extra closing parenthesis.
14365 * convert.cs (Error_CannotImplicitConversion): If the name of the
14366 types are the same, provide some extra information.
14368 * class.cs (FieldBase): Use an unused bit field from the field to
14369 encode the `has_offset' property from the FieldMember. This saves
14370 a couple of Ks on bootstrap compilation.
14372 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14373 method as our child, return the AnonymousMethod resolved
14376 * expression.cs (New.DoResolve): Allow return values from
14377 NewDelegate to also include AnonymousMethods.
14381 2004-12-02 Marek Safar <marek.safar@seznam.cz>
14384 * attribute.cs (Resolve): Improved implementation of params
14385 attribute arguments.
14387 * support.cs (ParameterData): Add HasParams to be faster.
14389 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
14391 all things are for /doc support:
14393 * doc.cs: new file that supports XML documentation generation.
14394 * mcs.exe.sources: added doc.cs.
14396 Handle /doc command line option.
14397 Report error 2006 instead of 5 for missing file name for /doc.
14398 Generate XML documentation when required, after type resolution.
14400 Added support for picking up documentation (/// and /** ... */),
14401 including a new XmlCommentState enumeration.
14403 Added lines to fill Documentation element for field, constant,
14404 property, indexer, method, constructor, destructor, operator, event
14405 and class, struct, interface, delegate, enum.
14406 Added lines to warn incorrect comment.
14408 Added Documentation field (passed only when /doc was specified).
14410 Added DocComment, DocCommentHeader, GenerateDocComment() and
14411 OnGenerateDocComment() and some supporting private members for
14412 /doc feature to MemberCore.
14414 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14416 Added overriden DocCommentHeader.
14418 Added overriden DocCommentHeader and GenerateDocComment().
14420 2004-12-01 Miguel de Icaza <miguel@ximian.com>
14422 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14423 unwrapping the enumeration values, chain to
14424 DoConstantNumericPromotions again, so we can promote things to the
14425 fundamental types (takes care of enums that are bytes, sbytes).
14429 2004-12-01 Raja R Harinath <rharinath@novell.com>
14431 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14432 Fix long-standing bug in type-lookup. Use FindType instead of
14433 LookupType when ec.ResolvingTypeTree.
14434 (Attribute.ResolveType, Attribute.Resolve)
14435 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14437 (Attributes.Search): Remove internal version. Update.
14438 (Attributes.SearchMulti): Update.
14439 (Attributes.GetClsCompliantAttribute): Remove.
14440 (Attributes.GetIndexerNameAttribute): Remove.
14441 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14442 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14443 * class.cs (Indexer.Define): Likewise.
14445 2004-12-01 Marek Safar <marek.safar@seznam.cz>
14448 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14449 MarshallByReference members access.
14451 * expression.cs: Use CheckMarshallByRefAccess;
14452 Better error CS0197 message.
14454 * report.cs: Print whole related error message.
14456 2004-11-30 Raja R Harinath <rharinath@novell.com>
14458 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14459 the current directory to help debugging.
14461 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14463 * class (GetClassBases): Better error 60 report.
14464 (EventProperty): Disabled warning 67 detection.
14466 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14469 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14471 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14474 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14477 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14479 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14481 2004-11-26 Miguel de Icaza <miguel@ximian.com>
14483 * attribute.cs (Attribute.Resolve): Refine error reporting and
14484 report a cs0117 if the identifier does not exist, to distinguish
14485 from 0617 which is a miss-use of the actual identifier.
14487 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14488 between cs0070 and cs0079.
14490 * class.cs (MemberBase.DoDefine): When reporting a wrong
14491 accessibility level, we use MethodCore to compare instead of
14492 Method (this was a regression in some refactoring effort).
14494 So now we correctly report cs0056 again.
14496 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14497 testing the target_type (which was known to be object_type) and
14498 not the source type (which is anonymous_method).
14500 Fixed reporting of error cs1660.
14502 * expression.cs (UserCast.Source): Expose the underlying cast.
14504 * statement.cs (Switch.SwitchGoverningType): Sort the list of
14505 allowed types to find a match to int32 first (most common).
14507 In addition, it ignores any ImplicitUserConversions that did an
14508 internal implicit conversion (as the switch statement allows only
14509 one integral conversion to exist).
14511 * class.cs (PartialContainer.Create): rename `name' to
14512 `member_name' for clarity. Then replace the string calls with a
14513 call to MemberName.GetPartialName, as now using
14514 MemberName.ToString is an error (this is due to the side effects
14515 it had, that were fixed in the past).
14517 This will restore the error reporting on a number of partial class
14518 errors that were missusing this (and getting an exception as a
14519 results, which is now just a plain textual warning, because
14520 yyparse debug output would crash otherwise).
14522 2004-11-26 Raja R Harinath <rharinath@novell.com>
14524 * Makefile (PROGRAM_INSTALL_DIR): Remove.
14526 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14528 * rootcontext.cs (LookupType): Make sure to cache lookups that
14529 don't give us a negative result. This saves about 5% of corlib
14532 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14534 * report.cs (AbstractMessage.Print): messages are sent to stderr
14536 * class.cs (TypeContainer.GetClassBases): It is an error to have a
14537 non-interface in the list of interfaces (at this point, either
14538 parent was properly set, or a base class is being listed in the
14539 interfaces section).
14541 This flags error 1722, and resolves the crash from bug 69259.
14543 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14545 * statement.cs (Using.EmitExpressionFinally): make this work right
14546 for valuetypes. Fixes 69926.
14548 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14550 * const.cs (Const.ChangeType): Cope with the "0 literal can be
14551 converted to an enum" here, before we try to change the underlying
14552 type. This code exists, but it is a different code path than the
14553 one used while encoding constants.
14555 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14556 old bug: when converting from the null literal to a pointer,
14557 return an EmptyCast, not the NullLiteral.
14559 This fixes #69921, the recent null_type changes probably made this
14560 bug more prominent.
14562 (ImplicitReferenceConversionExists): In addition, resynchronized
14563 the code here, so it matches the same code in
14564 ImplicitReferenceConversionExists for the `from any class-type S
14565 to any interface-type T'.
14568 2004-11-25 Marek Safar <marek.safar@seznam.cz>
14570 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14572 2004-11-24 Miguel de Icaza <miguel@ximian.com>
14574 * cs-parser.jay: Use verbosity accordingly.
14576 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14578 * expression.cs (Unary.ResolveOperator): Do not report warning;
14579 AddressOf reads from variable.
14581 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14583 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14587 * attribute.cs (Attributable): Removed CheckTargets.
14588 (Attributes.Emit): Explicit attribute targets are tested here.
14590 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14591 not enabled for interfaces.
14593 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14594 (GetAssemblyName): Ouch next bug there.
14596 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14598 * expression.cs: Error 275 added.
14600 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14602 Fix bug #69177 (Implemented decimal constant support)
14604 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14605 (BinaryFold): Add DecimalConstant.
14607 * const.cs (Define): Decimal constant
14609 (ChangeType): Add decimal type handling.
14610 (LookupConstantValue): Don't set value for decimal type but
14611 emit DecimalConstantAttribute. Needed for constant optimization.
14613 * constant.cs (ToDecimal): New method.
14614 (ConvertToDecimal): New method.
14615 (IntConstant): Implemented ConvertToDecimal.
14616 (DecimalConstant.Emit): Emit optimized version for decimals in
14619 * expression.cs (ResolveOperator): Changed order of constant
14620 reduction to work correctly with native types which have
14621 overloaded operators.
14622 (ResolveMemberAccess): Extract constant value from attribute
14625 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14627 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14628 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14629 (ChangeType): Decimal is special.
14630 (TypeToCoreType): Add decimal type.
14632 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14634 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14637 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14639 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14642 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14644 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14646 * pending.cs (PendingImplementation): Grab only interfaces.
14648 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14650 * statement.cs (ForeachHelperMethods): Add location member and
14651 error 202 detection.
14653 2004-11-19 Raja R Harinath <rharinath@novell.com>
14655 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14656 automatically handled by executable.make.
14657 (PROGRAM): Make profile-specific.
14659 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14661 * expression.cs (DoResolveBase): Fixed wrong warning for out
14664 2004-11-18 Martin Baulig <martin@ximian.com>
14666 Merged latest changes into gmcs. Please keep this comment in
14667 here, it makes it easier for me to see what changed in MCS since
14668 the last time I merged.
14670 2004-11-17 Raja R Harinath <rharinath@novell.com>
14672 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14673 (TypeHandle.GetMemberCache): New.
14674 (TypeHandle.TypeHandle): Update.
14675 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14676 (TypeManager.LookupParentInterfacesCache):
14677 Rename from LookupInterfaceCache. Optimize slightly.
14678 (TypeManager.MemberLookup_FindMembers): Update.
14679 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14680 multi-type variant.
14681 (AddCacheContents): Rename from AddHashtable.
14682 * class.cs (TypeContainer.parent_container): Remove.
14683 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14684 (TypeContainer.DoDefineMembers): Don't initialize it.
14685 Update to name changes.
14687 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14689 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14690 that factors the code to check access modifiers on override.
14692 (PropertyBase): Use the code here.
14694 Patch from Lluis S'anchez, fixes bug #69361.
14696 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14698 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14699 routine that is used to report the use of a captured variable
14700 whose address has been taken.
14702 There are two checks: one when variables are being captured and
14703 the other check is when the address of a variable is taken.
14705 (because an anonymous methods might be resolved before *or* after
14706 the address has been taken) and
14708 * expression.cs (Conditional.DoResolve): Remove the special
14709 casing that Martin added to trueExpr and falseExpr being both
14710 NullLiteral. We get the right behavior now just by introducing
14711 the null_type into the compiler.
14713 * convert.cs (ExplicitConversion): Change the code to use
14714 null_type instead of testing `expr is NullLiteral'.
14715 (ImplicitConversionStandard): use null_type too.
14716 (ImplicitReferenceConversionExists): use null_type too.
14717 (ImplicitReferenceConversion): use null_type too.
14719 * literal.cs: The type of `NullLiteral' is now null_type instead
14721 (Resolve): Set the type here.
14723 * typemanager.cs: Introduce null_type.
14725 2004-11-17 Martin Baulig <martin@ximian.com>
14727 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14728 direction, like FindMembers() does. Fixes #69546, testcase is in
14731 2004-11-16 Martin Baulig <martin@ximian.com>
14733 This is based on a patch from Marek Safar, see bug #69082.
14734 Fixes bugs #63705 and #67130.
14736 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14737 method; create a MemberCache for an interface type and cache the
14740 * decl.cs (IMemberContainer.ParentContainer): Removed.
14741 (IMemberContainer.ParentCache): New property.
14742 (MemberCache.SetupCacheForInterface): Removed.
14743 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14744 to create a cache for an interface's "parent".
14746 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14749 2004-11-16 Martin Baulig <martin@ximian.com>
14751 Merged back from gmcs; these changes already went into gmcs a
14752 couple of weeks ago.
14755 (TypeManager.AddUserType): Removed the `ifaces' argument.
14756 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14758 (TypeManager.AddUserInterface): Removed.
14759 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14761 (TypeManager.GetInterfaces): Likewise.
14762 (TypeManager.GetExplicitInterfaces): Likewise.
14764 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14766 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14767 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14769 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14771 * statement.cs: Avoid adding bools to a hashtable.
14773 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14775 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14776 calling an unsafe method from a safe location.
14778 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14781 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14783 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14785 * namespace.cs (VerifyUsing): use GetPartialName instead of
14788 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14790 * statement.cs (Return.Resolve): Fix regression in typo: if
14791 `in_exc', we have to request a NeedReturnLabel, this was a typo
14792 introduced in the anonymous method check-in. Fixes #69131.
14794 * Indexers were using the ShortName when defining themselves,
14795 causing a regression in the compiler bootstrap when applying the
14796 patch from 2004-11-02 (first part), now they use their full name
14797 and the bug is gone.
14799 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14801 * driver.cs: Strip the path from the names of embedded resources. Fixes
14804 2004-11-04 Raja R Harinath <rharinath@novell.com>
14806 Fix error message regression: cs0104-2.cs.
14807 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14808 (AliasEntry.Resolve): Update.
14809 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14811 (RootContext.LookupType): Update.
14813 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14815 * cs-parser.jay: Add support for handling accessor modifiers
14816 * class: Add support port accessor modifiers and error checking,
14817 define PropertyMethod.Define as virtual (not abstract anymore)
14818 * ecore.cs: Add checking for proeprties access with access modifiers
14819 * iterators.cs: Modify Accessor constructor call based in the modified
14821 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14823 * expression.cs (StringConcat): Handle being called twice,
14824 as when we have a concat in a field init with more than two
14827 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14829 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14830 special case explicit implementations, we should always produce
14831 the .property or .event declaration.
14833 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14834 since it will not return correct data if people use this
14835 unresolved in the presence of using statements (see test-313).
14837 * class.cs (MethodData.Define): If we are an explicit interface
14838 implementation, set the method name to the full name of the
14839 interface plus the name of the method.
14841 Notice that using the method.MethodName.GetFullName() does not
14842 work, as it will only contain the name as declared on the source
14843 file (it can be a shorthand in the presence of using statements)
14844 and not the fully qualifed type name, for example:
14848 class D : ICloneable {
14849 object ICloneable.Clone () {
14853 Would produce a method called `ICloneable.Clone' instead of
14854 `System.ICloneable.Clone'.
14856 * namespace.cs (Alias.Resolve): Use GetPartialName.
14858 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14860 * cs-parser.jay: Add error 1055 report.
14862 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14864 * assign.cs (Assign.DoResolve): Only do the transform of
14865 assignment into a New if the types are compatible, if not, fall
14866 through and let the implicit code deal with the errors and with
14867 the necessary conversions.
14869 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14871 * cs-parser.jay: Add error 1031 report.
14873 * cs-tokenizer.cs: Add location for error 1038.
14875 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14877 * cs-parser.jay: Add error 1016 report.
14879 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14881 * cs-parser.jay: Add errors 1575,1611 report.
14883 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14885 * cs-parser.jay: Add error 1001 report.
14887 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14890 * attribute.cs (GetMarshal): Add method argument for
14891 caller identification.
14893 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14894 agument for GetMarshal and RuntimeMissingSupport.
14896 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14898 * attribute.cs (ExtractSecurityPermissionSet): Removed
14899 TypeManager.code_access_permission_type.
14901 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14903 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14905 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14906 for obsolete use of a variable here. Fixes regression on errors
14907 cs0619-25 and cs0619-26.
14909 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14911 Fix #62358, implemented security attribute encoding.
14913 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14914 Tests permitted SecurityAction for assembly or other types.
14915 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14916 data from SecurityPermissionAttribute to PermisionSet class.
14918 * class.cs (ApplyAttributeBuilder): Added special handling
14919 for System.Security.Permissions.SecurityAttribute based types.
14921 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14922 special handling for System.Security.Permissions.SecurityAttribute
14925 * enum.cs (ApplyAttributeBuilder): Added special handling
14926 for System.Security.Permissions.SecurityAttribute based types.
14928 * parameter.cs (ApplyAttributeBuilder): Added special handling
14929 for System.Security.Permissions.SecurityAttribute based types.
14931 * rootcontext.cs: Next 2 core types.
14933 * typemanager.cs (TypeManager.security_permission_attr_type):
14934 Built in type for the SecurityPermission Attribute.
14935 (code_access_permission_type): Build in type.
14937 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14939 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14940 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14941 all of this information into
14942 EmitContext.EmitCapturedVariableInstance.
14944 * codegen.cs (EmitCapturedVariableInstance): move here the
14945 funcionality of emitting an ldarg.0 in the presence of a
14946 remapping. This centralizes the instance emit code.
14948 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14949 then emit a load of this: it means that we have reached the
14950 topmost ScopeInfo: the one that contains the pointer to the
14951 instance of the class hosting the anonymous method.
14953 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14954 captures to the topmost CaptureContext.
14956 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14958 * expression.cs (LocalVariableReference): Move the knowledge about
14959 the iterators into codegen's EmitCapturedVariableInstance.
14961 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14963 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14964 all code paths return a value from an anonymous method (it is the
14965 same as the 161 error, but for anonymous methods).
14967 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14969 The introduction of anonymous methods in the compiler changed
14970 various ways of doing things in the compiler. The most
14971 significant one is the hard split between the resolution phase
14972 and the emission phases of the compiler.
14974 For instance, routines that referenced local variables no
14975 longer can safely create temporary variables during the
14976 resolution phase: they must do so from the emission phase,
14977 since the variable might have been "captured", hence access to
14978 it can not be done with the local-variable operations from the runtime.
14982 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14983 is a toplevel block.
14985 (ToplevelBlock): A new kind of Block, these are the blocks that
14986 are created by the parser for all toplevel method bodies. These
14987 include methods, accessors and anonymous methods.
14989 These contain some extra information not found in regular blocks:
14990 A pointer to an optional CaptureContext (for tracking captured
14991 local variables and parameters). A pointer to the parent
14994 (Return.Resolve): Catch missmatches when returning a value from an
14995 anonymous method (error 1662).
14996 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14999 (Break.Resolve): ditto.
15001 (SwitchLabel): instead of defining the labels during the
15002 resolution phase, we now turned the public ILLabel and ILLabelCode
15003 labels into methods called GetILLabelCode() and GetILLabel() that
15004 only define the label during the Emit phase.
15006 (GotoCase): Track the SwitchLabel instead of the computed label
15007 (its contained therein). Emit the code by using
15008 SwitchLabel.GetILLabelCode ().
15010 (LocalInfo.Flags.Captured): A new flag has been introduce to track
15011 whether the Local has been captured or not.
15013 (LocalInfo.IsCaptured): New property, used to tell whether the
15014 local has been captured.
15016 * anonymous.cs: Vastly updated to contain the anonymous method
15019 The main classes here are: CaptureContext which tracks any
15020 captured information for a toplevel block and ScopeInfo used to
15021 track the activation frames for various local variables.
15023 Each toplevel block has an optional capture context associated
15024 with it. When a method contains an anonymous method both the
15025 toplevel method and the anonymous method will create a capture
15026 context. When variables or parameters are captured, they are
15027 recorded on the CaptureContext that owns them, for example:
15031 MyDelegate d = delegate {
15036 Here `a' will be recorded as captured on the toplevel
15037 CapturedContext, the inner captured context will not have anything
15038 (it will only have data if local variables or parameters from it
15039 are captured in a nested anonymous method.
15041 The ScopeInfo is used to track the activation frames for local
15042 variables, for example:
15044 for (int i = 0; i < 10; i++)
15045 for (int j = 0; j < 10; j++){
15046 MyDelegate d = delegate {
15051 At runtime this captures a single captured variable `i', but it
15052 captures 10 different versions of the variable `j'. The variable
15053 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15054 recorded on a child.
15056 The toplevel ScopeInfo will also track information like the `this'
15057 pointer if instance variables were referenced (this is necessary
15058 as the anonymous method lives inside a nested class in the host
15059 type of the method).
15061 (AnonymousMethod): Expanded to track the Toplevel, implement
15062 `AnonymousMethod.Compatible' to tell whether an anonymous method
15063 can be converted to a target delegate type.
15065 The routine now also produces the anonymous method content
15067 (AnonymousDelegate): A helper class that derives from
15068 DelegateCreation, this is used to generate the code necessary to
15069 produce the delegate for the anonymous method that was created.
15071 * assign.cs: API adjustments for new changes in
15072 Convert.ImplicitStandardConversionExists.
15074 * class.cs: Adjustments to cope with the fact that now toplevel
15075 blocks are of type `ToplevelBlock'.
15077 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15078 insteda of standard blocks.
15080 Flag errors if params arguments are passed to anonymous methods.
15082 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15083 `CurrentAnonymousMethod' which points to the current Anonymous
15084 Method. The variable points to the AnonymousMethod class that
15085 holds the code being compiled. It is set in the new EmitContext
15086 created for the anonymous method.
15088 (EmitContext.Phase): Introduce a variable and an enumeration to
15089 assist in enforcing some rules about when and where we are allowed
15090 to invoke certain methods (EmitContext.NeedsReturnLabel is the
15091 only one that enfonces this right now).
15093 (EmitContext.HaveCaptureInfo): new helper method that returns
15094 whether we have a CapturedContext initialized.
15096 (EmitContext.CaptureVariable): New method used to register that a
15097 LocalInfo must be flagged for capturing.
15099 (EmitContext.CapturedParameter): New method used to register that a
15100 parameters must be flagged for capturing.
15102 (EmitContext.CapturedField): New method used to register that a
15103 field must be flagged for capturing.
15105 (EmitContext.HaveCapturedVariables,
15106 EmitContext.HaveCapturedFields): Return whether there are captured
15107 variables or fields.
15109 (EmitContext.EmitMethodHostInstance): This is used to emit the
15110 instance for the anonymous method. The instance might be null
15111 (static methods), this (for anonymous methods that capture nothing
15112 and happen to live side-by-side with the current method body) or a
15113 more complicated expression if the method has a CaptureContext.
15115 (EmitContext.EmitTopBlock): Routine that drives the emission of
15116 code: it will first resolve the top block, then emit any metadata
15117 and then emit the code. The split is done so that we can extract
15118 any anonymous methods and flag any captured variables/parameters.
15120 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15121 during this phase, the ILGenerator should not be used as labels
15122 and local variables declared here might not be accessible to any
15123 code that is part of an anonymous method.
15125 Exceptions to this include the temporary variables that are
15126 created by some statements internally for holding temporary
15129 (EmitContext.EmitMeta): New routine, in charge of emitting all the
15132 (EmitContext.TemporaryReturn): This method is typically called
15133 from the Emit phase, and its the only place where we allow the
15134 ReturnLabel to be defined other than the EmitMeta. The reason is
15135 that otherwise we would have to duplicate a lot of logic in the
15136 Resolve phases of various methods that today is on the Emit
15139 (EmitContext.NeedReturnLabel): This no longer creates the label,
15140 as the ILGenerator is not valid during the resolve phase.
15142 (EmitContext.EmitThis): Extended the knowledge in this class to
15143 work in anonymous methods in addition to iterators.
15145 (EmitContext.EmitCapturedVariableInstance): This emits whatever
15146 code is necessary on the stack to access the instance to a local
15147 variable (the variable will be accessed as a field).
15149 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15150 EmitContext.EmitAddressOfParameter): Routines to support
15151 parameters (not completed at this point).
15153 Removals: Removed RemapLocal and RemapLocalLValue. We probably
15154 will also remove the parameters.
15156 * convert.cs (Convert): Define a `ConstantEC' which points to a
15157 null. This is just to prefity some code that uses
15158 ImplicitStandardConversion code and do not have an EmitContext
15161 The idea is to flag explicitly that at that point in time, it is
15162 known that the conversion will not trigger the delegate checking
15163 code in implicit conversions (which requires a valid
15166 Everywhere: pass new EmitContext parameter since
15167 ImplicitStandardConversionExists now requires it to check for
15168 anonymous method conversions.
15170 (Convert.ImplicitStandardConversionExists): If the type of an
15171 expression is the anonymous_method_type, and the type is a
15172 delegate, we invoke the AnonymousMethod.Compatible method to check
15173 whether an implicit conversion is possible.
15175 (Convert.ImplicitConversionStandard): Only do implicit method
15176 group conversions if the language level is not ISO_1.
15178 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15179 MethodInfo for the Invoke method. used by Delegate and
15182 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15183 method conversions if the target type is a delegate.
15185 Removed extra debugging nops.
15187 (LocalVariableReference): Turn the `local_info' into a public
15190 Add `prepared' field, the same hack used for FieldExprs to cope
15191 with composed assignments, as Local variables do not necessarily
15192 operate purely on the stack as they used to: they can be captured
15195 Add `temp' for a temporary result, like fields.
15197 Refactor DoResolve and DoResolveLValue into DoResolveBase.
15199 It now copes with Local variables that are captured and emits the
15200 proper instance variable to load it from a field in the captured
15203 (ParameterReference.DoResolveBase): During the resolve phase,
15204 capture parameters if we are in an anonymous method.
15206 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15207 anonymous method, use the EmitContext helper routines to emit the
15208 parameter reference.
15210 * iterators.cs: Set RemapToProxy to true/false during the
15213 * parameters.cs (GetParameterByName): New helper method.
15215 * typemanager.cs (anonymous_method_type) a new type that
15216 represents an anonyous method. This is always an internal type,
15217 used as a fencepost to test against the anonymous-methodness of an
15220 2004-10-20 Marek Safar <marek.safar@seznam.cz>
15222 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15224 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15226 2004-10-18 Martin Baulig <martin@ximian.com>
15228 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15229 `Type' directly, but call ResolveType() on it.
15230 (Catch.Resolve): Likewise.
15231 (Foreach.Resolve): Likewise.
15233 2004-10-18 Martin Baulig <martin@ximian.com>
15235 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15236 `Type' directly, but call ResolveType() on it.
15237 (Probe.DoResolve): Likewise.
15238 (ArrayCreation.LookupType): Likewise.
15239 (TypeOf.DoResolve): Likewise.
15240 (SizeOf.DoResolve): Likewise.
15242 2004-10-18 Martin Baulig <martin@ximian.com>
15244 * expression.cs (Invocation.BetterFunction): Put back
15245 TypeManager.TypeToCoreType().
15247 2004-10-18 Raja R Harinath <rharinath@novell.com>
15249 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15252 2004-10-18 Martin Baulig <martin@ximian.com>
15254 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
15255 `Type' directly, but call ResolveType() on it.
15257 2004-10-18 Martin Baulig <martin@ximian.com>
15259 * class.cs (FieldMember.Define): Don't access the TypeExpr's
15260 `Type' directly, but call ResolveType() on it.
15261 (MemberBase.DoDefine): Likewise.
15263 * expression.cs (New.DoResolve): Don't access the TypeExpr's
15264 `Type' directly, but call ResolveType() on it.
15265 (ComposedCast.DoResolveAsTypeStep): Likewise.
15267 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15268 `Type' directly, but call ResolveType() on it.
15270 2004-10-17 John Luke <john.luke@gmail.com>
15272 * class.cs (Operator.GetSignatureForError): use CSharpName
15274 * parameter.cs (Parameter.GetSignatureForError): Returns
15275 correct name even if was not defined.
15277 2004-10-13 Raja R Harinath <rharinath@novell.com>
15280 * class.cs (TypeContainer.EmitContext): New property.
15281 (DefineNestedTypes): Create an emitcontext for each part.
15282 (MethodCore.DoDefineParameters): Use container's emitcontext.
15283 Pass type array to InternalParameters.
15284 (MemberBase.DoDefine): Use container's emitcontext.
15285 (FieldMember.Define): Likewise.
15286 (Event.Define): Likewise.
15287 (SetMethod.GetParameterInfo): Change argument to EmitContext.
15288 Pass type array to InternalParameters.
15289 (SetIndexerMethod.GetParameterInfo): Likewise.
15290 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15291 * delegate.cs (Define): Pass emitcontext to
15292 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
15293 array to InternalParameters.
15294 * expression.cs (ParameterReference.DoResolveBase): Pass
15295 emitcontext to GetParameterInfo.
15296 (ComposedCast.DoResolveAsTypeStep): Remove check on
15297 ec.ResolvingTypeTree.
15298 * parameter.cs (Parameter.Resolve): Change argument to
15299 EmitContext. Use ResolveAsTypeTerminal.
15300 (Parameter.GetSignature): Change argument to EmitContext.
15301 (Parameters.ComputeSignature): Likewise.
15302 (Parameters.ComputeParameterTypes): Likewise.
15303 (Parameters.GetParameterInfo): Likewise.
15304 (Parameters.ComputeAndDefineParameterTypes): Likewise.
15305 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
15306 * support.cs (InternalParameters..ctor): Remove variant that takes
15308 * typemanager.cs (system_intptr_expr): New.
15309 (InitExpressionTypes): Initialize it.
15311 2004-10-12 Chris Toshok <toshok@ximian.com>
15313 * cs-parser.jay: fix location for try_statement and catch_clause.
15315 2004-10-11 Martin Baulig <martin@ximian.com>
15317 * report.cs: Don't make --fatal abort on warnings, we have
15318 -warnaserror for that.
15320 2004-10-07 Raja R Harinath <rharinath@novell.com>
15322 More DeclSpace.ResolveType avoidance.
15323 * decl.cs (MemberCore.InUnsafe): New property.
15324 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
15325 with newly created EmitContext.
15326 (FieldMember.Define): Likewise.
15327 * delegate.cs (Delegate.Define): Likewise.
15328 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15329 only if normal name-lookup fails.
15330 (TypeExpr.DoResolve): Enable error-checking.
15331 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15332 (SizeOf.DoResolve): Likewise.
15333 (ComposedCast.DoResolveAsTypeStep): Likewise.
15334 (StackAlloc.DoResolve): Likewise.
15335 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15336 (Block.Unsafe): New property.
15337 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15338 (Unsafe): Set 'unsafe' flag of contained block.
15339 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15340 (Fixed.Resolve): Likewise.
15341 (Catch.Resolve): Likewise.
15342 (Using.ResolveLocalVariableDecls): Likewise.
15343 (Foreach.Resolve): Likewise.
15345 2004-10-05 John Luke <john.luke@gmail.com>
15347 * cs-parser.jay: add location to error CS0175
15349 2004-10-04 Miguel de Icaza <miguel@ximian.com>
15351 * ecore.cs (Expression.Constantity): Add support for turning null
15354 * const.cs (Const.Define): Allow constants to be reference types
15355 as long as the value is Null.
15357 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
15359 * namespace.cs (NamespaceEntry.Using): No matter which warning
15360 level is set, check if this namespace name has already been added.
15362 2004-10-03 Ben Maurer <bmaurer@ximian.com>
15364 * expression.cs: reftype [!=]= null should always use br[true,false].
15367 2004-10-03 Marek Safar <marek.safar@seznam.cz>
15370 * attribute.cs: Enum conversion moved to
15371 GetAttributeArgumentExpression to be applied to the all
15374 2004-10-01 Raja R Harinath <rharinath@novell.com>
15376 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15377 * class.c (TypeContainer.DefineType): Flag error if
15378 base types aren't accessible due to access permissions.
15379 * decl.cs (DeclSpace.ResolveType): Move logic to
15380 Expression.ResolveAsTypeTerminal.
15381 (DeclSpace.ResolveTypeExpr): Thin layer over
15382 Expression.ResolveAsTypeTerminal.
15383 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15384 Refactor code into NestedAccess. Use it.
15385 (DeclSpace.NestedAccess): New.
15386 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15387 argument to silence errors. Check access permissions.
15388 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15389 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15390 (Cast.DoResolve): Likewise.
15391 (New.DoResolve): Likewise.
15392 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15393 (TypeOf.DoResolve): Likewise.
15395 * expression.cs (Invocation.BetterConversion): Return the Type of
15396 the better conversion. Implement section 14.4.2.3 more faithfully.
15397 (Invocation.BetterFunction): Make boolean. Make correspondence to
15398 section 14.4.2.2 explicit.
15399 (Invocation.OverloadResolve): Update.
15400 (Invocation): Remove is_base field.
15401 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
15402 (Invocation.Emit): Likewise.
15404 2004-09-27 Raja R Harinath <rharinath@novell.com>
15406 * README: Update to changes.
15408 2004-09-24 Marek Safar <marek.safar@seznam.cz>
15410 * cs-parser.jay: Reverted 642 warning fix.
15412 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15415 * decl.cs (FindMemberWithSameName): Indexer can have more than
15418 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15420 * expression.cs (LocalVariableReference.DoResolveLValue):
15421 Do not report warning 219 for out values.
15422 (EmptyExpression.Null): New member to avoid extra allocations.
15424 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15426 * cs-parser.jay: Fix wrong warning 642 report.
15428 * cs-tokenizer.cs (CheckNextToken): New helper;
15429 Inspect next character if is same as expected.
15431 2004-09-23 Martin Baulig <martin@ximian.com>
15433 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15434 (Convert.ImplicitReferenceConversionExists): Likewise.
15436 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15438 * class.cs (Operator.Define): Add error 448 and 559 report.
15440 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15442 * class.cs (MemberBase.IsTypePermitted): New protected
15443 method for checking error CS0610.
15445 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15447 * class.cs (TypeContainer.HasExplicitLayout): New property
15448 Returns whether container has StructLayout attribute set Explicit.
15449 (FieldMember): New abstract class for consts and fields.
15450 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15451 (Field): Reuse FieldMember.
15453 * const.cs (Const): Reuse FieldMember.
15455 * rootcontext.cs: EmitConstants call moved to class.
15457 2004-09-22 Martin Baulig <martin@ximian.com>
15459 Thanks to Peter Sestoft for this bug report.
15461 * expression.cs (Conditional): If both the `trueExpr' and the
15462 `falseExpr' is a NullLiteral, return a NullLiteral.
15464 2004-09-22 Martin Baulig <martin@ximian.com>
15466 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15467 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15468 for the "get_Current" call.
15470 2004-09-22 Martin Baulig <martin@ximian.com>
15472 Marek and me just fixed one of our oldest bugs: #28562 :-)
15474 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15476 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15477 we're an EnumConstant, just return that.
15478 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15479 an EnumConstant. In this case, we need to use GetValueAsEnumType()
15480 to get the value which'll actually be written into the attribute.
15481 However, we have to use GetValue() to access the attribute's value
15484 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15486 * constant.cs (Constant.IsNegative): New abstract property
15489 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15490 (StackAlloc.DoResolve): Reused IsNegative.
15492 2004-09-21 Martin Baulig <martin@ximian.com>
15494 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15495 if we're used in an iterator, we may be called from different
15498 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15499 we actually have an exception block.
15501 2004-09-20 John Luke <jluke@cfl.rr.com>
15503 * class.cs, cs-parser.jay: Improve the error report for 1520:
15504 report the actual line where the error happens, not where the
15505 class was declared.
15507 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15508 Pass location information that was available elsewhere.
15510 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
15512 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15513 runtime to delay sign assemblies.
15515 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15517 * cs-parser.jay: Do not report the stack trace, this is barely
15520 2004-08-22 John Luke <john.luke@gmail.com>
15522 * driver.cs : check that a resource id is not already used
15523 before adding it, report CS1508 if it is, bug #63637
15525 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15527 * ecore.cs: Removed dead code.
15529 2004-09-18 Marek Safar <marek.safar@seznam.cz>
15531 * class.cs: Do not report warning CS0067 on the interfaces.
15533 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15535 * cs-parser.jay: Add error 504 report.
15537 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15539 * rootcontext.cs: WarningLevel is 4 by default now.
15541 * statement.cs (Fixed.Resolve): Do not null
15544 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15547 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15548 deep search when property is not virtual.
15549 (PropertyExpr.ResolveAccessors): Make one call for both
15552 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15555 * statement.cs: Error 152 report constains also location.
15557 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15560 * const.cs: Explicitly set constant as static.
15562 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15565 * cs-parser.jay: Add error 1017 report.
15567 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15569 Fixed bug #59980, #64224
15570 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15572 * typemanager.cs (IsSpecialMethod): Simplified
15574 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15576 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15577 condition with better params.
15579 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15582 * attribute.cs (Resolve): Property has to have both
15585 2004-09-14 Martin Baulig <martin@ximian.com>
15587 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15589 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15592 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15593 called and is obsolete then this member suppress message
15594 when call is inside next [Obsolete] method or type.
15596 * expression.cs: Use TestObsoleteMethodUsage member.
15598 2004-09-14 Martin Baulig <martin@ximian.com>
15600 * cs-parser.jay: Sync a bit with the GMCS version.
15602 2004-09-14 Martin Baulig <martin@ximian.com>
15604 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15605 (CSharpParser.yacc_verbose_flag): New public field.
15607 * genericparser.cs: Removed.
15609 2004-09-14 Raja R Harinath <rharinath@novell.com>
15611 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15613 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15615 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15617 2004-09-10 Martin Baulig <martin@ximian.com>
15619 Backported my MemberName changes from GMCS into MCS.
15621 - we are now using a special `MemberName' class instead of using
15622 strings; in GMCS, the `MemberName' also contains the type
15625 - changed the grammar rules a bit:
15626 * the old `member_name' is now a `namespace_or_type_name':
15627 The rule is that we use `namespace_or_type_name' everywhere
15628 where we expect either a "member name" (GetEnumerator) or a
15629 "member name" with an explicit interface name
15630 (IEnumerable.GetEnumerator).
15631 In GMCS, the explicit interface name may include type arguments
15632 (IEnumerable<T>.GetEnumerator).
15633 * we use `member_name' instead of just `IDENTIFIER' for
15635 The rule is that we use `member_name' wherever a member may
15636 have type parameters in GMCS.
15638 * decl.cs (MemberName): New public class.
15639 (MemberCore.MemberName): New public readonly field.
15640 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15641 (DeclSpace): Likewise.
15643 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15644 * enum.cs (Enum.ctor): Likewise.
15646 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15648 (AliasEntry.ctor): Take a MemberName, not an Expression.
15649 (AliasEntry.UsingAlias): Likewise.
15651 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15652 (IMethodData.MemberName): Changed type from string to MemberName.
15653 (MemberBase.ExplicitInterfaceName): Likewise.
15654 (AbstractPropertyEventMethod.SetupName): Make this private.
15655 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15656 argument; compute the member name here.
15657 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15658 on the `member.MemberName' and the `prefix'.
15660 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15662 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15663 thus, we get a `MemberName' instead of a `string'. These
15664 declarations may have type parameters in GMCS.
15665 (interface_method_declaration, delegate_declaration): Likewise.
15666 (class_declaration, interface_declaration): Likewise.
15667 (method_header): Use `namespace_or_type_name' instead of
15668 `member_name'. We may be an explicit interface implementation.
15669 (property_declaration, event_declaration): Likewise.
15670 (member_name): This is now just an `IDENTIFIER', not a
15671 `namespace_or_type_name'.
15672 (type_name, interface_type): Removed.
15673 (namespace_or_type_name): Return a MemberName, not an Expression.
15674 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15675 call GetTypeExpression() on the MemberName to get an expression.
15676 (IndexerDeclaration.interface_type): Changed type from string to
15678 (MakeName): Operate on MemberName's instead of string's.
15680 2004-09-13 Raja R Harinath <rharinath@novell.com>
15683 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15684 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15685 lookup to avoid symbols introduced by 'using'.
15686 * rootcontext.cs (NamespaceLookup): Update.
15688 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15690 * class.cs (TypeContainer.DoDefineMembers): Do not call
15691 DefineDefaultConstructor for static classes.
15693 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15695 * attribute.cs (Attribute.Resolve): Add error 653 report.
15697 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15699 (Method.ApplyAttributeBuilder): Add error 685 report.
15700 (Operator.Define): Add error 564 report.
15702 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15704 * expression.cs (Invocation.DoResolve): Add error
15705 245 and 250 report.
15707 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15710 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15712 * class.cs (ConstructorInitializer.Resolve):
15713 Wrong error number (515->516).
15715 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15717 * class.cs (Indexer.Define): Add error 631 report.
15719 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15721 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15723 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15725 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15727 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15729 * cs-parser.jay: Added error CS0241 report.
15731 2004-09-10 Raja R Harinath <rharinath@novell.com>
15733 * cs-parser.jay (fixed_statement): Introduce a scope for the
15734 declaration in the 'fixed' statement.
15736 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15738 * cs-parser.jay: Added CS0230 error report.
15740 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15742 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15744 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15746 * expression.cs (Argument.Resolve): Added error CS0192 and
15749 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15751 C# 2.0 #pragma warning feature
15753 * cs-tokenizer.cs (PreProcessPragma): New method;
15754 Handles #pragma directive.
15756 * report.cs (WarningRegions): New class; Support
15757 class for #pragma warning directive. It tests whether
15758 warning is enabled for a given line.
15760 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15762 * const.cs: Add more descriptive error report, tahnks to
15765 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15767 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15769 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15771 * expression.cs: Apply patch from Ben: Remove dead code from
15772 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15773 as that code just threw an exception anwyays.
15775 * const.cs: Remove the call to the turnintoconstant, for details
15778 * literal.cs: The type of the null-literal is the null type; So
15779 we use a placeholder type (literal.cs:System.Null, defined here)
15782 * expression.cs (Conditional.DoResolve): Remove some old code that
15783 is no longer needed, conversions have been fixed.
15785 (ArrayCreationExpression.DoResolve): Return false if we fail to
15786 resolve the inner expression.
15788 2004-09-07 Raja R Harinath <rharinath@novell.com>
15791 * cs-parser.jay (delegate_declaration): Record a delegate
15792 declaration as a type declaration.
15793 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15795 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15797 * parameter.cs: Do not crash if the type can not be resolved.
15799 * expression.cs: Report errors with unsafe pointers, fixes #64896
15801 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15803 * expression.cs: Pointer arith always needs to do a conv.i
15804 if the operand is a long. fix 65320
15806 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15808 Fixed cs0619-37.cs, cs0619-38.cs
15810 * enum.cs (GetObsoleteAttribute): Removed.
15812 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15813 on Enum member is double staged. The first is tested member
15816 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15818 Fixed #56986, #63631, #65231
15820 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15821 adds member to name container.
15822 (TypeContainer.AddToTypeContainer): New method, adds type to
15824 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15825 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15826 AddOperator): Simplified by reusing AddToMemberContainer.
15827 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15829 (Method.CheckForDuplications): Fixed implementation to test all
15831 (MemberBase): Detection whether member is explicit interface
15832 implementation is now in constructor.
15833 (MemberBase.UpdateMemberName): Handles IndexerName.
15834 (Accessor): Changed to keep also location information.
15835 (AbstractPropertyEventMethod): Is derived from MemberCore.
15836 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15837 will be emited or not.
15838 (PropertyBase.AreAccessorsDuplicateImplementation):
15839 Tests whether accessors are not in collision with some method.
15840 (Operator): Is derived from MethodCore to simplify common
15843 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15845 (DeclSpace.AddToContainer): Adds the member to defined_names
15846 table. It tests for duplications and enclosing name conflicts.
15848 * enum.cs (EnumMember): Clean up to reuse the base structures
15850 2004-09-03 Martin Baulig <martin@ximian.com>
15852 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15853 into TypeContainer, to make partial classes work again.
15855 2004-09-03 Martin Baulig <martin@ximian.com>
15857 * rootcontext.cs (RootContext.V2): Removed.
15859 2004-03-23 Martin Baulig <martin@ximian.com>
15861 * expression.cs (Invocation.OverloadResolve): Added `bool
15862 may_fail' argument and use it instead of the Location.IsNull() hack.
15864 2004-09-03 Martin Baulig <martin@ximian.com>
15866 Merged latest changes into gmcs. Please keep this comment in
15867 here, it makes it easier for me to see what changed in MCS since
15868 the last time I merged.
15870 2004-09-03 Raja R Harinath <rharinath@novell.com>
15873 * expression.cs (BetterConversion): Don't allow either conversion
15874 to be null. Remove redundant implicit conversion test when 'q ==
15875 null' -- when this function is invoked, we already know that the
15876 implicit conversion exists.
15877 (BetterFunction): Assume that 'best' is non-null. Remove
15878 redundant reimplementation of IsApplicable when 'best' is null.
15879 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15880 number of arguments.
15881 (IsAncestralType): Extract from OverloadResolve.
15882 (OverloadResolve): Make robust to the MethodGroupExpr being
15883 unsorted. Implement all the logic of Section 14.5.5.1, and
15884 support overloading of methods from multiple applicable types.
15885 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15887 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15888 (RealError, Warning): Append type of report to related symbol.
15890 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15892 * enum.cs: Fixed CLS-Compliance checks for enum members.
15893 Error tests cs3008-8.cs, cs3014-8.cs
15895 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15897 Fixed bug #62342, #63102
15898 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15899 like ImplementMethod.
15901 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15903 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15906 2004-09-02 Martin Baulig <martin@ximian.com>
15908 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15909 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15912 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15914 C# 2.0 Static classes implemented
15916 * class.cs (TypeContainer): instance_constructors,
15917 initialized_fields, initialized_static_fields,
15918 default_constructor, base_inteface_types are protected to be
15919 accessible from StaticClass.
15920 (TypeContainer.DefineDefaultConstructor): New virtual method
15921 for custom default constructor generating
15922 (StaticClass): New class to handle "Static classes" feature.
15924 * cs-parser.jay: Handle static keyword on class like instance
15927 * driver.cs: Added "/langversion" command line switch with two
15928 options (iso-1, default).
15930 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15932 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15934 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15936 * delegate.cs: Style.
15938 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15940 * delegate.cs: Add seperate instance expr field for miguel.
15942 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15944 * PointerArithmetic (Resolve): make sure we are not doing
15945 pointer arith on void*. Also, make sure we are resolved
15946 by not setting eclass until resolve.
15948 All callers: Make sure that PointerArithmetic gets resolved.
15950 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15952 * ArrayCreation (LookupType): If the type does not resolve
15953 to an array, give an error.
15955 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15957 * statement.cs (Try.Resolve): Fixed bug #64222
15959 2004-08-27 Martin Baulig <martin@ximian.com>
15962 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15965 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15967 * ecore.cs (Constantify): Get underlying type via
15968 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15969 Windows in special cases.
15971 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15973 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15974 for obtaining also private methods.
15975 (GetRemoveMethod): Used GetRemoveMethod (true)
15976 for obtaining also private methods.
15978 2004-08-24 Martin Baulig <martin@ximian.com>
15980 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15981 MethodAttributes.HideBySig for operators.
15983 2004-08-23 Martin Baulig <martin@ximian.com>
15985 Back to the old error reporting system :-)
15987 * report.cs (Message): Removed.
15988 (Report.MessageData, ErrorData, WarningData): Removed.
15989 (Report.Error, Warning): Back to the old system.
15991 2004-08-23 Martin Baulig <martin@ximian.com>
15993 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15995 * class.cs (TypeContainer.ParentContainer): New public virtual
15996 method; replaces the explicit interface implementation.
15997 (ClassPart.ParentContainer): Override.
15999 2004-08-23 Martin Baulig <martin@ximian.com>
16001 * statement.cs (Switch): Added support for constant switches; see
16002 #59428 or test-285.cs.
16004 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16007 * statement.cs (GetEnumeratorFilter): Removed useless
16008 logic because C# specs is strict. GetEnumerator must be
16011 2004-08-22 Martin Baulig <martin@ximian.com>
16013 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16014 a switch and may break, reset the barrier. Fixes #59867.
16016 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16018 CLS-Compliance speed up (~5% for corlib)
16020 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16021 New method. Tests container for CLS-Compliant names
16023 * class.cs (TypeContainer.VerifyClsName): New method.
16024 Checks whether container name is CLS Compliant.
16025 (Constructor): Implements IMethodData.
16027 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16028 low-case table for CLS Compliance test.
16029 (MemberCache.VerifyClsParameterConflict): New method.
16030 Checks method parameters for CS3006 error.
16032 * enum.cs (EnumMember): Is derived from MemberCore.
16033 (Enum.VerifyClsName): Optimized for better performance.
16035 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16037 * report.cs: Renamed Error_T to Error and changed all
16040 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16042 * class.cs (TypeContainer.IndexerArrayList): New inner class
16043 container for indexers.
16044 (TypeContainer.DefaultIndexerName): New constant for default
16045 indexer name. Replaced all "Item" with this constant.
16046 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16048 * typemanager.cs (TypeManager.default_member_ctor): Cache here
16049 DefaultMemberAttribute constructor.
16051 2004-08-05 Martin Baulig <martin@ximian.com>
16053 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16056 2004-08-05 Marek Safar <marek.safar@seznam.cz>
16058 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16059 multi platforms problem.
16061 * compiler.csproj: Included shared files.
16063 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16065 Fix bug 60333, 55971 in the more general way
16066 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16067 Added arg_type argument for constant conversion.
16068 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16070 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16073 * class.cs (TypeContainer ): New inner classes MethodArrayList,
16074 OperatorArrayList, MethodCoreArrayList for typecontainer
16075 containers. Changed class member types to these new types.
16076 (MethodArrayList.DefineMembers): Added test for CS0659.
16078 2004-08-04 Miguel de Icaza <miguel@ximian.com>
16080 * cfold.cs: Synchronize the folding with the code in expression.cs
16081 Binary.DoNumericPromotions for uint operands.
16083 * attribute.cs: Revert patch from Raja, it introduced a regression
16084 while building Blam-1.2.1 (hard to isolate a test case).
16086 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16090 (TypeContainer.Define): Renamed to DefineContainerMembers because of
16092 (MethodCore.parent_method): New member. The method we're overriding
16093 if this is an override method.
16094 (MethodCore.CheckBase): Moved from Method class and made common.
16095 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16097 (MethodCore.CheckForDuplications): New abstract method. For custom
16098 member duplication search in a container
16099 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16100 method and its return type.
16101 (Event.conflict_symbol): New member. Symbol with same name in the
16105 (MemberCache.FindMemberWithSameName): New method. The method
16106 is looking for conflict with inherited symbols.
16108 2004-08-04 Martin Baulig <martin@ximian.com>
16110 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16112 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16114 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16116 * report.cs (Message): New enum for better error, warning reference in
16118 (MessageData): New inner abstract class. It generally handles printing of
16119 error and warning messages.
16120 Removed unused Error, Warning, Message methods.
16122 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16124 Fix for cs0592-8.cs test
16126 (Attributable.ValidAttributeTargets): Made public.
16127 (Attribute.ExplicitTarget): New member for explicit target value.
16128 (Attribute.CheckTargets): Now we translate explicit attribute
16129 target to Target here.
16131 2004-08-03 Ben Maurer <bmaurer@ximian.com>
16133 * ecore.cs (MethodGroupExpr): new IsBase property.
16135 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16137 * delegate.cs (DelegateCreation): store a MethodGroupExpr
16138 rather than an instance expr.
16140 (DelegateCreation.Emit): Use the method group rather than
16141 the instance expression. Also, if you have base.Foo as the
16142 method for a delegate, make sure to emit ldftn, not ldftnvirt.
16144 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
16146 (NewDelegate.DoResolve): Only check for the existance of Invoke
16147 if the method is going to be needed. Use MethodGroupExpr.
16149 (NewDelegate.Emit): Remove, DelegateCreation implements this.
16151 * expression.cs: For pointer arith., make sure to use
16152 the size of the type, not the size of the pointer to
16155 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16158 * class.cs (Class): Added error CS0502 test.
16160 2004-08-03 John Luke <jluke@cfl.rr.com>
16161 Raja R Harinath <rharinath@novell.com>
16164 * attribute.cs (Attribute.complained_before): New flag.
16165 (Attribute.ResolveType, Attribute.Resolve),
16166 (Attribute.DefinePInvokeMethod): Set it.
16167 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16169 2004-08-03 Martin Baulig <martin@ximian.com>
16171 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16172 use a user-defined operator; we still need to do numeric
16173 promotions in case one argument is a builtin type and the other
16174 one has an implicit conversion to that type. Fixes #62322.
16176 2004-08-02 Martin Baulig <martin@ximian.com>
16178 * statement.cs (LocalInfo.Flags): Added `IsThis'.
16179 (LocalInfo.IsThis): New public property.
16180 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16182 2004-08-01 Martin Baulig <martin@ximian.com>
16184 * class.cs (TypeContainer.GetClassBases): Don't set the default
16185 here since we may get called from GetPartialBases().
16186 (TypeContainer.DefineType): If GetClassBases() didn't return a
16187 parent, use the default one.
16189 2004-07-30 Duncan Mak <duncan@ximian.com>
16191 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16193 2004-07-30 Martin Baulig <martin@ximian.com>
16195 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16197 * class.cs (SourceMethod): New public class, derive from the
16198 symbol writer's ISourceMethod.
16199 (Method): Use the new symbol writer API.
16201 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16202 as argument and use the new symbol writer.
16205 (SourceFile): Implement the symbol writer's ISourceFile.
16206 (Location.SymbolDocument): Removed.
16207 (Location.SourceFile): New public property.
16209 * symbolwriter.cs: Use the new symbol writer API.
16211 2004-07-30 Raja R Harinath <rharinath@novell.com>
16213 * Makefile (install-local): Remove. Functionality moved to
16216 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
16218 * Makefile: Install mcs.exe.config file together with mcs.exe.
16219 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16220 correct runtime version.
16222 2004-07-25 Martin Baulig <martin@ximian.com>
16225 (TypeContainer.RegisterOrder): Removed, this was unused.
16226 (TypeContainer, interface_order): Removed.
16227 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16228 TypeContainer as argument since we can also be called with a
16229 `PartialContainer' for a partial class/struct/interface.
16230 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16231 of checking whether we're an `Interface' - we could be a
16232 `PartialContainer'.
16233 (PartialContainer.Register): Override; call
16234 AddClass()/AddStruct()/AddInterface() on our parent.
16236 * cs-parser.jay (interface_member_declaration): Add things to the
16237 `current_container', not the `current_class'.
16239 * rootcontext.cs (RegisterOrder): The overloaded version which
16240 takes an `Interface' was unused, removed.
16242 * typemanager.cs (TypeManager.LookupInterface): Return a
16243 `TypeContainer', not an `Interface'.
16244 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16245 contain a `PartialContainer' for an interface, so check it's
16246 `Kind' to figure out what it is.
16248 2004-07-25 Martin Baulig <martin@ximian.com>
16250 * class.cs (Class.DefaultTypeAttributes): New public constant.
16251 (Struct.DefaultTypeAttributes): Likewise.
16252 (Interface.DefaultTypeAttributes): Likewise.
16253 (PartialContainer.TypeAttr): Override this and add the
16254 DefaultTypeAttributes.
16256 2004-07-25 Martin Baulig <martin@ximian.com>
16258 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16259 we can just use the `Parent' field instead.
16261 2004-07-25 Martin Baulig <martin@ximian.com>
16263 * class.cs (TypeContainer.Emit): Renamed to EmitType().
16265 2004-07-25 Martin Baulig <martin@ximian.com>
16267 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16268 our parts before defining any methods.
16269 (TypeContainer.VerifyImplements): Make this virtual.
16270 (ClassPart.VerifyImplements): Override and call VerifyImplements()
16271 on our PartialContainer.
16273 2004-07-25 Martin Baulig <martin@ximian.com>
16275 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16277 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16278 argument, we can just use the `Parent' field instead.
16281 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
16282 (MemberBase.DoDefine): Likewise.
16284 2004-07-24 Martin Baulig <martin@ximian.com>
16286 * decl.cs (MemberCore.Parent): New public field.
16287 (DeclSpace.Parent): Moved to MemberCore.
16289 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16290 (MemberBase.ctor): Added TypeContainer argument, pass it to our
16292 (FieldBase, Field, Operator): Likewise.
16293 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16294 (EventField, Event): Likewise.
16296 2004-07-23 Martin Baulig <martin@ximian.com>
16298 * class.cs (PartialContainer): New public class.
16299 (ClassPart): New public class.
16300 (TypeContainer): Added support for partial classes.
16301 (TypeContainer.GetClassBases): Splitted some of the functionality
16302 out into GetNormalBases() and GetPartialBases().
16304 * cs-tokenizer.cs (Token.PARTIAL): New token.
16305 (Tokenizer.consume_identifier): Added some hacks to recognize
16306 `partial', but only if it's immediately followed by `class',
16307 `struct' or `interface'.
16309 * cs-parser.jay: Added support for partial clases.
16311 2004-07-23 Martin Baulig <martin@ximian.com>
16313 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16314 a `DeclSpace' and also made it readonly.
16315 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16316 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16317 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16319 * cs-parser.jay: Pass the `current_class', not the
16320 `current_container' (at the moment, this is still the same thing)
16321 to a new Method, Property, Event, Indexer or Constructor.
16323 2004-07-23 Martin Baulig <martin@ximian.com>
16325 * cs-parser.jay (CSharpParser): Added a new `current_class' field
16326 and removed the `current_interface' one.
16327 (struct_declaration, class_declaration, interface_declaration):
16328 Set `current_class' to the newly created class/struct/interface;
16329 set their `Bases' and call Register() before parsing their body.
16331 2004-07-23 Martin Baulig <martin@ximian.com>
16333 * class.cs (Kind): New public enum.
16334 (TypeContainer): Made this class abstract.
16335 (TypeContainer.Kind): New public readonly field.
16336 (TypeContainer.CheckDef): New public method; moved here from
16338 (TypeContainer.Register): New public abstract method.
16339 (TypeContainer.GetPendingImplementations): New public abstract
16341 (TypeContainer.GetClassBases): Removed the `is_class' and
16342 `is_iface' parameters.
16343 (TypeContainer.DefineNestedTypes): Formerly known as
16345 (ClassOrStruct): Made this class abstract.
16347 * tree.cs (RootTypes): New public type.
16349 2004-07-20 Martin Baulig <martin@ximian.com>
16351 * tree.cs (Tree.RecordNamespace): Removed.
16352 (Tree.Namespaces): Removed.
16354 * rootcontext.cs (RootContext.IsNamespace): Removed.
16356 * cs-parser.jay (namespace_declaration): Just create a new
16357 NamespaceEntry here.
16359 2004-07-20 Martin Baulig <martin@ximian.com>
16361 * statement.cs (ExceptionStatement): New abstract class. This is
16362 now used as a base class for everyone who's using `finally'.
16363 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16364 our local variables before using them.
16366 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16367 virtual method. This is used by Yield.Resolve() to "steal" an
16368 outer block's `finally' clauses.
16369 (FlowBranchingException): The .ctor now takes an ExceptionStatement
16372 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16373 version which takes an ExceptionStatement. This version must be
16374 used to create exception branchings.
16377 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16378 (Iterator.EmitMoveNext): Added exception support; protect the
16379 block with a `fault' clause, properly handle 'finally' clauses.
16380 (Iterator.EmitDispose): Run all the `finally' clauses here.
16382 2004-07-20 Martin Baulig <martin@ximian.com>
16384 * iterator.cs: This is the first of a set of changes in the
16385 iterator code. Match the spec more closely: if we're an
16386 IEnumerable, then GetEnumerator() must be called. The first time
16387 GetEnumerator() is called, it returns the current instance; all
16388 subsequent invocations (if any) must create a copy.
16390 2004-07-19 Miguel de Icaza <miguel@ximian.com>
16392 * expression.cs: Resolve the constant expression before returning
16395 2004-07-19 Martin Baulig <martin@ximian.com>
16397 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16398 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16399 the return type of the new EmitContext.
16401 2004-07-18 Martin Baulig <martin@ximian.com>
16403 * class.cs (Property.Define): Fix iterators.
16405 * iterators.cs (Iterator.Define): Moved the
16406 `container.AddInterator (this)' call here from the .ctor; only do
16407 it if we resolved successfully.
16409 2004-07-17 Miguel de Icaza <miguel@ximian.com>
16411 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16412 `true' for preprocessing directives that we parse. The return
16413 value indicates whether we should return to regular tokenizing or
16414 not, not whether it was parsed successfully.
16416 In the past if we were in: #if false ... #line #endif, we would
16417 resume parsing after `#line'. See bug 61604.
16419 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16420 building: IsEnumType should return true only for enums, not for
16421 enums or System.Enum itself. This fixes #61593.
16423 Likely what happened is that corlib was wrong: mcs depended on
16424 this bug in some places. The bug got fixed, we had to add the
16425 hack, which caused bug 61593.
16427 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16428 that was a workaround for the older conditions.
16430 2004-07-16 Ben Maurer <bmaurer@ximian.com>
16432 * assign.cs: IAssignMethod has a new interface, as documented
16433 inline. All assignment code now uses this new api.
16435 * ecore.cs, expression.cs: All classes which implement
16436 IAssignMethod now use the new interface.
16438 * expression.cs (Invocation): add a hack to EmitCall so that
16439 IndexerAccess can be the target of a compound assignment without
16440 evaluating its arguments twice.
16442 * statement.cs: Handle changes in Invocation api.
16444 2004-07-16 Martin Baulig <martin@ximian.com>
16446 * iterators.cs: Rewrote this. We're now using one single Proxy
16447 class for both the IEnumerable and the IEnumerator interface and
16448 `Iterator' derives from Class so we can use the high-level API.
16450 * class.cs (TypeContainer.AddIterator): New method.
16451 (TypeContainer.DoDefineType): New protected virtual method, which
16452 is called from DefineType().
16453 (TypeContainer.DoDefineMembers): Call DefineType() and
16454 DefineMembers() on all our iterators.
16455 (TypeContainer.Emit): Call Emit() on all our iterators.
16456 (TypeContainer.CloseType): Call CloseType() on all our iterators.
16458 * codegen.cs (EmitContext.CurrentIterator): New public field.
16460 2004-07-15 Martin Baulig <martin@ximian.com>
16463 (TypeManager.not_supported_exception_type): New type.
16465 2004-07-14 Martin Baulig <martin@ximian.com>
16467 * iterators.cs: Use real error numbers.
16469 2004-07-14 Martin Baulig <martin@ximian.com>
16471 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16472 requires this to be a System.Collection.IEnumerable and not a
16473 class implementing that interface.
16474 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
16476 2004-07-13 Marek Safar <marek.safar@seznam.cz>
16478 * class.cs: Fixed previous fix, it broke some error tests.
16480 2004-07-12 Martin Baulig <martin@ximian.com>
16482 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16485 2004-07-09 Miguel de Icaza <miguel@ximian.com>
16487 * assign.cs (LocalTemporary): Add new argument: is_address,If
16488 `is_address' is true, then the value that we store is the address
16489 to the real value, and not the value itself.
16491 * ecore.cs (PropertyExpr): use the new local temporary
16492 stuff to allow us to handle X.Y += z (where X is a struct)
16494 2004-07-08 Martin Baulig <martin@ximian.com>
16496 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16497 not always return, just like we're doing in Using.Resolve().
16499 2004-07-07 Miguel de Icaza <miguel@ximian.com>
16501 * cs-parser.jay (fixed_statement): flag this as Pinned.
16503 2004-07-06 Miguel de Icaza <miguel@ximian.com>
16505 * typemanager.cs (TypeManager): Removed MakePinned method, this
16506 mechanism is replaced with the .NET 2.x compatible mechanism of
16507 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16509 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
16510 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16511 `IsFixed' property which has a different meaning.
16513 2004-07-02 Raja R Harinath <rharinath@novell.com>
16515 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16516 visible from inside a nested class, not just the names of the
16517 immediately enclosing class.
16518 Fix for bug #60730.
16520 2004-06-24 Raja R Harinath <rharinath@novell.com>
16522 * expression.cs (BetterConversion): Remove buggy special-case
16523 handling of "implicit constant expression conversions". At this
16524 point, we already know that the conversion is possible -- we're
16525 only checking to see which is better.
16527 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16529 * cs-parser.jay: Added error CS0210 test.
16531 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16533 * cs-parser.jay: Added error CS0134 test.
16535 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16538 * cs-parser.jay: Added error CS0145 test.
16540 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16542 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16544 2004-06-23 Ben Maurer <bmaurer@ximian.com>
16546 * expression.cs (StackAlloc.Resolve): The argument may not
16547 be a constant; deal with this case.
16549 2004-06-23 Marek Safar <marek.safar@seznam.cz>
16551 * attribute.cs (IndexerName_GetIndexerName): Renamed to
16552 GetIndexerAttributeValue.
16553 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16555 * class.cs (Indexer.Define): Added error tests for CS0415,
16558 2004-06-23 Miguel de Icaza <miguel@ximian.com>
16560 * attribute.cs (Attribute.Resolve): Keep field code in sync with
16563 2004-06-23 Martin Baulig <martin@ximian.com>
16565 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16566 neither return nor throw, reset the barrier as well. Fixes #60457.
16568 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
16570 * class.cs : EventAttributes is now set to None by default.
16571 This fixes bug #60459.
16573 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16576 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16577 Don't throw exception but return null (it's sufficient now).
16579 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16581 * typemanager.cs (GetArgumentTypes): Faster implementation.
16583 2004-06-18 Martin Baulig <martin@ximian.com>
16585 * attribute.cs (Attribute.Resolve): Check whether we're an
16586 EmptyCast which a Constant child. Fixes #60333.
16588 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16590 * statement.cs (EmitCollectionForeach): Account for the fact that
16591 not all valuetypes are in areas which we can take the address of.
16592 For these variables, we store to a temporary variable. Also, make
16593 sure that we dont emit a `callvirt' on a valuetype method.
16595 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16597 * expression.cs (StackAlloc.DoReSolve): Added test for
16598 negative parameter (CS0247).
16600 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16603 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16605 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16608 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16611 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16613 Fix bug #58254 & cs1555.cs, cs1556.cs
16614 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16616 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16618 * cs-parser.jay: Added error CS1669 test for indexers.
16620 2004-06-11 Martin Baulig <martin@ximian.com>
16622 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16623 call this twice: for params and varargs methods.
16625 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16628 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16630 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16632 * attribute.cs (Attribute.GetValidTargets): Made public.
16635 (AbstractPropertyEventMethod): New class for better code sharing.
16636 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16638 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16640 2004-06-11 Raja R Harinath <rharinath@novell.com>
16643 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16644 that the call to Resolve is part of a MemberAccess.
16645 (Expression.Resolve): Use it for SimpleName resolution.
16646 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16647 Add 'intermediate' boolean argument.
16648 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16649 error message when the SimpleName can be resolved ambiguously
16650 between an expression and a type.
16651 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16653 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16654 call on the left-side.
16656 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16659 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16661 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16663 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16665 2004-06-11 Martin Baulig <martin@ximian.com>
16667 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16668 varargs methods if applicable.
16670 2004-06-11 Martin Baulig <martin@ximian.com>
16672 * expression.cs (Invocation.EmitCall): Don't use
16673 `method.CallingConvention == CallingConventions.VarArgs' since the
16674 method could also have `CallingConventions.HasThis'.
16676 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16678 * class.cs (Event.GetSignatureForError): Implemented.
16679 Fixed crash in error test cs3010.cs
16681 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16683 * cs-tokenizer.cs: Change the way we track __arglist to be
16684 consistent with the other keywords.
16686 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16688 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16691 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16693 * codegen.cs: Check that all referenced assemblies have a strongname
16694 before strongnaming the compiled assembly. If not report error CS1577.
16695 Fix bug #56563. Patch by Jackson Harper.
16696 * typemanager.cs: Added a method to return all referenced assemblies.
16697 Fix bug #56563. Patch by Jackson Harper.
16699 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16702 (Method.ApplyAttributeBuilder): Moved and added conditional
16703 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16706 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16708 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16711 * class.cs: (EventField.attribute_targets): Changed default target.
16713 2004-06-08 Martin Baulig <martin@ximian.com>
16715 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16717 2004-06-08 Martin Baulig <martin@ximian.com>
16719 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16721 2004-06-07 Martin Baulig <martin@ximian.com>
16723 Added support for varargs methods.
16725 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16728 * cs-parser.jay: Added support for `__arglist'.
16730 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16732 * expression.cs (Argument.AType): Added `ArgList'.
16733 (Invocation): Added support for varargs methods.
16734 (ArglistAccess): New public class.
16735 (Arglist): New public class.
16737 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16739 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16740 a method's top-level block if the method has varargs.
16742 * support.cs (ReflectionParameters, InternalParameters): Added
16743 support for varargs methods.
16745 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16747 * class.cs: Provide location in indexer error report.
16749 * driver.cs: Use standard names.
16751 * namespace.cs: Catch the use of using after a namespace has been
16752 declared also on using aliases.
16754 2004-06-03 Raja R Harinath <rharinath@novell.com>
16757 * typemanager.cs (closure_private_ok, closure_invocation_type)
16758 (closure_qualifier_type, closure_invocation_assembly)
16759 (FilterWithClosure): Move to ...
16760 (Closure): New internal nested class.
16761 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16762 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16763 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16764 (MemberLookup, MemberLookupFailed): Use it.
16765 * expression.cs (New.DoResolve): Treat the lookup for the
16766 constructor as being qualified by the 'new'ed type.
16767 (Indexers.GetIndexersForTypeOrInterface): Update.
16769 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16772 (GetConditionalAttributeValue): New method. Returns
16773 condition of ConditionalAttribute.
16774 (SearchMulti): New method. Returns all attributes of type 't'.
16775 Use it when attribute is AllowMultiple = true.
16776 (IsConditionalMethodExcluded): New method.
16779 (Method.IsExcluded): Implemented. Returns true if method has conditional
16780 attribute and the conditions is not defined (method is excluded).
16781 (IMethodData): Extended interface for ConditionalAttribute support.
16782 (PropertyMethod.IsExcluded): Implemented.
16785 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16788 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16791 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16793 * expression.cs (ArrayCreationExpression): Make this just an
16794 `expression'. It can't be a statement, so the code here was
16797 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16800 * typemanager.cs (GetFullNameSignature): New method for
16803 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16806 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16807 Use this method when MethodBuilder is null.
16808 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16809 Added test for error CS0626 (MONO reports error for this situation).
16810 (IMethodData.GetSignatureForError): Extended interface.
16812 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16815 (AttributeTester.GetObsoleteAttribute): Returns instance of
16816 ObsoleteAttribute when type is obsolete.
16819 (TypeContainer.VerifyObsoleteAttribute): Override.
16820 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16821 (MethodCode.VerifyObsoleteAttribute): Override.
16822 (MemberBase.VerifyObsoleteAttribute): Override.
16825 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16826 and report proper error.
16829 Delegate.VerifyObsoleteAttribute): Override.
16832 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16833 and report proper error.
16834 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16837 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16841 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16842 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16843 Added test for ObsoleteAttribute.
16846 (Catch): Derived from Statement.
16848 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16850 Fixed bug #59071 & cs0160.cs
16852 * statement.cs (Try.Resolve): Check here whether order of catch
16853 clauses matches their dependencies.
16855 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16857 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16858 caused a regression: #59343. Referencing nested classes from an
16859 assembly stopped working.
16861 2004-05-31 Martin Baulig <martin@ximian.com>
16863 MCS is now frozen for beta 2.
16865 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16867 * convert.cs: add a trivial cache for overload operator resolution.
16869 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16871 * decl.cs: If possible, use lookuptypedirect here. We can only do
16872 this if there is no `.' after the namespace. Avoids using
16873 LookupType, which does lots of slow processing.
16874 (FindNestedType) New method, does what it says :-).
16875 * namespace.cs: use LookupTypeDirect.
16876 * rootcontext.cs: use membercache, if possible.
16877 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16879 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16882 According to the spec,
16884 In a member access of the form E.I, if E is a single identifier,
16885 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16886 field, property, localvariable, or parameter with the same type as
16887 the meaning of E as a type-name (§3.8), then both possible
16888 meanings of E are permitted.
16890 We did not check that E as a simple-name had the same type as E as
16893 This trivial check gives us 5-7% on bootstrap time.
16895 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16897 * expression.cs (Invocation.OverloadResolve): Avoid the
16898 use of hashtables and boxing here by allocating on demand.
16900 2004-05-30 Martin Baulig <martin@ximian.com>
16902 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16903 we're doing a silent lookup. Don't try to lookup nested types in
16904 TypeManager.object_type (thanks to Ben Maurer).
16906 2004-05-30 Martin Baulig <martin@ximian.com>
16908 Committing a patch from Ben Maurer.
16910 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16912 2004-05-29 Martin Baulig <martin@ximian.com>
16914 * class.cs (IMethodData.ShouldIgnore): New method.
16916 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16917 `Location' argument, we don't need it anywhere. Use
16918 `IMethodData.ShouldIgnore ()' instead of
16919 `MethodData.GetMethodFlags ()'.
16920 (TypeManager.AddMethod): Removed.
16921 (TypeManager.AddMethod2): Renamed to AddMethod.
16923 2004-05-29 Martin Baulig <martin@ximian.com>
16925 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16927 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16928 converting from a class type S to an interface type and we already
16929 have an object on the stack, don't box it again. Fixes #52578.
16931 2004-05-29 Martin Baulig <martin@ximian.com>
16933 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16934 Added support for `params' parameters. Fixes #59267.
16936 2004-05-29 Martin Baulig <martin@ximian.com>
16938 * literal.cs (NullPointer): Provide a private .ctor which sets
16939 `type' to TypeManager.object_type. Fixes #59048.
16941 2004-05-29 Martin Baulig <martin@ximian.com>
16943 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16944 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16946 * ecore.cs (EventExpr.instance_expr): Make the field private.
16948 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16950 Fixed bug #50080 & cs0214-2.cs
16951 * expression.cs (Cast.DoResolve): Check unsafe context here.
16953 * statement.cs (Resolve.DoResolve): Likewise.
16955 2004-05-26 Martin Baulig <martin@ximian.com>
16957 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16959 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16960 (RootContext.LookupType): Pass down the `silent' flag.
16962 2004-05-25 Martin Baulig <martin@ximian.com>
16965 (MethodGroupExpr.IdenticalTypeName): New public property.
16966 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16967 expression actually refers to a type.
16969 2004-05-25 Martin Baulig <martin@ximian.com>
16971 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16972 for #56176 and made it actually work.
16974 2004-05-25 Martin Baulig <martin@ximian.com>
16976 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16977 (FieldExpr, PropertyExpr): Override and implement
16978 CacheTemporaries. Fixes #52279.
16980 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16982 * location.cs: In the new compiler listing a file twice is a
16983 warning, not an error.
16985 2004-05-24 Martin Baulig <martin@ximian.com>
16987 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16988 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16990 2004-05-24 Martin Baulig <martin@ximian.com>
16992 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16993 walking the `using' list. Fixes #53921.
16995 2004-05-24 Martin Baulig <martin@ximian.com>
16997 * const.cs (Const.LookupConstantValue): Added support for
16998 EmptyCast's; fixes #55251.
17000 2004-05-24 Martin Baulig <martin@ximian.com>
17002 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17003 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17004 which does the CS0135 check. The reason is that we first need to
17005 check whether the variable actually exists.
17007 2004-05-24 Martin Baulig <martin@ximian.com>
17009 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17010 than RootContext.LookupType() to find the explicit interface
17011 type. Fixes #58584.
17013 2004-05-24 Raja R Harinath <rharinath@novell.com>
17015 * Makefile: Simplify. Use executable.make.
17016 * mcs.exe.sources: New file. List of sources of mcs.exe.
17018 2004-05-24 Anders Carlsson <andersca@gnome.org>
17022 Use the invariant culture when doing String.Compare for CLS case
17025 2004-05-23 Martin Baulig <martin@ximian.com>
17027 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17028 don't have any dots. Fixes #52622, added cs0246-8.cs.
17030 * namespace.cs (NamespaceEntry.Lookup): Likewise.
17032 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17034 * class.cs (MemberBase.Define): Reuse MemberType member for
17035 resolved type. Other methods can use it too.
17037 2004-05-23 Martin Baulig <martin@ximian.com>
17039 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17040 the variable also exists in the current block (otherwise, we need
17041 to report a CS0103). Fixes #58670.
17043 2004-05-23 Martin Baulig <martin@ximian.com>
17045 * flowanalysis.cs (Reachability.Reachable): Compute this
17046 on-the-fly rather than storing it as a field.
17048 2004-05-23 Martin Baulig <martin@ximian.com>
17050 * flowanalysis.cs (Reachability.And): Manually compute the
17051 resulting `barrier' from the reachability.
17053 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17056 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17057 instance of ObsoleteAttribute when symbol is obsolete.
17060 (IMethodData): Extended interface for ObsoleteAttribute support.
17062 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17064 * attribute.cs: Fix bug #55970
17066 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17070 (GetObsoleteAttribute): New method. Creates the instance of
17072 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17073 ObsoleteAttribute when member is obsolete.
17074 (AttributeTester.Report_ObsoleteMessage): Common method for
17075 Obsolete error/warning reporting.
17078 (TypeContainer.base_classs_type): New member for storing parent type.
17081 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17082 for this MemberCore.
17084 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17086 * attribute.cs, const.cs: Fix bug #58590
17088 2004-05-21 Martin Baulig <martin@ximian.com>
17090 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17091 out parameters if the end of the method is unreachable. Fixes
17094 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17096 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17097 Hari was right, why extra method.
17099 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17101 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17103 2004-05-20 Martin Baulig <martin@ximian.com>
17105 Merged this back from gmcs to keep the differences to a minumum.
17107 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17108 instead of a Declspace.
17109 (Attribute.ResolveType): Likewise.
17110 (Attributes.Search): Likewise.
17111 (Attributes.Contains): Likewise.
17112 (Attributes.GetClsCompliantAttribute): Likewise.
17114 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17116 (MethodData.ApplyAttributes): Take an EmitContext instead of a
17119 2004-05-19 Marek Safar <marek.safar@seznam.cz>
17121 Fix bug #58688 (MCS does not report error when the same attribute
17124 * attribute.cs (Attribute.Emit): Distinction between null and default.
17126 2004-05-19 Raja R Harinath <rharinath@novell.com>
17128 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17129 of a top-level attribute without an attribute target.
17130 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
17132 (Attribute.Conditional_GetConditionName),
17133 (Attribute.Obsolete_GetObsoleteMessage): Update.
17134 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
17135 part of ScanForIndexerName.
17136 (Attribute.CanIgnoreInvalidAttribute): New function.
17137 (Attribute.ScanForIndexerName): Move to ...
17138 (Attributes.ScanForIndexerName): ... here.
17139 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17140 (Attributes.Search): New internal variant that can choose not to
17141 complain if types aren't resolved. The original signature now
17143 (Attributes.GetClsCompliantAttribute): Use internal variant, with
17144 complaints suppressed.
17145 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17146 only if it not useful.
17147 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17148 top-level for attributes that are shared between the assembly
17149 and a top-level class.
17150 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17151 * class.cs: Update to reflect changes.
17152 (DefineIndexers): Fuse loops.
17153 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
17154 a couple more variants of attribute names.
17156 2004-05-18 Marek Safar <marek.safar@seznam.cz>
17158 Fix bug #52585 (Implemented explicit attribute declaration)
17161 (Attributable.ValidAttributeTargets): New abstract method. It gets
17162 list of valid attribute targets for explicit target declaration.
17163 (Attribute.Target): It holds target itself.
17164 (AttributeSection): Removed.
17165 (Attribute.CheckTargets): New method. It checks whether attribute
17166 target is valid for the current element.
17169 (EventProperty): New class. For events that are declared like
17170 property (with add and remove accessors).
17171 (EventField): New class. For events that are declared like field.
17174 * cs-parser.jay: Implemented explicit attribute target declaration.
17176 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
17177 Override ValidAttributeTargets.
17180 (ReturnParameter): Class for applying custom attributes on
17182 (ParameterAtribute): New class. Class for applying custom
17183 attributes on the parameter type.
17185 2004-05-17 Miguel de Icaza <miguel@ximian.com>
17187 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17190 (Method): Allow UNSAFE here.
17192 * modifiers.cs: Support unsafe reporting.
17194 2004-05-17 Marek Safar <marek.safar@seznam.cz>
17196 * decl.cs: Fix bug #58478.
17198 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17200 * statement.cs: When checking for unreachable code on an EmptyStatement,
17201 set the location. Fixes bug #58488.
17203 2004-05-13 Miguel de Icaza <miguel@ximian.com>
17205 * driver.cs: Add -pkg handling.
17207 From Gonzalo: UseShelLExecute=false
17209 2004-05-12 Marek Safar <marek.safar@seznam.cz>
17212 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17214 (Attribute.IsClsCompliaceRequired): Moved to base for better
17216 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17217 when attribute is AttributeUsageAttribute.
17218 (Attribute.GetValidTargets): Simplified.
17219 (Attribute.GetAttributeUsage): New method returns AttributeUsage
17220 attribute for this type.
17221 (Attribute.ApplyAttributes): Method renamed to Emit and make
17223 (GlobalAttributeSection): New class for special handling of global
17224 attributes (assembly, module).
17225 (AttributeSection.Emit): New method.
17227 * class.cs: Implemented Attributable abstract methods.
17228 (MethodCore.LabelParameters): Moved to Parameter class.
17229 (Accessor): Is back simple class.
17230 (PropertyMethod): Implemented Attributable abstract class.
17231 (DelegateMethod): Implemented Attributable abstract class.
17232 (Event): New constructor for disctintion between normal Event
17233 and Event with accessors.
17235 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17237 * codegen.cs, const.cs, decl.cs, delegate.cs:
17238 (CommonAssemblyModulClass): Implemented Attributable abstract class
17241 * enum.cs: Implement IAttributeSupport interface.
17242 (EnumMember): New class for emum members. Implemented Attributable
17246 (ParameterBase): Is abstract.
17247 (ReturnParameter): New class for easier [return:] attribute handling.
17249 * typemanager.cs: Removed builder_to_attr.
17251 2004-05-11 Raja R Harinath <rharinath@novell.com>
17254 * attribute.cs (Attribute.GetPositionalValue): New function.
17255 * class.cs (TypeContainer.VerifyMembers): New function.
17256 (TypeContainer.Emit): Use it.
17257 (ClassOrStruct): New base class for Class and Struct.
17258 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
17259 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17261 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17262 then each non-static field should have a FieldOffset attribute.
17263 Otherwise, none of the fields should have a FieldOffset attribute.
17264 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
17265 and FieldOffset attributes.
17266 * typemanager.cs (TypeManager.struct_layout_attribute_type)
17267 (TypeManager.field_offset_attribute_type): New core types.
17268 (TypeManager.InitCoreTypes): Initialize them.
17270 2004-05-11 Michal Moskal <malekith@pld-linux.org>
17272 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17273 Return correct type.
17276 2004-05-09 Miguel de Icaza <miguel@ximian.com>
17278 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17279 be implicitly converted to ulong.
17281 * expression.cs: The logic for allowing operator &, | and ^ worked
17282 was wrong, it worked before because we did not report an error in
17283 an else branch. Fixes 57895.
17285 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17286 allow volatile fields to be reference types.
17288 2004-05-07 Miguel de Icaza <miguel@ximian.com>
17290 * driver.cs: Add support for /debug-
17292 2004-05-07 Raja R Harinath <rharinath@novell.com>
17294 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
17295 Add a 'complain' parameter to silence errors.
17296 (Attribute.Resolve): Update to changes. Put in sanity check to catch
17297 silently overlooked type-resolutions.
17298 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17299 to reflect changes.
17300 (Attributes.Search): New function.
17301 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17302 (Attributes.GetAttributeFullName): Remove hack.
17303 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
17304 Update to reflect changes.
17305 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17306 Use Attributes.Search instead of nested loops.
17308 2004-05-07 Marek Safar <marek.safar@seznam.cz>
17311 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17312 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17313 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17315 * report.cs: (Report.Warning): Renamed to Warning_T because of
17316 parameter collision.
17318 2004-05-05 Raja R Harinath <rharinath@novell.com>
17320 * expression.cs (MemberAccess.ResolveMemberAccess):
17321 Exit with non-zero status after Report.Error.
17322 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17324 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17326 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17328 * support.cs: Don't hang when the file is empty.
17330 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17332 * support.cs: In SeekableStreamReader, compute the preamble size of the
17333 underlying stream. Position changes should take into account that initial
17336 2004-05-03 Todd Berman <tberman@sevenl.net>
17338 * driver.cs: remove unused GetSysVersion function.
17340 2004-05-03 Todd Berman <tberman@sevenl.net>
17342 * driver.cs: Remove the hack from saturday, as well as the hack
17343 from jackson (LoadAssemblyFromGac), also adds the CWD to the
17344 link_paths to get that bit proper.
17346 2004-05-01 Todd Berman <tberman@sevenl.net>
17348 * driver.cs: Try a LoadFrom before a Load, this checks the current
17349 path. This is currently a bug in mono that is be fixed, however, this
17350 provides a workaround for now. This will be removed when the bug
17353 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
17355 * CryptoConvert.cs: Updated to latest version. Fix issue with
17356 incomplete key pairs (#57941).
17358 2004-05-01 Todd Berman <tberman@sevenl.net>
17360 * driver.cs: Remove '.' from path_chars, now System.* loads properly
17363 2004-04-30 Jackson Harper <jackson@ximian.com>
17365 * codegen.cs: Open keys readonly.
17367 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17369 * typemanager.cs: don't report cyclic struct layout when a struct
17370 contains 2 or more fields of the same type. Failed for Pango.AttrShape
17371 which has 2 Pango.Rectangle fields.
17373 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
17375 * expression.cs: Handle IntPtr comparisons with IL code
17376 rather than a method call.
17378 2004-04-29 Martin Baulig <martin@ximian.com>
17380 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
17381 the list of PropertyInfo's in class hierarchy and find the
17382 accessor. Fixes #56013.
17384 2004-04-29 Martin Baulig <martin@ximian.com>
17386 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17388 2004-04-29 Martin Baulig <martin@ximian.com>
17390 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17392 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17394 2004-04-29 Martin Baulig <martin@ximian.com>
17396 * class.cs (ConstructorInitializer.Resolve): Check whether the
17397 parent .ctor is accessible. Fixes #52146.
17399 2004-04-29 Martin Baulig <martin@ximian.com>
17401 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17403 * statement.cs (Using.EmitLocalVariableDecls): Use
17404 TypeManager.idisposable_type, not typeof (IDisposable).
17405 (Foreach.EmitCollectionForeach): Added support for valuetypes.
17407 2004-04-29 Martin Baulig <martin@ximian.com>
17409 * class.cs (Event.Define): Don't emit the field and don't set
17410 RTSpecialName and SpecialName for events on interfaces. Fixes
17413 2004-04-29 Raja R Harinath <rharinath@novell.com>
17415 Refactor Attribute.ApplyAttributes.
17416 * attribute.cs (Attributable): New base class for objects that can
17417 have Attributes applied on them.
17418 (Attribute): Make AttributeUsage fields public.
17419 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17420 (Attribute.IsInternalCall): New property.
17421 (Attribute.UsageAttr): Convert to a public read-only property.
17422 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17423 (Attribute.ResolveType, Attribute.Resolve)
17424 (Attribute.ScanForIndexerName): Update to reflect changes.
17425 (Attribute.CheckAttributeTarget): Re-format.
17426 (Attribute.ApplyAttributes): Refactor, to various
17427 Attributable.ApplyAttributeBuilder methods.
17428 * decl.cs (MemberCore): Make Attributable.
17429 * class.cs (Accessor): Make Attributable.
17430 (MethodData.ApplyAttributes): Use proper attribute types, not
17432 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17433 (TypeContainer.ApplyAttributeBuilder)
17434 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17435 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
17436 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17437 (Operator.ApplyAttributeBuilder): New factored-out methods.
17438 * const.cs (Const.ApplyAttributeBuilder): Likewise.
17439 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17440 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17441 * parameter.cs (ParameterBase): New Attributable base class
17442 that can also represent Return types.
17443 (Parameter): Update to the changes.
17445 2004-04-29 Jackson Harper <jackson@ximian.com>
17447 * driver.cs: Prefer the corlib system version when looking for
17448 assemblies in the GAC. This is still a hack, but its a better hack
17451 2004-04-29 Marek Safar <marek.safar@seznam.cz>
17453 * decl.cs, enum.cs: Improved error 3005 reporting.
17455 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17456 (related_symbols): New private member for list of symbols
17457 related to reported error/warning.
17459 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17461 2004-04-29 Martin Baulig <martin@ximian.com>
17463 * ecore.cs (Expression.Constantify): If we're an enum and
17464 TypeManager.TypeToCoreType() doesn't give us another type, use
17465 t.UnderlyingSystemType. Fixes #56178.
17467 2004-04-29 Martin Baulig <martin@ximian.com>
17469 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17470 interfaces and for each interface, only add members directly
17471 declared in that interface. Fixes #53255.
17473 2004-04-28 Martin Baulig <martin@ximian.com>
17475 * expression.cs (ConditionalLogicalOperator): Use a temporary
17476 variable for `left' to avoid that we evaluate it more than once;
17479 2004-04-28 Martin Baulig <martin@ximian.com>
17481 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17484 2004-04-28 Martin Baulig <martin@ximian.com>
17486 * statement.cs (LocalInfo.Resolve): Check whether the type is not
17489 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17490 whether the type is not void (CS1547).
17492 2004-04-28 Martin Baulig <martin@ximian.com>
17494 * expression.cs (Unary.DoResolveLValue): Override this and report
17495 CS0131 for anything but Operator.Indirection.
17497 2004-04-28 Martin Baulig <martin@ximian.com>
17499 Committing a patch from Ben Maurer; see bug #50820.
17501 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17504 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17507 2004-04-28 Martin Baulig <martin@ximian.com>
17509 Committing a patch from Ben Maurer; see bug #50820.
17511 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17514 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17517 2004-04-28 Martin Baulig <martin@ximian.com>
17519 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17520 (Block.AddLabel): Call DoLookupLabel() to only search in the
17523 2004-04-28 Martin Baulig <martin@ximian.com>
17525 * cfold.cs (ConstantFold.BinaryFold): Added special support for
17526 comparing StringConstants and NullLiterals in Equality and Inequality.
17528 2004-04-28 Jackson Harper <jackson@ximian.com>
17530 * driver.cs: Attempt to load referenced assemblies from the
17531 GAC. This is the quick and dirty version of this method that
17532 doesnt take into account versions and just takes the first
17533 canidate found. Will be good enough for now as we will not have more
17534 then one version installed into the GAC until I update this method.
17536 2004-04-28 Martin Baulig <martin@ximian.com>
17538 * typemanager.cs (TypeManager.CheckStructCycles): New public
17539 static method to check for cycles in the struct layout.
17541 * rootcontext.cs (RootContext.PopulateTypes): Call
17542 TypeManager.CheckStructCycles() for each TypeContainer.
17543 [Note: We only need to visit each type once.]
17545 2004-04-28 Martin Baulig <martin@ximian.com>
17547 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17549 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17550 success and added `out object value'. Use a `bool resolved' field
17551 to check whether we've already been called rather than
17552 `ConstantValue != null' since this breaks for NullLiterals.
17554 2004-04-28 Raja R Harinath <rharinath@novell.com>
17556 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17557 setting of this flag, since the 'set' method may be non-public.
17559 2004-04-28 Raja R Harinath <rharinath@novell.com>
17561 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17562 check on current_vector.Block.
17564 2004-04-27 Martin Baulig <martin@ximian.com>
17566 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17567 a field initializer. Fixes #56459.
17569 2004-04-27 Martin Baulig <martin@ximian.com>
17571 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17572 we're not attempting to use an indexer. Fixes #52154.
17574 2004-04-27 Martin Baulig <martin@ximian.com>
17576 * statement.cs (Return): Don't create a return label if we don't
17577 need it; reverts my change from January 20th. Thanks to Ben
17580 2004-04-27 Martin Baulig <martin@ximian.com>
17582 According to the spec, `goto' can only leave a nested scope, but
17585 * statement.cs (Block.LookupLabel): Only lookup in the current
17586 block, don't recurse into parent or child blocks.
17587 (Block.AddLabel): Check in parent and child blocks, report
17588 CS0140/CS0158 if we find a duplicate.
17589 (Block): Removed this indexer for label lookups.
17590 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17591 this already does the error reporting for us.
17594 (FlowBranching.UsageVector.Block): New public variable; may be null.
17595 (FlowBranching.CreateSibling): Added `Block' argument.
17596 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17597 label for the target of a `goto' and check whether we're not
17598 leaving a `finally'.
17600 2004-04-27 Martin Baulig <martin@ximian.com>
17602 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17603 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17606 2004-04-27 Martin Baulig <martin@ximian.com>
17608 * statement.cs (Block.AddLabel): Also check for implicit blocks
17609 and added a CS0158 check.
17611 2004-04-27 Martin Baulig <martin@ximian.com>
17613 * flowanalysis.cs (FlowBranchingLoop): New class.
17614 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17615 UsageVector's instead of an ArrayList.
17616 (FlowBranching.Label): Likewise.
17617 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17618 (FlowBranching.AddBreakVector): New method.
17620 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17622 * attribute.cs: Small regression fix: only convert the type if we
17623 the type is different, fixes System.Drawing build.
17625 2004-04-27 Martin Baulig <martin@ximian.com>
17627 * attribute.cs (Attribute.Resolve): If we have a constant value
17628 for a named field or property, implicity convert it to the correct
17631 2004-04-27 Raja R Harinath <rharinath@novell.com>
17633 * statement.cs (Block.Block): Implicit blocks share
17634 'child_variable_names' fields with parent blocks.
17635 (Block.AddChildVariableNames): Remove.
17636 (Block.AddVariable): Mark variable as "used by a child block" in
17637 every surrounding block.
17638 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17639 been used in a child block, complain about violation of "Invariant
17640 meaning in blocks" rule.
17641 * cs-parser.jay (declare_local_variables): Don't use
17642 AddChildVariableNames.
17643 (foreach_statement): Don't create an implicit block: 'foreach'
17644 introduces a scope.
17646 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17648 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17649 converting from 0L to ulong. Fixes 57522.
17651 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17653 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17654 derived class hides via 'new' keyword field from base class (test-242.cs).
17655 TODO: Handle this in the more general way.
17657 * class.cs (CheckBase): Ditto.
17659 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17661 * decl.cs (caching_flags): New member for storing cached values
17663 (MemberCore.Flags): New enum where bit flags for caching_flags
17665 (MemberCore.cls_compliance): Moved to caching_flags.
17666 (DeclSpace.Created): Moved to caching_flags.
17668 * class.cs: Use caching_flags instead of DeclSpace.Created
17670 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17672 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17673 if we are only a derived class, not a nested class.
17675 * typemanager.cs: Same as above, but do this at the MemberLookup
17676 level (used by field and methods, properties are handled in
17677 PropertyExpr). Allow for the qualified access if we are a nested
17680 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17682 * class.cs: Refactoring.
17683 (IMethodData): New inteface; Holds links to parent members
17684 to avoid member duplication (reduced memory allocation).
17685 (Method): Implemented IMethodData interface.
17686 (PropertyBase): New inner classes for get/set methods.
17687 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17688 (Event): New inner classes for add/remove methods.
17689 (Event.DelegateMethod): Implemented IMethodData interface.
17691 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17692 EmitContext (related to class.cs refactoring).
17694 2004-04-21 Raja R Harinath <rharinath@novell.com>
17696 * delegate.cs (Delegate.VerifyApplicability): If the number of
17697 arguments are the same as the number of parameters, first try to
17698 verify applicability ignoring any 'params' modifier on the last
17702 2004-04-16 Raja R Harinath <rharinath@novell.com>
17704 * class.cs (TypeContainer.AddIndexer): Use
17705 'ExplicitInterfaceName' to determine if interface name was
17706 explicitly specified. 'InterfaceType' is not initialized at this time.
17707 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17708 Indexers array is already in the required order. Initialize
17709 'IndexerName' only if there are normal indexers.
17710 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17711 (TypeContainer.Emit): Emit DefaultMember attribute only if
17712 IndexerName is initialized.
17715 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17717 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17720 2004-04-15 Raja R Harinath <rharinath@novell.com>
17722 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17726 * attribute.cs (Attribute.Resolve): Check for duplicate named
17730 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17732 * iterators.cs (MarkYield): track whether we are in an exception,
17733 and generate code accordingly. Use a temporary value to store the
17734 result for our state.
17736 I had ignored a bit the interaction of try/catch with iterators
17737 since their behavior was not entirely obvious, but now it is
17738 possible to verify that our behavior is the same as MS .NET 2.0
17742 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17744 * iterators.cs: Avoid creating temporaries if there is no work to
17747 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17748 Enumerations, use TypeManager.EnumToUnderlying and call
17751 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17754 (This.Emit): Use EmitContext.EmitThis to emit our
17757 (This.EmitAssign): Ditto.
17759 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17760 codepaths, we will move all the functionality into
17763 (FieldExpr.EmitAssign): Ditto.
17765 This fixes several hidden bugs that I uncovered while doing a code
17766 review of this today.
17768 * codegen.cs (EmitThis): reworked so the semantics are more clear
17769 and also support value types "this" instances.
17771 * iterators.cs: Changed so that for iterators in value types, we
17772 do not pass the value type as a parameter.
17774 Initialization of the enumerator helpers is now done in the caller
17775 instead of passing the parameters to the constructors and having
17776 the constructor set the fields.
17778 The fields have now `assembly' visibility instead of private.
17780 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17782 * expression.cs (Argument.Resolve): Check if fields passed as ref
17783 or out are contained in a MarshalByRefObject.
17785 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17786 another compiler type.
17788 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17790 * class.cs (Indexer.Define): use the new name checking method.
17791 Also, return false on an error.
17792 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17793 (is_identifier_[start/part]_character): make static.
17795 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17797 * expression.cs (Binary.ResolveOperator): Do no append strings
17798 twice: since we can be invoked more than once (array evaluation)
17799 on the same concatenation, take care of this here. Based on a fix
17800 from Ben (bug #56454)
17802 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17804 * codegen.cs: Fix another case where CS1548 must be reported (when
17805 delay-sign isn't specified and no private is available #56564). Fix
17806 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17807 error when MCS is used on the MS runtime and we need to delay-sign
17808 (which seems unsupported by AssemblyBuilder - see #56621).
17810 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17812 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17813 (TypeManager.ComputeNamespaces): Faster implementation for
17816 * compiler.csproj: Updated AssemblyName to mcs.
17818 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17820 * rootcontext.cs: Add new types to the boot resolution.
17822 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17823 MulticastDelegate is not allowed.
17825 * typemanager.cs: Add new types to lookup: System.TypedReference
17828 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17829 check for TypedReference or ArgIterator, they are not allowed.
17831 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17832 makes us properly catch 1510 in some conditions (see bug 56016 for
17835 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17837 * CryptoConvert.cs: update from corlib version
17840 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17842 * class.cs (Indexer.Define): Check indexername declaration
17844 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17846 * attribute.cs (IsClsCompliant): Fixed problem with handling
17847 all three states (compliant, not-compliant, undetected).
17849 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17851 * attribute.cs (Attribute): Location is now public.
17852 (Resolve): Store resolved arguments (pos_values) in attribute class.
17853 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17854 (GetClsCompliantAttributeValue): New method that gets
17855 CLSCompliantAttribute value.
17856 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17857 if exists else null.
17858 (AttributeTester): New class for CLS-Compliant verification routines.
17860 * class.cs (Emit): Add CLS-Compliant verification.
17861 (Method.GetSignatureForError): Implemented.
17862 (Constructor.GetSignatureForError): Implemented
17863 (Constructor.HasCompliantArgs): Returns if constructor has
17864 CLS-Compliant arguments.
17865 (Constructor.Emit): Override.
17866 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17867 is needed to test only parameters.
17868 (FieldBase.GetSignatureForError): Implemented.
17869 (TypeContainer): New member for storing base interfaces.
17870 (TypeContainer.FindMembers): Search in base interfaces too.
17872 * codegen.cs (GetClsComplianceAttribute): New method that gets
17873 assembly or module CLSCompliantAttribute value.
17874 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17876 (ModuleClass.Emit): Add error 3012 test.
17878 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17880 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17881 state for all decl types.
17882 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17883 if CLS-Compliant tests are required.
17884 (IsClsCompliaceRequired): New method. Analyze whether code
17885 must be CLS-Compliant.
17886 (IsExposedFromAssembly): New method. Returns true when MemberCore
17887 is exposed from assembly.
17888 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17889 value or gets cached value.
17890 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17891 is explicitly marked with CLSCompliantAttribute.
17892 (IsIdentifierClsCompliant): New abstract method. This method is
17893 used to testing error 3005.
17894 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17895 for identifier and parameters CLS-Compliant testing.
17896 (VerifyClsCompliance): New method. The main virtual method for
17897 CLS-Compliant verifications.
17898 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17899 null. I don't know why is null (too many public members !).
17900 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17901 and get value of first CLSCompliantAttribute that found.
17903 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17904 (VerifyClsCompliance): Override and add extra tests.
17906 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17907 clscheck- disable CLS-Compliant verification event if assembly is has
17908 CLSCompliantAttribute(true).
17910 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17911 ApllyAttribute is now called in emit section as in the other cases.
17912 Possible future Emit integration.
17913 (IsIdentifierClsCompliant): New override.
17914 (VerifyClsCompliance): New override.
17915 (GetEnumeratorName): Returns full enum name.
17917 * parameter.cs (GetSignatureForError): Implemented.
17919 * report.cs (WarningData): New struct for Warning message information.
17920 (LocationOfPreviousError): New method.
17921 (Warning): New method. Reports warning based on the warning table.
17922 (Error_T): New method. Reports error based on the error table.
17924 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17925 verifications are done here.
17927 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17929 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17930 CLSCompliantAttribute.
17931 (all_imported_types): New member holds all imported types from other
17933 (LoadAllImportedTypes): New method fills static table with exported types
17934 from all referenced assemblies.
17935 (Modules): New property returns all assembly modules.
17937 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17939 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17940 throwing a parser error.
17942 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17943 which removes the hardcoded get_/set_ prefixes for properties, as
17944 IL allows for the properties to be named something else.
17948 * expression.cs: Do not override operand before we know if it is
17949 non-null. Fix 56207
17951 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17953 * typemanager.cs: support for pinned variables.
17955 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17957 * decl.cs, typemanager.cs: Avoid using an arraylist
17958 as a buffer if there is only one result set.
17960 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17962 * expression.cs: Make sure you cant call a static method
17963 with an instance expression, bug #56174.
17965 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17967 * class.cs (IsDuplicateImplementation): Improve error reporting to
17968 flag 663 (method only differs in parameter modifier).
17970 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17971 in preprocessor directives.
17973 * location.cs (LookupFile): Allow for the empty path.
17975 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17976 better approach for some of that patch, but its failing with the
17977 CharSet enumeration. For now try/catch will do.
17979 * typemanager.cs: Do not crash if a struct does not have fields.
17982 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17984 * expression.cs: cs0213, cant fix a fixed expression.
17987 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17989 * cs-parser.jay: detect invalid embeded statements gracefully.
17992 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17994 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17997 the invocation type may not be a subclass of the tye of the item/
17998 The type of the item must be a subclass of the invocation item.
18003 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
18005 * attribute.cs: Added methods to get a string and a bool from an
18006 attribute. Required to information from AssemblyKeyFileAttribute,
18007 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18008 * codegen.cs: Modified AssemblyName creation to include support for
18009 strongnames. Catch additional exceptions to report them as CS1548.
18010 * compiler.csproj: Updated include CryptoConvert.cs.
18011 * compiler.csproj.user: Removed file - user specific configuration.
18012 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
18013 Mono.Security assembly. The original class is maintained and tested in
18014 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18015 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18016 like CSC 8.0 (C# v2) supports.
18017 * Makefile: Added CryptoConvert.cs to mcs sources.
18018 * rootcontext.cs: Added new options for strongnames.
18020 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
18022 * driver.cs: For --expect-error, report error code `2'
18023 if the program compiled with no errors, error code `1' if
18024 it compiled with an error other than the one expected.
18026 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
18028 * compiler.csproj: Updated for Visual Studio .NET 2003.
18029 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18030 * compiler.sln: Updated for Visual Studio .NET 2003.
18032 2004-03-24 Ravi Pratap M <ravi@ximian.com>
18034 * expression.cs: Fix bug #47234. We basically need to apply the
18035 rule that we prefer the conversion of null to a reference type
18036 when faced with a conversion to 'object' (csc behaviour).
18038 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18040 * statement.cs: Shorter form for foreach, eliminates
18041 a local variable. r=Martin.
18043 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18045 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18046 checks if we can use brtrue/brfalse to test for 0.
18047 * expression.cs: use the above in the test for using brtrue/brfalse.
18048 cleanup code a bit.
18050 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18052 * expression.cs: Rewrite string concat stuff. Benefits:
18054 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18055 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18056 rather than a concat chain.
18058 * typemanager.cs: Add lookups for more concat overloads.
18060 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18062 * expression.cs: Emit shorter il code for array init.
18079 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
18081 * statement.cs: Before, two switch blocks would be merged if the
18082 total size of the blocks (end_item - begin_item + 1) was less than
18083 two times the combined sizes of the blocks.
18085 Now, it will only merge if after the merge at least half of the
18090 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
18092 * class.cs : csc build fix for GetMethods(). See bug #52503.
18094 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
18096 * expression.cs: Make sure fp comparisons work with NaN.
18097 This fixes bug #54303. Mig approved this patch a long
18098 time ago, but we were not able to test b/c the runtime
18101 2004-03-19 Miguel de Icaza <miguel@ximian.com>
18103 * ecore.cs (TypExpr.GetHashCode): implement this overload.
18105 2004-03-19 Martin Baulig <martin@ximian.com>
18107 * class.cs (MemberCore.IsDuplicateImplementation): Report the
18108 error here and not in our caller.
18110 2004-03-19 Martin Baulig <martin@ximian.com>
18112 * interface.cs: Completely killed this file.
18113 (Interface): We're now a TypeContainer and live in class.cs.
18115 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18116 argument; we're now also called for interfaces.
18117 (TypeContainer.DefineMembers): Allow this method being called
18119 (TypeContainer.GetMethods): New public method; formerly known as
18120 Interface.GetMethod(). This is used by PendingImplementation.
18121 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18122 it's now private and non-static.
18123 (Interface): Moved this here; it's now implemented similar to
18125 (Method, Property, Event, Indexer): Added `bool is_interface'
18126 argument to their .ctor's.
18127 (MemberBase.IsInterface): New public field.
18129 * cs-parser.jay: Create normal Method, Property, Event, Indexer
18130 instances instead of InterfaceMethod, InterfaceProperty, etc.
18131 (opt_interface_base): Removed; we now use `opt_class_base' instead.
18132 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18134 2004-03-19 Martin Baulig <martin@ximian.com>
18136 * class.cs (MethodCore.IsDuplicateImplementation): New private
18137 method which does the CS0111 checking.
18138 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18139 Use IsDuplicateImplementation().
18141 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
18143 * decl.cs (FindMemberToOverride): New method to find the correct
18144 method or property to override in the base class.
18146 - Make Method/Property use the above method to find the
18147 version in the base class.
18148 - Remove the InheritableMemberSignatureCompare as it is now
18151 This patch makes large code bases much faster to compile, as it is
18152 O(n) rather than O(n^2) to do this validation.
18154 Also, it fixes bug 52458 which is that nested classes are not
18155 taken into account when finding the base class member.
18157 Reviewed/Approved by Martin.
18159 2004-03-17 Marek Safar <marek.safar@seznam.cz>
18161 * interface.cs: In all interface classes removed redundant
18162 member initialization.
18164 2004-03-16 Martin Baulig <martin@ximian.com>
18166 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18168 2004-03-15 Miguel de Icaza <miguel@ximian.com>
18170 * decl.cs (DefineTypeAndParents): New helper method to define a
18171 type's containers before the type itself is defined; This is a
18172 bug exposed by the recent changes to Windows.Forms when an
18173 implemented interface was defined inside a class that had not been
18176 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18178 (Check): Loop correctly to report errors modifiers
18179 (UNSAFE was not in the loop, since it was the same as TOP).
18181 * interface.cs: Every interface member now takes a ModFlags,
18182 instead of a "is_new" bool, which we set on the base MemberCore.
18184 Every place where we called "UnsafeOk" in the interface, now we
18185 call the proper member (InterfaceMethod.UnsafeOK) instead to get
18186 the unsafe settings from the member declaration instead of the
18187 container interface.
18189 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
18191 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18192 `set_indexer_name' to the pending bits (one per type).
18194 We fixed a bug today that was picking the wrong method to
18195 override, since for properties the existing InterfaceMethod code
18196 basically ignored the method name. Now we make sure that the
18197 method name is one of the valid indexer names.
18199 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
18201 * support.cs (SeekableStreamReader): Keep track of stream byte
18202 positions and don't mix them with character offsets to the buffer.
18204 Patch from Gustavo Giráldez
18206 2004-03-15 Marek Safar <marek.safar@seznam.cz>
18208 * interface.cs (InterfaceSetGetBase): Removed double member
18209 initialization, base class does it as well.
18211 2004-03-13 Martin Baulig <martin@ximian.com>
18213 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18214 when compiling corlib.
18216 2004-03-13 Miguel de Icaza <miguel@ximian.com>
18218 * convert.cs (ExplicitConversion): We were reporting an error on
18219 certain conversions (object_type source to a value type, when the
18220 expression was `null') before we had a chance to pass it through
18221 the user defined conversions.
18223 * driver.cs: Replace / and \ in resource specifications to dots.
18226 * class.cs: Add check for duplicate operators. Fixes 52477
18228 2004-03-11 Miguel de Icaza <miguel@ximian.com>
18230 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18231 that are in the middle of the statements, not only at the end.
18234 * class.cs (TypeContainer.AddField): No longer set the
18235 `HaveStaticConstructor' flag, now we call it
18236 `UserDefineStaticConstructor' to diferentiate the slightly
18237 semantic difference.
18239 The situation is that we were not adding BeforeFieldInit (from
18240 Modifiers.TypeAttr) to classes that could have it.
18241 BeforeFieldInit should be set to classes that have no static
18246 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18248 And most importantly Zoltan's comment:
18250 http://bugzilla.ximian.com/show_bug.cgi?id=44229
18252 "I think beforefieldinit means 'it's ok to initialize the type sometime
18253 before its static fields are used', i.e. initialization does not need
18254 to be triggered by the first access to the type. Setting this flag
18255 helps the JIT to compile better code, since it can run the static
18256 constructor at JIT time, and does not need to generate code to call it
18257 (possibly lots of times) at runtime. Unfortunately, mcs does not set
18258 this flag for lots of classes like String.
18260 csc sets this flag if the type does not have an explicit static
18261 constructor. The reasoning seems to be that if there are only static
18262 initalizers for a type, and no static constructor, then the programmer
18263 does not care when this initialization happens, so beforefieldinit
18266 This bug prevents the AOT compiler from being usable, since it
18267 generates so many calls to mono_runtime_class_init that the AOT code
18268 is much slower than the JITted code. The JITted code is faster,
18269 because it does not generate these calls if the vtable is type is
18270 already initialized, which is true in the majority of cases. But the
18271 AOT compiler can't do this."
18273 2004-03-10 Miguel de Icaza <miguel@ximian.com>
18275 * class.cs (MethodData.Emit): Refactor the code so symbolic
18276 information is generated for destructors; For some reasons we
18277 were taking a code path that did not generate symbolic information
18280 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
18282 * class.cs: Create a Constructor.CheckBase method that
18283 takes care of all validation type code. The method
18284 contains some code that was moved from Define.
18286 It also includes new code that checks for duplicate ctors.
18287 This fixes bug #55148.
18289 2004-03-09 Joshua Tauberer <tauberer@for.net>
18291 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18292 a { ... }-style array creation invokes EmitStaticInitializers
18293 which is not good for reference-type arrays. String, decimal
18294 and now null constants (NullCast) are not counted toward
18295 static initializers.
18297 2004-03-05 Martin Baulig <martin@ximian.com>
18299 * location.cs (SourceFile.HasLineDirective): New public field;
18300 specifies whether the file contains or is referenced by a "#line"
18302 (Location.DefineSymbolDocuments): Ignore source files which
18303 either contain or are referenced by a "#line" directive.
18305 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
18307 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18308 direct access to our parent, so check the method inline there.
18310 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
18312 * expression.cs (Invocation.EmitCall): Miguel's last commit
18313 caused a regression. If you had:
18318 In Foo the implict this would be null.
18320 2004-02-27 Miguel de Icaza <miguel@ximian.com>
18322 * expression.cs (Invocation.EmitCall): If the method is not
18323 virtual, do not emit a CallVirt to it, use Call.
18325 * typemanager.cs (GetFullNameSignature): Improve the method to
18326 cope with ".ctor" and replace it with the type name.
18328 * class.cs (ConstructorInitializer.Resolve): Now the method takes
18329 as an argument the ConstructorBuilder where it is being defined,
18330 to catch the recursive constructor invocations.
18332 2004-02-26 Miguel de Icaza <miguel@ximian.com>
18334 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18335 routines to check if a type is an enumerable/enumerator allow
18336 classes that implement the IEnumerable or IEnumerator interfaces.
18338 * class.cs (Property, Operator): Implement IIteratorContainer, and
18339 implement SetYields.
18341 (Property.Define): Do the block swapping for get_methods in the
18342 context of iterators. We need to check if Properties also
18343 include indexers or not.
18345 (Operator): Assign the Block before invoking the
18346 OperatorMethod.Define, so we can trigger the Iterator code
18349 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
18350 Property and Operator classes are not created when we parse the
18351 declarator but until we have the block completed, so we use a
18352 singleton SimpleIteratorContainer.Simple to flag whether the
18353 SetYields has been invoked.
18355 We propagate this setting then to the Property or the Operator to
18356 allow the `yield' to function.
18358 2004-02-25 Marek Safar <marek.safar@seznam.cz>
18360 * codegen.cs: Implemented attribute support for modules.
18361 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18362 Assembly/Module functionality.
18364 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18365 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18366 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18368 2004-02-16 Marek Safar <marek.safar@seznam.cz>
18370 * interface.cs (FindMembers): The operation is performed on all base
18371 interfaces and not only on the first. It is required for future CLS Compliance patch.
18373 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
18375 * statement.cs, codegen.cs:
18376 This patch deals with patterns such as:
18378 public class List : IEnumerable {
18380 public MyEnumerator GetEnumerator () {
18381 return new MyEnumerator(this);
18384 IEnumerator IEnumerable.GetEnumerator () {
18388 public struct MyEnumerator : IEnumerator {
18393 Before, there were a few things we did wrong:
18394 1) we would emit callvirt on a struct, which is illegal
18395 2) we emited ldarg when we needed to emit ldarga
18396 3) we would mistakenly call the interface methods on an enumerator
18397 type that derived from IEnumerator and was in another assembly. For example:
18399 public class MyEnumerator : IEnumerator
18401 Would have the interface methods called, even if there were public impls of the
18402 method. In a struct, this lead to invalid IL code.
18404 2004-02-11 Marek Safar <marek.safar@seznam.cz>
18406 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18409 * delegate.cs (Define): Fixed crash when delegate type is undefined.
18411 2004-02-11 Miguel de Icaza <miguel@ximian.com>
18413 * cs-parser.jay: Fix small regression: we were not testing V2
18414 compiler features correctly.
18416 * interface.cs: If the emit context is null, then create one
18418 2004-02-09 Marek Safar <marek.safar@seznam.cz>
18420 * decl.cs (GetSignatureForError): New virtual method to get full name
18421 for error messages.
18423 * attribute.cs (IAttributeSupport): New interface for attribute setting.
18424 Now it is possible to rewrite ApplyAttributes method to be less if/else.
18426 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18427 Duplicated members and code in these classes has been removed.
18428 Better encapsulation in these classes.
18430 2004-02-07 Miguel de Icaza <miguel@ximian.com>
18432 * assign.cs (Assign.DoResolve): When dealing with compound
18433 assignments, there is a new rule in ECMA C# 2.4 (might have been
18434 there before, but it is documented here) that states that in:
18438 If b is of type int, and the `op' is a shift-operator, then the
18439 above is evaluated as:
18443 * expression.cs (Binary.ResolveOperator): Instead of testing for
18444 int/uint/long/ulong, try to implicitly convert to any of those
18445 types and use that in pointer arithmetic.
18447 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18448 method to print information for from the type, not from the
18449 null-method we were given.
18451 2004-02-01 Duncan Mak <duncan@ximian.com>
18453 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18454 parsing for cmd, fixes bug #53694.
18456 2004-02-04 Marek Safar <marek.safar@seznam.cz>
18458 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18459 in the member name duplication tests. Property and operator name duplication
18460 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18462 2004-02-03 Marek Safar <marek.safar@seznam.cz>
18464 * interface.cs (PopulateMethod): Fixed crash when interface method
18465 returns not existing type (error test cs0246-3.cs).
18467 2004-02-02 Ravi Pratap M <ravi@ximian.com>
18469 * cs-parser.jay (interface_accessors): Re-write actions to also
18470 store attributes attached to get and set methods. Fix spelling
18473 (inteface_property_declaration): Modify accordingly.
18475 (InterfaceAccessorInfo): New helper class to store information to pass
18476 around between rules that use interface_accessors.
18478 * interface.cs (Emit): Apply attributes on the get and set
18479 accessors of properties and indexers too.
18481 * attribute.cs (ApplyAttributes): Modify accordingly to use the
18482 right MethodBuilder when applying attributes to the get and set accessors.
18484 2004-01-31 Miguel de Icaza <miguel@ximian.com>
18486 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18488 2004-01-26 Miguel de Icaza <miguel@ximian.com>
18490 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18492 2004-01-25 Miguel de Icaza <miguel@ximian.com>
18494 * cs-parser.jay: Remove YIELD token, instead use the new grammar
18495 changes that treat `yield' specially when present before `break'
18496 or `return' tokens.
18498 * cs-tokenizer.cs: yield is no longer a keyword.
18500 2004-01-23 Marek Safar <marek.safar@seznam.cz>
18502 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18503 setting for default constructors.
18504 For default constructors are almost every time set wrong Modifier. The
18505 generated IL code has been alright. But inside mcs this values was
18506 wrong and this was reason why several of my CLS Compliance tests
18509 2004-01-22 Martin Baulig <martin@ximian.com>
18511 * cs-parser.jay (namespace_or_type_name): Return an Expression,
18512 not a QualifiedIdentifier. This is what `type_name_expression'
18513 was previously doing.
18514 (type_name_expression): Removed; the code is now in
18515 `namespace_or_type_name'.
18516 (qualified_identifier): Removed, use `namespace_or_type_name'
18518 (QualifiedIdentifier): Removed this class.
18520 2004-01-22 Martin Baulig <martin@ximian.com>
18522 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18523 not a string as alias name.
18525 2004-01-21 Miguel de Icaza <miguel@ximian.com>
18527 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18528 #52730 bug, and instead compute correctly the need to use a
18529 temporary variable when requesting an address based on the
18530 static/instace modified of the field and the constructor.
18532 2004-01-21 Martin Baulig <martin@ximian.com>
18534 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18535 class and namespace before looking up aliases. Fixes #52517.
18537 2004-01-21 Martin Baulig <martin@ximian.com>
18539 * flowanalysis.cs (UsageVector.Merge): Allow variables being
18540 assinged in a 'try'; fixes exception4.cs.
18542 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18543 * class.cs : Implemented parameter-less constructor for TypeContainer
18545 * decl.cs: Attributes are now stored here. New property OptAttributes
18547 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18549 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18551 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18553 * typemanager.cs (CSharpSignature): Now reports also inner class name.
18554 (CSharpSignature): New method for indexer and property signature.
18556 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18558 * pending.cs (IsVirtualFilter): Faster implementation.
18560 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18562 * typemanager.cs: Avoid inclusion of same assembly more than once.
18564 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18566 * cs-parser.jay: Fixed problem where the last assembly attribute
18567 has been applied also to following declaration (class, struct, etc.)
18569 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18571 * class.cs: Added error CS0538, CS0539 reporting.
18572 Fixed crash on Microsoft runtime when field type is void.
18574 * cs-parser.jay: Added error CS0537 reporting.
18576 * pending.cs: Added error CS0535 reporting.
18577 Improved error report for errors CS0536, CS0534.
18579 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18581 Merge a few bits from the Anonymous Method MCS tree.
18583 * statement.cs (ToplevelBlock): New class for toplevel methods,
18584 will hold anonymous methods, lifted variables.
18586 * cs-parser.jay: Create toplevel blocks for delegates and for
18587 regular blocks of code.
18589 2004-01-20 Martin Baulig <martin@ximian.com>
18591 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18592 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18593 and `NeedExplicitReturn'; added `IsLastStatement'.
18594 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18595 have a `ReturnLabel' or we're not unreachable.
18597 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18598 child's reachability; don't just override ours with it. Fixes
18599 #58058 (lluis's example).
18600 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18601 InFinally(), InLoop(), InSwitch() and
18602 BreakCrossesTryCatchBoundary() methods.
18604 * statement.cs (Return): Do all error checking in Resolve().
18605 Unless we are the last statement in a top-level block, always
18606 create a return label and jump to it.
18607 (Break, Continue): Do all error checking in Resolve(); also make
18608 sure we aren't leaving a `finally'.
18609 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18610 statement in a top-level block.
18611 (Block.Flags): Added `IsDestructor'.
18612 (Block.IsDestructor): New public property.
18614 2004-01-20 Martin Baulig <martin@ximian.com>
18616 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18618 2004-01-20 Martin Baulig <martin@ximian.com>
18620 * statement.cs (Statement.ResolveUnreachable): New public method.
18621 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18622 (Block.Resolve): Resolve unreachable statements.
18624 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18626 * expression.cs: We need to fix the case where we do
18627 not have a temp variable here.
18629 * assign.cs: Only expression compound assignments need
18630 temporary variables.
18632 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18634 * flowanalysis.cs: Reduce memory allocation in a few ways:
18635 - A block with no variables should not allocate a bit
18637 - A method with no out parameters does not need any tracking
18638 for assignment of the parameters, so we need not allocate
18641 public readonly Type[] VariableTypes;
18642 public readonly string[] VariableNames;
18643 Are redundant. The data is already stored in the variable
18644 map, so we need not allocate another array for it.
18645 - We need to add alot of checks for if (params | locals) == null
18646 due to the first two changes.
18648 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18650 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18651 implement IMemoryLocation, we store a copy on a local variable and
18652 take the address of it. Patch from Benjamin Jemlich
18654 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18655 to use a special "type_name_expression" rule which reduces the
18656 number of "QualifiedIdentifier" classes created, and instead
18657 directly creates MemberAccess expressions.
18659 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18661 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18662 that fixes #52853. Null literal assignment to ValueType
18664 * class.cs (MethodData.Emit): Instead of checking the name of the
18665 method to determine if its a destructor, create a new derived
18666 class from Method called Destructor, and test for that.
18668 * cs-parser.jay: Create a Destructor object instead of a Method.
18670 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18674 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18676 * expression.cs (Binary.ResolveOperator): Perform an implicit
18677 conversion from MethodGroups to their delegate types on the
18678 Addition operation.
18680 * delegate.cs: Introduce a new class DelegateCreation that is the
18681 base class for `NewDelegate' and `ImplicitDelegateCreation',
18682 factor some code in here.
18684 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18685 conversion from MethodGroups to compatible delegate types.
18687 * ecore.cs (Expression.Resolve): Do not flag error 654
18688 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18689 we allow conversions from MethodGroups to delegate types now.
18691 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18692 assignments in v2 either.
18694 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18696 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18697 static read-only fields in ctors.
18699 Applied patch from Benjamin Jemlich
18701 * expression.cs (UnaryMutator): Avoid leaking local variables.
18703 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18705 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18706 here to return true, as they can be used like this:
18708 (XXX) int.MEMBER ()
18710 Fixed 49836 and all the other dups
18712 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18714 * driver.cs: Implement /win32res and /win32icon.
18716 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18718 * cs-parser.jay: Add a rule to improve error handling for the
18719 common mistake of placing modifiers after the type.
18721 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18723 * cs-parser.jay (interface_event_declaration): Catch
18724 initialization of events on interfaces, and report cs0068
18726 * cs-parser.jay (interface_event_declaration): Catch
18727 initialization of events.
18729 * ecore.cs: Better report missing constructors.
18731 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18732 the error reporting done in the wrong place. Fix.
18734 * expression.cs (Binary.ResolveOperator): Catch the
18735 operator + (E x, E y) error earlier, and later allow for implicit
18736 conversions in operator +/- (E e, U x) from U to the underlying
18739 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18740 52596, if the container class is abstract, the default constructor
18741 is protected otherwise its public (before, we were always public).
18743 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18746 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18747 Jemlich that fixes bug #52597, MCS was generating invalid code for
18748 idisposable structs. Thanks to Ben for following up with this
18751 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18753 * driver.cs: Allow assemblies without code to be generated, fixes
18756 2004-01-07 Nick Drochak <ndrochak@gol.com>
18758 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18760 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18762 * cs-parser.jay: Add rules to improve error reporting if fields or
18763 methods are declared at the namespace level (error 116)
18765 * Add rules to catch event add/remove
18767 2004-01-04 David Sheldon <dave-mono@earth.li>
18769 * expression.cs: Added matching ")" to error message for
18772 2004-01-03 Todd Berman <tberman@gentoo.org>
18774 * ecore.cs, attribute.cs:
18775 Applying fix from #52429.
18777 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18779 * ecore.cs, expression.cs, statement.cs:
18780 Total rewrite of how we handle branching. We
18781 now handle complex boolean expressions with fewer
18782 jumps. As well if (x == 0) no longer emits a ceq.
18784 if (x is Foo) is much faster now, because we generate
18787 Overall, we get a pretty big improvement on our benchmark
18788 tests. The code we generate is smaller and more readable.
18790 I did a full two-stage bootstrap. The patch was reviewed
18791 by Martin and Miguel.
18793 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18795 * cs-parser.jay: Make primary_expression not take a QI.
18796 we dont need this because the member_access rule covers
18797 us here. So we replace the rule with just IDENTIFIER.
18799 This has two good effects. First, we remove a s/r conflict.
18800 Second, we allocate many fewer QualifiedIdentifier objects.
18802 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18804 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18805 set the correct information via SRE. This prevents
18806 hanging on the MS runtime. Fixes #29374.
18808 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18810 * convert.cs: correctly handle conversions to value types
18811 from Enum and ValueType as unboxing conversions.
18813 Fixes bug #52569. Patch by Benjamin Jemlich.
18815 2004-01-02 Ravi Pratap <ravi@ximian.com>
18817 * expression.cs (BetterConversion): Prefer int -> uint
18818 over int -> ulong (csc's behaviour). This fixed bug #52046.
18820 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18822 * decl.cs (MemberCache.FindMembers): now returns a
18825 * typemanager.cs: In general, go with with ^^.
18826 (CopyNewMethods): take an IList.
18827 (RealMemberLookup): Only allocate an arraylist
18828 if we copy from two sets of methods.
18830 This change basically does two things:
18831 1) Fewer array lists allocated due to CopyNewMethods.
18832 2) the explicit cast in MemberList costed ALOT.
18834 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18836 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18837 a hashtable to avoid needless string allocations when an identifier is
18838 used more than once (the common case).
18840 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18842 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18843 is broken, it will not return anything. So, we
18844 have to use the information we have in mcs to
18847 * typemanager.cs: Add a cache for GetInterfaces,
18848 since this will now be used more often (due to ^^)
18850 (GetExplicitInterfaces) New method that gets the
18851 declared, not effective, interfaces on a type
18852 builder (eg, if you have interface IFoo, interface
18853 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18856 This patch makes MCS able to bootstrap itself on
18859 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18861 * expression.cs: Remove the Nop's that Miguel put
18864 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18866 * report.cs, codegen.cs: Give the real stack trace to
18867 the error when an exception is thrown.
18869 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18871 * decl.cs: only allocate hashtables for ifaces if
18874 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18876 * expression.cs: fix the error from cs0121-2.cs
18877 (a parent interface has two child interfaces that
18878 have a function with the same name and 0 params
18879 and the function is called through the parent).
18881 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18883 * class.cs, rootcontext.cs, typmanager.cs: do not
18886 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18888 * codegen.cs: remove stack for the ec flow branching.
18889 It is already a linked list, so no need.
18891 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18893 * Makefile: Allow custom profiler here.
18895 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18897 * typemanager.cs (LookupType):
18898 - Use a static char [], because split takes
18899 a param array for args, so it was allocating
18901 - Do not store true in a hashtable, it boxes.
18903 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18905 * flowanalysis.cs: bytify common enums.
18907 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18909 * modifiers.cs: Add a new set of flags for the
18910 flags allowed on explicit interface impls.
18911 * cs-parser.jay: catch the use of modifiers in
18912 interfaces correctly.
18913 * class.cs: catch private void IFoo.Blah ().
18915 All related to bug #50572.
18917 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18919 * decl.cs: Rewrite the consistant accessability checking.
18920 Accessability is not linear, it must be implemented in
18921 a tableish way. Fixes #49704.
18923 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18925 * expression.cs: Handle negation in a checked context.
18926 We must use subtraction from zero. Fixes #38674.
18928 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18930 * class.cs: Ignore static void main in DLLs.
18931 * rootcontext.cs: Handle the target type here,
18932 since we are have to access it from class.cs
18933 * driver.cs: account for the above.
18935 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18937 * report.cs: Give line numbers and files if available.
18939 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18941 * driver.cs: Implement /addmodule.
18943 * typemanager.cs: Change 'modules' field so it now contains Modules not
18946 2003-12-20 Martin Baulig <martin@ximian.com>
18948 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18949 (FieldBase.IsAssigned): Removed this field.
18950 (FieldBase.SetAssigned): New public method.
18951 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18953 2003-12-20 Martin Baulig <martin@ximian.com>
18955 * expression.cs (LocalVariableReference.DoResolve): Don't set
18956 `vi.Used' if we're called from DoResolveLValue().
18958 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18959 returns the usage vector it just merged into the current one -
18960 pass this one to UsageWarning().
18961 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18962 of the `EmitContext', don't call this recursively on our children.
18964 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18966 * driver.cs: Implement /target:module.
18968 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18970 * support.cs (CharArrayHashtable): New helper class.
18972 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18973 char arrays, not strings, so we can avoid creating a string in
18974 consume_identifier if the identifier is a keyword.
18976 2003-12-16 Martin Baulig <martin@ximian.com>
18978 * statement.cs (LocalInfo.Assigned): Removed this property.
18979 (LocalInfo.Flags): Removed `Assigned'.
18980 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18981 and uses flow analysis.
18982 (Block.UsageWarning): Made this method private.
18983 (Block.Resolve): Call UsageWarning() if appropriate.
18985 * expression.cs (LocalVariableReference.DoResolve): Always set
18986 LocalInfo.Used here.
18988 2003-12-13 Martin Baulig <martin@ximian.com>
18990 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18991 any value here; we're now using flow analysis to figure out
18992 whether a statement/block returns a value.
18994 2003-12-13 Martin Baulig <martin@ximian.com>
18996 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18998 (FlowBranching.MergeFinally): Don't call
18999 `branching.CheckOutParameters()' here, this is called in
19001 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19002 when adding the `finally' vector.
19004 2003-12-13 Martin Baulig <martin@ximian.com>
19007 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19008 actually work and also fix #48962.
19010 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
19012 * decl.cs: Do not check System.Object for nested types,
19013 since we know it does not have any. Big bang for buck:
19016 Run 1: 8.35 seconds
19017 Run 2: 8.32 seconds
19018 corlib: 17.99 seconds
19020 Run 1: 8.17 seconds
19021 Run 2: 8.17 seconds
19022 corlib: 17.39 seconds
19024 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
19026 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19027 time we are returning 0 members, so we save alot here.
19029 2003-12-11 Martin Baulig <martin@ximian.com>
19031 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19032 `MergeChild()', also just take the `FlowBranching' as argument;
19033 call Merge() on it and return the result.
19034 (FlowBranching.Merge): We don't need to do anything if we just
19037 2003-12-11 Martin Baulig <martin@ximian.com>
19039 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19040 them in an `ArrayList' to reduce memory usage. Thanks to Ben
19041 Maurer for this idea.
19043 2003-12-11 Martin Baulig <martin@ximian.com>
19045 * flowanalysis.cs (MergeResult): This class is now gone; we now
19046 use the `UsageVector' for this. The reason for this is that if a
19047 branching just has one sibling, we don't need to "merge" them at
19048 all - that's the next step to do.
19049 (FlowBranching.Merge): We now return a `UsageVector' instead of a
19052 2003-12-11 Martin Baulig <martin@ximian.com>
19054 Reworked flow analyis and made it more precise and bug-free. The
19055 most important change is that we're now using a special `Reachability'
19056 class instead of having "magic" meanings of `FlowReturns'. I'll
19057 do some more cleanups and optimizations and also add some more
19058 documentation this week.
19060 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19061 largely reworked this class.
19062 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19063 the new `Reachability' class instead of having "magic" values here.
19064 (FlowBranching): We're now using an instance of `Reachability'
19065 instead of having separate `Returns', `Breaks' etc. fields.
19067 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19068 based on flow analysis; ignore the return value of block.Emit ().
19070 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
19072 * driver.cs typemanager.cs: Find the mono extensions to corlib even
19073 if they are private.
19075 2003-12-09 Martin Baulig <martin@ximian.com>
19077 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19078 call them directly on the UsageVector.
19080 2003-12-09 Martin Baulig <martin@ximian.com>
19082 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19083 Changed return type from `FlowReturns' to `Reachability'.
19085 2003-12-09 Martin Baulig <martin@ximian.com>
19087 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19088 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19089 `Reachable' fields with a single `Reachability' one.
19091 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19093 * class.cs (FindMembers): Remove foreach's.
19098 Run 1: 8.74 seconds
19099 Run 2: 8.71 seconds
19102 Run 1: 8.64 seconds
19103 Run 2: 8.58 seconds
19106 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19111 This patch does a few things:
19112 1. EmptyStatement is now a singleton, so it is never reallocated.
19113 2. All blah is EmptyStatement constructs have been changed to
19114 blah == EmptyStatement.Value, which is much faster and valid
19115 now that EmptyStatement is a singleton.
19116 3. When resolving a block, rather than allocating a new array for
19117 the non-empty statements, empty statements are replaced with
19118 EmptyStatement.Value
19119 4. Some recursive functions have been made non-recursive.
19120 Mainly the performance impact is from (3), however (1) and (2) are needed for
19121 this to work. (4) does not make a big difference in normal situations, however
19122 it makes the profile look saner.
19127 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19128 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19129 Total memory allocated: 56397 KB
19132 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19133 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19134 Total memory allocated: 55666 KB
19136 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19138 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19139 than the hashtable in a hashtable version
19141 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19142 we always end up concating a string. This results in a huge perf
19143 loss, because many strings have to be tracked by the GC. In this
19144 patch, we first use a hashtable that works with two keys, so that
19145 the strings do not need to be concat'ed.
19149 Run 1: 8.74 seconds
19150 Run 2: 8.71 seconds
19153 Run 1: 8.65 seconds
19154 Run 2: 8.56 seconds
19156 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19158 * Makefile: Add a new target `do-time' that does a quick and simple
19159 profile, leaving easy to parse output.
19161 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
19163 * codegen.cs (Init): Create the dynamic assembly with
19164 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19166 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
19168 * support.cs: Make the PtrHashtable use only one
19169 instance of its comparer.
19171 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
19173 * typemanager.cs: Fix lookup of GetNamespaces.
19175 2003-11-29 Miguel de Icaza <miguel@ximian.com>
19177 * expression.cs: Removed redundant line.
19179 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19180 ArrayLists, use for loops with bounds.
19182 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19185 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19186 arraylists, use for loop with bounds.
19188 The above three changes give us a 0.071 second performance
19189 improvement out of 3.294 seconds down to 3.223. On my machine
19190 the above changes reduced the memory usage by 1,387 KB during
19191 compiler bootstrap.
19193 * cs-parser.jay (QualifiedIdentifier): New class used to represent
19194 QualifiedIdentifiers. Before we created a new string through
19195 concatenation, and mostly later on, the result would be
19196 manipulated by DecomposeQI through string manipulation.
19198 This reduced the compiler memory usage for bootstrapping from
19199 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19200 compile times in 0.05 seconds.
19202 2003-11-28 Dick Porter <dick@ximian.com>
19204 * support.cs: Do string compares with the Invariant culture.
19212 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19213 the comparison is done with the Invariant culture.
19215 2003-11-27 Miguel de Icaza <miguel@ximian.com>
19217 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19218 GetEnumerator method.
19220 (ProbeCollectionType): Iterate starting at the most specific type
19221 upwards looking for a GetEnumerator
19223 * expression.cs: Shift count can be up to 31 for int/uint and 63
19226 2003-11-26 Miguel de Icaza <miguel@ximian.com>
19228 * statement.cs (Block.LookupLabel): Also look for the label on the
19229 children blocks. Use a hash table to keep track of visited
19232 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19233 we actually did transform the other operand, otherwise fall back
19234 to the common codepath that casts to long.
19236 * cs-tokenizer.cs: Use the same code pattern as the int case.
19237 Maybe I should do the parsing myself, and avoid depending on the
19238 Parse routines to get this done.
19240 2003-11-25 Miguel de Icaza <miguel@ximian.com>
19242 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19243 which fixes bug 51347. This time test it.
19245 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19246 attributes for example can not tell the difference between these.
19247 The difference was only a syntax feature of the language.
19249 * attribute.cs: Apply attributes to delegates.
19251 * delegate.cs: Call the apply attributes method.
19253 2003-11-24 Miguel de Icaza <miguel@ximian.com>
19255 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19256 comparing 0 vs Byte.MinValue, not the value
19258 (ImplicitConversionRequired): When reporting a conversion error,
19259 use error 31 to print out the constant error instead of the
19262 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19263 which fixes bug 51347.
19265 2003-11-22 Miguel de Icaza <miguel@ximian.com>
19267 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
19268 which fixes the -warnaserror command line option.
19270 2003-11-21 Miguel de Icaza <miguel@ximian.com>
19272 * cfold.cs (DoNumericPromotions): During constant folding of
19273 additions on UIntConstant, special case intconstants with
19274 IntConstants like we do on the expression binary operator.
19276 2003-11-12 Miguel de Icaza <miguel@ximian.com>
19278 * convert.cs (ImplicitReferenceConversion): We were missing a case
19279 (System.Enum are not value types or class types, so we need to
19280 classify them separatedly).
19282 * driver.cs: We do not support error 2007.
19284 2003-11-12 Jackson Harper <jackson@ximian.com>
19286 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19287 system directory. Also use the full file name so users can
19288 libraries names mscorlib-o-tron.dll in a non system dir.
19290 2003-11-10 Martin Baulig <martin@ximian.com>
19292 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19293 (TypeManager.InitCoreTypes): Initialize them here, but instead of
19294 calling `ResolveType()' on them, directly assign their `Type'.
19296 2003-11-08 Martin Baulig <martin@ximian.com>
19298 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19299 return value and the `out parent' parameter.
19300 (TypeContainer.DefineType): Moved the CS0644 check into
19301 GetClassBases(). Don't pass the interface types to the
19302 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19303 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19305 * ecore.cs (TypeExpr.IsAttribute): New property.
19306 (TypeExpr.GetInterfaces): New method.
19308 * interface.cs (Interface.GetInterfaceTypeByName): Return a
19309 TypeExpr instead of a Type.
19310 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19311 (Interface.DefineType): Don't pass the interface types to the
19312 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19313 them later and then call `TypeBulider.AddInterfaceImplementation()'.
19315 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19316 instead of a `Type[]'.
19317 (TypeManager.RegisterBuilder): Likewise.
19318 (TypeManager.AddUserInterface): Likewise.
19319 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19320 `Type[]' and also return a `TypeExpr[]'.
19321 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19323 2003-11-08 Martin Baulig <martin@ximian.com>
19325 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19328 2003-11-08 Martin Baulig <martin@ximian.com>
19330 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19331 TypeManager.ResolveExpressionTypes().
19333 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19334 instead of an Expression.
19335 (TypeExpr): This is now an abstract base class for `TypeExpression'.
19336 (TypeExpression): New public class; formerly known as `TypeExpr'.
19338 * expression.cs (ComposedCast): Derive from TypeExpr.
19340 * typemanager.cs (TypeManager.system_*_expr): These are now
19341 TypExpr's instead of Expression's.
19342 (TypeManager.ResolveExpressionTypes): New public static function;
19343 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19346 2003-11-06 Miguel de Icaza <miguel@ximian.com>
19348 * expression.cs (New.DoResolve): Do not dereference value that
19349 might be a null return.
19351 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19352 sure that the constant value has the right type. Fixes an
19353 unreported bug, similar to 50425.
19355 * const.cs (Const.LookupConstantValue): Call
19356 ImplicitStandardConversionExists before doing a conversion to
19357 avoid havng the TypeManager.ChangeType do conversions.
19359 Reduced the number of casts used
19361 (Const.ChangeType): New routine to enable reuse of the constant
19362 type changing code from statement.
19364 * typemanager.cs (ChangeType): Move common initialization to
19365 static global variables.
19369 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19370 every value type to go through, even if it was void. Fix that.
19372 * cs-tokenizer.cs: Use is_identifier_start_character on the start
19373 character of the define, and the is_identifier_part_character for
19374 the rest of the string.
19376 2003-11-05 Miguel de Icaza <miguel@ximian.com>
19378 * expression.cs (UnaryMutator.EmitCode): When I updated
19379 LocalVariableReference.DoResolve, I overdid it, and dropped an
19380 optimization done on local variable references.
19382 2003-11-04 Miguel de Icaza <miguel@ximian.com>
19384 * ecore.cs: Convert the return from Ldlen into an int.
19386 2003-10-20 Miguel de Icaza <miguel@ximian.com>
19388 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19389 the accessibility, this is a special case for toplevel non-public
19390 classes (internal for instance).
19392 2003-10-20 Nick Drochak <ndrochak@gol.com>
19394 * ecore.cs: Fix typo and build. Needed another right paren.
19396 2003-10-19 Miguel de Icaza <miguel@ximian.com>
19398 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
19399 `internal' case regular and protected, but not allowing protected
19400 to be evaluated later. Bug 49840
19402 2003-10-15 Miguel de Icaza <miguel@ximian.com>
19404 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19405 to kb.Nlast, and not the kb.nFirst to isolate the switch
19408 Extract the underlying type, so enumerations of long/ulong are
19409 treated like long/ulong.
19411 2003-10-14 Miguel de Icaza <miguel@ximian.com>
19413 * expression.cs (New): Overload the meaning of RequestedType to
19414 track the possible creation of the NewDelegate type, since
19415 DoResolve is invoked more than once for new constructors on field
19418 See bugs: #48800 and #37014
19420 * cs-parser.jay (declare_local_constants): Take an arraylist
19421 instead of a single constant.
19423 (local_constant_declaration): It should take a
19424 constant_declarators, not a constant_declarator. Fixes 49487
19426 * convert.cs: Fix error report.
19428 2003-10-13 Jackson Harper <jackson@ximian.com>
19430 * typemanager.cs (TypeToCoreType): Add float and double this fixes
19433 2003-10-09 Martin Baulig <martin@ximian.com>
19435 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19437 (MethodCore.DoDefineParameters): Removed the TypeContainer
19438 argument; use the DeclSpace which was passed to the .ctor instead.
19439 (MethodCore.CheckParameter): Take a DeclSpace instead of a
19440 TypeContainer; we only need a DeclSpace here.
19442 2003-10-09 Martin Baulig <martin@ximian.com>
19444 * class.cs (MethodData): Added additional `DeclSpace ds' argument
19446 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19447 EmitContext's .ctor.
19449 2003-10-09 Martin Baulig <martin@ximian.com>
19451 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19452 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19453 AsAccessible(), moved them as well.
19455 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19457 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19459 * cs-parser.jay : Renamed yyName to yyNames related to jay.
19461 2003-10-07 Miguel de Icaza <miguel@ximian.com>
19463 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19464 generation for >=, as spotted by Paolo, bug 48679.
19465 Patch from David Waite.
19467 * cs-tokenizer.cs: Add handling for #pragma.
19469 * cs-parser.jay: Allow for both yield and yield return in the
19470 syntax. The anti-cobolization of C# fight will go on!
19472 * class.cs (TypeBuilder.DefineType): Catch error condition here
19473 (Parent.DefineType erroring out and returning null).
19475 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19476 coping with enumerations variables, we were mistakenly processing
19477 them as a regular value type instead of built-in types. Fixes the
19480 * typemanager.cs (IsBuiltinOrEnum): New method.
19482 2003-09-30 Miguel de Icaza <miguel@ximian.com>
19484 * cs-parser.jay: Upgrade: yield now needs the return clause.
19486 2003-09-19 Martin Baulig <martin@ximian.com>
19488 * decl.cs (MemberCache.SetupCacheForInterface): Take a
19489 `MemberCache parent' argument. Normally, an interface doesn't
19490 have a parent type except System.Object, but we use this in gmcs
19491 for generic type parameters.
19493 2003-09-18 Martin Baulig <martin@ximian.com>
19495 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19496 on `type.IsInterface'; don't check whether the type has a parent
19497 to determine whether it's an interface.
19499 2003-09-15 Martin Baulig <martin@ximian.com>
19501 * class.cs (TypeContainer.DefineType): Added an error flag to
19502 avoid reporting duplicate CS0146's ("class definition is
19505 * driver.cs (Driver.MainDriver): Abort if
19506 RootContext.ResolveTree() reported any errors.
19508 2003-09-07 Martin Baulig <martin@ximian.com>
19510 * report.cs (Error, Warning): Added overloaded versions which take
19511 a `params object[] args' and call String.Format().
19513 2003-09-07 Martin Baulig <martin@ximian.com>
19515 * decl.cs (DeclSpace..ctor): Don't call
19516 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19517 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
19518 (DeclSpace.RecordDecl): New method.
19520 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19522 2003-09-02 Ravi Pratap <ravi@ximian.com>
19524 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19525 value attributes to be applied to ParameterBuilders.
19527 * class.cs (MethodCore.LabelParameters): Make static and more
19528 generic so that it can be used from other places - like interface
19529 methods, for instance.
19531 * interface.cs (Interface.Emit): Call LabelParameters before
19532 emitting attributes on the InterfaceMethod.
19534 2003-08-26 Martin Baulig <martin@ximian.com>
19536 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19537 resolving aliases; fixes #47927.
19539 2003-08-26 Martin Baulig <martin@ximian.com>
19541 * statement.cs (Using.DoResolve): This is internally emitting a
19542 try/finally clause, so we need to set ec.NeedExplicitReturn if we
19543 do not always return. Fixes #47681.
19545 2003-08-26 Martin Baulig <martin@ximian.com>
19547 * decl.cs (MemberCore): Moved WarningNotHiding(),
19548 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19550 (AdditionResult): Make this nested in DeclSpace.
19551 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19552 argument; call NamespaceEntry.Define() unless we're nested in a
19555 * namespace.cs (Namespace.DefineName): New public function. This
19556 is called from DeclSpace's .ctor to add
19557 (Namespace.Lookup): Include DeclSpaces in the lookup.
19559 * class.cs (Operator): Derive from MemberBase, not MemberCore.
19561 * const.cs (Const): Derive from MemberBase, not MemberCore.
19563 2003-08-25 Martin Baulig <martin@ximian.com>
19565 * convert.cs (Convert.ExplicitReferenceConversion): When
19566 converting from an interface type to a class, unbox if the target
19567 type is a struct type. Fixes #47822.
19569 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19571 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19574 2003-08-22 Martin Baulig <martin@ximian.com>
19576 * class.cs (TypeManager.DefineType): When defining a nested type,
19577 call DefineType() on our parent; fixes #47801.
19579 2003-08-22 Martin Baulig <martin@ximian.com>
19581 * class.cs (MethodData.Define): While checking if a method is an
19582 interface implementation, improve the test a bit more to fix #47654.
19584 2003-08-22 Martin Baulig <martin@ximian.com>
19586 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19587 correctly; fixes #47722.
19589 2003-08-22 Martin Baulig <martin@ximian.com>
19591 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19592 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19594 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19596 2003-08-22 Martin Baulig <martin@ximian.com>
19598 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19599 can only be assigned in static constructors. Fixes #47161.
19601 2003-08-22 Martin Baulig <martin@ximian.com>
19603 Rewrote and improved the flow analysis code.
19605 * flowbranching.cs (FlowBranching): Make this class abstract.
19606 (FlowBranching.CreateBranching): New static function to create a
19607 new flow branching.
19608 (FlowBranchingBlock, FlowBranchingException): New classes.
19609 (FlowBranching.UsageVector.Type): New public readonly field.
19610 (FlowBranching.UsageVector.Breaks): Removed the setter.
19611 (FlowBranching.UsageVector.Returns): Removed the setter.
19612 (FlowBranching.UsageVector): Added Break(), Return(),
19613 NeverReachable() and Throw() methods to modify the reachability.
19614 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19615 done by FlowBranching.Merge().
19616 (FlowBranching.UsageVector.MergeChild): New method; merges the
19617 merge result into the current vector.
19618 (FlowBranching.Merge): New abstract method to merge a branching.
19620 2003-08-12 Martin Baulig <martin@ximian.com>
19622 * expression.cs (Indirection.CacheTemporaries): Create the
19623 LocalTemporary with the pointer type, not its element type.
19625 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19627 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19628 token was a keyword or not.
19630 Add `error' options where an IDENTIFIER was expected; Provide
19631 CheckToken and CheckIdentifierToken convenience error reporting
19634 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19636 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19637 NameSpaceEntry NameSpaceEntry.
19639 (LookupInterfaceOrClass): Avoid creating a full qualified name
19640 from namespace and name: avoid doing lookups when we know the
19641 namespace is non-existant. Use new Tree.LookupByNamespace which
19642 looks up DeclSpaces based on their namespace, name pair.
19644 * driver.cs: Provide a new `parser verbose' to display the
19645 exception thrown during parsing. This is turned off by default
19646 now, so the output of a failure from mcs is more graceful.
19648 * namespace.cs: Track all the namespaces defined in a hashtable
19651 (IsNamespace): New method
19653 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19655 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19656 we know that we need to concatenate (full typename can never be
19661 * statement.cs: Use a bitfield; Do not initialize to null things
19662 which are done by the constructor by default.
19664 * cs-parser.jay: bug fix, parameter was 4, not 3.
19666 * expression.cs: Just use the property;
19668 * statement.cs: No need for GetVariableInfo method.
19670 2003-08-08 Martin Baulig <martin@ximian.com>
19672 * flowanalysis.cs (FlowReturns): This is now nested in the
19673 `FlowBranching' class.
19674 (MyBitVector): Moved this here from statement.cs.
19675 (FlowBranching.SiblingType): New enum type.
19676 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19678 2003-08-07 Martin Baulig <martin@ximian.com>
19680 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19681 `FlowBranching' class and called `BranchingType'.
19683 2003-08-07 Martin Baulig <martin@ximian.com>
19685 * flowanalysis.cs: Moved all the control flow analysis code into
19688 2003-08-07 Martin Baulig <martin@ximian.com>
19690 * assign.cs (Assign.DoResolve): `target' must either be an
19691 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19694 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19696 * expression.cs (BinaryMethod): This kind of expression is created by the
19697 Binary class if it determines that the operator has to be handled
19700 (BinaryDelegate): This kind of expression is created if we are
19701 dealing with a + or - operator on delegates.
19703 (Binary): remove method, argumetns, and DelegateOperator: when
19704 dealing with methods,
19706 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19708 * statement.cs (Block): use bitfields for the three extra booleans
19709 we had in use. Remove unused topblock parameter.
19711 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19713 * assign.cs: Drop extra unneeded tests.
19715 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19717 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19719 * statement.cs (Foreach): Use VariableStorage instead of
19722 * codegen.cs (VariableStorage): New class used by clients that
19723 require a variable stored: locals or fields for variables that
19724 need to live across yield.
19726 Maybe provide a convenience api for EmitThis+EmitLoad?
19728 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19731 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19733 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19734 RemapParameterLValue): New methods that are used to turn a
19735 precomputed FieldInfo into an expression like this:
19739 The idea is to use this instead of making LocalVariableReference
19740 have more than one meaning.
19742 * cs-parser.jay: Add error production to BASE.
19744 * ecore.cs: Deal with TypeManager.GetField returning null, which
19745 is now a valid return value.
19747 (FieldExprNoAddress): New expression for Fields whose address can
19750 * expression.cs (LocalVariableReference): During the resolve
19751 phases, create new expressions if we are in a remapping context.
19752 Remove code that dealt with remapping here.
19754 (ParameterReference): same.
19756 (ProxyInstance): New expression, like the `This' expression, but
19757 it is born fully resolved. We know what we are doing, so remove
19758 the errors that are targeted to user-provided uses of `this'.
19760 * statement.cs (Foreach): our variable is now stored as an
19761 Expression; During resolution, follow the protocol, dont just
19762 assume it will return this.
19764 2003-08-06 Martin Baulig <martin@ximian.com>
19766 * support.cs (SeekableStreamReader.cs): New public class.
19768 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19769 SeekableStreamReader instead of the normal StreamReader.
19771 2003-08-04 Martin Baulig <martin@ximian.com>
19773 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19774 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19775 deambiguate casts and delegate invocations.
19776 (parenthesized_expression): Use the new tokens to ensure this is
19777 not a cast of method invocation.
19779 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19780 when reading a `)' and Deambiguate_CloseParens () was previously
19783 * expression.cs (ParenthesizedExpression): New class. This is
19784 just used for the CS0075 test.
19785 (Binary.DoResolve): Check for CS0075.
19787 2003-07-29 Ravi Pratap <ravi@ximian.com>
19789 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19790 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19791 reference comparison.
19793 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19794 examine the ReturnType for equality - this is necessary in the
19795 cases of implicit and explicit operators whose signature also
19796 includes the return type.
19798 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19800 * namespace.cs: Cache the result of the namespace computation,
19801 instead of computing it every time.
19803 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19805 * decl.cs: Use a global arraylist that we reuse over invocations
19806 to avoid excesive memory consumption. Reduces memory usage on an
19807 mcs compile by one meg (45 average).
19809 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19810 private, work around that.
19812 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19814 * literal.cs (IntLiteral): Define Zero and One static literals.
19816 * cs-parser.jay (integer_literal): use static literals to reduce
19817 memory usage for the most used literals (0, 1 and -1). 211kb
19818 reduced in memory usage.
19820 Replace all calls to `new ArrayList' with `new
19821 ArrayList(4)' which is a good average number for most allocations,
19822 and also requires only 16 bytes of memory for its buffer by
19825 This reduced MCS memory usage in seven megabytes for the RSS after
19828 2003-07-28 Ravi Pratap <ravi@ximian.com>
19830 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19831 handle params methods the correct way by forming only one
19832 applicable set with params and normal methods in them. Earlier we
19833 were looking at params methods only if we found no normal methods
19834 which was not the correct thing to do.
19836 (Invocation.BetterFunction): Take separate arguments indicating
19837 when candidate and the best method are params methods in their
19840 This fixes bugs #43367 and #46199.
19842 * attribute.cs: Documentation updates.
19844 (CheckAttribute): Rename to CheckAttributeTarget.
19845 (GetValidPlaces): Rename to GetValidTargets.
19847 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19848 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19852 2003-07-28 Martin Baulig <martin@ximian.com>
19854 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19855 name when looking up the base class of a nested class. Fixes #46977.
19857 2003-07-26 Martin Baulig <martin@ximian.com>
19859 * expression.cs (Indexers.Indexer): New nested struct; contains
19860 getter, setter and the indexer's type.
19861 (Indexers.Properties): This is now an ArrayList of
19862 Indexers.Indexer's.
19863 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19864 indexer doesn't have any getters.
19866 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19867 for embedded property and indexer assignments.
19869 2003-07-26 Martin Baulig <martin@ximian.com>
19871 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19872 preprocessor directive is not the first non-whitespace character
19875 2003-07-26 Martin Baulig <martin@ximian.com>
19877 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19878 namespace parsing, follow the spec more closely.
19880 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19881 NamespaceEntry.Lookup().
19883 2003-07-25 Martin Baulig <martin@ximian.com>
19885 * MethodCore.cs (OverridesSomething): New public field; it's set
19886 from TypeContainer.DefineMembers if this method overrides
19887 something (which doesn't need to be a method). Fix #39462.
19889 2003-07-25 Ravi Pratap <ravi@ximian.com>
19891 * typemanager.cs (GetMembers): Ensure that the list of members is
19892 reversed. This keeps things in sync.
19894 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19895 find an AttributeUsage attribute.
19897 * expression.cs (Invocation.OverloadResolve): Perform the check
19898 which disallows Invoke to be directly called on a Delegate.
19900 (Error_InvokeOnDelegate): Report error cs1533.
19902 2003-07-25 Martin Baulig <martin@ximian.com>
19904 * expression.cs (Indexers.GetIndexersForType): Only look in the
19905 interface hierarchy if the requested type is already an
19906 interface. Fixes #46788 while keeping #46502 fixed.
19908 2003-07-25 Martin Baulig <martin@ximian.com>
19910 * class.cs (TypeContainer.DefineMembers): Check whether all
19911 readonly fields have been assigned and report warning CS0649 if
19914 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19917 2003-07-24 Ravi Pratap <ravi@ximian.com>
19919 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19920 returned from GetMethods to make things consistent with the
19921 assumptions MCS makes about ordering of methods.
19923 This should comprehensively fix bug #45127 and it does :-)
19925 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19926 ordering is actually reverse.
19928 * Clean up some debug messages I left lying around.
19930 * interface.cs (Populate*): Get rid of code which emits attributes
19931 since the stage in which we emit attributes is the 'Emit' stage,
19932 not the define stage.
19934 (Emit): Move attribute emission for interface members here.
19936 2003-07-22 Ravi Pratap <ravi@ximian.com>
19938 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19939 closely: we eliminate methods in base types when we have an
19940 applicable method in a top-level type.
19942 Please see section 14.5.5.1 for an exact description of what goes
19945 This fixes bug #45127 and a host of other related to corlib compilation.
19947 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19948 array is the method corresponding to the top-level type (this is
19949 because of the changes made to icall.c) so we change this
19952 (MethodGroupExpr.Name): This too.
19954 * typemanager.cs (GetElementType): New method which does the right
19955 thing when compiling corlib.
19957 * everywhere: Make use of the above in the relevant places.
19959 2003-07-22 Martin Baulig <martin@ximian.com>
19961 * cs-parser.jay (invocation_expression): Moved
19962 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19963 `cast_expression', but create a InvocationOrCast which later
19964 resolves to either an Invocation or a Cast.
19966 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19967 method; call this before EmitStatement() to make sure that this
19968 expression can be used as a statement.
19970 * expression.cs (InvocationOrCast): New class; resolves to either
19971 an Invocation or a Cast.
19973 * statement.cs (StatementExpression): Call ResolveStatement() on
19974 the ExpressionStatement before emitting it.
19976 2003-07-21 Martin Baulig <martin@ximian.com>
19978 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19979 `ref' and `out' attributes match; fixes #46220.
19980 (MemberAccess.ResolveMemberAccess): You can't reference a type
19981 through an expression; fixes #33180.
19982 (Indexers.GetIndexersForType): Don't return the indexers from
19983 interfaces the class implements; fixes #46502.
19985 2003-07-21 Martin Baulig <martin@ximian.com>
19987 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19988 CS0661 checks; fixes bug #30442.
19990 2003-07-21 Martin Baulig <martin@ximian.com>
19992 * decl.cs (AdditionResult): Added `Error'.
19994 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19996 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19997 makes cs0031.cs actually work.
19999 2003-07-20 Martin Baulig <martin@ximian.com>
20001 * namespace.cs: Fixed that bug which caused a crash when compiling
20002 the debugger's GUI.
20004 2003-07-20 Miguel de Icaza <miguel@ximian.com>
20006 * typemanager.cs (LookupTypeReflection): Never expose types which
20007 are NotPublic, NestedPrivate, NestedAssembly, or
20008 NestedFamANDAssem. We used to return these, and later do a check
20009 that would report a meaningful error, but the problem is that we
20010 would not get the real match, if there was a name override.
20012 2003-07-18 Miguel de Icaza <miguel@ximian.com>
20014 * namespace.cs (Namespace, Name): Do not compute the namespace
20015 name dynamically, compute it in the constructor. This reduced
20016 memory usage by 1697 KB.
20018 * driver.cs: Use --pause to pause at the end.
20020 2003-07-17 Peter Williams <peter@newton.cx>
20022 * Makefile: Change the name of the test target so that it doesn't
20023 conflict with the recursive test target.
20025 2003-07-17 Miguel de Icaza <miguel@ximian.com>
20027 * expression.cs (LocalVariableReference.Emit, EmitAssign,
20028 AddressOf): Do not use EmitThis, that was wrong, use the actual
20031 2003-07-15 Miguel de Icaza <miguel@ximian.com>
20033 * class.cs (MethodData.Define): While checking if a method is an
20034 interface implementation, improve the test: If we are not public
20035 (use new test here: use the computed MethodAttributes directly,
20036 instead of the parsed modifier flags) check if the `implementing'
20037 method comes from an interface or not.
20039 * pending.cs (VerifyPendingMethods): Slightly better error
20042 * makefile: add test target that does the mcs bootstrap.
20044 2003-07-16 Ravi Pratap <ravi@ximian.com>
20046 * interface.cs (Define): Do nothing here since there are no
20047 members to populate etc. Move the attribute emission out of here
20048 since this was just totally the wrong place to put it. Attribute
20049 application happens during the 'Emit' phase, not in the 'Define'
20052 (Emit): Add this method and move the attribute emission here
20054 * rootcontext.cs (EmitCode): Call the Emit method on interface
20057 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20059 * expression.cs (OverloadResolve): Report error only if Location
20060 is not 'Null' which means that there was a probe going on.
20062 2003-07-14 Martin Baulig <martin@ximian.com>
20064 * expression.cs (ConditionalLogicalOperator): New public class to
20065 implement user defined conditional logical operators.
20066 This is section 14.11.2 in the spec and bug #40505.
20068 2003-07-14 Martin Baulig <martin@ximian.com>
20070 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20072 2003-07-14 Martin Baulig <martin@ximian.com>
20074 * codegen.cs (EmitContext.InFixedInitializer): New public field.
20076 * ecore.cs (IVariable.VerifyFixed): New interface method.
20078 * expression.cs (Unary.ResolveOperator): When resolving the `&'
20079 operator, check whether the variable is actually fixed. Fixes bug
20080 #36055. Set a variable definitely assigned when taking its
20081 address as required by the spec.
20083 * statement.cs (LocalInfo.IsFixed): New field.
20084 (LocalInfo.MakePinned): Set `IsFixed' to true.
20086 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20088 * attribute.cs (Attribute.Resolve): While doing a Member lookup
20089 for .ctors, ensure that we only ask for members declared in the
20090 attribute type (BindingFlags.DeclaredOnly).
20094 * expression.cs (Error_WrongNumArguments): Report error 1501
20095 correctly the way CSC does.
20097 2003-07-13 Martin Baulig <martin@ximian.com>
20099 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20100 lookup on the fully qualified name, to make things like "X.X" work
20101 where "X.X" is a fully qualified type name, but we also have a
20102 namespace "X" in the using list. Fixes #41975.
20104 2003-07-13 Martin Baulig <martin@ximian.com>
20106 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20107 function. If we're a CompoundAssign, we need to create an embedded
20108 CompoundAssign, not an embedded Assign.
20109 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20112 2003-07-13 Martin Baulig <martin@ximian.com>
20114 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20115 work to fix bug #46088.
20117 2003-07-13 Ravi Pratap <ravi@ximian.com>
20119 * class.cs (Operator.Emit): Do not emit attributes here - it is
20120 taken care of by the Method class that we delegate too. This takes
20121 care of bug #45876.
20123 2003-07-10 Martin Baulig <martin@ximian.com>
20125 * expression.cs (TypeOfVoid): New class.
20126 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
20128 2003-07-10 Martin Baulig <martin@ximian.com>
20130 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20133 2003-07-10 Martin Baulig <martin@ximian.com>
20135 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20136 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20138 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20140 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20142 2003-07-10 Martin Baulig <martin@ximian.com>
20144 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20145 of decimal. Fixes #42850.
20147 NOTE: I also fixed the created byte blob, but this doesn't work on
20148 the MS runtime and csc never produces any byte blobs for decimal
20151 2003-07-10 Martin Baulig <martin@ximian.com>
20153 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20154 structs; fixes #32068.
20155 (Block.AddChildVariableNames): Fixed #44302.
20157 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20159 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20161 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20163 * attribute.cs: And this test is onger needed.
20165 2003-07-08 Martin Baulig <martin@ximian.com>
20167 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20168 inaccessible types. Fixes #36313.
20170 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20172 * namespace.cs (NamespaceEntry): Create implicit entries for all
20173 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20174 implicit entries for N1.N2 and N1.
20176 2003-07-08 Martin Baulig <martin@ximian.com>
20178 Rewrote the handling of namespaces to fix a lot of the issues
20179 wrt. `using' aliases etc.
20181 * namespace.cs (Namespace): Splitted this class into a
20182 per-assembly `Namespace' and a per-file `NamespaceEntry'.
20184 * typemanager.cs (TypeManager.IsNamespace): Removed.
20185 (TypeManager.ComputeNamespaces): Only compute namespaces from
20186 loaded assemblies here, not the namespaces from the assembly we're
20187 currently compiling.
20189 2003-07-08 Martin Baulig <martin@ximian.com>
20191 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20193 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20195 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20198 I thought about the memory savings here, but LookupTypeReflection
20199 is used under already very constrained scenarios. Compiling
20200 corlib or mcs only exposes one hit, so it would not really reduce
20201 any memory consumption.
20203 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20205 * typemanager.cs: fixes bug #45889 by only adding public types from
20206 other assemblies to the list of known types.
20208 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20210 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20211 on the type we resolved.
20213 2003-07-05 Martin Baulig <martin@ximian.com>
20215 * pending.cs (PendingImplementation.ParentImplements): Don't
20216 create the proxy if the parent is abstract.
20218 * class.cs (TypeContainer.DefineIndexers): Process explicit
20219 interface implementations first. Fixes #37714.
20221 2003-07-04 Miguel de Icaza <miguel@ximian.com>
20223 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20224 defined recursively; but since we modify the input parameters
20225 (left is set to `this' temporarily), we reset this value if the
20226 left_is_explicit is false, which gives the original semantics to
20229 * literal.cs (NullPointer): new class used to represent a null
20230 literal in a pointer context.
20232 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20233 type is a pointer, use a NullPointer object instead of a
20234 NullLiteral. Closes 43687
20236 (ExplicitConversion): Convert pointer values using
20237 the conv opcode to the proper type.
20239 * ecore.cs (New): change ValueTypeVariable property into a method,
20240 that returns whether the valuetype is suitable for being used.
20242 * expression.cs (Binary.DoNumericPromotions): Only return if we
20243 the int constant was a valid uint, and we can return both left and
20244 right as uints. If not, we continue processing, to trigger the
20245 type conversion. This fixes 39018.
20247 * statement.cs (Block.EmitMeta): During constant resolution, set
20248 the CurrentBlock property on the emitcontext, so that we resolve
20249 constants propertly.
20251 2003-07-02 Martin Baulig <martin@ximian.com>
20253 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20254 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20256 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20257 than emitting it here.
20259 * statement.cs: Fixed some more flow analysis bugs.
20261 2003-07-02 Martin Baulig <martin@ximian.com>
20263 * class.cs (MethodData.Define): When implementing interface
20264 methods, set Final unless we're Virtual.
20266 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20267 check work for interface methods.
20269 2003-07-01 Martin Baulig <martin@ximian.com>
20271 * ecore.cs (EmitContext.This): Replaced this property with a
20272 GetThis() method which takes a Location argument. This ensures
20273 that we get the correct error location for a CS0188.
20275 2003-07-01 Miguel de Icaza <miguel@ximian.com>
20277 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20278 ImplicitStandardConversion.
20280 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20282 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
20284 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20287 2003-06-30 Miguel de Icaza <miguel@ximian.com>
20289 * class.cs (Constructor.Define): Turn off initlocals for unsafe
20292 (MethodData.Define): Turn off initlocals for unsafe methods.
20294 2003-06-29 Miguel de Icaza <miguel@ximian.com>
20296 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20297 complete; Fixes #37521.
20299 * delegate.cs: Use Modifiers.TypeAttr to compute the
20300 TypeAttributes, instead of rolling our own. This makes the flags
20301 correct for the delegates.
20303 2003-06-28 Miguel de Icaza <miguel@ximian.com>
20305 * class.cs (Constructor.Define): Set the private flag for static
20306 constructors as well.
20308 * cs-parser.jay (statement_expression): Set the return value to
20309 null, to avoid a crash when we catch an error.
20311 2003-06-24 Miguel de Icaza <miguel@ximian.com>
20313 * cs-parser.jay: Applied patch from Jackson that adds support for
20314 extern and unsafe modifiers to destructor declarations.
20316 * expression.cs: Report error 21 if the user is trying to index a
20319 * driver.cs: Add an error message, suggested by the bug report.
20321 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20322 if we do not have a ": this ()" constructor initializer. Fixes 45149
20324 2003-06-14 Miguel de Icaza <miguel@ximian.com>
20326 * namespace.cs: Add some information to reduce FAQs.
20328 2003-06-13 Miguel de Icaza <miguel@ximian.com>
20330 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20331 underlying enumeration types. Fixes #43915.
20333 * expression.cs: Treat ushort/short as legal values to be used in
20334 bitwise operations.
20336 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20338 * delegate.cs: transfer custom attributes for paramenters from
20339 the delegate declaration to Invoke and BeginInvoke.
20341 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20343 * attribute.cs: handle custom marshalers and emit marshal info
20346 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
20348 * makefile.gnu: Added anonymous.cs to the compiler sources.
20350 2003-05-28 Miguel de Icaza <miguel@ximian.com>
20352 * iterators.cs: Change the name of the proxy class to include two
20355 * cs-parser.jay: Update grammar to include anonymous methods.
20357 * anonymous.cs: new file.
20359 2003-05-27 Miguel de Icaza <miguel@ximian.com>
20361 * class.cs (Field.Define): Add missing test for pointers and
20364 2003-05-27 Ravi Pratap <ravi@ximian.com>
20366 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20367 we use the stobj opcode.
20369 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20370 since it wasn't the correct fix.
20372 It still is puzzling that we are required to use stobj for IntPtr
20373 which seems to be a ValueType.
20375 2003-05-26 Miguel de Icaza <miguel@ximian.com>
20377 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20378 during regular simple name resolution. Now, the trick is that
20379 instead of returning for processing the simplename, we do a
20380 TypeManager.LookupType (ie, a rooted lookup as opposed to a
20381 contextual lookup type). If a match is found, return that, if
20382 not, return for further composition.
20384 This fixes long-standing 30485.
20386 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20387 using the address to initialize an object, do an Stobj instead of
20388 using the regular Stelem.
20390 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20391 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20392 Because if we are a BaseIndexerAccess that value will be true.
20395 * statement.cs (GotoCase.Resolve): Return after reporting an
20396 error, do not attempt to continue.
20398 * expression.cs (PointerArithmetic.Emit): If our operand is a
20399 long, convert our constants to match the operand before
20400 multiplying. Convert to I type before adding. Fixes 43670.
20402 2003-05-14 Ravi Pratap <ravi@ximian.com>
20404 * enum.cs (ImplicitConversionExists) : Rename to
20405 ImplicitEnumConversionExists to remove ambiguity.
20407 * ecore.cs (NullCast): New type of cast expression class which
20408 basically is very similar to EmptyCast with the difference being
20409 it still is a constant since it is used only to cast a null to
20411 (eg. (string) null)
20413 * convert.cs (ImplicitReferenceConversion): When casting a null
20414 literal, we return a NullCast.
20416 * literal.cs (NullLiteralTyped): Remove - I don't see why this
20417 should be around anymore.
20419 The renaming (reported was slightly wrong). Corrections:
20421 ConvertImplicitStandard -> ImplicitConversionStandard
20422 ConvertExplicitStandard -> ExplicitConversionStandard
20424 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20425 before passing them in !
20427 * convert.cs (ImplicitConversionStandard): When comparing for
20428 equal expr and target types, ensure that expr is not a
20431 In general, we must not be checking (expr_type ==
20432 target_type) in the top level conversion methods
20433 (ImplicitConversion, ExplicitConversion etc). This checking is
20434 done in the methods that they delegate to.
20436 2003-05-20 Miguel de Icaza <miguel@ximian.com>
20438 * convert.cs: Move Error_CannotConvertType,
20439 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20440 ImplicitNumericConversion, ImplicitConversionExists,
20441 ImplicitUserConversionExists, StandardConversionExists,
20442 FindMostEncompassedType, FindMostSpecificSource,
20443 FindMostSpecificTarget, ImplicitUserConversion,
20444 ExplicitUserConversion, GetConversionOperators,
20445 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20446 TryImplicitIntConversion, Error_CannotConvertImplicit,
20447 ConvertImplicitRequired, ConvertNumericExplicit,
20448 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20449 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20452 Perform the following renames:
20454 StandardConversionExists -> ImplicitStandardConversionExists
20455 ConvertImplicit -> ImplicitConversion
20456 ConvertImplicitStandard -> ImplicitStandardConversion
20457 TryImplicitIntConversion -> ImplicitIntConversion
20458 ConvertImplicitRequired -> ImplicitConversionRequired
20459 ConvertNumericExplicit -> ExplicitNumericConversion
20460 ConvertReferenceExplicit -> ExplicitReferenceConversion
20461 ConvertExplicit -> ExplicitConversion
20462 ConvertExplicitStandard -> ExplicitStandardConversion
20464 2003-05-19 Martin Baulig <martin@ximian.com>
20466 * statement.cs (TypeInfo.StructInfo): Made this type protected.
20467 (TypeInfo): Added support for structs having structs as fields.
20469 * ecore.cs (FieldExpr): Implement IVariable.
20470 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20471 VariableInfo for the field.
20473 2003-05-18 Martin Baulig <martin@ximian.com>
20475 * expression.cs (This.DoResolve): Report a CS0027 if we're
20476 emitting a field initializer.
20478 2003-05-18 Martin Baulig <martin@ximian.com>
20480 * expression.cs (This.ResolveBase): New public function.
20481 (This.DoResolve): Check for CS0188.
20483 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20486 * ecore.cs (MethodGroupExpr.DoResolve): Set the
20487 `instance_expression' to null if we don't have any non-static
20490 2003-05-18 Martin Baulig <martin@ximian.com>
20492 Reworked the way how local variables and parameters are handled by
20493 the flow analysis code.
20495 * statement.cs (TypeInfo, VariableMap): New public classes.
20496 (VariableInfo): New public class. This is now responsible for
20497 checking whether a variable has been assigned. It is used for
20498 parameters and local variables.
20499 (Block.EmitMeta): Take the InternalParameters as argument; compute
20500 the layout of the flow vectors here.
20501 (Block.LocalMap, Block.ParameterMap): New public properties.
20502 (FlowBranching): The .ctor doesn't get the InternalParameters
20503 anymore since Block.EmitMeta() now computes the layout of the flow
20505 (MyStructInfo): This class is now known as `StructInfo' and nested
20506 in `TypeInfo'; we don't access this directly anymore.
20508 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20509 property and removed IsAssigned(), IsFieldAssigned(),
20510 SetAssigned() and SetFieldAssigned(); we now call them on the
20511 VariableInfo so we don't need to duplicate this code everywhere.
20513 * expression.cs (ParameterReference): Added `Block block' argument
20515 (LocalVariableReference, ParameterReference, This): The new
20516 VariableInfo class is now responsible for all the definite
20519 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20520 IsParameterAssigned, SetParameterAssigned): Removed.
20522 2003-05-18 Martin Baulig <martin@ximian.com>
20524 * typemanager.cs (InitCoreTypes): Try calling
20525 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20526 the 3-args-version. Corlib now also needs our `void_type'.
20527 (GetMethod): Added overloaded version which takes an optional
20528 `bool report_errors' to allow lookups of optional methods.
20530 2003-05-12 Martin Baulig <martin@ximian.com>
20532 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20533 only used for locals and not for parameters.
20535 2003-05-12 Miguel de Icaza <miguel@ximian.com>
20537 * support.cs (InternalParameters.ParameterType): Return the
20538 ExternalType of the parameter.
20540 * parameter.cs (Parameter.ExternalType): drop the two arguments,
20543 2003-05-11 Miguel de Icaza <miguel@ximian.com>
20545 * class.cs (MethodData.Define): Do not set the `newslot' on
20546 interface members, if they are also flagged as "override".
20548 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20549 better code for ++i and i++. This only works for static fields
20550 and local variables.
20552 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20553 want to pull the DeclSpace out of the builder_to_declspace instead
20554 of the TypeBuilder (like in TypeContainer.FindMembers).
20556 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20557 instead of LookupTypeContainer. Fixes the crash on .NET for
20558 looking up interface members.
20560 * const.cs: Create our own emit context during the Definition
20561 stage, so that constants are evaluated in the proper context, when
20562 a recursive definition happens.
20564 2003-05-11 Martin Baulig <martin@ximian.com>
20566 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
20567 new block for a switch section.
20568 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20569 the adding/lookup in the switch block. Fixes #39828.
20571 2003-05-09 Miguel de Icaza <miguel@ximian.com>
20573 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20574 functionality: I needed to convert the data after I had performed
20575 the add/sub operation into the operands type size.
20577 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20578 pass the type for the box operation, otherwise the resulting
20579 object would have been of type object.
20581 (BoxedCast): Add constructor to specify the type to box as.
20583 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20585 * iterators.cs: I was reusing the `count' variable inadvertently,
20586 take steps to not allow this to happen.
20588 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20590 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20591 by creating an array at the point where the params starts and
20592 putting all those arguments there, then adjusting the size of the
20595 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20597 * expression.cs (New.AddressOf): Implement interface
20598 IMemoryLocation. This is used when the `new' operator is used in
20599 the context of an invocation to a method on a value type.
20601 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20604 * namespace.cs: Also check the using aliases here.
20606 * driver.cs: Move the test for using validity after the types have
20607 been entered, so we do a single pass that also includes the using
20610 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20611 in the regular case. CreateSiblingForFinally is doing extra
20614 * attribute.cs (GetAttributeArgumentExpression): Store the result
20615 on an out value, and use the return value to indicate failure
20616 instead of using null (which is a valid return for Constant.GetValue).
20618 * statement.cs: Perform the analysis flow for the increment
20619 portion after the statement, because this will be the real flow of
20620 execution. Fixes #42385
20622 * codegen.cs (EmitContext.EmitArgument,
20623 EmitContext.EmitStoreArgument): New helper functions when the
20624 RemapToProxy flag is set.
20626 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20629 Add support for remapping parameters.
20631 * iterators.cs: Propagate parameter values; Store parameter
20632 values in the proxy classes.
20634 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20636 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20637 need a proxy reference; I do not know what I was thinking
20639 * cs-parser.jay (constructor_initializer): catch another error,
20640 and display nice message.
20642 (field_declaration): catch void field declaration
20643 to flag a better error.
20645 * class.cs (MemberBase.CheckBase): Report an error instead of a
20646 warning if a new protected member is declared in a struct.
20647 (Field.Define): catch the error of readonly/volatile.
20649 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20651 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20652 volatile variable is taken
20654 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20656 * statement.cs (Fixed.Resolve): Report an error if we are not in
20659 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20661 * typemanager.cs: reuse the code that handles type clashes for
20662 delegates and enumerations.
20664 * class.cs (Report28): Always report.
20666 * expression.cs (EncodeAsAttribute): Allow nulls here.
20668 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20670 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20671 the functionality for testing whether an expression is valid for
20672 an attribute here. Also handle the case of arrays of elements
20675 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20676 encoding a linear array into an array of objects that are suitable
20677 to be passed to an CustomAttributeBuilder.
20679 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20681 * ecore.cs: (FieldExpr): Handle field remapping here.
20683 * iteratators.cs: Pass the instance variable (if the method is an
20684 instance method) to the constructors, so we can access the field
20685 variables on the class.
20687 TODO: Test this with structs. I think the THIS variable on
20688 structs might have to be a pointer, and not a refenrece
20690 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20692 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20693 local variables to fields in a proxy class.
20695 * iterators.cs (PopulateProxy): Rename our internal fields to
20697 Create a <THIS> field if we are an instance method, so we can
20698 reference our parent container variables.
20699 (MapVariable): Called back from the EmitContext code to enter a
20700 new variable to field mapping into the proxy class (we just create
20704 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20705 for using the remapped locals to fields.
20707 I placed the code here, because that gives the same semantics to
20708 local variables, and only changes the Emit code.
20710 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20711 statements inside iterators.
20712 (VariableInfo): Add a FieldBuilder for the cases when we are
20713 remapping local variables to fields in a proxy class
20715 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20716 current_block != null.
20718 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20719 not cope with strings, as it has been moved to the
20720 TableSwitchEmit. Fixed bug in switch generation.
20722 * expression.cs (New.DoResolve): Provide more context for the user
20723 when reporting an error.
20725 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20728 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20729 check the permissions for it. Note than in a type-resolution
20730 context the check was already present in DeclSpace.ResolveType,
20731 but was missing from the MemberAccess.
20733 (ArrayCreation.CheckIndices): warn if the user has
20734 more nested levels of expressions, but there are no more
20735 dimensions specified. Avoids crash on bug 41906.
20737 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20739 * statement.cs (Block): replace Implicit bool, for a generic
20741 New flag: `Unchecked'. This is used during the EmitMeta phase
20742 (which is out-of-line with the regular Resolve/Emit process for a
20743 statement, as this is done ahead of time, but still gets a chance
20744 to call constant resolve).
20746 (Block.Flags): new enum for adding a new flag.
20748 (Block.EmitMeta): track the state of unchecked.
20750 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20751 to enable constant resolution to work there as well.
20753 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20755 * typemanager.cs (ienumerable_type): Also look up
20756 System.Collections.IEnumerable.
20758 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20760 TODO: Test more than one conditional per method.
20762 * class.cs (Indexer.Define): Report the location where the user is
20763 referencing the unsupported feature.
20765 (MethodData): Overload the use of `conditionals' to
20766 minimize the creation of needless ArrayLists. This saves roughly
20767 212kb on my machine.
20769 (Method): Implement the new IIteratorContainer interface.
20770 (Method.SetYields): Implement the method by setting the ModFlags
20771 to contain METHOD_YIELDS.
20773 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20774 which just got set to null.
20776 * iterators.cs: New file.
20778 (Yield, YieldBreak): New statements.
20780 * statement.cs (Return.Resolve): Flag an error if we are used in
20781 an iterator method.
20783 * codegen.cs (InIterator): New flag set if the code is being
20784 compiled in an iterator method.
20786 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20787 internal modifier, and we just use it to avoid adding extra
20788 fields, as this is seldom used.
20790 * cs-parser.jay: Add yield_statement (yield and yield break).
20792 * driver.cs: New flag -v2 to turn on version 2 features.
20794 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20795 hashtable when v2 is enabled.
20797 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20799 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20800 there is already a namespace defined with this name.
20802 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20803 people upgraded their corlibs.
20805 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20806 always use fully qualified types, no need to use the compiler
20809 (TypeManager.IsNamespace): Use binarysearch.
20811 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20812 AddDelegate): I did not quite use the new IsValid API properly: I
20813 have to pass the short-name and the fullname. I was passing only
20814 the basename instead of the fullname sometimes.
20816 (TypeContainer.DefineType): call NamespaceClash.
20818 * interface.cs (Interface.DefineType): use NamespaceClash before
20821 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20824 * enum.cs: (Enum.DefineType): use NamespaceClash before
20827 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20828 speed increase. First, use the negative_hits cache when we get a
20829 negative. Second, add the type with its full original name
20830 instead of the new . and + encoded name (reflection uses + to
20831 separate type from a nested type). Use LookupTypeReflection
20832 directly which bypasses the type->name hashtable (that we already
20833 know does not contain the type.
20835 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20836 location/container type.
20838 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20840 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20842 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20844 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20845 method is being referenced in the method group from a static
20846 context, and report error 120 if so.
20848 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20851 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20852 is created, we create the A namespace).
20854 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20857 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20859 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20860 invocation to ModuleBuilder.GetType with the same values will
20861 return a new type instance, so we need to cache its return
20864 * expression.cs (Binary.ResolveOperator): Only allow the compare
20865 operators on enums if they are of the same type.
20867 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20868 types of ValueType on their own case. Before we were giving them
20869 the same treatment as objects.
20871 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20872 fullname. Short name is used to compare against container name.
20873 Fullname is used to check against defined namespace names.
20875 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20876 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20878 (Method.CheckBase): Call parent.
20879 (MemberBase.CheckBase): Check for protected members on sealed
20881 (PropertyBase.CheckBase): Call parent.
20882 (Field.Define): Call parent.
20884 * report.cs: Negative error codes are now mapped to 8000 - code,
20885 so that the display is render more nicely.
20887 * typemanager.cs: Do not use try/catch, instead report a regular
20890 (GetPointerType, GetReferenceType): These methods provide
20891 mechanisms to obtain the T* and T& from a T. We had the code
20892 previously scattered around the code base, and it also used
20893 TypeManager.LookupType that would go through plenty of caches.
20894 This one goes directly to the type source.
20896 In some places we did the Type.GetType followed by
20897 ModuleBuilder.GetType, but not in others, so this unifies the
20898 processing as well.
20900 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20901 statements now that we have namespace information.
20903 * typemanager.cs (IsNamespace): New method, returns whether the
20904 string presented is a namespace or not.
20906 (ComputeNamespaces): New public entry point, computes the list of
20907 available namespaces, using the GetNamespaces API call in Mono, or
20908 the slower version in MS.NET.
20910 Now before we start the semantic analysis phase, we have a
20911 complete list of namespaces including everything that the user has
20914 Deleted old code to cache namespaces in .nsc files.
20916 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20918 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20919 class/struct location definition Location for the implicit
20920 constructor location.
20922 (Operator.Define): Use the location of the operator for the
20923 implicit Method definition.
20925 (Constructor.Emit): use the constructor location for the implicit
20926 base initializer constructor.
20928 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20929 and the Expression class now contains two new methods:
20931 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20932 isolate type lookup from the rest of the resolution process.
20934 Since we use Expressions to hold type definitions due to the way
20935 we parse the input we have historically overloaded Resolve to
20936 perform the Type lookups if a special flag is passed. Now this is
20937 eliminated and two methods take their place.
20939 The differences in the two methods between xStep and xTerminal is
20940 that xStep is involved in our current lookup system that uses
20941 SimpleNames to compose a name, while xTerminal is used just to
20942 catch the case where the simplename lookup failed.
20944 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20946 * expression.cs (ResolveMemberAccess): Remove redundant code.
20947 TypeExpr expressions are always born fully resolved.
20949 * interface.cs (PopulateMethod): Do not lookup the types twice.
20950 We were doing it once during SemanticAnalysis and once during
20953 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20954 in local variable type definitions, were being returned as a
20955 SimpleName (we decomposed everything into a string), that is
20956 because primary_expression was being used instead of a type in the
20957 grammar (reduce/reduce conflicts).
20959 The part that was wrong is that we converted the expression into a
20960 string (an oversimplification in one hand, compounded with primary
20961 expressions doing string concatenation).
20967 Would return "A.B.C[]" as a SimpleName. This stopped things like
20968 using clauses from working on this particular context. And a type
20969 was being matched directly against "A.B.C[]".
20971 We now use the correct approach, and allow for ComposedCast to be
20972 part of the unary expression. So the "A.B.C []" become a composed
20973 cast of "A.B.C" (as a nested group of MemberAccess with a
20974 SimpleName at the end) plus the rank composition "[]".
20978 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20980 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20981 for the access level checking.
20983 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20984 `TypeContainer container', because I kept getting confused when I
20985 was debugging this code.
20987 * expression.cs (Indexers): Instead of tracking getters/setters,
20988 we now track them in parallel. We create one arraylist less, but
20989 most importantly it is possible now for the LValue code to find a
20990 matching get for a set.
20992 (IndexerAccess.DoResolveLValue): Update the code.
20993 GetIndexersForType has been modified already to extract all the
20994 indexers from a type. The code assumed it did not.
20996 Also make the code set the correct return type for the indexer.
20997 This was fixed a long time ago for properties, but was missing for
20998 indexers. It used to be void_type.
21000 (Binary.Emit): Test first for doubles instead of
21001 floats, as they are more common.
21003 (Binary.EmitBranchable): Use the .un version of the branch opcodes
21004 when dealing with floats and the <=, >= operators. This fixes bug
21007 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21008 to load the array value by emitting a load on the foreach variable
21009 type. This was incorrect.
21011 We now emit the code to load an element using the the array
21012 variable type, and then we emit the conversion operator.
21016 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
21018 * attribute.cs: Avoid allocation of ArrayLists in the common case.
21020 2003-04-09 Miguel de Icaza <miguel@ximian.com>
21022 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21023 test for protection before we test for signatures.
21025 (MethodSignature.ToString): implement.
21027 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21028 to the case where we reduced into a LongConstant.
21030 * decl.cs (CheckAccessLevel): If the type is an array, we can not
21031 depend on whether the information is acurrate, because the
21032 Microsoft runtime will always claim that the array type is public,
21033 regardless of the real state.
21035 If the type is a pointer, another problem happens: the type is
21036 reported as non-public in Microsoft.
21038 In both cases we have to call CheckAccessLevel recursively with
21039 the underlying type as the argument to be tested.
21041 2003-04-08 Miguel de Icaza <miguel@ximian.com>
21043 * assign.cs (Assign.Emit): If we are dealing with a compound
21044 assignment expression, we should use the code path that stores the
21045 intermediate result in a temporary value. This fixes #40903.
21047 *expression.cs (Indirection.ToString): Provide ToString method for
21050 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
21052 * class.cs: Null out fields holding references to Block objects so
21053 they can be garbage collected.
21055 * expression.cs (OverloadResolve): Remove unused local.
21057 2003-04-07 Martin Baulig <martin@ximian.com>
21059 * codegen.cs (EmitContext.CurrentFile): New public field.
21060 (EmitContext.Mark): Use the CurrentFile to check whether the
21061 location is in the correct file.
21062 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21064 2003-04-07 Martin Baulig <martin@ximian.com>
21066 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21068 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21069 location. [FIXME: The location argument which gets passed to this
21070 method is sometimes wrong!]
21072 2003-04-07 Nick Drochak <ndrochak@gol.com>
21074 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21076 2003-04-07 Miguel de Icaza <miguel@ximian.com>
21078 * expression.cs (Indirection.EmitAssign): We were using the
21079 temporary, but returning immediately instead of continuing the
21082 2003-04-06 Martin Baulig <martin@ximian.com>
21084 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21085 if it's a nested child, but also deriving from the outer class.
21088 * typemanager.cs (IsNestedChildOf): Make this work if it's a
21089 nested child, but also deriving from the outer class. See
21091 (FilterWithClosure): We may access private members of the outer
21092 class if we're a nested child and deriving from the outer class.
21093 (RealMemberLookup): Only set `closure_private_ok' if the
21094 `original_bf' contained BindingFlags.NonPublic.
21096 2003-04-05 Martin Baulig <martin@ximian.com>
21098 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21100 2003-04-02 Miguel de Icaza <miguel@ximian.com>
21102 * class.cs (Event.Define): Do not allow abstract events to have
21105 2003-04-01 Miguel de Icaza <miguel@ximian.com>
21107 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21108 block in event declarations.
21110 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21111 value type, get its address.
21113 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21114 leaving a class on the stack instead of a boolean value (int
21115 0/1). Change the code so we compare against null, and then the
21116 result against zero.
21118 * class.cs (TypeContainer.GetClassBases): We were checking for the
21119 parent class being sealed too late.
21121 * expression.cs (Binary.Emit): For <= and >= when dealing with
21122 floating point values, use cgt.un and clt.un instead of cgt and
21125 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
21127 * statement.cs: Apply the same optimization as MS: skip the
21128 GetEnumerator returning an IEnumerator, and use the one returning a
21129 CharEnumerator instead. This allows us to avoid the try-finally block
21132 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
21134 * cs-parser.jay: Attributes cannot be applied to
21135 namespaces. Fixes #40473
21137 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21140 (Add*): check if the name is valid using the full name for constants,
21141 fields, properties and events.
21143 2003-03-28 Miguel de Icaza <miguel@ximian.com>
21145 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21146 char constants to be part of the enumeration.
21148 * expression.cs (Conditional.DoResolve): Add support for operator
21149 true. Implements the missing functionality from 14.12
21151 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21152 operator true/false as required by the spec.
21154 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21155 implicit conversion to boolean.
21157 * statement.cs (Statement.ResolveBoolean): A boolean expression is
21158 also one where the type implements `operator true'.
21160 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21161 get an expression that will invoke operator true based on an
21164 (GetConversionOperators): Removed the hack that called op_True
21167 (Expression.ResolveBoolean): Move this from Statement.
21169 2003-03-17 Miguel de Icaza <miguel@ximian.com>
21171 * ecore.cs (FieldExpr): do not allow initialization of initonly
21172 fields on derived classes
21174 2003-03-13 Martin Baulig <martin@ximian.com>
21176 * statement.cs (Block.Emit): Call ig.BeginScope() and
21177 ig.EndScope() when compiling with debugging info; call
21178 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21180 2003-03-08 Miguel de Icaza <miguel@ximian.com>
21182 * expression.cs (Indexers): Do not construct immediately, allow
21183 for new members to be appended as we go. Fixes 38143
21185 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21187 * expression.cs: save/restore context when resolving an unchecked
21190 2003-03-05 Miguel de Icaza <miguel@ximian.com>
21192 * cfold.cs: Catch division by zero in modulus operator during
21195 2003-03-03 Miguel de Icaza <miguel@ximian.com>
21197 * interface.cs (Interface.DefineMembers): Avoid defining members
21200 2003-02-27 Miguel de Icaza <miguel@ximian.com>
21202 * driver.cs: handle the +/- options for -noconfig
21204 * statement.cs (Unckeched.Resolve): Also track the state of
21205 unchecked in the Resolve phase.
21207 2003-02-27 Martin Baulig <martin@ximian.com>
21209 * ecore.cs (Expression.MemberLookup): Don't create a
21210 MethodGroupExpr for something which is not a method. Fixes #38291.
21212 2003-02-25 Miguel de Icaza <miguel@ximian.com>
21214 * class.cs (MemberBase.CheckParameters): Also check that the type
21215 is unmanaged if it is a pointer.
21217 * expression.cs (SizeOf.Resolve): Add location information.
21219 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21220 a managed type is declared.
21222 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21223 parameter modifiers as well. Fixes bug 38606
21225 * class.cs: Very sad. Am backing out the speed up changes
21226 introduced by the ArrayList -> Array in the TypeContainer, as they
21227 were not actually that much faster, and introduced a bug (no error
21228 reports on duplicated methods).
21230 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21231 source first, this will guarantee that we have a valid expression
21232 before calling in lower levels functions that will require a
21233 resolved object. Then use this original_source in the
21234 target.ResolveLValue instead of the original source that was
21237 Another change. Use target.Resolve instead of LValueResolve.
21238 Although we are resolving for LValues, we will let the Assign code
21239 take care of that (it will be called again from Resolve). This
21240 basically allows code like this:
21242 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21243 class Y { void A (X x) { x [0] += o; }
21245 The problem was that the indexer was trying to resolve for
21246 set_Item (idx, object o) and never finding one. The real set_Item
21247 was set_Item (idx, X). By delaying the process we get the right
21252 2003-02-23 Martin Baulig <martin@ximian.com>
21254 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21255 while calling DoEmit ().
21257 * codegen.cs (EmitContext.Mark): Don't mark locations in other
21258 source files; if you use the #line directive inside a method, the
21259 compiler stops emitting line numbers for the debugger until it
21260 reaches the end of the method or another #line directive which
21261 restores the original file.
21263 2003-02-23 Martin Baulig <martin@ximian.com>
21265 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21267 2003-02-23 Martin Baulig <martin@ximian.com>
21269 * statement.cs (Block.AddChildVariableNames): We need to call this
21270 recursively, not just for our immediate children.
21272 2003-02-23 Martin Baulig <martin@ximian.com>
21274 * class.cs (Event.Define): Always make the field private, like csc does.
21276 * typemanager.cs (TypeManager.RealMemberLookup): Make events
21277 actually work, fixes bug #37521.
21279 2003-02-23 Miguel de Icaza <miguel@ximian.com>
21281 * delegate.cs: When creating the various temporary "Parameters"
21282 classes, make sure that we call the ComputeAndDefineParameterTypes
21283 on those new parameters (just like we do with the formal ones), to
21284 allow them to be resolved in the context of the DeclSpace.
21286 This fixes the bug that Dick observed in Bugzilla #38530.
21288 2003-02-22 Miguel de Icaza <miguel@ximian.com>
21290 * expression.cs (ResolveMemberAccess): When resolving a constant,
21291 do not attempt to pull a constant if the value was not able to
21292 generate a valid constant.
21294 * const.cs (LookupConstantValue): Do not report more errors than required.
21296 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21298 * expression.cs: fixes bug #38328.
21300 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21302 * class.cs: Changed all the various members that can be part of a
21303 class from being an ArrayList to be an Array of the right type.
21304 During the DefineType type_list, interface_list, delegate_list and
21305 enum_list are turned into types, interfaces, delegates and enums
21308 And during the member population, indexer_list, event_list,
21309 constant_list, field_list, instance_constructor_list, method_list,
21310 operator_list and property_list are turned into their real arrays.
21312 Although we could probably perform this operation earlier, for
21313 good error reporting we need to keep the lists and remove the
21314 lists for longer than required.
21316 This optimization was triggered by Paolo profiling the compiler
21317 speed on the output of `gen-sample-program.pl' perl script.
21319 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21320 not crash in methods like MemberLookupFailed that use this field.
21322 This problem arises when the compiler fails to resolve a type
21323 during interface type definition for example.
21325 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21327 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21328 inherit from System.Object, so we have to stop at null, not only
21329 when reaching System.Object.
21331 2003-02-17 Miguel de Icaza <miguel@ximian.com>
21333 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21334 DeclaredOnly because the parent indexer might have had a different
21335 name, but did not loop until the top of the hierarchy was reached.
21337 The problem this one fixes is 35492: when a class implemented an
21338 indexer from an interface, we were getting the interface method
21339 (which was abstract) and we were flagging an error (can not invoke
21342 This also keeps bug 33089 functioning, and test-148 functioning.
21344 * typemanager.cs (IsSpecialMethod): The correct way of figuring
21345 out if a method is special is to see if it is declared in a
21346 property or event, or whether it is one of the predefined operator
21347 names. This should fix correctly #36804.
21349 2003-02-15 Miguel de Icaza <miguel@ximian.com>
21351 The goal here is to remove the dependency on EmptyCast.Peel ().
21352 Killing it completely.
21354 The problem is that currently in a number of places where
21355 constants are expected, we have to "probe" for an EmptyCast, and
21356 Peel, which is not the correct thing to do, as this will be
21357 repetitive and will likely lead to errors.
21359 The idea is to remove any EmptyCasts that are used in casts that
21360 can be reduced to constants, so we only have to cope with
21363 This bug hunt was triggered by Bug 37363 and the desire to remove
21364 the duplicate pattern where we were "peeling" emptycasts to check
21365 whether they were constants. Now constants will always be
21368 * ecore.cs: Use an enumconstant here instead of wrapping with
21371 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21372 throwing me off. By handling this we can get rid of a few hacks.
21374 * statement.cs (Switch): Removed Peel() code.
21376 2003-02-14 Miguel de Icaza <miguel@ximian.com>
21378 * class.cs: Location information for error 508
21380 * expression.cs (New.DoResolve): Add a guard against double
21381 resolution of an expression.
21383 The New DoResolve might be called twice when initializing field
21384 expressions (see EmitFieldInitializers, the call to
21385 GetInitializerExpression will perform a resolve on the expression,
21386 and later the assign will trigger another resolution
21388 This leads to bugs (#37014)
21390 * delegate.cs: The signature for EndInvoke should contain any ref
21391 or out parameters as well. We were not doing this in the past.
21393 * class.cs (Field.Define): Do not overwrite the type definition
21394 inside the `volatile' group. Turns out that volatile enumerations
21395 were changing the type here to perform a validity test, which
21398 2003-02-12 Miguel de Icaza <miguel@ximian.com>
21400 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21401 and structs, we do not want to load the instance variable
21403 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21404 enum_type has to be handled like an object reference (implicit
21405 conversions exists from this to object), but the regular IsClass
21406 and IsValueType tests will never return true for this one.
21408 Also we use TypeManager.IsValueType instead of type.IsValueType,
21409 just for consistency with the rest of the code (this is only
21410 needed if we ever use the construct exposed by test-180.cs inside
21411 corlib, which we dont today).
21413 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
21415 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21418 2003-02-09 Martin Baulig <martin@ximian.com>
21420 * namespace.cs (Namespace..ctor): Added SourceFile argument.
21421 (Namespace.DefineNamespaces): New static public method; this is
21422 called when we're compiling with debugging to add all namespaces
21423 to the symbol file.
21425 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21426 pass it to the Namespace's .ctor.
21428 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21429 and MethodBase arguments; pass the namespace ID to the symwriter;
21430 pass the MethodBase instead of the token to the symwriter.
21431 (SymbolWriter.DefineNamespace): New method to add a namespace to
21434 2003-02-09 Martin Baulig <martin@ximian.com>
21436 * symbolwriter.cs: New file. This is a wrapper around
21437 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
21438 methods here in near future.
21440 2003-02-09 Martin Baulig <martin@ximian.com>
21442 * codegen.cs (EmitContext.Mark): Just pass the arguments to
21443 ILGenerator.MarkSequencePoint() which are actually used by the
21446 2003-02-09 Martin Baulig <martin@ximian.com>
21448 * location.cs (SourceFile): New public sealed class. This
21449 contains the name and an index which is used in the location's token.
21450 (Location): Reserve an appropriate number of bits in the token for
21451 the source file instead of walking over that list, this gives us a
21452 really huge performance improvement when compiling with debugging.
21454 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21455 `SourceFile' argument instead of a string.
21456 (Driver.ProcessFile): Add all the files via Location.AddFile(),
21457 but don't parse/tokenize here, we need to generate the list of all
21458 source files before we do that.
21459 (Driver.ProcessFiles): New static function. Parses/tokenizes all
21462 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21463 instead of a string.
21465 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21468 2003-02-09 Martin Baulig <martin@ximian.com>
21470 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21471 filename on `#line default'.
21473 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21475 * statement.cs: don't clear the pinned var when the fixed statement
21476 returns from the method (fixes bug#37752).
21478 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21480 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
21483 2003-02-07 Martin Baulig <martin@ximian.com>
21485 * driver.cs: Removed the `--debug-args' command line argument.
21487 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21488 automatically by the AsssemblyBuilder.
21489 (CodeGen.InitializeSymbolWriter): We don't need to call any
21490 initialization function on the symbol writer anymore. This method
21491 doesn't take any arguments.
21493 2003-02-03 Miguel de Icaza <miguel@ximian.com>
21495 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21496 from referenced assemblies as well.
21498 2003-02-02 Martin Baulig <martin@ximian.com>
21500 * class.cs (MethodData.Emit): Generate debugging info for external methods.
21502 2003-02-02 Martin Baulig <martin@ximian.com>
21504 * class.cs (Constructor.Emit): Open the symbol writer before
21505 emitting the constructor initializer.
21506 (ConstructorInitializer.Emit): Call ec.Mark() to allow
21507 single-stepping through constructor initializers.
21509 2003-01-30 Miguel de Icaza <miguel@ximian.com>
21511 * class.cs: Handle error 549: do not allow virtual methods in
21514 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21516 * decl.cs: Check access levels when resolving types
21518 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21520 * statement.cs: Add parameters and locals set in catch blocks that might
21521 return to set vector
21523 2003-01-29 Miguel de Icaza <miguel@ximian.com>
21525 * class.cs (Operator): Set the SpecialName flags for operators.
21527 * expression.cs (Invocation.DoResolve): Only block calls to
21528 accessors and operators on SpecialName methods.
21530 (Cast.TryReduce): Handle conversions from char constants.
21533 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21535 * statement.cs: small memory and time optimization in FlowBranching.
21537 2003-01-28 Pedro Mart <yoros@wanadoo.es>
21539 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21540 problem that the last fix but in the other sid (Set).
21542 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21543 access when there is no indexer in the hierarchy.
21545 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21547 * class.cs: Combine some if statements.
21549 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21551 * driver.cs: fixed bug #37187.
21553 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
21555 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21556 any indexer, it's needed to build a list with all the indexers in the
21557 hierarchy (AllGetters), else we have problems. Fixes #35653.
21559 2003-01-23 Miguel de Icaza <miguel@ximian.com>
21561 * class.cs (MethodData.Define): It is wrong for an interface
21562 implementation to be static in both cases: explicit and implicit.
21563 We were only handling this in one case.
21565 Improve the if situation there to not have negations.
21567 * class.cs (Field.Define): Turns out that we do not need to check
21568 the unsafe bit on field definition, only on usage. Remove the test.
21570 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21572 * driver.cs: use assembly.Location instead of Codebase (the latest
21573 patch made mcs fail when using MS assemblies).
21575 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
21577 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21578 get the path to *corlib.dll.
21580 2003-01-21 Nick Drochak <ndrochak@gol.com>
21584 * typemanager.cs: Remove compiler warnings
21586 2003-01-20 Duncan Mak <duncan@ximian.com>
21588 * AssemblyInfo.cs: Bump the version number to 0.19.
21590 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21592 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21594 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21596 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21598 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21600 * cs-parser.jay: Small fix: we were not comparing the constructor
21601 name correctly. Thanks to Zoltan for the initial pointer.
21603 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21605 * cs-tokenizer.cs: Set file name when specified with #line
21607 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21609 * cs-parser.jay: Only perform the constructor checks here if we
21610 are named like the class; This will help provider a better
21611 error. The constructor path is taken when a type definition is
21612 not found, but most likely the user forgot to add the type, so
21613 report that rather than the constructor error.
21615 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21617 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21620 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21622 * cs-parser.jay: Add cleanup call.
21624 2003-01-13 Duncan Mak <duncan@ximian.com>
21626 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21627 consistent with other methods.
21629 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21631 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21633 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21635 * attribute.cs: only set GuidAttr to true when we have a
21638 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21642 * typemanager.cs: fixes to allow mcs compile corlib with the new
21643 Type.IsSubclassOf fix.
21645 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21647 * expression.cs (LocalVariableReference.DoResolve): Classify a
21648 constant as a value, not as a variable. Also, set the type for
21651 * cs-parser.jay (fixed_statement): take a type instead of a
21652 pointer_type, so we can produce a better error message later.
21654 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21657 (For.DoEmit): Make inifinite loops have a
21658 non-conditional branch back.
21660 (Fixed.DoEmit): First populate the pinned variables, then emit the
21661 statement, then clear the variables. Before I was emitting the
21662 code once for each fixed piece.
21665 2003-01-08 Martin Baulig <martin@ximian.com>
21667 * statement.cs (FlowBranching.MergeChild): A break in a
21668 SWITCH_SECTION does not leave a loop. Fixes #36155.
21670 2003-01-08 Martin Baulig <martin@ximian.com>
21672 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21673 lives in the same number space than `param_map'. Fixes #36154.
21675 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21677 * cs-parser.jay (constructor_declaration): Set the
21678 Constructor.ModFlags before probing for it. This makes the
21679 compiler report 514, 515 and 132 (the code was there, but got
21682 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21683 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21684 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21686 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21688 * enum.cs: create the enum static fields using the enum type.
21690 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21692 * class.cs: don't try to create the ParamBuilder for the return
21693 type if it's not needed (and handle it breaking for the ms runtime
21696 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21698 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21700 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21702 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21703 the command. This showed up while compiling the JANET source
21704 code, which used \r as its only newline separator.
21706 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21708 * class.cs (Method.Define): If we are an operator (because it
21709 reuses our code), then set the SpecialName and HideBySig. #36128
21711 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21713 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21714 exception, report error 120 `object reference required'.
21716 * driver.cs: Add --pause option, used during to measure the size
21717 of the process as it goes with --timestamp.
21719 * expression.cs (Invocation.DoResolve): Do not allow methods with
21720 SpecialName to be invoked.
21722 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21724 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21725 number before adding it.
21727 2002-12-21 Ravi Pratap <ravi@ximian.com>
21729 * ecore.cs (StandardImplicitConversion): When in an unsafe
21730 context, we allow conversion between void * to any other pointer
21731 type. This fixes bug #35973.
21733 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21735 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21736 is not thrown when extensionless outputs are used
21738 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21740 * rootcontext.cs: fixed compilation of corlib.
21742 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21744 * attribute.cs (Attributes.Contains): Add new method.
21746 * class.cs (MethodCore.LabelParameters): if the parameter is an
21747 `out' parameter, check that no attribute `[In]' has been passed.
21749 * enum.cs: Handle the `value__' name in an enumeration.
21751 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21753 * decl.cs: Added special case to allow overrides on "protected
21756 2002-12-18 Ravi Pratap <ravi@ximian.com>
21758 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21759 since it makes much more sense.
21761 (Attributes.ctor): Don't require a Location parameter.
21763 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21765 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21766 since we already have that information per attribute.
21768 * everywhere : make appropriate changes.
21770 * class.cs (LabelParameters): Write the code which actually
21771 applies attributes to the return type. We can't do this on the MS
21772 .NET runtime so we flag a warning in the case an exception is
21775 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21777 * const.cs: Handle implicit null conversions here too.
21779 2002-12-17 Ravi Pratap <ravi@ximian.com>
21781 * class.cs (MethodCore.LabelParameters): Remove the extra
21782 Type [] parameter since it is completely unnecessary. Instead
21783 pass in the method's attributes so that we can extract
21784 the "return" attribute.
21786 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21788 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21789 of ignoring it and letting the compile continue.
21791 * typemanager.cs (ChangeType): use an extra argument to return an
21792 error condition instead of throwing an exception.
21794 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21796 * expression.cs (Unary.TryReduce): mimic the code for the regular
21797 code path. Perform an implicit cast in the cases where we can
21798 implicitly convert to one of the integral types, and then reduce
21799 based on that constant. This fixes bug #35483.
21801 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21803 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21805 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21807 * namespace.cs: fixed bug #35489.
21809 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21811 * class.cs: Remove some dead code.
21813 * cs-parser.jay: Estimate the number of methods needed
21814 (RootContext.MethodCount);
21816 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21817 numbers instead of StringBuilders.
21819 * support.cs (PtrHashtable): Add constructor with initial size;
21820 We can now reduce reallocations of the method table.
21822 2002-12-10 Ravi Pratap <ravi@ximian.com>
21824 * attribute.cs (ApplyAttributes): Keep track of the emitted
21825 attributes on a per-target basis. This fixes bug #35413.
21827 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21829 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21830 default to the Windows 1252 encoding.
21832 (UnixParseOption): Support version, thanks to Alp for the missing
21835 * AssemblyInfo.cs: Add nice assembly information.
21837 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21840 * cs-parser.jay: Allow a trailing comma before the close bracked
21841 in the attribute_section production.
21843 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21844 address of the instance was being taken, I will take this out,
21845 because we take the address of the object immediately here.
21847 2002-12-09 Ravi Pratap <ravi@ximian.com>
21849 * typemanager.cs (AreMultipleAllowed): Take care of the most
21850 obvious case where attribute type is not in the current assembly -
21853 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21855 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21856 definitions, instead of doing that afterwards.
21858 Also we use a nice little hack, depending on the constructor, we
21859 know if we are a "composed" name or a simple name. Hence, we
21860 avoid the IndexOf test, and we avoid
21862 * codegen.cs: Add code to assist in a bug reporter to track down
21863 the source of a compiler crash.
21865 2002-12-07 Ravi Pratap <ravi@ximian.com>
21867 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21868 types have been emitted for a given element and flag an error
21869 if something which does not have AllowMultiple set is used more
21872 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21873 attribute types and their corresponding AllowMultiple properties
21875 (AreMultipleAllowed): Check the property for a given type.
21877 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21878 property in the case we have a TypeContainer.
21880 (Attributes.AddAttribute): Detect duplicates and just skip on
21881 adding them. This trivial fix catches a pretty gross error in our
21882 attribute emission - global attributes were being emitted twice!
21884 Bugzilla bug #33187 is now fixed.
21886 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21888 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21889 instead of pp_and).
21891 * expression.cs (Binary.ResolveOperator): I can only use the
21892 Concat (string, string, string) and Concat (string, string,
21893 string, string) if the child is actually a concatenation of
21896 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21898 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21899 context where we need a 2-character lookahead.
21901 * pending.cs (PendingImplementation): Rework so we can keep track
21902 of interface types all the time, and flag those which were
21903 implemented by parents as optional.
21905 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21907 * expression.cs (Binary.ResolveOperator): Use
21908 String.Concat(string,string,string) or
21909 String.Concat(string,string,string,string) when possible.
21911 * typemanager: More helper methods.
21914 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21916 * pending.cs: remove the bogus return from GetMissingInterfaces()
21917 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21919 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21921 * namespace.cs: avoid duplicated 'using xxx' being added to
21922 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21923 when we get more than one 'using' statement for the same namespace.
21924 Report a CS0105 warning for it.
21926 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21928 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21929 of calling getChar/putback, uses internal knowledge of it.
21931 (xtoken): Reorder tokenizer so most common patterns are checked
21932 first. This reduces the compilation time in another 5% (from 8.11s
21933 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21935 The parsing time is 22% of the compilation in mcs, and from that
21936 64% is spent on the tokenization process.
21938 I tried using a binary search for keywords, but this is slower
21939 than the hashtable. Another option would be to do a couple of
21942 * Not use a StringBuilder, instead use an array of chars,
21943 with a set value. Notice that this way we could catch
21944 the 645 error without having to do it *afterwards*.
21946 * We could write a hand-parser to avoid the hashtable
21947 compares altogether.
21949 The identifier consumption process takes 37% of the tokenization
21950 time. Another 15% is spent on is_number. 56% of the time spent
21951 on is_number is spent on Int64.Parse:
21953 * We could probably choose based on the string length to
21954 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21957 Another 3% is spend on wrapping `xtoken' in the `token' function.
21959 Handle 0xa0 as whitespace (#34752)
21961 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21963 * typemanager.cs (IsCLRType): New routine to tell whether a type
21964 is one of the builtin types.
21966 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21967 typecode in more places instead of doing pointer comparissions.
21968 We could leverage some knowledge about the way the typecodes are
21971 New code to cache namespaces in assemblies, it is currently not
21972 invoked, to be used soon.
21974 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21976 * expression.cs (Binary.ResolveOperator): specially handle
21977 strings, and do not perform user-defined operator overloading for
21980 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21982 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21983 internalcall as it is a pretty simple operation; Avoid whenever
21984 possible to call Char.IsLetter.
21986 (consume_identifier): Cut by half the number of
21987 hashtable calls by merging the is_keyword and GetKeyword behavior.
21989 Do not short-circuit, because if we do, we
21990 report errors (ie, #if false && true would produce an invalid
21994 2002-11-24 Martin Baulig <martin@ximian.com>
21996 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21997 check constant ranges and report a CS0221. Fixes #33186.
21999 2002-11-24 Martin Baulig <martin@ximian.com>
22001 * cs-parser.jay: Make this work for uninitialized variable
22002 declarations in the `for' initializer. Fixes #32416.
22004 2002-11-24 Martin Baulig <martin@ximian.com>
22006 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22007 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
22009 2002-11-24 Martin Baulig <martin@ximian.com>
22011 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22012 argument; if true, we also check for user-defined conversions.
22013 This is only needed if both arguments are of a user-defined type.
22014 Fixes #30443, added test-175.cs.
22015 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22017 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22019 2002-11-24 Martin Baulig <martin@ximian.com>
22021 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22022 function to get the store opcode.
22023 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22024 only emit the Ldelema if the store opcode is Stobj. You must run
22025 both test-34 and test-167 to test this. Fixes #34529.
22027 2002-11-23 Martin Baulig <martin@ximian.com>
22029 * ecore.cs (Expression.MemberLookup): Added additional
22030 `qualifier_type' argument which is used when we're being called
22031 from MemberAccess.DoResolve() and null if we're called from a
22033 (Expression.MemberLookupFailed): New method to report errors; this
22034 does the CS1540 check and reports the correct error message.
22036 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22037 argument for the CS1540 check and redone the way how we're dealing
22038 with private members. See the comment in the source code for details.
22039 (FilterWithClosure): Reverted this back to revision 1.197; renamed
22040 `closure_start_type' to `closure_qualifier_type' and check whether
22041 it's not null. It was not this filter being broken, it was just
22042 being called with the wrong arguments.
22044 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22045 and pass it the correct `qualifier_type'; this also does the error
22048 2002-11-22 Miguel de Icaza <miguel@ximian.com>
22050 * expression.cs (Invocation.EmitParams): If the we are dealing
22051 with a non-built-in value type, load its address as well.
22053 (ArrayCreation): Use a a pretty constant instead
22054 of the hardcoded value 2. Use 6 instead of 2 for the number of
22055 static initializers.
22057 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22058 because they are not really value types, just glorified integers.
22060 * driver.cs: Do not append .exe, the CSC compiler does not do it.
22062 * ecore.cs: Remove redundant code for enumerations, make them use
22063 the same code path as everything else, fixes the casting issue
22064 with enumerations in Windows.Forms.
22066 * attribute.cs: Do only cast to string if it is a string, the
22067 validation happens later.
22069 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22070 people upgrade their corlibs.
22072 * ecore.cs: Oops, enumerations were not following the entire code path
22074 2002-11-21 Miguel de Icaza <miguel@ximian.com>
22076 * typemanager.cs (FilterWithClosure): Commented out the test for
22077 1540 in typemanager.cs, as it has problems when accessing
22078 protected methods from a parent class (see test-174.cs).
22080 * attribute.cs (Attribute.ValidateGuid): new method.
22081 (Attribute.Resolve): Use above.
22083 2002-11-19 Miguel de Icaza <miguel@ximian.com>
22085 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22087 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22088 handling for enumerations, as we only needed the TypeContainer
22089 functionality to begin with (this is required for the fix below to
22090 work for enums that reference constants in a container class for
22093 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22095 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22096 a valid TypeBuilder to perform lookups on.o
22098 * class.cs (InheritableMemberSignatureCompare): Use true in the
22099 call to GetGetMethod and GetSetMethod, because we are comparing
22100 the signature, and we need to get the methods *even* if they are
22103 (PropertyBase.CheckBase): ditto.
22105 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22106 GotoCase.Resolve): Use Peel on EmpytCasts.
22108 * ecore.cs (EmptyCast): drop child, add Peel method.
22110 2002-11-17 Martin Baulig <martin@ximian.com>
22112 * ecore.cs (EmptyCast.Child): New public property.
22114 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22115 label resolved to an EmptyCast. Fixes #34162.
22116 (GotoCase.Resolve): Likewise.
22117 (Block.EmitMeta): Likewise.
22119 2002-11-17 Martin Baulig <martin@ximian.com>
22121 * expression.cs (Invocation.BetterConversion): Prefer int over
22122 uint; short over ushort; long over ulong for integer literals.
22123 Use ImplicitConversionExists instead of StandardConversionExists
22124 since we also need to check for user-defined implicit conversions.
22125 Fixes #34165. Added test-173.cs.
22127 2002-11-16 Martin Baulig <martin@ximian.com>
22129 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22130 with the `true' and `false' literals. Fixes #33151.
22132 2002-11-16 Martin Baulig <martin@ximian.com>
22134 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22135 October 22nd; don't do the cs1540 check for static members.
22137 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22138 now using our own filter here and doing the cs1540 check again.
22140 2002-11-16 Martin Baulig <martin@ximian.com>
22142 * support.cs (InternalParameters): Don't crash if we don't have
22143 any fixed parameters. Fixes #33532.
22145 2002-11-16 Martin Baulig <martin@ximian.com>
22147 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22148 when looking up static methods to make this work on Windows.
22151 2002-11-16 Martin Baulig <martin@ximian.com>
22153 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22154 a setter rather than using PropertyInfo.CanWrite.
22156 2002-11-15 Nick Drochak <ndrochak@gol.com>
22158 * class.cs: Allow acces to block member by subclasses. Fixes build
22161 2002-11-14 Martin Baulig <martin@ximian.com>
22163 * class.cs (Constructor.Emit): Added the extern/block check.
22166 2002-11-14 Martin Baulig <martin@ximian.com>
22168 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22169 iteration while looking for indexers, this is needed because the
22170 indexer may have a different name in our base classes. Fixed the
22171 error reporting (no indexers at all, not get accessor, no
22172 overloaded match). Fixes bug #33089.
22173 (IndexerAccess.DoResolveLValue): Likewise.
22175 2002-11-14 Martin Baulig <martin@ximian.com>
22177 * class.cs (PropertyBase.CheckBase): Make this work for multiple
22178 indexers. Fixes the first part of bug #33089.
22179 (MethodSignature.InheritableMemberSignatureCompare): Added support
22182 2002-11-13 Ravi Pratap <ravi@ximian.com>
22184 * attribute.cs (Attribute.Resolve): Catch the
22185 NullReferenceException and report it since it isn't supposed to
22188 2002-11-12 Miguel de Icaza <miguel@ximian.com>
22190 * expression.cs (Binary.EmitBranchable): Also handle the cases for
22191 LogicalOr and LogicalAnd that can benefit from recursively
22192 handling EmitBranchable. The code now should be nice for Paolo.
22194 2002-11-08 Miguel de Icaza <miguel@ximian.com>
22196 * typemanager.cs (LookupType): Added a negative-hit hashtable for
22197 the Type lookups, as we perform quite a number of lookups on
22198 non-Types. This can be removed once we can deterministically tell
22199 whether we have a type or a namespace in advance.
22201 But this might require special hacks from our corlib.
22205 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22206 and double which avoids a conversion from an integer to a double.
22208 * expression.cs: tiny optimization, avoid calling IsConstant,
22209 because it effectively performs the lookup twice.
22211 2002-11-06 Miguel de Icaza <miguel@ximian.com>
22213 But a bogus return here to keep the semantics of the old code
22214 until the Mono runtime is fixed.
22216 * pending.cs (GetMissingInterfaces): New method used to remove all
22217 the interfaces that are already implemented by our parent
22218 classes from the list of pending methods.
22220 * interface.cs: Add checks for calls after ResolveTypeExpr.
22222 2002-11-05 Miguel de Icaza <miguel@ximian.com>
22224 * class.cs (Class.Emit): Report warning 67: event not used if the
22225 warning level is beyond 3.
22227 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22228 being a NullLiteral.
22230 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22233 * class.cs (TypeContainer.GetClassBases): Cover a missing code
22234 path that might fail if a type can not be resolved.
22236 * expression.cs (Binary.Emit): Emit unsigned versions of the
22239 * driver.cs: use error 5.
22241 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22243 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22245 2002-11-01 Miguel de Icaza <miguel@ximian.com>
22247 * cs-parser.jay (switch_section): A beautiful patch from Martin
22248 Baulig that fixed 33094.
22250 2002-10-31 Miguel de Icaza <miguel@ximian.com>
22252 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22253 Check whether the base is abstract and report an error if so.
22255 * expression.cs (IndexerAccess.DoResolveLValue,
22256 IndexerAccess.DoResolve): ditto.
22258 (Invocation.DoResolve): ditto.
22260 (Invocation.FullMethodDesc): Improve the report string.
22262 * statement.cs (Block): Eliminate IsVariableDefined as it is
22263 basically just a wrapper for GetVariableInfo.
22265 * ecore.cs (SimpleName): Use new
22267 * support.cs (ReflectionParamter.ParameterType): We unwrap the
22268 type, as we return the actual parameter ref/unref state on a
22271 2002-10-30 Miguel de Icaza <miguel@ximian.com>
22273 * support.cs: Return proper flags REF/OUT fixing the previous
22276 * expression.cs: Reverted last patch, that was wrong. Is_ref is
22277 not used to mean `ref' but `ref or out' in ParameterReference
22279 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22280 full type signature instead of calling TypeManger.CSharpName
22283 * support.cs (InternalParameters.ParameterDesc): Do not compare
22284 directly to the modflags, because REF/OUT will actually be bitsets
22287 * delegate.cs (VerifyMethod): Check also the modifiers.
22289 * cs-tokenizer.cs: Fix bug where floating point values with an
22290 exponent where a sign was missing was ignored.
22292 * driver.cs: Allow multiple assemblies to be specified in a single
22295 2002-10-28 Miguel de Icaza <miguel@ximian.com>
22297 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
22298 because identifiers after a parenthesis would end up in this kind
22299 of production, and we needed to desamiguate it for having casts
22302 (UserDefinedType *) xxx
22304 2002-10-24 Miguel de Icaza <miguel@ximian.com>
22306 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22307 we should set on the Bindingflags.NonPublic, but not turn on
22308 private_ok. private_ok controls whether a Private member is
22309 returned (this is chekced on the filter routine), while the
22310 BindingFlags.NonPublic just controls whether private/protected
22311 will be allowed. This fixes the problem part of the problem of
22312 private properties being allowed to be used in derived classes.
22314 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22315 so we can call the children DoResolveLValue method (this will
22316 properly signal errors on lvalue assignments to base properties)
22318 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22319 getter are null, and we have a property info, we know that this
22320 happened because the lookup failed, so we report an error 122 for
22321 protection level violation.
22323 We also silently return if setter and getter are null in the
22324 resolve functions, this condition only happens if we have flagged
22325 the error before. This is the other half of the problem.
22327 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22328 not have accessibility information, that is why we were returning
22329 true in the filter function in typemanager.cs.
22331 To properly report 122 (property is inaccessible because of its
22332 protection level) correctly, we report this error in ResolveAccess
22333 by failing if both the setter and the getter are lacking (ie, the
22336 DoResolve and DoLResolve have been modified to check for both
22337 setter/getter being null and returning silently, the reason being
22338 that I did not want to put the knowledge about this error in upper
22341 int old = Report.Errors;
22342 x = new PropertyExpr (...);
22343 if (old != Report.Errors)
22348 So the property expr is returned, but it is invalid, so the error
22349 will be flagged during the resolve process.
22351 * class.cs: Remove InheritablePropertySignatureCompare from the
22352 class, as we no longer depend on the property signature to compute
22353 whether it is possible to implement a method or not.
22355 The reason is that calling PropertyInfo.GetGetMethod will return
22356 null (in .NET, in Mono it works, and we should change this), in
22357 cases where the Get Method does not exist in that particular
22362 class X { public virtual int A { get { return 1; } } }
22364 class Z : Y { public override int A { get { return 2; } } }
22366 Would fail in Z because the parent (Y) would not have the property
22367 defined. So we avoid this completely now (because the alternative
22368 fix was ugly and slow), and we now depend exclusively on the
22371 (PropertyBase.CheckBase): Use a method-base mechanism to find our
22372 reference method, instead of using the property.
22374 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22375 routines are gone now.
22377 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22378 names, they were incorrectly named.
22380 * cs-tokenizer.cs: Return are more gentle token on failure.
22382 * pending.cs (PendingImplementation.InterfaceMethod): This routine
22383 had an out-of-sync index variable, which caused it to remove from
22384 the list of pending methods the wrong method sometimes.
22386 2002-10-22 Miguel de Icaza <miguel@ximian.com>
22388 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22389 CanWrite, because those refer to this particular instance of the
22390 property, and do not take into account the fact that we can
22391 override single members of a property.
22393 Constructor requires an EmitContext. The resolution process does
22394 not happen here, but we need to compute the accessors before,
22395 because the resolution does not always happen for properties.
22397 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22398 subclass, before we did not update this flag, but we did update
22401 (GetAccessors): Drop this routine, as it did not work in the
22402 presence of partially overwritten set/get methods.
22404 Notice that this broke the cs1540 detection, but that will require
22407 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22411 * driver.cs: issue a warning instead of an error if we don't support
22412 debugging for the platform. Also ignore a couple of errors that may
22413 arise when trying to write the symbols. Undo my previous patch.
22415 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22417 * driver.cs: ignore /debug switch except for Unix platforms.
22419 2002-10-23 Nick Drochak <ndrochak@gol.com>
22421 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22423 2002-10-21 Miguel de Icaza <miguel@ximian.com>
22425 * driver.cs: Do not make mcs-debug conditional, so we do not break
22426 builds that use it.
22428 * statement.cs (UsageVector.MergeChildren): I would like Martin to
22429 review this patch. But basically after all the children variables
22430 have been merged, the value of "Breaks" was not being set to
22431 new_breaks for Switch blocks. I think that it should be set after
22432 it has executed. Currently I set this to the value of new_breaks,
22433 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22434 conservative, but I do not understand this code very well.
22436 I did not break anything in the build, so that is good ;-)
22438 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22440 2002-10-20 Mark Crichton <crichton@gimp.org>
22442 * cfold.cs: Fixed compile blocker. Really fixed it this time.
22444 2002-10-20 Nick Drochak <ndrochak@gol.com>
22446 * cfold.cs: Fixed compile blocker.
22448 2002-10-20 Miguel de Icaza <miguel@ximian.com>
22450 * driver.cs: I was chekcing the key, not the file.
22452 2002-10-19 Ravi Pratap <ravi@ximian.com>
22454 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22455 message that we were generating - we just need to silently return
22458 2002-10-19 Miguel de Icaza <miguel@ximian.com>
22460 * class.cs (Event.Define): Change my previous commit, as this
22461 breaks the debugger. This is a temporary hack, as it seems like
22462 the compiler is generating events incorrectly to begin with.
22464 * expression.cs (Binary.ResolveOperator): Added support for
22465 "U operator - (E x, E y)"
22467 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22470 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22471 init-only variables, but this path did not take into account that
22472 there might be also instance readonly variables. Correct this
22475 This fixes bug 32253
22477 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22480 * driver.cs: Change the extension for modules to `netmodule'
22482 * cs-parser.jay: Improved slightly the location tracking for
22483 the debugger symbols.
22485 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22486 modifiers that were specified instead of the hardcoded value
22487 (FamAndAssem). This was basically ignoring the static modifier,
22488 and others. Fixes 32429.
22490 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22491 fixed a bug in the process (32476)
22493 * expression.cs (ArrayAccess.EmitAssign): Patch from
22494 hwang_rob@yahoo.ca that fixes bug 31834.3
22496 2002-10-18 Miguel de Icaza <miguel@ximian.com>
22498 * driver.cs: Make the module extension .netmodule.
22500 2002-10-16 Miguel de Icaza <miguel@ximian.com>
22502 * driver.cs: Report an error if the resource file is not found
22503 instead of crashing.
22505 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22506 false, like Emit does.
22508 2002-10-16 Nick Drochak <ndrochak@gol.com>
22510 * typemanager.cs: Remove unused private member. Also reported mcs
22511 bug to report this as a warning like csc.
22513 2002-10-15 Martin Baulig <martin@gnome.org>
22515 * statement.cs (Statement.Emit): Made this a virtual method; emits
22516 the line number info and calls DoEmit().
22517 (Statement.DoEmit): New protected abstract method, formerly knows
22518 as Statement.Emit().
22520 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22522 2002-10-11 Miguel de Icaza <miguel@ximian.com>
22524 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22525 have fixed a remaining problem: not every AddXXXX was adding a
22526 fully qualified name.
22528 Now everyone registers a fully qualified name in the DeclSpace as
22529 being defined instead of the partial name.
22531 Downsides: we are slower than we need to be due to the excess
22532 copies and the names being registered this way.
22534 The reason for this is that we currently depend (on the corlib
22535 bootstrap for instance) that types are fully qualified, because
22536 we dump all the types in the namespace, and we should really have
22537 types inserted into the proper namespace, so we can only store the
22538 basenames in the defined_names array.
22540 2002-10-10 Martin Baulig <martin@gnome.org>
22542 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22543 from bug #31834, see the bug report for a testcase which is
22546 2002-10-10 Martin Baulig <martin@gnome.org>
22548 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22549 flow analysis code for this.
22551 * statement.cs (Do, While, For): Tell the flow analysis code about
22553 (FlowBranching.UsageVector): Added support for infinite loops.
22554 (Block.Resolve): Moved the dead code elimination here and use flow
22557 2002-10-09 Miguel de Icaza <miguel@ximian.com>
22559 * class.cs (Field.Define): Catch cycles on struct type
22562 * typemanager.cs (IsUnmanagedtype): Do not recursively check
22563 fields if the fields are static. We only need to check instance
22566 * expression.cs (As.DoResolve): Test for reference type.
22568 * statement.cs (Using.ResolveExpression): Use
22569 ConvertImplicitRequired, not ConvertImplicit which reports an
22571 (Using.ResolveLocalVariableDecls): ditto.
22573 * expression.cs (Binary.ResolveOperator): Report errors in a few
22574 places where we had to.
22576 * typemanager.cs (IsUnmanagedtype): Finish implementation.
22578 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22580 * expression.cs: Use StoreFromPtr instead of extracting the type
22581 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22583 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22584 an enumeration value to a System.Enum, but System.Enum is not a
22585 value type, but an class type, so we need to box.
22587 (Expression.ConvertExplicit): One codepath could return
22588 errors but not flag them. Fix this. Fixes #31853
22590 * parameter.cs (Resolve): Do not allow void as a parameter type.
22592 2002-10-06 Martin Baulig <martin@gnome.org>
22594 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22595 if it's a class type and not a struct. Fixes #31815.
22597 2002-10-06 Martin Baulig <martin@gnome.org>
22599 * statement.cs: Reworked the flow analysis code a bit to make it
22600 usable for dead code elimination.
22602 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22604 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22606 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22608 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22609 to fix the test 165, will investigate deeper.
22611 2002-10-04 Martin Baulig <martin@gnome.org>
22613 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22614 finally blocks actually work.
22615 (Try.Resolve): We don't need to create a sibling for `finally' if
22616 there is no finally block.
22618 2002-10-04 Martin Baulig <martin@gnome.org>
22620 * class.cs (Constructor.Define): The default accessibility for a
22621 non-default constructor is private, not public.
22623 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22625 * class.cs (Constructor): Make AllowedModifiers public, add
22628 * cs-parser.jay: Perform the modifiers test here, as the
22629 constructor for the Constructor class usually receives a zero
22630 because of the way we create it (first we create, later we
22631 customize, and we were never checking the modifiers).
22633 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22634 is a version of LookupTypeReflection that includes the type-name
22635 cache. This can be used as a fast path for functions that know
22636 the fully qualified name and are only calling into *.GetType() to
22637 obtain a composed type.
22639 This is also used by TypeManager.LookupType during its type
22642 (LookupType): We now also track the real type name, as sometimes
22643 we can get a quey for the real type name from things like
22644 ComposedCast. This fixes bug 31422.
22646 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22647 complete type fullname, it does not have to go through the type
22648 resolution system to obtain the composed version of the type (for
22649 obtaining arrays or pointers).
22651 (Conditional.Emit): Use the EmitBoolExpression to
22652 generate nicer code, as requested by Paolo.
22654 (ArrayCreation.CheckIndices): Use the patch from
22655 hwang_rob@yahoo.ca to validate the array initializers.
22657 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22659 * class.cs (ConstructorInitializer.Emit): simplify code by using
22660 Invocation.EmitCall, and at the same time, fix the bugs in calling
22661 parent constructors that took variable arguments.
22663 * ecore.cs (Expression.ConvertNumericExplicit,
22664 Expression.ImplicitNumericConversion): Remove the code that
22665 manually wrapped decimal (InternalTypeConstructor call is now gone
22668 * expression.cs (Cast.TryReduce): Also handle decimal types when
22669 trying to perform a constant fold on the type.
22671 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22673 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22674 that only turned off an error report, and did nothing else.
22676 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22678 * driver.cs: Handle and ignore /fullpaths
22680 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22682 * expression.cs (Binary.ResolveOperator): Catch the case where
22683 DoNumericPromotions returns true,
22685 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22687 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22689 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22692 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22694 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22695 conversion exists, but it is also required that the conversion be
22696 performed. This manifested in "(Type64Enum) 2".
22698 * class.cs (TypeManager.AddMethod): The fix is not to change
22699 AddEnum, because that one was using a fully qualified name (every
22700 DeclSpace derivative does), but to change the AddMethod routine
22701 that was using an un-namespaced name. This now correctly reports
22702 the duplicated name.
22704 Revert patch until I can properly fix it. The issue
22705 is that we have a shared Type space across all namespaces
22706 currently, which is wrong.
22708 Options include making the Namespace a DeclSpace, and merge
22709 current_namespace/current_container in the parser.
22711 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22713 * cs-parser.jay: Improve error reporting when we get a different
22714 kind of expression in local_variable_type and
22715 local_variable_pointer_type.
22717 Propagate this to avoid missleading errors being reported.
22719 * ecore.cs (ImplicitReferenceConversion): treat
22720 TypeManager.value_type as a target just like object_type. As
22725 Is valid, and needs to result in the int 1 being boxed before it
22726 is assigned to the value type v.
22728 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22729 to validate the enumeration name.
22731 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22732 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22733 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22735 * ecore.cs (TryImplicitIntConversion): When doing an
22736 implicit-enumeration-conversion, check if the type is 64-bits and
22737 perform a conversion before passing to EnumConstant.
22739 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22741 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22742 report ambiguous type references. Unlike the MS version, we
22743 report what the ambiguity is. Innovation at work ;-)
22745 (DeclSpace.FindType): Require a location argument to
22746 display when we display an ambiguous error.
22748 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22750 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22752 * expression.cs (EmitDynamicInitializers): Apply patch from
22753 hwang_rob@yahoo.ca that fixes the order in which we emit our
22756 2002-09-21 Martin Baulig <martin@gnome.org>
22758 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22759 delegate takes no arguments.
22761 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22763 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22766 * expression.cs: Extract the underlying type.
22768 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22770 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22772 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22774 * class.cs (TypeContainer.DefineType): We can not use the nice
22775 PackingSize with the size set to 1 DefineType method, because it
22776 will not allow us to define the interfaces that the struct
22779 This completes the fixing of bug 27287
22781 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22782 means also structs. This fixes part of the problem.
22783 (Expresion.ImplicitReferenceConversionExists): ditto.
22785 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22786 error if there were no errors reported during the type lookup
22787 process, to avoid duplicates or redundant errors. Without this
22788 you would get an ambiguous errors plus a type not found. We have
22789 beaten the user enough with the first error.
22791 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22794 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22795 during the resolution process, stop the lookup, this avoids
22796 repeated error reports (same error twice).
22798 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22800 * typemanager.cs (LookupType): Redo the type lookup code to match
22801 the needs of System.Reflection.
22803 The issue is that System.Reflection requires references to nested
22804 types to begin with a "+" sign instead of a dot. So toplevel
22805 types look like: "NameSpace.TopLevelClass", and nested ones look
22806 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22809 2002-09-19 Martin Baulig <martin@gnome.org>
22811 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22812 says that a method always returns or always throws an exception,
22813 don't report the CS0161.
22815 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22816 set `Returns = new_returns'.
22818 2002-09-19 Martin Baulig <martin@gnome.org>
22820 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22821 to an enum constant, check for a CS0176.
22823 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22825 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22826 for operators that must be in pairs and report errors.
22828 * ecore.cs (SimpleName.DoResolveType): During the initial type
22829 resolution process, when we define types recursively, we must
22830 check first for types in our current scope before we perform
22831 lookups in the enclosing scopes.
22833 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22835 (Invocation.VerifyArgumentsCompat): Call
22836 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22837 I thought we were supposed to always call this, but there are a
22838 few places in the code where we dont do it.
22840 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22842 * driver.cs: Add support in -linkres and -resource to specify the
22843 name of the identifier.
22845 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22847 * ecore.cs (StandardConversionExists): Sync with the conversion
22848 code: allow anything-* to void* conversions.
22850 (FindMostSpecificSource): Use an Expression argument
22851 instead of a Type, because we might be handed over a Literal which
22852 gets a few more implicit conversions that plain types do not. So
22853 this information was being lost.
22855 Also, we drop the temporary type-holder expression when not
22858 2002-09-17 Martin Baulig <martin@gnome.org>
22860 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22861 this is an explicit interface implementation.
22863 2002-09-17 Martin Baulig <martin@gnome.org>
22865 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22866 different `IndexerName' attributes.
22868 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22869 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22870 virtual CommonResolve().
22872 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22874 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22875 and convert that to the UnderlyingType.
22877 * statement.cs (Foreach.Resolve): Indexers are just like variables
22878 or PropertyAccesses.
22880 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22881 inside quoted strings, we were not doing this before.
22883 2002-09-16 Martin Baulig <martin@gnome.org>
22885 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22886 resolve it. This is needed for the definite assignment check of the
22887 instance expression, fixes bug #29846.
22888 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22890 2002-09-16 Nick Drochak <ndrochak@gol.com>
22892 * parameter.cs: Fix compile error. Cannot reference static member
22893 from an instance object. Is this an mcs bug?
22895 2002-09-14 Martin Baulig <martin@gnome.org>
22897 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22898 multiple times. Fixes bug #30295, added test-166.cs.
22900 2002-09-14 Martin Baulig <martin@gnome.org>
22902 * statement.cs (Block.Emit): Don't emit unreachable code.
22903 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22904 `break' statements.
22905 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22907 2002-09-14 Martin Baulig <martin@gnome.org>
22909 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22912 2002-09-14 Martin Baulig <martin@gnome.org>
22914 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22915 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22916 be false on the ms runtime.
22918 2002-09-13 Martin Baulig <martin@gnome.org>
22920 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22921 the CS0038 error message.
22923 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22925 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22926 constant inside, return it.
22928 2002-09-12 Martin Baulig <martin@gnome.org>
22930 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22931 implicit conversion can be done between enum types.
22933 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22934 check whether an implicit conversion to the current enum's UnderlyingType
22935 exists and report an error if not.
22937 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22938 without debugging support.
22940 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22941 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22943 2002-09-12 Martin Baulig <martin@gnome.org>
22945 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22947 * ecore.cs (IMemberExpr.DeclaringType): New property.
22948 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22949 nonstatic member of an outer type (CS0038).
22951 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22953 * driver.cs: Activate the using-error detector at warning level
22954 4 (at least for MS-compatible APIs).
22956 * namespace.cs (VerifyUsing): Small buglett fix.
22958 * pending.cs (PendingImplementation): pass the container pointer.
22960 * interface.cs (GetMethods): Allow for recursive definition. Long
22961 term, I would like to move every type to support recursive
22962 definitions, not the current ordering mechanism that we have right
22965 The situation is this: Attributes are handled before interfaces,
22966 so we can apply attributes to interfaces. But some attributes
22967 implement interfaces, we will now handle the simple cases
22968 (recursive definitions will just get an error).
22970 * parameter.cs: Only invalidate types at the end if we fail to
22973 2002-09-09 Martin Baulig <martin@gnome.org>
22975 * ecore.cs (PropertyExpr.Emit): Also check for
22976 TypeManager.system_int_array_get_length so this'll also work when
22977 compiling corlib. Fixes #30003.
22979 2002-09-09 Martin Baulig <martin@gnome.org>
22981 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22982 and throw an exception if we can't get the type's size. Fixed #30040,
22985 2002-09-09 Martin Baulig <martin@gnome.org>
22987 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22989 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22990 context. Fixes bug #30027.
22992 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22993 virtual functions. Fixes bug #30043, added test-164.cs.
22995 2002-09-08 Ravi Pratap <ravi@ximian.com>
22997 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22999 2002-09-08 Nick Drochak <ndrochak@gol.com>
23001 * driver.cs: Use an object to get the windows codepage since it's not a
23004 2002-09-08 Miguel de Icaza <miguel@ximian.com>
23006 * statement.cs (For.Emit): for infinite loops (test == null)
23007 return whether there is a break inside, not always "true".
23009 * namespace.cs (UsingEntry): New struct to hold the name of the
23010 using definition, the location where it is defined, and whether it
23011 has been used in a successful type lookup.
23013 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23018 2002-09-06 Ravi Pratap <ravi@ximian.com>
23020 * attribute.cs : Fix incorrect code which relied on catching
23021 a NullReferenceException to detect a null being passed in
23022 where an object was expected.
23024 2002-09-06 Miguel de Icaza <miguel@ximian.com>
23026 * statement.cs (Try): flag the catch variable as assigned
23028 * expression.cs (Cast): Simplified by using ResolveType instead of
23029 manually resolving.
23031 * statement.cs (Catch): Fix bug by using ResolveType.
23033 2002-09-06 Ravi Pratap <ravi@ximian.com>
23035 * expression.cs (BetterConversion): Special case for when we have
23036 a NullLiteral as the argument and we have to choose between string
23037 and object types - we choose string the way csc does.
23039 * attribute.cs (Attribute.Resolve): Catch the
23040 NullReferenceException and report error #182 since the Mono
23041 runtime no more has the bug and having this exception raised means
23042 we tried to select a constructor which takes an object and is
23045 2002-09-05 Ravi Pratap <ravi@ximian.com>
23047 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23048 message (1502, 1503) when we can't locate a method after overload
23049 resolution. This is much more informative and closes the bug
23052 * interface.cs (PopulateMethod): Return if there are no argument
23053 types. Fixes a NullReferenceException bug.
23055 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23056 expressions too. Previously we were checking only in one place for
23057 positional arguments leaving out named arguments.
23059 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23060 type to the enum type is not allowed. Remove code corresponding to
23063 (ConvertNumericExplicit): Allow explicit conversions from
23064 the underlying type to enum type. This precisely follows the spec
23065 and closes a bug filed by Gonzalo.
23067 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23070 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23072 2002-09-03 Miguel de Icaza <miguel@ximian.com>
23074 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23075 it was important that we stored the right value after the
23076 reduction in `converted'.
23078 2002-09-04 Martin Baulig <martin@gnome.org>
23080 * location.cs (Location.SymbolDocument): Use full pathnames for the
23083 2002-08-30 Miguel de Icaza <miguel@ximian.com>
23085 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23086 of the expression resolve mechanism, because that will catch the
23087 SimpleName error failures.
23089 (Conditional): If we can not resolve the
23090 expression, return, do not crash.
23092 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23095 (location): display token name instead of its number.
23097 2002-08-28 Martin Baulig <martin@gnome.org>
23099 * expression.cs (Binary.ResolveOperator): Don't silently return
23100 but return an error if an operator cannot be applied between two
23103 2002-08-28 Martin Baulig <martin@gnome.org>
23105 * class.cs (Constructor.Define): Set the permission attributes
23106 correctly instead of making all constructors public.
23108 2002-08-28 Martin Baulig <martin@gnome.org>
23110 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23111 for private members before reporting a CS0103; if we find anything,
23114 2002-08-28 Martin Baulig <martin@gnome.org>
23116 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23117 to check whether `closure_start_type == closure_invocation_type',
23118 we also need to check whether `m.DeclaringType == closure_invocation_type'
23119 before bypassing the permission checks. We might be accessing
23120 protected/private members from the base class.
23121 (TypeManager.RealMemberLookup): Only set private_ok if private
23122 members were requested via BindingFlags.NonPublic.
23124 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23126 * expression.cs (MemberAccess.ResolveMemberAccess): Set
23127 MethodGroupExpr.IsExplicitImpl if appropriate.
23128 (Invocation.DoResolve): Don't report the CS0120 for explicit
23129 interface implementations.
23131 2002-08-27 Martin Baulig <martin@gnome.org>
23133 * expression.cs (Invocation.DoResolve): If this is a static
23134 method and we don't have an InstanceExpression, we must report
23137 2002-08-25 Martin Baulig <martin@gnome.org>
23139 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23140 `==' between a valuetype and an object.
23142 2002-08-25 Miguel de Icaza <miguel@ximian.com>
23144 * ecore.cs (TypeExpr): Provide a ToString method.
23146 2002-08-24 Martin Baulig <martin@gnome.org>
23148 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23149 now called proggie.dbg and it's a binary file.
23151 2002-08-23 Martin Baulig <martin@gnome.org>
23153 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23155 2002-08-23 Martin Baulig <martin@gnome.org>
23157 * struct.cs (MyStructInfo.ctor): Make this work with empty
23158 structs; it's not allowed to use foreach() on null.
23160 2002-08-23 Martin Baulig <martin@gnome.org>
23162 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23163 writer the full pathname of the generated assembly.
23165 2002-08-23 Martin Baulig <martin@gnome.org>
23167 * statements.cs (FlowBranching.UsageVector.MergeChildren):
23168 A `finally' block never returns or breaks; improved handling of
23171 2002-08-23 Martin Baulig <martin@gnome.org>
23173 * statement.cs (Throw.Resolve): Allow `throw null'.
23175 2002-08-23 Martin Baulig <martin@gnome.org>
23177 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23178 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23179 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
23180 MemberLookup would return a wrong event if this is an explicit
23181 interface implementation and the class has an event with the same
23184 2002-08-23 Martin Baulig <martin@gnome.org>
23186 * statement.cs (Block.AddChildVariableNames): New public method.
23187 (Block.AddChildVariableName): Likewise.
23188 (Block.IsVariableNameUsedInChildBlock): Likewise.
23189 (Block.AddVariable): Check whether a variable name has already
23190 been used in a child block.
23192 * cs-parser.jay (declare_local_variables): Mark all variable names
23193 from the current block as being used in a child block in the
23196 2002-08-23 Martin Baulig <martin@gnome.org>
23198 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23199 find the symbol writer.
23201 * driver.cs: csc also allows the arguments to /define being
23202 separated by commas, not only by semicolons.
23204 2002-08-23 Martin Baulig <martin@gnome.org>
23206 * interface.cs (Interface.GetMembers): Added static check for events.
23208 2002-08-15 Martin Baulig <martin@gnome.org>
23210 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23211 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23213 * ecore.cs (Expression.MemberLookup): Added documentation and explained
23214 why the MethodData.EmitDestructor() change was necessary.
23216 2002-08-20 Martin Baulig <martin@gnome.org>
23218 * class.cs (TypeContainer.FindMembers): Added static check for events.
23220 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23222 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23223 use Type.GetEvents(), not Type.FindMembers().
23225 2002-08-20 Martin Baulig <martin@gnome.org>
23227 * decl.cs (MemberCache): Added a special method cache which will
23228 be used for method-only searched. This ensures that a method
23229 search will return a MethodInfo with the correct ReflectedType for
23232 2002-08-20 Martin Baulig <martin@gnome.org>
23234 * decl.cs (DeclSpace.FindMembers): Made this public.
23236 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23238 * delegate.cs: fixed build on windows.
23239 [FIXME: Filed as bug #29150: MCS must report these errors.]
23241 2002-08-19 Ravi Pratap <ravi@ximian.com>
23243 * ecore.cs (StandardConversionExists): Return a false
23244 if we are trying to convert the void type to anything else
23245 since that is not allowed.
23247 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23248 we flag error 70 in the event an event is trying to be accessed
23249 directly from outside the declaring type.
23251 2002-08-20 Martin Baulig <martin@gnome.org>
23253 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23254 MemberCache from typemanager.cs to decl.cs.
23256 2002-08-19 Martin Baulig <martin@gnome.org>
23258 * class.cs (TypeContainer): Implement IMemberContainer.
23259 (TypeContainer.DefineMembers): Create the MemberCache.
23260 (TypeContainer.FindMembers): Do better BindingFlags checking; only
23261 return public members if BindingFlags.Public was given, check
23262 whether members are static.
23264 2002-08-16 Martin Baulig <martin@gnome.org>
23266 * decl.cs (DeclSpace.Define): Splitted this in Define and
23267 DefineMembers. DefineMembers is called first and initializes the
23270 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
23271 DefineMembers() on all our DeclSpaces.
23273 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23274 but call DefineMembers() on all nested interfaces. We call their
23275 Define() in our new Define() function.
23277 * interface.cs (Interface): Implement IMemberContainer.
23278 (Interface.Define): Moved all code except the attribute stuf to
23280 (Interface.DefineMembers): Initialize the member cache.
23282 * typemanager.cs (IMemberFinder): Removed this interface, we don't
23283 need this anymore since we can use MemberCache.FindMembers directly.
23285 2002-08-19 Martin Baulig <martin@gnome.org>
23287 * typemanager.cs (MemberCache): When creating the cache for an
23288 interface type, add all inherited members.
23289 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23290 to `out bool used_cache' and documented it.
23291 (TypeManager.MemberLookup): If we already used the cache in the first
23292 iteration, we don't need to do the interfaces check.
23294 2002-08-19 Martin Baulig <martin@gnome.org>
23296 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
23297 here from IMemberFinder and don't implement this interface anymore.
23298 (DeclSpace.MemberCache): Moved here from IMemberFinder.
23300 * typemanager.cs (IMemberFinder): This interface is now only used by
23301 classes which actually support the member cache.
23302 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23303 since we only put DeclSpaces into this Hashtable.
23304 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23305 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23307 2002-08-16 Martin Baulig <martin@gnome.org>
23309 * typemanager.cs (ICachingMemberFinder): Removed.
23310 (IMemberFinder.MemberCache): New property.
23311 (TypeManager.FindMembers): Merged this with RealFindMembers().
23312 This function will never be called from TypeManager.MemberLookup()
23313 so we can't use the cache here, just the IMemberFinder.
23314 (TypeManager.MemberLookup_FindMembers): Check whether the
23315 IMemberFinder has a MemberCache and call the cache's FindMembers
23317 (MemberCache): Rewrote larger parts of this yet another time and
23318 cleaned it up a bit.
23320 2002-08-15 Miguel de Icaza <miguel@ximian.com>
23322 * driver.cs (LoadArgs): Support quoting.
23324 (Usage): Show the CSC-like command line arguments.
23326 Improved a few error messages.
23328 2002-08-15 Martin Baulig <martin@gnome.org>
23330 * typemanager.cs (IMemberContainer.Type): New property.
23331 (IMemberContainer.IsInterface): New property.
23333 The following changes are conditional to BROKEN_RUNTIME, which is
23334 defined at the top of the file.
23336 * typemanager.cs (MemberCache.MemberCache): Don't add the base
23337 class'es members, but add all members from TypeHandle.ObjectType
23338 if we're an interface.
23339 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23340 is the current type.
23341 (MemberCache.CacheEntry.Container): Removed this field.
23342 (TypeHandle.GetMembers): Include inherited members.
23344 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23346 * typemanager.cs: fixed compilation and added a comment on a field that
23349 2002-08-15 Martin Baulig <martin@gnome.org>
23351 * class.cs (ConstructorInitializer.Resolve): In the
23352 Expression.MemberLookup call, use the queried_type as
23355 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23356 declared' attribute, it's always true.
23357 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23358 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23359 temporary wrapper for FindMembers which tells MemberLookup whether
23360 members from the base classes are included in the return value.
23361 This will go away soon.
23362 (TypeManager.MemberLookup): Use this temporary hack here; once the
23363 new MemberCache is completed, we don't need to do the DeclaredOnly
23364 looping here anymore since the MemberCache will take care of this.
23365 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23366 (MemberCache): When creating the MemberCache for a class, get
23367 members from the current class and all its base classes.
23368 (MemberCache.CacheEntry.Container): New field. This is a
23369 temporary hack until the Mono runtime is fixed to distinguish
23370 between ReflectedType and DeclaringType. It allows us to use MCS
23371 with both the MS runtime and the unfixed Mono runtime without
23372 problems and without accecting performance.
23373 (MemberCache.SearchMembers): The DeclaredOnly looping from
23374 TypeManager.MemberLookup is now done here.
23376 2002-08-14 Martin Baulig <martin@gnome.org>
23378 * statement.cs (MyStructInfo.MyStructInfo): Don't call
23379 Type.GetFields on dynamic types but get the fields from the
23380 corresponding TypeContainer.
23381 (MyStructInfo.GetStructInfo): Added check for enum types.
23383 * typemanager.cs (MemberList.IsSynchronized): Implemented.
23384 (MemberList.SyncRoot): Implemented.
23385 (TypeManager.FilterWithClosure): No need to check permissions if
23386 closure_start_type == closure_invocation_type, don't crash if
23387 closure_invocation_type is null.
23389 2002-08-13 Martin Baulig <martin@gnome.org>
23391 Rewrote TypeContainer.FindMembers to use a member cache. This
23392 gives us a speed increase of about 35% for the self-hosting MCS
23393 build and of about 15-20% for the class libs (both on GNU/Linux).
23395 * report.cs (Timer): New class to get enhanced profiling. This
23396 whole class is "TIMER" conditional since it remarkably slows down
23399 * class.cs (MemberList): New class. This is an IList wrapper
23400 which we're now using instead of passing MemberInfo[]'s around to
23401 avoid copying this array unnecessarily.
23402 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23403 (ICachingMemberFinder, IMemberContainer): New interface.
23404 (TypeManager.FilterWithClosure): If `criteria' is null, the name
23405 has already been checked, otherwise use it for the name comparision.
23406 (TypeManager.FindMembers): Renamed to RealMemberFinder and
23407 provided wrapper which tries to use ICachingMemberFinder.FindMembers
23408 if possible. Returns a MemberList, not a MemberInfo [].
23409 (TypeHandle): New class, implements IMemberContainer. We create
23410 one instance of this class per type, it contains a MemberCache
23411 which is used to do the member lookups.
23412 (MemberCache): New class. Each instance of this class contains
23413 all members of a type and a name-based hash table.
23414 (MemberCache.FindMembers): This is our new member lookup
23415 function. First, it looks up all members of the requested name in
23416 the hash table. Then, it walks this list and sorts out all
23417 applicable members and returns them.
23419 2002-08-13 Martin Baulig <martin@gnome.org>
23421 In addition to a nice code cleanup, this gives us a performance
23422 increase of about 1.4% on GNU/Linux - not much, but it's already
23423 half a second for the self-hosting MCS compilation.
23425 * typemanager.cs (IMemberFinder): New interface. It is used by
23426 TypeManager.FindMembers to call FindMembers on a TypeContainer,
23427 Enum, Delegate or Interface.
23428 (TypeManager.finder_to_member_finder): New PtrHashtable.
23429 (TypeManager.finder_to_container): Removed.
23430 (TypeManager.finder_to_delegate): Removed.
23431 (TypeManager.finder_to_interface): Removed.
23432 (TypeManager.finder_to_enum): Removed.
23434 * interface.cs (Interface): Implement IMemberFinder.
23436 * delegate.cs (Delegate): Implement IMemberFinder.
23438 * enum.cs (Enum): Implement IMemberFinder.
23440 * class.cs (TypeContainer): Implement IMemberFinder.
23442 2002-08-12 Martin Baulig <martin@gnome.org>
23444 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23446 2002-08-12 Martin Baulig <martin@gnome.org>
23448 * ecore.cs (ITypeExpression): New interface for expressions which
23450 (TypeExpression): Renamed to TypeLookupExpression.
23451 (Expression.DoResolve): If we're doing a types-only lookup, the
23452 expression must implement the ITypeExpression interface and we
23453 call DoResolveType() on it.
23454 (SimpleName): Implement the new ITypeExpression interface.
23455 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23456 hack, the situation that we're only looking up types can't happen
23457 anymore when this method is called. Moved the type lookup code to
23458 DoResolveType() and call it.
23459 (SimpleName.DoResolveType): This ITypeExpression interface method
23460 is now doing the types-only lookup.
23461 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23462 (ResolveFlags): Added MaskExprClass.
23464 * expression.cs (MemberAccess): Implement the ITypeExpression
23466 (MemberAccess.DoResolve): Added support for a types-only lookup
23467 when we're called via ITypeExpression.DoResolveType().
23468 (ComposedCast): Implement the ITypeExpression interface.
23470 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
23471 Expression.Resolve() with ResolveFlags.Type instead.
23473 2002-08-12 Martin Baulig <martin@gnome.org>
23475 * interface.cs (Interface.Define): Apply attributes.
23477 * attribute.cs (Attribute.ApplyAttributes): Added support for
23478 interface attributes.
23480 2002-08-11 Martin Baulig <martin@gnome.org>
23482 * statement.cs (Block.Emit): Only check the "this" variable if we
23483 do not always throw an exception.
23485 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23486 whether the property has a set accessor.
23488 2002-08-11 Martin Baulig <martin@gnome.org>
23490 Added control flow analysis support for structs.
23492 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23493 with control flow analysis turned off.
23494 (IVariable): New interface.
23495 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23496 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23497 (FieldExpr.DoResolve): Resolve the instance expression with flow
23498 analysis turned off and do the definite assignment check after the
23499 resolving when we know what the expression will resolve to.
23501 * expression.cs (LocalVariableReference, ParameterReference):
23502 Implement the new IVariable interface, only call the flow analysis
23503 code if ec.DoFlowAnalysis is true.
23504 (This): Added constructor which takes a Block argument. Implement
23505 the new IVariable interface.
23506 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23507 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23508 This does the definite assignment checks for struct members.
23510 * class.cs (Constructor.Emit): If this is a non-static `struct'
23511 constructor which doesn't have any initializer, call
23512 Block.AddThisVariable() to tell the flow analysis code that all
23513 struct elements must be initialized before control returns from
23516 * statement.cs (MyStructInfo): New public class.
23517 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23518 argument to this indexer. If non-zero, check an individual struct
23519 member, not the whole struct.
23520 (FlowBranching.CheckOutParameters): Check struct members.
23521 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23522 overloaded versions of these methods which take an additional
23523 `int field_idx' argument to check struct members.
23524 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23525 overloaded versions of these methods which take an additional
23526 `string field_name' argument to check struct member.s
23527 (VariableInfo): Implement the IVariable interface.
23528 (VariableInfo.StructInfo): New public property. Returns the
23529 MyStructInfo instance of the variable if it's a struct or null.
23530 (Block.AddThisVariable): New public method. This is called from
23531 Constructor.Emit() for non-static `struct' constructor which do
23532 not have any initializer. It creates a special variable for the
23533 "this" instance variable which will be checked by the flow
23534 analysis code to ensure that all of the struct's fields are
23535 initialized before control returns from the constructor.
23536 (UsageVector): Added support for struct members. If a
23537 variable/parameter is a struct with N members, we reserve a slot
23538 in the usage vector for each member. A struct is considered fully
23539 initialized if either the struct itself (slot 0) or all its
23540 members are initialized.
23542 2002-08-08 Martin Baulig <martin@gnome.org>
23544 * driver.cs (Driver.MainDriver): Only report an error CS5001
23545 if there were no compilation errors.
23547 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23548 `UnsafeContext' property to determine whether the parent is in
23549 unsafe context rather than checking the parent's ModFlags:
23550 classes nested in an unsafe class are unsafe as well.
23552 2002-08-08 Martin Baulig <martin@gnome.org>
23554 * statement.cs (UsageVector.MergeChildren): Distinguish between
23555 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23556 we return. Added test17() and test18() to test-154.cs.
23558 2002-08-08 Martin Baulig <martin@gnome.org>
23560 * typemanager.cs (TypeManager.FilterWithClosure): If we have
23561 Family access, make sure the invoking type isn't a subclass of the
23562 queried type (that'd be a CS1540).
23564 * ecore.cs (Expression.MemberLookup): Added overloaded version of
23565 this method which takes an additional `Type invocation_type'.
23567 * expression.cs (BaseAccess.DoResolve): Use the base type as
23568 invocation and query type.
23569 (MemberAccess.DoResolve): If the lookup failed and we're about to
23570 report a CS0122, try a lookup with the ec.ContainerType - if this
23571 succeeds, we must report a CS1540.
23573 2002-08-08 Martin Baulig <martin@gnome.org>
23575 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23576 (MethodGroupExpr): Implement the IMemberExpr interface.
23578 * expression (MemberAccess.ResolveMemberAccess): No need to have
23579 any special code for MethodGroupExprs anymore, they're now
23582 2002-08-08 Martin Baulig <martin@gnome.org>
23584 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23585 Family, FamANDAssem and FamORAssem permissions.
23586 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23588 2002-08-08 Martin Baulig <martin@gnome.org>
23590 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23591 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23594 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23596 * driver.cs: implemented /resource option to embed managed resources.
23598 2002-08-07 Martin Baulig <martin@gnome.org>
23600 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23601 (FieldBase.HasFieldInitializer): New public property.
23602 (FieldBase.GetInitializerExpression): New public method. Resolves and
23603 returns the field initializer and makes sure it is only resolved once.
23604 (TypeContainer.EmitFieldInitializers): Call
23605 FieldBase.GetInitializerExpression to get the initializer, this ensures
23606 that it isn't resolved multiple times.
23608 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23609 the resolving process (SimpleName/MemberLookup) that we're currently
23610 emitting a field initializer (which must not access any instance members,
23611 this is an error CS0236).
23613 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23614 argument, if the `IsFieldInitializer' flag is set, we must report and
23615 error CS0236 and not an error CS0120.
23617 2002-08-07 Martin Baulig <martin@gnome.org>
23619 * ecore.cs (IMemberExpr): New public interface.
23620 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23621 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23622 if the expression is an IMemberExpr.
23624 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23625 to be null, implicitly default to `this' if we're non-static in
23626 this case. Simplified the code a lot by using the new IMemberExpr
23627 interface. Also fixed bug #28176 here.
23629 2002-08-06 Martin Baulig <martin@gnome.org>
23631 * cs-parser.jay (SimpleLookup): Removed. We need to create
23632 ParameterReferences during semantic analysis so that we can do a
23633 type-only search when resolving Cast, TypeOf and SizeOf.
23634 (block): Pass the `current_local_parameters' to the Block's
23637 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23638 argument to the constructor.
23639 (ConstructorInitializer.Resolve): Create a temporary implicit
23640 block with the parameters.
23642 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23643 references here if we aren't doing a type-only search.
23645 * statement.cs (Block): Added constructor which takes a
23646 `Parameters parameters' argument.
23647 (Block.Parameters): New public property.
23649 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23650 to `Parameters' and made it public readonly.
23652 2002-08-06 Martin Baulig <martin@gnome.org>
23654 * ecore.cs (Expression.Warning): Made this public as well.
23656 * report.cs (Report.Debug): Print the contents of collections.
23658 2002-08-06 Martin Baulig <martin@gnome.org>
23660 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23661 used to tell Resolve() which kinds of expressions it may return.
23662 (Expression.Resolve): Added overloaded version of this method which
23663 takes a `ResolveFlags flags' argument. This can be used to tell
23664 Resolve() which kinds of expressions it may return. Reports a
23666 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23667 ResolveFlags.SimpleName.
23668 (Expression.Error118): Added overloaded version of this method which
23669 takes a `ResolveFlags flags' argument. It uses the flags to determine
23670 which kinds of expressions are allowed.
23672 * expression.cs (Argument.ResolveMethodGroup): New public method.
23673 Resolves an argument, but allows a MethodGroup to be returned.
23674 This is used when invoking a delegate.
23676 * TODO: Updated a bit.
23678 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23680 Fixed compilation with csc.
23682 * ecore.cs: Expression.Error made public. Is this correct? Should
23683 Warning be made public too?
23685 * expression.cs: use ea.Location instead of ea.loc.
23686 [FIXME: Filed as bug #28607: MCS must report these errors.]
23688 2002-08-06 Martin Baulig <martin@gnome.org>
23690 * ecore.cs (Expression.loc): Moved the location here instead of
23691 duplicating it in all derived classes.
23692 (Expression.Location): New public property.
23693 (Expression.Error, Expression.Warning): Made them non-static and
23694 removed the location argument.
23695 (Expression.Warning): Added overloaded version which takes an
23696 `int level' argument.
23697 (Expression.Error118): Make this non-static and removed the
23698 expression and location arguments.
23699 (TypeExpr): Added location argument to the constructor.
23701 * expression.cs (StaticCallExpr): Added location argument to
23703 (Indirection, PointerArithmetic): Likewise.
23704 (CheckedExpr, UnCheckedExpr): Likewise.
23705 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23706 (StringPtr): Likewise.
23709 2002-08-05 Martin Baulig <martin@gnome.org>
23711 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23713 * assign.cs (Assign.DoResolve): Check whether the source
23714 expression is a value or variable.
23716 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23717 while resolving the corresponding blocks.
23719 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23720 an error, don't silently return null.
23722 * statement.cs (Block.AddVariable): Do the error reporting here
23723 and distinguish between CS0128 and CS0136.
23724 (Block.DoResolve): Report all unused labels (warning CS0164).
23725 (LabeledStatement): Pass the location to the constructor.
23726 (LabeledStatement.HasBeenReferenced): New property.
23727 (LabeledStatement.Resolve): Set it to true here.
23729 * statement.cs (Return.Emit): Return success even after reporting
23730 a type mismatch error (CS0126 or CS0127), this is what csc does and
23731 it avoids confusing the users with any consecutive errors.
23733 2002-08-05 Martin Baulig <martin@gnome.org>
23735 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23737 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23739 * expression.cs (MemberAccess.DoResolve): Silently return if an
23740 error has already been reported.
23742 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23743 error has already been reported.
23745 2002-08-05 Martin Baulig <martin@gnome.org>
23747 * statement.cs (UsageVector): Only initialize the `parameters'
23748 vector if we actually have any "out" parameters.
23750 2002-08-05 Martin Baulig <martin@gnome.org>
23752 * expression.cs (Binary.ResolveOperator): When combining delegates,
23753 they must have the same type.
23755 2002-08-05 Martin Baulig <martin@gnome.org>
23757 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23758 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23759 work with the ms runtime and we also don't need it: if we're a
23760 PropertyBuilder and not in the `indexer_arguments' hash, then we
23761 are a property and not an indexer.
23763 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23764 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23765 since the latter one doesn't work with the ms runtime.
23767 2002-08-03 Martin Baulig <martin@gnome.org>
23769 Fixed bugs #27998 and #22735.
23771 * class.cs (Method.IsOperator): New public field.
23772 (Method.CheckBase): Report CS0111 if there's already a method
23773 with the same parameters in the current class. Report CS0508 when
23774 attempting to change the return type of an inherited method.
23775 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23776 and it's not marked abstract or extern.
23777 (PropertyBase): New abstract base class for Property and Indexer.
23778 (PropertyBase.CheckBase): Moved here from Property and made it work
23780 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23781 the same so we can reuse it there.
23782 (Property, Indexer): Derive from PropertyBase.
23783 (MethodSignature.inheritable_property_signature_filter): New delegate
23784 to find properties and indexers.
23786 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23787 argument and improved error reporting.
23789 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23790 EmptyReadOnlyParameters and made it a property.
23792 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23793 version of this method which takes a `PropertyInfo indexer'.
23794 (TypeManager.RegisterIndexer): New method.
23796 * class.cs: Added myself as author of this file :-)
23798 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23800 * class.cs: fixed compilation on windoze.
23802 2002-08-03 Martin Baulig <martin@gnome.org>
23804 * interface.cs (Interface.GetInterfaceBases): Check whether all
23805 base interfaces are at least as accessible than the current one.
23807 * class.cs (TypeContainer.GetClassBases): Check whether base types
23808 are at least as accessible than the current type.
23809 (TypeContainer.AsAccessible): Implemented and made non-static.
23810 (MemberBase.CheckParameters): Report errors if the accessibility
23813 * delegate.cs (Delegate.Delegate): The default visibility is
23814 internal for top-level types and private for nested types.
23815 (Delegate.Define): Report errors if the accessibility checks fail.
23817 * enum.cs (Enum.Enum): The default visibility is internal for
23818 top-level types and private for nested types.
23819 (Enum.DefineType): Compute the correct visibility.
23821 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23822 function which takes a `bool is_toplevel' instead of a TypeContainer.
23824 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23827 2002-08-02 Martin Baulig <martin@gnome.org>
23829 * expression.cs (LocalVariableReferenc): Added constructor which
23830 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23831 (LocalVariableReference.IsReadOnly): New property.
23832 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23833 variable is readonly, use our own readonly flag to do this; you can
23834 use the new constructor to get a writable reference to a read-only
23837 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23838 reference to the local variable.
23840 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23842 * rootcontext.cs (ResolveCore): Also include System.Exception
23844 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23845 we reach an EmptyStatement.
23847 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23850 * expression.cs (Binary.ResolveOperator): Check error result in
23853 use brtrue/brfalse directly and avoid compares to null.
23855 2002-08-02 Martin Baulig <martin@gnome.org>
23857 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23858 Fixes bug #28407, added test-155.cs.
23860 2002-08-01 Martin Baulig <martin@gnome.org>
23862 * class.cs (Event.EmitDefaultMethod): Make this work with static
23863 events. Fixes #28311, added verify-3.cs.
23865 2002-08-01 Martin Baulig <martin@gnome.org>
23867 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23868 `is_disposable' fields.
23869 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23870 `hm.is_disposable' if we're using the collection pattern.
23871 (Foreach.EmitCollectionForeach): Use the correct type for the
23872 enumerator's local variable, only emit the try/finally block if
23873 necessary (fixes #27713).
23875 2002-08-01 Martin Baulig <martin@gnome.org>
23877 * ecore.cs (Expression.report118): Renamed to Error118 and made
23880 * statement.cs (Throw.Resolve): Check whether the expression is of
23881 the correct type (CS0118) and whether the type derives from
23882 System.Exception (CS0155).
23883 (Catch.Resolve): New method. Do the type lookup here and check
23884 whether it derives from System.Exception (CS0155).
23885 (Catch.CatchType, Catch.IsGeneral): New public properties.
23887 * typemanager.cs (TypeManager.exception_type): Added.
23889 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23891 * driver.cs: Updated About function.
23893 2002-07-31 Martin Baulig <martin@gnome.org>
23895 Implemented Control Flow Analysis.
23897 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23898 (EmitContext.CurrentBranching): Added.
23899 (EmitContext.StartFlowBranching): Added.
23900 (EmitContext.EndFlowBranching): Added.
23901 (EmitContext.KillFlowBranching): Added.
23902 (EmitContext.IsVariableAssigned): Added.
23903 (EmitContext.SetVariableAssigned): Added.
23904 (EmitContext.IsParameterAssigned): Added.
23905 (EmitContext.SetParameterAssigned): Added.
23906 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23907 Added control flow analysis stuff here.
23909 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23910 resolve the expression as lvalue.
23911 (LocalVariableReference.DoResolve): Check whether the variable has
23912 already been assigned.
23913 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23914 the parameter as assigned here.
23915 (ParameterReference.DoResolve): Check whether the parameter has already
23917 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23918 expression as lvalue.
23920 * statement.cs (FlowBranching): New class for the flow analysis code.
23921 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23922 (LabeledStatement.IsDefined): New public property.
23923 (LabeledStatement.AddUsageVector): New public method to tell flow
23924 analyis that the label may be reached via a forward jump.
23925 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23927 (VariableInfo.Number): New public field. This is used by flow analysis
23928 to number all locals of a block.
23929 (Block.CountVariables): New public property. This is the number of
23930 local variables in this block (including the locals from all parent
23932 (Block.EmitMeta): Number all the variables.
23934 * statement.cs: Added flow analysis support to all classes.
23936 2002-07-31 Martin Baulig <martin@gnome.org>
23938 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23939 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23940 then use this argument.
23942 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23944 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23945 use this to specify /define options.
23947 2002-07-29 Martin Baulig <martin@gnome.org>
23949 * statement.cs (Fixed): Moved all code that does variable lookups
23950 and resolvings from Emit to Resolve.
23952 * statement.cs (For): Moved all code that does variable lookups
23953 and resolvings from Emit to Resolve.
23955 * statement.cs (Using): Moved all code that does variable lookups
23956 and resolvings from Emit to Resolve.
23958 2002-07-29 Martin Baulig <martin@gnome.org>
23960 * attribute.cs (Attribute.Resolve): Explicitly catch a
23961 System.NullReferenceException when creating the
23962 CustromAttributeBuilder and report a different warning message.
23964 2002-07-29 Martin Baulig <martin@gnome.org>
23966 * support.cs (ParameterData.ParameterName): Added method to
23967 get the name of a parameter.
23969 * typemanager.cs (TypeManager.IsValueType): New public method.
23971 2002-07-29 Martin Baulig <martin@gnome.org>
23973 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23974 is a flag which specifies that it's either ref or out.
23975 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23976 the out parameter to `out Parameter.Modifier mod', also set the
23977 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23979 * support.cs (InternalParameters.ParameterModifier): Distinguish
23980 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23981 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23983 * expression.cs (Argument.GetParameterModifier): Distinguish
23984 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23985 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23987 2002-07-29 Martin Baulig <martin@gnome.org>
23989 * expression.cs (ParameterReference.ParameterReference): Added
23990 `Location loc' argument to the constructor.
23992 * cs-parser.jay: Pass location to ParameterReference.
23994 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23996 * statement.cs (Try): Initialize the location.
23998 * cs-parser.jay: pass location to Try.
24000 * expression.cs (Unary.Reduce): Change the prototype to return
24001 whether a constant fold could be performed or not. The result is
24002 returned in an out parameters. In the case of Indirection and
24003 AddressOf, we want to perform the full tests.
24005 2002-07-26 Miguel de Icaza <miguel@ximian.com>
24007 * statement.cs (Statement.Emit): Flag dead code.
24009 2002-07-27 Andrew Birkett <andy@nobugs.org>
24011 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24013 2002-07-27 Martin Baulig <martin@gnome.org>
24015 * class.cs (MethodData.Define): Put back call to
24016 TypeManager.AddMethod(), accidentally commented this out.
24018 * report.cs (Debug): New public method to print debugging information,
24019 this is `[Conditional ("DEBUG")]'.
24021 2002-07-26 Martin Baulig <martin@gnome.org>
24023 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24024 (switch_statement): Push the current_block to the switch_stack and
24025 pop it again when we're done with the switch.
24026 (switch_section): The new block is a child of the current_block.
24027 Fixes bug #24007, added test-152.cs.
24029 2002-07-27 Martin Baulig <martin@gnome.org>
24031 * expression.cs (Invocation.EmitArguments): When calling a varargs
24032 function with only its fixed arguments, we need to pass an empty
24035 2002-07-27 Martin Baulig <martin@gnome.org>
24037 Mono 0.13 has been released.
24039 2002-07-25 Miguel de Icaza <miguel@ximian.com>
24041 * driver.cs: Rename --resource to --linkres, because that is what
24042 we do currently, we dont support --resource yet.
24044 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24046 2002-07-25 Martin Baulig <martin@gnome.org>
24048 * class.cs (MethodData): New public class. This is a `method builder'
24049 class for a method or one accessor of a Property/Indexer/Event.
24050 (MethodData.GetMethodFlags): Moved here from MemberBase.
24051 (MethodData.ApplyAttributes): Likewise.
24052 (MethodData.ApplyObsoleteAttribute): Likewise.
24053 (MethodData.ApplyConditionalAttribute): Likewise.
24054 (MethodData.ApplyDllImportAttribute): Likewise.
24055 (MethodData.CheckAbstractAndExternal): Likewise.
24056 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24057 (MethodData.Emit): Formerly known as Method.Emit().
24058 (MemberBase): Moved everything which was specific to a single
24059 accessor/method to MethodData.
24060 (Method): Create a new MethodData and call Define() and Emit() on it.
24061 (Property, Indexer, Event): Create a new MethodData objects for each
24062 accessor and call Define() and Emit() on them.
24064 2002-07-25 Martin Baulig <martin@gnome.org>
24066 Made MethodCore derive from MemberBase to reuse the code from there.
24067 MemberBase now also checks for attributes.
24069 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24070 (MemberBase.GetMethodFlags): Moved here from class Method and marked
24072 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24073 `CallingConventions cc' and `Attributes opt_attrs' arguments.
24074 (MemberBase.ApplyAttributes): New virtual method; applies the
24075 attributes to a method or accessor.
24076 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24077 (MemberBase.ApplyConditionalAttribute): Likewise.
24078 (MemberBase.ApplyDllImportAttribute): Likewise.
24079 (MemberBase.CheckAbstractAndExternal): Likewise.
24080 (MethodCore.ParameterTypes): This is now a property instead of a
24081 method, it's initialized from DoDefineParameters().
24082 (MethodCore.ParameterInfo): Removed the set accessor.
24083 (MethodCore.DoDefineParameters): New protected virtual method to
24084 initialize ParameterTypes and ParameterInfo.
24085 (Method.GetReturnType): We can now simply return the MemberType.
24086 (Method.GetMethodFlags): Override the MemberBase version and add
24087 the conditional flags.
24088 (Method.CheckBase): Moved some code from Define() here, call
24089 DoDefineParameters() here.
24090 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24091 here to avoid some larger code duplication.
24092 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24093 ensure that abstract and external accessors don't declare a body.
24095 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24096 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24097 lookup in the attribute's parent classes, so we need to abort as soon
24098 as we found the first match.
24099 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24100 the attribute has no arguments.
24102 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24105 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24107 * cs-parser.jay: reverted previous patch.
24109 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24111 * cs-parser.jay: fixed bug #22119.
24113 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24115 * attribute.cs: fixed compilation. The error was:
24116 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
24117 be assigned to before control leaves the current method."
24118 [FIXME: Filed as bug #28186: MCS must report this error.]
24120 2002-07-25 Martin Baulig <martin@gnome.org>
24122 * attribute.cs (Attribute.Conditional_GetConditionName): New static
24123 method to pull the condition name ouf of a Conditional attribute.
24124 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24125 the obsolete message and error flag out of an Obsolete attribute.
24127 * class.cs (Method.GetMethodFlags): New public method to get the
24128 TypeManager.MethodFlags for this method.
24129 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24131 (Method.Define): Get and apply the Obsolete and Conditional attributes;
24132 if we're overriding a virtual function, set the new private variable
24133 `parent_method'; call the new TypeManager.AddMethod().
24135 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
24136 the MethodBuilder and the Method in a PtrHashtable.
24137 (TypeManager.builder_to_method): Added for this purpose.
24138 (TypeManager.MethodFlags): Added IsObsoleteError.
24139 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
24140 Obsolete and Conditional arguments in MethodBuilders. If we discover
24141 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24142 the message from the attribute.
24144 2002-07-24 Martin Baulig <martin@gnome.org>
24146 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24147 preprocessor directives, ensure that the argument to #define/#undef is
24148 exactly one identifier and that it's actually an identifier.
24150 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24153 2002-07-24 Martin Baulig <martin@gnome.org>
24155 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24156 initialize it to TypeManager.object_type in the constructor.
24157 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24158 of the `hm.get_current' method if we're using the collection pattern.
24159 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24160 for the explicit conversion to make it work when we're using the collection
24161 pattern and the `Current' property has a different return type than `object'.
24164 2002-07-24 Martin Baulig <martin@gnome.org>
24166 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24167 does not match, but don't report any errors. This method is called in
24168 order for all methods in a MethodGroupExpr until a matching method is
24169 found, so we don't want to bail out if the first method doesn't match.
24170 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24171 matches, report the 123. Fixes #28070.
24173 2002-07-24 Martin Baulig <martin@gnome.org>
24175 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24176 TypeManager.TypeToCoreType() to the top of the method so the
24177 following equality checks will work. Fixes #28107.
24179 2002-07-24 Martin Baulig <martin@gnome.org>
24181 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24182 operand is of type uint, and the other operand is of type sbyte,
24183 short or int, the operands are converted to type long." -
24184 Actually do what this comment already told us. Fixes bug #28106,
24187 2002-07-24 Martin Baulig <martin@gnome.org>
24189 * class.cs (MethodBase): New abstract class. This is now a base
24190 class for Property, Indexer and Event to avoid some code duplication
24191 in their Define() and DefineMethods() methods.
24192 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24193 generic methods for Define() and DefineMethods().
24194 (FieldBase): Derive from MemberBase, not MemberCore.
24195 (Property): Derive from MemberBase, not MemberCore.
24196 (Property.DefineMethod): Moved all the code from this method to the
24197 new MethodBase.DefineAccessor(), just call it with appropriate
24199 (Property.Define): Call the new Property.DoDefine(), this does some
24200 sanity checks and we don't need to duplicate the code everywhere.
24201 (Event): Derive from MemberBase, not MemberCore.
24202 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24203 accessors, this will also make them work with interface events.
24204 (Indexer): Derive from MemberBase, not MemberCore.
24205 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24206 (Indexer.Define): Use the new MethodBase functions.
24208 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24209 argument to the constructor.
24210 (Interface.FindMembers): Added support for interface events.
24211 (Interface.PopluateEvent): Implemented.
24213 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
24215 2002-07-22 Miguel de Icaza <miguel@ximian.com>
24217 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24218 but this is required to check for a method name being the same as
24219 the containing class.
24223 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24225 * interface.cs: initialize variable.
24227 2002-07-23 Martin Baulig <martin@gnome.org>
24229 Implemented the IndexerName attribute in interfaces.
24231 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24232 name if this is an explicit interface implementation.
24233 (Indexer.InterfaceIndexerName): New public variable. If we're
24234 implementing an interface indexer, this is the IndexerName in that
24235 interface. Otherwise, it's the IndexerName.
24236 (Indexer.DefineMethod): If we're implementing interface indexer,
24237 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
24238 and Pending.ImplementIndexer methods.
24239 (Indexer.Define): Also define the PropertyBuilder if we're
24240 implementing an interface indexer and this is neither an explicit
24241 interface implementation nor do the IndexerName match the one in
24244 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24245 If a method is defined here, then we always need to create a proxy
24246 for it. This is used when implementing interface indexers.
24247 (Pending.IsInterfaceIndexer): New public method.
24248 (Pending.ImplementIndexer): New public method.
24249 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24250 This is used when implementing interface indexers to define a proxy
24252 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24253 define a proxy if necessary.
24255 * interface.cs (Interface.IndexerName): New public variable.
24256 (Interface.PopulateIndexer): Set the IndexerName.
24257 (Interface.DefineIndexers): New private method. Populate all the
24258 indexers and make sure their IndexerNames match.
24260 * typemanager.cs (IndexerPropertyName): Added support for interface
24263 2002-07-22 Martin Baulig <martin@gnome.org>
24265 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24266 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24267 ret if HasReturnLabel.
24268 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24271 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24272 and set the ec.LoopBeginTryCatchLevel.
24273 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24274 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24275 the current ec.TryCatchLevel, the branch goes out of an exception
24276 block. In this case, we need to use Leave and not Br.
24278 2002-07-22 Martin Baulig <martin@gnome.org>
24280 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24281 block unless the block does not always return or it is contained in
24282 another try { ... } catch { ... } block. Fixes bug #26506.
24283 Added verify-1.cs to the test suite.
24285 2002-07-22 Martin Baulig <martin@gnome.org>
24287 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24288 then we do not always return. Fixes bug #24985.
24290 2002-07-22 Martin Baulig <martin@gnome.org>
24292 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24293 lookup on a per-class level; ie. walk up the class hierarchy until we
24294 found at least one applicable method, then choose the best among them.
24295 Fixes bug #24463 and test-29.cs.
24297 2002-07-22 Martin Baulig <martin@gnome.org>
24299 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24300 return types of the methods. The return type is not part of the
24301 signature and we must not check it to make the `new' modifier work.
24302 Fixes bug #27999, also added test-147.cs.
24303 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24305 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24306 on the method's return type.
24308 2002-07-21 Martin Baulig <martin@gnome.org>
24310 * assign.cs: Make this work if the rightmost source is a constant and
24311 we need to do an implicit type conversion. Also adding a few more tests
24312 to test-38.cs which should have caught this.
24314 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24315 target in the makefile for this. The makefile.gnu is primarily intended
24316 for end-users who don't want to debug the compiler.
24318 2002-07-21 Martin Baulig <martin@gnome.org>
24320 * assign.cs: Improved the Assign class so it can now handle embedded
24321 assignments (X = Y = Z = something). As a side-effect this'll now also
24322 consume less local variables. test-38.cs now passes with MCS, added
24323 a few new test cases to that test.
24325 2002-07-20 Martin Baulig <martin@gnome.org>
24327 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24328 instructions. Fixes bug #27977, also added test-146.cs.
24330 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24332 * cs-tokenizer.cs: fixed getHex ().
24334 2002-07-19 Martin Baulig <martin@gnome.org>
24336 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24337 not Type.GetType() to lookup the array type. This is needed when
24338 we're constructing an array of a user-defined type.
24339 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24340 single-dimensional arrays, but also for single-dimensial arrays of
24343 2002-07-19 Martin Baulig <martin@gnome.org>
24345 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24346 this function is called, it's not allowed to share LocalBuilders
24347 among ILGenerators.
24349 2002-07-19 Martin Baulig <martin@gnome.org>
24351 * expression.cs (Argument.Resolve): Report an error 118 when trying
24352 to pass a type as argument.
24354 2002-07-18 Martin Baulig <martin@gnome.org>
24356 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24357 Conv_R_Un for the signed `long' type.
24359 2002-07-15 Miguel de Icaza <miguel@ximian.com>
24361 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24362 `expr' for the temporary result, as that will fail if we do
24363 multiple resolves on the same expression.
24365 2002-07-05 Miguel de Icaza <miguel@ximian.com>
24367 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24368 ec.TypeContainer for looking up aliases.
24370 * class.cs (TypeContainer): Remove LookupAlias from here.
24372 * decl.cs (DeclSpace); Move here.
24374 2002-07-01 Miguel de Icaza <miguel@ximian.com>
24376 * class.cs (FindMembers): Only call filter if the constructor
24377 bulider is not null.
24379 Also handle delegates in `NestedTypes' now. Now we will perform
24380 type lookups using the standard resolution process. This also
24383 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24384 This uses Expressions (the limited kind that can be parsed by the
24385 tree) instead of strings.
24387 * expression.cs (ComposedCast.ToString): Implement, used to flag
24388 errors since now we have to render expressions.
24390 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
24393 * ecore.cs (SimpleName.ToString): ditto.
24395 * cs-parser.jay: Instead of using strings to assemble types, use
24396 Expressions to assemble the type (using SimpleName, ComposedCast,
24397 MemberAccess). This should fix the type lookups in declarations,
24398 because we were using a different code path for this.
24400 * statement.cs (Block.Resolve): Continue processing statements
24401 even when there is an error.
24403 2002-07-17 Miguel de Icaza <miguel@ximian.com>
24405 * class.cs (Event.Define): Also remove the `remove' method from
24406 the list of pending items.
24408 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24409 generate more compact code.
24411 2002-07-17 Martin Baulig <martin@gnome.org>
24413 * const.cs (Const.LookupConstantValue): Add support for constant
24414 `unchecked' and `checked' expressions.
24415 Also adding test case test-140.cs for this.
24417 2002-07-17 Martin Baulig <martin@gnome.org>
24419 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24420 check whether mi.ReturnType implements the IEnumerator interface; the
24421 `==' and the IsAssignableFrom() will fail in this situation.
24423 2002-07-16 Ravi Pratap <ravi@ximian.com>
24425 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
24428 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24430 * expression.cs: fixed bug #27811.
24432 2002-07-14 Miguel de Icaza <miguel@ximian.com>
24434 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24435 Molaro: when we are a ref, the value already contains a pointer
24436 value, do not take the address of it.
24438 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24439 * removed mb-parser.jay and mb-tokenizer.cs
24441 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24443 * expression.cs: check against the building corlib void type.
24445 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24447 * ecore.cs: fix for valuetype static readonly fields: when
24448 initializing them, we need their address, not the address of a copy.
24450 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24452 * typemanager.cs: register also enum_type in corlib.
24454 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24456 * class.cs: allow calling this (but not base) initializers in structs.
24458 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24460 * ecore.cs: make sure we compare against the building base types
24463 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24465 * typemanager.cs: fix TypeToCoreType() to handle void and object
24466 (corlib gets no more typerefs after this change).
24468 2002-07-12 Miguel de Icaza <miguel@ximian.com>
24470 * expression.cs (ArrayCreation.EmitArrayArguments): use
24471 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24473 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24474 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
24475 array indexes, the runtime actually forbids them.
24477 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24478 for array arguments here.
24480 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24481 instead of the default for ValueTypes.
24483 (New.DoEmit): Use IsValueType instead of
24484 IsSubclassOf (value_type)
24485 (New.DoResolve): ditto.
24486 (Invocation.EmitCall): ditto.
24488 * assign.cs (Assign): ditto.
24490 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24491 Statements *are* currently doing part of their resolution during
24494 Expressions do always resolve during resolve, but statements are
24495 only required to propagate resolution to their children.
24497 2002-07-11 Miguel de Icaza <miguel@ximian.com>
24499 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24501 (LoadAssembly): Do not add the dll if it is already specified
24503 (MainDriver): Add the System directory to the link path at the end,
24504 after all the other -L arguments.
24506 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24507 wrong opcode for loading bytes and bools (ldelem.i1 instead of
24508 ldelem.u1) and using the opposite for sbytes.
24510 This fixes Digger, and we can finally run it.
24512 * driver.cs (UnixParseOption): Move the option parsing here.
24513 (CSCParseOption): Implement CSC-like parsing of options.
24515 We now support both modes of operation, the old Unix way, and the
24516 new CSC-like way. This should help those who wanted to make cross
24517 platform makefiles.
24519 The only thing broken is that /r:, /reference: and /lib: are not
24520 implemented, because I want to make those have the same semantics
24521 as the CSC compiler has, and kill once and for all the confussion
24522 around this. Will be doing this tomorrow.
24524 * statement.cs (Unsafe.Resolve): The state is checked during
24525 resolve, not emit, so we have to set the flags for IsUnsfe here.
24527 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24529 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24530 not catch the Error_ObjectRefRequired in SimpleName (as it is
24531 possible to have a class/instance variable name that later gets
24532 deambiguated), we have to check this here.
24534 2002-07-10 Ravi Pratap <ravi@ximian.com>
24536 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24537 make static and put into Expression.
24539 (Event.Define): Register the private field of the event with the
24540 TypeManager so that GetFieldFromEvent can get at it.
24542 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24543 keep track of the private field associated with an event which
24546 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24549 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24551 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24553 * expression.cs (Binary.EmitBranchable): this routine emits the
24554 Binary expression in a branchable context. This basically means:
24555 we need to branch somewhere, not just get the value on the stack.
24557 This works together with Statement.EmitBoolExpression.
24559 * statement.cs (Statement.EmitBoolExpression): Use
24562 2002-07-09 Miguel de Icaza <miguel@ximian.com>
24564 * statement.cs (For): Reduce the number of jumps in loops.
24566 (For): Implement loop inversion for the For statement.
24568 (Break): We can be breaking out of a Try/Catch controlled section
24569 (foreach might have an implicit try/catch clause), so we need to
24570 use Leave instead of Br.
24572 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24573 now). If the instace expression supports IMemoryLocation, we use
24574 the AddressOf method from the IMemoryLocation to extract the
24575 address instead of emitting the instance.
24577 This showed up with `This', as we were emitting the instance
24578 always (Emit) instead of the Address of This. Particularly
24579 interesting when This is a value type, as we dont want the Emit
24580 effect (which was to load the object).
24582 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24584 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24586 * statement.cs (Checked): Set the CheckedState during the resolve
24587 process too, as the ConvCast operations track the checked state on
24588 the resolve process, and not emit.
24590 * cs-parser.jay (namespace_member_declaration): Flag that we have
24591 found a declaration when we do. This is used to flag error 1529
24593 * driver.cs: Report ok when we display the help only.
24595 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24597 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24599 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24601 * cs-tokenizer.cs (define): We also have to track locally the
24602 defines. AllDefines is just used for the Conditional Attribute,
24603 but we also need the local defines for the current source code.
24605 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24607 * statement.cs (While, For, Do): These loops can exit through a
24608 Break statement, use this information to tell whether the
24609 statement is the last piece of code.
24611 (Break): Flag that we break.
24613 * codegen.cs (EmitContexts): New `Breaks' state variable.
24615 2002-07-03 Martin Baulig <martin@gnome.org>
24617 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24618 modifiers in method declarations in structs. Otherwise, you won't
24619 be able to override things like Object.Equals().
24621 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24623 * class.cs (Method, Property, Indexer): Do not allow the public
24624 modifier to be used in explicit interface implementations.
24626 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24627 override modifiers in method declarations in structs
24629 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24631 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24632 integer or real overflow, report an error
24634 2002-07-02 Martin Baulig <martin@gnome.org>
24636 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24637 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24638 to tell the runtime about our newly created System.Object and
24639 System.ValueType types.
24641 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24643 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24644 struct instead of Ldarg/Starg.
24646 2002-07-02 Martin Baulig <martin@gnome.org>
24648 * expression.cs (Indirection.Indirection): Call
24649 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24651 2002-07-02 Martin Baulig <martin@gnome.org>
24653 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24654 ValueType, call TypeManager.TypeToCoreType() on it.
24655 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24656 the OpCodes.Newarr argument.
24658 2002-07-02 Martin Baulig <martin@gnome.org>
24660 * expression.cs (Invocation.EmitCall): When compiling corlib,
24661 replace all calls to the system's System.Array type to calls to
24662 the newly created one.
24664 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24665 System.Array methods.
24666 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24667 from the system's System.Array type which must be replaced.
24669 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24671 * typemanager.cs: load unverifiable_code_ctor so we can build
24672 corlib using the correct type. Avoid using GetTypeCode() with
24674 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24675 TypeManager.object_type to allow building corlib.
24677 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24679 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24681 2002-07-01 Martin Baulig <martin@gnome.org>
24683 * class.cs: Make the last change actually work, we need to check
24684 whether `ifaces != null' to avoid a crash.
24686 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24688 * class.cs: when we build structs without fields that implement
24689 interfaces, we need to add the interfaces separately, since there is
24690 no API to both set the size and add the interfaces at type creation
24693 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24695 * expression.cs: the dimension arguments to the array constructors
24696 need to be converted if they are a long.
24698 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24700 * class.cs: don't emit ldarg.0 if there is no parent constructor
24701 (fixes showstopper for corlib).
24703 2002-06-29 Martin Baulig <martin@gnome.org>
24705 MCS now compiles corlib on GNU/Linux :-)
24707 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24708 ie. check for MethodImplOptions.InternalCall.
24710 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24711 and TypeManager.attribute_type are null, so we must explicitly check
24712 whether parent is not null to find out whether it's an attribute type.
24713 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24714 and SetBuilder, not only if the property is neither abstract nor external.
24715 This is necessary to set the MethodImplOptions on the accessor methods.
24716 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24717 SetBuilder, see Property.Emit().
24719 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24720 populate "System.Object", "System.ValueType" and "System.Attribute" since
24721 they've already been populated from BootCorlib_PopulateCoreTypes().
24723 2002-06-29 Martin Baulig <martin@gnome.org>
24725 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24726 is the NullLiteral, we also need to make sure that target_type is not
24729 2002-06-29 Martin Baulig <martin@gnome.org>
24731 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24732 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24733 before calling BootstrapCorlib_ResolveDelegate ().
24735 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24737 * statement.cs: fixed build-breaker. All tests passed ok.
24739 2002-06-27 Martin Baulig <martin@gnome.org>
24741 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24742 for System.Decimal when compiling corlib.
24744 2002-06-27 Martin Baulig <martin@gnome.org>
24746 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24747 switch blocks which contain nothing but a default clause.
24749 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24751 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24753 2002-06-27 Martin Baulig <martin@gnome.org>
24755 * ecore.cs (PropertyExpr.PropertyExpr): Call
24756 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24758 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24759 is already a TypeBuilder.
24761 2002-06-27 Martin Baulig <martin@gnome.org>
24763 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24764 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24765 the "from an array-type to System.Array" case. This makes it work
24766 when compiling corlib.
24768 2002-06-27 Martin Baulig <martin@gnome.org>
24770 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24771 non-static PropertyExpr, set its InstanceExpression. This makes
24772 the `ICollection.Count' property work in System/Array.cs.
24774 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24776 * driver.cs: Made error handling more consistent. Errors now
24777 tracked by Report class, so many methods which used to return int
24778 now return void. Main() now prints success/failure and
24779 errors/warnings message.
24781 Renamed '--probe' compiler argument to '--expect-error'. Removed
24782 the magic number return values (123 and 124). Now, if the
24783 expected error occurs, the compiler exits with success (exit value
24784 0). If the compilation completes without seeing that particular
24785 error, the compiler exits with failure (exit value 1). The
24786 makefile in mcs/errors has been changed to handle the new behaviour.
24788 * report.cs: Made 'expected error' number a property and renamed
24789 it from 'Probe' to 'ExpectedError'.
24791 * genericparser.cs: Removed error handling support, since it is
24792 now all done by Report class.
24794 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24795 class, so parse() no longer returns an int.
24797 * namespace.cs: Use Report.Error instead of GenericParser.error
24799 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24801 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24802 TypeContainer.AddOperator): At the front of the list put the
24803 explicit implementations, so they get resolved/defined first.
24805 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24807 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24808 interface type is implemented by this TypeContainer. Used during
24809 explicit interface implementation.
24811 (Property.Define, Indexer.Define, Method.Define): Validate that
24812 the given interface in the explicit implementation is one of the
24813 base classes for the containing type.
24815 Also if we are explicitly implementing an interface, but there is
24816 no match in the pending implementation table, report an error.
24818 (Property.Define): Only define the property if we are
24819 not explicitly implementing a property from an interface. Use the
24820 correct name also for those properties (the same CSC uses,
24821 although that is really not needed).
24823 (Property.Emit): Do not emit attributes for explicitly implemented
24824 properties, as there is no TypeBuilder.
24826 (Indexer.Emit): ditto.
24828 Hiding then means that we do not really *implement* a pending
24829 implementation, which makes code fail.
24831 2002-06-22 Martin Baulig <martin@gnome.org>
24833 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24834 the return value of Object.GetType(). [FIXME: we need to do this whenever
24835 we get a type back from the reflection library].
24837 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24839 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24841 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24843 * attribute.cs: Return null if we can not look up the type.
24845 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24846 the interface types found.
24848 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24849 interface types found.
24851 * typemanager.cs (GetInterfaces): Make this routine returns alll
24852 the interfaces and work around the lame differences between
24853 System.Type and System.Reflection.Emit.TypeBuilder in the results
24854 result for GetInterfaces.
24856 (ExpandInterfaces): Given an array of interface types, expand and
24857 eliminate repeated ocurrences of an interface. This expands in
24858 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24861 2002-06-21 Martin Baulig <martin@gnome.org>
24863 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24866 2002-06-21 Martin Baulig <martin@gnome.org>
24868 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24869 and called with one of the core types, return the corresponding typebuilder for
24872 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24875 2002-06-21 Martin Baulig <martin@gnome.org>
24877 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24878 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24879 (Expression.ConvertReferenceExplicit): Likewise.
24881 * expression.cs (ElementAccess.DoResolve): Likewise.
24882 (ElementAccess.DoResolveLValue): Likewise.
24884 2002-06-10 Martin Baulig <martin@gnome.org>
24886 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24887 add the "value" parameter to the parameter list.
24889 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24892 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24894 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24895 the argument to an int, uint, long or ulong, per the spec. Also
24896 catch negative constants in array creation.
24898 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24900 * class.cs: do not allow the same interface to appear twice in
24901 the definition list.
24903 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24905 * ecore.cs: don't use ldlen with System.Array.
24907 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24909 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24911 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24913 * modifiers.cs: produce correct field attributes for protected
24914 internal. Easy fix so miguel can work on ther harder stuff:-)
24916 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24918 * pending.cs: New file. Move the code from class.cs here.
24919 Support clearning the pending flag for all methods (when not doing
24920 explicit interface implementation).
24922 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24924 * rootcontext.cs: added a couple more types needed to bootstrap.
24926 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24928 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24929 constructor in the type, instead of any constructor in the type
24930 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24931 a bug in the Mono runtime when applying the params attribute).
24933 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24934 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24936 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24938 * expression.cs (Unary.ResolveOperator): Use TypeManager
24939 to resolve the type.
24941 2002-06-13 Ravi Pratap <ravi@ximian.com>
24943 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24946 * enum.cs (AddEnumMember): Add support to store the attributes associated
24947 with each member too.
24949 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24950 field builders too - this takes care of the enum member case.
24952 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24954 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24955 address-of operator on both value types and pointers.
24957 2002-06-10 Martin Baulig <martin@gnome.org>
24959 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24960 PropertyBuilder to the `property_builders' list.
24962 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24963 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24964 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24965 find any indexers which are inherited from an interface.
24967 2002-06-09 Martin Baulig <martin@gnome.org>
24969 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24970 the same type as the constant if necessary. There's also a test-130.cs
24973 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24975 * typemanager.cs (TypeManager.ChangeType): Previously known as
24976 Enum.ChangeEnumType().
24978 2002-06-09 Martin Baulig <martin@gnome.org>
24980 * expression.cs (Cast.TryReduce): Added support for consts.
24982 2002-06-08 Ravi Pratap <ravi@ximian.com>
24984 * class.cs (Accessor): Hold attributes information so we can pass
24987 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24988 Modify to pass in attributes attached to the methods.
24990 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24992 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24993 to handle the Accessor kind :-)
24995 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24997 2002-06-08 Martin Baulig <martin@gnome.org>
24999 * expression.cs (Unary.TryReduceNegative): Added support for
25002 2002-06-08 Martin Baulig <martin@gnome.org>
25004 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25005 name can't be found in the `defined_names' - the caller will do a
25006 MemberLookup in this case and thus find methods in System.Enum
25007 such as Enum.IsDefined().
25009 2002-06-08 Martin Baulig <martin@gnome.org>
25011 * enum.cs (Enum.ChangeEnumType): This is a custom version of
25012 Convert.ChangeType() which works with TypeBuilder created types.
25013 (Enum.LookupEnumValue, Enum.Define): Use it here.
25015 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25016 `TypeBuilder.BaseType != null' check.
25017 (TypeContainer.FindMembers): Only lookup parent members if we
25018 actually have a parent.
25019 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25020 (ConstructorInitializer.Resolve): Likewise.
25022 * interface.cs (Interface.FindMembers): Added
25023 `TypeBuilder.BaseType != null' check.
25025 * rootcontext.cs (RootContext.ResolveCore): Added
25026 "System.Runtime.CompilerServices.IndexerNameAttribute" to
25027 classes_second_stage.
25029 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25030 debug_type and trace_type when compiling with --nostdlib.
25032 2002-06-07 Martin Baulig <martin@gnome.org>
25034 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25035 (AddField): Set it to true when adding a non-static field.
25036 (DefineType): Use `have_nonstatic_fields' to find out whether we
25037 have non-static fields, not `Fields != null'.
25039 2002-06-02 Miguel de Icaza <miguel@ximian.com>
25041 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25042 dereferencing a null on the static-field code path)
25044 2002-05-30 Martin Baulig <martin@gnome.org>
25046 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25047 to take command line arguments. Use reflection to call the new
25048 custom `Initialize' function on the symbol writer and pass it the
25049 command line arguments.
25051 * driver.cs (--debug-args): New command line argument to pass command
25052 line arguments to the symbol writer.
25054 2002-05-28 Miguel de Icaza <miguel@ximian.com>
25056 * assign.cs (DoResolve): Forgot to do the implicit conversion to
25057 the target type for indexers and properties. Thanks to Joe for
25060 2002-05-27 Miguel de Icaza <miguel@ximian.com>
25062 * typemanager.cs (MethodFlags): returns the method flags
25063 (Obsolete/ShouldIgnore) that control warning emission and whether
25064 the invocation should be made, or ignored.
25066 * expression.cs (Invocation.Emit): Remove previous hack, we should
25067 not do this on matching a base type, we should do this based on an attribute
25069 Only emit calls to System.Diagnostics.Debug and
25070 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25071 on the command line.
25073 * rootcontext.cs: Global settings for tracing and debugging.
25075 * cs-tokenizer.cs (define): New utility function to track
25076 defines. Set the global settings for TRACE and DEBUG if found.
25078 2002-05-25 Ravi Pratap <ravi@ximian.com>
25080 * interface.cs (Populate*): Pass in the TypeContainer as well as
25081 the DeclSpace as parameters so that we can create EmitContexts and
25082 then use that to apply attributes etc.
25084 (PopulateMethod, PopulateEvent, PopulateProperty)
25085 (PopulateIndexer): Apply attributes everywhere.
25087 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25090 (ApplyAttributes): Update accordingly.
25092 We now apply interface attributes for all members too.
25094 2002-05-26 Miguel de Icaza <miguel@ximian.com>
25096 * class.cs (Indexer.Define); Correctly check if we are explicit
25097 implementation (instead of checking the Name for a ".", we
25098 directly look up if the InterfaceType was specified).
25100 Delay the creation of the PropertyBuilder.
25102 Only create the PropertyBuilder if we are not an explicit
25103 interface implementation. This means that explicit interface
25104 implementation members do not participate in regular function
25105 lookups, and hence fixes another major ambiguity problem in
25106 overload resolution (that was the visible effect).
25108 (DefineMethod): Return whether we are doing an interface
25111 * typemanager.cs: Temporary hack until we get attributes in
25112 interfaces (Ravi is working on that) and we get IndexerName
25113 support in interfaces.
25115 * interface.cs: Register the indexers as properties.
25117 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25118 warning, I have verified that this is a bug in the .NET runtime
25119 (JavaScript suffers of the same problem).
25121 * typemanager.cs (MemberLookup): When looking up members for
25122 interfaces, the parent of an interface is the implicit
25123 System.Object (so we succeed in searches of Object methods in an
25124 interface method invocation. Example: IEnumerable x; x.ToString
25127 2002-05-25 Miguel de Icaza <miguel@ximian.com>
25129 * class.cs (Event): Events should also register if they do
25130 implement the methods that an interface requires.
25132 * typemanager.cs (MemberLookup); use the new GetInterfaces
25135 (GetInterfaces): The code used to lookup interfaces for a type is
25136 used in more than one place, factor it here.
25138 * driver.cs: Track the errors at the bottom of the file, we kept
25141 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25142 instance if the method we are calling is static!
25144 2002-05-24 Miguel de Icaza <miguel@ximian.com>
25146 * attribute.cs (ApplyAttributes): Make this function filter out
25147 the IndexerName attribute (as that attribute in reality is never
25148 applied) and return the string constant for the IndexerName
25151 * class.cs (TypeContainer.Emit): Validate that all the indexers
25152 have the same IndexerName attribute, and if so, set the
25153 DefaultName attribute on the class.
25155 * typemanager.cs: The return value might contain other stuff (not
25156 only methods). For instance, consider a method with an "Item"
25157 property and an Item method.
25159 * class.cs: If there is a problem with the parameter types,
25162 2002-05-24 Ravi Pratap <ravi@ximian.com>
25164 * ecore.cs (ImplicitConversionExists): Wrapper function which also
25165 looks at user defined conversion after making a call to
25166 StandardConversionExists - we need this for overload resolution.
25168 * expression.cs : Update accordingly the various method calls.
25170 This fixes 2 bugs filed against implicit user defined conversions
25172 2002-05-22 Miguel de Icaza <miguel@ximian.com>
25174 * statement.cs: Track the result of the assignment.
25176 2002-05-21 Miguel de Icaza <miguel@ximian.com>
25178 * expression.cs (MemberAccess): Improved error reporting for
25179 inaccessible members.
25181 2002-05-22 Martin Baulig <martin@gnome.org>
25183 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
25184 itself with debugging support.
25186 2002-05-22 Martin Baulig <martin@gnome.org>
25188 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25189 Removed, this isn't needed anymore.
25191 2002-05-20 Martin Baulig <martin@gnome.org>
25193 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25194 be underlying type for an enum.
25196 2002-05-20 Miguel de Icaza <miguel@ximian.com>
25198 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25199 that splits out the loading of just the core types.
25201 * rootcontext.cs (ResolveCore): Split the struct resolution in
25202 two, so we can load the enumeration underlying types before any
25205 * expression.cs (Is): Bandaid until we fix properly Switch (see
25206 bug #24985 for details).
25208 * typemanager.cs (ImplementsInterface): The hashtable will contain
25209 a null if there are no interfaces implemented.
25211 2002-05-18 Miguel de Icaza <miguel@ximian.com>
25213 * cs-parser.jay (indexer_declarator): It is fine to have array
25216 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25218 * typemanager.cs: (RegisterBuilder): New function used to register
25219 TypeBuilders that implement interfaces. Since
25220 TypeBuilder.GetInterfaces (as usual) does not work with lame
25222 (AddUserType): register interfaces.
25224 (ImplementsInterface): Use the builder_to_ifaces hash if we are
25225 dealing with TypeBuilder. Also, arrays are showing up as
25226 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25227 methods can not be invoked on them!
25229 * ecore.cs (ExplicitReferenceConversionExists): Made public.
25230 (ImplicitReferenceConversionExists): Split out from
25231 StandardConversionExists.
25233 * expression.cs (As): We were only implementing one of the three
25234 cases for the as operator. We now implement them all.
25235 (Is): Implement the various other cases for Is as well.
25237 * typemanager.cs (CACHE): New define used to control if we want or
25238 not the FindMembers cache. Seems to have a negative impact on
25239 performance currently
25241 (MemberLookup): Nested types have full acess to
25242 enclosing type members
25244 Remove code that coped with instance/static returns for events, we
25245 now catch this in RealFindMembers.
25247 (RealFindMembers): only perform static lookup if the instance
25248 lookup did not return a type or an event.
25250 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25252 * assign.cs (CompoundAssign): We pass more semantic information
25253 now to Compound Assignments than we did before: now we have all
25254 the information at hand, and now we resolve the target *before* we
25255 do the expression expansion, which allows the "CacheValue" method
25256 to have the effect we intended (before, a [x] += 1 would generate
25257 two differen ArrayAccess expressions from the ElementAccess,
25258 during the resolution process).
25260 (CompoundAssign.DoResolve): Resolve target and original_source here.
25262 2002-05-16 Miguel de Icaza <miguel@ximian.com>
25264 * expression.cs (ArrayAccess): dropped debugging information.
25266 * typemanager.cs: Small bug fix: I was always returning i_members,
25267 instead of one of i_members or s_members (depending on which had
25270 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
25271 method is invoked before any code generation takes place, and it
25272 is a mechanism to inform that the expression will be invoked more
25273 than once, and that the method should use temporary values to
25274 avoid having side effects
25276 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25278 * ecore.cs (Expression.CacheTemporaries): Provide empty default
25281 * expression.cs (Indirection, ArrayAccess): Add support for
25282 CacheTemporaries in these two bad boys.
25284 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25285 ldobj or ldind_ref.
25286 (StoreFromPtr): Handle stobj as well.
25288 * expression.cs (UnaryMutator): Share more code.
25290 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25291 down: I was not tracking the Filter function as well, which
25292 was affecting the results of the cache.
25294 2002-05-15 Miguel de Icaza <miguel@ximian.com>
25296 * attribute.cs: Remove the hack to handle the CharSet property on
25299 2002-05-14 Miguel de Icaza <miguel@ximian.com>
25301 * attribute.cs (DoResolve): More uglyness, we now only try to
25302 resolve the attribute partially, to extract the CharSet
25303 information (only if we are a StructLayout attribute). Otherwise
25305 (GetExtraTypeInfo): Add some code to conditionally kill in the
25306 future this. I am more and more convinced that the .NET
25307 framework has special code to handle the attribute setting on
25310 * expression.cs (IsParamsMethodApplicable): Revert my previous
25311 foreach change here, it was wrong.
25313 2002-05-13 Miguel de Icaza <miguel@ximian.com>
25315 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25316 (pp_expr): do not abort on unknown input, just return.
25317 (eval): abort if there are pending chars.
25319 * attribute.cs (Attribute.Resolve): Positional parameters are
25320 optional. Deal with that case.
25322 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25323 the Ansi/Unicode/Auto information for the type.
25325 (TypeContainer.DefineType): instantiate the EmitContext here, as
25326 we will be using it during the type definition (to resolve
25327 attributes) and during the emit phase.
25329 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25330 to pull type information out of the attributes
25332 (Attribute.Resolve): track the constructor builder, and allow for
25333 multiple invocations (structs and classes will use this).
25335 * ecore.cs (MemberLookupFinal): new version with all the
25336 parameters customizable.
25338 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25339 constructors. Return if the result value is null (as the error
25340 would have been flagged already by MemberLookupFinal)
25342 Do not allow instances of abstract classes or interfaces to be
25345 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25346 We have to compare the assembly property here when dealing with
25347 FamANDAssem and Assembly access modifiers, because we might be
25348 creating an assembly from *modules* (that means that we are not
25349 getting TypeBuilders for types defined in other modules that are
25350 part of this assembly).
25352 (Method.Emit): If the method is marked abstract and has a body,
25355 (TypeContainer.DefineMembers): If both the defined member and the
25356 parent name match are methods, then do not emit any warnings: let
25357 the Method.Define routine take care of flagging warnings. But if
25358 there is a mismatch (method overrides something else, or method is
25359 overriwritten by something, then emit warning).
25361 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25362 set to null, this means `do not check for the return type on the
25365 (Method.Define): set the return type for the method signature to
25366 null, so that we get methods with the same name and parameters and
25367 different return types. This is used to flag warning 114 (you are
25368 hiding a method, and you probably want to use the new/override
25371 * typemanager.cs (MemberLookup): Implemented proper access
25372 control, closing a long standing set of bug reports. The problem
25373 was that the Framework only has two bits: Public and NonPublic,
25374 and NonPublic includes private and protected methods, but we need
25375 to enforce the FamANDAssem, FamOrAssem and Family.
25377 2002-05-11 Miguel de Icaza <miguel@ximian.com>
25379 * statement.cs (GotoCase): Return true: Ammounts to giving up
25380 knowledge on whether we return or not, and letting the other case
25381 be responsible for it.
25383 2002-05-10 Miguel de Icaza <miguel@ximian.com>
25385 * driver.cs: Do not load directories for each file processed, only
25386 do it if there is a pattern.
25388 * ecore.cs: Report readonly assigns here as well, as we might have
25389 been resolved only by MemberAccess.
25391 (SimpleName.SimpleNameResolve): Also be useful for LValue
25392 resolution. We need this to propagate assign to local readonly variables
25394 * typemanager.cs: Use a ptrhashtable for the criteria, because we
25395 do not want to reuse potential criteria memory.
25397 * class.cs (MyEventBuilder): Set reflected_type;
25399 * ecore.cs (Constantify): Added support for constifying bools.
25401 (RootContext.LookupType): Added a cache for values looked up in
25402 the declaration space.
25404 * typemanager.cs (FindMembers): Now is a front-end to
25405 RealFindMembers, and provides a two-level hashtable-based cache to
25408 15% performance improvement: from 22.5 to 19.2 seconds.
25410 * expression.cs (IsParamsMethodApplicable): use foreach.
25411 (Invocation.DoResolve): ditto.
25412 (New.DoResolve): ditto.
25413 (ArrayCreation.DoResolve): ditto.
25415 * ecore.cs (FindMostEncompassingType): use foreach.
25417 * delegate.cs (NewDelegate.DoResolve): Use foreach
25419 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25420 (RemoveMethods): use foreach.
25422 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25423 nested foreach statements instead of for, and also break out of
25424 the inner loop once a match is found.
25426 (Invocation.OverloadResolve): Use foreach, simplify the code.
25428 2002-05-08 Miguel de Icaza <miguel@ximian.com>
25430 * cfold.cs (BinaryFold): During an enumeration evaluation context,
25431 we actually unwrap the expression to allow for extra information
25434 * expression.cs: Use Shr_Un on unsigned operations.
25436 2002-05-08 Ravi Pratap <ravi@ximian.com>
25438 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
25439 applicable operators was not being considered correctly. This closes
25440 the bug Miguel reported.
25442 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25444 * attribute.cs: check that the type derives from System.Attribute
25445 and report the correct error in that case (moved the duplicate code to
25446 its own method, too).
25448 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25450 * attribute.cs: lookup attribute type name as the spec says: first the
25451 bare attribute name and then name + "Attribute" (nant compiles with
25452 mcs after this fix).
25454 2002-05-07 Miguel de Icaza <miguel@ximian.com>
25456 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
25457 Because of the way we parse things, we should try to see if a
25458 UIntConstant can fit in an integer.
25460 2002-05-07 Ravi Pratap <ravi@ximian.com>
25462 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25463 when we are in an explicit context.
25465 (ConvertReferenceExplicit): When converting from Iface type S to Class
25466 T make sure the rules are implemented as an OR.
25468 * parameter.cs (ParameterType): Make it a property for now although the
25469 purpose really isn't anything immediate.
25471 * expression.cs (Is*Applicable): Do better checking on the parameter type
25472 of a ref/out parameter. The ones from the system assemblies are already
25473 marked with the correct type so we don't need to do any correction.
25475 * ecore.cs (StandardConversionExists): Conversion from Interface types to
25476 the object type is standard too so include that.
25478 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25480 * ecore.cs (StandardConversionExists): Augment with missing code:
25481 deal with IntConstant, LongConstants and Enumerations.
25483 * assign.cs: Report the error, instead of failing silently
25485 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25486 typecontainer that they are declared, because the
25487 typecontainer/namespace will have the list of using clauses that
25488 need to be applied.
25490 Assembly Attributes were escaping the normal registration
25493 (EmitCode): Apply attributes within an EmitContext that represents
25494 the container they were declared on.
25496 * cs-parser.jay: Track bases for structs. How did I get this wrong?
25498 2002-05-06 Ravi Pratap <ravi@ximian.com>
25500 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25501 Revamp completely - make much cleaner as we now operate only
25504 (FindMostSpecificSource, FindMostSpecificTarget): New methods
25505 to implement the logic detailed in the spec more correctly.
25507 (UserDefinedConversion): Update accordingly.
25509 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25511 * statement.cs: Return flow analysis information up.
25513 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25516 (token): Do not consume an extra character before calling
25519 2002-05-06 Piers Haken <piersh@friskit.com>
25521 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25523 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25525 * class.cs (Constructor.Emit): Set the IsStatic flag in the
25526 EmitContext during the instance constructor initializer
25527 resolution, to stop access to instance variables.
25529 This is mandated by the spec, last paragraph of the `constructor
25530 initializers' section.
25532 2002-05-05 Miguel de Icaza <miguel@ximian.com>
25534 * cs-parser.jay, class.cs (Accessor): new class used to represent
25535 an accessor (get or set). In the past we used `null' to represent
25536 a missing accessor. But this is ambiguous because there was no
25537 way to tell in abstract indexers/properties if one of them was
25540 Now there is a way of addressing that.
25542 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25543 instead of FindMembers.
25545 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25546 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25548 * attribute.cs: Treat indexers and properties as the same in terms
25549 of applying attributes
25551 * ecore.cs (FindMostEncompassedType): Use statically initialized
25552 EmptyExpressions()s like we do elsewhere to avoid creating useless
25553 objects (and we take this out of the tight loop).
25555 (GetConversionOperators): Move the code to extract the actual
25556 operators to a separate routine to clean things up.
25558 2002-05-04 Miguel de Icaza <miguel@ximian.com>
25560 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25561 events are always registered FieldBuilders.
25563 * class.cs (FieldBase): New class shared by Fields
25565 * delegate.cs: If we are a toplevel delegate, use our full name.
25566 If we are a nested delegate, then only use our tail name.
25568 2002-05-02 Ravi Pratap <ravi@ximian.com>
25570 * expression.cs (IsApplicable): Ensure that we add the "&" to
25571 ref/out types before comparing it with the type of the argument.
25573 (IsParamsMethodApplicable): Ditto.
25575 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
25578 * delegate.cs : Handle the case when we have more than one applicable
25579 method. Flag an error only when we finish checking all.
25581 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25583 * expression.cs: Add support for boolean static initializers.
25585 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25587 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25589 * parameter.cs (ComputeParameterTypes,
25590 ComputeAndDefineParameterTypes): Better error handling: now we
25591 clear the `types' cache if we fail during any of the type lookups.
25592 We also return the status code correctly to our caller
25594 * delegate.cs: If we fail to define a delegate, abort the extra
25597 * expression.cs (Binary.ResolveOperator): for
25598 operator==(object,object) and operator !=(object, object) we also
25599 have to verify that there is an implicit conversion from one to
25602 (ArrayAccess.DoResolve): Array Access can operate on
25605 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25607 * assign.cs (CompoundAssign): A new class used as a "flag" that
25608 the assignment actually is happening as part of a compound
25609 assignment operator.
25611 During compound assignment, a few new rules exist to enable things
25618 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25619 to the type of x) if y is implicitly convertible to the type of x,
25620 and the operator is a builtin operator and the return type of the
25621 operator is explicitly convertible to the type of x.
25623 * rootcontext.cs: Reset warning level to 2. 4 catches various
25624 "interesting" features in mcs, we must clean this up at some
25625 point, but currently am trying to kill other bugs ;-)
25627 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25628 in container classes as well.
25630 * expression.cs (Binary.ResolveOperator): Handle string case
25631 before anything else (as operator overloading does emit an error
25632 before doing anything else).
25634 This code could go away when we move to a table driven model, but
25635 i could not come up with a good plan last night.
25637 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25639 * typemanager.cs (CSharpName): reimplementation using regex.
25640 * class.cs: added null check for fields in Emit
25641 * rootcontext.cs: set warninglevel to 4
25643 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25645 * typemanager.cs (CSharpName): reimplemented with Lupus
25648 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25650 * statement.cs (If): correclty implement Resolve, because we were
25651 not catching sem errors in there. The same process is needed
25653 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25656 (Statement.Warning_DeadCodeFound): Factorize code.
25657 (While): Report dead code here too.
25659 (Statement): Added Resolve virtual method to allow
25660 for resolution split from the emit code.
25662 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25664 * statement.cs (EmitBoolExpression): No longer try to resolve the
25666 (MakeBoolean): New utility function that resolve, implicitly
25667 converts to boolean and tags the expression.
25670 (If, Do): Implement dead code elimination.
25671 (While): Implement loop inversion
25673 (Do, While, For, If): Resolve the expression prior to calling our
25676 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25679 - added method Report28 (warning: program has more than one entry point)
25680 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25681 - modified method Method.Define, the part at the end of the method
25683 * rootcontext.cs: added static public Location EntryPointLocation;
25685 * ../errors/cs0028.cs : Add test case for the above warning.
25688 - modified method CSharpName to allow arrays of primitive type to
25689 be printed nicely (e.g. instead of System.Int32[][] it now prints
25691 - added method CSharpSignature: returns the signature of a method
25692 in string format to be used in reporting errors, warnings, etc.
25694 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25697 2002-04-26 Ravi Pratap <ravi@ximian.com>
25699 * delegate.cs (Define): Fix extremely silly bug where I was
25700 setting the type of the 'object' parameter of the BeginInvoke
25701 method to System.IAsyncResult instead of System.Object ;-)
25703 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25705 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25708 (Constructor.Emit): return if we fail to initialize the
25709 constructor. Another door closed!
25711 * expression.cs (New.DoResolve): Improve error message (from -6 to
25712 1501). Use DeclaredOnly lookup to find the exact constructor.
25714 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25715 loop. This is useful.
25717 * cs-parser.jay: Adjust the default parameters so that destructors
25718 have the proper signature.
25720 2002-04-26 Martin Baulig <martin@gnome.org>
25722 * driver.cs (LoadAssembly): If `assembly' contains any characters
25723 which are only valid in path names and not in assembly names
25724 (currently slash, backslash and point), use Assembly.LoadFrom ()
25725 instead of Assembly.Load () on the `assembly' (before iteration
25726 over the link_paths).
25728 2002-04-26 Martin Baulig <martin@gnome.org>
25730 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25732 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25734 * class.cs (Property): use the new typemanager.MemberLookup
25736 (TypeContainer.MemberLookup): Implement using the
25737 TypeManager.MemberLookup now.
25739 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25740 and return MemberInfos, so that these can be used without an
25741 EmitContext (what we had before).
25743 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25745 * expression.cs: Fix the case where the argument to params if the
25746 type of the params. I omitted handling this before. Fixed
25748 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25750 * driver.cs: Call BootCorlib_PopulateCoreType
25752 * class.cs (Property.CheckBase): Check for properties only, not
25755 * interface.cs: Temporary hack: try/catch around the
25756 CustomAttributeBuilder, because I am getting an exception that I
25759 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25760 types whose definitions are required to be there (attributes are
25761 defined before standard types).
25763 Compute definitions as we boot the various types, as they are used
25764 immediately (value_type class will need object_type, but if we do
25765 not initialize object_type, we will pass a null, which will let
25766 the runtime pick the System.Object from the existing corlib, which
25767 is not what we want).
25769 2002-04-22 Patrik Torstensson <totte@labs2.com>
25771 * cs-tokenizer.cs: fixed a number of trim() issues.
25773 2002-04-22 Ravi Pratap <ravi@ximian.com>
25775 * expression.cs (Argument.Type): Ensure that we return the correct
25776 type when we have out or ref parameters [in which case we
25779 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25781 * class.cs (Property, Indexer): Allow extern modifier in there.
25783 * typemanager.cs (InitBaseTypes): Initializes object_type and
25784 value_type, since those will be used early on during the bootstrap
25785 process to compile corlib.
25787 (InitCoreTypes): Move code from here to InitBaseTypes.
25789 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25791 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25792 single-dimension arrays as using the ldlen opcode.
25794 Daniel Lewis discovered this optimization.
25796 * typemanager.cs: Add signature for System.Array::get_Length
25798 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25800 * statement.cs: report the error when the foreach does not apply to an
25801 array nor a collection.
25803 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25805 * expression.cs: Add implicit conversions to the operator ~.
25807 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25809 * typemanager.cs: Locate the decimal constructor.
25811 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25813 * attribute.cs: use the new property of TypeOf.
25814 * expression.cs: added 'get' property around typearg.
25816 These changes fix a build breaker reported by NickD. Is this the
25817 correct way to fix? If not, please, revert my changes and make it
25820 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25822 * attribute.cs: Add support for typeof in attribute invocations.
25823 I am not sure that this is right though.
25825 2002-04-14 Duncan Mak <duncan@ximian.com>
25827 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25828 Binary.Operator.Division case.
25830 2002-04-13 Ravi Pratap <ravi@ximian.com>
25832 * class.cs (DefineType): Ensure that we do a proper check on
25833 attribute types and also register it with the TypeManager.
25835 (TypeContainer.Targets): The default for attribute types is
25836 AttributeTargets.All.
25838 * attribute.cs (ApplyAttributes): Registering the attribute type
25839 is done elsewhere, not when we discover we have a Usage attribute.
25841 2002-04-12 Ravi Pratap <ravi@ximian.com>
25843 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25844 and get rid of is_delegate parameter.
25846 * everywhere : update.
25848 2002-04-12 Ravi Pratap <ravi@ximian.com>
25850 * cs-parser.jay (compilation_unit): Revamp completely to use
25851 some new ideas that I got from Rhys' grammar to solve the problems
25852 with assembly level attributes.
25854 (outer_declaration): New grammar production.
25856 (attribute_sections): Add.
25858 (opt_attributes): Base on attribute_sections
25860 (namespace_declaration): Allow opt_attributes to tackle the case
25861 when we have assembly level attributes - we are clever in this
25864 * attribute.cs (ApplyAttributes): Do not worry about assembly
25865 attributes in the non-global context.
25867 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25868 instead of SetGlobalAttributes.
25870 * class.cs, rootcontext.cs : Ensure we define and generate
25871 attribute types before anything else.
25873 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25874 and flag the new error -20 for the case when the attribute type
25875 does not have valid targets specified. csc does not catch this.
25877 * ../errors/errors.txt : update for error # -20
25879 2002-04-11 Ravi Pratap <ravi@ximian.com>
25881 * support.cs (InternalParameters.ParameterModifier): Do some null
25882 checking and return sane values.
25884 * class.cs (Method.Define): If we are a PInvoke method, ensure
25885 that we are static and extern. Report error # 601
25887 * ../errors/cs0601.cs : Add test case for the above error.
25889 2002-04-07 Ravi Pratap <ravi@ximian.com>
25891 * rootcontext.cs (attribute_types): We need to keep type of
25892 all attribute types separately and emit code for them first.
25894 (RegisterAttribute) : Implement.
25896 * class.cs (DefineType): Check if the current Type is a custom
25897 attribute type and register it accordingly.
25899 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25900 adding the first attribute twice and rename to
25902 (SetGlobalAttributes): this.
25904 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25907 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25908 if we are processing global arguments. Hmm, I am unsure of this.
25910 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25912 * expression.cs: added static array of strings to avoid calling
25913 Enum.ToString () for Operator in Binary. Significant recover of
25916 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25918 * class.cs (FindMembers): Allow the Builders of the various
25919 members to be null. If they are skip them. This only happens
25920 during the PInvoke declaration.
25922 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25924 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25925 failure, so we do not keep going afterwards.
25927 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25928 wanted to pass `false' as the `is_delegate' argument. If this is
25929 the case, why not use delegate_type == null to mean `is_delegate =
25930 false' and anything else as is_delegate = true.
25932 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25934 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25935 code for the section, not the beginning of the tests.
25937 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25939 * cfold.cs: Handle operator + (Enum x, Underlying x)
25941 * expression.cs (Binary): same. Warn about errors where we have
25942 Enum/Enum in operator + as well.
25944 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25947 - added support for switch(bool)
25948 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25949 - add TableSwitchEmit() to handle table-based switch statements
25951 2002-04-05 Ravi Pratap <ravi@ximian.com>
25953 * expression.cs (Invocation.OverloadResolve): Factor out code which
25954 does parameter compatibility checking with arguments so that we can
25955 re-use the code even from Delegate.VerifyApplicability
25957 (VerifyArgumentsCompat): Move above code here.
25959 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25960 and instead make a call to the above method.
25962 2002-03-31 Ravi Pratap <ravi@ximian.com>
25964 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25965 We use it to keep track of classes which are attribute types.
25967 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25969 * delegate.cs (Delegate.Define): Correctly define the types in the
25970 presence of fixed and array parameters.
25972 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25975 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25976 include NonPublic after the first iteration.
25978 * class.cs (Indexer.CheckBase): Only check if both parents are
25981 * cs-parser.jay (accessor_body): If empty, set to null.
25983 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25984 same code path here to resolve constants names that we did have in
25985 MemberAccess.DoResolve. There is too much code duplicated here.
25987 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25989 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25991 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25994 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25995 tokens, numbers and strings.
25997 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26000 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26001 asyncronous parameters and the regular parameters.
26003 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26004 specify the target directory.
26006 * expression.cs: (This.DoResolve): Simplify
26007 (As.Emit): Optimize, do not generate IsInst if the expression is
26008 always of the given type.
26010 (Is.DoResolve): Bug fix, we were reporting both always/never for
26013 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26014 creating too many unnecessary arrays.
26016 2002-03-31 Miguel de Icaza <miguel@ximian.com>
26018 * class.cs (EmitFieldInitializer): Use Assign expression to assign
26019 fields instead of rolling our own initializer. Takes care of all
26020 implicit conversions, and drops unnecessary static checks/argument.
26022 2002-03-31 Dick Porter <dick@ximian.com>
26024 * driver.cs: use the GetDirectories() return values properly, and
26025 use "/" as path separator.
26027 2002-03-30 Miguel de Icaza <miguel@ximian.com>
26029 * expression.cs (Unary): Optimize - - expr into expr.
26030 (Binary): Optimize a + (-b) into a -b.
26032 * codegen.cs (CodeGen): Made all methods static.
26034 2002-03-29 Miguel de Icaza <miguel@ximian.com>
26038 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26039 TypeBuilder property.
26041 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26044 * tree.cs: Removed the various RecordXXXX, and replaced with a
26045 single RecordDecl. Removed all the accessor methods, and just
26046 left a single access point Type
26048 * enum.cs: Rename DefineEnum to DefineType.
26050 * decl.cs: New abstract method `DefineType' used to unify the
26051 Defines for Enumerations, Interfaces, TypeContainers and
26054 (FindType): Moved LookupInterfaceOrClass here. Moved the
26055 LookupBaseClasses method that used to live in class.cs and
26056 interface.cs here, and renamed to FindType.
26058 * delegate.cs: Implement DefineType. Take advantage of the
26059 refactored pattern for locating the parent builder without taking
26060 the parent_builder argument (which we know does not work if we are
26061 nested, and triggering a toplevel definition).
26063 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26065 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26066 accessibility of a member has changed during override and report
26069 * class.cs (Method.Define, Property.Define): Only complain on
26070 overrides if the method is private, any other accessibility is
26071 fine (and since we just checked the permission is the same, we are
26074 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26075 and elif are processed always. The other pre-processing
26076 directives are only processed if we are "taking" the path
26078 2002-03-29 Martin Baulig <martin@gnome.org>
26080 * class.cs (Method.Emit): Only emit symbolic debugging info if the
26081 current location is not Null.
26083 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26084 a separate method so we can profile it.
26086 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26087 `span.Seconds' are just seconds, but no minutes or hours.
26088 (MainDriver): Profile the CodeGen.SaveSymbols calls.
26090 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26092 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26093 Remove the gratuitous set of Final:
26095 // If an interface implementation, then we can set Final.
26096 if (((flags & MethodAttributes.Abstract) == 0) &&
26097 implementing.DeclaringType.IsInterface)
26098 flags |= MethodAttributes.Final;
26100 I do not know what I was smoking when I used that.
26103 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26104 step into fixing the name resolution issues for delegates and
26105 unifying the toplevel name resolution.
26107 2002-03-28 Martin Baulig <martin@gnome.org>
26109 * class.cs (Method.Emit): If we have a symbol writer, call its
26110 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26111 tell it about the current method.
26113 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26114 writer that we're going to emit the first byte of IL code for a new
26115 statement (a new source line).
26116 (EmitContext.EmitTopBlock): If we have a symbol writer, call
26117 EmitContext.Mark() before emitting any code.
26119 * location.cs (SymbolDocument): Return null when we're Null.
26121 * statement.cs (Statement): Moved the `Location loc' variable here.
26122 (Statement.EmitBoolExpression): If we have a symbol writer, call
26123 ec.Mark() before emitting any code to tell it that we're at the
26124 beginning of a new statement.
26125 (StatementExpression): Added `Location' argument to the constructor.
26126 (Block): Added public readonly variable `StartLocation' and public
26127 variable `EndLocation'. The latter is to be set using SetEndLocation().
26128 (Block): Added constructor which takes a start and end location.
26129 (Block.SetEndLocation): New method. This sets the end location.
26130 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26131 local variables we create.
26132 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26133 each statement and do also mark the begin and end of the block.
26135 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26136 tell it the current lexer.Location, use Location.Null for the end of the
26138 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26139 current block, set its end location using SetEndLocation().
26140 (statement_expression): StatementExpression constructor now takes the
26141 lexer.Location as additional argument.
26142 (for_statement, declare_local_variables): Likewise.
26143 (declare_local_variables): When creating a new implicit block, use the
26144 new Block constructor and pass it the lexer.Location.
26146 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26148 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26149 members also on the parent interfaces recursively.
26151 2002-03-27 Miguel de Icaza <miguel@ximian.com>
26153 * report.cs: Use new formats, since Gonzalo finished the missing
26156 * expression.cs (Binary.ResolveOperator): added missing operator|
26157 operator& and operator^ for bool/bool.
26159 * cs-parser.jay: CheckDef now takes a Location argument that is
26160 used to report errors more precisly (instead of reporting the end
26161 of a definition, we try to track something which is a lot closer
26162 to the source of the problem).
26164 * cs-tokenizer.cs: Track global token use, so we can properly flag
26165 the use of #define/#undef after the first token has been seen.
26167 Also, rename the reportXXXX to Error_DescriptiveName
26169 * decl.cs (DeclSpace.IsTopLevel): Move property here from
26170 TypeContainer, so that Enum and Interface can use this too.
26172 * class.cs (TypeContainer.LookupInterfaceOrClass,
26173 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26174 `builder' argument. Typically this was used to pass the parent
26175 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26178 The problem is that a nested class could trigger the definition of
26179 a toplevel class, and the builder would be obviously wrong in that
26182 So we drop this argument, and we compute dynamically the
26183 TypeBuilder/ModuleBuilder (the correct information was available
26184 to us anyways from DeclSpace.Parent)
26186 * interface.cs (Interface.DefineInterface): Drop builder
26187 parameter cleanup like class.cs
26189 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
26192 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26195 (Try.Emit): Propagate the returns value from the statement.
26197 (Return.Emit): Even if we are leavning
26199 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26201 * modifiers.cs: Fix the computation of MethodAttributes flags.
26203 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26205 * driver.cs: allow compilation of files that start with '/'.
26206 Add a default case when checking the argument of --target.
26208 2002-03-25 Miguel de Icaza <miguel@ximian.com>
26210 * interface.cs: Implement the same search algorithm for types in
26211 the interface code.
26213 * delegate.cs: Do not allow multiple definition.
26215 * Recovered ChangeLog that got accidentally amputated
26217 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26219 * rootcontext.cs: Load manually enum to allow core classes to
26220 contain enumerations.
26222 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26223 Update to new static methods in TypeManager.
26225 * typemanager.cs (GetMethod, GetConstructor): Use our
26226 implementation of FindMembers to find the members, since during
26227 corlib compilation, the types are TypeBuilders and GetMethod and
26228 GetConstructor do not work.
26230 Make all methods in TypeManager static.
26232 (InitCodeHelpers): Split the functionality from
26233 the InitCodeTypes function.
26235 * driver.cs: Call InitCodeHelpers after we have populated the
26238 * cs-parser.jay (delegate_declaration): we did not used to compute
26239 the delegate name correctly for void delegates.
26241 2002-03-24 Miguel de Icaza <miguel@ximian.com>
26243 * rootcontext.cs (RootContext): Init the interface_resolve_order
26244 and type_container_resolve_order always.
26246 (ResolveCore, BootstrapCorlib_ResolveClass,
26247 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26248 compiler when compiling with --nostdlib
26250 * class.cs (TypeContainer.DefineType): Check that our parent is
26251 not null. This test is most important when we are bootstraping
26254 * codegen.cs: Split out the symbol writing code.
26256 2002-03-25 Martin Baulig <martin@gnome.org>
26258 * driver.cs (-g): Made -g an alias for --debug.
26260 2002-03-24 Martin Baulig <martin@gnome.org>
26262 * codegen.cs (SymbolWriter): New public variable. Returns the
26263 current symbol writer.
26264 (CodeGen): Added `bool want_debugging_support' argument to the
26265 constructor. If true, tell the ModuleBuild that we want debugging
26266 support and ask it for the ISymbolWriter.
26267 (Save): If we have a symbol writer, call it's Close() method after
26268 saving the assembly.
26270 * driver.c (--debug): New command line argument to create a
26271 debugger information file.
26273 * location.cs (SymbolDocument): New public property. Returns an
26274 ISymbolDocumentWriter object for the current source file or null
26275 if we don't have a symbol writer.
26277 2002-03-21 Miguel de Icaza <miguel@ximian.com>
26279 * driver.cs (LoadAssembly): Correctly return when all the paths
26280 have been tried and not before.
26282 * statement.cs (Switch.Emit): return the actual coverage for this
26283 statement (returns/not-returns)
26285 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26286 switch of the statement if we are the last switch section. That
26287 kills two problems: try/catch problems (we used to emit an empty
26288 nop at the end) and switch statements where all branches would
26291 2002-03-19 Miguel de Icaza <miguel@ximian.com>
26293 * driver.cs: Add default assemblies (the equivalent to the
26294 Microsoft CSC.RSP file)
26296 * cs-tokenizer.cs: When updating `cols and setting it to zero,
26297 also update tokens_seen and set it to false.
26299 * driver.cs: Implement --recurse for Mike.
26301 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26302 correctly splitting out the paths.
26304 2002-03-18 Miguel de Icaza <miguel@ximian.com>
26306 * interface.cs (Interface.PopulateProperty): Instead of using
26307 `parent' as the declaration space for the set parameters, use
26310 * support.cs (InternalParameters): InternalParameters constructor
26311 takes a DeclSpace instead of a TypeContainer.
26313 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26314 types are being initialized, load the address of it before calling
26317 (New): Provide a mechanism to disable the generation of local
26318 value type temporaries when the caller will be providing us with
26319 an address to store it.
26321 (ArrayCreation.EmitDynamicInitializers): Use it.
26323 2002-03-17 Miguel de Icaza <miguel@ximian.com>
26325 * expression.cs (Invocation.EmitArguments): Only probe for array
26326 property if there is more than one argument. Sorry about that.
26328 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26329 empty param arrays.
26331 * class.cs (Method.LabelParameters): Fix incorrect code path that
26332 prevented the `ParamArrayAttribute' from being applied to the
26335 2002-03-16 Miguel de Icaza <miguel@ximian.com>
26337 * support.cs (ReflectionParameters): Correctly compute whether the
26338 last argument is a params array. Fixes the problem with
26341 * typemanager.cs: Make the assemblies array always be non-null
26342 (empty, but non-null)
26344 * tree.cs (RecordDecl): New function that abstracts the recording
26345 of names. This reports error 101, and provides a pointer to the
26346 previous declaration. Fixes a crash in the compiler.
26348 * cs-parser.jay (constructor_declaration): Update to new grammar,
26349 and provide a constructor_body that can be empty.
26351 2002-03-15 Miguel de Icaza <miguel@ximian.com>
26353 * driver.cs: Add support for --resources.
26355 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26356 Make all types for the various array helper methods be integer.
26358 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26359 CheckState to ConvCast.
26361 (ConvCast): Now it takes a `checked' state argument, to avoid
26362 depending on the emit context for the conversion, and just using
26363 the resolve time setting.
26365 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26366 instead of Invocation.EmitArguments. We do not emit the original
26367 arguments, instead we emit those which have been converted to
26368 unsigned int expressions.
26370 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26372 * codegen.cs: ditto.
26374 * expression.cs (LocalVariableReference): Drop the use of the
26375 Store function that depended on the variable index.
26377 * statement.cs (VariableInfo): Drop the `Idx' property from this
26378 class, as this is not taking into account the indexes for
26379 temporaries tat we generate during the execution, getting the
26382 * class.cs: First emit class initializers, then call the parent
26385 * expression.cs (Binary): Fix opcode emision.
26386 (UnaryMutator.EmitCode): Support checked code generation
26388 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26389 matches for events for both the Static and Instance scans,
26390 pointing to the same element. Fix that.
26392 2002-03-14 Miguel de Icaza <miguel@ximian.com>
26394 * rootcontext.cs (ResolveTree): Always set the
26395 interface_resolve_order, because nested interfaces will be calling
26398 * class.cs (GetInterfaceOrClass): Track the same resolution
26399 process used by TypeManager.LookupType. This fixes the nested
26400 type lookups in class declarations (separate path from
26403 (TypeContainer.DefineType): Also define nested interfaces.
26404 (TypeContainer.RegisterOrder): New public function used to
26405 register the order in which child interfaces need to be closed.
26407 Nested interfaces need to be closed after their parents have been
26410 * interface.cs (InterfaceAttr): Put all the logic for computing
26411 the interface attribute here.
26413 (DefineInterface): Register our interface order with the
26414 RootContext or with the TypeContainer depending on the case.
26416 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26418 * cs-parser.jay: rework foreach statement to work with the new
26419 changes to the policy on SimpleNames.
26421 * report.cs: support Stacktrace on warnings as well.
26423 * makefile: drop --unsafe and /unsafe from the compile.
26425 2002-03-13 Ravi Pratap <ravi@ximian.com>
26427 * ecore.cs (StandardConversionExists): Modify to take an Expression
26428 as the first parameter. Ensure we do null -> reference type conversion
26431 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26432 temporary Expression objects.
26434 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26436 * interface.cs: workaround bug in method overloading resolution
26437 (there is already a bugzilla bug for it).
26439 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26441 We could also solve this problem by having a separate path for
26442 performing type lookups, instead of DoResolve, we could have a
26443 ResolveType entry point, and only participating pieces of the
26444 production (simplename, deref, array) would implement this.
26446 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26447 signal SimpleName to only resolve type names and not attempt to
26448 resolve anything else.
26450 * expression.cs (Cast): Set the flag.
26452 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26454 * class.cs: Only report 108 if there is no `new' modifier.
26456 * cs-parser.jay: rework foreach statement to work with the new
26457 changes to the policy on SimpleNames.
26459 * report.cs: support Stacktrace on warnings as well.
26461 * makefile: drop --unsafe and /unsafe from the compile.
26463 2002-03-11 Miguel de Icaza <miguel@ximian.com>
26465 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26466 lookups here, instead of doing that at parse time. This means
26467 that our grammar will not introduce `LocalVariableReferences' as
26468 expressions at this point. That solves the problem of code like
26472 static void Main ()
26476 This is only half the fix. The full fix requires parameters to
26477 also be handled in this way.
26479 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26480 makes the use more obvious of the DeclSpace. The
26481 ec.TypeContainer.TypeBuilder is now only used to pull the
26482 TypeBuilder for it.
26484 My theory is that I can get rid of the TypeBuilder completely from
26485 the EmitContext, and have typecasts where it is used (from
26486 DeclSpace to where it matters).
26488 The only pending problem is that the code that implements Aliases
26489 is on TypeContainer, and probably should go in DeclSpace.
26491 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26492 lookups here, instead of doing that at parse time. This means
26493 that our grammar will not introduce `LocalVariableReferences' as
26494 expressions at this point. That solves the problem of code like
26498 static void Main ()
26502 This is only half the fix. The full fix requires parameters to
26503 also be handled in this way.
26505 * class.cs (Property.DefineMethod): When implementing an interface
26506 method, set newslot, when implementing an abstract method, do not
26507 set the flag (before we tried never setting it, or always setting
26508 it, which is the difference).
26509 (Indexer.DefineMethod): same.
26510 (Method.DefineMethod): same.
26512 * ecore.cs: Only set the status used flag if we get back a Field.
26514 * attribute.cs: Temporary hack, so Paolo can keep working.
26516 2002-03-08 Ravi Pratap <ravi@ximian.com>
26518 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26519 the unmanaged type in the case we have a MarshalAs attribute.
26521 (Resolve): Handle the case when we are parsing the special MarshalAs
26522 attribute [we need to store the unmanaged type to use later]
26524 * typemanager.cs (marshal_as_attr_type): Built in type for the
26525 MarshalAs Attribute.
26527 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
26528 on parameters and accordingly set the marshalling info.
26530 2002-03-09 Miguel de Icaza <miguel@ximian.com>
26532 * class.cs: Optimizing slightly by removing redundant code after
26533 we switched to the `NoTypes' return value.
26534 (Property.DefineMethod): use NoTypes here too.
26536 This fixes the bug I introduced in my last batch of changes.
26538 2002-03-05 Ravi Pratap <ravi@ximian.com>
26540 * tree.cs (RecordEnum): Add. We now keep track of enums too.
26542 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26543 Enums since those are types too.
26545 * cs-parser.jay (enum_declaration): Record enums as we parse them.
26547 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
26548 thanks to a call during the lookup process.
26550 2002-03-07 Miguel de Icaza <miguel@ximian.com>
26552 * statement.cs (Foreach): Lots of work to accomodate a particular
26553 kind of foreach statement that I had not kept in mind. It is
26554 possible to have foreachs on classes that provide a GetEnumerator
26555 method that return objects that implement the "pattern" for using
26556 a foreach, there is no need to support GetEnumerator
26559 This is needed to compile nant.
26561 * decl.cs: Only report 114 if the member is not `Finalize' and if
26562 the warning level is at least 2.
26564 * class.cs: Moved the compare function from Method to
26567 (MethodSignature.InheritableMemberSignatureCompare): Add new
26568 filter function that is used to extract inheritable methods from a
26571 (Method.Define): Use the new `inheritable_method_signature_filter'
26574 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26577 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26579 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26581 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26583 * expression.cs: Pass location information to
26584 ConvertImplicitStandard.
26586 * class.cs: Added debugging code to track return values from
26589 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26591 * expression.cs (Is.DoResolve): If either side of the `is' is an
26592 interface, do not flag the warning.
26594 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26597 * report.cs: Allow for --fatal to be used with --probe.
26599 * typemanager.cs (NoTypes): Move the definition for the empty Type
26602 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26604 (TypeContainer.DefineProxy): New function used to proxy to parent
26605 implementations when implementing interfaces.
26606 (TypeContainer.ParentImplements): used to lookup if our parent
26607 implements a public function that is required by an interface.
26608 (TypeContainer.VerifyPendingMethods): Hook this up.
26610 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26611 `modules' and `assemblies' arraylists into arrays. We only grow
26612 these are the very early start up of the program, so this improves
26613 the speedof LookupType (nicely measured).
26615 * expression.cs (MakeByteBlob): Replaced unsafe code with
26616 BitConverter, as suggested by Paolo.
26618 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26619 folding of string concatenation, but if either side is a string,
26620 and the other is not, then return null, and let the runtime use
26621 the concatenation on the string plus the object (using
26622 `Object.ToString').
26624 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26626 Constant Folding has been implemented now.
26628 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26629 the error instead on types that are not supported in one's
26632 * constant.cs (Constant and all children): New set of functions to
26633 perform implict and explicit conversions.
26635 * ecore.cs (EnumConstant): Implement the new functions to perform
26636 conversion by proxying to the child expression.
26638 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26639 own separate setting that can not be turned off from the command
26640 line using --unchecked or --checked and is only controlled using
26641 the checked/unchecked statements and expressions. This setting is
26642 used by the constant folder to flag errors.
26644 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26645 ConstantCheckState as well.
26647 During Resolve, they also have to flag the state, because the
26648 constant folder runs completely in the Resolve phase.
26650 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26653 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26655 * cfold.cs: New file, this file contains the constant folder.
26657 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26658 argument to track whether we are using the resulting address to
26659 load or store a value and provide better error messages.
26661 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26662 new AddressOf arguments.
26664 * statement.cs (Foreach.EmitCollectionForeach): Update
26666 * expression.cs (Argument.Emit): Call AddressOf with proper
26667 arguments to track usage.
26669 (New.DoEmit): Call AddressOf with new arguments.
26671 (Unary.Emit): Adjust AddressOf call.
26673 2002-03-01 Ravi Pratap <ravi@ximian.com>
26675 * cs-parser.jay (member_access): Change the case for pre-defined types
26676 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26679 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26682 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26683 essentially like methods and apply attributes like MethodImplOptions to them too.
26685 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26688 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26689 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26692 * Update code everywhere accordingly.
26694 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26696 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26698 2002-02-28 Ravi Pratap <ravi@ximian.com>
26700 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26701 try performing lookups against those instead of jumping straight into using
26702 the 'using' clauses.
26704 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26706 (LookupType): Perform lookups in implicit parents too.
26708 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26709 sequence as RootContext.LookupType.
26711 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26712 the various cases of namespace lookups into this method.
26714 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26716 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26717 in positional arguments)
26719 * class.cs (Operator): Update the AllowedModifiers to contain
26722 * cs-parser.jay: Update operator declaration to allow for the
26723 operator body to be empty.
26725 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26728 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26730 * class.cs (Method.Emit): Label parameters.
26732 * driver.cs: Return 1 or 0 as the program exit code.
26734 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26736 * expression.cs: Special case the `null' object when trying to
26737 auto-compute the type, as anything can be explicitly converted to
26740 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26741 spotting this Paolo.
26743 (Expression.ImplicitNumericConversion): Perform comparissions of
26744 the type using the underlying type in the case of an enumeration
26745 rather than using the enumeration type for the compare.
26747 Cope with the underlying == type case, which is not possible to
26750 (Expression.ConvertNumericExplicit): Perform comparissions of
26751 the type using the underlying type in the case of an enumeration
26752 rather than using the enumeration type for the compare.
26754 * driver.cs: If the user does not supply an extension, assume .exe
26756 * cs-parser.jay (if_statement): Rewrote so that we can track the
26757 location for the if statement.
26759 * expression.cs (Binary.ConstantFold): Only concat strings when
26760 the operation is "+", not everything ;-)
26762 * statement.cs (Statement.EmitBoolExpression): Take a location
26764 (If, While, Do): Track location.
26766 * expression.cs (Binary.ResolveOperator): In the object + string
26767 case, I was missing a call to ConvertImplicit
26769 2002-02-25 Ravi Pratap <ravi@ximian.com>
26771 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26772 Location arguments. Ensure we use RootContext.LookupType to do our work
26773 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26775 * interface.cs (PopulateMethod): Handle the type of the parameter being
26778 * expression.cs (Invocation.BetterFunction): Handle the case when we
26779 have a params method with no fixed arguments and a call is made with no
26782 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26784 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26785 the verbatim-string-literal
26787 * support.cs (InternalParameters.ParameterModifier): handle null
26789 (InternalParameters.ParameterType): ditto.
26791 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26792 duplicating the name of the variable parameter.
26793 (GetParameterByName): Fix bug where we were not looking up array
26794 paramters if they were the only present (thanks Paolo!).
26795 (GetParameterInfo): We only have an empty set of types if both
26796 fixed and array are set to null.
26797 (GetParameterInfo-idx): Handle FixedParameter == null
26799 * cs-parser.jay: Handle the case where there is no catch
26800 statements (missing null test).
26802 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26804 * driver.cs (MainDriver): Be conservative on our command line
26807 Catch DirectoryNotFoundException when calling GetFiles.
26809 (SplitPathAndPattern): Used to split the input specification into
26810 a path and a pattern that we can feed to Directory.GetFiles.
26812 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26814 * statement.cs (Fixed): Implement the last case of the Fixed
26815 statement (string handling).
26817 * expression.cs (StringPtr): New class used to return a char * to
26818 a string; Used by the Fixed statement.
26820 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26822 * expression.cs (Binary.ResolveOperator): Remove redundant
26823 MemberLookup pn parent type.
26824 Optimize union call, we do not need a union if the types are the same.
26825 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26828 Specialize the use of MemberLookup everywhere, instead of using
26829 the default settings.
26831 (StackAlloc): Implement stackalloc keyword.
26833 * cs-parser.jay: Add rule to parse stackalloc.
26835 * driver.cs: Handle /h, /help, /?
26837 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26838 before we supported unsafe code.
26840 * makefile: add --unsafe to the self compilation of mcs.
26842 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26844 * expression.cs (PointerArithmetic): New class that is used to
26845 perform pointer arithmetic.
26846 (Binary.Resolve): Handle pointer arithmetic
26847 Handle pointer comparission.
26848 (ArrayPtr): Utility expression class that is used to take the
26849 address of an array.
26851 (ElementAccess): Implement array access for pointers
26853 * statement.cs (Fixed): Implement fixed statement for arrays, we
26854 are missing one more case before we are done.
26856 * expression.cs (Indirection): Implement EmitAssign and set the
26857 ExprClass to Variable. This allows pointer dereferences to be
26858 treated as variables, and to have values assigned to them.
26860 * ecore.cs (Expression.StoreFromPtr): New utility function to
26861 store values dereferencing.
26863 2002-02-20 Ravi Pratap <ravi@ximian.com>
26865 * expression.cs (Binary.ResolveOperator): Ensure that we are
26866 not trying to operate on a void type - this fixes the reported
26869 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26870 the parent implementation is sealed.
26872 * ../errors/cs0239.cs : Add.
26874 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26876 * typemanager.cs (unverifiable_code_type): Corresponds to
26877 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26878 which have unsafe code in them.
26880 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26883 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26885 * cs-tokenizer.cs: Add support for @"litreal strings"
26887 Make tokenizer accept pre-processor directives
26888 on any column (remove the old C-like limitation).
26890 * rootcontext.cs (EmitCode): Emit any global attributes.
26891 (AddGlobalAttributes): Used to keep track of assembly attributes.
26893 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26895 * cs-parser.jay: Add support for global attributes.
26897 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26899 * expression.cs (Indirection): New helper class. Unary will
26900 create Indirection classes to be able to implement the
26901 IMemoryLocation interface on it.
26903 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26905 * cs-parser.jay (fixed_statement): reference the right statement.
26907 * statement.cs (Fixed.Emit): Finish implementing the fixed
26908 statement for the &x case.
26910 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26912 * class.cs (Property.Define, Method.Define): Remove newslot when
26915 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26916 wrong. NewSlot should only be used if the `new' keyword is present.
26918 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26919 locating our system dir. Sorry about this.
26921 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26923 * driver.cs (GetSystemDir): Compute correctly the location of our
26924 system assemblies. I was using the compiler directory instead of
26925 the library directory.
26927 2002-02-13 Ravi Pratap <ravi@ximian.com>
26929 * expression.cs (BetterFunction): Put back in what Miguel commented out
26930 since it is the correct fix. The problem is elsewhere ;-)
26932 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26933 parameters of the parms method are themselves compatible or not !
26935 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26936 to check that a class implements an interface before saying that an implicit
26937 conversion was allowed. Use ImplementsInterface to do the checking.
26939 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26941 * class.cs (Method.Define): Track whether we are an explicit
26942 implementation or not. And only call DefineMethodOverride if we
26943 are an explicit implementation.
26945 (Property.DefineMethod): Ditto.
26947 2002-02-11 Ravi Pratap <ravi@ximian.com>
26949 * expression.cs (BetterFunction): Catch hideous bug which was
26950 preventing us from detecting ambiguous calls due to implicit casts i.e
26953 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26955 * support.cs (Pair): Remove un-needed method. I figured why I was
26956 getting the error in cs-parser.jay, the variable in a foreach loop
26957 is readonly, and the compiler does not really treat this as a variable.
26959 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26960 instead of EQUALS in grammar.
26962 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26964 * expression.cs (Unary.DoResolve): Check whether the argument is
26967 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26969 * support.cs: Api for Pair to set a value. Despite the fact that
26970 the variables are public the MS C# compiler refuses to compile
26971 code that accesses the field if the variable is part of a foreach
26974 * statement.cs (Fixed): Begin implementation of the fixed
26977 (Block.AddVariable): Return the VariableInfo on success and null
26978 on failure instead of true/false.
26980 * cs-parser.jay (foreach): Catch errors on variables already
26981 defined (we were ignoring this value before) and properly unwind
26982 the block hierarchy
26984 (fixed_statement): grammar for the fixed statement.
26986 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26988 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26989 pointer types to be incretemented.
26991 (SizeOf): Implement.
26993 * cs-parser.jay (pointer_member_access): Implement
26994 expr->IDENTIFIER production.
26996 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26997 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27000 (Unary): Implement indirection.
27002 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27003 use in non-unsafe context).
27005 (SimpleName.DoResolve): Check for pointers in field access on safe
27008 (Expression.LoadFromPtr): Factor the load-indirect code in this
27009 function. This was duplicated in UnboxCast and ParameterReference
27011 2002-01-24 Miguel de Icaza <miguel@ximian.com>
27013 * expression.cs (ComposedCast): report an error if a pointer cast
27014 is used in a safe region.
27016 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27017 pointer type casts in unsafe context.
27019 * codegen.cs (EmitContext): Set up IsUnsafe.
27021 * cs-parser.jay (non_expression_type): Add productions for pointer
27024 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27025 code. We should not use force into static mode if the method is
27026 not virtual. Fixes bug in MIS
27028 * statement.cs (Do.Emit, While.Emit, For.Emit,
27029 Statement.EmitBoolExpression): Add support to Do and While to
27030 propagate infinite loop as `I do return' semantics.
27032 Improve the For case to also test for boolean constants.
27034 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27035 to the list of attributes we can add.
27037 Remove `EmitContext' argument.
27039 * class.cs (Method.Define): Apply parameter attributes.
27040 (Constructor.Define): Apply parameter attributes.
27041 (MethodCore.LabelParameters): Move here the core of labeling
27044 * support.cs (ReflectionParameters.ParameterModifier,
27045 InternalParameters.ParameterModifier): Use IsByRef on the type and
27046 only return the OUT bit for these parameters instead of in/out/ref
27049 This is because I miss-understood things. The ParameterInfo.IsIn
27050 and IsOut represent whether the parameter has the [In] and [Out]
27053 2002-01-22 Miguel de Icaza <miguel@ximian.com>
27055 * ecore.cs (FieldExpr.Emit): Release temporaries.
27057 * assign.cs (LocalTemporary.Release): new function.
27059 * codegen.cs (EmitContext.GetTemporaryStorage,
27060 EmitContext.FreeTemporaryStorage): Rework the way we deal with
27061 temporary storage. Now we can "put back" localbuilders when we
27064 2002-01-21 Miguel de Icaza <miguel@ximian.com>
27066 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27067 need to make a copy of the variable to generate verifiable code.
27069 2002-01-19 Miguel de Icaza <miguel@ximian.com>
27071 * driver.cs: Compute dynamically the system directory.
27073 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27074 Slower, but more generally useful. Used by the abstract
27075 registering implementation.
27077 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27078 the rules for the special rule on Type/instances. First check if
27079 we have the same name, and if so, try that special static path
27080 rather than the instance path.
27082 2002-01-18 Miguel de Icaza <miguel@ximian.com>
27084 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27087 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27088 Enum, ValueType, Delegate or Array for non-corlib compiles.
27090 * cs-tokenizer.cs: Catch long identifiers (645)
27092 * typemanager.cs (IndexerPropetyName): Ravi never tested this
27095 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27096 fix, we were returning too early, so we were not registering
27097 pending methods from abstract classes.
27099 Do not register pending methods if the class is abstract.
27101 * expression.cs (Conditional.DoResolve): Report circular implicit
27102 conversions when we neecd to compute it for conditional
27105 (Is.DoResolve): If the expression is always of the provided type,
27106 flag warning 183. If the expression can not ever be of the
27107 provided type flag warning 184.
27109 * class.cs: Catch 169 as well.
27111 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27114 2002-01-18 Nick Drochak <ndrochak@gol.com>
27116 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
27118 2002-01-17 Miguel de Icaza <miguel@ximian.com>
27120 * interface.cs: (PopulateMethod): Check for pointers being defined
27121 only if the unsafe context is active.
27122 (PopulateProperty): ditto.
27123 (PopulateIndexer): ditto.
27125 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27126 specified. If pointers are present, make sure that they are
27127 present in an unsafe context.
27128 (Constructor, Constructor.Define): ditto.
27129 (Field, Field.Define): ditto.
27130 (Property, Property.Define): ditto.
27131 (Event, Event.Define): ditto.
27133 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27134 hashtable if there are classes or structs defined.
27136 * expression.cs (LocalVariableReference.DoResolve): Simplify this
27137 code, as the constant resolution moved.
27139 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27140 the metadata, so we can flag error 133.
27142 * decl.cs (MemberCore.UnsafeOK): New function to test that a
27143 pointer is being declared in an unsafe context.
27145 2002-01-16 Miguel de Icaza <miguel@ximian.com>
27147 * modifiers.cs (Modifiers.Check): Require a Location argument.
27148 Report error 227 for Unsafe use.
27150 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27152 * statement.cs (For.Emit): If the test is null, then report that
27153 we do `return', as we wont reach anything afterwards.
27155 (Switch.SwitchGoverningType): Track the expression that matched
27158 * driver.cs: Allow negative numbers as an error code to flag.
27160 * cs-parser.jay: Handle 1551.
27162 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27164 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27166 * cs-parser.jay: Report 1518 (type declaration can only contain
27167 class, struct, interface, enum or delegate)
27169 (switch_label): Report 1523 (keywords `case' or `default' must
27172 (opt_switch_sections): Report 1522 (empty switch)
27174 * driver.cs: Report 1515 (response file specified multiple times)
27175 Report 1516 (Source file specified multiple times).
27177 * expression.cs (Argument.Resolve): Signal 1510
27179 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27180 access not allowed in static code)
27182 2002-01-11 Ravi Pratap <ravi@ximian.com>
27184 * typemanager.cs (IsPointerType): Utility method which we are going
27187 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27188 the object type, so we take care of that.
27190 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27192 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27193 added to non-params parameters :-)
27195 * typemanager.cs (CSharpName): Include 'void' type too.
27197 (void_ptr_type): Include in the set of core types.
27199 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
27202 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
27205 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
27206 completely forgotten about it.
27208 2002-01-10 Ravi Pratap <ravi@ximian.com>
27210 * cs-parser.jay (pointer_type): Add. This begins our implementation
27211 of parsing rules for unsafe code.
27213 (unsafe_statement): Implement.
27215 (embedded_statement): Modify to include the above.
27217 * statement.cs (Unsafe): Implement new class for unsafe blocks.
27219 * codegen.cs (EmitContext.InUnsafe): Add. This determines
27220 if the current context is an unsafe one.
27222 * cs-parser.jay (local_variable_pointer_type): Since local variable types
27223 are handled differently, we need separate rules for them.
27225 (local_variable_declaration): Update to use local_variable_pointer_type
27226 to allow variable declarations of unmanaged pointer types.
27228 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27229 in unsafe contexts.
27231 * ../errors/cs0214.cs : Add.
27233 2002-01-16 Nick Drochak <ndrochak@gol.com>
27235 * makefile: remove 'response' file when cleaning.
27237 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27239 * cs-parser.jay: Report 1524.
27241 2002-01-14 Miguel de Icaza <miguel@ximian.com>
27243 * typemanager.cs (RegisterMethod): drop checking if we have
27244 registered this from here
27246 2002-01-12 Miguel de Icaza <miguel@ximian.com>
27248 * class.cs (Method.EmitDestructor): Implement calling our base
27251 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27252 value of InFinally.
27254 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27255 this routine and will wrap the call in a try/catch block. Deal
27258 2002-01-11 Miguel de Icaza <miguel@ximian.com>
27260 * ecore.cs (Expression.MemberLookup): instead of taking a
27261 parameter `same_type' that was used to tell whether we could
27262 access private members we compute our containing type from the
27265 (FieldExpr): Added partial support for volatile fields. This does
27266 not work for volatile fields exposed from assemblies, as I can not
27267 figure out how to extract the modreq from it.
27269 Updated all the source files to use this.
27271 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27272 because it is referenced by MemberLookup very often.
27274 2002-01-09 Ravi Pratap <ravi@ximian.com>
27276 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27277 TypeBuilder.GetCustomAttributes to retrieve what we need.
27279 Get rid of redundant default_member_attr_type as this is the same as
27280 default_member_type which already exists.
27282 * interface.cs, attribute.cs : Update accordingly.
27284 2002-01-08 Miguel de Icaza <miguel@ximian.com>
27286 * typemanager.cs: Enable IndexerPropertyName again. It does not
27287 work for TYpeBuilders though. Ravi, can you please fix this?
27289 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27291 * expression.cs (Argument.Emit): Handle the case of ref objects
27292 being passed to ref functions;
27294 (ParameterReference.EmitLoad): Loads the content of the pointer
27295 without dereferencing.
27297 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27299 * cs-tokenizer.cs: Implemented the pre-processing expressions.
27301 2002-01-08 Ravi Pratap <ravi@ximian.com>
27303 * class.cs (Indexer.DefineMethod): Incorporate the interface
27304 type in the name of the method if we are doing explicit interface
27307 * expression.cs (ConversionExists): Remove as it is completely obsolete.
27309 (BetterConversion): Fix extremely trivial bug where we were referring to
27310 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27313 * ../errors/bug16.cs : Add although we have fixed it.
27315 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27317 * expression.cs (BaseIndexer): Begin implementation.
27319 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27321 * cs-parser.jay (indexer_declarator): Use qualified_identifier
27322 production directly to remove a shift/reduce, and implement
27323 explicit interface implementation.
27325 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27326 after a floating point suffix.
27328 * expression.cs (DoNumericPromotions): Improved the conversion for
27329 uint/uint. If we have a constant, we avoid doing a typecast to a
27332 * class.cs (Indexer): Implement explicit interface implementation
27335 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27337 * class.cs: make the default instance constructor public and hidebysig.
27339 2001-01-03 Ravi Pratap <ravi@ximian.com>
27341 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27342 so we can call it from elsewhere.
27344 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27345 we emit it internally if the class has a defined indexer; otherwise the user
27346 emits it by decorating the class definition with the DefaultMemberAttribute.
27348 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27349 attribute is not used on a type which defines an indexer.
27351 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27352 character when we skip whitespace.
27354 * ../errors/cs0646.cs : Add.
27356 2002-01-03 Miguel de Icaza <miguel@ximian.com>
27358 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27361 * makefile: Add practical target `mcs3.exe' which builds the third
27362 generation compiler.
27364 * expression.cs (New): Fix structures constructor calling.
27366 * class.cs (Property, Method, Indexer): Emit Final flag on the
27367 method if we are an interface implementation and we are not
27370 * ecore.cs (PropertyExpr): New public field `IsBase', tells
27371 whether this property is referencing a `base' method.
27373 * expression.cs (Invocation.EmitCall): take an extra argument:
27374 is_base, this is used to determine whether the `call' or
27375 `callvirt' opcode should be used.
27378 * delegate.cs: update EmitCall.
27380 * class.cs (Method.Define): Set NewSlot for the cases where we are
27381 not implementing an interface method.
27383 (Property.Define): ditto.
27385 2002-01-02 Miguel de Icaza <miguel@ximian.com>
27387 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27388 'r'. Allows mcs to parse itself fully.
27390 2002-01-02 Ravi Pratap <ravi@ximian.com>
27392 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27393 of the number of initializers that require the InitializeArray method.
27395 (CheckIndices): Store the Expression in all cases - not the plain value. Also
27396 update the above field where necessary.
27398 (MakeByteBlob): Update accordingly.
27400 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
27403 (EmitDynamicInitializers): Update in accordance with the new optimization.
27405 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27406 same OpCode applies.
27408 * cs-parser.jay : Fix some glaring errors I introduced.
27410 2002-01-01 Ravi Pratap <ravi@ximian.com>
27412 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27413 so that we can check for name clashes there too.
27415 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27416 for interface indexers.
27418 * interfaces.cs (Define): Emit the default member attribute.
27420 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27421 variable was being referred to while setting the value ;-)
27423 2002-01-01 Miguel de Icaza <miguel@ximian.com>
27425 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27426 byte-by-byte information when we know the data is zero.
27428 Make the block always a multiple of 4, because
27429 DefineInitializedData has a bug.
27431 * assign.cs: Fix, we should assign from the temporary, not from
27434 * expression.cs (MakeByteBlob): Fix my incorrect code.
27436 2001-12-31 Miguel de Icaza <miguel@ximian.com>
27438 * typemanager.cs (EnumToUnderlying): This function is used to get
27439 the underlying type from an enumeration, because it does not
27442 * constant.cs: Use the I4_S form for values between -128 and 127.
27444 * statement.cs (Block.LookupLabel): Looks up a label.
27445 (Block): Drop support for labeled blocks.
27447 (LabeledStatement): New kind of statement that represents a label
27450 (Goto): Finally implement this bad boy.
27452 * cs-parser.jay: Update to reflect new mechanism to implement
27455 2001-12-30 Miguel de Icaza <miguel@ximian.com>
27457 * codegen.cs (EmitContext.This): a codegen property that keeps the
27458 a single instance of this instead of creating many different this
27461 * delegate.cs (Delegate.DoResolve): Update to use the property;
27463 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27465 * expression.cs (BaseAccess.DoResolve): Ditto.
27467 2001-12-29 Ravi Pratap <ravi@ximian.com>
27469 * typemanager.cs (methodimpl_attr_type): Add to hold the type
27470 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27472 (InitCoreTypes): Update accordingly.
27474 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27475 so we can quickly store the state.
27477 (ApplyAttributes): Set the correct implementation flags
27478 for InternalCall methods.
27480 2001-12-29 Miguel de Icaza <miguel@ximian.com>
27482 * expression.cs (EmitCall): if a method is not virtual, then do
27483 not use callvirt on it.
27485 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27486 user defined stuff) requires the use of stobj, which takes an
27487 address on the stack instead of an array and an index. So emit
27488 the Ldelema operation for it.
27490 (EmitStoreOpcode): Use stobj for valuetypes.
27492 (UnaryMutator.EmitCode): Use the right 1 value depending on
27493 whether we are dealing with int64/uint64, float or doubles.
27495 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27496 constructors that I implemented last night.
27498 (Constructor.IsDefault): Fix to work properly for static
27501 * cs-parser.jay (CheckDef): report method signature errors.
27502 Update error number 103 to be 132.
27504 * decl.cs: New AdditionResult enumeration value: MethodExists.
27505 Although we do this check for methods later on in the semantic
27506 analysis, catching repeated default constructors is so easy that
27507 we catch these here.
27509 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27512 (ParameterReference.EmitAssign, Emit): handle
27515 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27516 (ArrayAccess.EmitStoreOpcode): ditto.
27518 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27520 * expression.cs (MakeByteBlob): Complete all the missing types
27521 (uint, short, ushort, byte, sbyte)
27523 * class.cs: Only init instance field initializers on instance
27526 Rename `constructors' to instance_constructors.
27528 (TypeContainer.AddConstructor): Only add constructors to the list
27529 if it is not static.
27531 Make sure that we handle default_static_constructor independently
27532 everywhere where we handle instance_constructors
27534 2001-12-28 Miguel de Icaza <miguel@ximian.com>
27536 * class.cs: Do not lookup or create a base initializer for a
27537 static constructor.
27539 (ConstructorInitializer.Resolve): use the proper type to lookup
27542 * cs-parser.jay: Report error 1585 (modifiers between type and name).
27544 * enum.cs, interface.cs: Remove CloseType, this is taken care by
27547 * decl.cs: CloseType is now an virtual method, the default
27548 implementation just closes this type.
27550 2001-12-28 Ravi Pratap <ravi@ximian.com>
27552 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27553 to PreserveSig by default. Also emit HideBySig on such methods.
27555 Basically, set the defaults to standard values.
27557 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27558 argument, if candidate is better, it can't be worse than the best !
27560 (Invocation): Re-write bits to differentiate between methods being
27561 applicable in their expanded form and their normal form - for params
27564 Get rid of use_standard everywhere as only standard conversions are allowed
27565 in overload resolution.
27567 More spec conformance.
27569 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27571 * driver.cs: Add --timestamp, to see where the compiler spends
27574 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27575 `this' in static code.
27577 (SimpleName.DoResolve): Implement in terms of a helper function
27578 that allows static-references to be passed upstream to
27581 (Expression.ResolveWithSimpleName): Resolve specially simple
27582 names when called by MemberAccess to implement the special
27585 (Expression.ImplicitReferenceConversion): Handle conversions from
27586 Null to reference types before others, as Null's type is
27589 * expression.cs (Invocation.EmitCall): Handle the special case of
27590 calling methods declared on a reference type from a ValueType
27591 (Base classes System.Object and System.Enum)
27593 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27594 the left hand side is a TypeExpr, not on every enumeration.
27596 (Binary.Resolve): If types are reference types, then do a cast to
27597 object on operators != and == of both arguments.
27599 * typemanager.cs (FindMembers): Extract instance and static
27600 members if requested.
27602 * interface.cs (PopulateProperty): Use void_type instead of null
27603 as the return type for the setter method.
27605 (PopulateIndexer): ditto.
27607 2001-12-27 Ravi Pratap <ravi@ximian.com>
27609 * support.cs (ReflectionParameters): Fix minor bug where we
27610 were examining the wrong parameter for the ParamArray attribute.
27612 Cope with requests for the type of the parameter at position
27613 greater than the params parameter's. We now return the element
27614 type of the params array as that makes more sense.
27616 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27617 accordingly as we no longer have to extract the element type
27620 (Invocation.OverloadResolve): Update.
27622 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27624 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27625 against IEnumerator, test whether the return value is a descendant
27626 of the IEnumerator interface.
27628 * class.cs (Indexer.Define): Use an auxiliary method to implement
27629 the other bits of the method definition. Begin support for
27630 explicit interface implementation.
27632 (Property.DefineMethod): Use TypeManager.void_type instead of null
27633 for an empty return value.
27635 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27637 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27638 dealing with a FieldExpr which is composed of a FieldBuilder, in
27639 the code path we did extract the constant, but we should have
27640 obtained the underlying value to be able to cast it (otherwise we
27641 end up in an infinite loop, this is what Ravi was running into).
27643 (ArrayCreation.UpdateIndices): Arrays might be empty.
27645 (MemberAccess.ResolveMemberAccess): Add support for section
27646 14.5.4.1 that deals with the special case of E.I when E is a type
27647 and something else, that I can be a reference to a static member.
27649 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27650 handle a particular array type to create byte blobs, it is just
27651 something we dont generate byteblobs for.
27653 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27656 * location.cs (Push): remove the key from the hashtable that we
27657 are about to add. This happens for empty files.
27659 * driver.cs: Dispose files after we have parsed them.
27661 (tokenize): new function that only runs the tokenizer on its
27662 input, for speed testing.
27664 2001-12-26 Ravi Pratap <ravi@ximian.com>
27666 * class.cs (Event.Define): Define the private field only if there
27667 are no accessors defined.
27669 * expression.cs (ResolveMemberAccess): If there is no associated
27670 field with the event, that means we have an event defined with its
27671 own accessors and we should flag error cs0070 since transforming
27672 ourselves into a field is not valid in that case.
27674 * ecore.cs (SimpleName.DoResolve): Same as above.
27676 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27677 and charset to sane values.
27679 2001-12-25 Ravi Pratap <ravi@ximian.com>
27681 * assign.cs (DoResolve): Perform check on events only if they
27682 are being accessed outside the declaring type.
27684 * cs-parser.jay (event_declarations): Update rules to correctly
27685 set the type of the implicit parameter etc.
27687 (add_accessor, remove_accessor): Set current local parameters.
27689 * expression.cs (Binary): For delegate addition and subtraction,
27690 cast the return value from the method into the appropriate delegate
27693 2001-12-24 Ravi Pratap <ravi@ximian.com>
27695 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27696 of these as the workaround is unnecessary.
27698 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27699 delegate data - none of that is needed at all.
27701 Re-write bits to extract the instance expression and the delegate method
27704 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27707 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27708 of attaching attributes instead of duplicating code everywhere.
27710 * everywhere : Update code to do attribute emission using the above method.
27712 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27714 * expression.cs (IsParamsMethodApplicable): if there are not
27715 parameters, return immediately.
27717 * ecore.cs: The 0 literal can be implicity converted to an enum
27720 (SimpleName.DoResolve): First lookup the type, then lookup the
27723 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27724 want to get its address. If the InstanceExpression is not
27725 addressable, store the result in a temporary variable, then get
27728 * codegen.cs: Only display 219 errors on warning level or above.
27730 * expression.cs (ArrayAccess): Make it implement the
27731 IMemoryLocation interface.
27733 (Binary.DoResolve): handle the operator == (object a, object b)
27734 and operator != (object a, object b) without incurring into a
27735 BoxedCast (because 5 != o should never be performed).
27737 Handle binary enumerator operators.
27739 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27740 value type, otherwise use Ldelem_ref.
27742 Use precomputed names;
27744 (AddressOf): Implement address of
27746 * cs-parser.jay (labeled_statement): Fix recursive block
27747 addition by reworking the production.
27749 * expression.cs (New.DoEmit): New has a special case:
27751 If we are dealing with a ValueType, we have a few
27752 situations to deal with:
27754 * The target of New is a ValueType variable, that is
27755 easy, we just pass this as the variable reference
27757 * The target of New is being passed as an argument,
27758 to a boxing operation or a function that takes a
27761 In this case, we need to create a temporary variable
27762 that is the argument of New.
27765 2001-12-23 Ravi Pratap <ravi@ximian.com>
27767 * rootcontext.cs (LookupType): Check that current_type is not null before
27768 going about looking at nested types.
27770 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27771 not implement the IAssignMethod interface any more.
27773 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27774 where we tranform them into FieldExprs if they are being resolved from within
27775 the declaring type.
27777 * ecore.cs (SimpleName.DoResolve): Do the same here.
27779 * assign.cs (DoResolve, Emit): Clean up code considerably.
27781 * ../errors/bug10.cs : Add.
27783 * ../errors/cs0070.cs : Add.
27785 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27787 * assign.cs : Get rid of EventIsLocal everywhere.
27789 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27791 * ecore.cs (ConvertIntLiteral): finished the implementation.
27793 * statement.cs (SwitchLabel): Convert the value we are using as a
27794 key before looking up the table.
27796 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27798 * codegen.cs (EmitTopBlock): Require a Location argument now.
27800 * cs-parser.jay (constructor_declarator): We need to setup
27801 current_local_parameters before we parse the
27802 opt_constructor_initializer, to allow the variables to be bound
27803 to the constructor arguments.
27805 * rootcontext.cs (LookupType): First lookup nested classes in our
27806 class and our parents before we go looking outside our class.
27808 * expression.cs (ConstantFold): Extract/debox the values at the
27811 * rootcontext.cs (EmitCode): Resolve the constants first before we
27812 resolve the types. This is not really needed, but it helps debugging.
27814 * statement.cs: report location.
27816 * cs-parser.jay: pass location to throw statement.
27818 * driver.cs: Small bug fix.
27820 * report.cs: Updated format to be 4-zero filled digits.
27822 2001-12-22 Ravi Pratap <ravi@ximian.com>
27824 * expression.cs (CheckIndices): Fix minor bug where the wrong
27825 variable was being referred to ;-)
27827 (DoEmit): Do not call EmitStaticInitializers when the
27828 underlying type is System.Object.
27830 2001-12-21 Ravi Pratap <ravi@ximian.com>
27832 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27833 and do the usual workaround for SRE.
27835 * class.cs (MyEventBuilder.EventType): New member to get at the type
27836 of the event, quickly.
27838 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27840 * assign.cs (Assign.DoResolve): Handle the case when the target
27841 is an EventExpr and perform the necessary checks.
27843 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27846 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27848 (EventExpr): Set the type in the constructor itself since we
27849 are meant to be born fully resolved.
27851 (EventExpr.Define): Revert code I wrote earlier.
27853 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27854 instance expression is null. The instance expression is a This in that case
27855 or a null, depending on whether it is a static method or not.
27857 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27858 refers to more than one method.
27860 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27861 and accordingly flag errors.
27863 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27865 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27867 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27869 * location.cs (ToString): Provide useful rutine.
27871 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27873 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27874 objects, return the actual integral boxed.
27876 * statement.cs (SwitchLabel): define an ILLabel for each
27879 (Switch.CheckSwitch): If the value is a Literal, extract
27880 the underlying literal.
27882 Also in the unused hashtable we had, add the SwitchLabel so we can
27883 quickly look this value up.
27885 * constant.cs: Implement a bunch of new constants. Rewrite
27886 Literal based on this. Made changes everywhere to adapt to this.
27888 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27889 dereferencing array only once, and also copes with enumrations.
27891 bytes are two bytes wide, not one.
27893 (Cast): Perform constant conversions.
27895 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27896 wrappers to the literals here.
27898 * expression.cs (DoNumericPromotions): long literals can converted
27899 to ulong implicity (this is taken care of elsewhere, but I was
27900 missing this spot).
27902 * ecore.cs (Expression.Literalize): Make the return type Literal,
27903 to improve type checking.
27905 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27907 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27909 * literal.cs: Revert code from ravi that checked the bounds. The
27910 bounds are sane by the definition of the type itself.
27912 * typemanager.cs: Fix implementation of ImplementsInterface. We
27913 need to actually look up in our parent hierarchy for interfaces
27916 * const.cs: Use the underlying type for enumerations
27918 * delegate.cs: Compute the basename for the delegate creation,
27919 that should fix the delegate test case, and restore the correct
27920 Type Lookup semantics in rootcontext
27922 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27923 referencing a nested type with the Reflection API is using the "+"
27926 * cs-parser.jay: Do not require EOF token at the end.
27928 2001-12-20 Ravi Pratap <ravi@ximian.com>
27930 * rootcontext.cs (LookupType): Concatenate type names with
27931 a '.' instead of a '+' The test suite passes again.
27933 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27934 field of the enumeration.
27936 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27937 the case when the member is an EventExpr.
27939 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27940 static has an associated instance expression.
27942 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27944 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27946 * class.cs (Event.Define): Register event and perform appropriate checks
27949 We define the Add and Remove methods even if the use provides none because
27950 in that case, we provide default implementations ourselves.
27952 Define a private field of the type of the event. This is done by the CSC compiler
27953 and we should be doing it too ;-)
27955 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27956 More methods we use in code we generate.
27958 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27961 (InitCoreTypes): Update accordingly for the above.
27963 * class.cs (Event.Emit): Generate code for default accessors that we provide
27965 (EmitDefaultMethod): Do the job in the above.
27967 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27970 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27972 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27973 builders even if we were missing one.
27975 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27976 pass the Basename as our class name instead of the Name. The
27977 basename will be correctly composed for us.
27979 * parameter.cs (Paramters): Now takes a Location argument.
27981 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27982 make all the code call directly LookupType in RootContext and take
27983 this chance to pass the Location information everywhere.
27985 * Everywhere: pass Location information.
27987 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27989 * class.cs (Constructor.Define): Updated way of detecting the
27990 length of the parameters.
27992 (TypeContainer.DefineType): Use basename as the type name for
27995 (TypeContainer.Define): Do not recursively define types here, as
27996 definition is taken care in order by the RootContext.
27998 * tree.cs: Keep track of namespaces in a per-file basis.
28000 * parameter.cs (Parameter.ComputeSignature): Update to use
28003 (Parameters.GetSignature): ditto.
28005 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28006 instead of a TypeContainer.
28008 (Interface.SemanticAnalysis): Use `this' instead of our parent to
28009 resolve names. Because we need to be resolve in our context, not
28012 * driver.cs: Implement response files.
28014 * class.cs (TypeContainer.DefineType): If we are defined, do not
28015 redefine ourselves.
28017 (Event.Emit): Emit the code for add/remove handlers.
28018 (Event.Define): Save the MethodBuilders for add/remove.
28020 * typemanager.cs: Use pair here too.
28022 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28023 DictionaryEntry requires the first argument to be non-null.
28025 (enum_declaration): Compute full name for registering the
28028 (delegate_declaration): Instead of using
28029 formal_parameter_list, use opt_formal_parameter_list as the list
28032 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28033 (EventParsing): New property that controls whether `add' and
28034 `remove' are returned as tokens or identifiers (for events);
28036 2001-12-19 Ravi Pratap <ravi@ximian.com>
28038 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28039 use MyEventBuilder only and let it wrap the real builder for us.
28041 (MyEventBuilder): Revamp constructor etc.
28043 Implement all operations that we perform on EventBuilder in precisely the same
28046 (FindMembers): Update to use the EventBuilder member.
28048 (Event.Emit): Update accordingly.
28050 2001-12-18 Ravi Pratap <ravi@ximian.com>
28052 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28053 by calling the appropriate methods.
28055 (GetCustomAttributes): Make stubs as they cannot possibly do anything
28058 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28060 2001-12-17 Ravi Pratap <ravi@ximian.com>
28062 * delegate.cs (Delegate.Populate): Check that the return type
28063 and various parameters types are indeed accessible.
28065 * class.cs (Constructor.Define): Same here.
28067 (Field.Define): Ditto.
28069 (Event.Define): Ditto.
28071 (Operator.Define): Check that the underlying Method defined itself
28072 correctly - so it's MethodBuilder should not be null.
28074 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28075 expression happens to be null.
28077 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28078 members but as of now we don't seem to be able to do anything really useful with it.
28080 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28081 not the EventBuilder.
28083 2001-12-18 Miguel de Icaza <miguel@ximian.com>
28085 * cs-tokenizer.cs: Add support for defines.
28086 Add support for #if, #elif, #else, #endif
28088 (eval_var): evaluates a variable.
28089 (eval): stubbed for evaluating functions.
28091 * cs-parser.jay: Pass the defines information
28093 * driver.cs: Add --define command line option.
28095 * decl.cs: Move MemberCore here.
28097 Make it the base class for DeclSpace. This allows us to catch and
28098 report 108 and 109 for everything now.
28100 * class.cs (TypeContainer.Define): Extract all the members
28101 before populating and emit the warning 108 (new keyword required
28102 to override) instead of having each member implement this.
28104 (MemberCore.Define): New abstract method, we will be using this in
28105 the warning reporting engine in Populate.
28107 (Operator.Define): Adjust to new MemberCore protocol.
28109 * const.cs (Const): This does not derive from Expression, it is a
28110 temporary object we use to create fields, it is a MemberCore.
28112 * class.cs (Method.Define): Allow the entry point to be in a
28115 * driver.cs: Rewrite the argument handler to clean it up a bit.
28117 * rootcontext.cs: Made it just an auxiliary namespace feature by
28118 making everything static.
28120 * driver.cs: Adapt code to use RootContext type name instead of
28123 * delegate.cs: Remove RootContext argument.
28125 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28128 * class.cs (Event.Define): The lookup can fail.
28130 * cs-tokenizer.cs: Begin implementation of pre-procesor.
28132 * expression.cs: Resolve the this instance before invoking the code.
28134 2001-12-17 Miguel de Icaza <miguel@ximian.com>
28136 * cs-parser.jay: Add a production in element_access that allows
28137 the thing to become a "type" reference. This way we can parse
28138 things like "(string [])" as a type.
28140 Note that this still does not handle the more complex rules of
28144 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
28146 * ecore.cs: (CopyNewMethods): new utility function used to
28147 assemble the list of methods from running FindMembers.
28149 (MemberLookup): Rework FindMembers so that
28151 2001-12-16 Miguel de Icaza <miguel@ximian.com>
28153 * class.cs (TypeContainer): Remove Delegates who fail to be
28156 * delegate.cs (Populate): Verify that we dont get null return
28157 values. TODO: Check for AsAccessible.
28159 * cs-parser.jay: Use basename to emit error 574 (destructor should
28160 have the same name as container class), not the full name.
28162 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28163 possible representation.
28165 Also implements integer type suffixes U and L.
28167 2001-12-15 Miguel de Icaza <miguel@ximian.com>
28169 * expression.cs (ArrayCreation.DoResolve): We need to do the
28170 argument resolution *always*.
28172 * decl.cs: Make this hold the namespace. Hold the root context as
28174 (LookupType): Move here.
28176 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28178 * location.cs (Row, Name): Fixed the code, it was always returning
28179 references to the first file.
28181 * interface.cs: Register properties defined through interfaces.
28183 * driver.cs: Add support for globbing on the command line
28185 * class.cs (Field): Make it derive from MemberCore as well.
28188 2001-12-15 Ravi Pratap <ravi@ximian.com>
28190 * class.cs (Event::Define): Check that the type of the event is a delegate
28191 type else flag error #66.
28193 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28196 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28197 values of EntryPoint, CharSet etc etc.
28199 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28201 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28202 be null and we should ignore this. I am not sure if this is really clean. Apparently,
28203 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28204 which needs this to do its work.
28206 * ../errors/cs0066.cs : Add.
28208 2001-12-14 Miguel de Icaza <miguel@ximian.com>
28210 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28213 * class.cs: (MethodSignature.MethodSignature): Removed hack that
28214 clears out the parameters field.
28215 (MemberSignatureCompare): Cleanup
28217 (MemberCore): New base class used to share code between MethodCore
28220 (RegisterRequiredImplementations) BindingFlags.Public requires
28221 either BindingFlags.Instace or Static. Use instance here.
28223 (Property): Refactored code to cope better with the full spec.
28225 * parameter.cs (GetParameterInfo): Return an empty array instead
28228 * class.cs (Property): Abstract or extern properties have no bodies.
28230 * parameter.cs (GetParameterInfo): return a zero-sized array.
28232 * class.cs (TypeContainer.MethodModifiersValid): Move all the
28233 method modifier validation to the typecontainer so we can reuse
28234 this on properties.
28236 (MethodCore.ParameterTypes): return an empty sized array of types.
28238 (Property.Define): Test property modifier validity.
28240 Add tests for sealed/override too.
28242 (Method.Emit): abstract or extern methods have no bodies.
28244 2001-12-14 Ravi Pratap <ravi@ximian.com>
28246 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28249 (Method::Define, ::Emit): Modify accordingly.
28251 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28253 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28255 * makefile: Pass in /unsafe.
28257 2001-12-13 Miguel de Icaza <miguel@ximian.com>
28259 * class.cs (MakeKey): Kill routine.
28261 * class.cs (TypeContainer.Define): Correctly define explicit
28262 method implementations (they require the full interface name plus
28265 * typemanager.cs: Deply the PtrHashtable here and stop using the
28266 lame keys. Things work so much better.
28268 This of course broke everyone who depended on `RegisterMethod' to
28269 do the `test for existance' test. This has to be done elsewhere.
28271 * support.cs (PtrHashtable): A hashtable that avoid comparing with
28272 the object stupid Equals method (because, that like fails all over
28273 the place). We still do not use it.
28275 * class.cs (TypeContainer.SetRequiredInterface,
28276 TypeContainer.RequireMethods): Killed these two routines and moved
28277 all the functionality to RegisterRequiredImplementations.
28279 (TypeContainer.RegisterRequiredImplementations): This routine now
28280 registers all the implementations required in an array for the
28281 interfaces and abstract methods. We use an array of structures
28282 which can be computed ahead of time to reduce memory usage and we
28283 also assume that lookups are cheap as most classes will not
28284 implement too many interfaces.
28286 We also avoid creating too many MethodSignatures.
28288 (TypeContainer.IsInterfaceMethod): Update and optionally does not
28289 clear the "pending" bit if we find that there are problems with
28292 (TypeContainer.VerifyPendingMethods): Update to report errors of
28293 methods that look like implementations but are not.
28295 (TypeContainer.Define): Add support for explicit interface method
28298 2001-12-12 Miguel de Icaza <miguel@ximian.com>
28300 * typemanager.cs: Keep track of the parameters here instead of
28301 being a feature of the TypeContainer.
28303 * class.cs: Drop the registration of parameters here, as
28304 InterfaceMethods are also interface declarations.
28306 * delegate.cs: Register methods with the TypeManager not only with
28307 the TypeContainer. This code was buggy.
28309 * interface.cs: Full registation here.
28311 2001-12-11 Miguel de Icaza <miguel@ximian.com>
28313 * expression.cs: Remove reducer for binary expressions, it can not
28316 * const.cs: Put here the code that used to go into constant.cs
28318 * constant.cs: Put here the code for constants, this is a new base
28319 class for Literals.
28321 * literal.cs: Make Literal derive from Constant.
28323 2001-12-09 Miguel de Icaza <miguel@ximian.com>
28325 * statement.cs (Return.Emit): Report error 157 if the user
28326 attempts to return from a finally block.
28328 (Return.Emit): Instead of emitting a return, jump to the end of
28331 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28332 LocalBuilder to store the result of the function. ReturnLabel is
28333 the target where we jump.
28336 2001-12-09 Radek Doulik <rodo@ximian.com>
28338 * cs-parser.jay: remember alias in current namespace
28340 * ecore.cs (SimpleName::DoResolve): use aliases for types or
28343 * class.cs (LookupAlias): lookup alias in my_namespace
28345 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28347 (LookupAlias): lookup alias in this and if needed in parent
28350 2001-12-08 Miguel de Icaza <miguel@ximian.com>
28354 * rootcontext.cs: (ModuleBuilder) Made static, first step into
28355 making things static. I need this to avoid passing the
28356 TypeContainer when calling ParameterType.
28358 * support.cs (InternalParameters.ParameterType): Remove ugly hack
28359 that did string manipulation to compute the type and then call
28360 GetType. Use Parameter.ParameterType instead.
28362 * cs-tokenizer.cs: Consume the suffix for floating values.
28364 * expression.cs (ParameterReference): figure out whether this is a
28365 reference parameter or not. Kill an extra variable by computing
28366 the arg_idx during emission.
28368 * parameter.cs (Parameters.GetParameterInfo): New overloaded
28369 function that returns whether a parameter is an out/ref value or not.
28371 (Parameter.ParameterType): The type of the parameter (base,
28372 without ref/out applied).
28374 (Parameter.Resolve): Perform resolution here.
28375 (Parameter.ExternalType): The full type (with ref/out applied).
28377 * statement.cs (Using.Emit, Using.EmitExpression): Implement
28378 support for expressions on the using statement.
28380 2001-12-07 Miguel de Icaza <miguel@ximian.com>
28382 * statement.cs (Using.EmitLocalVariableDecls): Split the
28383 localvariable handling of the using statement.
28385 (Block.EmitMeta): Keep track of variable count across blocks. We
28386 were reusing slots on separate branches of blocks.
28388 (Try.Emit): Emit the general code block, we were not emitting it.
28390 Check the type of the declaration to be an IDisposable or
28391 something that can be implicity converted to it.
28393 Emit conversions if required.
28395 * ecore.cs (EmptyExpression): New utility class.
28396 (Expression.ImplicitConversionExists): New utility function.
28398 2001-12-06 Miguel de Icaza <miguel@ximian.com>
28400 * statement.cs (Using): Implement.
28402 * expression.cs (LocalVariableReference): Support read only variables.
28404 * statement.cs: Remove the explicit emit for the Leave opcode.
28405 (VariableInfo): Add a readonly field.
28407 2001-12-05 Miguel de Icaza <miguel@ximian.com>
28409 * ecore.cs (ConvCast): new class used to encapsulate the various
28410 explicit integer conversions that works in both checked and
28411 unchecked contexts.
28413 (Expression.ConvertNumericExplicit): Use new ConvCast class to
28414 properly generate the overflow opcodes.
28416 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28418 * statement.cs: The correct type for the EmptyExpression is the
28419 element_type, not the variable type. Ravi pointed this out.
28421 2001-12-04 Ravi Pratap <ravi@ximian.com>
28423 * class.cs (Method::Define): Handle PInvoke methods specially
28424 by using DefinePInvokeMethod instead of the usual one.
28426 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28427 above to do the task of extracting information and defining the method.
28429 2001-12-04 Ravi Pratap <ravi@ximian.com>
28431 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28432 of the condition for string type.
28434 (Emit): Move that here.
28436 (ArrayCreation::CheckIndices): Keep string literals in their expression
28439 (EmitDynamicInitializers): Handle strings appropriately.
28441 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28443 * codegen.cs (EmitContext): Replace multiple variables with a
28444 single pointer to the current Switch statement.
28446 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28449 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28453 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28456 (Foreach.Emit): Foreach on arrays was not setting
28457 up the loop variables (for break/continue).
28459 (GotoCase): Semi-implented.
28461 2001-12-03 Ravi Pratap <ravi@ximian.com>
28463 * attribute.cs (CheckAttribute): Handle system attributes by using
28464 Attribute.GetAttributes to examine information we need.
28466 (GetValidPlaces): Same here.
28468 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28470 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28472 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28474 (Method::Define): Set appropriate flags if we have a DllImport attribute.
28476 (Method::Emit): Handle the case when we are a PInvoke method.
28478 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28480 * expression.cs: Use ResolveWithSimpleName on compound names.
28482 2001-12-02 Ravi Pratap <ravi@ximian.com>
28484 * constant.cs (EmitConstant): Make sure we resolve the associated expression
28485 before trying to reduce it.
28487 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28489 * constant.cs (LookupConstantValue): Implement.
28491 (EmitConstant): Use the above in emitting the constant.
28493 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28494 that are user-defined by doing a LookupConstantValue on them.
28496 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28499 2001-11-29 Miguel de Icaza <miguel@ximian.com>
28501 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28503 (BaseAccess.DoResolve): Implement.
28505 (MemberAccess.DoResolve): Split this routine into a
28506 ResolveMemberAccess routine that can be used independently
28508 2001-11-28 Miguel de Icaza <miguel@ximian.com>
28510 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28511 As that share bits of the implementation. Is returns a boolean,
28512 while As returns the Type that is being probed.
28514 2001-12-01 Ravi Pratap <ravi@ximian.com>
28516 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28517 instead of a Literal - much easier.
28519 (EnumInTransit): Remove - utterly useless :-)
28521 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28523 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28525 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28526 chain when we have no associated expression.
28528 2001-11-30 Ravi Pratap <ravi@ximian.com>
28530 * constant.cs (Define): Use Location while reporting the errror.
28532 Also emit a warning when 'new' is used and there is no inherited
28535 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
28538 (LookupEnumValue): Implement to lookup an enum member's value and define it
28541 (Populate): Re-write accordingly to use the above routine.
28543 2001-11-27 Miguel de Icaza <miguel@ximian.com>
28545 * expression.cs (This): Fix prototype for DoResolveLValue to
28546 override the base class DoResolveLValue.
28548 * cs-parser.cs: Report errors cs574 and cs575 (destructor
28551 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28552 (we need to load the address of the field here). This fixes
28555 (FieldExpr.DoResolveLValue): Call the DoResolve
28556 function to initialize the Instance expression.
28558 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28559 correctly the GetEnumerator operation on a value type.
28561 * cs-parser.jay: Add more simple parsing error catches.
28563 * statement.cs (Switch): Add support for string switches.
28564 Handle null specially.
28566 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
28568 2001-11-28 Ravi Pratap <ravi@ximian.com>
28570 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28572 (declare_local_constant): New helper function.
28574 * statement.cs (AddConstant): Keep a separate record of constants
28576 (IsConstant): Implement to determine if a variable is a constant.
28578 (GetConstantExpression): Implement.
28580 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28582 * statement.cs (IsVariableDefined): Re-write.
28584 2001-11-27 Ravi Pratap <ravi@ximian.com>
28586 * class.cs (TypeContainer::FindMembers): Look for constants
28587 in the case when we are looking for MemberTypes.Field
28589 * expression.cs (MemberAccess::DoResolve): Check that in the
28590 case we are a FieldExpr and a Literal, we are not being accessed
28591 by an instance reference.
28593 * cs-parser.jay (local_constant_declaration): Implement.
28595 (declaration_statement): Implement for constant declarations.
28597 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28599 * statement.cs (Switch): Catch double defaults.
28601 (Switch): More work on the switch() statement
28602 implementation. It works for integral values now, need to finish
28606 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28608 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28609 integer literals into other integer literals. To be used by
28612 2001-11-24 Ravi Pratap <ravi@ximian.com>
28614 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28617 (EmitDynamicInitializers): Cope with the above since we extract data
28618 directly from ArrayData now.
28620 (ExpectInitializers): Keep track of whether initializers are mandatory
28623 (Bounds): Make it a hashtable to prevent the same dimension being
28624 recorded for every element in that dimension.
28626 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28629 Also fix bug which was causing the indices to be emitted in the reverse
28632 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28634 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28635 unfinished. They do not work, because the underlying code is
28638 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28640 * cs-parser.jay: Remove bogus fixme.
28642 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28643 on Switch statement.
28645 2001-11-23 Ravi Pratap <ravi@ximian.com>
28647 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28650 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28651 parameter. Apparently, any expression is allowed.
28653 (ValidateInitializers): Update accordingly.
28655 (CheckIndices): Fix some tricky bugs thanks to recursion.
28657 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28658 I was being completely brain-dead.
28660 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28661 and re-write acordingly.
28663 (DelegateInvocation): Re-write accordingly.
28665 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28667 (MakeByteBlob): Handle types more correctly.
28669 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28670 initialization from expressions but it is incomplete because I am a complete
28673 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28675 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28676 on If. Basically, we have to return `true' (ie, we do return to
28677 our caller) only if both branches of the if return.
28679 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28680 short-circuit operators, handle them as short circuit operators.
28682 (Cast.DoResolve): Resolve type.
28683 (Cast.Cast): Take an expression as the target type.
28685 * cs-parser.jay (cast_expression): Remove old hack that only
28686 allowed a limited set of types to be handled. Now we take a
28687 unary_expression and we resolve to a type during semantic
28690 Use the grammar productions from Rhys to handle casts (this is
28691 not complete like Rhys syntax yet, we fail to handle that corner
28692 case that C# has regarding (-x), but we will get there.
28694 2001-11-22 Ravi Pratap <ravi@ximian.com>
28696 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28697 field which is an array type.
28699 * cs-parser.jay (declare_local_variables): Support array initialization too.
28701 * typemanager.cs (MakeKey): Implement.
28703 (everywhere): Use the above appropriately.
28705 * cs-parser.jay (for_statement): Update for array initialization while
28706 declaring variables.
28708 * ecore.cs : The error message was correct, it's the variable's names that
28709 were misleading ;-) Make the code more readable.
28711 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28712 the correct type etc.
28714 (ConvertExplicit): Handle Enum types by examining the underlying type.
28716 2001-11-21 Ravi Pratap <ravi@ximian.com>
28718 * parameter.cs (GetCallingConvention): Always return
28719 CallingConventions.Standard for now.
28721 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28723 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28724 and `r' after calling DoNumericPromotions.
28726 * ecore.cs: Fix error message (the types were in the wrong order).
28728 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28729 BindingFlags.Instance as well
28731 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28732 implicit int literal conversion in an empty cast so that we
28733 propagate the right type upstream.
28735 (UnboxCast): new class used to unbox value types.
28736 (Expression.ConvertExplicit): Add explicit type conversions done
28739 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28740 the target type before applying the implicit LongLiterals to ULong
28743 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28745 * cs-parser.jay (for_statement): Reworked the way For works: now
28746 we declare manually any variables that are introduced in
28747 for_initializer to solve the problem of having out-of-band code
28748 emition (that is what got for broken).
28750 (declaration_statement): Perform the actual variable declaration
28751 that used to be done in local_variable_declaration here.
28753 (local_variable_declaration): Do not declare anything, just pass
28754 the information on a DictionaryEntry
28756 2001-11-20 Ravi Pratap <ravi@ximian.com>
28758 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28759 re-write of the logic to now make it recursive.
28761 (UpdateIndices): Re-write accordingly.
28763 Store element data in a separate ArrayData list in the above methods.
28765 (MakeByteBlob): Implement to dump the array data into a byte array.
28767 2001-11-19 Ravi Pratap <ravi@ximian.com>
28769 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28772 * constant.cs (Define): Implement.
28774 (EmitConstant): Re-write fully.
28776 Pass in location info.
28778 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28781 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28782 DictionaryEntry since we need location info too.
28784 (constant_declaration): Update accordingly.
28786 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28787 code into another method : UpdateIndices.
28789 2001-11-18 Ravi Pratap <ravi@ximian.com>
28791 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28792 some type checking etc.
28794 2001-11-17 Ravi Pratap <ravi@ximian.com>
28796 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28797 bits to provide dimension info if the user skips doing that.
28799 Update second constructor to store the rank correctly.
28801 2001-11-16 Ravi Pratap <ravi@ximian.com>
28803 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28804 and try to implement.
28806 * ../errors/cs0150.cs : Add.
28808 * ../errors/cs0178.cs : Add.
28810 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28812 * statement.cs: Implement foreach on multi-dimensional arrays.
28814 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28815 name of the params argument.
28817 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28818 initializing the array.
28820 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28821 we can use this elsewhere.
28823 * statement.cs: Finish implementation of foreach for single
28826 * cs-parser.jay: Use an out-of-band stack to pass information
28827 around, I wonder why I need this.
28829 foreach_block: Make the new foreach_block the current_block.
28831 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28832 function used to return a static Parameters structure. Used for
28833 empty parameters, as those are created very frequently.
28835 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28837 2001-11-15 Ravi Pratap <ravi@ximian.com>
28839 * interface.cs : Default modifier is private, not public. The
28840 make verify test passes again.
28842 2001-11-15 Ravi Pratap <ravi@ximian.com>
28844 * support.cs (ReflectionParameters): Fix logic to determine
28845 whether the last parameter is a params one. Test 9 passes again.
28847 * delegate.cs (Populate): Register the builders we define with
28848 RegisterParameterForBuilder. Test 19 passes again.
28850 * cs-parser.jay (property_declaration): Reference $6 instead
28851 of $$ to get at the location.
28853 (indexer_declaration): Similar stuff.
28855 (attribute): Ditto.
28857 * class.cs (Property): Register parameters for the Get and Set methods
28858 if they exist. Test 23 passes again.
28860 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28861 call to EmitArguments as we are sure there aren't any params arguments.
28862 Test 32 passes again.
28864 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28865 IndexOutOfRangeException.
28867 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28868 Test 33 now passes again.
28870 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28872 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28873 broke a bunch of things. Will have to come up with a better way
28874 of tracking locations.
28876 * statement.cs: Implemented foreach for single dimension arrays.
28878 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28880 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28881 an error. This removes the lookup from the critical path.
28883 * cs-parser.jay: Removed use of temporary_loc, which is completely
28886 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28888 * support.cs (ReflectionParameters.ParameterModifier): Report
28889 whether the argument is a PARAMS argument or not.
28891 * class.cs: Set the attribute `ParamArrayAttribute' on the
28892 parameter argument.
28894 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28895 and cons_param_array_attribute (ConstructorInfo for
28896 ParamArrayAttribute).,
28898 * codegen.cs: Emit the return using the `Return' statement, that
28899 way we can report the error correctly for missing return values.
28901 * class.cs (Method.Emit): Clean up.
28903 * expression.cs (Argument.Resolve): Take another argument: the
28904 location where this argument is used. Notice that this is not
28905 part of the "Argument" class as to reduce the size of the
28906 structure (we know the approximate location anyways).
28908 Test if the argument is a variable-reference, if not, then
28909 complain with a 206.
28911 (Argument.Emit): Emit addresses of variables.
28913 (Argument.FullDesc): Simplify.
28915 (Invocation.DoResolve): Update for Argument.Resolve.
28917 (ElementAccess.DoResolve): ditto.
28919 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28920 method should be virtual, as this method is always virtual.
28922 (NewDelegate.DoResolve): Update for Argument.Resolve.
28924 * class.cs (ConstructorInitializer.DoResolve): ditto.
28926 * attribute.cs (Attribute.Resolve): ditto.
28928 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28930 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28932 * expression.cs (ParameterReference): Drop IStackStorage and implement
28933 IAssignMethod instead.
28935 (LocalVariableReference): ditto.
28937 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28938 IAssignMethod instead.
28940 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28942 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28943 enumerations that are used in heavily used structures derive from
28944 byte in a laughable and pathetic attempt to reduce memory usage.
28945 This is the kind of pre-optimzations that you should not do at
28946 home without adult supervision.
28948 * expression.cs (UnaryMutator): New class, used to handle ++ and
28949 -- separatedly from the other unary operators. Cleans up the
28950 code, and kills the ExpressionStatement dependency in Unary.
28952 (Unary): Removed `method' and `Arguments' from this class, making
28953 it smaller, and moving it all to SimpleCall, so I can reuse this
28954 code in other locations and avoid creating a lot of transient data
28955 strucutres when not required.
28957 * cs-parser.jay: Adjust for new changes.
28959 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28961 * enum.cs (Enum.Populate): If there is a failure during
28964 * cs-parser.jay (opt_enum_base): we used to catch type errors
28965 here, but this is really incorrect. The type error should be
28966 catched during semantic analysis.
28968 2001-12-11 Ravi Pratap <ravi@ximian.com>
28970 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28971 current_local_parameters as expected since I, in my stupidity, had forgotten
28974 * attribute.cs (GetValidPlaces): Fix stupid bug.
28976 * class.cs (Method::Emit): Perform check on applicability of attributes.
28978 (Constructor::Emit): Ditto.
28980 (Field::Emit): Ditto.
28982 (Field.Location): Store location information.
28984 (Property, Event, Indexer, Operator): Ditto.
28986 * cs-parser.jay (field_declaration): Pass in location for each field.
28988 * ../errors/cs0592.cs : Add.
28990 2001-11-12 Ravi Pratap <ravi@ximian.com>
28992 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28994 (InitCoreTypes): Update accordingly.
28996 (RegisterAttrType, LookupAttr): Implement.
28998 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28999 info about the same.
29001 (Resolve): Update to populate the above as necessary.
29003 (Error592): Helper.
29005 (GetValidPlaces): Helper to the above.
29007 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29009 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29011 2001-11-12 Ravi Pratap <ravi@ximian.com>
29013 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29015 * ../errors/cs0617.cs : Add.
29017 2001-11-11 Ravi Pratap <ravi@ximian.com>
29019 * enum.cs (Emit): Rename to Populate to be more consistent with what
29020 we expect it to do and when exactly it is called.
29022 * class.cs, rootcontext.cs : Update accordingly.
29024 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29025 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29027 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29029 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29030 of a fieldinfo using the above, when dealing with a FieldBuilder.
29032 2001-11-10 Ravi Pratap <ravi@ximian.com>
29034 * ../errors/cs0031.cs : Add.
29036 * ../errors/cs1008.cs : Add.
29038 * ../errrors/cs0543.cs : Add.
29040 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29043 (FindMembers): Implement.
29045 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29046 enums and delegates too.
29048 (enum_types): Rename to builder_to_enum.
29050 (delegate_types): Rename to builder_to_delegate.
29052 * delegate.cs (FindMembers): Implement.
29054 2001-11-09 Ravi Pratap <ravi@ximian.com>
29056 * typemanager.cs (IsEnumType): Implement.
29058 * enum.cs (Emit): Re-write parts to account for the underlying type
29059 better and perform checking etc.
29061 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29062 of the underlying type.
29064 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29067 * enum.cs (error31): Helper to report error #31.
29069 * cs-parser.jay (enum_declaration): Store location of each member too.
29071 * enum.cs (member_to_location): New hashtable.
29073 (AddEnumMember): Update location hashtable.
29075 (Emit): Use the location of each member while reporting errors.
29077 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29079 * cs-parser.jay: A for_initializer if is a
29080 local_variable_declaration really ammount to have an implicit
29081 block with the variable declaration and no initializer for for.
29083 * statement.cs (For.Emit): Cope with null initializers.
29085 This fixes the infinite loop on for initializers.
29087 2001-11-08 Miguel de Icaza <miguel@ximian.com>
29089 * enum.cs: More cleanup.
29091 * ecore.cs: Remove dead code.
29093 * class.cs (Property.Emit): More simplification.
29094 (Event.Emit): ditto.
29096 Reworked to have less levels of indentation.
29098 2001-11-08 Ravi Pratap <ravi@ximian.com>
29100 * class.cs (Property): Emit attributes.
29110 * enum.cs (Emit): Ditto.
29112 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29115 * class.cs (Field, Event, etc.): Move attribute generation into the
29116 Emit method everywhere.
29118 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29119 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29120 as we had no way of defining nested enums !
29122 * rootcontext.cs : Adjust code accordingly.
29124 * typemanager.cs (AddEnumType): To keep track of enum types separately.
29126 2001-11-07 Ravi Pratap <ravi@ximian.com>
29128 * expression.cs (EvalConstantExpression): Move into ecore.cs
29130 * enum.cs (Enum): Rename some members and make them public and readonly
29131 according to our convention.
29133 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29136 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29138 (Enum::Emit): Write a simple version for now which doesn't try to compute
29139 expressions. I shall modify this to be more robust in just a while.
29141 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29143 (TypeContainer::CloseType): Create the Enum types too.
29145 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29147 * expression.cs (EvalConstantExpression): Get rid of completely.
29149 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29150 user-defined values and other cases.
29152 (IsValidEnumLiteral): Helper function.
29154 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
29155 out there in the case we had a literal FieldExpr.
29157 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29159 (Literalize): Revamp a bit to take two arguments.
29161 (EnumLiteral): New class which derives from Literal to wrap enum literals.
29163 2001-11-06 Ravi Pratap <ravi@ximian.com>
29165 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29167 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29169 (Resolve): Use the above to ensure we have proper initializers.
29171 2001-11-05 Ravi Pratap <ravi@ximian.com>
29173 * expression.cs (Expression::EvalConstantExpression): New method to
29174 evaluate constant expressions.
29176 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29178 2001-11-07 Miguel de Icaza <miguel@ximian.com>
29180 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29183 (Binary.ResolveOperator): Handle operator != (object a, object b)
29184 and operator == (object a, object b);
29186 (Binary.DoNumericPromotions): Indicate whether the numeric
29187 promotion was possible.
29189 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29192 Made the ArrayAccess implement interface IAssignMethod instead of
29193 IStackStore as the order in which arguments are passed reflects
29196 * assign.cs: Instead of using expr.ExprClass to select the way of
29197 assinging, probe for the IStackStore/IAssignMethod interfaces.
29199 * typemanager.cs: Load InitializeArray definition.
29201 * rootcontext.cs (RootContext.MakeStaticData): Used to define
29202 static data that can be used to initialize arrays.
29204 2001-11-05 Miguel de Icaza <miguel@ximian.com>
29206 * expression.cs: Handle operator== and operator!= for booleans.
29208 (Conditioal.Reduce): Implement reducer for the ?: operator.
29210 (Conditional.Resolve): Implement dead code elimination.
29212 (Binary.Resolve): Catch string literals and return a new
29213 concatenated string.
29215 (Unary.Reduce): Implement reduction of unary expressions.
29217 * ecore.cs: Split out the expression core handling here.
29219 (Expression.Reduce): New method used to perform constant folding
29220 and CSE. This is needed to support constant-expressions.
29222 * statement.cs (Statement.EmitBoolExpression): Pass true and false
29223 targets, and optimize for !x.
29225 2001-11-04 Ravi Pratap <ravi@ximian.com>
29227 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29228 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29229 set custom atttributes.
29231 * literal.cs (Literal::GetValue): New abstract method to return the actual
29232 value of the literal, cast as an object.
29234 (*Literal): Implement GetValue method.
29236 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29237 expressions to the arraylist but objects of type Argument.
29239 * class.cs (TypeContainer::Emit): Emit our attributes too.
29241 (Method::Emit, Constructor::Emit): Ditto.
29243 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29244 to be ignoring earlier.
29246 2001-11-03 Ravi Pratap <ravi@ximian.com>
29248 * attribute.cs (AttributeSection::Define): Implement to do the business
29249 of constructing a CustomAttributeBuilder.
29251 (Attribute): New trivial class. Increases readability of code.
29253 * cs-parser.jay : Update accordingly.
29255 (positional_argument_list, named_argument_list, named_argument): New rules
29257 (attribute_arguments): Use the above so that we are more correct.
29259 2001-11-02 Ravi Pratap <ravi@ximian.com>
29261 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29262 to perform all checks for a method with a params parameter.
29264 (Invocation::OverloadResolve): Update to use the above method and therefore
29265 cope correctly with params method invocations.
29267 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
29270 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29271 constructors in our parent too because we can't afford to miss out on
29274 * attribute.cs (AttributeSection): New name for the class Attribute
29276 Other trivial changes to improve readability.
29278 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29279 use the new class names.
29281 2001-11-01 Ravi Pratap <ravi@ximian.com>
29283 * class.cs (Method::Define): Complete definition for params types too
29285 (Indexer::Define): Ditto.
29287 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29288 Cope everywhere with a request for info about the array parameter.
29290 2001-11-01 Ravi Pratap <ravi@ximian.com>
29292 * tree.cs (RecordNamespace): Fix up to check for the correct key.
29294 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
29295 local_variable_type to extract the string corresponding to the type.
29297 (local_variable_type): Fixup the action to use the new helper method.
29299 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
29302 * expression.cs : Clean out code which uses the above.
29304 2001-10-31 Ravi Pratap <ravi@ximian.com>
29306 * typemanager.cs (RegisterMethod): Check if we already have an existing key
29307 and bale out if necessary by returning a false.
29309 (RegisterProperty): Ditto.
29311 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29312 and print out appropriate error messages.
29314 * interface.cs (everywhere): Ditto.
29316 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29317 location to constructor.
29319 * class.cs (Property, Event, Indexer): Update accordingly.
29321 * ../errors/cs111.cs : Added.
29323 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29324 of a method, as laid down by the spec.
29326 (Invocation::OverloadResolve): Use the above method.
29328 2001-10-31 Ravi Pratap <ravi@ximian.com>
29330 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29331 now take a TypeContainer and a Parameters object.
29333 (ParameterData): Modify return type of ParameterModifier method to be
29334 Parameter.Modifier and not a string.
29336 (ReflectionParameters, InternalParameters): Update accordingly.
29338 * expression.cs (Argument::GetParameterModifier): Same here.
29340 * support.cs (InternalParameters::ParameterType): Find a better way of determining
29341 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29342 symbol in it at all so maybe this is only for now.
29344 2001-10-30 Ravi Pratap <ravi@ximian.com>
29346 * support.cs (InternalParameters): Constructor now takes an extra argument
29347 which is the actual Parameters class.
29349 (ParameterDesc): Update to provide info on ref/out modifiers.
29351 * class.cs (everywhere): Update call to InternalParameters to pass in
29352 the second argument too.
29354 * support.cs (ParameterData): Add ParameterModifier, which is a method
29355 to return the modifier info [ref/out etc]
29357 (InternalParameters, ReflectionParameters): Implement the above.
29359 * expression.cs (Argument::ParameterModifier): Similar function to return
29360 info about the argument's modifiers.
29362 (Invocation::OverloadResolve): Update to take into account matching modifiers
29365 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29366 a new SetFormalParameters object which we pass to InternalParameters.
29368 2001-10-30 Ravi Pratap <ravi@ximian.com>
29370 * expression.cs (NewArray): Merge into the ArrayCreation class.
29372 2001-10-29 Ravi Pratap <ravi@ximian.com>
29374 * expression.cs (NewArray): Merge classes NewBuiltinArray and
29375 NewUserdefinedArray into one as there wasn't much of a use in having
29378 * expression.cs (Argument): Change field's name to ArgType from Type.
29380 (Type): New readonly property which returns the proper type, taking into
29381 account ref/out modifiers.
29383 (everywhere): Adjust code accordingly for the above.
29385 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29386 whether we are emitting for a ref or out parameter.
29388 * expression.cs (Argument::Emit): Use the above field to set the state.
29390 (LocalVariableReference::Emit): Update to honour the flag and emit the
29393 * parameter.cs (Attributes): Set the correct flags for ref parameters.
29395 * expression.cs (Argument::FullDesc): New function to provide a full desc.
29397 * support.cs (ParameterData): Add method ParameterDesc to the interface.
29399 (ReflectionParameters, InternalParameters): Implement the above method.
29401 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29404 (Invocation::FullMethodDesc): Ditto.
29406 2001-10-29 Miguel de Icaza <miguel@ximian.com>
29408 * cs-parser.jay: Add extra production for the second form of array
29411 * expression.cs (ArrayCreation): Update to reflect the above
29414 * Small changes to prepare for Array initialization.
29416 2001-10-28 Miguel de Icaza <miguel@ximian.com>
29418 * typemanager.cs (ImplementsInterface): interface might be null;
29419 Deal with this problem;
29421 Also, we do store negative hits on the cache (null values), so use
29422 this instead of calling t.GetInterfaces on the type everytime.
29424 2001-10-28 Ravi Pratap <ravi@ximian.com>
29426 * typemanager.cs (IsBuiltinType): New method to help determine the same.
29428 * expression.cs (New::DoResolve): Get rid of array creation code and instead
29429 split functionality out into different classes.
29431 (New::FormArrayType): Move into NewBuiltinArray.
29433 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29436 (NewBuiltinArray): New class to handle creation of built-in arrays.
29438 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29439 account creation of one-dimensional arrays.
29441 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29443 (NewUserdefinedArray::DoResolve): Implement.
29445 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29447 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29448 we maintain inside the TypeManager. This is necessary to perform lookups on the
29451 (LookupType): Update to perform GetType on the module builders too.
29453 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29455 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29457 2001-10-23 Ravi Pratap <ravi@ximian.com>
29459 * expression.cs (New::DoResolve): Implement guts of array creation.
29461 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29463 2001-10-27 Miguel de Icaza <miguel@ximian.com>
29465 * expression.cs: Fix bug I introduced lsat night that broke
29468 (Expression.Resolve): Report a 246 error (can not resolve name)
29469 if we find a SimpleName in the stream.
29471 (Expression.ResolveLValue): Ditto.
29473 (Expression.ResolveWithSimpleName): This function is a variant of
29474 ResolveName, this one allows SimpleNames to be returned without a
29475 warning. The only consumer of SimpleNames is MemberAccess
29477 2001-10-26 Miguel de Icaza <miguel@ximian.com>
29479 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29480 might arrive here. I have my doubts that this is correct.
29482 * statement.cs (Lock): Implement lock statement.
29484 * cs-parser.jay: Small fixes to support `lock' and `using'
29486 * cs-tokenizer.cs: Remove extra space
29488 * driver.cs: New flag --checked, allows to turn on integer math
29491 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29492 Threading.Monitor.Exit
29494 2001-10-23 Miguel de Icaza <miguel@ximian.com>
29496 * expression.cs (IndexerAccess::DoResolveLValue): Set the
29497 Expression Class to be IndexerAccess.
29499 Notice that Indexer::DoResolve sets the eclass to Value.
29501 2001-10-22 Miguel de Icaza <miguel@ximian.com>
29503 * class.cs (TypeContainer::Emit): Emit code for indexers.
29505 * assign.cs (IAssignMethod): New interface implemented by Indexers
29506 and Properties for handling assignment.
29508 (Assign::Emit): Simplify and reuse code.
29510 * expression.cs (IndexerAccess, PropertyExpr): Implement
29511 IAssignMethod, clean up old code.
29513 2001-10-22 Ravi Pratap <ravi@ximian.com>
29515 * typemanager.cs (ImplementsInterface): New method to determine if a type
29516 implements a given interface. Provides a nice cache too.
29518 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29521 (ConvertReferenceExplicit): Ditto.
29523 * delegate.cs (Delegate::Populate): Update to define the parameters on the
29524 various methods, with correct names etc.
29526 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
29527 Operator.UnaryNegation.
29529 * cs-parser.jay (operator_declarator): Be a little clever in the case where
29530 we have a unary plus or minus operator.
29532 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
29535 * everywhere : update accordingly.
29537 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29540 * class.cs (Method::Define): For the case where we are implementing a method
29541 inherited from an interface, we need to set the MethodAttributes.Final flag too.
29542 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29544 2001-10-21 Ravi Pratap <ravi@ximian.com>
29546 * interface.cs (FindMembers): Implement to work around S.R.E
29549 * typemanager.cs (IsInterfaceType): Implement.
29551 (FindMembers): Update to handle interface types too.
29553 * expression.cs (ImplicitReferenceConversion): Re-write bits which
29554 use IsAssignableFrom as that is not correct - it doesn't work.
29556 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29557 and accordingly override EmitStatement.
29559 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29560 using the correct logic :-)
29562 2001-10-19 Ravi Pratap <ravi@ximian.com>
29564 * ../errors/cs-11.cs : Add to demonstrate error -11
29566 2001-10-17 Miguel de Icaza <miguel@ximian.com>
29568 * assign.cs (Assign::Resolve): Resolve right hand side first, and
29569 then pass this as a hint to ResolveLValue.
29571 * expression.cs (FieldExpr): Add Location information
29573 (FieldExpr::LValueResolve): Report assignment to readonly
29576 (Expression::ExprClassFromMemberInfo): Pass location information.
29578 (Expression::ResolveLValue): Add new method that resolves an
29581 (Expression::DoResolveLValue): Default invocation calls
29584 (Indexers): New class used to keep track of indexers in a given
29587 (IStackStore): Renamed from LValue, as it did not really describe
29588 what this did. Also ResolveLValue is gone from this interface and
29589 now is part of Expression.
29591 (ElementAccess): Depending on the element access type
29593 * typemanager.cs: Add `indexer_name_type' as a Core type
29594 (System.Runtime.CompilerServices.IndexerNameAttribute)
29596 * statement.cs (Goto): Take a location.
29598 2001-10-18 Ravi Pratap <ravi@ximian.com>
29600 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29601 if two delegates are compatible.
29603 (NewDelegate::DoResolve): Update to take care of the case when
29604 we instantiate a delegate from another delegate.
29606 * typemanager.cs (FindMembers): Don't even try to look up members
29607 of Delegate types for now.
29609 2001-10-18 Ravi Pratap <ravi@ximian.com>
29611 * delegate.cs (NewDelegate): New class to take care of delegate
29614 * expression.cs (New): Split the delegate related code out into
29615 the NewDelegate class.
29617 * delegate.cs (DelegateInvocation): New class to handle delegate
29620 * expression.cs (Invocation): Split out delegate related code into
29621 the DelegateInvocation class.
29623 2001-10-17 Ravi Pratap <ravi@ximian.com>
29625 * expression.cs (New::DoResolve): Implement delegate creation fully
29626 and according to the spec.
29628 (New::DoEmit): Update to handle delegates differently.
29630 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29631 because of which we were printing out arguments in reverse order !
29633 * delegate.cs (VerifyMethod): Implement to check if the given method
29634 matches the delegate.
29636 (FullDelegateDesc): Implement.
29638 (VerifyApplicability): Implement.
29640 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29641 delegate invocations too.
29643 (Invocation::Emit): Ditto.
29645 * ../errors/cs1593.cs : Added.
29647 * ../errors/cs1594.cs : Added.
29649 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29651 2001-10-16 Ravi Pratap <ravi@ximian.com>
29653 * typemanager.cs (intptr_type): Core type for System.IntPtr
29655 (InitCoreTypes): Update for the same.
29657 (iasyncresult_type, asynccallback_type): Ditto.
29659 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29662 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29665 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29666 the builders for the 4 members of a delegate type :-)
29668 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29671 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29673 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29675 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29677 * statement.cs (Break::Emit): Implement.
29678 (Continue::Emit): Implement.
29680 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29681 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29682 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29683 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29686 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29687 properties that track the label for the current loop (begin of the
29688 loop and end of the loop).
29690 2001-10-15 Ravi Pratap <ravi@ximian.com>
29692 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29693 use of emitting anything at all.
29695 * class.cs, rootcontext.cs : Get rid of calls to the same.
29697 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29699 (Populate): Define the constructor correctly and set the implementation
29702 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29705 (AddDelegateType): Implement.
29707 (IsDelegateType): Implement helper method.
29709 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29711 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29712 and accordingly handle it.
29714 * delegate.cs (Populate): Take TypeContainer argument.
29715 Implement bits to define the Invoke method. However, I still haven't figured out
29716 how to take care of the native int bit :-(
29718 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29719 Qualify the name of the delegate, not its return type !
29721 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29724 (StandardConversionExists): Checking for array types turns out to be recursive.
29726 (ConvertReferenceExplicit): Implement array conversion.
29728 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29730 2001-10-12 Ravi Pratap <ravi@ximian.com>
29732 * cs-parser.jay (delegate_declaration): Store the fully qualified
29733 name as it is a type declaration.
29735 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29738 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29739 as TypeContainer::DefineType.
29741 (Populate): Method in which all the definition of the various methods (Invoke)
29744 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29747 (CloseDelegate): Finally creates the delegate.
29749 * class.cs (TypeContainer::DefineType): Update to define delegates.
29750 (Populate, Emit and CloseType): Do the same thing here too.
29752 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29753 delegates in all these operations.
29755 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29757 * expression.cs: LocalTemporary: a new expression used to
29758 reference a temporary that has been created.
29760 * assign.cs: Handle PropertyAccess back here, so that we can
29761 provide the proper semantic access to properties.
29763 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29764 a few more explicit conversions.
29766 * modifiers.cs: `NEW' modifier maps to HideBySig.
29768 * expression.cs (PropertyExpr): Make this into an
29769 ExpressionStatement, and support the EmitStatement code path.
29771 Perform get/set error checking, clean up the interface.
29773 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29774 them into toplevel access objects.
29776 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29778 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29781 * typemanager.cs: Keep track here of our PropertyBuilders again to
29782 work around lameness in SRE.
29784 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29786 * expression.cs (LValue::LValueResolve): New method in the
29787 interface, used to perform a second resolution pass for LValues.
29789 (This::DoResolve): Catch the use of this in static methods.
29791 (This::LValueResolve): Implement.
29793 (This::Store): Remove warning, assigning to `this' in structures
29796 (Invocation::Emit): Deal with invocation of
29797 methods on value types. We need to pass the address to structure
29798 methods rather than the object itself. (The equivalent code to
29799 emit "this" for structures leaves the entire structure on the
29800 stack instead of a pointer to it).
29802 (ParameterReference::DoResolve): Compute the real index for the
29803 argument based on whether the method takes or not a `this' pointer
29804 (ie, the method is static).
29806 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29807 value types returned from functions when we need to invoke a
29808 method on the sturcture.
29811 2001-10-11 Ravi Pratap <ravi@ximian.com>
29813 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29814 defining the type in the Modulebuilder or Typebuilder. This is to take
29815 care of nested types which need to be defined on the TypeBuilder using
29816 DefineNestedMethod.
29818 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29819 methods in RootContext, only ported to be part of TypeContainer.
29821 (TypeContainer::GetInterfaceOrClass): Ditto.
29823 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29825 * interface.cs (Interface::DefineInterface): New method. Does exactly
29826 what RootContext.CreateInterface did earlier, only it takes care of nested types
29829 (Interface::GetInterfaces): Move from RootContext here and port.
29831 (Interface::GetInterfaceByName): Same here.
29833 * rootcontext.cs (ResolveTree): Re-write.
29835 (PopulateTypes): Re-write.
29837 * class.cs (TypeContainer::Populate): Populate nested types too.
29838 (TypeContainer::Emit): Emit nested members too.
29840 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29841 instead just use the name argument passed in as it is already fully
29844 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29845 to TypeContainer mapping to see if a type is user-defined.
29847 * class.cs (TypeContainer::CloseType): Implement.
29849 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29850 the default constructor.
29852 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29855 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29857 * interface.cs (CloseType): Create the type here.
29859 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29862 Remove all the methods which are now in TypeContainer.
29864 2001-10-10 Ravi Pratap <ravi@ximian.com>
29866 * delegate.cs (Define): Re-write bits to define the delegate
29869 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29871 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29873 * expression.cs (ImplicitReferenceConversion): handle null as well
29874 as a source to convert to any reference type.
29876 * statement.cs (Return): Perform any implicit conversions to
29877 expected return type.
29879 Validate use of return statement.
29881 * codegen.cs (EmitContext): Pass the expected return type here.
29883 * class.cs (Method, Constructor, Property): Pass expected return
29884 type to EmitContext.
29886 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29888 * expression.cs: Make DoResolve take an EmitContext instead of a
29891 Replaced `l' and `location' for `loc', for consistency.
29893 (Error, Warning): Remove unneeded Tc argument.
29895 * assign.cs, literal.cs, constant.cs: Update to new calling
29898 * codegen.cs: EmitContext now contains a flag indicating whether
29899 code is being generated in a static method or not.
29901 * cs-parser.jay: DecomposeQI, new function that replaces the old
29902 QualifiedIdentifier. Now we always decompose the assembled
29903 strings from qualified_identifier productions into a group of
29906 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29908 * rootcontext.cs: Deal with field-less struct types correctly now
29909 by passing the size option to Define Type.
29911 * class.cs: Removed hack that created one static field.
29913 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29915 * statement.cs: Moved most of the code generation here.
29917 2001-10-09 Ravi Pratap <ravi@ximian.com>
29919 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29922 (ElementAccess): Remove useless bits for now - keep checks as the spec
29925 2001-10-08 Ravi Pratap <ravi@ximian.com>
29927 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29928 and start performing checks according to the spec.
29930 2001-10-07 Ravi Pratap <ravi@ximian.com>
29932 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29933 rank_specifiers instead.
29935 (rank_specifiers): Change the order in which the rank specifiers are stored
29937 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29939 * expression.cs (ElementAccess): Implement the LValue interface too.
29941 2001-10-06 Ravi Pratap <ravi@ximian.com>
29943 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29944 except that user defined conversions are not included.
29946 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29947 perform the conversion of the return type, if necessary.
29949 (New::DoResolve): Check whether we are creating an array or an object
29950 and accordingly do the needful.
29952 (New::Emit): Same here.
29954 (New::DoResolve): Implement guts of array creation.
29956 (New::FormLookupType): Helper function.
29958 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29960 * codegen.cs: Removed most of the code generation here, and move the
29961 corresponding code generation bits to the statement classes.
29963 Added support for try/catch/finalize and throw.
29965 * cs-parser.jay: Added support for try/catch/finalize.
29967 * class.cs: Catch static methods having the flags override,
29968 virtual or abstract.
29970 * expression.cs (UserCast): This user cast was not really doing
29971 what it was supposed to do. Which is to be born in fully resolved
29972 state. Parts of the resolution were being performed at Emit time!
29976 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29978 * expression.cs: Implicity convert the result from UserCast.
29980 2001-10-05 Ravi Pratap <ravi@ximian.com>
29982 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29983 prevented it from working correctly.
29985 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29986 merely ConvertImplicit.
29988 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29990 * typemanager.cs: Make the LookupTypeContainer function static,
29991 and not per-instance.
29993 * class.cs: Make static FindMembers (the one that takes a Type
29996 * codegen.cs: Add EmitForeach here.
29998 * cs-parser.jay: Make foreach a toplevel object instead of the
29999 inline expansion, as we need to perform semantic analysis on it.
30001 2001-10-05 Ravi Pratap <ravi@ximian.com>
30003 * expression.cs (Expression::ImplicitUserConversion): Rename to
30004 UserDefinedConversion.
30006 (Expression::UserDefinedConversion): Take an extra argument specifying
30007 whether we look for explicit user conversions too.
30009 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30011 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30013 (ExplicitUserConversion): Make it a call to UserDefinedConversion
30014 with the appropriate arguments.
30016 * cs-parser.jay (cast_expression): Record location too.
30018 * expression.cs (Cast): Record location info.
30020 (Expression::ConvertExplicit): Take location argument.
30022 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30023 to determine if we are doing explicit conversions.
30025 (UserCast::Emit): Update accordingly.
30027 (Expression::ConvertExplicit): Report an error if everything fails.
30029 * ../errors/cs0030.cs : Add.
30031 2001-10-04 Miguel de Icaza <miguel@ximian.com>
30033 * modifiers.cs: If the ABSTRACT keyword is present, also set the
30034 virtual and newslot bits.
30036 * class.cs (TypeContainer::RegisterRequiredImplementations):
30037 Record methods we need.
30039 (TypeContainer::MakeKey): Helper function to make keys for
30040 MethodBases, since the Methodbase key is useless.
30042 (TypeContainer::Populate): Call RegisterRequiredImplementations
30043 before defining the methods.
30045 Create a mapping for method_builders_to_methods ahead of time
30046 instead of inside a tight loop.
30048 (::RequireMethods): Accept an object as the data to set into the
30049 hashtable so we can report interface vs abstract method mismatch.
30051 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30053 * report.cs: Make all of it static.
30055 * rootcontext.cs: Drop object_type and value_type computations, as
30056 we have those in the TypeManager anyways.
30058 Drop report instance variable too, now it is a global.
30060 * driver.cs: Use try/catch on command line handling.
30062 Add --probe option to debug the error reporting system with a test
30065 * report.cs: Add support for exiting program when a probe
30066 condition is reached.
30068 2001-10-03 Ravi Pratap <ravi@ximian.com>
30070 * expression.cs (Binary::DoNumericPromotions): Fix the case when
30071 we do a forcible conversion regardless of type, to check if
30072 ForceConversion returns a null.
30074 (Binary::error19): Use location to report error.
30076 (Unary::error23): Use location here too.
30078 * ../errors/cs0019.cs : Check in.
30080 * ../errors/cs0023.cs : Check in.
30082 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30083 case of a non-null MethodInfo object with a length of 0 !
30085 (Binary::ResolveOperator): Flag error if overload resolution fails to find
30086 an applicable member - according to the spec :-)
30087 Also fix logic to find members in base types.
30089 (Unary::ResolveOperator): Same here.
30091 (Unary::report23): Change name to error23 and make first argument a TypeContainer
30092 as I was getting thoroughly confused between this and error19 :-)
30094 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30095 (::FindMostEncompassedType): Implement.
30096 (::FindMostEncompassingType): Implement.
30097 (::StandardConversionExists): Implement.
30099 (UserImplicitCast): Re-vamp. We now need info about most specific
30100 source and target types so that we can do the necessary conversions.
30102 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30103 mathematical union with no duplicates.
30105 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30107 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30108 in order from base classes to child classes, so that we can in
30109 child classes look up in our parent for method names and
30110 attributes (required for handling abstract, virtual, new, override
30111 constructs: we need to instrospect our base class, and if we dont
30112 populate the classes in order, the introspection might be
30113 incorrect. For example, a method could query its parent before
30114 the parent has any methods and would determine that the parent has
30115 no abstract methods (while it could have had them)).
30117 (RootContext::CreateType): Record the order in which we define the
30120 2001-10-02 Miguel de Icaza <miguel@ximian.com>
30122 * class.cs (TypeContainer::Populate): Also method definitions can
30123 fail now, keep track of this.
30125 (TypeContainer::FindMembers): Implement support for
30126 DeclaredOnly/noDeclaredOnly flag.
30128 (Constructor::Emit) Return the ConstructorBuilder.
30130 (Method::Emit) Return the MethodBuilder.
30131 Check for abstract or virtual methods to be public.
30133 * rootcontext.cs (RootContext::CreateType): Register all the
30134 abstract methods required for the class to be complete and the
30135 interface methods that must be implemented.
30137 * cs-parser.jay: Report error 501 (method requires body if it is
30138 not marked abstract or extern).
30140 * expression.cs (TypeOf::Emit): Implement.
30142 * typemanager.cs: runtime_handle_type, new global type.
30144 * class.cs (Property::Emit): Generate code for properties.
30146 2001-10-02 Ravi Pratap <ravi@ximian.com>
30148 * expression.cs (Unary::ResolveOperator): Find operators on base type
30149 too - we now conform exactly to the spec.
30151 (Binary::ResolveOperator): Same here.
30153 * class.cs (Operator::Define): Fix minor quirk in the tests.
30155 * ../errors/cs0215.cs : Added.
30157 * ../errors/cs0556.cs : Added.
30159 * ../errors/cs0555.cs : Added.
30161 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30163 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30164 single integer which is really efficient
30166 2001-10-01 Ravi Pratap <ravi@ximian.com>
30168 * expression.cs (Expression::ImplicitUserConversion): Use location
30169 even in the case when we are examining True operators.
30171 * class.cs (Operator::Define): Perform extensive checks to conform
30172 with the rules for operator overloading in the spec.
30174 * expression.cs (Expression::ImplicitReferenceConversion): Implement
30175 some of the other conversions mentioned in the spec.
30177 * typemanager.cs (array_type): New static member for the System.Array built-in
30180 (cloneable_interface): For System.ICloneable interface.
30182 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30183 we start resolving the tree and populating types.
30185 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30187 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30189 * expression.cs (Expression::ExprClassFromMemberInfo,
30190 Expression::Literalize): Create literal expressions from
30191 FieldInfos which are literals.
30193 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30194 type casts, because they were wrong. The test suite in tests
30197 (ImplicitNumericConversion): ushort to ulong requires a widening
30200 Int32 constant to long requires widening cast as well.
30202 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30203 for integers because the type on the stack is not i4.
30205 2001-09-30 Miguel de Icaza <miguel@ximian.com>
30207 * expression.cs (report118): require location argument.
30209 * parameter.cs: Do not dereference potential null value.
30211 * class.cs: Catch methods that lack the `new' keyword when
30212 overriding a name. Report warnings when `new' is used without
30213 anything being there to override.
30215 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30217 * class.cs: Only add constructor to hashtable if it is non-null
30218 (as now constructors can fail on define).
30220 (TypeManager, Class, Struct): Take location arguments.
30222 Catch field instance initialization in structs as errors.
30224 accepting_filter: a new filter for FindMembers that is static so
30225 that we dont create an instance per invocation.
30227 (Constructor::Define): Catch errors where a struct constructor is
30230 * cs-parser.jay: Pass location information for various new
30233 * delegate.cs (Delegate): take a location argument.
30235 * driver.cs: Do not call EmitCode if there were problesm in the
30236 Definition of the types, as many Builders wont be there.
30238 * decl.cs (Decl::Decl): Require a location argument.
30240 * cs-tokenizer.cs: Handle properly hex constants that can not fit
30241 into integers, and find the most appropiate integer for it.
30243 * literal.cs: Implement ULongLiteral.
30245 * rootcontext.cs: Provide better information about the location of
30246 failure when CreateType fails.
30248 2001-09-29 Miguel de Icaza <miguel@ximian.com>
30250 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30253 * expression.cs (Binary::CheckShiftArguments): Add missing type
30255 (Binary::ResolveOperator): Add type to the logical and and logical
30256 or, Bitwise And/Or and Exclusive Or code paths, it was missing
30259 (Binary::DoNumericPromotions): In the case where either argument
30260 is ulong (and most signed types combined with ulong cause an
30261 error) perform implicit integer constant conversions as well.
30263 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30265 * expression.cs (UserImplicitCast): Method should always be
30267 (Invocation::BetterConversion): Simplified test for IntLiteral.
30269 (Expression::ImplicitNumericConversion): Split this routine out.
30270 Put the code that performs implicit constant integer conversions
30273 (Expression::Resolve): Become a wrapper around DoResolve so we can
30274 check eclass and type being set after resolve.
30276 (Invocation::Badness): Remove this dead function
30278 (Binary::ResolveOperator): Do not compute the expensive argumnets
30279 unless we have a union for it.
30281 (Probe::Emit): Is needs to do an isinst and then
30282 compare against null.
30284 (::CanConvert): Added Location argument. If the Location argument
30285 is null (Location.Null), then we do not report errors. This is
30286 used by the `probe' mechanism of the Explicit conversion. We do
30287 not want to generate an error for something that the user
30288 explicitly requested to be casted. But the pipeline for an
30289 explicit cast first tests for potential implicit casts.
30291 So for now, if the Location is null, it means `Probe only' to
30292 avoid adding another argument. Might have to revise this
30295 (ClassCast): New class used to type cast objects into arbitrary
30296 classes (used in Explicit Reference Conversions).
30298 Implement `as' as well.
30300 Reverted all the patches from Ravi below: they were broken:
30302 * The use of `level' as a mechanism to stop recursive
30303 invocations is wrong. That was there just to catch the
30304 bug with a strack trace but not as a way of addressing
30307 To fix the problem we have to *understand* what is going
30308 on and the interactions and come up with a plan, not
30309 just get things going.
30311 * The use of the type conversion cache that I proposed
30312 last night had an open topic: How does this work across
30313 protection domains. A user defined conversion might not
30314 be public in the location where we are applying the
30315 conversion, a different conversion might be selected
30316 (ie, private A->B (better) but public B->A (worse),
30317 inside A, A->B applies, but outside it, B->A will
30320 * On top of that (ie, even if the above is solved),
30321 conversions in a cache need to be abstract. Ie, `To
30322 convert from an Int to a Short use an OpcodeCast', not
30323 `To convert from an Int to a Short use the OpcodeCast on
30324 the variable 5' (which is what this patch was doing).
30326 2001-09-28 Ravi Pratap <ravi@ximian.com>
30328 * expression.cs (Invocation::ConversionExists): Re-write to use
30329 the conversion cache
30331 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30332 cache all conversions done, not just user-defined ones.
30334 (Invocation::BetterConversion): The real culprit. Use ConversionExists
30335 to determine if a conversion exists instead of acutually trying to
30336 perform the conversion. It's faster too.
30338 (Expression::ConvertExplicit): Modify to use ConversionExists to check
30339 and only then attempt the implicit conversion.
30341 2001-09-28 Ravi Pratap <ravi@ximian.com>
30343 * expression.cs (ConvertImplicit): Use a cache for conversions
30344 already found. Check level of recursion and bail out if necessary.
30346 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30348 * typemanager.cs (string_concat_string_string, string_concat_object_object):
30349 Export standard methods that we expect for string operations.
30351 * statement.cs (Block::UsageWarning): Track usage of variables and
30352 report the errors for not used variables.
30354 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30357 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30359 * codegen.cs: remove unnneded code
30361 * expression.cs: Removed BuiltinTypeAccess class
30363 Fix the order in which implicit conversions are
30366 The previous fixed dropped support for boxed conversions (adding a
30367 test to the test suite now)
30369 (UserImplicitCast::CanConvert): Remove test for source being null,
30370 that code is broken. We should not feed a null to begin with, if
30371 we do, then we should track the bug where the problem originates
30372 and not try to cover it up here.
30374 Return a resolved expression of type UserImplicitCast on success
30375 rather than true/false. Ravi: this is what I was talking about,
30376 the pattern is to use a static method as a "constructor" for
30379 Also, do not create arguments until the very last minute,
30380 otherwise we always create the arguments even for lookups that
30381 will never be performed.
30383 (UserImplicitCast::Resolve): Eliminate, objects of type
30384 UserImplicitCast are born in a fully resolved state.
30386 * typemanager.cs (InitCoreTypes): Init also value_type
30387 (System.ValueType).
30389 * expression.cs (Cast::Resolve): First resolve the child expression.
30391 (LValue): Add new method AddressOf to be used by
30394 Change the argument of Store to take an EmitContext instead of an
30395 ILGenerator, because things like FieldExpr need to be able to call
30396 their children expression to generate the instance code.
30398 (Expression::Error, Expression::Warning): Sugar functions for
30401 (Expression::MemberLookup): Accept a TypeContainer instead of a
30402 Report as the first argument.
30404 (Expression::ResolvePrimary): Killed. I still want to improve
30405 this as currently the code is just not right.
30407 (Expression::ResolveMemberAccess): Simplify, but it is still
30410 (Unary::Resolve): Catch errors in AddressOf operators.
30412 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30413 index to a byte for the short-version, or the compiler will choose
30414 the wrong Emit call, which generates the wrong data.
30416 (ParameterReference::Emit, ::Store): same.
30418 (FieldExpr::AddressOf): Implement.
30420 * typemanager.cs: TypeManager: made public variable instead of
30423 * driver.cs: document --fatal.
30425 * report.cs (ErrorMessage, WarningMessage): new names for the old
30426 Error and Warning classes.
30428 * cs-parser.jay (member_access): Turn built-in access to types
30429 into a normal simplename
30431 2001-09-27 Ravi Pratap <ravi@ximian.com>
30433 * expression.cs (Invocation::BetterConversion): Fix to cope
30434 with q being null, since this was introducing a bug.
30436 * expression.cs (ConvertImplicit): Do built-in conversions first.
30438 2001-09-27 Ravi Pratap <ravi@ximian.com>
30440 * expression.cs (UserImplicitCast::Resolve): Fix bug.
30442 2001-09-27 Ravi Pratap <ravi@ximian.com>
30444 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30445 I had introduced long ago (what's new ?).
30447 * expression.cs (UserImplicitCast::CanConvert): Static method to do
30448 the work of all the checking.
30449 (ConvertImplicit): Call CanConvert and only then create object if necessary.
30450 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30452 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30453 that is the right way.
30455 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
30456 overloading resolution. Use everywhere instead of cutting and pasting code.
30458 (Binary::ResolveOperator): Use MakeUnionSet.
30460 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
30461 we have to convert to bool types. Not complete yet.
30463 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30465 * typemanager.cs (TypeManager::CSharpName): support ushort.
30467 * expression.cs (Expression::TryImplicitIntConversion): Attempts
30468 to provide an expression that performsn an implicit constant int
30469 conversion (section 6.1.6).
30470 (Expression::ConvertImplicitRequired): Reworked to include
30471 implicit constant expression conversions.
30473 (Expression::ConvertNumericExplicit): Finished.
30475 (Invocation::Emit): If InstanceExpression is null, then it means
30476 that we perform a call on this.
30478 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30480 * expression.cs (Unary::Emit): Remove some dead code.
30481 (Probe): Implement Resolve and Emit for `is'.
30482 (Expression::ConvertImplicitRequired): Attempt to do constant
30483 expression conversions here. Maybe should be moved to
30484 ConvertImplicit, but I am not sure.
30485 (Expression::ImplicitLongConstantConversionPossible,
30486 Expression::ImplicitIntConstantConversionPossible): New functions
30487 that tell whether is it possible to apply an implicit constant
30488 expression conversion.
30490 (ConvertNumericExplicit): Started work on explicit numeric
30493 * cs-parser.jay: Update operator constants.
30495 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30496 (Parameters::GetSignature): Hook up VerifyArgs here.
30497 (Parameters::VerifyArgs): Verifies that no two arguments have the
30500 * class.cs (Operator): Update the operator names to reflect the
30501 ones that the spec expects (as we are just stringizing the
30504 * expression.cs (Unary::ResolveOperator): Fix bug: Use
30505 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30506 previous usage did only work for our methods.
30507 (Expression::ConvertImplicit): Handle decimal implicit numeric
30508 conversions as well.
30509 (Expression::InternalTypeConstructor): Used to invoke constructors
30510 on internal types for default promotions.
30512 (Unary::Emit): Implement special handling for the pre/post
30513 increment/decrement for overloaded operators, as they need to have
30514 the same semantics as the other operators.
30516 (Binary::ResolveOperator): ditto.
30517 (Invocation::ConversionExists): ditto.
30518 (UserImplicitCast::Resolve): ditto.
30520 2001-09-26 Ravi Pratap <ravi@ximian.com>
30522 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30523 operator, return after emitting body. Regression tests pass again !
30525 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30526 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30527 (Invocation::OverloadResolve): Ditto.
30528 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30530 * everywhere : update calls to the above methods accordingly.
30532 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30534 * assign.cs (Assign): Make it inherit from ExpressionStatement.
30536 * expression.cs (ExpressionStatement): New base class used for
30537 expressions that can appear in statements, so that we can provide
30538 an alternate path to generate expression that do not leave a value
30541 (Expression::Emit, and all the derivatives): We no longer return
30542 whether a value is left on the stack or not. Every expression
30543 after being emitted leaves a single value on the stack.
30545 * codegen.cs (EmitContext::EmitStatementExpression): Use the
30546 facilties of ExpressionStatement if possible.
30548 * cs-parser.jay: Update statement_expression.
30550 2001-09-25 Miguel de Icaza <miguel@ximian.com>
30552 * driver.cs: Change the wording of message
30554 2001-09-25 Ravi Pratap <ravi@ximian.com>
30556 * expression.cs (Binary::ResolveOperator): Had forgottten to set
30557 the type of the expression to the return type of the method if
30558 we have an overloaded operator match ! The regression tests pass again !
30559 (Unary::ResolveOperator): Ditto.
30561 * expression.cs (Invocation::ConversionExists): Correct the member lookup
30562 to find "op_Implicit", not "implicit" ;-)
30563 (UserImplicitCast): New class to take care of user-defined implicit conversions.
30564 (ConvertImplicit, ForceConversion): Take TypeContainer argument
30566 * everywhere : Correct calls to the above accordingly.
30568 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30569 (ConvertImplicit): Do user-defined conversion if it exists.
30571 2001-09-24 Miguel de Icaza <miguel@ximian.com>
30573 * assign.cs: track location.
30574 (Resolve): Use implicit conversions on assignment.
30576 * literal.cs: Oops. Not good, Emit of short access values should
30577 pass (Bytes) or the wrong argument will be selected.
30579 * expression.cs (Unary::Emit): Emit code for -expr.
30581 (Unary::ResolveOperator): Handle `Substract' for non-constants
30582 (substract from zero from the non-constants).
30583 Deal with Doubles as well.
30585 (Expression::ConvertImplicitRequired): New routine that reports an
30586 error if no implicit conversion exists.
30588 (Invocation::OverloadResolve): Store the converted implicit
30589 expressions if we make them
30591 2001-09-24 Ravi Pratap <ravi@ximian.com>
30593 * class.cs (ConstructorInitializer): Take a Location argument.
30594 (ConstructorBaseInitializer): Same here.
30595 (ConstructorThisInitializer): Same here.
30597 * cs-parser.jay : Update all calls accordingly.
30599 * expression.cs (Unary, Binary, New): Take location argument.
30600 Update accordingly everywhere.
30602 * cs-parser.jay : Update all calls to the above to take a location
30605 * class.cs : Ditto.
30607 2001-09-24 Ravi Pratap <ravi@ximian.com>
30609 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30610 (Invocation::BetterConversion): Same here
30611 (Invocation::ConversionExists): Ditto.
30613 (Invocation::ConversionExists): Implement.
30615 2001-09-22 Ravi Pratap <ravi@ximian.com>
30617 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30618 Also take an additional TypeContainer argument.
30620 * All over : Pass in TypeContainer as argument to OverloadResolve.
30622 * typemanager.cs (CSharpName): Update to check for the string type and return
30625 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30628 2001-09-21 Ravi Pratap <ravi@ximian.com>
30630 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30631 (Invocation::BetterFunction): Implement.
30632 (Invocation::BetterConversion): Implement.
30633 (Invocation::ConversionExists): Skeleton, no implementation yet.
30635 Okay, things work fine !
30637 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30639 * typemanager.cs: declare and load enum_type, delegate_type and
30642 * expression.cs (Expression::Emit): Now emit returns a value that
30643 tells whether a value is left on the stack or not. This strategy
30644 might be reveted tomorrow with a mechanism that would address
30645 multiple assignments.
30646 (Expression::report118): Utility routine to report mismatches on
30649 (Unary::Report23): Report impossible type/operator combination
30652 (Unary::IsIncrementableNumber): Whether the type can be
30653 incremented or decremented with add.
30654 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30656 (Unary::ResolveOperator): Implement ++, !, ~,
30658 (Invocation::Emit): Deal with new Emit convetion.
30660 * All Expression derivatives: Updated their Emit method to return
30661 whether they leave values on the stack or not.
30663 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30664 stack for expressions that are statements.
30666 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30668 * expression.cs (LValue): New interface. Must be implemented by
30670 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30673 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30674 interface for generating code, simplifies the code.
30676 2001-09-20 Ravi Pratap <ravi@ximian.com>
30678 * expression.cs (everywhere): Comment out return statements in ::Resolve
30679 methods to avoid the warnings.
30681 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30683 * driver.cs (parse): Report error 2001 if we can not open the
30686 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30689 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30692 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30693 otherwise nested blocks end up with the same index.
30695 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30697 * expression.cs: Instead of having FIXMEs in the Resolve
30698 functions, throw exceptions so it is obvious that we are facing a
30701 * cs-parser.jay (invocation_expression): Pass Location information.
30703 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30704 Use a basename for those routines because .NET does not like paths
30707 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30710 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30712 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30713 are loading the correct data types (throws an exception if not).
30714 (TypeManager::InitCoreTypes): Use CoreLookupType
30716 * expression.cs (Unary::ResolveOperator): return the child
30717 expression for expressions which are just +expr.
30718 (Unary::ResolveOperator): Return negative literals for -LITERAL
30719 expressions (otherwise they are Unary {Literal}).
30720 (Invocation::Badness): Take into account `Implicit constant
30721 expression conversions'.
30723 * literal.cs (LongLiteral): Implement long literal class.
30724 (IntLiteral): export the `Value' of the intliteral.
30726 2001-09-19 Ravi Pratap <ravi@ximian.com>
30728 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30730 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30731 instead of 'Operator'
30733 * expression.cs (Binary::ResolveOperator): Update accordingly.
30734 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30737 * cs-parser.jay (unary_expression): Update to use the new names.
30739 * gen-treedump.cs (GetUnary): Same here.
30741 * expression.cs (Unary::Resolve): Implement.
30742 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30743 operators are found instead of making noise ;-)
30744 (Unary::ResolveOperator): New method to do precisely the same thing which
30745 Binary::ResolveOperator does for Binary expressions.
30746 (Unary.method, .Arguments): Add.
30747 (Unary::OperName): Implement.
30748 (Unary::ForceConversion): Copy and Paste !
30750 * class.cs (Operator::Define): Fix a small bug for the case when we have
30753 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30754 for the inbuilt operators. Only overloading works for now ;-)
30756 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30758 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30759 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30761 * expression.cs (This::Emit): Implement.
30762 (This::Resolve): Implement.
30763 (TypeOf:Resolve): Implement.
30764 (Expression::ResolveSimpleName): Add an implicit this to instance
30766 (MemberAccess::Resolve): Deal with Parameters and Fields.
30767 Bind instance variable to Field expressions.
30768 (FieldExpr::Instance): New field used to track the expression that
30769 represents the object instance.
30770 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30772 (FieldExpr::Emit): Implement.
30774 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30775 the last instruction contains a return opcode to avoid generating
30776 the last `ret' instruction (this generates correct code, and it is
30777 nice to pass the peverify output).
30779 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30780 initializer for static and instance variables.
30781 (Constructor::Emit): Allow initializer to be null in the case of
30782 static constructors. Only emit initializer for instance
30785 (TypeContainer::FindMembers): Return a null array if there are no
30788 Also fix the code for the MemberTypes.Method branch, as it was not
30789 scanning that for operators (or tried to access null variables before).
30791 * assign.cs (Assign::Emit): Handle instance and static fields.
30795 * driver.cs: Stop compilation if there are parse errors.
30797 * cs-parser.jay (constructor_declaration): Provide default base
30798 initializer for non-static constructors.
30799 (constructor_declarator): Do not provide a default base
30800 initializers if none was specified.
30801 Catch the fact that constructors should not have parameters.
30803 * class.cs: Do not emit parent class initializers for static
30804 constructors, that should be flagged as an error.
30806 2001-09-18 Ravi Pratap <ravi@ximian.com>
30808 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30809 Move back code into TypeContainer::Populate.
30811 2001-09-18 Ravi Pratap <ravi@ximian.com>
30813 * class.cs (TypeContainer::AddConstructor): Fix the check to
30814 compare against Name, not Basename.
30815 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30817 * cs-parser.jay : Update accordingly.
30819 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30820 for methods, don't forget to look into the operators too.
30821 (RegisterMethodBuilder): Helper method to take care of this for
30822 methods, constructors and operators.
30823 (Operator::Define): Completely revamp.
30824 (Operator.OperatorMethod, MethodName): New fields.
30825 (TypeContainer::Populate): Move the registering of builders into
30826 RegisterMethodBuilder.
30827 (Operator::Emit): Re-write.
30829 * expression.cs (Binary::Emit): Comment out code path to emit method
30830 invocation stuff for the case when we have a user defined operator. I am
30831 just not able to get it right !
30833 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30835 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30838 (Expression::MemberLookup): Provide a version that allows to
30839 specify the MemberTypes and BindingFlags.
30841 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30842 so it was not fetching variable information from outer blocks.
30844 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30845 Beforefieldinit as it was buggy.
30847 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30848 that Ravi put here.
30850 * class.cs (Constructor::Emit): Only emit if block is not null.
30851 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30852 deal with this by semantically definining it as if the user had
30855 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30856 constructors as we now "emit" them at a higher level.
30858 (TypeContainer::DefineDefaultConstructor): Used to define the
30859 default constructors if none was provided.
30861 (ConstructorInitializer): Add methods Resolve and Emit.
30863 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30865 2001-09-17 Ravi Pratap <ravi@ximian.com>
30867 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30868 the default constructor builder with our hashtable for methodbuilders
30871 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30872 and argument_count is 0 in which case we have a match.
30873 (Binary::ResolveOperator): More null checking and miscellaneous coding
30876 2001-09-17 Ravi Pratap <ravi@ximian.com>
30878 * rootcontext.cs (IsNameSpace): Compare against null.
30880 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30882 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30883 and Unary::Operator.
30885 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30888 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30889 we have overloaded operators.
30890 (Binary::ResolveOperator): Implement the part which does the operator overload
30893 * class.cs (Operator::Emit): Implement.
30894 (TypeContainer::Emit): Emit the operators we have too.
30896 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30897 the case when we have a user-defined operator.
30899 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30901 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30903 2001-09-16 Ravi Pratap <ravi@ximian.com>
30905 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30906 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30907 (Constructor::Emit): Implement.
30908 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30909 if we have no work to do.
30910 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30913 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30914 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30916 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30919 2001-09-15 Ravi Pratap <ravi@ximian.com>
30921 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30923 (Tree::RecordNamespace): Method to do what the name says ;-)
30924 (Tree::Namespaces): Property to get at the namespaces hashtable.
30926 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30929 * rootcontext.cs (IsNamespace): Fixed it :-)
30931 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30933 * class.cs (TypeContainer::FindMembers): Add support for
30935 (MethodCore): New class that encapsulates both the shared aspects
30936 of a Constructor and a Method.
30937 (Method, Constructor): Factored pieces into MethodCore.
30939 * driver.cs: Added --fatal which makes errors throw exceptions.
30940 Load System assembly as well as part of the standard library.
30942 * report.cs: Allow throwing exceptions on errors for debugging.
30944 * modifiers.cs: Do not use `parent', instead use the real type
30945 container to evaluate permission settings.
30947 * class.cs: Put Ravi's patch back in. He is right, and we will
30948 have to cope with the
30950 2001-09-14 Ravi Pratap <ravi@ximian.com>
30952 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30953 FamORAssem, not FamANDAssem.
30955 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30957 * driver.cs: Added --parse option that only parses its input files
30960 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30961 incorrect. IsTopLevel is not used to tell whether an object is
30962 root_types or not (that can be achieved by testing this ==
30963 root_types). But to see if this is a top-level *class* (not
30964 necessarly our "toplevel" container).
30966 2001-09-14 Ravi Pratap <ravi@ximian.com>
30968 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30969 parent instead of a direct call to GetType.
30971 2001-09-14 Ravi Pratap <ravi@ximian.com>
30973 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30974 Modifiers.TypeAttr. This should just be a call to that method.
30976 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30977 object so that we can determine if we are top-level or not.
30979 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30982 * enum.cs (Enum::Define): Ditto.
30984 * modifiers.cs (FieldAttr): Re-write.
30986 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30987 (TypeContainer::HaveStaticConstructor): New property to provide access
30988 to precisely that info.
30990 * modifiers.cs (MethodAttr): Re-write.
30991 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30993 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30994 of top-level types as claimed.
30996 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30998 * expression.cs (MemberLookup): Fruitless attempt to lookup
30999 constructors. Maybe I need to emit default constructors? That
31000 might be it (currently .NET emits this for me automatically).
31001 (Invocation::OverloadResolve): Cope with Arguments == null.
31002 (Invocation::EmitArguments): new function, shared by the new
31003 constructor and us.
31004 (Invocation::Emit): Handle static and instance methods. Emit
31005 proper call instruction for virtual or non-virtual invocations.
31006 (New::Emit): Implement.
31007 (New::Resolve): Implement.
31008 (MemberAccess:Resolve): Implement.
31009 (MethodGroupExpr::InstanceExpression): used conforming to the spec
31010 to track instances.
31011 (FieldExpr::Resolve): Set type.
31013 * support.cs: Handle empty arguments.
31015 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31016 SimpleLookup): Auxiliary routines to help parse a qualifier
31019 Update qualifier_identifier rule.
31021 * codegen.cs: Removed debugging messages.
31023 * class.cs: Make this a global thing, this acts just as a "key" to
31024 objects that we might have around.
31026 (Populate): Only initialize method_builders_to_methods once.
31028 * expression.cs (PropertyExpr): Initialize type from the
31031 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31032 Resolve pattern. Attempt to implicitly convert value to boolean.
31035 * expression.cs: Set the type for the int32/int32 argument case.
31036 (Binary::ResolveOperator): Set the return type to boolean for
31037 comparission operators
31039 * typemanager.cs: Remove debugging print code.
31041 (Invocation::Resolve): resolve type.
31043 * class.cs: Allocate a MemberInfo of the correct size, as the code
31044 elsewhere depends on the test to reflect the correct contents.
31046 (Method::) Keep track of parameters, due to System.Reflection holes
31048 (TypeContainer::Populate): Keep track of MethodBuilders to Method
31051 (TypeContainer::FindMembers): Use ArrayList and then copy an array
31052 of the exact size and return that.
31054 (Class::LookupMethodByBuilder): New function that maps
31055 MethodBuilders to its methods. Required to locate the information
31056 on methods because System.Reflection bit us again.
31058 * support.cs: New file, contains an interface ParameterData and
31059 two implementations: ReflectionParameters and InternalParameters
31060 used to access Parameter information. We will need to grow this
31063 * expression.cs (Invocation::GetParameterData): implement a cache
31064 and a wrapper around the ParameterData creation for methods.
31065 (Invocation::OverloadResolve): Use new code.
31067 2001-09-13 Ravi Pratap <ravi@ximian.com>
31069 * class.cs (TypeContainer::EmitField): Remove and move into
31070 (Field::Define): here and modify accordingly.
31071 (Field.FieldBuilder): New member.
31072 (TypeContainer::Populate): Update accordingly.
31073 (TypeContainer::FindMembers): Implement.
31075 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31077 * statement.cs: (VariableInfo::VariableType): New field to be
31078 initialized with the full type once it is resolved.
31080 2001-09-12 Miguel de Icaza <miguel@ximian.com>
31082 * parameter.cs (GetParameterInfo): Use a type cache to compute
31083 things only once, and to reuse this information
31085 * expression.cs (LocalVariableReference::Emit): Implement.
31086 (OpcodeCast::Emit): fix.
31088 (ParameterReference::Resolve): Implement.
31089 (ParameterReference::Emit): Implement.
31091 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31092 that are expressions need to stay as Expressions.
31094 * typemanager.cs (CSharpName): Returns the C# name of a type if
31097 * expression.cs (Expression::ConvertImplicit): New function that
31098 implements implicit type conversions.
31100 (Expression::ImplicitReferenceConversion): Implements implicit
31101 reference conversions.
31103 (EmptyCast): New type for transparent casts.
31105 (OpcodeCast): New type for casts of types that are performed with
31106 a sequence of bytecodes.
31108 (BoxedCast): New type used for casting value types into reference
31109 types. Emits a box opcode.
31111 (Binary::DoNumericPromotions): Implements numeric promotions of
31112 and computation of the Binary::Type.
31114 (Binary::EmitBranchable): Optimization.
31116 (Binary::Emit): Implement code emission for expressions.
31118 * typemanager.cs (TypeManager): Added two new core types: sbyte
31121 2001-09-12 Ravi Pratap <ravi@ximian.com>
31123 * class.cs (TypeContainer::FindMembers): Method which does exactly
31124 what Type.FindMembers does, only we don't have to use reflection. No
31125 implementation yet.
31127 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31128 typecontainer objects as we need to get at them.
31129 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31131 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31132 typecontainer object.
31134 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31135 of just a Report object.
31137 2001-09-11 Ravi Pratap <ravi@ximian.com>
31139 * class.cs (Event::Define): Go back to using the prefixes "add_" and
31141 (TypeContainer::Populate): Now define the delegates of the type too.
31142 (TypeContainer.Delegates): Property to access the list of delegates defined
31145 * delegates.cs (Delegate::Define): Implement partially.
31147 * modifiers.cs (TypeAttr): Handle more flags.
31149 2001-09-11 Ravi Pratap <ravi@ximian.com>
31151 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31153 (Operator::Define): Re-write logic to get types by using the LookupType method
31154 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31155 (Indexer::Define): Ditto.
31156 (Event::Define): Ditto.
31157 (Property::Define): Ditto.
31159 2001-09-10 Ravi Pratap <ravi@ximian.com>
31161 * class.cs (TypeContainer::Populate): Now define operators too.
31162 (TypeContainer.Operators): New property to access the list of operators
31164 (Operator.OperatorMethodBuilder): New member to hold the method builder
31165 for the operator we are defining.
31166 (Operator::Define): Implement.
31168 2001-09-10 Ravi Pratap <ravi@ximian.com>
31170 * class.cs (Event::Define): Make the prefixes of the accessor methods
31171 addOn_ and removeOn_
31173 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31174 of the location being passed in too. Ideally, this should go later since all
31175 error reporting should be done through the Report object.
31177 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31178 (Populate): Iterate thru the indexers we have and define them too.
31179 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31180 for the get and set accessors.
31181 (Indexer::Define): Implement.
31183 2001-09-09 Miguel de Icaza <miguel@ximian.com>
31185 * expression.cs (Binary::Resolve): Beginning of it. I scratched
31186 my previous implementation, did not work.
31188 * typemanager.cs: Add a couple of missing types (the longs).
31190 * literal.cs: Use TypeManager.bool_type instead of getting it.
31192 * expression.cs (EventExpr): New kind of expressions.
31193 (Expressio::ExprClassFromMemberInfo): finish
31195 2001-09-08 Miguel de Icaza <miguel@ximian.com>
31197 * assign.cs: Emit stores to static fields differently.
31199 2001-09-08 Ravi Pratap <ravi@ximian.com>
31201 * Merge in changes and adjust code to tackle conflicts. Backed out my
31202 code in Assign::Resolve ;-)
31204 2001-09-08 Ravi Pratap <ravi@ximian.com>
31206 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31207 instead Report.Error and also pass in the location.
31208 (CSharpParser::Lexer): New readonly property to return the reference
31209 to the Tokenizer object.
31210 (declare_local_variables): Use Report.Error with location instead of plain
31214 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31215 (Operator.CheckBinaryOperator): Ditto.
31217 * cs-parser.jay (operator_declarator): Update accordingly.
31219 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31220 (CheckBinaryOperator): Same here.
31222 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31223 on the name without any prefixes of namespace names etc. This is because we
31224 already might have something already fully qualified like
31225 'System.Console.WriteLine'
31227 * assign.cs (Resolve): Begin implementation. Stuck ;-)
31229 2001-09-07 Ravi Pratap <ravi@ximian.com>
31231 * cs-tokenizer.cs (location): Return a string which also contains
31234 * expression.cs (ElementAccess): New class for expressions of the
31235 type 'element access.'
31236 (BaseAccess): New class for expressions of the type 'base access.'
31237 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31240 * cs-parser.jay (element_access): Implement action.
31241 (base_access): Implement actions.
31242 (checked_expression, unchecked_expression): Implement.
31244 * cs-parser.jay (local_variable_type): Correct and implement.
31245 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31247 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31249 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31250 name and the specifiers.
31252 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31254 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
31255 making them all public ;-)
31257 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31260 2001-09-07 Miguel de Icaza <miguel@ximian.com>
31262 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31264 (FieldExpr, PropertyExprs): New resolved expressions.
31265 (SimpleName::MemberStaticCheck): Perform static checks for access
31266 to non-static fields on static methods. Maybe this should be
31267 generalized for MemberAccesses.
31268 (SimpleName::ResolveSimpleName): More work on simple name
31271 * cs-parser.jay (primary_expression/qualified_identifier): track
31272 the parameter index.
31274 * codegen.cs (CodeGen::Save): Catch save exception, report error.
31275 (EmitContext::EmitBoolExpression): Chain to expression generation
31276 instead of temporary hack.
31277 (::EmitStatementExpression): Put generic expression code generation.
31279 * assign.cs (Assign::Emit): Implement variable assignments to
31280 local variables, parameters and fields.
31282 2001-09-06 Miguel de Icaza <miguel@ximian.com>
31284 * statement.cs (Block::GetVariableInfo): New method, returns the
31285 VariableInfo for a variable name in a block.
31286 (Block::GetVariableType): Implement in terms of GetVariableInfo
31288 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31289 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31291 2001-09-06 Ravi Pratap <ravi@ximian.com>
31293 * cs-parser.jay (operator_declaration): Continue on my quest : update
31294 to take attributes argument.
31295 (event_declaration): Ditto.
31296 (enum_declaration): Ditto.
31297 (indexer_declaration): Ditto.
31299 * class.cs (Operator::Operator): Update constructor accordingly.
31300 (Event::Event): Ditto.
31302 * delegate.cs (Delegate::Delegate): Same here.
31304 * enum.cs (Enum::Enum): Same here.
31306 2001-09-05 Ravi Pratap <ravi@ximian.com>
31308 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31310 * ../tests/cs0658.cs : New file to demonstrate error 0658.
31312 * attribute.cs (Attributes): New class to encapsulate all attributes which were
31313 being passed around as an arraylist.
31314 (Attributes::AddAttribute): Method to add attribute sections.
31316 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31317 (struct_declaration): Update accordingly.
31318 (constant_declaration): Update.
31319 (field_declaration): Update.
31320 (method_header): Update.
31321 (fixed_parameter): Update.
31322 (parameter_array): Ditto.
31323 (property_declaration): Ditto.
31324 (destructor_declaration): Ditto.
31326 * class.cs (Struct::Struct): Update constructors accordingly.
31327 (Class::Class): Ditto.
31328 (Field::Field): Ditto.
31329 (Method::Method): Ditto.
31330 (Property::Property): Ditto.
31331 (TypeContainer::OptAttribute): update property's return type.
31333 * interface.cs (Interface.opt_attributes): New member.
31334 (Interface::Interface): Update to take the extra Attributes argument.
31336 * parameter.cs (Parameter::Parameter): Ditto.
31338 * constant.cs (Constant::Constant): Ditto.
31340 * interface.cs (InterfaceMemberBase): New OptAttributes field.
31341 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
31342 the attributes as a parameter.
31343 (InterfaceProperty): Update constructor call.
31344 (InterfaceEvent): Ditto.
31345 (InterfaceMethod): Ditto.
31346 (InterfaceIndexer): Ditto.
31348 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
31349 pass the attributes too.
31350 (interface_event_declaration): Ditto.
31351 (interface_property_declaration): Ditto.
31352 (interface_method_declaration): Ditto.
31353 (interface_declaration): Ditto.
31355 2001-09-05 Miguel de Icaza <miguel@ximian.com>
31357 * class.cs (Method::Define): Track the "static Main" definition to
31358 create an entry point.
31360 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31361 EntryPoint if we find it.
31363 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31364 (EmitContext::ig): Make this variable public.
31366 * driver.cs: Make the default output file be the first file name
31367 with the .exe extension.
31369 Detect empty compilations
31371 Handle various kinds of output targets. Handle --target and
31372 rename -t to --dumper.
31374 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31375 methods inherited from Expression return now an Expression. This
31376 will is used during the tree rewriting as we resolve them during
31379 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31380 the spec. Missing entirely is the information about
31381 accessability of elements of it.
31383 (Expression::ExprClassFromMemberInfo): New constructor for
31384 Expressions that creates a fully initialized Expression based on
31385 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31388 (Invocation::Resolve): Begin implementing resolution of invocations.
31390 * literal.cs (StringLiteral): Implement Emit.
31392 2001-09-05 Ravi Pratap <ravi@ximian.com>
31394 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31397 2001-09-04 Ravi Pratap <ravi@ximian.com>
31399 * cs-parser.jay (attribute_arguments): Implement actions.
31400 (attribute): Fix bug in production. Implement action.
31401 (attribute_list): Implement.
31402 (attribute_target): Implement.
31403 (attribute_target_specifier, opt_target_specifier): Implement
31404 (CheckAttributeTarget): New method to check if the attribute target
31406 (attribute_section): Implement.
31407 (opt_attributes): Implement.
31409 * attribute.cs : New file to handle attributes.
31410 (Attribute): Class to hold attribute info.
31412 * cs-parser.jay (opt_attribute_target_specifier): Remove production
31413 (attribute_section): Modify production to use 2 different rules to
31414 achieve the same thing. 1 s/r conflict down !
31415 Clean out commented, useless, non-reducing dimension_separator rules.
31417 * class.cs (TypeContainer.attributes): New member to hold list
31418 of attributes for a type.
31419 (Struct::Struct): Modify to take one more argument, the attribute list.
31420 (Class::Class): Ditto.
31421 (Field::Field): Ditto.
31422 (Method::Method): Ditto.
31423 (Property::Property): Ditto.
31425 * cs-parser.jay (struct_declaration): Update constructor call to
31426 pass in the attributes too.
31427 (class_declaration): Ditto.
31428 (constant_declaration): Ditto.
31429 (field_declaration): Ditto.
31430 (method_header): Ditto.
31431 (fixed_parameter): Ditto.
31432 (parameter_array): Ditto.
31433 (property_declaration): Ditto.
31435 * constant.cs (Constant::Constant): Update constructor similarly.
31436 Use System.Collections.
31438 * parameter.cs (Parameter::Parameter): Update as above.
31440 2001-09-02 Ravi Pratap <ravi@ximian.com>
31442 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31443 (TypeContainer.delegates): New member to hold list of delegates.
31445 * cs-parser.jay (delegate_declaration): Implement the action correctly
31446 this time as I seem to be on crack ;-)
31448 2001-09-02 Miguel de Icaza <miguel@ximian.com>
31450 * rootcontext.cs (RootContext::IsNamespace): new function, used to
31451 tell whether an identifier represents a namespace.
31453 * expression.cs (NamespaceExpr): A namespace expression, used only
31454 temporarly during expression resolution.
31455 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31456 utility functions to resolve names on expressions.
31458 2001-09-01 Miguel de Icaza <miguel@ximian.com>
31460 * codegen.cs: Add hook for StatementExpressions.
31462 * class.cs: Fix inverted test for static flag in methods.
31464 2001-09-02 Ravi Pratap <ravi@ximian.com>
31466 * class.cs (Operator::CheckUnaryOperator): Correct error number used
31467 to make it coincide with MS' number.
31468 (Operator::CheckBinaryOperator): Ditto.
31470 * ../errors/errors.txt : Remove error numbers added earlier.
31472 * ../errors/cs1019.cs : Test case for error # 1019
31474 * ../errros/cs1020.cs : Test case for error # 1020
31476 * cs-parser.jay : Clean out commented cruft.
31477 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31478 used anywhere - non-reducing rule.
31479 (namespace_declarations): Non-reducing rule - comment out.
31481 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31482 with TypeContainer::AddEnum.
31484 * delegate.cs : New file for delegate handling classes.
31485 (Delegate): Class for declaring delegates.
31487 * makefile : Update.
31489 * cs-parser.jay (delegate_declaration): Implement.
31491 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
31493 * class.cs (Event::Define): Implement.
31494 (Event.EventBuilder): New member.
31496 * class.cs (TypeContainer::Populate): Update to define all enums and events
31498 (Events): New property for the events arraylist we hold. Shouldn't we move to using
31499 readonly fields for all these cases ?
31501 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31503 * class.cs (Property): Revamp to use the convention of making fields readonly.
31504 Accordingly modify code elsewhere.
31506 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31507 the Define method of the Property class.
31509 * class.cs : Clean up applied patch and update references to variables etc. Fix
31511 (TypeContainer::Populate): Update to define all the properties we have. Also
31512 define all enumerations.
31514 * enum.cs (Define): Implement.
31516 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31518 * cs-parser.jay (overloadable_operator): The semantic value is an
31519 enum of the Operator class.
31520 (operator_declarator): Implement actions.
31521 (operator_declaration): Implement.
31523 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31524 validity of definitions.
31525 (Operator::CheckBinaryOperator): Static method to check for binary operators
31526 (TypeContainer::AddOperator): New method to add an operator to a type.
31528 * cs-parser.jay (indexer_declaration): Added line to actually call the
31529 AddIndexer method so it gets added ;-)
31531 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
31532 already taken care of by the MS compiler ?
31534 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31536 * class.cs (Operator): New class for operator declarations.
31537 (Operator::OpType): Enum for the various operators.
31539 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31541 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31542 ostensibly handle this in semantic analysis.
31544 * cs-parser.jay (general_catch_clause): Comment out
31545 (specific_catch_clauses, specific_catch_clause): Ditto.
31546 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31547 (catch_args, opt_catch_args): New productions.
31548 (catch_clause): Rewrite to use the new productions above
31549 (catch_clauses): Modify accordingly.
31550 (opt_catch_clauses): New production to use in try_statement
31551 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31552 and re-write the code in the actions to extract the specific and
31553 general catch clauses by being a little smart ;-)
31555 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31556 Hooray, try and catch statements parse fine !
31558 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31560 * statement.cs (Block::GetVariableType): Fix logic to extract the type
31561 string from the hashtable of variables.
31563 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31564 I end up making that mistake ;-)
31565 (catch_clauses): Fixed gross error which made Key and Value of the
31566 DictionaryEntry the same : $1 !!
31568 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31570 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31572 * cs-parser.jay (event_declaration): Correct to remove the semicolon
31573 when the add and remove accessors are specified.
31575 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31577 * cs-parser.jay (IndexerDeclaration): New helper class to hold
31578 information about indexer_declarator.
31579 (indexer_declarator): Implement actions.
31580 (parsing_indexer): New local boolean used to keep track of whether
31581 we are parsing indexers or properties. This is necessary because
31582 implicit_parameters come into picture even for the get accessor in the
31583 case of an indexer.
31584 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31586 * class.cs (Indexer): New class for indexer declarations.
31587 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31588 (TypeContainer::indexers): New member to hold list of indexers for the
31591 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31593 * cs-parser.jay (add_accessor_declaration): Implement action.
31594 (remove_accessor_declaration): Implement action.
31595 (event_accessors_declaration): Implement
31596 (variable_declarators): swap statements for first rule - trivial.
31598 * class.cs (Event): New class to hold information about event
31600 (TypeContainer::AddEvent): New method to add an event to a type
31601 (TypeContainer::events): New member to hold list of events.
31603 * cs-parser.jay (event_declaration): Implement actions.
31605 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31607 * cs-parser.jay (dim_separators): Implement. Make it a string
31608 concatenating all the commas together, just as they appear.
31609 (opt_dim_separators): Modify accordingly
31610 (rank_specifiers): Update accordingly. Basically do the same
31611 thing - instead, collect the brackets here.
31612 (opt_rank_sepcifiers): Modify accordingly.
31613 (array_type): Modify to actually return the complete type string
31614 instead of ignoring the rank_specifiers.
31615 (expression_list): Implement to collect the expressions
31616 (variable_initializer): Implement. We make it a list of expressions
31617 essentially so that we can handle the array_initializer case neatly too.
31618 (variable_initializer_list): Implement.
31619 (array_initializer): Make it a list of variable_initializers
31620 (opt_array_initializer): Modify accordingly.
31622 * expression.cs (New::NType): Add enumeration to help us
31623 keep track of whether we have an object/delegate creation
31624 or an array creation.
31625 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31626 members to hold data about array creation.
31627 (New:New): Modify to update NewType
31628 (New:New): New Overloaded contructor for the array creation
31631 * cs-parser.jay (array_creation_expression): Implement to call
31632 the overloaded New constructor.
31634 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31636 * class.cs (TypeContainer::Constructors): Return member
31637 constructors instead of returning null.
31639 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31641 * typemanager.cs (InitCoreTypes): Initialize the various core
31642 types after we have populated the type manager with the user
31643 defined types (this distinction will be important later while
31644 compiling corlib.dll)
31646 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31647 on Expression Classification. Now all expressions have a method
31648 `Resolve' and a method `Emit'.
31650 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31651 generation from working. Also add some temporary debugging
31654 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31656 * codegen.cs: Lots of code generation pieces. This is only the
31657 beginning, will continue tomorrow with more touches of polish. We
31658 handle the fundamentals of if, while, do, for, return. Others are
31659 trickier and I need to start working on invocations soon.
31661 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31664 * codegen.cs (EmitContext): New struct, used during code
31665 emission to keep a context. Most of the code generation will be
31668 * cs-parser.jay: Add embedded blocks to the list of statements of
31669 this block. So code generation proceeds in a top down fashion.
31671 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31673 * statement.cs: Add support for multiple child blocks.
31675 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31677 * codegen.cs (EmitCode): New function, will emit the code for a
31678 Block of code given a TypeContainer and its ILGenerator.
31680 * statement.cs (Block): Standard public readonly optimization.
31681 (Block::Block constructors): Link children.
31682 (Block::Child): Child Linker.
31683 (Block::EmitVariables): Emits IL variable declarations.
31685 * class.cs: Drop support for MethodGroups here, delay until
31687 (Method::): Applied the same simplification that I did before, and
31688 move from Properties to public readonly fields.
31689 (Method::ParameterTypes): Returns the parameter types for the
31690 function, and implements a cache that will be useful later when I
31691 do error checking and the semantic analysis on the methods is
31693 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31694 and made a method, optional argument tells whether this is a class
31695 or a structure to apply the `has-this' bit.
31696 (Method::GetCallingConvention): Implement, returns the calling
31698 (Method::Define): Defines the type, a second pass is performed
31699 later to populate the methods.
31701 (Constructor::ParameterTypes): implement a cache similar to the
31702 one on Method::ParameterTypes, useful later when we do semantic
31705 (TypeContainer::EmitMethod): New method. Emits methods.
31707 * expression.cs: Removed MethodGroup class from here.
31709 * parameter.cs (Parameters::GetCallingConvention): new method.
31711 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31713 * class.cs (TypeContainer::Populate): Drop RootContext from the
31716 (Constructor::CallingConvention): Returns the calling convention.
31717 (Constructor::ParameterTypes): Returns the constructor parameter
31720 (TypeContainer::AddConstructor): Keep track of default constructor
31721 and the default static constructor.
31723 (Constructor::) Another class that starts using `public readonly'
31724 instead of properties.
31726 (Constructor::IsDefault): Whether this is a default constructor.
31728 (Field::) use readonly public fields instead of properties also.
31730 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31731 track of static constructors; If none is used, turn on
31732 BeforeFieldInit in the TypeAttributes.
31734 * cs-parser.jay (opt_argument_list): now the return can be null
31735 for the cases where there are no arguments.
31737 (constructor_declarator): If there is no implicit `base' or
31738 `this', then invoke the default parent constructor.
31740 * modifiers.cs (MethodAttr): New static function maps a set of
31741 modifiers flags into a MethodAttributes enum
31742 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31743 MethodAttr, TypeAttr to represent the various mappings where the
31744 modifiers are used.
31745 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31747 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31749 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31752 * interface.cs (PopulateIndexer): Implemented the code generator
31753 for interface indexers.
31755 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31757 * interface.cs (InterfaceMemberBase): Now we track the new status
31760 (PopulateProperty): Implement property population. Woohoo! Got
31761 Methods and Properties going today.
31763 Removed all the properties for interfaces, and replaced them with
31764 `public readonly' fields.
31766 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31768 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31769 initialize their hashtables/arraylists only when they are needed
31770 instead of doing this always.
31772 * parameter.cs: Handle refs and out parameters.
31774 * cs-parser.jay: Use an ArrayList to construct the arguments
31775 instead of the ParameterCollection, and then cast that to a
31778 * parameter.cs: Drop the use of ParameterCollection and use
31779 instead arrays of Parameters.
31781 (GetParameterInfo): Use the Type, not the Name when resolving
31784 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31786 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31787 and instead use public readonly fields.
31789 * class.cs: Put back walking code for type containers.
31791 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31793 * class.cs (MakeConstant): Code to define constants.
31795 * rootcontext.cs (LookupType): New function. Used to locate types
31798 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31800 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31801 this System.Reflection code is. Kudos to Microsoft
31803 * typemanager.cs: Implement a type cache and avoid loading all
31804 types at boot time. Wrap in LookupType the internals. This made
31805 the compiler so much faster. Wow. I rule!
31807 * driver.cs: Make sure we always load mscorlib first (for
31808 debugging purposes, nothing really important).
31810 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31811 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31813 * rootcontext.cs: Lookup types on their namespace; Lookup types
31814 on namespaces that have been imported using the `using' keyword.
31816 * class.cs (TypeContainer::TypeAttr): Virtualize.
31817 (Class::TypeAttr): Return attributes suitable for this bad boy.
31818 (Struct::TypeAttr): ditto.
31819 Handle nested classes.
31820 (TypeContainer::) Remove all the type visiting code, it is now
31821 replaced with the rootcontext.cs code
31823 * rootcontext.cs (GetClassBases): Added support for structs.
31825 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31827 * interface.cs, statement.cs, class.cs, parameter.cs,
31828 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31829 Drop use of TypeRefs, and use strings instead.
31831 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31835 * class.cs (Struct::Struct): set the SEALED flags after
31836 checking the modifiers.
31837 (TypeContainer::TypeAttr): new property, returns the
31838 TypeAttributes for a class.
31840 * cs-parser.jay (type_list): Oops, list production was creating a
31841 new list of base types.
31843 * rootcontext.cs (StdLib): New property.
31844 (GetInterfaceTypeByName): returns an interface by type name, and
31845 encapsulates error handling here.
31846 (GetInterfaces): simplified.
31847 (ResolveTree): Encapsulated all the tree resolution here.
31848 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31851 * driver.cs: Add support for --nostdlib, to avoid loading the
31852 default assemblies.
31853 (Main): Do not put tree resolution here.
31855 * rootcontext.cs: Beginning of the class resolution.
31857 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31859 * rootcontext.cs: Provide better error reporting.
31861 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31863 * rootcontext.cs (CreateInterface): Handle the case where there
31864 are no parent interfaces.
31866 (CloseTypes): Routine to flush types at the end.
31867 (CreateInterface): Track types.
31868 (GetInterfaces): Returns an array of Types from the list of
31869 defined interfaces.
31871 * typemanager.c (AddUserType): Mechanism to track user types (puts
31872 the type on the global type hash, and allows us to close it at the
31875 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31877 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31878 RecordInterface instead.
31880 * cs-parser.jay: Updated to reflect changes above.
31882 * decl.cs (Definition): Keep track of the TypeBuilder type that
31883 represents this type here. Not sure we will use it in the long
31884 run, but wont hurt for now.
31886 * driver.cs: Smaller changes to accomodate the new code.
31888 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31891 * rootcontext.cs (CreateInterface): New method, used to create
31892 the System.TypeBuilder type for interfaces.
31893 (ResolveInterfaces): new entry point to resolve the interface
31895 (CodeGen): Property, used to keep track of the code generator.
31897 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31899 * cs-parser.jay: Add a second production for delegate_declaration
31902 (enum_body): Put an opt_comma here instead of putting it on
31903 enum_body or enum_member_declarations so we can handle trailing
31904 commas on enumeration members. Gets rid of a shift/reduce.
31906 (type_list): Need a COMMA in the middle.
31908 (indexer_declaration): Tell tokenizer to recognize get/set
31910 * Remove old targets.
31912 * Re-add the parser target.
31914 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31916 * cs-parser.jay: Add precendence rules for a number of operators
31917 ot reduce the number of shift/reduce conflicts in the grammar.
31919 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31921 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31924 Get rid of old crufty code.
31926 * rootcontext.cs: Use this to keep track of the parsed
31927 representation and the defined types available to the program.
31929 * gen-treedump.cs: adjust for new convention.
31931 * type.cs: Split out the type manager, and the assembly builder
31934 * typemanager.cs: the type manager will live here now.
31936 * cil-codegen.cs: And the code generator here.
31938 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31940 * makefile: Fixed up for easy making.
31942 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31944 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31947 (unary_expression): Expand pre_increment_expression and
31948 post_decrement_expression to reduce a shift/reduce.
31950 2001-07-11 Simon Cozens
31952 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31954 Improve allow_keyword_as_indent name.
31956 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31958 * Adjustments for Beta2.
31960 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31962 * decl.cs: Added `Define' abstract method.
31963 (InTransit): new property, used to catch recursive definitions.
31965 * interface.cs: Implement `Define'.
31967 * modifiers.cs: Map Modifiers.constants to
31968 System.Reflection.TypeAttribute flags.
31970 * class.cs: Keep track of types and user-defined types.
31971 (BuilderInit): New method for creating an assembly
31972 (ResolveType): New function to launch the resolution process, only
31973 used by interfaces for now.
31975 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31976 that are inserted into the name space.
31978 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31980 * ARGH. I have screwed up my tree so many times due to the use of
31981 rsync rather than using CVS. Going to fix this at once.
31983 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31986 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31988 * Experiment successful: Use System.Type rather that our own
31991 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31993 * cs-parser.jay: Removed nsAliases from here.
31995 Use new namespaces, handle `using XXX;'
31997 * namespace.cs: Reimplemented namespace handling, use a recursive
31998 definition of the class. Now we can keep track of using clauses
31999 and catch invalid using clauses.
32001 2001-05-24 Miguel de Icaza <miguel@ximian.com>
32003 * gen-treedump.cs: Adapted for all the renaming.
32005 * expression.cs (Expression): this class now has a Type property
32006 which returns an expression Type.
32008 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32009 `Type', as this has a different meaning now in the base
32011 2001-05-22 Miguel de Icaza <miguel@ximian.com>
32013 * interface.cs, class.cs: Removed from all the sources the
32014 references to signature computation, as we can not do method
32015 signature computation during the parsing time, as we are not
32016 trying to solve at that point distinguishing:
32020 void a (NS.Blah x) {}
32023 Which depending on the context might be valid or not, as we do not
32024 know if Blah is the same thing as NS.Blah at that point.
32026 * Redid everything so the code uses TypeRefs now instead of
32027 Types. TypeRefs are just temporary type placeholders, that need
32028 to be resolved. They initially have a pointer to a string and the
32029 current scope in which they are used. This is used later by the
32030 compiler to resolve the reference to an actual Type.
32032 * DeclSpace is no longer a CIR.Type, and neither are
32033 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
32034 are all DeclSpaces, but no Types.
32036 * type.cs (TypeRefManager): This implements the TypeRef manager,
32037 which keeps track of all the types that need to be resolved after
32038 the parsing has finished.
32040 2001-05-13 Miguel de Icaza <miguel@ximian.com>
32042 * ARGH. We are going to have to store `foreach' as a class rather
32043 than resolving it, as we need to verify error 1579 after name
32044 resolution. *OR* we could keep a flag that says `This request to
32045 IEnumerator comes from a foreach statement' which we can then use
32046 to generate the error.
32048 2001-05-10 Miguel de Icaza <miguel@ximian.com>
32050 * class.cs (TypeContainer.AddMethod): we now add methods to the
32051 MethodGroup instead of the method hashtable.
32053 * expression.cs: Add MethodGroup abstraction, which gets us one
32054 step closer to the specification in the way we handle method
32057 * cs-parser.jay (primary_expression): qualified_identifier now
32058 tried to match up an identifier to a local variable reference or
32059 to a parameter reference.
32061 current_local_parameters is now a parser global variable that
32062 points to the current parameters for the block, used during name
32065 (property_declaration): Now creates an implicit `value' argument to
32068 2001-05-09 Miguel de Icaza <miguel@ximian.com>
32070 * parameter.cs: Do not use `param' arguments as part of the
32071 signature, per the spec.
32073 2001-05-08 Miguel de Icaza <miguel@ximian.com>
32075 * decl.cs: Base class for classes, structs and interfaces. This
32076 is the "Declaration Space"
32078 * cs-parser.jay: Use CheckDef for checking declaration errors
32079 instead of having one on each function.
32081 * class.cs: Factor out some code for handling error handling in
32082 accordance to the "Declarations" section in the "Basic Concepts"
32083 chapter in the ECMA C# spec.
32085 * interface.cs: Make all interface member classes derive from
32086 InterfaceMemberBase.
32088 2001-05-07 Miguel de Icaza <miguel@ximian.com>
32090 * Many things: all interfaces are parsed and generated in
32091 gen-treedump. Support for member variables, constructors,
32092 destructors, properties, constants is there.
32094 Beginning of the IL backend, but very little done, just there for
32097 2001-04-29 Miguel de Icaza <miguel@ximian.com>
32099 * cs-parser.jay: Fix labeled statement.
32101 * cs-tokenizer.cs (escape): Escape " and ' always.
32102 ref_line, ref_name: keep track of the line/filename as instructed
32103 by #line by the compiler.
32106 2001-04-27 Miguel de Icaza <miguel@ximian.com>
32108 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32109 to match the values in System.CodeDOM.
32111 Divid renamed to Divide.
32113 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32115 (Statements.set): remove.
32117 * System.CodeDOM/CodeCatchClause.cs: always have a valid
32120 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32121 falseStatements always have valid values.
32123 * cs-parser.jay: Use System.CodeDOM now.