1 2009-06-16 Marek Safar <marek.safar@gmail.com>
3 * driver.cs: Close resource handlers.
5 2009-06-12 Jb Evain <jbevain@novell.com>
7 * rootcontext.cs: add a Platform field.
8 * driver.cs: handle /platform.
9 * codegen.cs: pass the proper flags according to
10 the platform when saving the assembly.
12 2009-06-11 Marek Safar <marek.safar@gmail.com>
14 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
15 Add optional parameters grammar.
17 2009-06-10 Marek Safar <marek.safar@gmail.com>
19 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
20 driver.cs: Split lang version and metadata version.
22 2009-06-10 Marek Safar <marek.safar@gmail.com>
24 * decl.cs: Better overload ctor collision error message.
26 2009-06-05 Jb Evain <jbevain@novell.com>
28 * driver.cs (EmbededResource): avoid using an internal method
29 in gmcs to embed manifest resources.
31 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
33 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
34 the compiler from older mono versions (like moon's bots)
36 2009-06-04 Marek Safar <marek.safar@gmail.com>
38 * namespace.cs (LookupTypeReflection): Ignore collisions between
41 2009-06-04 Marek Safar <marek.safar@gmail.com>
43 * codegen.cs: Enabled generic type forwarders.
45 2009-06-04 Marek Safar <marek.safar@gmail.com>
47 * dmcs.*: Add another version of SRE compiler.
49 2009-06-03 Marek Safar <marek.safar@gmail.com>
51 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
52 generic-mcs.cs: Fixed variant type conversions.
54 2009-06-02 Marek Safar <marek.safar@gmail.com>
57 * codegen.cs: Fixes a crash on invalid string value attribute.
59 2009-06-01 Marek Safar <marek.safar@gmail.com>
62 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
63 cs-parser.jay: Fully import __arglist modifier.
65 2009-05-29 Marek Safar <marek.safar@gmail.com>
67 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
68 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
69 actually work with closed generic types.
71 2009-05-27 Alan McGovern <amcgovern@novell.com>
73 * class.cs, decl.cs, delegate.cs, parameter.cs:
74 Fix the build by replacing the use of 'var' with the actual type.
76 2009-05-27 Marek Safar <marek.safar@gmail.com>
78 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
79 cs-parser.jay, generic-mcs.cs: Report wrong variant types
82 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
85 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
86 Marek Safar <marek.safar@gmail.com>
89 * parameter.cs: Use predefined and not empty name for implicit
92 2009-05-21 Marek Safar <marek.safar@gmail.com>
94 * class.cs: Don't report wrong warnings for event fields.
96 2009-05-21 Marek Safar <marek.safar@gmail.com>
99 * class.cs: Check for static class using parent container instead of
102 2009-05-08 Marek Safar <marek.safar@gmail.com>
104 A fix for bug #496922
105 * expression.cs: Always use temporary variable when using object
108 2009-04-28 Marek Safar <marek.safar@gmail.com>
110 A fix for bug #495112
111 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
114 2009-04-27 Miguel de Icaza <miguel@novell.com>
116 * driver.cs: Add a flag to work as a replacement for CSC in VS.
118 2009-04-24 Miguel de Icaza <miguel@novell.com>
120 * complete.cs: No idea how gonzalo got a null in the list, but
123 2009-04-24 Miguel de Icaza <miguel@novell.com>
125 * complete.cs (CompletionElementInitializer): New completion class
126 to support completing inside a C# 3 element initializer, so this
127 allows completion for Silverlight situations where it is very
130 new TextBlock () { Fo<TAB>
132 (CompletionSimpleName): Expose the prefix that was
133 passed to the simple name.
135 * cs-parser.jay (object_or_collection_initializer): Add support
136 for element_initializers.
138 * expression.cs (CollectionOrObjectInitializers.DoResolve):
139 special case completion expressions as this method aggressively
140 collects data before it operates, and errors were being thrown
141 earlier than we were able to complete.
143 2009-04-23 Miguel de Icaza <miguel@novell.com>
145 * eval.cs: Make getcompletions silent and enable debugging output
146 if the -v option is passed.
148 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
149 Consider looking up the namespace that matches the prefix being
152 This is part of the support for allowing completions like:
153 `System.Co<TAB>' to complete to System.Console.
155 * complete.cs (CompletionSimpleName.AppendResults): Make this
158 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
160 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
161 COMPLETE_COMPLETION as internal.
163 2009-04-17 Miguel de Icaza <miguel@novell.com>
165 * complete.cs: Include namespace resolution in simple names as
166 well as global types and types in the using scope in the
169 * namespace.cs: Supporting infrastrcture to provide completions
170 based on the current using scope.
172 * eval.cs: Introduce an entry point that allows for initialization
173 to return a list of the files passed on the command line.
175 2009-04-14 Marek Safar <marek.safar@gmail.com>
177 A fix for bug #494243
178 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
180 2009-04-13 Marek Safar <marek.safar@gmail.com>
182 A fix for bug #493887
183 * statement.cs: Don't skip string multi-section with default or
184 null label when populating string hashtable.
186 2009-04-06 Marek Safar <marek.safar@gmail.com>
188 A fix for bug #492329
189 * expression.cs (New): Load variable when assigning type parameter
192 2009-04-06 Marek Safar <marek.safar@gmail.com>
194 A fix for bug #488960
195 * decl.cs: Compare MVAR types using non-null values.
197 2009-03-27 Marek Safar <marek.safar@gmail.com>
199 * typemanager.cs, expression.cs: Removed unused nullable checks.
201 2009-03-27 Marek Safar <marek.safar@gmail.com>
203 * *.cs: Removed some gmcs conditionals.
205 2009-03-26 Marek Safar <marek.safar@gmail.com>
207 * generic.cs, support.cs: Moved generics stuff out of support.cs
209 2009-03-24 Marek Safar <marek.safar@gmail.com>
211 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
214 2009-03-23 Marek Safar <marek.safar@gmail.com>
216 * attribute.cs: Consider all members for error reporting when
217 checking named arguments.
219 2009-03-23 Marek Safar <marek.safar@gmail.com>
221 A fix for bug #487625
222 * namespace.cs: Use a warning for all predefined type conflicts.
224 2009-03-23 Marek Safar <marek.safar@gmail.com>
226 A fix for bug #485706
227 * statement.cs: Explicitly type catch type argument to pass verifier
230 2009-03-22 Miguel de Icaza <miguel@novell.com>
232 Initial support to provide code completion facilities to consumers
233 of the evaluator API.
235 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
236 support the completion engine. When we reach the end of the
237 input stream instead of returning EOF, when this flag is true the
238 tokenizer instead produces:
240 One GENERATE_COMPLETION token: this token then must be
241 handled in the grammar at every point where the user
242 would likely request a completion.
244 As many COMPLETE_COMPLETION tokens as necessary. These
245 tokens are generated to assist the parser in unwinding and
246 producing a valid parse tree.
248 The parser rules do not have to be perfect, the parser needs to be
249 augmented with judicious use of GENERATE_COMPLETION tokens to
250 improve the areas where we can provide completion and the parser
251 needs to add support for COMPLETE_COMPLETION tokens in productions
254 It is common to not have enough support for COMPLETE_COMPLETION
255 under certain rules and that even if we generated the
256 GENERATE_COMPLETION token that the resulting tree will be invalid
257 due to the missing rules that support COMPLETE_COMPLETION.
259 The final EOF token is produced by having the parser notify the
260 tokenizer when it reaches the root production that the next token
263 * support.cs (CompletionResult): New Exception. This exception
264 is thrown to return the completion results when one of the special
265 completion expressions is reached.
267 This exception is thrown by the completing ExpressionStatements
268 classes that live in complete.cs
270 * complete.cs (CompletingExpression): a new base class for
271 completing expressions. This derives from the
272 ExpressionStatement class and not from Expression as it allows
273 completion to happen not only where expressions are expected in
274 the grammar, but also where statements are expected.
276 (CompletionSimpleName): A new class used to provide completions
277 for SimpleNames. This currently only resolves to local
278 variables from the evaluator context (GetVars call).
280 (CompletionMemberAccess): Implements support for completing member
283 * cs-parser.jay: Add support for completion in a few places.
285 * eval.cs (GetCompletions): New public API for the evaluator that
286 returns a list of possible completions given the input. The
287 return value is an array of completions
289 * anonymous.cs (Compatible): If the exception thrown from the
290 resolved expression is a CompletionResult exception let that one
291 through instead of printing a diagnostic error in the try/catch.
293 2009-03-22 Miguel de Icaza <miguel@novell.com>
297 * driver.cs (Main): Use Environment.Exit to quit quickly and
298 prevent the compiler from doing the usual wait for helper thread
301 This is to prevent a slowdown that was reported by Gonzalo on
304 2009-03-19 Marek Safar <marek.safar@gmail.com>
306 * ecore.cs: Load build-in types directly instead of accessing
309 2009-03-18 Marek Safar <marek.safar@gmail.com>
311 * ecore.cs: Always use unbox.any when available.
313 2009-03-18 Marek Safar <marek.safar@gmail.com>
315 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
317 2009-03-17 Marek Safar <marek.safar@gmail.com>
319 * generic.cs: Removed obsolete version of type inference.
321 2009-03-16 Marek Safar <marek.safar@gmail.com>
323 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
324 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
325 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
326 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
328 2009-03-11 Marek Safar <marek.safar@gmail.com>
330 A fix for bug #482996
331 * anonymous.cs: Make sure we are not infering return type when
332 checking type compatibility.
334 2009-03-11 Marek Safar <marek.safar@gmail.com>
336 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
337 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
338 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
339 attributes in their own structure. Needed when accessing their
340 properties before they are resolved.
342 2009-03-09 Marek Safar <marek.safar@gmail.com>
344 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
345 hashtable (~10x faster).
347 * driver.cs: Removed wrong Reset.
349 2009-03-08 Marek Safar <marek.safar@gmail.com>
351 * class.cs: Use correct common base type for unmanaged delayed
354 * rootcontext.cs: Wrap unhandled exception.
356 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
358 Make SeekableStreamReader self-tuning and arbitrarily seekable
359 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
361 (SeekableStreamReader.Position.set): Use it. Simplify logic
362 which, as a side-effect, makes it arbitrarily-seekable. Tune the
363 buffer size when the stream needs to be re-read from the beginning.
365 2009-03-05 Marek Safar <marek.safar@gmail.com>
367 A fix for bug #480100
368 * parameter.cs: A parameter is not hoisted when used directly as ET.
370 2009-03-04 Marek Safar <marek.safar@gmail.com>
372 * statement.cs: Fixed an issue when using variable is of interface
375 2009-03-03 Marek Safar <marek.safar@gmail.com>
377 A fix for bug #480319
378 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
380 2009-03-03 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #480867
383 * typemanager.cs, expression.cs, ecore.cs: Changed method group
384 expression to have no valid type.
386 2009-03-03 Marek Safar <marek.safar@gmail.com>
388 A fix for bug #481258
389 * class.cs: Set extension method flag in partial container.
391 2009-03-03 Marek Safar <marek.safar@gmail.com>
393 * statement.cs, typemanager.cs: Use expression for StringEmitter.
395 * attribute.cs: Add sanity check.
397 2009-02-27 Marek Safar <marek.safar@gmail.com>
399 * class.cs: Add external constructor error.
401 2009-02-26 Marek Safar <marek.safar@gmail.com>
403 A fix for bug #475354
404 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
405 correctly user defined nullable equality operators.
407 2009-02-25 Marek Safar <marek.safar@gmail.com>
409 A fix for bug #479532
410 * expression.cs: Implement NewInitialize::AddressOf.
412 2009-02-25 Marek Safar <marek.safar@gmail.com>
414 A fix for bug #413633
415 * expression.cs: Iterate all base class-constraint types.
417 2009-02-24 Marek Safar <marek.safar@gmail.com>
419 A fix for bug #479209
420 * literal.cs: Mutate null underlying type.
422 2009-02-24 Marek Safar <marek.safar@gmail.com>
424 A fix for bug #476295
425 * convert.cs: Avoid wrapping implicitly convertible reference type.
427 2009-02-23 Marek Safar <marek.safar@gmail.com>
429 * iterators.cs: Create MemberName correctly.
431 2009-02-23 Marek Safar <marek.safar@gmail.com>
433 A fix for bug #478655
434 * literal.cs: Check also underlying null type conversion.
436 2009-02-21 Marek Safar <marek.safar@gmail.com>
438 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
440 2009-02-20 Marek Safar <marek.safar@gmail.com>
442 A fix for bug #477447
443 * statement.cs: Add reference to correct parent storey when this
444 is accessible from deep children storey (more than 1 level).
446 2009-02-19 Marek Safar <marek.safar@gmail.com>
448 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
449 * class.cs: Define base type members before setting up member cache.
451 2009-02-18 Marek Safar <marek.safar@gmail.com>
453 A fix for bug #477378
454 * nullable.cs, expression.cs, statement.cs: More precise null type
457 2009-02-18 Marek Safar <marek.safar@gmail.com>
459 A fix for bug #472805
460 * typemanager.cs, namespace.cs: Import only visible extension method
463 2009-02-18 Marek Safar <marek.safar@gmail.com>
465 A fix for bug #476895
466 * attribute.cs: Use correct resolve context for attribute type.
468 2009-02-18 Marek Safar <marek.safar@gmail.com>
470 A fix for bug #476266
471 * anonymous.cs: Mutate multi-dimensional arrays.
473 2009-02-18 Marek Safar <marek.safar@gmail.com>
475 A fix for bug #476400
476 * statement.cs, expression.cs: Removed wrong Dispose optimization.
478 2009-02-18 Marek Safar <marek.safar@gmail.com>
480 A fix for bug #476811
481 * generics.cs: Fixed null-literal check.
483 2009-02-17 Marek Safar <marek.safar@gmail.com>
485 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
486 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
487 messing with static variables.
489 2009-02-16 Marek Safar <marek.safar@gmail.com>
491 A fix for bug #475965
492 * generics.cs: Check generic parameter type after extracting from
495 2009-02-16 Marek Safar <marek.safar@gmail.com>
497 A fix for bug #475823
498 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
501 2009-02-14 Marek Safar <marek.safar@gmail.com>
503 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
504 Simplified event field definition using backing field and not
505 field builder directly.
507 * expression.cs (EmitLdArg): Optimize fast paths.
509 2009-02-13 Marek Safar <marek.safar@gmail.com>
511 A fix for bug #475327
512 * expression.cs (ArrayCreation): Don't mutate values optimized away.
514 2009-02-13 Marek Safar <marek.safar@gmail.com>
516 A fix for bug #475342
517 * cs-parser.jay: Using 'super' instead of 'base' to call base
518 constructor crashes compiler.
520 2009-02-13 Marek Safar <marek.safar@gmail.com>
522 A fix for bug #475354
523 * expression.cs (Constantify): Add nullable types.
525 * const.cs (EmitDecimalConstant): Avoid explicit cast.
527 2009-02-12 Marek Safar <marek.safar@gmail.com>
529 A fix for bug #475246
530 * expression.cs: More broken flowanalysis hacking needed.
532 2009-02-12 Marek Safar <marek.safar@gmail.com>
534 * attribute.cs: Compare only ref/out array modifiers.
536 2009-02-11 Marek Safar <marek.safar@gmail.com>
538 * statement.cs: Use member cache when looking for foreach members.
540 2009-02-11 Marek Safar <marek.safar@gmail.com>
542 * expression.cs: Don't expose internal initializer types.
544 * statement.cs: Check also explicit conversions for goto case.
546 2009-02-11 Marek Safar <marek.safar@gmail.com>
548 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
550 2009-02-10 Marek Safar <marek.safar@gmail.com>
552 * *.cs: Replace null-type with NullLiteral where appropriate.
554 2009-02-09 Marek Safar <marek.safar@gmail.com>
556 * expression.cs: Initializer of reference argument use temporary
557 variable to be verifiable.
559 * parameter.cs: Share EmitLdArg.
561 2009-02-09 Marek Safar <marek.safar@gmail.com>
563 A fix for bug #473559
564 * class.cs: Fixed: Not reporting error about nested class with the
567 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
569 Contributed under the MIT/X11 license.
571 * generic.cs: Added VerifyVariantTypeParameters which performs new
572 variance verification logic. The old logic, based on the spec, was
573 wrong because the spec is full of LIES!
575 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
577 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
580 * ecore.cs: Added calls to the new variance verification logic.
583 * delegate.cs: Removed calls to the old variance verification logic.
585 2009-02-06 Marek Safar <marek.safar@gmail.com>
587 * delegate.cs: Use cached Invoke method directly.
589 2009-02-06 Marek Safar <marek.safar@gmail.com>
591 * expression.cs: Emit expression tree for hoisted variable access.
593 2009-02-04 Marek Safar <marek.safar@gmail.com>
595 * namespace.cs: Add better extension class check.
597 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
599 * generic.cs: Fixed typeo (TypeParameter.Variacne).
601 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
603 This patch adds initial generic variance support to the compiler.
604 It is contributed under the MIT/X11 license.
606 * typemanager.cs: Modified ImplementsInterface to check variance.
607 Added VerifyVariantTypeParameters which checks the specified type to see
608 if it uses a variant type parameter as a type argument (which is not
609 allowed). Added IsVariantOf which determins if the first type is a
610 variant of the second. NOTE: This only supports reference types at
611 the moment to conform with the current level of VM support. When the
612 VM supports value types, this will follow step.
614 * generic.cs: Added the Variance enum. Added a Variance property to
615 TypeParameter and added variance support to definition phase. Added a
616 Variance property to TypeParameterName. Also check to make sure that
617 no variant types appear in generic method parameters.
619 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
620 keywords if the langversion supports it.
622 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
623 that variant types are only used in legal positions. Also added
624 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
627 * decl.cs: Construct TypeParameter with the variance information.
629 * convert.cs: Checks variance in ImplicitReferenceConversionExists
630 and ImplicitConversionStandard.
632 * rootcontext.cs: Added new "Future" language version.
634 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
635 type parameters are not used as type arguments in interface inheritance.
636 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
637 parameters are not used as method return types. In MemberBase.
638 ResolveMemberType, ensure that variant type parameters are not used
639 as type arguments. Also call VerifyNoVariantTypeParameters on every
640 set of parameters which are resolved.
642 * delegate.cs: Modified Delegate.Define to ensure that variant
643 parameters are not used as type arguments and that a contravariant
644 parameter is not used as the return type. Also call
645 VerifyNoVariantTypeParameters on the delegate parameters.
647 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
648 to specify generic variance.
650 * driver.cs: Added support for LanguageVersion.Future in the form of
651 "-langversion:future".
653 * generic-mcs.cs: Stubbed out new members in generic.cs.
655 2009-02-03 Marek Safar <marek.safar@gmail.com>
657 * class.cs, generic.cs: Emit type parameter constraints for nested
660 2009-02-02 Marek Safar <marek.safar@gmail.com>
662 A fix for bug #471213
663 * class.cs: Avoid emitting backing field for abstract event fields.
665 2009-02-01 Marek Safar <marek.safar@gmail.com>
667 A fix for bug #359731
668 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
671 2009-01-30 Marek Safar <marek.safar@gmail.com>
673 A fix for bug #470767
674 * statement.cs: Introduced BlockScopeExpression, needed when
675 expression tree conversion has to emit scope variables.
677 2009-01-29 Marek Safar <marek.safar@gmail.com>
679 * class.cs: Remove duplicate CallingConvention.
681 2009-01-29 Marek Safar <marek.safar@gmail.com>
683 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
684 when I finally found the right naming convention.
686 2009-01-29 Marek Safar <marek.safar@gmail.com>
688 * cs-tokenizer.cs: Put back different open parens optimization.
690 2009-01-28 Marek Safar <marek.safar@gmail.com>
692 A fix for bug #470227
693 * cs-tokenizer.cs: Remove too agressive parser optimization.
695 2009-01-28 Marek Safar <marek.safar@gmail.com>
697 A fix for bug #324319
698 * class.cs: Remove too early base type resolve.
700 2009-01-27 Marek Safar <marek.safar@gmail.com>
702 A fix for bug #324319
703 * ecore.cs: Explicitly type null when assigning to type argument to
704 make pass verifier check.
706 2009-01-27 Marek Safar <marek.safar@gmail.com>
708 * anonymous.cs: Fixed recent regression when initializing captured
711 2009-01-26 Marek Safar <marek.safar@gmail.com>
713 A fix for bug #469019
714 * anonymous.cs: Use all parent type parameters when instantiating
715 nested generic storey.
717 2009-01-26 Marek Safar <marek.safar@gmail.com>
719 * expression.cs: Check for null instance methodgroup expression.
721 2009-01-26 Marek Safar <marek.safar@gmail.com>
723 A fix for bug #469244
724 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
725 instance inside a conditional expression.
727 2009-01-23 Marek Safar <marek.safar@gmail.com>
729 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
730 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
731 GetElementType and HasElementType. IsValueType clean up.
733 2009-01-23 Marek Safar <marek.safar@gmail.com>
735 * nullable.cs: Use common EmitCall.
737 * expression.cs: Emit constraint. for virtual calls only.
739 2009-01-23 Marek Safar <marek.safar@gmail.com>
741 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
742 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
743 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
746 2009-01-22 Jb Evain <jbevain@novell.com>
748 * anonymous.cs: make anonymous types' ToString implementation
749 match what csc outputs.
751 2009-01-21 Marek Safar <marek.safar@gmail.com>
753 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
756 2009-01-17 Marek Safar <marek.safar@gmail.com>
758 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
761 2009-01-16 Marek Safar <marek.safar@gmail.com>
763 * nullable.cs (LiftedBinaryOperator): Check for all possible null
766 2009-01-15 Marek Safar <marek.safar@gmail.com>
768 A fix for bug #466634
769 * statement.cs: Add reference for nested storey when only this
772 2009-01-15 Marek Safar <marek.safar@gmail.com>
774 A fix for bug #466474
775 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
778 2009-01-15 Marek Safar <marek.safar@gmail.com>
780 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
781 Fixed nested stories parent referencing process. Also fixes #463985.
783 2009-01-06 Marek Safar <marek.safar@gmail.com>
785 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
786 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
787 implementation. Also fixes #463108.
789 2009-01-05 Marek Safar <marek.safar@gmail.com>
791 A fix for bug #416109
792 * decl.cs: Issue correct CLSAttribute warning location.
794 2009-01-05 Marek Safar <marek.safar@gmail.com>
796 A fix for bug #456775
797 * attribute.cs: Use attribute owner scope when resolving attribute
800 2009-01-05 Marek Safar <marek.safar@gmail.com>
802 A fix for bug #457257
803 * decl.cs: Fixed incorrect member declaring type comparison.
805 2009-01-05 Marek Safar <marek.safar@gmail.com>
807 A fix for bug #460896
808 * driver.cs: Handle /RES resources as embeddable.
810 2009-01-05 Marek Safar <marek.safar@gmail.com>
812 A fix for bug #462515
813 * ecore.cs: Report inacessible members upwards.
815 2009-01-05 Marek Safar <marek.safar@gmail.com>
817 A fix for bug #463190, #463192
818 * decl.cs, namespace.cs: Also import internal extension classes.
820 2009-01-04 Marek Safar <marek.safar@gmail.com>
822 A fix for bug #463415
823 * generic.cs: Use right index for RemoveDependentTypes.
825 2009-01-02 Marek Safar <marek.safar@gmail.com>
827 A fix for bug #463196
828 * expression.cs: Fixed enum to null comparison.
830 2009-01-02 Marek Safar <marek.safar@gmail.com>
832 A fix for bug #463121
833 * nullable.cs: Fixed nullable user equality operator comparison.
835 2009-01-02 Marek Safar <marek.safar@gmail.com>
837 A fix for bug #462950
838 * class.cs, decl.cs: Use full explicit name when defining automatic
839 property backing field.
841 2009-01-02 Marek Safar <marek.safar@gmail.com>
843 A fix for bug #462592
844 * pending.cs: Emit type arguments for generic proxy method.
846 2008-12-30 Marek Safar <marek.safar@gmail.com>
848 * expression.cs (As): Mutate all type arguments.
850 2008-12-29 Marek Safar <marek.safar@gmail.com>
852 A fix for bug #462622
853 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
856 2008-12-29 Marek Safar <marek.safar@gmail.com>
858 A fix for bug #450782
859 * ecore.cs: Consider more variables of form V.I to be fixed.
861 2008-12-29 Marek Safar <marek.safar@gmail.com>
863 A fix for bug #460712
864 * typemanager.cs: Core types could be imported.
866 2008-12-28 Marek Safar <marek.safar@gmail.com>
868 A fix for bugs #460847, #460772, #458049, #457339, #447807
869 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
870 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
871 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
872 user lambdas used inside query clauses.
874 2008-12-18 Marek Safar <marek.safar@gmail.com>
876 A fix for bug #460229
877 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
879 2008-12-18 Marek Safar <marek.safar@gmail.com>
881 A fix for bug #459952
882 * decl.cs, namespace.cs: Use common CheckAccessLevel.
884 2008-12-18 Marek Safar <marek.safar@gmail.com>
886 A fix for bug #459630
887 * convert.cs: Enum to valuetype conversion is not allowed.
889 2008-12-18 Marek Safar <marek.safar@gmail.com>
891 A fix for bug #457087
892 * generic.cs: Don't crash when constraint comes from type
895 2008-12-16 Marek Safar <marek.safar@gmail.com>
897 A fix for bug #459221
898 * anonymous.cs, statement.cs: Delay only captured this
901 2008-12-12 Marek Safar <marek.safar@gmail.com>
903 A fix for bug #457489
904 * anonymous.cs, statement.cs: Split anonymous storey instantiation
905 and initialization to capture scope initializers correctly.
907 2008-12-11 Marek Safar <marek.safar@gmail.com>
909 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
910 ParameterReference refactoring.
912 2008-12-03 Marek Safar <marek.safar@gmail.com>
914 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
915 to be imported from any assembly.
917 2008-12-03 Marek Safar <marek.safar@gmail.com>
919 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
920 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
921 from anonymous method and lambda expression.
923 2008-12-01 Marek Safar <marek.safar@gmail.com>
925 A fix for bug #448560
926 * expression.cs (As): Box any generic type arguments to be
929 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
931 Add tripwire for implicit conversion bugs
932 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
934 (MethodGroupExpr.OverloadResolve): Add sanity check between
935 IsApplicable and VerifyArgumentsCompat.
936 (VerifyArgumentsCompat): Report CS1501 where appropriate.
938 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
940 Fix build break in System.Data_test
941 * convert.cs (ImplicitConversionExists): Move NullLiteral
943 (ImplicitStandardConversionExists): ... here.
945 2008-11-28 Marek Safar <marek.safar@gmail.com>
947 * literal.cs: Emit correctly explicit null to nullable cast.
949 2008-11-28 Marek Safar <marek.safar@gmail.com>
951 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
954 2008-11-28 Marek Safar <marek.safar@gmail.com>
956 A fix for bug #449005
957 * convert.cs, nullable.cs: Use only one implicit nullable
960 2008-11-27 Marek Safar <marek.safar@gmail.com>
962 * convert.cs, literal.cs: More Convert cleanup is needed.
964 2008-11-27 Marek Safar <marek.safar@gmail.com>
966 * decl.cs, class.cs: Fixed misleading error message.
968 2008-11-26 Marek Safar <marek.safar@gmail.com>
970 A fix for bug #449005
971 * nullable.cs (EmitEquality): Disable optimization for user operator
974 2008-11-25 Marek Safar <marek.safar@gmail.com>
976 A fix for bug #447027
977 * anonymous.cs (HoistedVariable): Cache also outer access to deal
978 with context variables stored as expression instances.
980 2008-11-25 Marek Safar <marek.safar@gmail.com>
982 A fix for bug #447027
983 * delegate.cs: Fixed delegate VerifyMethod logic.
985 2008-11-24 Marek Safar <marek.safar@gmail.com>
987 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
990 2008-11-21 Marek Safar <marek.safar@gmail.com>
992 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
993 member type resolve to follow normal flow, instead of random
996 2008-11-21 Marek Safar <marek.safar@gmail.com>
998 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
1001 2008-11-21 Marek Safar <marek.safar@gmail.com>
1003 * const.cs: Emit decimal array constant as literal.
1005 2008-11-20 Marek Safar <marek.safar@gmail.com>
1007 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
1009 2008-11-19 Marek Safar <marek.safar@gmail.com>
1011 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
1012 into real property (saves 8 MB for corlib compilation).
1014 2008-11-19 Marek Safar <marek.safar@gmail.com>
1016 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
1017 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
1018 generic-mcs.cs: Small cleanup of TypeArguments.
1020 2008-11-18 Marek Safar <marek.safar@gmail.com>
1022 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
1023 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
1024 of ConstructedType expression, renamed to GenericTypeExpr.
1026 2008-11-17 Marek Safar <marek.safar@gmail.com>
1028 A fix for bug #445303
1029 * location.cs (IsConditionalDefined): Handle undefined global
1032 2008-11-17 Marek Safar <marek.safar@gmail.com>
1034 A fix for bug #444678
1035 * expression.cs (TryReduceConstant): Always create new constant
1038 2008-11-17 Marek Safar <marek.safar@gmail.com>
1040 A fix for bug #444673
1041 * ecore.cs: Ignore open generic types when used as generic type
1044 2008-11-17 Marek Safar <marek.safar@gmail.com>
1046 A fix for bug #445458
1047 * expression.cs, cs-parser.jay: Don't crash when an expression
1050 2008-11-17 Marek Safar <marek.safar@gmail.com>
1052 A fix for bug #445464
1053 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
1054 inside unbound type.
1056 2008-11-14 Jb Evain <jbevain@novell.com>
1058 * driver.cs: ignore empty -nowarn argument such as
1059 the one in -nowarn:12,13,,.
1061 2008-11-13 Marek Safar <marek.safar@gmail.com>
1063 A fix for bug #444271
1064 * anonymous.cs: Rescan parent storeys when best candidate was
1067 2008-11-13 Marek Safar <marek.safar@gmail.com>
1069 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
1070 useless UnboundTypeExpression.
1072 * attribute.cs: Do check obsolete attribute on generic types.
1074 2008-11-12 Marek Safar <marek.safar@gmail.com>
1076 A fix for bugs #425680, #400139
1077 * ecore.cs, expression.cs: Trying to do some almost_matched_members
1080 2008-11-11 Marek Safar <marek.safar@gmail.com>
1082 A fix for bug #435747
1083 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
1084 compound value types assignment. Few micro optimizations added.
1086 2008-11-10 Marek Safar <marek.safar@gmail.com>
1088 A fix for bug #442610
1089 * anonymous.cs (MutateConstructor): More SRE hacking.
1091 2008-11-10 Marek Safar <marek.safar@gmail.com>
1093 A fix for bug #442579
1094 * ecore.cs: Also initialize expanded form of a method with 1 params
1097 2008-11-06 Marek Safar <marek.safar@gmail.com>
1099 * expression.cs (UnaryMutator): Do early l-side check.
1101 2008-11-05 Miguel de Icaza <miguel@novell.com>
1103 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1104 Init, otherwise we would crash later on when checking for friend
1107 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1108 Otherwise we never get any meaningful information as to what
1111 2008-11-05 Marek Safar <marek.safar@gmail.com>
1113 A fix for bug #436318
1114 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1116 2008-11-05 Miguel de Icaza <miguel@novell.com>
1118 * namespace.cs: Turns out that it was a really bad idea to hide
1119 the errors for namespaces not found here in eval mode.
1121 * eval.cs: When we process using clauses, only enter those into
1122 the list of valid using clauses after they have been validated.
1124 The above change gives the proper semantics: it does not
1125 senselessly report the same errors with broken using statements by
1126 never storing them in the first place when they are invalid.
1128 2008-11-05 Marek Safar <marek.safar@gmail.com>
1130 A fix for bug #421839
1131 * cs-parser.jay: Remove expression from coalesce rule to force lower
1132 priority than the assignment operator.
1134 2008-11-05 Marek Safar <marek.safar@gmail.com>
1136 A fix for bug #437875
1137 * nullable.cs: Compile correctly method group operand used with null
1138 coalescing operator.
1140 2008-11-04 Marek Safar <marek.safar@gmail.com>
1142 A fix for bug #434589
1143 * expression.cs (Binary): Ignore lifted conversions when at least
1144 one operand is of reference type.
1146 2008-11-04 Marek Safar <marek.safar@gmail.com>
1148 * cs-parser.jay: Better syntax error report.
1150 2008-11-03 Marek Safar <marek.safar@gmail.com>
1152 A fix for bug #436792
1153 * cs-parser.jay: Use GetLocation to access location.
1155 2008-11-03 Marek Safar <marek.safar@gmail.com>
1157 A fix for bug #440774
1158 * cs-parser.jay: Also set current_array_type when parsing local
1161 2008-11-03 Marek Safar <marek.safar@gmail.com>
1163 A fix for bug #440785
1164 * expression.cs (As): Don't resolve self modifing expression
1167 2008-11-03 Marek Safar <marek.safar@gmail.com>
1169 A fix for bug #439447
1170 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1172 2008-11-03 Marek Safar <marek.safar@gmail.com>
1174 A fix for bug #437571
1175 * cs-parser.jay: Fixes internal error for invalid expression
1178 2008-10-17 Marek Safar <marek.safar@gmail.com>
1180 * ecore.cs: Resolve correctly ambiguous params delegate methods.
1182 2008-10-17 Marek Safar <marek.safar@gmail.com>
1184 * generic.cs, anonymous.cs: Simplified GetDeclarations.
1186 2008-10-17 Marek Safar <marek.safar@gmail.com>
1188 * cs-tokenizer.cs: More precise cast parsing.
1190 2008-10-16 Martin Baulig <martin@ximian.com>
1192 * anonymous.cs (AnonymousMethodStorey): Put back the
1193 `hoisted_locals' hashtable and use it in EmitType().
1195 2008-10-15 Marek Safar <marek.safar@gmail.com>
1197 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1198 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1201 2008-10-14 Marek Safar <marek.safar@gmail.com>
1203 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1205 2008-10-14 Marek Safar <marek.safar@gmail.com>
1207 * statement.cs: Mutate scope initializers.
1209 2008-10-14 Marek Safar <marek.safar@gmail.com>
1211 * expression.cs: Use typeless value for This constant.
1213 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1215 2008-10-14 Marek Safar <marek.safar@gmail.com>
1217 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1220 2008-10-13 Marek Safar <marek.safar@gmail.com>
1222 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1225 2008-10-13 Marek Safar <marek.safar@gmail.com>
1227 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1228 parser and tokenizer. Fixes many ambiguities including #433258.
1230 2008-10-10 Marek Safar <marek.safar@gmail.com>
1232 * cs-parser.jay: Fixed missing accessor recovery.
1234 2008-10-10 Marek Safar <marek.safar@gmail.com>
1236 A fix for bug #433701
1237 * expression.cs: Better error message.
1239 2008-10-10 Marek Safar <marek.safar@gmail.com>
1241 * cs-parser.jay, expression.cs: Start reporting real parser errors.
1243 * Makefile: Disabled unused debug symbols.
1245 Also fixes: #320556, #321097, #321656, #321876, #351316
1247 2008-10-09 Miguel de Icaza <miguel@novell.com>
1249 * eval.cs: rename "<interactive>" to "{interactive}", to work
1250 around a requirement in the compiler that this be a valid
1251 filename, and in Windows it is not (433886).
1253 2008-10-09 Marek Safar <marek.safar@gmail.com>
1255 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1257 2008-10-08 Marek Safar <marek.safar@gmail.com>
1259 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1260 cs-parser.jay: Generic type declaration and type arguments cleanup.
1262 2008-10-05 Marek Safar <marek.safar@gmail.com>
1264 * cs-parser.jay: Allow parsing weird array creation construct.
1266 2008-10-05 Marek Safar <marek.safar@gmail.com>
1268 * cs-parser.jay: Conflicts reduction.
1270 2008-10-04 Marek Safar <marek.safar@gmail.com>
1272 * cs-parser.jay: Conflicts reduction.
1274 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
1277 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1278 property. Add a 'count' hint about the use of the shared vector.
1279 Ensure that we don't leak out dirty bits.
1280 (UsageVector.MergeChild): Throw away information about variables
1282 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1284 2008-10-03 Marek Safar <marek.safar@gmail.com>
1286 A fix for bug #431746
1287 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1288 parameters when iterator is created.
1290 2008-10-03 Marek Safar <marek.safar@gmail.com>
1292 A fix for bug #431827
1293 * expression.cs: Fixed right based pointer arithmetic operations
1296 2008-10-03 Marek Safar <marek.safar@gmail.com>
1298 A fix for bug #353779
1299 * assign.cs, expression.cs: Fixed compound assignment conversions.
1301 2008-10-02 Marek Safar <marek.safar@gmail.com>
1303 A fix for bug #375262
1304 * statement.cs: Refactor ArrayForeach to be usable with string
1305 indexer. Optimized single dimentional arrays foreach.
1307 2008-10-02 Marek Safar <marek.safar@gmail.com>
1309 A fix for bug #431255
1310 * anonymous.cs, expression.cs: Removed broken optimization.
1312 2008-10-01 Marek Safar <marek.safar@gmail.com>
1314 * anonymous.cs: Use full type parameters of parent generic
1315 containers. Removed unnecessary AddParentStoreyReference call.
1317 2008-10-01 Marek Safar <marek.safar@gmail.com>
1319 A fix for bug #324702
1320 * class.cs: Use better shorter names for explicit interface member
1323 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1325 2008-10-01 Marek Safar <marek.safar@gmail.com>
1327 * expression.cs: Use new interface to check fixed expression.
1329 2008-10-01 Marek Safar <marek.safar@gmail.com>
1331 A fix for bug #421101
1332 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1333 interface to check for fixed fixed-buffers.
1335 2008-10-01 Marek Safar <marek.safar@gmail.com>
1337 A fix for bug #429264
1338 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1340 * delegate.cs: Removed unnecessary casts.
1342 2008-09-30 Marek Safar <marek.safar@gmail.com>
1344 A fix for bug #352151
1345 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1346 class.cs: Fixed already defined explicit interface members check.
1348 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
1350 cs-tokenizer.cs: Fix typo.
1352 2008-09-28 Miguel de Icaza <miguel@novell.com>
1354 * eval.cs (InteractiveBase): The quit command now just sets a
1355 flag, instead of calling Environment.Exit(), it is milder on
1358 CompiledMethod is now in Mono.CSharp, not nested inside
1359 the Evaluator, it was inconvenient to use.
1361 2008-09-27 Miguel de Icaza <miguel@novell.com>
1363 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1364 code to be invoked without having to reparse.
1366 2008-09-27 Miguel de Icaza <miguel@novell.com>
1368 * ecore.cs: The recent changes to FieldExpr broke this as well.
1369 Fixes LINQ queries in the interactive shell.
1371 * Multiple files: indentation fixing for the Mono coding
1372 guidelines for the switch statement.
1374 * eval.cs: Make the Evaluator API thread safe.
1376 2008-09-26 Marek Safar <marek.safar@gmail.com>
1378 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1379 constructor parsing.
1381 2008-09-26 Marek Safar <marek.safar@gmail.com>
1383 A fix for bug #325326
1384 * statement.cs: Check possible mistaken empty statement using
1385 explicit blocks only.
1387 2008-09-25 Miguel de Icaza <miguel@novell.com>
1389 * eval.cs (LoadAssembly, ReferenceAssembly): Call
1390 RootNamespace.ComputeNamespaces to update the internal list of
1391 namespaces, this is no longer done for us.
1393 (InteractiveBase): Use the Evaluator APIs instead of calling into
1396 2008-09-25 Marek Safar <marek.safar@gmail.com>
1398 A fix for bug #429264
1399 * expression.cs: Missing mutator for access to multidimensional
1402 2008-09-25 Marek Safar <marek.safar@gmail.com>
1404 * class.cs, statement: Emit DebuggerHidden attribute for iterator
1407 * driver.cs: Missing input argument check.
1409 2008-09-25 Marek Safar <marek.safar@gmail.com>
1411 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1412 expression.cs, statement.cs, rootcontext.cs, class.cs,
1413 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1416 2008-09-24 Miguel de Icaza <miguel@novell.com>
1418 * ecore.cs (FieldExpr): Only initialize eclass when we return a
1419 fully constructed FieldExpr, fixes the regression introduced in
1422 * ecore.cs, expression.cs: Plug back the eclass initialization as
1423 otherwise it regresses `csharp'.
1425 2008-09-24 Marek Safar <marek.safar@gmail.com>
1427 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1428 ecore.cs, attribute.cs: Moved obsolete method checks from emit
1429 phase to resolve phase. It resolves problems with expression trees
1430 and fixes bugs #323796, #325156.
1432 2008-09-23 Marek Safar <marek.safar@gmail.com>
1434 * codegen.cs: Report better error when symbol writer is missing.
1436 2008-09-23 Marek Safar <marek.safar@gmail.com>
1438 * codegen.cs: Set .NET symbol writer.
1440 * decl.cs: Guard against null generic arguments.
1442 * report.cs: Don't report exactly same additional details.
1444 2008-09-22 Marek Safar <marek.safar@gmail.com>
1446 A fix for bug #324917
1447 * cs-parser.jay: Add missing multidimensional non-expression type
1450 2008-09-22 Marek Safar <marek.safar@gmail.com>
1452 A fix for bug #428191
1453 * anonymous.cs: Create an outer generic fields also for non-storey
1456 2008-09-22 Marek Safar <marek.safar@gmail.com>
1458 A fix for bug #378294
1459 * class.cs: Make fixed size buffers gmcs feature only.
1461 2008-09-22 Marek Safar <marek.safar@gmail.com>
1463 A fix for bug #355622, #324993
1464 * assign.cs, const.cs, class.cs: Create new EmitContext for each
1467 2008-09-19 Marek Safar <marek.safar@gmail.com>
1469 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1472 2008-09-19 Marek Safar <marek.safar@gmail.com>
1474 A fix for bug #416110
1475 * generic.cs: Struct constraint results in default ctor and
1476 ValueType base type constraint to be set.
1478 2008-09-19 Marek Safar <marek.safar@gmail.com>
1480 A fix for bug #423791
1481 * generic.cs: Fixed params output type type-inference.
1483 2008-09-19 Marek Safar <marek.safar@gmail.com>
1485 * cs-parser.jay, expression.cs: Fixed few expression crashes.
1487 2008-09-19 Marek Safar <marek.safar@gmail.com>
1489 * cs-tokenizer.cs: Don't break on extra partial modifier.
1491 2008-09-19 Marek Safar <marek.safar@gmail.com>
1493 A fix for bug #427592
1494 * generic.cs: Use common parameter resolve method.
1496 2008-09-18 Marek Safar <marek.safar@gmail.com>
1498 A fix for bug #414758
1499 * expression.cs, ecore.cs: Fixed crash when accessing non-static
1502 2008-09-18 Marek Safar <marek.safar@gmail.com>
1504 * driver.cs, namespace.cs: Read types and namespaces after all
1505 requested assemblies are loaded, fixes issues with System.Core
1506 auto-reference, and #419888.
1508 2008-09-18 Marek Safar <marek.safar@gmail.com>
1510 A fix for bug #417705
1511 * cs-parser.jay: Fixed as/is operator expression split.
1513 2008-09-18 Marek Safar <marek.safar@gmail.com>
1515 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1516 Fixed expression tree representation of empty new expression and
1517 new initializer expression.
1519 2008-09-18 Miguel de Icaza <miguel@novell.com>
1521 * eval.cs: Remove warning, keep reference to driver around.
1523 * Hide fields that do not need to be public.
1525 2008-09-17 Marek Safar <marek.safar@gmail.com>
1527 A fix for bug #426385
1528 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1529 conversion for array elements.
1531 2008-09-17 Marek Safar <marek.safar@gmail.com>
1533 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1534 void parsing conflicts.
1536 2008-09-15 Marek Safar <marek.safar@gmail.com>
1538 A fix for bug #425601
1539 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1540 System.Core only when there is no custom ExtensionAttribute
1543 2008-09-15 Miguel de Icaza <miguel@novell.com>
1545 * namespace.cs: Do not report CS0246 (name
1547 2008-09-12 Marek Safar <marek.safar@gmail.com>
1549 A fix for bug #425669
1550 * generic.cs: Don't cache generic static anonymous method
1553 2008-09-12 Marek Safar <marek.safar@gmail.com>
1555 * generic.cs, class.cs, delegate.cs: Check recursive inherited
1556 conflicting constraints.
1558 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
1560 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1563 2008-09-12 Marek Safar <marek.safar@gmail.com>
1565 * literal.cs, convert.cs, expression.cs, statement.cs: More null
1566 to null pointer conversion fixes.
1568 2008-09-11 Marek Safar <marek.safar@gmail.com>
1570 * cs-parser.jay, expression.cs: An implicitly typed local variable
1571 declarator cannot use an array initializer.
1573 2008-09-11 Marek Safar <marek.safar@gmail.com>
1575 * cs-parser.jay: Reduced number of printed tokens, add sorting.
1577 2008-09-11 Marek Safar <marek.safar@gmail.com>
1579 * generic.cs (InflatedConstraints): Don't crash when constraints
1582 * cs-parser.jay: const_declarator is a block.
1584 * constant.cs: Check for not allowed NaN conversions.
1586 2008-09-10 Miguel de Icaza <miguel@novell.com>
1588 * driver.cs: Drop --shell argument, the compiler is no longer a
1591 * eval.cs: Move most of the code that deals with evaluation into
1592 this file and document the public API from repl.cs
1594 * repl.cs: Remove from here.
1596 2008-09-10 Marek Safar <marek.safar@gmail.com>
1598 A fix for bug #424684
1599 * generic.cs: Generic class constraints must come first.
1601 2008-09-09 Miguel de Icaza <miguel@novell.com>
1603 * cs-parser.jay: Improve error reporting for syntax errors in
1604 statements and expressions, we now report the expected tokens
1605 instead of reporting the useless "; expected".
1607 Drop the strings from the token declaration, it turns out that
1608 they did not do what I thought they did. Instead they were adding
1609 two sets of tokens to the tables.
1611 2008-09-09 Marek Safar <marek.safar@gmail.com>
1613 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1614 delegate.cs: Share special type check.
1616 2008-09-09 Marek Safar <marek.safar@gmail.com>
1618 A fix for bug #423981
1619 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1621 2008-09-09 Marek Safar <marek.safar@gmail.com>
1623 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1626 2008-09-09 Marek Safar <marek.safar@gmail.com>
1628 A fix for bugs: #324750, #335946
1629 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
1630 lookup rule to determine ?-based tokens.
1632 2008-09-08 Miguel de Icaza <miguel@novell.com>
1634 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1635 expressions (like event adding or removing) end up here, so we
1636 need to treat those as statements.
1638 Add LoadAssembly method.
1640 2008-09-04 Miguel de Icaza <miguel@novell.com>
1642 * repl.cs: Add Time method.
1644 2008-09-05 Marek Safar <marek.safar@gmail.com>
1646 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1648 2008-09-05 Miguel de Icaza <miguel@novell.com>
1650 * repl.cs: Add workaround for old compilers.
1652 2008-09-04 Jb Evain <jbevain@novell.com>
1654 * repl.cs (PrettyPrint): pretty print everything that
1655 implements IDictionary, as well as IEnumerables. Also,
1656 add a quit helper property.
1658 2008-09-04 Marek Safar <marek.safar@gmail.com>
1660 * constant.cs: Better error reporting for decimal literals.
1662 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1665 2008-09-04 Marek Safar <marek.safar@gmail.com>
1666 Miguel de Icaza <miguel@novell.com>
1668 A fix for bug #422951
1669 * assign.cs (Assign.DoResolve): Perform the type conversions
1670 checks before we attempt to initialize `New' initializers.
1672 2008-09-04 Marek Safar <marek.safar@gmail.com>
1674 A fix for bug #422853
1675 * delegate.cs (DelegateCreation): Add special handling for
1676 EmptyExpression.Null instance expression which is just another
1677 hack for undecided member instance exression.
1679 2008-09-04 Marek Safar <marek.safar@gmail.com>
1681 * expression.cs, ecore.cs: Emit full expression tree for reduced
1684 2008-09-04 Marek Safar <marek.safar@gmail.com>
1686 * expression.cs (This): Guard against multi-resolving.
1688 * ecore.cs, statement.cs (Throw): Simplified.
1690 * flowanalysis.cs: Also verify event fields.
1692 2008-09-04 Miguel de Icaza <miguel@novell.com>
1694 * assign.cs (Assign.DoResolve): Perform the type conversions
1695 checks before we attempt to initialize `New' initializers.
1697 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1699 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1702 * repl.cs: Update help.
1704 2008-09-03 Miguel de Icaza <miguel@novell.com>
1706 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1707 handling of the default config handling, including the special
1708 treatment of System.Core assembly.
1710 Fixes the REPL processing for LINQ.
1712 2008-09-03 Marek Safar <marek.safar@gmail.com>
1714 A fix for bug #422507
1715 * expression.cs (UnboxCast): Add missing child expression mutator.
1717 2008-09-03 Marek Safar <marek.safar@gmail.com>
1719 * driver.cs: Don't self reference System.Core assembly.
1721 2008-09-03 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #422507
1724 * expression.cs (StringConcat): Add missing type mutator.
1726 2008-09-03 Marek Safar <marek.safar@gmail.com>
1728 * generic.cs (TypeInferenceContext): Follow equality rule for
1729 constructed type lower bound type inference.
1731 2008-09-02 Miguel de Icaza <miguel@novell.com>
1733 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1734 <dblank@cs.brynmawr.edu> which updates the cursor position on
1737 2008-09-02 Marek Safar <marek.safar@gmail.com>
1739 A fix for bug #367145
1740 * driver.cs: Fixed import of extension methods when using -noconfig
1743 2008-09-02 Marek Safar <marek.safar@gmail.com>
1745 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1746 version from non-generic implementation instead.
1748 2008-09-01 Marek Safar <marek.safar@gmail.com>
1750 A fix for bug #418908
1751 * class.cs: Use AddScopeStatement for field initializers.
1753 2008-09-01 Marek Safar <marek.safar@gmail.com>
1755 A fix for bug #415385
1756 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1758 2008-09-01 Marek Safar <marek.safar@gmail.com>
1760 A fix for bug #421736
1761 * iterators.cs: Don't crash on unreachable iterators.
1763 2008-09-01 Marek Safar <marek.safar@gmail.com>
1765 A fix for bug #421628
1766 * parameter.cs, attribute.cs: Clone also parameter attributes.
1768 2008-08-30 Miguel de Icaza <miguel@novell.com>
1770 * namespace.cs (LookupType): In EvalMode, try to replace
1771 the TypeBuilder from our cache with a Type as Reflection.Emit does
1772 not like to mix code from older assemblies emitted and new
1775 This sounds like a serious Mono bug that prevents multiple
1776 assemblies to be generated and consumed at the same time.
1778 * cs-parser.jay (push_current_class): Do not make interactive
1779 classes internal or private, make them public as we currently
1780 generate each new class in a new assembly.
1782 2008-08-29 Miguel de Icaza <miguel@novell.com>
1784 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1785 remove types that are entered into the global namespace during
1786 parsing so that we can remove them on failure.
1788 * cs-parser.jay: Parsing: we now keep track of types that are
1789 entered into global variables and queue those in case the parsing
1792 This happens in a few situations: during partial-input, we invoke
1793 the parser repeatedly for example with the string "class X", this
1794 would cause X to be registed, and we need to remove this
1795 registration so that another parse attempt later with say "class X {"
1796 would actually work.
1798 Additionally, if there is an error in the resolution phase, for
1799 example: "class X : NonExistant {}" th
1801 * cs-parser.jay: Be more precise with the errors being raised,
1802 instead of flagging all exceptions during parsing to be attributed
1803 to the parsing process, distinguish those from errors happening in
1804 the actions and hint that using -v would produce the actual
1807 * repl.cs: Do not load all compiler references on each reset,
1808 doing the partial reset takes care of this.
1810 2008-08-28 Miguel de Icaza <miguel@novell.com>
1812 * repl.cs: Add support for loading all the files from
1813 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1816 Introduce a micro-parser that is able to deambiguate on its input
1817 whether we are dealing with a compilation unit (namespace, class,
1818 interface, struct, delegate) declaration or a statement. This
1819 allows both declarations and statements to be entered.
1821 Set history size by default to 300 lines.
1823 Instead of distinguishing based on the parser.InteractiveResult,
1824 have only two cases: statements were parsed, or a compilation unit
1825 was. Always pull the Using statement additions from the
1826 compilation unit parse.
1828 * cs-tokenizer.cs: Rename tokens to better describe their intent
1829 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1831 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1832 EvalMode is used to trigger the lookup of global variables while
1833 StatementMode is used turn variable declarations into static
1836 * getline.cs: Allow history size to be set.
1838 2008-08-29 Marek Safar <marek.safar@gmail.com>
1840 A fix for bug #360755
1841 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1843 2008-08-29 Marek Safar <marek.safar@gmail.com>
1845 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1847 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1848 member name, it is too confusing
1850 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1852 * rootcontext.cs: Finally default to warning level 4.
1854 2008-08-28 Marek Safar <marek.safar@gmail.com>
1856 * class.cs (CheckBase): Ignore overloaded operators.
1858 2008-08-28 Marek Safar <marek.safar@gmail.com>
1860 A fix for bug #420830
1861 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1863 2008-08-28 Marek Safar <marek.safar@gmail.com>
1865 A fix for bug #420832
1866 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1868 2008-08-28 Marek Safar <marek.safar@gmail.com>
1870 A fix for bug #420386
1871 * nullables.cs: Fixed logic of nullable user comparison operators involving
1874 2008-08-28 Marek Safar <marek.safar@gmail.com>
1876 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1878 2008-08-27 Miguel de Icaza <miguel@novell.com>
1880 * repl.cs: Add support for aborting the running code with C-c.
1882 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1884 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1886 2008-08-27 Miguel de Icaza <miguel@novell.com>
1888 * cs-parser.jay (interactive_statement_list): A new set of rules
1889 for hosting statements that uses the "interactive_" prefix.
1891 * repl.cs: Add support for parsing `using' as a statement or as a
1892 directive. Deambiguating before passing this to the parser.
1894 We need to distinguish statement_expressions that occur at the
1895 toplevel vs those that occur embedded into expressions.
1897 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1898 that fixes the cursor key handling, and a history bug.
1900 2008-08-26 Miguel de Icaza <miguel@novell.com>
1902 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1903 limitations in Console, instead the 2.0 bootstrap libraries now
1904 include the Console bits.
1906 Also, remove the use of Nullables from getline.cs
1910 Interactive support for the C# compiler. Use gmcs --shell to
1911 enter a read-eval-print loop shell.
1913 Docs: http://www.mono-project.com/CsharpRepl
1915 * sources: include repl.cs here and getline.cs for gmcs.exe,
1916 everything else is getline.cs impaired.
1918 * Makefile: when bootstrapping pass a special flag
1919 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1920 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1921 This distinguishes those two cases.
1923 * repl.cs: Support for a read-eval-print loop. Will be soon
1924 refactored into eval support and then REPL on top of it.
1926 * ecore.cs: If a simplename lookup fails, before erroring out,
1927 if we are in EvalMode to resolve the name to a declaration in the
1930 This means that variable declarations that happened in previous
1931 classes (as repl puts every statement in a separate class) are
1932 made visible in this way.
1934 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1935 triggered an error due to the end of file being reached. This is
1936 used to do multi-line input, and notify the caller that the user
1937 needs to provide more text before a successful parse.
1939 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1940 to drive the evaluation with a custom wrapper.
1942 * driver.cs: Add support for --shell, and refactor some code to be
1945 * namespace.cs: Add support for serializing the contents of the
1946 namespaces and reloading them.
1948 * getline.cs: A managed implementation of ReadLine under
1949 X11/Apache2 license terms. Easy to embed in other applications as
1952 * namespace.cs: Add some functions to save and restore the
1955 * rootcontext.cs: New public field.
1957 * cs-tokenizer.cs: Add support for one of the possible characters
1958 we introduce into the token stream.
1960 This patch does not affect the regular tokenization process, the
1961 only performance hit would happen if there is an invalid character
1962 on the input string.
1964 * support.cs: Move isatty helper routine here.
1966 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1967 code generator for in-memory assemblies.
1969 2008-08-26 Marek Safar <marek.safar@gmail.com>
1971 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1972 parameter cannot be always used as a type.
1974 2008-08-21 Marek Safar <marek.safar@gmail.com>
1976 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1978 2008-08-21 Marek Safar <marek.safar@gmail.com>
1980 * convert.cs: Implement explicit array to IList<T> conversion.
1982 2008-08-20 Marek Safar <marek.safar@gmail.com>
1984 A fix for bug #362740
1985 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1987 2008-08-20 Marek Safar <marek.safar@gmail.com>
1989 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1990 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1991 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1992 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1993 handling to use just one type of infrastructure and deal with generics
1996 2008-07-23 Martin Baulig <martin@ximian.com>
1998 *** Merged this from trunk revision 108527 ***
2001 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
2002 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
2005 2008-08-15 Marek Safar <marek.safar@gmail.com>
2007 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
2010 2008-08-15 Marek Safar <marek.safar@gmail.com>
2012 * delegate.cs: Fixed compiler crash when creating delegate using partial
2015 * typemanager.cs: MulticastDelegate is not a delegate.
2017 2008-08-14 Marek Safar <marek.safar@gmail.com>
2019 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
2022 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
2024 * cs-parser.jay (type): Allow 'var' in mcs too.
2025 (local_variable_type): Likewise.
2027 2008-08-14 Marek Safar <marek.safar@gmail.com>
2029 * driver.cs: Removed broken -noconfig variants.
2031 2008-08-14 Marek Safar <marek.safar@gmail.com>
2033 A fix for bug #417078
2034 * expression.cs: Emit correctly left side pointer operators.
2036 2008-08-13 Marek Safar <marek.safar@gmail.com>
2038 * generic.cs, lambda.cs: Inflate method generic arguments only.
2040 2008-08-12 Marek Safar <marek.safar@gmail.com>
2042 * class.cs: Fixed struct layout check regression.
2044 2008-08-12 Marek Safar <marek.safar@gmail.com>
2046 * cs-parser.jay, enum.cs: Simplified enum parsing.
2048 * decl.cs: Check all type parameters conflicts.
2050 * expression.cs, statement.cs, attribute.cs: More expression checks.
2052 2008-08-11 Marek Safar <marek.safar@gmail.com>
2054 * generic.cs: Add type inference types restriction.
2056 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
2057 anonymous.cs, expression.cs: Allocate less accessor parameters.
2059 2008-08-08 Marek Safar <marek.safar@gmail.com>
2061 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
2064 2008-08-08 Marek Safar <marek.safar@gmail.com>
2066 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
2068 2008-08-07 Marek Safar <marek.safar@gmail.com>
2070 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
2071 Also fixes #362146 and #381592.
2073 2008-08-07 Marek Safar <marek.safar@gmail.com>
2075 * ecore.cs: Reduced constant cannot be used as an attribute value.
2077 * cs-parser.jay: Base expression has to be a type.
2079 * expression.cs (Conditional): Uses ReducedExpression.
2081 2008-08-06 Marek Safar <marek.safar@gmail.com>
2083 A fix for bug #376826
2084 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
2085 address of hoisted local variable or parameter cannot be taken.
2087 2008-08-05 Marek Safar <marek.safar@gmail.com>
2089 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
2090 anonymous method inside checked/unchecked expression.
2092 2008-08-05 Marek Safar <marek.safar@gmail.com>
2094 * typemanager.cs (IsEqual): Guard against null.
2096 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2097 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2098 routine. Fixed few misleading conversion errors.
2100 2008-08-04 Marek Safar <marek.safar@gmail.com>
2102 * class.cs: Consider generics when checking cycles in struct layout.
2104 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
2106 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
2108 2008-08-04 Marek Safar <marek.safar@gmail.com>
2110 A fix for bug #414165
2111 * anonymous.cs: Use same anonymous implementation method for all anonymous
2114 2008-08-04 Marek Safar <marek.safar@gmail.com>
2116 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2119 2008-08-04 Marek Safar <marek.safar@gmail.com>
2121 * cs-parser.jay: Typeof argument has to be a type expression.
2123 * namespace.cs: Check alias and namespace definitions collisions.
2125 * class.cs, pending.cs: Moved explicit interface accessor implementation
2128 * delegate.cs, expression.cs: Verify special name invocations.
2130 2008-08-01 Marek Safar <marek.safar@gmail.com>
2132 * cs-parser.jay: Don't choke on empty generic type arguments.
2134 * cs-tokenizer.cs: Handle escaped preprocessor directives.
2136 * expression.cs, ecore.cs: Minor expressions bugs.
2138 2008-08-01 Marek Safar <marek.safar@gmail.com>
2140 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2141 and added more error handling.
2143 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2145 * modifiers.cs, enum.cs: Fixed.
2147 2008-07-31 Jb Evain <jbevain@novell.com>
2149 * driver.cs: remove -pkg ability of smcs.
2151 2008-07-30 Marek Safar <marek.safar@gmail.com>
2153 * statement.cs (Switch): Correctly set empty default target for single
2156 2008-07-30 Marek Safar <marek.safar@gmail.com>
2158 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2159 string switch statement implementation to use string dictionary which
2160 significantly (2-8x) improves performance of generated code.
2162 2008-07-29 Marek Safar <marek.safar@gmail.com>
2164 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2165 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2167 2008-07-29 Marek Safar <marek.safar@gmail.com>
2169 A fix for bug #412595
2170 * typemanager.cs, convert.cs, expression.cs: Some types are never
2171 convertible to each other.
2173 2008-07-29 Marek Safar <marek.safar@gmail.com>
2175 * nullable.cs (CreateNullConstant): An error messages update.
2177 2008-07-29 Marek Safar <marek.safar@gmail.com>
2179 A fix for bug #412595
2180 * cfold.cs: Don't cast undefined bool constant.
2182 2008-07-29 Martin Baulig <martin@ximian.com>
2185 (SymbolWriter.Reset): New public static method.
2188 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2190 2008-07-28 Marek Safar <marek.safar@gmail.com>
2192 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2194 * expression.cs (ElementAccess): Exact size allocation.
2196 2008-07-26 Marek Safar <marek.safar@gmail.com>
2198 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2200 2008-07-25 Marek Safar <marek.safar@gmail.com>
2202 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2204 * class.cs: Removed $PRIVATE$ field hack which caused problems during
2207 2008-07-25 Marek Safar <marek.safar@gmail.com>
2209 A fix for bug #412217
2210 * assign.cs: Mutate also assignment type.
2212 2008-07-25 Marek Safar <marek.safar@gmail.com>
2214 A fix for bug #323644
2215 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2218 2008-07-25 Marek Safar <marek.safar@gmail.com>
2220 A fix for bug #412134
2221 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2222 non-enumerable operands when overloading equality or bitwise operators.
2224 2008-07-25 Marek Safar <marek.safar@gmail.com>
2226 * anonymous.cs: Cache closed generic anonymous method delegates.
2228 2008-07-24 Marek Safar <marek.safar@gmail.com>
2230 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
2231 anonymous.cs, statement.cs: Always emit anonymous method as static method
2232 when is instance free. Use nesting for nested anynomous methods blocks.
2234 2008-07-23 Marek Safar <marek.safar@gmail.com>
2236 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2239 2008-07-23 Marek Safar <marek.safar@gmail.com>
2241 * expression.cs: Removed MakeSimpleCall.
2243 2008-07-23 Marek Safar <marek.safar@gmail.com>
2245 A fix for bug #323012
2246 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2247 Base method implementing interface has to be public.
2249 2008-07-23 Marek Safar <marek.safar@gmail.com>
2251 * cs-parser.jay: Don't break on missing argument.
2253 2008-07-22 Marek Safar <marek.safar@gmail.com>
2255 A fix for bug #320993
2256 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2257 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2259 2008-07-22 Marek Safar <marek.safar@gmail.com>
2261 A fix for bug #320748
2262 * convert.cs: Implicit user operators cannot convert to interfaces
2264 2008-07-22 Marek Safar <marek.safar@gmail.com>
2266 A fix for bug #312686
2267 * driver.cs: Ignore empty assembly references.
2269 2008-07-22 Marek Safar <marek.safar@gmail.com>
2271 A fix for bug #387040
2272 * ecore.cs: Skip constrains check for an explicit implementation.
2274 2008-07-21 Marek Safar <marek.safar@gmail.com>
2276 A fix for bug #409045
2277 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2278 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2279 identifiers are file specific unless passed as input arguments.
2281 2008-07-21 Marek Safar <marek.safar@gmail.com>
2283 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2284 to emit UnmanagedMarshal data under 2.0 profile.
2286 2008-07-21 Marek Safar <marek.safar@gmail.com>
2288 A fix for bug #410369
2289 * parameter.cs: Clone correctly ParamsParameter.
2291 2008-07-21 Marek Safar <marek.safar@gmail.com>
2293 * expression.cs (Argument): Always report type for type based expressions
2296 2008-07-18 Marek Safar <marek.safar@gmail.com>
2298 A fix for bug #410666
2299 * anonymous.cs: Correctly initialize generic storey reference.
2301 2008-07-18 Marek Safar <marek.safar@gmail.com>
2303 * convert.cs: Don't box same type arguments.
2305 2008-07-18 Marek Safar <marek.safar@gmail.com>
2307 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2308 Finished missing generic type mutators.
2310 2008-07-18 Marek Safar <marek.safar@gmail.com>
2312 * iterators.cs, statement.cs: Finished statements CloneTo.
2314 2008-07-18 Marek Safar <marek.safar@gmail.com>
2316 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2318 * expression.cs: Emit optimized default value expressions in expression tree
2321 2008-07-18 Marek Safar <marek.safar@gmail.com>
2323 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2325 2008-07-17 Marek Safar <marek.safar@gmail.com>
2327 A fix for bug #367536
2328 * cs-parser.jay: Check static constructor of generic types for an access
2331 2008-07-17 Marek Safar <marek.safar@gmail.com>
2333 A fix for bug #353800
2334 * lambda.cs: Emit ret for contextual statements.
2336 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2337 up emitting redundant ret for all anonymous methods with return.
2339 2008-07-17 Marek Safar <marek.safar@gmail.com>
2341 A fix for bug #365188
2342 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2343 create anonymous method storey in unreachable block.
2345 2008-07-17 Marek Safar <marek.safar@gmail.com>
2347 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2348 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2349 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2350 statement.cs: Fixed relevant defects found by Gendarme.
2352 2008-07-17 Marek Safar <marek.safar@gmail.com>
2354 A fix for bug #325291
2355 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
2356 statement.cs: Replaced IAnonymousHost with top level block flag.
2358 2008-07-17 Marek Safar <marek.safar@gmail.com>
2360 * cs-parser.jay: Clean up unused open_parens.
2362 2008-07-17 Marek Safar <marek.safar@gmail.com>
2364 * ecore.cs: Custom error message for a range variable assignment.
2366 2008-07-16 Marek Safar <marek.safar@gmail.com>
2368 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2371 2008-07-16 Marek Safar <marek.safar@gmail.com>
2373 * literal.cs: Null literal is of object type.
2375 2008-07-16 Marek Safar <marek.safar@gmail.com>
2377 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2378 expression of nullable equality comparison.
2380 2008-07-15 Marek Safar <marek.safar@gmail.com>
2382 * expression.cs(PointerArithmetic): Removed redundant assignment.
2384 2008-07-15 Marek Safar <marek.safar@gmail.com>
2386 * decl.cs (GetSignatureForError): Report full namespace name for containers.
2388 2008-07-14 Marek Safar <marek.safar@gmail.com>
2390 A fix for bug #408361
2391 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2392 they are replaced by GetMethod.
2394 2008-07-14 Marek Safar <marek.safar@gmail.com>
2396 A fix for bug #408721 by jeremie.laval@gmail.com
2397 * expression.cs (Indirection): Implemented CloneTo.
2399 2008-07-14 Marek Safar <marek.safar@gmail.com>
2401 * statement.cs (AssignableSlots): Temporary disabled variable initialization
2404 2008-07-14 Marek Safar <marek.safar@gmail.com>
2406 * report.cs (EnableReporting): Don't reinitialize 0-based values.
2408 2008-07-11 Marek Safar <marek.safar@gmail.com>
2410 * linq.cs: Reset tranparent parameter counter in probing mode.
2412 2008-07-11 Marek Safar <marek.safar@gmail.com>
2414 * anonymous.cs: Mutate anonymous method type.
2416 2008-07-11 Marek Safar <marek.safar@gmail.com>
2418 * ecore.cs, anonymous.cs: Mutate field expressions.
2420 2008-07-10 Marek Safar <marek.safar@gmail.com>
2422 A fix for bug #369670
2423 * linq.cs, statement.cs: Use explicit block for query expressions variables.
2425 2008-07-10 Marek Safar <marek.safar@gmail.com>
2427 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2429 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
2432 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2433 only one '>', and finds a '>>', abort the generic lookahead.
2435 2008-07-10 Marek Safar <marek.safar@gmail.com>
2437 A fix for bug #319902
2438 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
2440 2008-07-10 Marek Safar <marek.safar@gmail.com>
2442 A fix for bug #406371
2443 * statement.cs: Moved EmitSymbolInfo to Block.
2445 2008-07-09 Marek Safar <marek.safar@gmail.com>
2447 * ecore.cs: Report better error for extension method overload failures.
2449 2008-07-09 Marek Safar <marek.safar@gmail.com>
2451 * expression.cs (Is): No need to box reference values.
2453 2008-07-09 Marek Safar <marek.safar@gmail.com>
2455 * class.cs: Use event resolve context when initializing CreateEmitContext.
2457 2008-07-09 Marek Safar <marek.safar@gmail.com>
2459 A fix for bug #394436
2460 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2461 method used inside expression trees. Added more LINQ to expression tree
2464 2008-07-08 Marek Safar <marek.safar@gmail.com>
2466 A fix for bug #378189, #370577
2467 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2470 2008-07-08 Marek Safar <marek.safar@gmail.com>
2472 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2475 2008-07-08 Marek Safar <marek.safar@gmail.com>
2477 A fix for bug #406702
2478 * anonymous.cs: Always park anonymous method in the nearest parent storey.
2480 2008-07-07 Marek Safar <marek.safar@gmail.com>
2482 A fix for bug #406648
2483 * cs-parser.jay: Report nullable use in mcs for some cases.
2485 2008-07-07 Marek Safar <marek.safar@gmail.com>
2487 * ecore.cs: Improved argument mismatch error messages.
2489 2008-07-07 Marek Safar <marek.safar@gmail.com>
2491 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2493 2008-07-07 Marek Safar <marek.safar@gmail.com>
2495 * expression.cs (TypeOf): Mutate type argument.
2497 2008-07-04 Marek Safar <marek.safar@gmail.com>
2499 * class.cs: Report missing partial modifier for correct type.
2501 2008-07-04 Marek Safar <marek.safar@gmail.com>
2503 * ecore.cs, expression.cs (VariableReference): Variable property is
2506 2008-07-04 Marek Safar <marek.safar@gmail.com>
2508 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2510 2008-07-04 Marek Safar <marek.safar@gmail.com>
2512 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2515 2008-07-04 Marek Safar <marek.safar@gmail.com>
2517 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2518 anonymous method storey to an instance method when only "this" is hoisted.
2520 2008-07-03 Marek Safar <marek.safar@gmail.com>
2522 A fix for bug #321615
2523 * expression.cs: Pointer comparisons use unsigned operator.
2525 2008-07-03 Marek Safar <marek.safar@gmail.com>
2527 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2529 2008-07-02 Marek Safar <marek.safar@gmail.com>
2531 A fix for bug #404905
2532 * class.cs: Always initialize local unsafe variables.
2534 2008-06-30 Marek Safar <marek.safar@gmail.com>
2536 A fix for bug #396987
2537 * expression.cs (NewInitialize): Clear local temporary variable for next run
2539 2008-06-27 Marek Safar <marek.safar@gmail.com>
2541 A fix for bug #401020
2542 * ecore.cs: Both types and modifiers have to match for ref and out arguments
2544 2008-06-27 Marek Safar <marek.safar@gmail.com>
2546 A fix for bug #398319
2547 * cs-parser.jay: Implemented undocumented base access expression inside
2550 2008-06-26 Marek Safar <marek.safar@gmail.com>
2552 A fix for bug #404227
2553 * cs-parser.jay: Parse namespace declaration using qualified identifier.
2555 2008-06-26 Marek Safar <marek.safar@gmail.com>
2557 A fix for bug #404227
2558 * convert.cs: Fixed explicit array to interface cast.
2560 2008-06-26 Marek Safar <marek.safar@gmail.com>
2562 A fix for bug #403894
2563 * delegate.cs: Mutate DelegateInvocation type.
2565 2008-06-26 Marek Safar <marek.safar@gmail.com>
2567 A fix for bug #379348
2568 * delegate.cs: Box a load of generic parameters.
2570 2008-06-26 Marek Safar <marek.safar@gmail.com>
2572 * expression.cs: Add an array creation arguments mutate.
2574 2008-06-26 Marek Safar <marek.safar@gmail.com>
2576 A fix for bug #386068
2577 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2580 2008-06-25 Marek Safar <marek.safar@gmail.com>
2582 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2585 2008-06-25 Marek Safar <marek.safar@gmail.com>
2587 A fix for bug #403518
2588 * delegate.cs: Type correctly anonymous method new invocation.
2590 2008-06-24 Marek Safar <marek.safar@gmail.com>
2592 A fix for bug #394826
2593 * anonymous.cs: Fully qualify members when resolving anonymous type internal
2596 2008-06-24 Marek Safar <marek.safar@gmail.com>
2598 A fix for bug #394826
2599 * anonymous.cs, iterators.cs: Construct generic storey only when is really
2602 2008-06-24 Marek Safar <marek.safar@gmail.com>
2604 * class.cs: Clone indexer parameters for localized capturing.
2606 2008-06-24 Marek Safar <marek.safar@gmail.com>
2608 A fix for bug #402379
2609 * expression.cs: Don't crash when an object initializer resolve fails.
2611 2008-06-24 Marek Safar <marek.safar@gmail.com>
2613 A fix for bug #402888
2614 * expression.cs: Mutate conditional expression.
2616 2008-06-24 Marek Safar <marek.safar@gmail.com>
2618 A fix for bug #401012
2619 * class.cs: Keep StructLayout in shared container.
2621 2008-06-24 Marek Safar <marek.safar@gmail.com>
2623 A fix for bug #400438
2624 * decl.cs, class.cs: Only properties can be automatically implemented.
2626 2008-06-24 Marek Safar <marek.safar@gmail.com>
2628 * statement.cs (ChangeToIterator): Copy also labels.
2630 2008-06-23 Marek Safar <marek.safar@gmail.com>
2632 * ecore.cs: Pass type argument details to parent extension method.
2634 2008-06-23 Marek Safar <marek.safar@gmail.com>
2636 A fix for bug #375966
2637 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2639 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
2641 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2643 2008-06-22 Marek Safar <marek.safar@gmail.com>
2645 A fix for bug #394347
2646 * anonymous.cs: Cache compatible delegates as compatibility check produces
2647 a new method every time.
2649 2008-06-20 Marek Safar <marek.safar@gmail.com>
2651 * anonymous.cs: Propagate storey reference for single references.
2653 2008-06-20 Marek Safar <marek.safar@gmail.com>
2655 A fix for bug #387615
2656 * assign.cs, expression.cs: Correctly clone compound assignment.
2658 2008-06-19 Marek Safar <marek.safar@gmail.com>
2660 A fix for bug #359611, #359604
2661 * anonymous.cs: Mutate all types of hoisted parameters.
2663 2008-06-19 Marek Safar <marek.safar@gmail.com>
2665 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2666 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2667 expression.cs, codegen.cs, statement.cs
2669 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2670 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2672 ** Anonymous methods, lambda expressions rewrite **
2674 Anonymous expressions are now resolved when an explicit block is resolved
2675 and they don't require any registration procedure anymore. Further,
2676 anonymous methods are defined when explicit block is emitted which allows
2677 better control of whole process and opens possibilities for more
2678 optimizations as well as alternative to reverse whole process.
2680 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2681 process consistent and to correctly emit hoisted generic methods when they
2682 have at least 1 hoisted variable.
2684 2008-06-17 Martin Baulig <martin@ximian.com>
2686 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2688 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2689 virtual property; check it in Emit().
2690 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2692 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2694 (Indexer.Define): Likewise.
2696 2008-06-17 Marek Safar <marek.safar@gmail.com>
2698 * convert.cs: Don't use IsInterface on type arguments.
2700 * delegate.cs: DelegateInvocation uses MethodInfo.
2702 * parameter.cs: Removed IsTypeParameter.
2704 * generic-mcs.cs: More missing stuff.
2706 2008-06-16 Martin Baulig <martin@ximian.com>
2709 (Modifiers.DEBUGGER_HIDDEN): New public const.
2712 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2715 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2716 (AbstractPropertyEventMethod): Likewise.
2717 (Constructor.Emit): Likewise.
2718 (SourceMethod.SetCompilerGenerated): Removed.
2720 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2724 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2725 if we're an `IteratorHost'.
2726 (AnonymousMethodMethod..ctor): Don't set
2727 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2730 2008-06-16 Marek Safar <marek.safar@gmail.com>
2732 * statement.cs: Clean-up foreach statements.
2734 2008-06-12 Marek Safar <marek.safar@gmail.com>
2736 * class.cs: Stop using public method which should not exist
2737 (MethodBuilder.SetGenericMethodSignature).
2739 2008-06-11 Martin Baulig <martin@ximian.com>
2742 (Location.LookupFile): Add `CompilationUnit' argument; when given
2743 a relative file name, make it relative to the directory the .cs
2744 file is located in instead of using the current directory.
2746 2008-06-11 Martin Baulig <martin@ximian.com>
2749 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2750 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2751 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2752 (SourceMethod.SetCompilerGenerated): Likewise.
2754 2008-06-11 Marek Safar <marek.safar@gmail.com>
2756 * codegen.cs, driver: Only write symbol file when it's asked for.
2758 2008-06-11 Marek Safar <marek.safar@gmail.com>
2760 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2762 2008-06-10 Martin Baulig <martin@ximian.com>
2764 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2766 2008-06-09 Marek Safar <marek.safar@gmail.com>
2768 A fix for bug #316290
2769 * expression.cs: Include decimal operators in predefined table.
2771 * parameters.cs: More readonlyness.
2773 2008-06-09 Marek Safar <marek.safar@gmail.com>
2775 A fix for bug #397213
2776 * cs-parser.jay: One more missing current_local_parameters reset.
2778 2008-06-09 Marek Safar <marek.safar@gmail.com>
2780 A fix for bug #396633
2781 * class.cs: Host backing field in partial container.
2783 2008-06-09 Marek Safar <marek.safar@gmail.com>
2785 A fix for bug #397068
2786 * expression.cs: Check both operand types when predefined operator is used.
2788 2008-06-05 Martin Baulig <martin@ximian.com>
2790 Merged the `debugger-kahalo' branch.
2793 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2794 we're an iterator method.
2795 (SourceMethod): Reflect latest symbol writer changes;
2796 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2797 now `start_row' and `end_row'.
2798 (Constructor.Emit): Fix the logic whether to emit symbol information.
2800 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2804 (CompilationUnit): New public class; derives from `SourceFile'.
2805 (SourceFileEntry.DefineSymbolInfo): New public method.
2806 (SourceFileEntry.SetChecksum): New public method.
2807 (Location): Encode hidden line numbers by using `column == 255';
2808 the .ctor now accepts `column == -1' to mark a hidden line number.
2809 (Location.Hidden): New public property.
2810 (Location.CheckPoint): Add `CompilationUnit'.
2811 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2812 (Location.Push): Add `CompilationUnit compile_unit' argument.
2813 (Location.CompilationUnit): New public property.
2816 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2818 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2820 * driver.cs: `SourceFile' -> `CompilationUnit'.
2822 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2824 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2826 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2830 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2831 new symbol writer API to also pass the file.
2833 2008-06-05 Marek Safar <marek.safar@gmail.com>
2835 * statement.cs: Emit catch variable assignment using variable expression.
2837 2008-06-05 Marek Safar <marek.safar@gmail.com>
2839 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2840 with other variable types.
2842 2008-06-04 Marek Safar <marek.safar@gmail.com>
2844 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2845 GetLength method emit, it breaks resolve rules.
2847 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2848 Marek Safar <marek.safar@gmail.com>
2850 A fix for bug #395542
2851 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2854 2008-06-02 Marek Safar <marek.safar@gmail.com>
2856 A fix for bug #395287
2857 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2859 2008-05-31 Marek Safar <marek.safar@gmail.com>
2861 A fix for bug #395845
2862 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2863 non-nullable parameter type.
2865 2008-05-31 Marek Safar <marek.safar@gmail.com>
2867 * class.cs: Handle contructor initializer as a statement in top-level block.
2869 2008-05-30 Marek Safar <marek.safar@gmail.com>
2871 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2872 security attributes.
2874 2008-05-24 Marek Safar <marek.safar@gmail.com>
2876 * ecore.cs, expression.cs: Small IVariable refactoring.
2878 2008-05-22 Marek Safar <marek.safar@gmail.com>
2880 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2882 2008-05-21 Marek Safar <marek.safar@gmail.com>
2884 * cs-parser.jay: Removed redundant catch type check.
2886 2008-05-21 Marek Safar <marek.safar@gmail.com>
2888 A fix for bug #390372
2889 * nullable.cs: Set correct return type.
2891 2008-05-21 Marek Safar <marek.safar@gmail.com>
2893 A fix for bug #391062
2894 * typemanager.cs: Fixed crash when comparing null types.
2896 2008-05-21 Marek Safar <marek.safar@gmail.com>
2898 A fix for bug #391871
2899 * cs-parser.jay: Better error handling for invalid catch type.
2901 2008-05-20 Marek Safar <marek.safar@gmail.com>
2903 A fix for bug #392155
2904 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2906 2008-05-15 Marek Safar <marek.safar@gmail.com>
2908 A fix for bug #390666
2909 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2912 2008-05-15 Marek Safar <marek.safar@gmail.com>
2914 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2917 2008-05-13 Marek Safar <marek.safar@gmail.com>
2919 A fix for bug #389625
2920 * delegate.cs, generic.cs: Some progress on method group return type
2923 2008-05-13 Marek Safar <marek.safar@gmail.com>
2925 A fix for bug #378419
2926 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2928 2008-05-12 Marek Safar <marek.safar@gmail.com>
2930 * class.cs (Constructor): Added IsCompilerGenerated.
2932 2008-05-12 Marek Safar <marek.safar@gmail.com>
2934 * expression.cs: Enum binary operators can accept non-enum operand only when
2935 is implicitly convertible to underlying type.
2937 2008-05-12 Marek Safar <marek.safar@gmail.com>
2939 A fix for bug #389272
2940 * support.cs: Workaround System.InvalidOperationException for enums.
2942 2008-05-12 Marek Safar <marek.safar@gmail.com>
2944 A fix for bug #389073
2945 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2947 2008-05-10 Marek Safar <marek.safar@gmail.com>
2949 * driver.cs: Split Parse.
2951 * location.cs (LookupFile): Uses string.Empty.
2953 2008-05-07 Marek Safar <marek.safar@gmail.com>
2955 * expression.cs, parameter.cs: Small ParameterReference clean up.
2957 2008-05-07 Marek Safar <marek.safar@gmail.com>
2959 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2960 hack. Fixes #387502.
2962 2008-05-06 Martin Baulig <martin@ximian.com>
2964 * class.cs (Constructor.Emit): Fix the logic whether to emit
2967 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2970 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2971 InvalidOperationException when the iterator is before the start or
2974 2008-05-06 Marek Safar <marek.safar@gmail.com>
2976 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2977 when left is nullable type.
2979 2008-05-06 Marek Safar <marek.safar@gmail.com>
2981 A fix for bug #386628
2982 * expression.cs (LocalVariableReference): Continue in resolving when
2983 variable is not assigned.
2985 2008-05-05 Marek Safar <marek.safar@gmail.com>
2987 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2988 nullable operations.
2990 2008-05-04 Marek Safar <marek.safar@gmail.com>
2992 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2993 it saves many redundant temporary variables for nullable operations.
2995 2008-05-03 Marek Safar <marek.safar@gmail.com>
2997 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2999 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
3002 * nullable.cs: Constant coalescing operator optimizations.
3004 2008-05-03 Marek Safar <marek.safar@gmail.com>
3006 * constant.cs: Use unsigned conversion for values which are unsigned only.
3008 2008-05-03 Marek Safar <marek.safar@gmail.com>
3010 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
3011 coalescing operator as it should be.
3013 2008-05-02 Marek Safar <marek.safar@gmail.com>
3015 A fix for bug #371016
3016 * expression.cs: All predefined delegate operators require implicit method
3019 2008-05-02 Marek Safar <marek.safar@gmail.com>
3021 * constant.cs: Emit long constant as uint when fits the range.
3023 * convert.cs, expression.cs: Fixed few unsafe conversions.
3025 2008-05-02 Marek Safar <marek.safar@gmail.com>
3027 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
3029 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
3032 * convert.cs (ImplicitNumericConversion): Don't modify the type of
3034 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
3036 2008-05-01 Marek Safar <marek.safar@gmail.com>
3038 * constant.cs, literal.cs: IsLiteral property for error reporting.
3040 * ecore.cs, expression.cs: Implemented Property expression.
3042 2008-05-01 Marek Safar <marek.safar@gmail.com>
3044 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
3046 * nullable.cs: Implemented nullable coalescing null operator.
3048 * ecore.cs, expression.cs: Expression trees work.
3050 2008-05-01 Marek Safar <marek.safar@gmail.com>
3052 * ecore.cs: CreateExpressionTree is finally abstract.
3054 * expression.cs, linq.cs: Updated.
3056 2008-05-01 Marek Safar <marek.safar@gmail.com>
3058 * expression.cs, ecore.cs: Block base access expression inside expression
3061 2008-05-01 Marek Safar <marek.safar@gmail.com>
3063 A fix for bug #385058
3064 * expression.cs: User-defined operator implementations always take
3065 precedence over predefined operator implementations.
3067 2008-04-30 Marek Safar <marek.safar@gmail.com>
3069 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
3070 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
3071 expression tree conversions.
3073 2008-04-30 Marek Safar <marek.safar@gmail.com>
3075 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
3076 operators method details to Operator class.
3078 2008-04-30 Marek Safar <marek.safar@gmail.com>
3080 * anonymous.cs: Pass unsafe flags to anonymous container.
3082 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
3083 inside expression tree.
3085 2008-04-29 Martin Baulig <martin@ximian.com>
3087 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
3088 (Tokenizer.PopPosition): Also restore the `line'.
3090 2008-04-29 Marek Safar <marek.safar@gmail.com>
3092 * delegate.cs: Implemented Invoke expression.
3094 2008-04-29 Marek Safar <marek.safar@gmail.com>
3096 * expression.cs: Fixed equality reference comparison regression.
3098 2008-04-29 Marek Safar <marek.safar@gmail.com>
3100 * ecore.cs: Clean up EmptyCast hack.
3102 * expression.cs, nullable.cs: Implemented enum binary and unary operations
3103 using correct conversion rules. Also fixes #383993.
3105 2008-04-28 Martin Baulig <martin@ximian.com>
3107 * class.cs (Constructor.Emit): Don't emit debugging information
3108 for generated default .ctor's.
3110 2008-04-28 Marek Safar <marek.safar@gmail.com>
3112 * convert.cs: Empty-cast ushort to int conversion.
3114 2008-04-28 Marek Safar <marek.safar@gmail.com>
3116 A fix for bug #384191
3117 * ecore.cs, expression.cs: Fixed expression cloning.
3119 2008-04-28 Marek Safar <marek.safar@gmail.com>
3121 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3123 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
3125 Fix #381559, test-638.cs, test-639.cs
3126 * assign.cs (CompoundAssign.Helper): New wrapper.
3127 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3129 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3130 Pass unconverted expressions to the params array creation expression.
3131 (FieldExpr.EmitAssign): Don't special-case StringConcat.
3132 (PropertyExpr.EmitAssign): Likewise.
3133 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3134 element if it is of kind CompoundAssign.Helper.
3135 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3136 first before anything else.
3137 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3138 (ArrayAccess.LoadArrayAndArguments): Simplify.
3140 2008-04-27 Marek Safar <marek.safar@gmail.com>
3142 * expression.cs: Fixed cloning of typeof(void).
3144 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
3146 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3147 (Assign.Emit): Likewise. Move it to ...
3148 (CompoundAssign.DoResolve): ... here and ...
3149 (CompoundAssign.Emit): ... here.
3150 (EventAddOrRemove): New helper to handle += and -= on events, and
3151 avoid the use of BinaryDelegates.
3152 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3153 (EventExpr.EmitAddOrRemove): Improve.
3154 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3156 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3157 create VarExprs for 'foo.bar.var'.
3158 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3159 is a highly inappropriate name for its functionality.
3161 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3163 Simplify handling of multiple assignments
3164 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
3166 (SimpleAssign): New. Class to be used for normal assignments.
3167 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3168 * expression.cs, parameter.cs, statement.cs: Likewise.
3170 2008-04-25 Marek Safar <marek.safar@gmail.com>
3172 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3173 for incompatible underlying types, more to come, uff.
3175 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3178 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3179 Handle 'leave_copy'.
3181 2008-04-25 Marek Safar <marek.safar@gmail.com>
3183 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3185 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
3187 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
3188 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3189 * statement.cs (While, Do, For): Allow test to have side effects.
3190 (For.DoEmit): Always emit InitStatement.
3193 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3194 Always create SideEffectConstant.
3195 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3196 of type EnumConstant.
3198 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3199 Handle 'right' being SideEffectConstant of type 'bool'.
3201 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3202 Use left.EmitBranchable instead of open coding it, so as to
3203 improve optimization opportunities.
3205 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3207 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3209 (Expression.EmitSideEffect): Document.
3211 2008-04-23 Marek Safar <marek.safar@gmail.com>
3213 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3215 2008-04-23 Marek Safar <marek.safar@gmail.com>
3217 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3219 2008-04-23 Marek Safar <marek.safar@gmail.com>
3221 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3222 conversion to expression tree.
3224 2008-04-23 Marek Safar <marek.safar@gmail.com>
3226 * ecore.cs: Removed unused expression.
3228 2008-04-22 Marek Safar <marek.safar@gmail.com>
3230 * expression.cs: Implemented NegateChecked and New expressions.
3232 2008-04-22 Marek Safar <marek.safar@gmail.com>
3234 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3236 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
3239 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3240 needing final 'ret' instruction.
3242 2008-04-22 Marek Safar <marek.safar@gmail.com>
3244 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3246 2008-04-21 Marek Safar <marek.safar@gmail.com>
3248 * expression.cs: Emit ldnull and not null expression as an instance argument
3249 of static method expression calls.
3251 2008-04-21 Marek Safar <marek.safar@gmail.com>
3253 A fix for bug #378200
3254 * expression.cs: Fixed crash when creating parameterless expression tree
3257 2008-04-21 Marek Safar <marek.safar@gmail.com>
3259 A fix for bug #375297
3260 * anonymous.cs: Fixed crash when inferring from null argument anonymous
3263 2008-04-21 Marek Safar <marek.safar@gmail.com>
3265 A fix for bug #377596
3266 * decl.cs, class.cs: Emit delegate type argument attributes.
3268 2008-04-21 Marek Safar <marek.safar@gmail.com>
3270 A fix for bug #365314
3271 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3273 2008-04-21 Marek Safar <marek.safar@gmail.com>
3275 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3278 2008-04-21 Marek Safar <marek.safar@gmail.com>
3280 * generic.cs (TypeParameter): Removed redundant location.
3282 2008-04-19 Marek Safar <marek.safar@gmail.com>
3284 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3285 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3286 FullNamedExpression in all declaration type expression, statements will come
3289 2008-04-18 Marek Safar <marek.safar@gmail.com>
3291 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3292 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3294 2008-04-18 Marek Safar <marek.safar@gmail.com>
3296 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3299 2008-04-17 Marek Safar <marek.safar@gmail.com>
3301 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3304 2008-04-17 Marek Safar <marek.safar@gmail.com>
3306 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3310 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
3312 Hook up 'EmitSideEffect'
3313 * constant.cs (Constant.EmitSideEffect): New.
3314 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
3315 (SideEffectConstant.EmitSideEffect): New.
3316 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
3317 unconditional branch in EmitBranchable.
3318 (FieldExpr.EmitBranchable): New.
3319 * expression.cs (Unary.EmitSideEffect): New.
3320 (Binary.EmitSideEffect): New.
3321 (VariableReference.EmitSideEffect): New. Do nothing.
3323 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3325 Introduce 'EmitSideEffect'
3326 * ecore.cs (Expression.EmitSideEffect): New.
3327 (TypeCast): Rename from EmptyCast.
3329 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3330 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3331 * convert.cs, nullable.cs: Update to changes.
3333 2008-04-16 Marek Safar <marek.safar@gmail.com>
3335 * class.cs, cs-parser.jay: Early check for base types expression.
3337 2008-04-16 Marek Safar <marek.safar@gmail.com>
3339 * decl.cs (MemberName): Declare PrettyName as obsolete.
3341 2008-04-16 Marek Safar <marek.safar@gmail.com>
3343 * namespace.cs: Use MemberName comparison.
3345 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3348 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
3350 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3351 (MemberName.FullyQualifiedName): New. Provides the functionality
3352 that users assume FullName would have.
3353 * ecore.cs, namespace.cs: Update to changes.
3355 * statement.cs (Using.assign): Make into ExpressionStatement.
3356 (Using.EmitPreTryBody): Simplify.
3358 2008-04-16 Marek Safar <marek.safar@gmail.com>
3360 * report.cs: ColorFormat is protected.
3362 * rootcontext.cs: Unused fields clean-up.
3364 * namespace.cs: Made UsingEntry name private.
3366 2008-04-16 Marek Safar <marek.safar@gmail.com>
3368 * cs-tokenizer.cs, location.cs: Removed unused field.
3370 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
3371 Raja R Harinath <harinath@hurrynot.org>
3374 * constant.cs (SideEffectConstant.value): Rename from 'left'.
3375 (SideEffectConstant.side_effect): Rename from 'right'.
3376 (SideEffectConstant..ctor): Normalize 'side_effect'.
3377 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3378 value of this constant.
3379 * cfold.cs: Update to changes.
3381 2008-04-15 Marek Safar <marek.safar@gmail.com>
3383 * cs-paser.jay: Removed unused variable.
3385 * driver.cs: Made Compile instance method.
3387 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
3389 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3391 2008-04-15 Marek Safar <marek.safar@gmail.com>
3393 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
3395 2008-04-13 Jb Evain <jbevain@novell.com>
3397 * namespace.cs: update the System.Core fullname for 2.1
3398 * driver.cs: update the list of required assemblies for 2.1.
3399 Merged from the Moonlight 2 branch.
3401 2008-04-11 Marek Safar <marek.safar@gmail.com>
3403 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3404 types and user defined operators. User operators arguments has to be checked
3405 for null value before invocation, which also means no operator is called
3406 when any argument is not convertible to unwrapped nullable type.
3408 2008-04-09 Marek Safar <marek.safar@gmail.com>
3410 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3411 of Unary expressions to follow operator overloading rules precisely.
3412 Also fixes #321794, #323794
3414 2008-04-08 Marek Safar <marek.safar@gmail.com>
3416 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3419 2008-04-08 Marek Safar <marek.safar@gmail.com>
3421 * expression.cs, ecore.cs: Implemented MemberInit expression.
3423 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
3425 Fix mono/tests/exception4.cs
3426 * statement.cs (ExceptionStatement, TryCatch): Revert to using
3427 ec.NeedReturnLabel () rather emitting a 'nop'.
3429 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3431 (TryCatch.SomeCodeFollows): Likewise.
3432 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3433 for 'break', 'continue' and 'return' statements inside a try.
3434 We're fairly sure that the generated IL stream will have more
3435 instructions textually following the try.
3436 (FlowBranchingTryCatch): Likewise.
3438 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3439 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3442 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3443 wrapper -- forward everything to CollectionForeach.
3444 (CollectionForeach.NonDisposableWrapper): New.
3445 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3446 instead of a pop + branch to end.
3448 2008-04-07 Marek Safar <marek.safar@gmail.com>
3450 A fix for bug #377485
3451 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
3452 Propagate location for extension method groups. Report conversion failure at
3455 2008-04-07 Marek Safar <marek.safar@gmail.com>
3457 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3458 ListInit and Field expressions.
3460 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
3462 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3463 Since $PC is always -1 inside the body of MoveNext, the fault
3465 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3466 * statement.cs (ExceptionStatement.emit_finally): Likewise.
3467 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3469 The denouement! Fix #324708
3470 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3471 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3472 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3473 'finally' inside the finally clause.
3475 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3476 inside an iterator. Don't emit the body of the 'finally' inside
3477 the finally clause yet.
3479 Use the ResumableStatement infrastructure for MoveNext ()
3480 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3481 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
3482 'old_resume_points'. Move dispatcher upfront.
3483 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3484 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3485 in an enumerator. This encodes the main fix in this patch series
3486 -- we can only jump into the first instruction of a try from the
3487 outside, but we want to emit try/finally regions in iterators and
3488 resume in the middle of them.
3490 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
3492 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3493 of NeedReturnLabel here.
3495 Introduce a common point for emitting try/finally to IL
3496 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
3497 features of the various subclasses, which are now driven by ...
3498 (ExceptionStatement.EmitPreTryBody): ... this and ...
3499 (ExceptionStatement.EmitTryBody): ... this and the original
3501 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3502 Remove DoEmit and update to follow above protocol.
3504 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3505 of the dispatcher are the same, skip emitting the 'switch'.
3506 * iterator.cs (Iterator.EmitDispose): Update to changes.
3508 Clean up handling of 'using' statement
3509 * statement.cs (UsingTemporary): New. Carved out of ...
3510 (Using): ... this. Simplify drastically. Handle exactly
3512 * cs-parser.jay (using_statement): Split. Create UsingTemporary
3513 or Using as appropriate. If there are multiple variable declared,
3514 create nested Using statements.
3515 (resource_acquisition): Kill.
3517 * statement.cs (ExceptionStatement.EmitForDispose): Use
3518 EmitFinallyBody, not EmitFinally.
3520 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3521 * iterator.cs: Update to changes.
3523 Start using the ResumableStatement infrastructure
3524 * statement.cs (ResumeableStatement.PrepareForDispose): New.
3525 (ResumableStatement.EmitForDispose): New.
3526 (ExceptionStatement): Override them.
3527 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3528 EmitForDispose to create the body of the Dispose method. Don't
3531 * iterator.cs (Iterator.AddResumePoint): Move here from ...
3532 * statement.cs (Toplevel.AddResumePoint): ... here.
3533 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3534 * flowanalysis.cs (FlowBranchingIterator): New.
3535 * codegen.cs (EmitContext): Update to changes.
3537 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3538 (Iterator.old_resume_points): Rename from 'resume_points'.
3539 (Iterator.MoveNextStatement): Remove unused class.
3541 New infrastructure for try/finally in iterators (still unused)
3542 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3543 (FlowBranchingToplevel.AddResumePoint): Hook into
3544 ToplevelBlock.AddResumePoint.
3545 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3546 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3547 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
3548 resume points and assign program-counter values.
3549 (ExceptionBlock.AddResumePoint): Collect resume points for
3550 de-muxer at the top of try block.
3551 * iterators.cs (Yield.CheckContext): Simplify.
3552 (Yield.Resolve): Use FlowBranching.AddResumePoint.
3554 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
3556 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3557 argument to an ExitStatement.
3558 (FlowBranchingException): Refactor saved origins code.
3559 * statement.cs (ExitStatement): Update to cahges.
3560 * iterator.cs (YieldBreak): Likewise.
3562 * statement.cs (ResumableStatement): New. Common base class for
3563 YieldReturn and ExceptionStatement.
3564 (ExitStatement): New. Common base class for Return and YieldBreak.
3565 (Return): Update to changes.
3566 * iterator.cs (YieldBreak): Likewise.
3567 * lambda.cs (ContextualReturn): Likewise.
3570 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3571 emit a meaningful error message.
3573 Fix #324765, #319508
3574 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3575 (VariableInfo.SetAssigned): Set it.
3576 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3577 determine if CS0219 or CS0168 is appropriate. Don't use
3578 flow-analysis information.
3579 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3580 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
3581 (EmitContext.EndFlowBranching): ... this.
3583 2008-04-03 Marek Safar <marek.safar@gmail.com>
3585 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3587 2008-04-03 Marek Safar <marek.safar@gmail.com>
3589 A fix for bug #376508
3590 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3591 ImplicitConversionExists.
3593 2008-04-03 Marek Safar <marek.safar@gmail.com>
3595 * expression.cs (Binary): Added remaining binary operators to expression
3598 * nullable.cs: Optimize shift with null argument.
3600 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
3602 Fix minor IL regression
3603 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3604 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3605 * cs-parser.jay (try_statement): Update to changes.
3607 * statement.cs (TryFinally.need_exc_block): Delete.
3608 (TryFinally): Update to changes.
3610 Now all ExceptionStatements are unconditional
3611 * statement.cs (CollectionForeach.DisposableWrapper): New.
3612 Extract out the try/finally code into a new wrapper.
3613 (CollectionForeach.Resolve): Use it to simplify the code.
3615 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
3617 Start at simplifying ExceptionStatement semantics a bit
3618 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3619 * cs-parser.jay (try_statement): Update to changes.
3620 (opt_catch_clauses): Remove.
3621 * flowanalysis.cs: Update to changes.
3622 (FlowBranching.BranchingType.TryCatch): New.
3623 (FlowBranchingTryCatch): New.
3625 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3626 (FlowBranching.CreateBranching): Update to changes.
3627 (FlowBranchingBlock.AddSibling): Add sanity check.
3628 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3631 * iterators.cs (Iterator.MarkFinally): Remove.
3632 * statement.cs (ExceptionStatement): Update to changes.
3634 Add support for skipping over finally blocks at runtime. First
3635 in a series to fix #324708
3636 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3637 (Iterator.EmitMoveNext): Initialize it.
3638 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3639 branch over the body of the 'finally' clause.
3641 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
3643 Avoid lopsided use of Foo/DoFoo names
3644 * statement.cs (ExpressionStatement.EmitFinallyBody):
3645 Rename from EmitFinally.
3646 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3647 * iterator.cs: Update to changes.
3649 2008-04-02 Marek Safar <marek.safar@gmail.com>
3651 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3652 based on UserOperatorCall. More binary nullable operators clean up.
3654 2008-04-02 Martin Baulig <martin@ximian.com>
3656 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3658 2008-04-02 Marek Safar <marek.safar@gmail.com>
3660 * nullable.cs: Merge user and empty conversions when lifting expression
3663 * expression.cs (StringConcat): Implemented expression tree representation.
3665 2008-04-01 Marek Safar <marek.safar@gmail.com>
3667 * nullable.cs: When lifting null literal and a user operator exists, no call
3670 2008-04-01 Marek Safar <marek.safar@gmail.com>
3672 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3675 2008-04-01 Marek Safar <marek.safar@gmail.com>
3677 * nullable.cs, expression.cs: Use namespace instead heavily nested
3678 monster abstract class.
3680 2008-04-01 Marek Safar <marek.safar@gmail.com>
3682 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3683 lifting of null literal and user operators. Clean up of some temporary
3686 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3688 Fix #368224, test-629.cs
3689 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3690 if it crossed an unwind-protect boundary.
3691 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3692 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3693 inside an unwind-protected region.
3694 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3695 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3696 'leave' instead of a 'br' if unwind-protected.
3697 (Iterator.EmitYieldBreak): Likewise.
3699 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3701 * driver.cs: Only define versioninfo resources if no win32 resource
3704 2008-03-28 Marek Safar <marek.safar@gmail.com>
3706 A fix for bug #372375
3707 * convert.cs: Fixed boxing of nullable types.
3709 2008-03-28 Marek Safar <marek.safar@gmail.com>
3711 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3714 2008-03-28 Marek Safar <marek.safar@gmail.com>
3716 A fix for bug #374619
3717 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3719 2008-03-27 Marek Safar <marek.safar@gmail.com>
3721 * lambda.cs: Check return type only for invocation.
3723 2008-03-27 Marek Safar <marek.safar@gmail.com>
3725 A fix for bug #374214
3726 * ecore.cs: Correctly report argument type mismatch.
3728 2008-03-27 Marek Safar <marek.safar@gmail.com>
3730 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3731 and not rely on broken IsEnum.
3733 2008-03-27 Marek Safar <marek.safar@gmail.com>
3735 * nullable.cs: New file, extracted from generic.cs.
3737 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3739 2008-03-27 Marek Safar <marek.safar@gmail.com>
3741 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3742 predefined comparison operators and null literals.
3744 * report.cs: New warning ID.
3746 2008-03-25 Marek Safar <marek.safar@gmail.com>
3748 A fix for bug #370577
3749 * lambda.cs: Check return type too.
3751 2008-03-25 Marek Safar <marek.safar@gmail.com>
3753 A fix for bug #372846
3754 * class.cs: Automatic properties can be declared as unsafe.
3756 2008-03-20 Marek Safar <marek.safar@gmail.com>
3758 * location.cs: Use string based concatenation.
3760 * expression.cs: LiftedBinaryOperator is gmcs only.
3762 2008-03-20 Marek Safar <marek.safar@gmail.com>
3764 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3765 conversions rules and expression trees.
3767 2008-03-19 Marek Safar <marek.safar@gmail.com>
3769 * delegate.cs: Use extension method source as delegate target.
3771 2008-03-19 Marek Safar <marek.safar@gmail.com>
3773 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3774 binary operations to be purely based on binary operations and optimized
3775 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3776 and other ET refactoring.
3778 * typemanager.cs: Fixed warning.
3780 2008-03-17 Marek Safar <marek.safar@gmail.com>
3782 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3784 * symbolwriter.cs: Fixed.
3786 2008-03-17 Marek Safar <marek.safar@gmail.com>
3788 * anonymous.cs, driver.cs: Reset anonymous types counters.
3790 2008-03-17 Marek Safar <marek.safar@gmail.com>
3792 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3794 * class.cs: Use fullname for all type member definitions.
3796 2008-02-19 Martin Baulig <martin@ximian.com>
3799 (IMethodData.EmitExtraSymbolInfo): New interface method.
3800 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3801 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3802 interface method here as an empty public virtual method.
3805 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3806 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3807 CodeGen.SymbolWriter.SetRealMethodName().
3809 2008-02-18 Martin Baulig <martin@ximian.com>
3812 (ScopeInfo.EmitType): Override this and emit debugging
3813 information for captured variables.
3814 (RootScopeInfo.EmitType): Override this and emit symbol
3815 information for a captured `this'.
3817 2008-02-15 Martin Baulig <martin@ximian.com>
3819 * iterators.cs: Emit debugging info.
3822 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3823 (EmitContext.OmitDebuggingInfo): New public property.
3826 (While): Override Emit() and don't emit symbol info there; do it
3827 inside DoEmit() instead.
3828 (Block.Emit): Omit symbol information while emitting the scope
3829 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3831 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3832 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3833 .ctor to make `IsIterator' work.
3835 2008-03-14 Martin Baulig <martin@ximian.com>
3837 * symbolwriter.cs: Added the new symbol writer function from the
3838 debugger's `terrania' branch; temporarily enclose them inside
3839 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3842 2008-03-14 Martin Baulig <martin@ximian.com>
3845 (SymbolWriter): Make this a public static class.
3848 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3849 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3851 2008-03-14 Marek Safar <marek.safar@gmail.com>
3853 A fix for bug #370577
3854 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3857 2008-03-14 Marek Safar <marek.safar@gmail.com>
3859 * typemanager.cs (CSharpName): Made 250 times faster.
3861 2008-03-13 Marek Safar <marek.safar@gmail.com>
3863 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3865 2008-03-12 Marek Safar <marek.safar@gmail.com>
3867 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3868 crash when predefined field does not exist.
3870 2008-03-12 Marek Safar <marek.safar@gmail.com>
3872 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3874 2008-03-12 Marek Safar <marek.safar@gmail.com>
3876 * class.cs (FixedField): Don't crash when contructors are missing.
3878 2008-03-11 Marek Safar <marek.safar@gmail.com>
3880 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3881 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3882 check internal types accessibility for internal and external types.
3883 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3885 2008-03-11 Marek Safar <marek.safar@gmail.com>
3887 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3888 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3889 attribute.cs, statement: Use corect instance of predefined types (work
3890 related to #364674).
3892 2008-03-07 Marek Safar <marek.safar@gmail.com>
3894 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3896 2008-03-07 Marek Safar <marek.safar@gmail.com>
3898 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3899 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3900 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3901 predefined types clean up, delayed predefined types members initialization
3902 (work related to #364674).
3904 2008-03-05 Marek Safar <marek.safar@gmail.com>
3906 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3908 2008-03-05 Marek Safar <marek.safar@gmail.com>
3910 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3911 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3912 predefined types clean up (work related to #364674).
3914 2008-03-04 Marek Safar <marek.safar@gmail.com>
3916 * ecore.cs: Print an error message instead of throwing exception.
3918 2008-03-04 Marek Safar <marek.safar@gmail.com>
3920 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3921 expression.cs, statement.cs: Unififed null literal representation.
3923 2008-03-03 Marek Safar <marek.safar@gmail.com>
3925 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3926 expression.cs: Refactored binary operators resolve phase and improved speed.
3927 The nullable code is still missing and won't work correctly, more fixes
3930 It also fixes #323726, #324312, #324248, and many other unreported issues.
3932 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3934 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3937 2008-02-27 Marek Safar <marek.safar@gmail.com>
3939 * ecore.cs: Clean-up and split BetterConversion.
3941 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3944 * enum.cs (EnumMember.Value): Only access 'value' if
3945 ResolveValue says it's ok.
3946 (EnumMember.DoResolveValue): Don't set prev_member.value.
3947 (Enum.GetDefinition): Reverse arguments of Equals --
3948 EnumMember.Value can return 'null'.
3950 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3952 2008-02-22 Marek Safar <marek.safar@gmail.com>
3954 * generic.cs, expression.cs: More ongoing work on expression trees.
3956 2008-02-21 Marek Safar <marek.safar@gmail.com>
3958 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3959 handle missing matches when mutiple operators exist.
3961 2008-02-20 Marek Safar <marek.safar@gmail.com>
3963 A fix for bug #363218
3964 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3967 2008-02-20 Marek Safar <marek.safar@gmail.com>
3969 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3970 update. This time to deal correctly with SideEffectConstant expression used
3971 as an argument for another constant folding.
3973 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3975 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3978 2008-02-19 Marek Safar <marek.safar@gmail.com>
3980 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3982 2008-02-19 Marek Safar <marek.safar@gmail.com>
3984 A fix for bug #328136
3985 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3986 side is a false constant, because we still need to evaluate the right-hand
3989 * statement.cs (If): Emit two types of boolean constants (simple constant,
3990 side-effect constant).
3992 2008-02-19 Marek Safar <marek.safar@gmail.com>
3994 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3996 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3999 2008-02-18 Marek Safar <marek.safar@gmail.com>
4001 A fix for bug #361457
4002 * ecore.cs (IsApplicable): Params methods have lower priority.
4004 * support.cs: Return correct parameter modifier for params types.
4006 2008-02-18 Marek Safar <marek.safar@gmail.com>
4008 * generic.cs (TypeParameter): Cache attribute target name.
4010 * support.cs: Removed unused variable.
4012 * typemanager.cs: Removed debugging leftover.
4014 * ecore.cs: Use local type instead of a property;
4016 * class.cs (VerifyMembers): Consider also parent to test whether type member
4019 * expression.cs (FullMethodDesc): Removed.
4021 * attribute.cs (IsValidArgumentType): Made static.
4023 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
4025 Cleanup to be more readable.
4026 * Makefile (GMCS_PROFILE): Remove.
4027 (COMPILER_NAME): New helper.
4029 2008-02-15 Miguel de Icaza <miguel@novell.com>
4031 * cs-tokenizer.cs: if a conditional expression happens inside a
4032 (...) this also means that we do not need to de-ambiguate between
4033 an parenthesized expression and a cast.
4037 * constant.cs (SideEffectConstant): a constant value that happens
4038 to have a side effect.
4040 Fixes the build regressions introduced by the fix for #359789
4042 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
4044 * expression.cs (Conditional.Emit): when emitting the ternary
4045 operator, use local variables to generate code verifiable code.
4047 The verifier cannot infer that the type on stack before the
4048 stloc.0 is executed is of type ParentB. This happens because the
4049 stack merge algorithm uses only parent types when deciding which
4050 is the common type. This is described in Part III 1.8.1.3 of ECMA
4053 This code compiled with mcs is not verifiable under MS. The MS
4054 verifier picks the first common interface of Foo and Bar, which is
4055 wrong, but doesn't use a full join type of the 2 interfaces.
4057 CSC uses a clever hack to compile such code in a verifiable
4058 way. It stores the intermediate values in a local variable with
4063 2008-02-14 Miguel de Icaza <miguel@novell.com>
4065 * expression.cs: Do not fold BitwiseAnd operators when the left
4066 side is a false constant, because we still need to evaluate the
4071 * support.cs: Instead of throwing an InternalErrorException when
4072 the position of the stream is outside the boundary of our buffer,
4073 reset the state of the reader, and restart the reading from the
4074 beginning of the file.
4076 2008-02-14 Marek Safar <marek.safar@gmail.com>
4078 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
4080 2008-02-14 Marek Safar <marek.safar@gmail.com>
4082 A fix for bug #361686
4083 * decl.cs: A protected types used inside a private class which parents
4084 derives from the protected class are accessible.
4086 2008-02-13 Marek Safar <marek.safar@gmail.com>
4088 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
4089 the parameterless constructor.
4091 2008-02-13 Marek Safar <marek.safar@gmail.com>
4093 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4094 lookup methods to use standard member cache when doing member lookup.
4096 2008-02-12 Marek Safar <marek.safar@gmail.com>
4098 * driver.cs: Don't report full path for referenced module as assembly error.
4100 2008-02-12 Marek Safar <marek.safar@gmail.com>
4102 * Makefile: Fixed `qh' target to work on all machines.
4104 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4105 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4106 and HasElementType with TypeManager implementation.
4108 2008-02-08 Marek Safar <marek.safar@gmail.com>
4110 A fix for bugs #325134, #359749
4111 * expression.cs, ecore.cs: Try to resolve an extension method even if the
4112 first binds point to non-method member expression.
4114 2008-02-08 Marek Safar <marek.safar@gmail.com>
4116 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4118 2008-02-08 Marek Safar <marek.safar@gmail.com>
4120 A fix for bugs #321394, #323028
4121 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4122 Reworked naive IsAccessibleAs implementation to handle nested types.
4124 2008-02-05 Jb Evain <jbevain@novell.com>
4126 * class.cs: use generic type comparison for parameters
4129 2008-02-05 Marek Safar <marek.safar@gmail.com>
4131 A fix for bug #325372
4132 * class.cs: Use generic type comparison when testing method signatures.
4134 2008-02-05 Marek Safar <marek.safar@gmail.com>
4136 A fix for bug #357047
4137 * ecore.cs: Applied C# 3.0 changes to better conversion.
4139 2008-02-05 Marek Safar <marek.safar@gmail.com>
4141 A fix for bug #358374
4142 * cs-parser.jay: Correctly set modifiers for all constructor types.
4144 2008-02-04 Marek Safar <marek.safar@gmail.com>
4146 A fix for bug #355251
4147 * generic.cs: Added base class constraint based type inference.
4149 2008-02-01 Marek Safar <marek.safar@gmail.com>
4151 A fix for bug #357255
4152 * decl.cs: One more missing visibility check.
4154 2008-02-01 Marek Safar <marek.safar@gmail.com>
4156 * support.cs: Fixed broken return.
4158 2008-01-25 Marek Safar <marek.safar@gmail.com>
4160 * report.cs: Correctly reset warnings count after probing.
4162 2008-01-25 Martin Baulig <martin@ximian.com>
4165 (NamespaceEntry.SymbolFileID): Make this work again after
4166 MemberName.ToString() is gone.
4168 2008-01-25 Marek Safar <marek.safar@gmail.com>
4170 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4173 2008-01-25 Marek Safar <marek.safar@gmail.com>
4175 * generic.cs: Use full implicit conversion for type inference fixing.
4177 2008-01-24 Marek Safar <marek.safar@gmail.com>
4179 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4180 Fixed user operator conversions.
4182 2008-01-24 Marek Safar <marek.safar@gmail.com>
4184 * generic.cs: Do nullable type to null comparison optimization during
4187 2008-01-24 Marek Safar <marek.safar@gmail.com>
4189 A fix for bug #355163
4190 * generic.cs: Enabled l-value resolve on nullable expressions.
4192 2008-01-24 Marek Safar <marek.safar@gmail.com>
4194 A fix for bug #353986
4195 * class.cs: Ingore static ctors with parameters for any further checks.
4197 2008-01-24 Marek Safar <marek.safar@gmail.com>
4199 A fix for bug #354310
4200 * namespace.cs: Removed redundant check.
4202 2008-01-24 Marek Safar <marek.safar@gmail.com>
4204 A fix for bug #354928
4205 * expression.cs: ElementInitializers can be resolved only once.
4207 2008-01-24 Marek Safar <marek.safar@gmail.com>
4209 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4210 Condition expressions.
4212 2008-01-23 Marek Safar <marek.safar@gmail.com>
4214 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4216 2008-01-22 Marek Safar <marek.safar@gmail.com>
4218 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4221 * generic.cs: Implemented coalesce expression.
4223 2008-01-22 Marek Safar <marek.safar@gmail.com>
4225 A fix for bug #355145
4226 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4227 expression tree type inference.
4229 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
4232 * expression.cs (Binary.IsUnsignedType): Fix typo.
4234 2008-01-22 Marek Safar <marek.safar@gmail.com>
4236 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4238 2008-01-22 Marek Safar <marek.safar@gmail.com>
4240 A fix for bug #355161
4241 * ecore.cs, expression.cs: Wider range of extension method supported
4244 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
4246 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4247 AssemblyBuilder to operate in compiler context. Fixes mcs part of
4250 2008-01-22 Marek Safar <marek.safar@gmail.com>
4252 A fix for bug #355148
4253 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4255 2008-01-22 Miguel de Icaza <miguel@novell.com>
4257 * expression.cs (CreateExpressionTree): Add support for or and
4258 logical or, and indent following the coding conventions.
4260 * typemanager.cs (LinqExpression): renamed from
4261 ExpressionTreeManager, for a shorter name.
4263 Use TypeManager.CoreLookupType to lookup types from our core
4264 assemblies and turn those into "Type" variables.
4266 Consumers that previously used "Namespace" and "Type" from this
4267 class should instead use the TypeExpression which is a type that
4268 is fully resolved (without involving the regular C# resolution
4271 This typically looks like this:
4273 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4274 new MemberAccess (texpr, name, type_arguments, loc)
4276 This avoids the problem in: #355178
4278 2008-01-21 Marek Safar <marek.safar@gmail.com>
4280 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4281 feature in parser only as we do in other cases.
4283 2008-01-21 Marek Safar <marek.safar@gmail.com>
4285 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4286 typemanager.cs: A refactoring of params arguments to reuse existing
4287 expressions (params -> array initializer) to emit params argument instead
4288 of specialized handling.
4289 It was required by expression tree implementation and it has other benefits
4290 as well, we now apply same optimization for params arguments as we do for
4293 2008-01-18 Marek Safar <marek.safar@gmail.com>
4295 A fix for bug #353526
4296 * generic.cs: A type inference of params arguments may not required any
4297 temporary array creation.
4299 2008-01-18 Marek Safar <marek.safar@gmail.com>
4301 A fix for bug #353534
4302 * generic.cs, ecore.cs, expression.cs: A method group type inference is
4303 supported for delegates only.
4305 2008-01-18 Marek Safar <marek.safar@gmail.com>
4307 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4308 type for more than 1 candidates.
4310 2008-01-18 Marek Safar <marek.safar@gmail.com>
4312 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4315 2008-01-16 Marek Safar <marek.safar@gmail.com>
4317 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4318 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4319 operator) expressions.
4321 2008-01-16 Zoltan Varga <vargaz@gmail.com>
4323 * statement.cs: Avoid declaring an IL variable for this_variable since it is
4324 not accessed from the generated IL.
4326 2008-01-14 Marek Safar <marek.safar@gmail.com>
4328 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4329 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4330 statement.cs: The first expression tree implementation drop, mostly
4331 infrastructure work.
4333 2008-01-14 Marek Safar <marek.safar@gmail.com>
4335 * ecore.cs (IsNestedChild): Refactored.
4337 2008-01-11 Marek Safar <marek.safar@gmail.com>
4339 * lambda.cs: Don't use a cast on unknown expression statement.
4341 2008-01-10 Geoff Norton <gnorton@novell.com>
4343 * cs-tokenizer.cs: One more token to distinguish between method and lambda
4346 2008-01-09 Marek Safar <marek.safar@gmail.com>
4348 * doc.cs: Report better /doc crash details.
4350 2008-01-09 Marek Safar <marek.safar@gmail.com>
4352 A fix for bug #352536
4353 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4355 2008-01-08 Marek Safar <marek.safar@gmail.com>
4357 A fix for bug #352287
4358 * ecore.cs, expression.cs: Do `this' access checking in all member access
4361 2008-01-08 Marek Safar <marek.safar@gmail.com>
4363 * rootcontext.cs, driver.cs: Switch to linq mode by default.
4365 * report.cs: Reset message stacks.
4367 2008-01-08 Marek Safar <marek.safar@gmail.com>
4369 * generic.cs (InferInPhases): Correctly calculate params position.
4371 2008-01-08 Marek Safar <marek.safar@gmail.com>
4373 * cs-tokenizer.cs: No need to parse full string when parsing lambda
4376 2008-01-07 Marek Safar <marek.safar@gmail.com>
4378 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4380 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4382 * driver.cs: Updated --help option.
4384 2008-01-07 Marek Safar <marek.safar@gmail.com>
4386 * generic.cs (InferParamsTypeArguments): Removed.
4387 (InferInPhases): Add params type inference.
4388 (LowerBoundInference): Fixed scoring mechanism.
4390 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4392 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
4394 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4395 byte array for unsigned "baked" assemblies.
4397 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
4399 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4400 array for assemblies that are not strongnamed.
4402 2008-01-04 Marek Safar <marek.safar@gmail.com>
4404 A fix for bug #351481
4405 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4406 declaring type for nested generic types.
4408 2008-01-04 Marek Safar <marek.safar@gmail.com>
4410 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4411 instead of ToString.
4413 2008-01-03 Marek Safar <marek.safar@gmail.com>
4415 A fix for bug #351047
4416 * expression.cs (Binary.ResolveOperator): Allow equality operators between
4417 null and structs only when equality and inequality operators are defined
4418 either as an user-operators or predefined operators.
4420 2008-01-03 Marek Safar <marek.safar@gmail.com>
4422 A fix for bug #351047
4423 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4425 2008-01-03 Marek Safar <marek.safar@gmail.com>
4427 A fix for bug #351257
4428 * cs-tokenizer.cs: Advance line number for '\r' correctly.
4430 2008-01-03 Marek Safar <marek.safar@gmail.com>
4432 A fix for bug #351157
4433 * class.cs (Using): Fixed yet another broken cloning.
4435 (Block): Put back more sensible default value for statements.
4437 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
4439 * codegen.cs: Allow AssemblyVersion with only major version component.
4442 2007-12-29 Marek Safar <marek.safar@gmail.com>
4444 A fix for bug #324654
4445 * class.cs: Use FullName property as member name.
4447 2007-12-28 Marek Safar <marek.safar@gmail.com>
4449 A fix for bug #342117
4450 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4451 constructor constraint.
4453 2007-12-28 Marek Safar <marek.safar@gmail.com>
4455 A fix for bug #338273
4456 * class.cs (ProbertyBase): Access modifier checks are required for overrides
4459 2007-12-28 Marek Safar <marek.safar@gmail.com>
4461 A fix for bug #350839
4462 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4464 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4466 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4469 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4471 * statement.cs: Changed some Hashtables to use HybridDictionaries
4472 instead. It was observed that some HashTables only contained a few
4473 items in the vast majority of cases. Since HybridDictionary is
4474 more efficient on small sets (<10 elements), "known_variables"
4475 from class ExplicitBlock as well as "labels" and "constants " from
4476 class Block were changed to HybridDictionaries.
4478 Atsai results: (56216kb->54987kb)
4480 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4483 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4485 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4488 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4490 * expression.cs: foreach loop to for loop, saved on allocation of
4491 enumerator (59333kb->59141kb)
4493 * statement.cs. Changed foreach loops to for loops, saved on
4494 allocation of enumerator (59141kb->59006kb)
4496 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4497 when constructed with no specified capacity. This was causing a
4498 few ArrayLists to allocate more memory than they would potentially
4499 need in the Block class and MemberCache class. Setting the
4500 ArrayLists to construct with a capacity of 1 saves some
4501 memory. (56216kb->55585kb)
4503 2007-12-27 Marek Safar <marek.safar@gmail.com>
4505 A fix for bug #347189 (2nd issue)
4506 * expression.cs (MemberAccess): Nested type can be found in base non-generic
4509 2007-12-27 Miguel de Icaza <miguel@novell.com>
4511 * report.cs: Do not use colors if stdout and stderr are not a
4514 2007-12-27 Marek Safar <marek.safar@gmail.com>
4516 A fix for bug #346998
4517 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4520 2007-12-27 Marek Safar <marek.safar@gmail.com>
4522 A fix for bug #343465
4523 * class.cs: Explicit method name for nested types uses dots only.
4525 2007-12-27 Marek Safar <marek.safar@gmail.com>
4527 A fix for bug #343707
4528 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4530 2007-12-27 Marek Safar <marek.safar@gmail.com>
4532 * ecore.cs: Report type inference errors only when arguments count matches
4535 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4537 * expression.cs, report.cs: New warning.
4539 * typemanager.cs: Catch anonymous method type too.
4541 2007-12-23 Marek Safar <marek.safar@gmail.com>
4543 A fix for bug #346379
4544 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4546 2007-12-23 Marek Safar <marek.safar@gmail.com>
4548 A fix for bug #347359
4549 * expression.cs (Invocation): Don't resolve already resolved expression.
4551 2007-12-23 Marek Safar <marek.safar@gmail.com>
4553 A fix for bug #347189
4554 * class.cs (FixedField): Use non-dependent code only in the define phase.
4556 2007-12-23 Marek Safar <marek.safar@gmail.com>
4558 A fix for bug #348076
4559 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4561 2007-12-22 Marek Safar <marek.safar@gmail.com>
4563 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4564 discovered extension methods.
4566 2007-12-22 Marek Safar <marek.safar@gmail.com>
4568 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4571 2007-12-21 Miguel de Icaza <miguel@novell.com>
4573 * report.cs (ErrorMessage): Add support for using colors on
4574 terminals that support it.
4576 2007-12-21 Marek Safar <marek.safar@gmail.com>
4578 * ecore.cs: Use information about expanded params for error reporting.
4580 2007-12-21 Marek Safar <marek.safar@gmail.com>
4582 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4583 and logic for params overloads.
4585 2007-12-15 Miguel de Icaza <miguel@novell.com>
4587 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4588 as this is also created from the parser. Fixes #349034
4590 2007-12-12 Miguel de Icaza <miguel@novell.com>
4592 * statement.cs (Throw.CloneTo): it is valid to have empty
4593 expressions for throw.
4595 2007-12-03 Marek Safar <marek.safar@gmail.com>
4597 * cs-parser.jay: Set delegate constraint parsing region correctly.
4599 2007-12-03 Marek Safar <marek.safar@gmail.com>
4601 A fix for bug #345467
4602 * typemanager.cs (IsEqual): Compare generic parameters position only.
4604 2007-11-28 Marek Safar <marek.safar@gmail.com>
4606 * expression.cs (BaseAccess): Type arguments can be null.
4608 2007-11-27 Raja R Harinath <harinath@gmail.com>
4610 * statement.cs (Block.Resolve): Ensure flow-branching tree is
4611 consistent even when an error has occured.
4612 (Switch.Resolve): Likewise.
4614 2007-11-22 Marek Safar <marek.safar@gmail.com>
4616 A fix for bug #334505
4617 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4620 2007-11-22 Marek Safar <marek.safar@gmail.com>
4622 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
4623 refactorings required to resolve extension methods correctly when mixing
4624 generics and non-generics members.
4626 2007-11-20 Marek Safar <marek.safar@gmail.com>
4628 A fix for bug #342584
4629 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4632 2007-11-19 Marek Safar <marek.safar@gmail.com>
4634 A fix for bug #342512
4635 * delegate.cs: Use delegate argument expression when is available. Don't
4636 emit virtual call when class is sealed.
4638 2007-11-16 Marek Safar <marek.safar@gmail.com>
4640 A fix for bug #325423
4641 * assign.cs (FieldInitializer): Use resolved expression for emit.
4643 * class.cs: Print less confusing error message.
4645 2007-11-16 Marek Safar <marek.safar@gmail.com>
4647 * cs-tokenizer.cs: Removed GMCS ifdefs.
4649 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4652 * cs-parser.jay: Disabled nullable check.
4654 * generic-mcs: Copied more generic stuff.
4656 2007-11-16 Marek Safar <marek.safar@gmail.com>
4658 * gcs-parser.jay: Merged to cs-parser.jay.
4660 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4661 * *.csproj, *.sources: Updated to use only jay parser file.
4663 2007-11-16 Marek Safar <marek.safar@gmail.com>
4665 * gcs-parser.jay: Added nullable and default expression feature checks.
4667 2007-11-16 Marek Safar <marek.safar@gmail.com>
4669 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4670 it fixes many TODOs and hidden bugs.
4672 * expression: Removed duplicate error check.
4674 2007-11-15 Marek Safar <marek.safar@gmail.com>
4676 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4677 implicitly type local variable only when it is used in a declaration.
4679 2007-11-15 Marek Safar <marek.safar@gmail.com>
4681 * attribute.cs: Use CS0612 for empty strings.
4683 2007-11-14 Marek Safar <marek.safar@gmail.com>
4685 * lambda.cs, statement.cs: Contextual return may act as a statement.
4687 2007-11-14 Marek Safar <marek.safar@gmail.com>
4689 A fix for a regression cause by #324222
4690 * class.cs: Don't report unused even when it implements an interface.
4692 2007-11-13 Marek Safar <marek.safar@gmail.com>
4694 A fix for bug #341205
4695 * ecore.cs, expression.cs: Method group expression cannot do static
4696 method access with an instance reference check before overloading takes
4699 2007-11-13 Marek Safar <marek.safar@gmail.com>
4701 A fix for bug #325359
4702 * class.cs: Use predictable name for automatically generated property.
4704 2007-11-12 Marek Safar <marek.safar@gmail.com>
4706 A fix for bug #324996
4707 * expression.cs (Is): Handle case where D is nullable and T is not
4710 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4712 2007-11-12 Marek Safar <marek.safar@gmail.com>
4714 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4715 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4716 Flush small error reporting changes.
4718 2007-11-09 Marek Safar <marek.safar@gmail.com>
4720 A fix for bug #324996
4721 * expression.cs: Rewrote Is expression implementation to work with
4722 generics, nullable types, anonymous method. A const result expression
4723 uses existing infrastructure instead of custom not fully-featured one.
4725 2007-11-08 Marek Safar <marek.safar@gmail.com>
4727 A fix for bug #340202
4728 * class.cs: Consider generics for volatile field.
4730 2007-11-08 Marek Safar <marek.safar@gmail.com>
4732 A fix for bug #335594
4733 * expression.cs: Use conversion rules when handling string addition.
4735 2007-11-07 Marek Safar <marek.safar@gmail.com>
4737 A fix for bug #336651
4738 * expression.cs: Fixed a crash when probing is on.
4740 2007-11-07 Marek Safar <marek.safar@gmail.com>
4742 A fix for bug #324242
4743 * covert.cs: Added a conversion from any nullable-type with an
4744 underlying enum-type to the type System.Enum.
4746 2007-11-07 Marek Safar <marek.safar@gmail.com>
4748 A fix for bug #324222
4749 * class.cs: Report all non-used event fields.
4751 2007-11-07 Marek Safar <marek.safar@gmail.com>
4753 A fix for bug #325161
4754 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4755 qualifier for generic types.
4757 2007-11-07 Marek Safar <marek.safar@gmail.com>
4759 A fix for bug #322971
4760 * expression.cs, ecore.cs: Added intermediate result value check for
4763 2007-11-07 Marek Safar <marek.safar@gmail.com>
4765 A fix for bug #324754
4766 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4767 when it was requested.
4769 2007-11-07 Marek Safar <marek.safar@gmail.com>
4771 A fix for bug #325101
4772 * expression.cs: Do type not value comparison for `is' expression.
4774 2007-11-07 Marek Safar <marek.safar@gmail.com>
4776 A fix for bug #320236
4777 * convert.cs: Don't apply user conversion on underlying target type.
4779 2007-11-06 Marek Safar <marek.safar@gmail.com>
4781 * expression.cs: Don't use unresolved expression for error reporting.
4783 2007-11-06 Marek Safar <marek.safar@gmail.com>
4785 A fix for bugs #337712, #324490
4786 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4787 overloading resolution too.
4789 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4790 the process consistent and more robust.
4792 * expression.cs, linq.cs, report.cs: Update.
4794 2007-11-02 Marek Safar <marek.safar@gmail.com>
4796 A fix for bug #332909
4797 * attribute.cs: Resolve attributes in correct context using error
4800 * rootcontext.cs: Define Obsolete attribute members as core members.
4802 2007-11-02 Marek Safar <marek.safar@gmail.com>
4804 * statement.cs: Removed unused methods.
4806 2007-10-31 Wade Berrier <wberrier@novell.com>
4808 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4809 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4812 2007-10-31 Marek Safar <marek.safar@gmail.com>
4814 A fix for bug #338102
4815 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4816 methods registered as non-generics.
4818 2007-10-31 Marek Safar <marek.safar@gmail.com>
4820 A fix for bugs #337712, #324490
4821 * delegate.cs: Delegate covariance and contravariance is not allowed for
4824 2007-10-31 Marek Safar <marek.safar@gmail.com>
4826 A fix for bug #337719
4827 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4830 2007-10-30 Marek Safar <marek.safar@gmail.com>
4832 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4834 2007-10-29 Marek Safar <marek.safar@gmail.com>
4836 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4839 2007-10-29 Raja R Harinath <rharinath@novell.com>
4841 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4843 2007-10-29 Marek Safar <marek.safar@gmail.com>
4845 A fix for bug #334652
4846 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4847 extension methods when we have not found the best candidate in normal
4850 2007-10-27 Marek Safar <marek.safar@gmail.com>
4852 * AssemblyInfo.cs: Keep up-to-date.
4854 2007-10-27 Marek Safar <marek.safar@gmail.com>
4856 * Makefile: Fixed generics compiler name.
4858 2007-10-27 Marek Safar <marek.safar@gmail.com>
4860 * lambda.test: removed, lambda parsing is done differently.
4862 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4864 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4866 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4868 2007-10-27 Marek Safar <marek.safar@gmail.com>
4870 * Makefile, *.sources : All C# compilers are in mcs folder.
4872 * *.cs: Use existing 2_1 define for smcs.
4874 2007-10-26 Marek Safar <marek.safar@gmail.com>
4876 A fix for bug #335847
4877 * assign.cs, expression.cs: Couple of changes to avoid creating a
4878 temporary variable for each object initializer assignment statement. It
4879 simplifies struct initialization too, otherwise two temporary variables
4881 Implemented optimization of redundant default element initializers.
4883 2007-10-25 Marek Safar <marek.safar@gmail.com>
4885 A fix for bug #336766
4886 * expression.cs (Class.CheckBase): Use generic name when method is
4889 2007-10-25 Marek Safar <marek.safar@gmail.com>
4891 A fix for bug #334737
4892 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4893 variable and not variable argument for prepared copies.
4895 2007-10-24 Marek Safar <marek.safar@gmail.com>
4897 A fix for bug #325110
4898 * class.cs, expression.cs, attribute.cs: Use open generic method when
4899 checking conditional attribute.
4901 2007-10-24 Marek Safar <marek.safar@gmail.com>
4903 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4904 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4905 FeatureIsNotAvailable.
4907 2007-10-24 Marek Safar <marek.safar@gmail.com>
4909 ** C# 3.0 Partial methods
4911 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4912 methods support. Because of member cache issue with generics only
4913 non-generics partial methods are fully supported.
4915 2007-10-23 Marek Safar <marek.safar@gmail.com>
4917 * class.cs, decl.cs: Rewrote member overloads check to cope with
4918 generics and to use member cache for member checking. It also improves
4919 performance and fixes remaining overloads issues.
4921 2007-10-20 Marek Safar <marek.safar@gmail.com>
4923 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4924 roottypes.cs, typemanager.cs:
4926 A member cache creation logic changed to add members immediately and
4927 not rely on fallback. The member cache is now only prefered way
4928 how to access and find type declaration members. It saves 5 MB of memory
4929 during MWF compilation and makes code ready for more optimizations and
4930 clean-ups, it's also a pre-requirement for partial methods.
4932 2007-10-18 Raja R Harinath <harinath@gmail.com>
4934 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4935 handling for generic parameters.
4937 2007-10-15 Marek Safar <marek.safar@gmail.com>
4939 * class.cs (FixedField): Removed redundant volatile check.
4941 2007-10-15 Marek Safar <marek.safar@gmail.com>
4943 * class.cs, decl.cs: Fixed overload members verification to do only one
4944 check per possible collision.
4946 2007-10-13 Marek Safar <marek.safar@gmail.com>
4948 A fix for bug #325478
4949 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4950 and create only one disposable flags container.
4952 2007-10-12 Marek Safar <marek.safar@gmail.com>
4954 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4955 * statement.cs (Fixed): Fixed variables cloning.
4957 2007-10-12 Marek Safar <marek.safar@gmail.com>
4959 A fix for bug #333342
4960 * class.cs (EventField): Don't mark value type event as synchronized.
4962 2007-10-12 Marek Safar <marek.safar@gmail.com>
4964 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4965 inference to identify best candidate method correctly.
4966 (ProperyExpr): A range variable is read only and cannot be modified.
4968 2007-10-11 Marek Safar <marek.safar@gmail.com>
4970 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4971 logic to identify best candidate method correctly.
4973 2007-10-11 Marek Safar <marek.safar@gmail.com>
4975 * location.cs (Equals, GetHashCode): Removed.
4977 2007-10-11 Marek Safar <marek.safar@gmail.com>
4979 * report.cs: Implemented message recorder. It is used mainly for lambda
4980 expressions to capture otherwise swallowed error messages.
4982 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4984 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4986 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4988 * expression.cs (MemberAccess): Always report lookup failure.
4990 * location.cs: Implemented Equals, GetHashCode.
4992 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4994 2007-10-10 Jb Evain <jbevain@novell.com>
4996 * codegen.cs: re-enable assembly version check.
4998 2007-10-09 Marek Safar <marek.safar@gmail.com>
5000 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
5003 * namespace.cs (UsingAlias): Do correct version check.
5005 2007-10-08 Marek Safar <marek.safar@gmail.com>
5007 * expresison.cs, ecore.cs: Issue extension method error message when
5010 * rootcontext.cs: Added ISO_2 compiler mode option.
5012 2007-10-08 Marek Safar <marek.safar@gmail.com>
5014 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
5017 2007-10-08 Marek Safar <marek.safar@gmail.com>
5019 * attribute.cs (GetString, GetBoolean): Work with both literal and
5022 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
5023 Moved method overload specific methods to MethodGroupExpr.
5025 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
5026 it should be less memory consuming.
5028 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5030 * codegen.cs: remove the assembly version check until the buildbot is
5033 2007-10-07 Jb Evain <jbevain@novell.com>
5035 * attribute.cs (Attribute.GetString): if the value
5036 expression is a StringConstant, return its string value.
5038 2007-10-07 Jb Evain <jbevain@novell.com>
5040 * typemanager.cs: add `assembly_version_attribute_type`.
5041 * codegen.cs: on attribute emission, check that the
5042 AssemblyVersionAttribute doesn't overflow.
5044 2007-10-05 Marek Safar <marek.safar@gmail.com>
5046 A fix for bug #324677
5047 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
5048 parent container of a scope container with currently resolved one.
5050 2007-10-05 Marek Safar <marek.safar@gmail.com>
5052 A fix for bug #325534
5053 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
5056 2007-10-05 Marek Safar <marek.safar@gmail.com>
5058 A fix for bug #327504
5059 * class.cs (Operator.Define): Refactored implicit and explicit user
5060 operator conversion rules.
5062 2007-10-05 Marek Safar <marek.safar@gmail.com>
5064 A fix for bug #327520
5065 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
5067 2007-10-04 Marek Safar <marek.safar@gmail.com>
5069 A fix for bug #328022
5070 * class.cs (MethodData.Define): Use correct method to check whether
5071 a method implementents an accessor.
5073 2007-10-04 Marek Safar <marek.safar@gmail.com>
5075 A fix for bug #330069
5076 * statement.cs (Fixed.Resolve): Read the first array element only when
5077 an array is instantiated.
5079 2007-10-04 Marek Safar <marek.safar@gmail.com>
5081 * expression.cs, assign.cs, generics.cs: Print correct operator when
5082 compound assignment is used.
5084 2007-10-04 Marek Safar <marek.safar@gmail.com>
5086 A fix for bug #325841
5087 * expression.cs (ArrayAccess): Use full argument cloning only for
5088 string compound concatenation.
5090 2007-10-03 Marek Safar <marek.safar@gmail.com>
5092 A fix for bug #328774
5093 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5095 (PropertyExpr.EmitAssign): Fixed string concatenation compound
5098 2007-10-03 Raja R Harinath <rharinath@novell.com>
5101 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5102 Event accessibility checks here. Remove some bogus code that
5103 accidently made GenericMethods work.
5104 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5106 2007-09-25 Marek Safar <marek.safar@gmail.com>
5108 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5110 * statement.cs (Block): Refactored AddVariable to allow error handling
5113 * generic.cs: New stub.
5115 2007-09-23 Marek Safar <marek.safar@gmail.com>
5117 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5120 2007-09-17 Marek Safar <marek.safar@gmail.com>
5122 * class.cs: Use partial container to record whether any partial part
5123 contains static field initializer and therefore default contructor has
5126 2007-09-14 Marek Safar <marek.safar@gmail.com>
5128 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5129 mono-list when only one of two partial parts has defined accessibility
5132 2007-09-14 Marek Safar <marek.safar@gmail.com>
5134 A fix for bug #82845
5136 * class.cs (TypeContainer): Set correct resolve context for all field
5139 2007-09-13 Marek Safar <marek.safar@gmail.com>
5141 * assign.cs: Fixed a crash when field is resolved twice with an error.
5143 * codegen.cs: Changed InFieldInitializer to be flag.
5145 * anonymous.cs, ecore.cs, expression.cs: Update after
5146 IsInFieldInitializer rename.
5148 * const.cs: Removed unused parameter.
5150 * class.cs: Changed the way how we resolve and emit field initializers.
5151 The field initilizers have to have access to contructor block to emit
5152 compiler generated code.
5154 2007-09-13 Marek Safar <marek.safar@gmail.com>
5156 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5157 generics use TypeContainer instead.
5159 2007-09-12 Marek Safar <marek.safar@gmail.com>
5161 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5163 * lambda.cs (ResolveParameters): Use more powerful
5164 InflateGenericArgument.
5166 * parameters.cs: Better exception message.
5168 2007-09-10 Marek Safar <marek.safar@gmail.com>
5170 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5171 correct expression block type.
5173 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5175 * expression.cs (Invocation): Extracted method group resolve to
5178 2007-09-07 Marek Safar <marek.safar@gmail.com>
5180 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5181 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5183 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5184 generic extension methods.
5186 2007-09-06 Marek Safar <marek.safar@gmail.com>
5188 A fix for bug #82676 (Do I get it right now?)
5189 * convert.cs (Binary.ResolveOperator): An interface is converted to the
5190 object before a standard conversion is applied.
5192 2007-09-06 Marek Safar <marek.safar@gmail.com>
5194 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5197 2007-09-05 Marek Safar <marek.safar@gmail.com>
5199 A fix for bug #82676
5200 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5201 non-generic interface types.
5203 2007-09-05 Marek Safar <marek.safar@gmail.com>
5205 A fix for bug #82690
5206 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5208 2007-09-05 Marek Safar <marek.safar@gmail.com>
5210 A fix for bug #82571
5211 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
5212 modifier for container based methods.
5214 2007-09-05 Marek Safar <marek.safar@gmail.com>
5216 A fix for bug #82676
5217 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5218 any interface-type T means to any of interface type T.
5220 2007-09-04 Marek Safar <marek.safar@gmail.com>
5222 * namespace.cs: We have 2 versions of System.Core assembly.
5224 2007-09-04 Marek Safar <marek.safar@gmail.com>
5226 A fix for bug #82652
5227 * class.cs (Class.GetClassBases): Compare types and not expressions.
5229 2007-09-04 Marek Safar <marek.safar@gmail.com>
5231 A fix for bug #82620
5232 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5233 actually never worked before.
5234 (IndexerAccess): Emit prepared arguments before they are modified.
5236 2007-09-04 Marek Safar <marek.safar@gmail.com>
5238 A fix for bug #82563
5239 * assign.cs: Revert wrong fix.
5241 * expression.cs (VariableReference.EmitAssign): Handle ref reference
5243 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5244 Instead of ldelema/stdind we have to use temporary variables to handle
5245 cases like String.Concat (params string[]).
5247 2007-08-31 Marek Safar <marek.safar@gmail.com>
5249 * class.cs: EmitAttributes to Emit rename.
5251 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5253 (MemberCore.HasClsCompliantAttribute): Don't depend on
5254 GetClsCompliantAttributeValue execution.
5256 2007-08-31 Marek Safar <marek.safar@gmail.com>
5258 * anonymous.cs: Use shorter type prefix.
5260 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5263 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5264 variables when probing is on.
5266 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
5267 unresolved variables.
5268 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5269 handle transparent identifiers.
5271 2007-08-26 Marek Safar <marek.safar@gmail.com>
5273 * attribute.cs (IsClsCompliant): Add nullable types test.
5275 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
5277 * doc.cs : catch other types of exception than XmlException to
5278 report CS1570. Fixed bug #82565.
5280 2007-08-23 Marek Safar <marek.safar@gmail.com>
5282 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
5283 The number of delegate parameters has to match.
5284 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5287 2007-08-21 Marek Safar <marek.safar@gmail.com>
5289 * anonymous.cs (AnonymousMethod): Generate private anonymous method
5290 to fix problem with private arguments.
5292 2007-08-20 Marek Safar <marek.safar@gmail.com>
5294 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5296 * decl.cs (MemberName): Ignore generic type with no generic arguments.
5298 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5299 empty. Add cloning suport.
5301 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5303 2007-08-20 Marek Safar <marek.safar@gmail.com>
5305 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
5306 to create EmptyCast. It handles EmptyConstantCast specialization for
5309 2007-08-18 Marek Safar <marek.safar@gmail.com>
5311 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5312 (EmitArrayArgument): One routine for array arguments.
5313 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
5315 2007-08-17 Marek Safar <marek.safar@gmail.com>
5317 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5319 2007-08-17 Marek Safar <marek.safar@gmail.com>
5321 * anonymous.cs: MemberLookupFinal update.
5323 * class.cs (ConstructorInitializer): Is expression based.
5325 * delegate.cs: MethodGroupExpr update.
5327 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
5329 (Error_MemberLookupFailed): Customizable error override.
5330 (MethodGroupExpr): Keep queried type for later usage.
5331 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5334 * expression.cs: Error_MemberLookupFailed refactoring.
5335 (New.DoResolve): Resolve as much as possible.
5336 (ElementInitializer.Error_MemberLookupFailed): Object initializer
5337 customization for invalid member types.
5339 * statement.cs: MethodGroupExpr update.
5341 2007-08-16 Marek Safar <marek.safar@gmail.com>
5343 * modifier.cs (Check): Check all modifiers and not only accessibility
5346 2007-08-16 Marek Safar <marek.safar@gmail.com>
5348 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5349 type and not an expression.
5351 2007-08-16 Marek Safar <marek.safar@gmail.com>
5353 * statement.cs (Catch.Clone): Type and variable can be null.
5355 2007-08-16 Marek Safar <marek.safar@gmail.com>
5357 A fix for bug #81979
5358 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5359 I am really not sure whether this is the best fix.
5361 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5364 2007-08-14 Marek Safar <marek.safar@gmail.com>
5366 ** C# 3.0 Object and collection initializers (major re-write)
5368 * assign.cs (DoResolve): Initializers are not assign related.
5370 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5371 used during collection or object initialization.
5373 * expression.cs (Error_InvalidArguments): Add initializers specific
5374 messages. More will come later because it requires some general
5376 (New.DoResolve): Better error handling for unsafe types.
5377 (EmptyExpressionStatement): New class.
5378 (ElementInitializer): An object initializer expression.
5379 (CollectionElementInitializer): A collection initializer expression.
5380 (CollectionOrObjectInitializers): A block of object or collection
5382 (NewInitialize): New expression with element/object initializers.
5384 * statement.cs: Reverted object/collection initializer hacks.
5386 * typemanager.cs (CSharpName): Filter __arglist type.
5388 2007-08-09 Marek Safar <marek.safar@gmail.com>
5390 ** C# 3.0 Anonymous Types (update to the latest standard)
5392 * expression.cs (Binary.ResolveOperator): Threat all null based types
5394 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5395 (AnonymousTypeParameter): Updated.
5397 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5398 (AnonymousTypeClass): New anonymous type container.
5400 * class.cs (AddField): Return operation result.
5402 * generic.cs: Another empty TypeArguments overload.
5404 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5405 are stored at top of normal hierarchy.
5407 * typemanager.cs (CSharpName): Filter anonymous types.
5409 2007-08-09 Marek Safar <marek.safar@gmail.com>
5411 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5412 as single Concat call. How could we miss that :-(
5414 2007-08-08 Marek Safar <marek.safar@gmail.com>
5416 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5418 2007-08-07 Miguel de Icaza <miguel@novell.com>
5420 * expression.cs: Fix the previous commit, the creation of the
5421 arguments array list needs also to be conditional on the arguments
5424 * class.cs: Add a little bit of help to help narrow down problems.
5426 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5427 not try to copy in that case.
5429 * driver.cs: When building SMCS, include a new different set of
5430 default assemblies here. Do this here so we can control whether
5431 to include the default assemblies with /noconfig.
5433 2007-08-03 Marek Safar <marek.safar@gmail.com>
5435 A fix for bug #81979
5436 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5439 2007-08-03 Marek Safar <marek.safar@gmail.com>
5441 A fix for bug #82300
5443 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5444 we are in probing scope.
5446 2007-08-03 Marek Safar <marek.safar@gmail.com>
5448 A fix for bug #82301
5450 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5451 (Statement.CloneTo): Clone and not map children blocks.
5453 2007-08-03 Marek Safar <marek.safar@gmail.com>
5455 A fix for bug #82299
5457 * expression.cs (LocalVariableReference.CloneTo): Remap local info
5460 * statement.cs (Statement.CloneTo): Clone variables before statements
5461 to allow remaping of local variables.
5463 2007-08-03 Marek Safar <marek.safar@gmail.com>
5465 A fix for bug #82296
5468 * report.cs: Log crash details for future clone problems.
5470 * statement.cs (Return.Clone): Don't clone non-existent expression.
5472 2007-08-03 Raja R Harinath <harinath@gmail.com>
5474 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5475 (Class.AddBasesForPart): Move CS0537 check here from ...
5476 * cs-parser.jay (class_declaration): ... here. Move calling of
5477 'AddBasesForPart' to ...
5478 (class_bases): ... here.
5479 (struct_declaration, interface_declaration): Update to changes.
5481 2007-08-02 Marek Safar <marek.safar@gmail.com>
5483 A fix for bug #81923
5485 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5486 conversion is allowed.
5488 2007-08-02 Marek Safar <marek.safar@gmail.com>
5490 A fix for bug #81564
5492 * ecore.cs (EventExpr): Add IsBase handling.
5494 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5497 2007-08-02 Raja R Harinath <harinath@gmail.com>
5499 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5500 * cs-parser.jay: Some whitespace cleanups.
5501 (current_delegate): New.
5503 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5504 a dummy code block, and use 'type_name' instead of 'member_name'.
5505 (interface_declaration, class_declaration): Likewise.
5506 (delegate_declaration): Likewise. Rearrange slightly and use
5508 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5509 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
5511 2007-08-02 Marek Safar <marek.safar@gmail.com>
5513 A fix for bug #82039
5515 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5518 * typemanager.cs (CSharpName): Split to string overload.
5520 2007-08-02 Marek Safar <marek.safar@gmail.com>
5523 * report.cs: Updated warning CS0472.
5525 2007-08-01 Marek Safar <marek.safar@gmail.com>
5527 A fix for bug #82181
5529 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5531 2007-08-01 Marek Safar <marek.safar@gmail.com>
5533 A fix for bug #82277
5534 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5536 2007-08-01 Marek Safar <marek.safar@gmail.com>
5538 ** C# 3.0 Type Inference (major bits are working)
5540 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5541 (.ImplicitStandardConversionExists): Uses compatible.
5542 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5543 (.InferReturnType): New method.
5544 (.Compatible): Refactored.
5545 (.ResolveParameters): Uses factory to create resolved parameters.
5546 (.CompatibleMethod): Add probing mode support.
5547 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5548 clearly distinguish between 2 different operations.
5549 (LambdaMethod): Moved to lambda.cs.
5550 (AnonymousMethod): Removed unused fields and methods.
5551 (AnonymousDelegate): Simplified.
5553 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5555 * convert. cs (ImplicitConversionStandard): Compatible works differently.
5557 * delegate.cs (Delegate): New mehods to reduce code duplication.
5558 (.GetConstructor): New method.
5559 (.GetInvokeMethod): New method.
5560 (DelegateCreation): Updated.
5562 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5564 (OverloadResolve): Made probing little bit faster.
5566 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5569 * generic.cs (TypeInferenceContext): Dummy implementation.
5571 * iterators.cs: Updated after Resolve/Define rename.
5573 * lambda.cs (LambdaExpression)
5574 (.ResolveParameters): Handles both type of arguments and type inference too.
5576 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5577 (InflateTypes): Updated.
5579 * support.cs (InflateTypes): Changed signature and updated.
5581 * typemanager.cs (LookupMemberCache): Better dynamic type check.
5582 (MemberLookup_FindMembers): More MS tricks.
5583 (GetParameterData): Ditto.
5584 (GetDelegateParameters): Uses quick path for dynamic types.
5586 2007-08-01 Marek Safar <marek.safar@gmail.com>
5588 * class.cs (MethodData.Define): EmitContext is required for generic stuff
5591 2007-07-31 Marek Safar <marek.safar@gmail.com>
5593 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5596 2007-07-26 Jb Evain <jbevain@novell.com>
5598 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5599 which takes a boolean 'report_errors', similar to the GetMethod.
5600 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5601 in .net 2.1, do not report errors here.
5603 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5604 System.Runtime.CompilerServices.RequiredAttributeAttribute and
5605 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5608 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5609 of the type InternalsVisibleToAttribute before the first call
5610 to CoreLookupType which is allowed to fail (third boolean parameter
5611 to true). Because, during the resolution for a type that is not
5612 immediately found, we try to check if the type is not defined in
5613 a friend assembly, and to do so, we need the
5614 InternalVisibleToAttribute.
5616 2007-07-23 Miguel de Icaza <miguel@novell.com>
5618 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5619 feature that allows structs to be compared against null and inline
5620 the result as true or false.
5622 Notice that the same code is not permitted inside a generic block
5623 of code that would do:
5625 class Foo<T> where T : struct {
5632 It is only allowed if the type of T is not bound (no where
5633 clause). In my opinion, this CSC 2 behavior is broken but people
5634 seem to be using it (IronRuby does, a few bug reports on bugzilla
5635 have it and some people have complained about it).
5637 All of the users that depend on this behavior have code that is
5640 * report.cs (Warning, Error): make these take object arguments,
5641 not strings, as that allows us to take advantage of Format.
5643 2007-07-20 William Holmes <billholmes54@gmail.com>
5645 * decl.cs: Changed MemberName.CountTypeArguments to also check the
5646 Left member variable for the Count.
5647 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
5648 MemberName.CountTypeArguments to avoid a NRE.
5650 This code is contributed under the MIT X11 license
5652 2007-07-18 Marek Safar <marek.safar@gmail.com>
5654 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5656 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5658 * doc.cs : generic method arguments are written as ``x while generic
5659 type arguments are `x. Combined with the previous change, fixed bug
5662 2007-07-18 Raja R Harinath <rharinath@novell.com>
5665 * expression.cs (Binary.ResolveOperator): When converting
5666 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5668 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5670 * doc.cs : when T: or whatever x: is specified, it does not really
5671 check the doc comment's syntax correctness. Fixed bug #82006.
5673 2007-07-18 Marek Safar <marek.safar@gmail.com>
5675 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5676 LambdaExpression better.
5678 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5680 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5682 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5683 as it can be generated.
5685 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5688 * lambda.cs (LambdaExpression): Refactored to share same code with
5689 AnonymousMethodExpression.
5691 2007-07-17 Marek Safar <marek.safar@gmail.com>
5693 * anonymous.cs (MakeName): Include host name for easier debugging.
5694 (LambdaMethod): New class for lambda spcecific stuff.
5696 * attribute.cs: Set EmitContext return type.
5698 * class.cs: Set EmitContext return type.
5700 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5701 with null/void meaning.
5703 * iterators.cs (ContainerType): Implemented.
5705 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5707 * statement.cs (Return): Updated to lambda expressions.
5708 (Block.CloneTo): Parent can be null.
5710 2007-07-13 Marek Safar <marek.safar@gmail.com>
5712 A fix for bug #81917
5713 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5715 * class.cs (FixedField): Check whether field is in unsafe scope.
5717 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5718 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5720 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5723 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5725 2007-07-13 Marek Safar <marek.safar@gmail.com>
5727 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5728 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5731 2007-07-13 Marek Safar <marek.safar@gmail.com>
5733 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5735 2007-07-13 Marek Safar <marek.safar@gmail.com>
5737 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5738 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5740 * codegen.cs(EmitContext): Add ProbingMode flag.
5742 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5744 * driver.cs: For now set both warning values.
5746 * ecore.cs (SimpleName): Name is readonly.
5747 (MethodGroup.OverloadResolve): One quick path for probing.
5749 * expression.cs (Unary): Set Oper r/o.
5750 (Binary): Set Oper r/o.
5751 (ParameterReference): Set few instance variables as r/o.
5752 (ParameterReference.DoResolveBase): Don't capture aruments when
5754 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5755 (Arglist): arguments are private.
5756 (SizeOf): type is private and r/o.
5757 (MemberAccess): arguments are private.
5759 * report.cs: Enhanced reporting on/off capabilities.
5761 * lambda.cs: Uses ec.IsInProbingMode.
5762 (ContextualReturn): Derives from return.
5764 * rootcontext.cs: For now set both warning values.
5766 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5768 (Return.Resolve): Don't die immediately.
5769 (Block.Resolve): Speed-up probing.
5770 (Block.CloneTo): Clone only child blocks.
5772 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5774 * iterators.cs: reverted Miguel's latest change (r81925) as it
5775 breaks the build in System.
5777 2007-07-13 Miguel de Icaza <miguel@novell.com>
5779 * iterators.cs (Yield.CheckContext): Check for the iterator type
5780 also here as we can call into Yield even in codepaths that are not
5782 (MethodOrOperator is the only path that was checked).
5784 In addition to the standard check, use a more specific check for
5785 constructors to report a more verbose error.
5787 2007-07-12 Miguel de Icaza <miguel@novell.com>
5789 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5790 report the warning and continue
5792 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5793 values on the stack on the call to Emit. Use EmitStatement if
5794 possible, or using Emit + Pop if not possible. Fixes #82064
5796 2007-07-12 Raja R Harinath <rharinath@novell.com>
5798 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5799 avoid try...finally in some cases.
5801 2007-07-10 Marek Safar <marek.safar@gmail.com>
5803 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5805 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5806 instead of method. Re-use standard error handling.
5807 (ConstructorInitializer.Emit): Simplified.
5809 * delegate.cs: Updated after Invocation.EmitCall change.
5811 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5812 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5813 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5814 method and don't permanently changing input arguments.
5815 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5816 is resolved it has one of the candidates is the best one which is later
5817 used to emit. Removed a few unused method.
5818 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5820 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5821 (Binary.ResolveOperator): Ditto.
5822 (ConditionalLogicalOperator.DoResolve): Ditto.
5823 (Invocation): Uses method group.
5824 (Invocation.DoResolve): Simplified.
5825 (Invocation.EmitCall): Removed useless is_static.
5826 (Invocation.Emit): Delegate to method group.
5827 (Invocation.EmitStatement): Simplified.
5828 (New): Uses method group.
5829 (MemberAccess.DoResolve): Don't destroy original expression.
5831 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5833 2007-07-04 Marek Safar <marek.safar@gmail.com>
5835 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5838 * lambda.cs: Add custom error message type.
5840 2007-07-03 Marek Safar <marek.safar@gmail.com>
5842 * lambda.cs: Simplified little bit.
5844 * parameter.cs: Introduced ImplicitLambdaParameter.
5845 (Parameters.CreateFullyResolved): New factory instead of ctor.
5849 * delegate.cs: Updated parameter creation.
5851 2007-07-03 Marek Safar <marek.safar@gmail.com>
5853 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5856 * generic.cs: Synchronized with gmcs.
5858 2007-07-03 Marek Safar <marek.safar@gmail.com>
5860 * class.cs (Indexer): Check return type as soon as possible.
5862 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5865 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5867 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5869 * parameter.cs (Parameter): Use expression type when it is available.
5871 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5872 method modifier for the first parameter only.
5874 2007-06-24 Marek Safar <marek.safar@gmail.com>
5876 A fix for bug #81938
5877 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5879 * constant.cs: Tide up an exception message.
5881 2007-06-22 Marek Safar <marek.safar@gmail.com>
5883 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5884 an uninitialized variable is used.
5886 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5888 2007-06-22 Marek Safar <marek.safar@gmail.com>
5890 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5891 not found error handling.
5893 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5895 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5896 (ArrayCreation.DoResolve): Simplified.
5897 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5898 its own resolve process.
5899 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5901 2007-06-20 Marek Safar <marek.safar@gmail.com>
5903 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5906 2007-06-20 Marek Safar <marek.safar@gmail.com>
5908 * cs-tokenizer.cs: Removed var related stuff.
5910 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5911 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5912 a type and a keyword at same time.
5914 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5917 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5918 implicitly typed arrays, more changes will follow.
5920 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5922 2007-06-19 Marek Safar <marek.safar@gmail.com>
5924 * ecore.cs (VarExpr): Removed Handled field.
5926 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5927 build-in assign functionality.
5928 (ForEach.Resolve): Removed all implicitly typed local variable code and
5930 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5931 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5933 2007-06-18 Marek Safar <marek.safar@gmail.com>
5935 * assign.cs: Removed implicitly typed local variable check.
5937 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5938 referencing implicitly typed local variable.
5939 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5942 * statement.cs (Fixed): Removed unsupported implicitly typed local
5945 2007-06-15 Marek Safar <marek.safar@gmail.com>
5947 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5949 2007-06-14 Marek Safar <marek.safar@gmail.com>
5951 A fix for bugs #81855 and #76274
5952 * attribute.cs (AttachTo): Always set owner for global attributes to
5955 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5958 * cs-parser.jay: Assembly and module attributes must precede all other
5959 elements except using clauses and extern alias declarations.
5961 2007-06-13 Marek Safar <marek.safar@gmail.com>
5963 A fix for bug #81748
5965 * expression.cs: More checks for non ISO-1 features.
5967 2007-06-12 Marek Safar <marek.safar@gmail.com>
5969 A fix for bug #81807
5970 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5971 present inside switch statement and it is required by nullable check.
5973 2007-06-12 Marek Safar <marek.safar@gmail.com>
5975 A fix for bug #81840
5976 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5977 when type matching fails.
5979 * namespace.cs: Tiny error message change.
5981 2007-06-12 Marek Safar <marek.safar@gmail.com>
5983 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5984 reporting. Added automatic property check.
5986 * class.cs: Updated after CheckAbstractAndExtern relocation.
5987 (AEventPropertyAccessor.GetSignatureForError): Customized.
5989 2007-06-11 Marek Safar <marek.safar@gmail.com>
5991 * class.cs (DefineBaseTypes): Base type can be undefined.
5993 * ecore.cs (TypeLookup): Minor refactoring.
5994 (DoResolveAsTypeStep): Removed redundant check.
5996 * namespace.cs (Lookup): Removed redundant check.
5998 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5999 ResolveAsTypeTerminal step.
6000 (BootstrapCorlib_*): Simplified.
6001 (PopulateCoreType): Core types can be now external.
6003 2007-06-07 Marek Safar <marek.safar@gmail.com>
6005 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
6007 (InferTypeArguments): Infers anonymous expression type arguments.
6008 (Compatible): Split to Compatible and InferTypeArguments.
6010 * lambda.cs: Updated.
6012 2007-06-08 Marek Safar <marek.safar@gmail.com>
6014 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
6016 2007-06-07 Raja R Harinath <harinath@gmail.com>
6018 Fix #80477, cs0135-2.cs, cs0135-3.cs
6019 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
6020 names to the "known" variables list.
6021 (Block.CheckInvariantMeaningInBlock): Handle the fact the
6022 parameter names are also "known".
6023 (Block.CheckError136): Remove.
6024 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
6027 2007-06-07 Marek Safar <marek.safar@gmail.com>
6029 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
6031 2007-06-06 Marek Safar <marek.safar@gmail.com>
6033 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
6034 internal error not an user error.
6036 * expression.cs (IsApplicable): Refactored to make debugging easier.
6038 * support.cs: More tricks for non-mono runtimes.
6040 * typemanager.cs (CoreLookupType): Made public.
6041 (InitSystemCore): All linq specific stuff moved to linq.cs
6043 2007-06-05 Marek Safar <marek.safar@gmail.com>
6045 * typemanager.cs (CSharpSignature): One more missing build-in types
6047 More tricks for non-mono runtime.
6049 2007-06-05 Raja R Harinath <harinath@gmail.com>
6051 * statement.cs (Block.CheckError136_InParents): Remove.
6052 (Block.AddVariable): Use GetParameterInfo instead.
6053 (ToplevelBlock.ProcessArguments): Likewise.
6055 2007-06-04 Raja R Harinath <rharinath@novell.com>
6057 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
6059 (ToplevelBlock.GetParameterInfo): Split out of ...
6060 (ToplevelBlock.GetParameterRefernce): ... this.
6061 (ToplevelBlock.ParameterMap): Remove.
6062 * expression.cs (ParameterReference): Update to use
6063 ToplevelParameterInfo.
6065 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
6068 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
6069 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
6071 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
6072 (ToplevelBlock.ProcessParameters) ... here.
6073 (ToplevelBlock..ctor): Invoke it.
6075 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
6078 * statement.cs (IKnownVariable): New interface.
6079 (LocalInfo): Implement it.
6080 (ToplevelParameterInfo): New class.
6081 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
6082 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
6083 GetKnownVariableInfo.
6085 2007-06-03 Raja R Harinath <harinath@gmail.com>
6087 Partly speed up CS0136 error checks.
6088 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
6089 'recurse' parameter.
6090 (Block.DoCheckError136): Only check errors in parameters. Move
6091 local variable checks ...
6092 (Block.AddVariable): ... here, and ...
6093 (ToplevelBlock.ResolveMeta): ... here.
6095 2007-06-02 Raja R Harinath <harinath@gmail.com>
6097 * statement.cs (Block.IsChildOf): Remove.
6099 * statement.cs (Statement.Clone): Move special case code ...
6100 (Block.CloneTo): ... here.
6102 2007-05-29 Raja R Harinath <rharinath@novell.com>
6104 * statement.cs (ToplevelBlock.container): Remove field. It's
6105 redundant with 'Parent'.
6106 (ToplevelBlock.ContainerBlock): Remove accessor.
6107 (ToplevelBlock..ctor): Update to changes. Register anonymous
6108 child with parent here, ...
6109 * cs-parser.jay (end_anonymous): ... not here. Don't modify
6111 (start_anonymous): Don't save current_block.
6112 (top_current_block): Remove.
6114 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6115 (Block.Resolve): Update to changes.
6116 (Block..ctor): Move setting of "correct" 'Toplevel'
6117 and 'Explicit' fields to ...
6118 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6120 2007-05-27 Raja R Harinath <harinath@gmail.com>
6123 * statement.cs (Block.Implicit): Remove.
6124 (Block): Update to changes.
6125 * flowanalysis.cs: Likewise.
6127 Mildly speed up CheckInvariantMeaningInBlock
6128 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6129 Recursively call AddKnownVariable to all enclosing blocks.
6130 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6131 Remove recursive calls.
6132 (Block): Update to changes.
6134 New ExplicitBlock invariants
6135 * statement.cs (Block.Explicit): New field. It points to the
6136 immediately enclosing non-implicit block.
6137 (Block..ctor): Maintain the invariant.
6138 * cs-parser.jay: Take advantage of invariant.
6140 Introduce ExplicitBlock
6141 * statement.cs (ExplicitBlock): New.
6142 (ToplevelBlock): Derive from it.
6143 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6145 (Block.Implicit): Update to changes.
6146 * cs-parser.jay: Update to changes.
6149 * codegen.cs (EmitContext.IsLastStatement): Remove.
6150 * statement.cs (Block.DoEmit): Update to changes.
6152 2007-05-25 Raja R Harinath <rharinath@novell.com>
6154 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6155 modifying current_block directly.
6157 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
6159 * class.cs: Implemented automatic properties (C# 3.0)
6160 Thanks to Marek for the help.
6162 2007-05-23 Raja R Harinath <rharinath@novell.com>
6164 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6165 variable as assigned, note also that all its components are
6167 (MyBitVector.SetRange): New. Function to set multiple bits to true.
6169 2007-05-19 Marek Safar <marek.safar@gmail.com>
6171 * anonymous.cs, class.cs: Emit Compiler generated attribute when
6172 member is marked as compiler generated.
6174 * decl.cs (MemberCore): Refactored ModFlags into property.
6176 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6177 (Check): Check only accessibility modifiers.
6179 2007-05-18 Raja R Harinath <rharinath@novell.com>
6181 Track all assignable slots in one bit array
6182 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6183 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
6184 logic from VariableMap constructor here. Use the same 'offset'
6185 variable that's later used for computing offsets of local
6187 * flowanalysis.cs (UsageVector.parameters): Remove.
6188 (UsageVector): Update to changes.
6189 (VariableMap): Remove.
6191 Avoid creating ParameterMap in every block
6192 * statement.cs (Block.ParameterMap): Move ...
6193 (ToplevelBlock.ParameterMap): ... here.
6194 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6196 * flowanalysis.cs (FlowBranching.param_map): Remove.
6197 (FlowBranching.UsageVector): Update to changes.
6198 (FlowBranchingToplevel.CheckOutParameters): Likewise.
6200 * statement.cs (Block.CloneTo): Clone Toplevel field too.
6202 * expression.cs (ParameterReference): Distinguish between block
6203 where parameter was referenced and declared.
6205 2007-05-18 Marek Safar <marek.safar@gmail.com>
6207 * flowanalysis.cs, statement.cs: Put back improved error handling.
6209 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
6213 Imporved object and collection initialization (C# 3.0).
6215 2007-05-15 Marek Safar <marek.safar@gmail.com>
6217 A fix for bug #81380
6218 * expression.cs (Is.DoResolve): Only value types have constant `is'
6221 2007-05-15 Raja R Harinath <rharinath@novell.com>
6223 * statement.cs (ToplevelBlock.child): Remove.
6225 2007-05-15 Raja R Harinath <harinath@gmail.com>
6227 Rationalize ResolveMeta: refactoring
6228 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
6229 out constant handling code into ...
6230 (Block.DoResolveConstants): ... this.
6232 Rationalize ResolveMeta: kill local_map
6233 * statement.cs (Block.local_map, Block.LocalMap): Remove.
6234 (Block.AssignableSlots): New.
6235 (Block.ResolveMeta): Make protected. Don't create a VariableMap
6236 for locals -- move code from VariableMap here. Avoid unnecessary
6238 * flowanalysis.cs (FlowBranching.local_map): Remove.
6239 (FlowBranching..ctor): Use Block.AssignableSlots.
6240 (VariableMap): Remove unused constructors.
6242 2007-05-11 Raja R Harinath <rharinath@novell.com>
6244 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6246 2007-05-11 Marek Safar <marek.safar@gmail.com>
6248 * typemanager.cs (IsFriendAssembly): Should not be called for building
6251 2007-05-09 Marek Safar <marek.safar@gmail.com>
6253 * literal.cs (NullConstant): Print null in all cases.
6255 * expression.cs (Binary.ResolveOperator): Implemented delegate
6256 comparison based on C# 2.0 changes.
6258 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
6260 This code is contributed under the MIT X11 license
6262 The following enables support for several C# 3.0 language features:
6264 * cs-tokenizer.cs: Added support for the "var" keyword.
6266 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6267 Added VarExpr class to facilitate type inferencing.
6269 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6270 to support anonymous types.
6272 * assign.cs: Added support for type inferencing and initialization.
6274 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6276 * expression.cs: Added implicit array support to ArrayCreation.
6277 Added 5 types and 1 interface:
6279 IInitializable Implementing classes can inject initializing
6280 statements after object instantiation.
6282 Initializer Stores data for object initialization.
6284 AnonymousType An expression for anonymous types.
6286 AnonymousTypeParameter Stores data about an anonymous type's field.
6288 NewInitialize An expression for object initialization.
6290 CollectionInitialize An expression for collection initialization.
6292 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6295 2007-05-06 Marek Safar <marek.safar@gmail.com>
6297 A fix for bug #81500
6298 * cs-tokenizer.cs: Add special handling for coalescing operator.
6300 2007-05-06 Marek Safar <marek.safar@gmail.com>
6302 A fix for bug #81529
6303 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6304 its value from base class until it is redefined.
6306 2007-05-02 Raja R Harinath <rharinath@novell.com>
6308 Fix regression in cs0631-3.cs
6309 * cs-parser.jay (operator_declarator): Add opt_attributes to error
6310 fallback. Make error fallback catch more cases.
6312 2007-05-01 Miguel de Icaza <miguel@novell.com>
6314 * cs-parser.jay: Allow parameters in operator declarations to have
6317 2007-04-27 Miguel de Icaza <miguel@novell.com>
6319 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6322 * lambda.cs (ContextualReturn.Resolve): An expression is valid
6323 inside the ContextualReturn, it does not have to be an
6324 ExpressionStatement.
6326 2007-04-24 Miguel de Icaza <miguel@novell.com>
6328 * lambda.cs (ContextualReturn.Resolve): if the return type is not
6331 2007-04-23 Miguel de Icaza <miguel@novell.com>
6333 * anonymous.cs (AnonymousContainer): split the virtual Resolve
6334 method in two methods: ResolveNoDefine and Resolve.
6336 ResolveNoDefine will stop just after ResolveTopBlock has been
6339 Resolve will then continue by creating a method and issuing the
6340 call to method.Define ().
6342 (AnonymousMethod): Split and implement the new Resolve and
6343 ResolveNoDefine as well.
6345 * lambda.cs (LambdaExpression): Split the anonymous method
6346 resolution code into a separate routine (CoreCompatibilityTest)
6347 from DoCompatibleTest.
6349 (LambdaExpression.TryBuild): New method, this method tries to
6350 build the LambdaExpression with the given set of types to be used
6351 as the types for the various parameters of the lambda expression.
6353 If the compilation succeed with the given types, the infered type
6354 of the Anonymous method is returned, otherwise null is returned.
6356 2007-04-23 Marek Safar <marek.safar@gmail.com>
6358 A fix for bug #81414
6359 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6361 2007-04-22 Miguel de Icaza <miguel@novell.com>
6363 * cs-tokenizer.cs: Change various identifiers here from the
6364 camelCasing to the recommended Linux-like style for instance
6365 variables from the Coding Guidelines.
6367 2007-04-19 Martin Baulig <martin@ximian.com>
6370 (Convert.ImplicitReferenceConversionCore): Allow conversions from
6371 System.Enum to System.ValueType.
6373 2007-04-13 Martin Baulig <martin@ximian.com>
6375 Rewrote implicit reference conversions. We need to distinguish
6376 between implicit reference conversions (13.1.4) and implicit
6377 boxing conversions (13.1.5).
6379 According to the spec, there's an an implicit conversion
6380 "From a one-dimensional array-type S[] to IList<T> and base
6381 interfaces of this interface, provided there is an implicit
6382 reference conversion from S to T." Note that this does not
6383 include boxing conversions.
6386 (Convert.ImplicitTypeParameterBoxingConversion): New method.
6387 (Convert.ImplicitReferenceConversion): Split into
6388 ImplicitReferenceConversionCore() and
6389 ImplicitBoxingConversionExist().
6390 (Convert.ImplicitReferenceConversionExists): Use the new
6391 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6393 2007-04-12 Martin Baulig <martin@ximian.com>
6395 * convert.cs (Convert.ImplicitReferenceConversion): Move the
6396 `TypeManager.null_type' checks up to the top of the method.
6398 2007-04-11 Marek Safar <marek.safar@gmail.com>
6400 A fix for bug #81350
6401 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6404 2007-04-11 Martin Baulig <martin@ximian.com>
6406 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6407 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6408 to make this work for generic classes; fixes #79561.
6410 2007-04-11 Martin Baulig <martin@ximian.com>
6412 * expression.cs (As): Add support for nullable types; fixes #79371.
6414 2007-04-11 Martin Baulig <martin@ximian.com>
6416 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6417 `type.FullName' is null; fixes #80243.
6419 2007-04-11 Martin Baulig <martin@ximian.com>
6421 * expression.cs (Invocation.IsApplicable): Don't modify the method
6422 if type inference succeeded, but the method was not applicable.
6425 2007-04-10 Marek Safar <marek.safar@gmail.com>
6427 A fix for bug #81324
6428 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6429 internal and external namespaces containers.
6431 2007-04-10 Martin Baulig <martin@ximian.com>
6433 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6434 TypeManager.DropGenericMethodArguments() so we also call
6435 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
6437 2007-04-10 Martin Baulig <martin@ximian.com>
6439 * iterators.cs (Iterator.CreateIterator): Don't crash if
6440 `method.ReturnType' is null. This happens if something went wrong
6441 while resolving that typ (we already reported an error in this case).
6443 2007-04-10 Martin Baulig <martin@ximian.com>
6445 * expression.cs (New.DoResolve): Don't call CheckComImport() on
6446 generic interfaces; report the CS0144 directly.
6448 2007-04-10 Martin Baulig <martin@ximian.com>
6450 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6451 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6453 2007-04-10 Martin Baulig <martin@ximian.com>
6455 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6457 2007-04-09 Raja R Harinath <rharinath@novell.com>
6460 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6461 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6464 * statement.cs (For.Resolve): If resolution fails, use
6467 2007-04-08 Marek Safar <marek.safar@gmail.com>
6469 * anonymous.cs (MakeName): Make faster and zero-based.
6470 (VerifyExplicitParameterCompatibility): Back to mode where generic
6471 parameter is ignored.
6472 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6474 * class.cs (EmitType): Method can emit another new method.
6476 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6478 * driver.cs: Updated.
6480 * lambda.cs: Reuse predefined empty parameters.
6482 * parameter.cs: Updated
6484 * support.cs: Implemented InflateTypes.
6486 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6487 (InitSystemCore): Introduced to isolate 3.0 dependencies.
6489 2007-04-03 Martin Baulig <martin@ximian.com>
6493 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6494 version of TypeManager.IsOverride() which also works with generic
6497 2007-04-03 Martin Baulig <martin@ximian.com>
6502 (Convert.ExplicitReferenceConversion): We need to cast when
6503 converting from IList<T> to S[].
6505 2007-04-01 Marek Safar <marek.safar@gmail.com>
6507 * decl.cs (FindExtensionMethods): Consider all candidates with same name
6510 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6512 2007-03-31 Marek Safar <marek.safar@gmail.com>
6514 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6515 argument and return type inferring.
6517 * codegen.cs (InferReturnType): Flag whether return can be inferred.
6518 (ReturnType): Turned to property.
6520 * statement.cs (Return): Implemented return type inferring.
6522 * support.cs (ReflectionParameters): Use local types if possible.
6524 2007-03-30 Raja R Harinath <rharinath@novell.com>
6526 * flowanalysis.cs (FlowBranching.Reachability): Remove.
6527 (FlowBranching.UsageVector): Update to changes.
6529 Prepare to kill 'Reachability'
6530 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6531 argument of constructor.
6533 2007-03-29 Raja R Harinath <rharinath@novell.com>
6535 Prepare to kill 'Reachability'
6536 * flowanalysis.cs (UsageVector.is_unreachable): New.
6537 (UsageVector): Update to maintain 'is_unreachable' in parallel to
6538 'reachability', and verify they're consistent.
6541 * expression.cs (New.EmitStatement): Handle type parameters here too.
6543 2007-03-29 Martin Baulig <martin@ximian.com>
6548 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6549 CompilerGeneratedClass.
6550 (ScopeInfo.EmitScopeInstance): Make this protected.
6551 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6552 `ec.CurrentAnonymousMethod.Scope == Scope'.
6554 * statement.cs (Block.ScopeInfo): Make this a property.
6556 2007-03-27 Raja R Harinath <harinath@gmail.com>
6558 Prepare to kill 'Reachability'
6559 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6560 (FlowBranching.UsageVector.Reachability): Remove property.
6561 (FlowBranching.UsageVector.IsUnreachable): New property.
6562 (FlowBranching.UsageVector.ResetBarrier): New.
6563 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6564 * codegen.cs, statement.cs: Update to changes.
6566 2007-03-27 Martin Baulig <martin@ximian.com>
6571 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6574 2007-03-26 Raja R Harinath <rharinath@novell.com>
6576 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6577 instead of TriState. Remove all mention of TriState.
6579 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6580 replaced by a boolean. Add boolean 'is_unreachable' field, check
6581 and maintain invariants.
6583 2007-03-25 Marek Safar <marek.safar@gmail.com>
6585 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6587 2007-03-25 Marek Safar <marek.safar@gmail.com>
6589 * expression.cs: Stop using obsolete 2.0 opcodes.
6591 2007-03-25 Marek Safar <marek.safar@gmail.com>
6593 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6594 one of the latests Martin's fixes.
6596 2007-03-23 Miguel de Icaza <miguel@novell.com>
6598 * expression.cs: On BigEndian systems, swap the bytes, temporary
6599 solution until we get a new bitconverter class.
6601 2007-03-23 Martin Baulig <martin@ximian.com>
6605 * decl.cs (MemberCache.AddMembers): Add generic methods both as
6606 "Method" and "Method`1". Normally, a cache lookup is done on the
6607 "Method" form (ie. without the generic arity), but this one makes
6608 lookups on the full form work as well.
6610 2007-03-22 Raja R Harinath <rharinath@novell.com>
6612 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6615 2007-03-20 Bill Holmes <billholmes54@gmail.com>
6617 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6618 ordered_member_list, to TypeBuilder to store members to be defined
6619 in the order they were parsed in.
6620 - ordered_explicit_member_list contains all properties indexers
6621 and methods that are defined as explicit implementation of an
6622 interface or base class.
6623 - ordered_member_list contains all properties indexers and methods
6624 that are not defined as explicit implementation of an interface
6627 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
6628 functionality in these removed classes has been replaced with
6629 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
6630 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6632 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6633 to CheckForDuplications inside GetMethod and SetMethod Define Method
6634 to handle method property and indexer name conflicts.
6638 All code is contributed under the MIT/X11 license.
6640 2007-03-20 Martin Baulig <martin@ximian.com>
6642 * class.cs (TypeContainer.Interfaces): Removed; they're now
6643 included in `TypeContainer.Types'.
6645 2007-03-20 Martin Baulig <martin@ximian.com>
6647 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
6649 * class.cs (TypeContainer.CreateType): New public method. This is
6650 now called before DefineType() to create the TypeBuilders.
6651 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6652 has already been created by CreateType().
6653 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6654 don't resolve our base classes here; this has been moved into
6655 DefineBaseTypes(). We're now called from CreateType().
6656 (TypeContainer.DefineBaseTypes): New private method; resolve our
6657 base classes here. We're now called from DefineType().
6660 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6661 our types first to create all the TypeBuilders. After that, call
6662 TypeContainer.DefineType() on all the types which'll resolve their
6663 base classes and setup the resolve order.
6665 2007-03-20 Martin Baulig <martin@ximian.com>
6667 * class.cs (TypeContainer.Enums): Removed; they're now included in
6668 `TypeContainer.Types'.
6670 2007-03-20 Martin Baulig <martin@ximian.com>
6673 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6674 (TypeContainer.DoResolveMembers): Call DefineType() on our
6675 `compiler_generated' classes; moved here from DefineNestedTypes().
6678 (RootContext.ResolveTree): Call ResolveMembers() on all
6679 TypeContainer's in the `type_container_resolve_order'.
6681 2007-03-19 Marek Safar <marek.safar@gmail.com>
6683 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6685 2007-03-17 Marek Safar <marek.safar@gmail.com>
6687 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6688 implementation flags.
6690 2007-03-17 Marek Safar <marek.safar@gmail.com>
6692 * class.cs: More optimizations for type parameters.
6694 2007-03-15 Marek Safar <marek.safar@gmail.com>
6696 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6698 * ecore.cs, parameter.cs: More common code for both corlibs.
6700 * typemanager.cs (IsGenericMethod): Simplified.
6702 2007-03-15 Raja R Harinath <rharinath@novell.com>
6704 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6706 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6708 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6709 unconditionally. Simplify explanation.
6710 (Try.Resolve, Using.Resolve): Likewise.
6712 2007-03-15 Martin Baulig <martin@ximian.com>
6716 * decl.cs (DeclSpace): If we're a partial class, use our
6717 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6719 2007-03-15 Raja R Harinath <rharinath@novell.com>
6721 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6723 (FlowBranching.UsageVector): Update to changes.
6724 (FlowBranching.MergeSiblings): Likewise.
6725 * statement.cs: Likewise.
6727 2007-03-15 Martin Baulig <martin@ximian.com>
6732 (MemberCache): Added a special .ctor for type parameters.
6735 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6738 2007-03-09 Martin Baulig <martin@ximian.com>
6740 * enum.cs (Enum): Make this a TypeContainer.
6741 (EnumMember): Derive from `Const'.
6744 (Const.DoResolveValue): New protected virtual method; move most of
6745 the functionality of ResolveValue() here so we can override it in
6747 (Const.CreateConstantReference): Make this virtual.
6749 * class.cs (Kind): Add `Kind.Enum'.
6750 (TypeContainer.Emit): Don't emit the enums here; they're already
6751 in the `RootContext.typecontainer_resolve_order'.
6753 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6754 here; they're already in the `typecontainer_resolve_order'.
6756 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6757 TypeManager.DropGenericTypeArguments().
6760 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6761 (TypeManager.IsEnumType): Likewise.
6762 (TypeManager.EnumToUnderlying): Likewise.
6763 (TypeManager.IsEqual): Add support for enums.
6765 2007-03-12 Raja R Harinath <rharinath@novell.com>
6767 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6768 DefaultParameterValueAttribute to be undefined, say if System.dll
6771 2007-03-11 Marek Safar <marek.safar@gmail.com>
6773 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6776 2007-03-10 Marek Safar <marek.safar@gmail.com>
6778 * class.cs, parameter.cs: Unified parameters verification.
6780 2007-03-08 Martin Baulig <martin@ximian.com>
6782 * cs-parser.jay (constructor_header): Pass the location to the
6783 newly created TopLevelBlock.
6785 2007-03-07 Martin Baulig <martin@ximian.com>
6787 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6789 2007-03-06 Miguel de Icaza <miguel@novell.com>
6791 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6792 with the changes from David, fixes the build.
6794 2007-03-05 David Mitchell <dmitchell@logos.com>
6796 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6797 and its base interfaces to a one-dimensional array type S[],
6798 provided there is an implicit or explicit reference conversion
6801 2007-03-03 Marek Safar <marek.safar@gmail.com>
6803 * cs-tokenizer.cs: Implemented basic linq grammar.
6805 * driver.cs: Set linq lang version on demand.
6807 2007-02-26 Marek Safar <marek.safar@gmail.com>
6809 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6811 2007-02-25 Marek Safar <marek.safar@gmail.com>
6813 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6816 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6818 Check property and event extern attributes.
6820 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6823 2007-02-24 Marek Safar <marek.safar@gmail.com>
6825 A fix for bug #80407
6826 * ecore.cs: Don't report ambiguity error when methods have same parent.
6828 2007-02-23 Marek Safar <marek.safar@gmail.com>
6830 A fix for bug #80878
6831 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6833 2007-02-22 Marek Safar <marek.safar@gmail.com>
6835 * attribute.cs: Enable ExtensionAttribute presence test.
6837 2007-02-22 Marek Safar <marek.safar@gmail.com>
6839 * class.cs: Warn about missing GetHashCode only when Equals is override.
6841 * decl.cs: Check accessibility of type arguments.
6843 * typemanager.cs: Correctly report nullable array.
6845 2007-02-20 Marek Safar <marek.safar@gmail.com>
6847 * class.cs, report.cs: Capture more details when things go wrong.
6849 2007-02-20 Marek Safar <marek.safar@gmail.com>
6851 A fix for bug #80650
6852 * cs-parser.jay: Anonymous container starts at constructor declaration
6853 and not at block beginning because it has to be usable in constructor
6856 * statement.cs: Use context location and not block one for error reporting.
6858 2007-02-18 Marek Safar <marek.safar@gmail.com>
6860 A fix for bug #78712
6861 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6864 2007-02-18 Marek Safar <marek.safar@gmail.com>
6866 A fix for bug #80493 by Atsushi Enomoto
6867 * cs-parser.jay: Ignore invalid attribute target.
6869 2007-02-18 Marek Safar <marek.safar@gmail.com>
6871 * cs-tokenizer.cs: Ignore '\0' as white space character.
6873 2007-02-17 Miguel de Icaza <miguel@novell.com>
6875 * cs-parser.jay: Add support for lambda expressions to the mcs
6878 * lambda.cs: Only clone when we are probing, not on the final call
6879 (Compatible is the final call).
6881 * statement.cs (CloneContext): Introduce class to provide block
6882 remapping during clone.
6884 All statements Clone themselves now.
6886 (Clone): special handling for blocks, when we clone a block, we
6887 register the block inside this routine, as children of the block
6888 might trigger a lookup.
6890 * expression.cs: Add support for CloneContext in all expressions.
6892 2007-02-17 Marek Safar <marek.safar@gmail.com>
6894 A fix for bug #80493
6895 * statement.cs: Report ambiguous warning when interfaces are not related.
6897 2007-02-15 Marek Safar <marek.safar@gmail.com>
6899 C# 3.0 extension methods.
6901 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6902 cannot be used directly.
6904 * class.cs (Class.Emit): Emit extension attribute if any class method
6905 is extension method.
6906 (Method.Define): Add basic extension method validation conditions.
6907 (Method.Emit): Emit extension attribute for method.
6909 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6910 extension method exists. Currently we follow same approach as Microsoft
6911 does, emit even if a method or a class are private but this can change
6914 * cs-parser.jay: Add handling of `this' keyword in method parameters
6917 * decl.cs (DeclSpace.IsStaticClass): New property.
6918 (MemberCache.FindExtensionMethods): Looks for extension methods with
6919 defined name and extension type.
6921 * doc.cs: Updated after OverloadResolve changes.
6923 * driver.cs: Add new soft reference to System.Core.dll.
6925 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6926 (ExtensionMethodGroupExpr): Represents group of extension methods.
6928 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6929 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6930 to MethodGroupExpr and made non-static for easier customization.
6931 (Invocation.DoResolve): Add extension method lookup when no standard
6933 (MemberAccess.DoResolve): Try extension methods if no member exists.
6935 * modifiers.cs: Add METHOD_EXTENSION modifier.
6937 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6938 as well as candidate extension type.
6939 (ComputeNamespaces): When assembly constains extension methods registers
6941 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6942 extension method lookup.
6943 (Namespace.LookupExtensionMethod): Looks for extension method in this
6945 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6946 find a method which matches name and extensionType.
6948 * parameter.cs (Parameter): Add This modifer.
6949 (HasExtensionMethodModifier): New property.
6950 (Resolve): Add extension parameter check.
6951 (ModFlags): turned to property to exclude this modifier as it is not real
6953 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6955 * support.cs (ParameterData): Add ExtensionMethodType.
6956 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6958 * typemanager.cs: Add type and ctor extension attribute type.
6960 2007-02-15 Miguel de Icaza <miguel@novell.com>
6962 * report.cs (DisableErrors, EnableErrors): used to prevent error
6963 output when we are "trying" to compile various methods with
6966 * ecore.cs (Expression): Add Clone method that calls the virtual
6967 CloneTo method. The current CloneTo method in Expression throws
6968 an exception so we can track down all the places where this must
6969 be implemented (not using abstract, because that would be a lot of
6970 up-front-work before we can start testing the implementation
6973 Important: we only need Clone capabilities for expressions created
6974 by the parser, as the expressions we will be cloning are
6975 expressions in the pre-resolved state. This vastly simplifies
6978 (SimpleName): Add CloneTo that does nothing.
6979 (EmptyCast): Add CloneTo.
6981 * expression.cs (Binary): Implement CloneTo.
6982 (Invocation.IsApplicable): Store the current ec in
6983 EmitContext.TempEc and restore it on return. This is used so we
6984 do not have to sprinkle hundres of methods with an extra
6985 EmitContext, we know that the only user is the lambda expression
6986 ImplicitConversionExists code.
6988 (Argument): Add Cloning capabilities.
6989 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6990 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6991 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6992 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6993 IndexerAccess): Add Clone capability.
6995 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6997 (Argument): Add cloning capability.
6999 * assign.cs (Assign): Implement CloneTo.
7001 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
7003 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
7004 version by calling Convert with the EmitContext (that we are
7005 currently storing in ec, this is not great, but will do for now,
7006 to avoid passing EmitContext parameters to hundreds of functions
7007 that do not need them now).
7009 (SetExpression): Remove, it is not needed.
7011 (ContextualReturn): Implement CloneTo.
7013 * statement.cs (Statement): Implement cloning infrastructure,
7014 similar to expressions.
7016 (Block): Partial implementation of Clone for statements.
7018 (Return): Implement clone.
7020 * constant.cs (Constant.CloneTo): New method, does nothing.
7022 * codegen.cs (TempEc): Add a static EmitContext as a temporary
7023 solution, until we decide how to exactly do this.
7025 2007-02-14 Marek Safar <marek.safar@gmail.com>
7027 A fix for bug #80493
7028 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
7029 a property is override we need to use second accessor.
7031 2007-02-13 Marek Safar <marek.safar@gmail.com>
7033 A fix for bug #80418
7034 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
7037 2007-02-13 Marek Safar <marek.safar@gmail.com>
7039 Another fix for bug #80749
7040 * pending.cs: Abstract class has priority over interfaces.
7042 2007-02-13 Marek Safar <marek.safar@gmail.com>
7044 Another fix for bug #80749
7045 * pending.cs: Abstract class has priority over interfaces.
7047 2007-02-13 Marek Safar <marek.safar@gmail.com>
7049 Another fix for bug #80749
7050 * pending.cs: Abstract class has priority over interfaces.
7052 2007-02-13 Marek Safar <marek.safar@gmail.com>
7054 Another fix for bug #80749
7055 * pending.cs: Abstract class has priority over interfaces.
7057 2007-02-13 Marek Safar <marek.safar@gmail.com>
7059 * class.cs Better error message.
7061 * driver.cs: Add shorter versions of -optimize option.
7063 2007-02-13 Martin Baulig <martin@ximian.com>
7065 * class.cs (Constructor.Emit): Check the return value of
7066 ec.ResolveTopBlock() and return on error.
7068 2007-02-13 Raja R Harinath <rharinath@novell.com>
7070 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
7071 message to fix error message regression.
7073 2007-02-12 Marek Safar <marek.safar@gmail.com>
7075 * delegate.cs: Delegate creation expression cannot be of Nullable type.
7077 2007-02-12 Marek Safar <marek.safar@gmail.com>
7079 A fix for bug #80749
7080 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7081 its parent container.
7083 * class.cs (DefineFieldInitializers): Each initializer can has different
7086 * const.cs: Updated.
7088 2007-02-11 Miguel de Icaza <miguel@novell.com>
7090 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7091 now all the heavy lifting to check that embedded statements or
7092 expressions have the right form is done in the ContextualReturn.
7094 (ContextualReturn): New class.
7096 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7097 method that can be invoked to report 201, so we do not replicate
7100 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7102 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7103 treating tabs as spaces.
7105 2007-02-09 Marek Safar <marek.safar@gmail.com>
7107 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7108 * assign.cs: Use full implicit conversion for right side check.
7110 2007-02-09 Marek Safar <marek.safar@gmail.com>
7112 * statement.cs (Switch): Switch over boolean type is not standardized.
7114 2007-02-08 Marek Safar <marek.safar@gmail.com>
7116 A fix for bug #80755
7117 * decl.cs (FindBaseEvent): Don't use method cache for events.
7119 2007-02-07 Marek Safar <marek.safar@gmail.com>
7121 * cs-parser.jay: Better syntax error handling.
7123 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7124 instead of underlying type value.
7126 2007-02-06 Marek Safar <marek.safar@gmail.com>
7128 * driver.cs: Check define identifier before is registered.
7130 * namespace.cs: Use existing error message.
7132 * report.cs: New warning.
7134 2007-02-06 Marek Safar <marek.safar@gmail.com>
7136 A fix for bug #80742
7137 * expression.cs: Delegate Invoke method can be called directly.
7139 2007-02-06 Marek Safar <marek.safar@gmail.com>
7141 A fix for bug #80676
7142 * class.cs (IsEntryPoint): The Main method can have params modifier.
7144 2007-02-04 Miguel de Icaza <miguel@novell.com>
7146 * parameter.cs (Parameter, Parameters): Add Clone method.
7148 * anonymous.cs (Compatible): Turn method into virtual method, so
7149 LambdaExpression can implement a different behavior.
7151 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7152 out the basic checking here, so it can be used by
7155 * lambda.cs: Introduce "Compatible" function that will do the
7158 2007-02-02 Marek Safar <marek.safar@gmail.com>
7160 * attribute.cs: Unified one error message.
7162 * class.cs (Class): Use type attributes and not properties to test static
7164 (IsEntryPoint): Don's pass local variable.
7166 * convert.cs: Removed duplicate check.
7168 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7170 * driver.cs: Don't crash when soft reference does not exist.
7172 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7173 (UsingEntry): Removed redundant allocation.
7175 * parameter.cs: Add fast path for type parameters.
7177 * support.cs: Don't allocate attribute when it's not used.
7179 2007-01-30 Miguel de Icaza <miguel@novell.com>
7182 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7183 this into a virtual method, so we can override it in LambdaExpression.
7185 * driver.cs: Improve diagnostics in case of failure.
7187 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7188 write a function that is slightly more complex and that parses:
7190 type identifier [, type identifier]* )
7192 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7195 (canEmpty ? i >= 0 : i > 0)
7197 2007-01-30 Raja R Harinath <rharinath@novell.com>
7199 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7200 exception on possibly valid code.
7202 2007-01-29 Raja R Harinath <rharinath@novell.com>
7204 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7206 (parse_opt_type_arguments): Remove. It's almost the same as
7208 (parse_namespace_or_typename): Use parse_less_than.
7210 2007-01-28 Miguel de Icaza <miguel@novell.com>
7212 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7213 this bug took a few hours to find, because the state saved and
7214 restored by PushPosition and PopPosition was ignoring the state of
7215 parse_generic_less_than.
7217 I can also now remove the handling of OP_LT and OP_GT, this solves
7220 * cs-tokenizer.cs: store the location for the ARROW token, we use
7223 (PushPosition, PopPosition): save/restore also `current_token',
7224 restore `parse_generic_less_than' (was missing).
7226 (parse_opt_type_arguments): use parse_type, not
7227 parse_namespace_or_typename to parse types.
7229 * lambda.cs: Empty new file, will eventually have the lambda
7230 expression implementation.
7232 * lambda.test: used to test the internal tokenizer.
7234 * report.cs (FeatureIsNotISO1): Rename from
7235 FeatureIsNotStandardized, because it was about the language level
7236 (1 vs 2) it was not about standarization.
7238 (FeatureRequiresLINQ): New.
7240 * support.cs (SeekableStreamReader): Only require that the reader
7241 is a TextReader, not a StreamReader, so we can plug StringReader.
7243 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7244 given position in the input stream the following tokens can be
7245 parsed as a type followed by an identifier.
7247 (is_punct): after a '(' if parse_type_and_parameter returns true,
7248 then return a special token OPEN_PARENS_LAMBDA which is used to
7249 avoid reduce/reduce errors in the grammar for the
7250 lambda_expression rules.
7252 (parse_type): implement a type parser inside the
7253 tokenizer, the parser only returns true or false depending on
7254 whether the input at a given position can be parsed as a type.
7256 (peek_token): new method used during type parsing.
7258 2007-01-28 Raja R Harinath <rharinath@novell.com>
7261 * anonymous.cs (ScopeInfo.InflateParameters): New.
7262 (AnonymousContainer.Resolve): Use it to redirect types of
7263 delegate parameters.
7265 2007-01-27 Raja R Harinath <rharinath@novell.com>
7268 * expression.cs (Error_InvalidArguments): Don't use two different
7269 messages for CS1503. Use ExtraInformation and
7270 SymbolRelatedToPreviousError instead.
7273 * decl.cs (DeclSpace.initialize_type_params): Don't access
7274 'type_params' of a partial class directly.
7276 2007-01-26 Miguel de Icaza <miguel@novell.com>
7278 * constant.cs: Removed a handful of out-of-range checks that were
7281 2007-01-25 Marek Safar <marek.safar@gmail.com>
7283 * expression.cs (CheckUselessComparison): Add additional check for char
7286 * namespace.cs: Fixed typo.
7288 2007-01-23 Miguel de Icaza <miguel@novell.com>
7290 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7291 gone, instead we inline the test, preventing the needless casts to
7292 longs, ulongs and doubles for the parameters, avoiding calls to
7293 methods that overchecked stuff, and instead inlined things
7296 2007-01-20 Marek Safar <marek.safar@gmail.com>
7298 * cs-parser.jay: Better parameter error handling.
7300 2007-01-17 Marek Safar <marek.safar@gmail.com>
7302 A fix for bug #80368, #80522
7303 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7304 whether array initializer contains constants only.
7305 (ArrayCreation.Emit): Use better formula to decide when
7306 are array initializers for static initialization.
7307 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7308 have to emit even constants otherwise they are pre-initialized.
7310 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
7311 Raja R Harinath <rharinath@novell.com>
7313 Fix emit order of 'get' vs. 'set'.
7314 * support.cs (Accessors): New.
7315 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7316 Note the order in which accessors are declared in the source.
7317 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7318 Refactored from Property.Define and Indexer.Define.
7319 (PropertyBase.DefineAccessors): New helper that calls the above in
7320 appropriate order as noted by the parser.
7321 (Property.Define, Indexer.Define): Update to changes.
7322 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7324 2007-01-17 Raja R Harinath <rharinath@novell.com>
7326 Fix cs0029-6.cs and gcs0029-2.cs (regression)
7327 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7328 there's an implicit conversion from the current type to the target
7329 type before converting the underlying constant.
7331 2007-01-16 Marek Safar <marek.safar@gmail.com>
7333 * const.cs (ResolveValue): Updated after constant conversion was made more
7336 * constant.cs (GetAttributableValue): constant to object conversion is
7337 used for attributes only.
7338 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7339 constant conversions.
7340 (LongConstant.ConvertImplicitly): Ditto.
7342 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7343 (ImplicitConversionStandard): Handle constant conversion as extra step.
7344 It solves the issue when constant conversion was called indirectly like
7345 inside array initializer and constant folding was skipped.
7347 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7350 * statement.cs(ImplicitConversionStandard): Updated after constant
7351 conversion was made more generic.
7353 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
7355 * expression.cs (As.DoResolve): Use GenericConstraints instead of
7356 Constraints, solves the problem where the compiler incorrectly
7357 reported that a type parameter was not constrained to a class (Bug
7360 2007-01-14 Marek Habersack <grendello@gmail.com>
7362 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7364 2007-01-14 Marek Safar <marek.safar@gmail.com>
7366 A fix for bug #80368
7367 * assign.cs (FieldInitializer): New class implements field
7368 initializer statement.
7370 * attribute.cs: Update after FieldMember rename.
7372 * class.cs (PropertyBasedMember): New common class for property based
7374 (InterfaceMemberBase): New base class for all members which can be used as
7375 an interface members.
7376 (MethodCore): Moved really common code to InterfaceMemberBase.
7377 (Method.Define): Equal and GetHasCode detection is relevant for methods
7379 (MethodData.Define): Don't assume that public event implements an
7380 interface automatically.
7381 (MethodData.DefineMethodBuilder): Issue an error even if only extern
7383 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7384 (FieldMember): Merged with FieldBase.
7385 (EventProperty.AEventPropertyAccessor): New specialization to check whether
7386 event extern modifier can be used.
7387 (EventField.EventFieldAccessor): Moved event field specific code here.
7388 (Event.AllowedModifiers): Even event can be extern.
7389 (Event.FindOutBaseMethod): New override specific to events.
7390 (Indexer.parameters): Reintroduce parameters because base class holds
7391 only properties common data.
7392 (Indexer.CheckForDuplications): Indexers are threated as methods so we
7393 need do extra parameters check.
7395 * const.cs: Update after FieldMember rename.
7397 * decl.cs (MemberCache.FindBaseEvent): New method.
7399 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7400 to reflect that indexer is now derived from PropertyBased.
7402 * ecore.cs (GetMemberType): Made public.
7403 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7406 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7408 * typemanager.cs (CSharpSignature): Correctly print event accessors.
7409 (RegisterEvent): Removed.
7410 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7411 (GetPrivateFieldOfEvent): Renamed to GetEventField.
7413 2007-01-11 Raja R Harinath <rharinath@novell.com>
7416 * statement.cs (CollectionForeach.TryType): Prefer generic
7417 GetEnumerator over non-generic variant. Fix code to follow comments.
7419 2007-01-09 Raja R Harinath <rharinath@novell.com>
7422 * support.cs (ReflectionParameter): Don't use an invalid index on
7423 the generic parameter data.
7425 2007-01-08 Miguel de Icaza <miguel@novell.com>
7427 * driver.cs: Just add a tiny bit of infrastructure.
7429 2007-01-02 Marek Safar <marek.safar@gmail.com>
7431 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7432 where field type is struct from current assembly.
7434 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7437 2007-01-02 Marek Safar <marek.safar@gmail.com>
7439 A fix for bug #80381
7440 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7443 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7445 (Namespace.LookupType): Always use core types from corlib when speficied.
7447 * report.cs: A new warning.
7449 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7450 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7451 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7453 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7454 (InitCoreTypes): Set expression type of object_type and value_type
7455 immediately after lookup.
7457 2007-01-01 Miguel de Icaza <miguel@novell.com>
7459 * cs-tokenizer.cs: Accept Pc class characters (Connector
7460 Punctuation) as valid identifiers. Fixes #78259
7462 * expression.cs (Invocation.DoResolve): Moved the check for the
7463 use of `this' for doing method calls to the Invocation resolution
7464 step, after overload resolution has taken place instead of doing
7465 the check at the low-level `This.DoResolve' level.
7467 The `This.DoResolve'(appens before overload resolution, so it has
7468 no way of knowing if the method that will be called will be
7469 instace or static, triggering an erroneous report for cs0188 (Bug
7472 We now do the check for instance method invocations after we know
7473 what method will be called.
7475 (This.CheckThisUsage): Move the actual use of this structure
7476 checking into its own method and expose it.
7478 * Everywhere that called Error_ValueCannotBeConverted: pass a new
7481 Exceptions: Null.ConvertImplicitly,
7482 Constant.ImplicitConversionRequired as there are too many call
7483 sites for passing the ec.
7485 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7486 EmitContext, if the value is null, then we do not try to provide
7487 the extra information from the error (If a userdefined conversion
7488 exists, as UserDefinedConversion requires a non null-EmitContext).
7492 2006-12-30 Raja R Harinath <rharinath@novell.com>
7494 * flowanalysis.cs (MyBitVector): Document some invariants.
7495 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7496 introduced below, and add a couple of others,
7498 2006-12-30 Marek Safar <marek.safar@gmail.com>
7500 * attribute.cs (GetMethodObsoleteAttribute): Uses new
7501 GetPropertyFromAccessor and GetEventFromAccessor.
7503 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7504 overrides non-obsolete one.
7505 (Indexer.Define): Error message has been moved to the parser.
7507 * cs-parser.jay: Better syntax errors handling.
7509 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7510 when an invocation has no arguments.
7512 * ecore.cs: Removed not used caching.
7514 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7517 * report.cs: Add a new warning.
7519 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7521 * typemanager.cs (enumeration_type): Removed.
7522 (CSharpSignature): Reuses IsSpecialMethod.
7523 (IsEqual): Hack for MS BCL.
7524 (GetPropertyFromAccessor): New method.
7525 (GetEventFromAccessor): New method.
7526 (IsSpecialMethod): Fixed to handle more cases.
7528 2006-12-30 Marek Safar <marek.safar@gmail.com>
7530 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7531 Made white spaces array static.
7533 * ecore.cs (RemoveGenericArity): Optimized.
7535 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7537 (MyBitVector.initialize_vector): Simplified.
7539 2006-12-22 Miguel de Icaza <miguel@novell.com>
7541 * ecore.cs: Am not entirely happy with this hack, but it seems to
7542 address the issue in 80257 (a small test case for
7545 I set the MethodGroupExpr.Type to an internal compiler type
7546 (itself in this case) to force the resolution to take place. Why
7547 it does not take place with a null is beyond me.
7549 2006-12-20 Marek Safar <marek.safar@gmail.com>
7551 A fix for bug #80288
7552 * expression.cs (ResolveOperator): Consider user defined conversion for
7553 logical and operator too.
7554 (EmitBranchable): Optimization for logical and when full constant folding
7555 could not be applied but one operand is constant.
7557 2006-12-19 Marek Safar <marek.safar@gmail.com>
7559 * class.cs (GetClassBases): Write 5 times every day, will never use
7560 FullName for error reporting.
7562 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7564 2006-12-19 Martin Baulig <martin@ximian.com>
7566 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7567 the symbol file info here.
7569 2006-12-18 Marek Safar <marek.safar@gmail.com>
7571 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7572 of `elseif' is taking then following sections are not taking.
7573 Fixes an issue reported on mono mailing list.
7575 2006-12-18 Marek Safar <marek.safar@gmail.com>
7577 A fix for bug #80300
7578 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7579 a caller is not taking.
7581 2006-12-18 Raja R Harinath <rharinath@novell.com>
7583 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7584 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7585 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7586 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7587 * class.cs: Update to changes.
7589 2006-12-17 Marek Safar <marek.safar@gmail.com>
7591 A fix for bug #79934
7592 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7595 * class.cs (ResolveMembers): Register an iterator in current container and
7598 2006-12-16 Raja R Harinath <rharinath@novell.com>
7601 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7602 satisfy a params annotated parameter.
7604 2006-12-16 Marek Safar <marek.safar@gmail.com>
7606 A fix for bug #77014
7607 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7608 paramters correctly and not rely on hacks in Parameters class.
7609 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7611 (Invocation.VerifyArgumentsCompat): Ditto.
7612 (Invocation.EmitArguments): Changed to correctly emit params arguments at
7615 * parameter.cs (HasParams): Don't assume that params is the last one.
7617 * support.cs (ReflectionParameters.ctor): Look for params attribute
7619 (ReflectionParameters.ParameterType): Removed hack when we returned last
7620 parameter for out of range parameters.
7621 (ParameterName, ParameterModifier): Ditto.
7623 2006-12-14 Marek Safar <marek.safar@gmail.com>
7625 A fix for bug #79987
7626 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7627 when assembly is not CLS compliant but type is. I have no idea why is this
7630 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7632 2006-12-13 Miguel de Icaza <miguel@novell.com>
7634 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7635 in struct constructors, they are basically no-ops.
7637 2006-12-12 Marek Safar <marek.safar@gmail.com>
7639 * cs-tokenizer.cs (Position): Save preprocessor status too.
7641 2006-12-12 Marek Safar <marek.safar@gmail.com>
7643 A fix for bug #77794
7644 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7646 2006-12-12 Marek Safar <marek.safar@gmail.com>
7648 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7650 (pp_expr): Report error for an invalid expression.
7651 (handle_preprocessing_directive): Simplified; add more error checking.
7653 2006-12-11 Marek Safar <marek.safar@gmail.com>
7655 A fix for bug #74939
7656 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7657 directives handling.
7659 2006-12-10 Marek Safar <marek.safar@gmail.com>
7661 A fix for bugs #80093, and #75984
7662 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7663 logic, it seems to me as it worked before "by coincidence".
7664 (xtoken): Simplified to use reworked handle_preprocessing_directive.
7665 (cleanup): Enabled endif check.
7667 2006-12-09 Marek Safar <marek.safar@gmail.com>
7669 A fix for bug #80162
7670 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7671 enumerators are never ambiguous.
7673 2006-12-08 Raja R Harinath <rharinath@novell.com>
7676 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7678 2006-12-06 Marek Safar <marek.safar@gmail.com>
7680 A fix for bug #80144
7681 * class.cs (EventProperty.Define): Explicit implementation means
7682 that an even is used.
7684 2006-12-06 Marek Safar <marek.safar@gmail.com>
7686 Fixes the operators implementation (part II)
7688 * cfold.cs (DoConstantNumericPromotions): Renamed to
7689 DoBinaryNumericPromotions and simplified.
7690 (BinaryFold): Couple of conversion fixes; simplified.
7692 * constant.cs, ecore.cs, literal.cs
7693 (ToType): Renamed to ConvertImplicitly.
7694 (Reduce): Renamed to ConvertExplicitly.
7696 * class.cs, convert.cs: Updated.
7698 * expression.cs: TryReduce doesn't throw an exception.
7700 2006-12-01 Marek Safar <marek.safar@gmail.com>
7702 A fix for bug #80108
7703 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7706 2006-11-30 Marek Safar <marek.safar@gmail.com>
7708 Fixes unary operators implementation (part I)
7711 * cfold.cs (Error_CompileTimeOverflow): Made internal
7713 * const.cs (IConstant): Changed to use reference to constant and
7714 not constant itself.
7715 Updated IConstant implementations.
7717 * constant.cs (CreateConstant): New factory method.
7718 Updated IConstant implementation.
7720 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7722 * ecore.cs: Updated to use CreateConstantReference.
7724 * enum.cs: Reflects IConstant changes.
7726 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7728 * literal.cs (NullConstant): Change to be independently usable.
7730 2006-11-29 Martin Baulig <martin@ximian.com>
7732 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7733 we need to emit the scope initializer before calling the base .ctor.
7735 * anonymous.cs: Merged back from the new anonymous methods branch.
7736 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7738 * expression.cs (ParameterReference.DoResolveBase): Create a
7739 "normal" ScopeInfo when capturing parameters rather than using the
7740 root scope; this makes things work with anonymous methods having
7744 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7746 2006-11-22 Marek Safar <marek.safar@gmail.com>
7748 A fix for bug #79987
7749 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7750 check to a base class.
7751 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7752 only when assembly has missing attribute.
7753 * report.cs: Update.
7755 2006-11-21 Marek Safar <marek.safar@gmail.com>
7757 * cs-tokenizer.cs: Merged with gmcs version.
7759 2006-11-20 Marek Safar <marek.safar@gmail.com>
7762 * cs-parser.jay: Better error message when partial keyword is misplaced.
7764 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7766 A fix for bug #79810
7767 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7768 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7769 a RuntimeWrappedException by default.
7771 2006-11-18 Marek Safar <marek.safar@gmail.com>
7773 A fix for bug #79843
7774 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7776 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7778 2006-11-18 Marek Safar <marek.safar@gmail.com>
7780 * driver.cs, namespace.cs: Uses faster IndexOf version.
7782 2006-11-17 Marek Safar <marek.safar@gmail.com>
7784 A fix for bug #79941
7785 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7787 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7788 even if internal name is different.
7789 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7790 (UserDefinedConversion): Simplified as the operators cannot be internal.
7791 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7793 (MethodLookup): Replaced EmitContext with parentType.
7794 * expression.cs: Updated.
7796 2006-11-09 Raja R Harinath <rharinath@novell.com>
7798 * driver.cs (BadAssembly): Handle all the ugliness of
7799 DefineDynamicAssembly.
7801 2006-11-08 Raja R Harinath <rharinath@novell.com>
7803 Address parts of #58244 -- most of what's left is in the runtime
7804 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7805 CS1509 error checks, and handle them for all assembly loads, not
7806 just the first invocation.
7807 (LoadModule): Likewise. Move handling of 'adder_method' ...
7808 * codegen.cs (AssemblyClass.AddModule): ... here.
7810 2006-11-02 Marek Safar <marek.safar@gmail.com>
7812 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7813 IEnumerable<T> is ambiguous.
7815 2006-10-31 Marek Safar <marek.safar@gmail.com>
7817 A fix for bug #67689
7818 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7819 GetEnumerator is ambiguous.
7821 * report.cs: Add new warning.
7823 2006-10-29 Marek Safar <marek.safar@gmail.com>
7825 A fix for bug #78602
7826 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7827 to protected member can be nested type.
7829 2006-10-28 Marek Safar <marek.safar@gmail.com>
7831 A fix for bug #78965
7832 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7833 to protected member must derive from current type.
7835 2006-10-27 Marek Safar <marek.safar@gmail.com>
7837 assign.cs: Reuses error method.
7839 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7840 instead of type for constants.
7841 (Expression.Error_ValueAssignment): Common error method.
7843 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7846 2006-10-27 Marek Safar <marek.safar@gmail.com>
7848 A fix for bug #79081
7849 * expression.cs (MemberAccess.DoResolve): Check nested type
7852 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7854 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7856 2006-10-26 Marek Safar <marek.safar@gmail.com>
7858 A fix for bug #76591
7859 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7861 2006-10-26 Marek Safar <marek.safar@gmail.com>
7863 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7864 type forwarder of the same type multiple times.
7866 2006-10-26 Raja R Harinath <rharinath@novell.com>
7869 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7870 instance as an rvalue, even when we later resolve as an lvalue.
7872 2006-10-25 Martin Baulig <martin@ximian.com>
7874 * anonymous.cs: Fix #79673.
7876 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7878 A fix for bug #79666
7879 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7880 ignored when is optimized (= default value) as its value is already set.
7882 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7884 A fix for bug #79724
7885 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7886 TypeContainer for type lookup.
7888 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7890 A fix for bug #79231
7891 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7892 * expression.cs (OverloadResolve): Always convert type name for
7894 (ResolveNamespaceOrType): Don't confuse a nested type with any
7897 2006-10-18 Martin Baulig <martin@ximian.com>
7899 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7901 2006-10-17 Miguel de Icaza <miguel@novell.com>
7903 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7904 an int32, but requesting an int64 from the conversion
7906 2006-10-12 Martin Baulig <martin@ximian.com>
7909 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7911 2006-10-12 Martin Baulig <martin@ximian.com>
7914 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7916 2006-10-11 Miguel de Icaza <miguel@novell.com>
7918 * convert.cs: Remove broken code: I was doing the "Existance"
7919 tests for Implicit conversions.
7921 2006-10-10 Miguel de Icaza <miguel@novell.com>
7923 * convert.cs: Added one missing case in
7924 ImplicitStandardConversionExists uint64 to intptr.
7928 * typemanager.cs (uintptr_type): another core known type.
7930 * ecore.cs (OperatorCast): routine used to do cast operations that
7931 depend on op_Explicit. We could change some of the Decimal
7932 conversions to use this.
7934 This one has a probe mechanism that checks both types for an op_
7935 which it coudl be used to eliminate two classes: CastToDecimal
7936 and CastFromDecimal.
7938 * convert.cs: Implement the conversions documented in #59800
7940 2006-10-10 Martin Baulig <martin@ximian.com>
7942 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7943 before RootScope.ResolveMembers().
7945 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7946 `CurrentType' if appropriate.
7948 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7950 A fix for bug #78568
7951 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7952 when contains binary operators.
7953 * cs-parser.jay: Updated.
7955 2006-10-09 Martin Baulig <martin@ximian.com>
7958 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7959 moved that into Define() and also do the other type parameter
7960 checks there. Fixes #79094. Added gtest-292.cs.
7963 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7964 since that doesn't include type parameters; don't use `Ldelema'
7965 for type parameters. Fixes #78980. Added gtest-293.cs.
7967 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7970 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7971 conversion is allowed.
7973 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7975 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7976 error reporting when no error occurs.
7978 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7980 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7983 2006-10-06 Raja R Harinath <rharinath@novell.com>
7986 * class.cs (DefineTypeBuilder): Check circular dependencies before
7987 setting the parent of the TypeBuilder.
7988 (CheckRecursiveDefinition): Don't use 'BaseType', since
7989 it may not be valid until after DefineTypeBuilder. Use
7990 'base_type' instead.
7992 2006-10-04 Martin Baulig <martin@ximian.com>
7994 Merged the Anonymous Methods patch.
7996 * anonymous.cs, iterators.cs: The new anonymous methods code.
7998 * statement.cs (Variable): New public abstract class.
7999 (LocalInfo.Variable): New public property.
8000 (LocalInfo.ResolveVariable): New public method.
8001 (Block.Flags): Add `IsIterator'.
8002 (Block.AddVariable): Improved the CS0136 check.
8003 (Block.AnonymousChildren): New public property.
8004 (Block.AddAnonymousChild): New public method.
8005 (ToplevelBlock): Update to use the new anonymous method framework.
8006 (ToplevelBlock.ctor): `container' is now a `Block' and not a
8007 `ToplevelBlock'; this is required to correctly implement the
8009 (Fixed, Using): Use `TemporaryVariable' instead of directly
8010 creating the `LocalBuilder'.
8012 * parameter.cs (Parameter.ResolveVariable): New public method.
8013 (Parameters.ResolveVariable): Likewise.
8015 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
8017 * class.cs (TypeContainer): Replaced the `iterators' list and
8018 corresponding methods with a list of `CompilerGeneratedClass'es.
8019 (TypeContainer.ResolveMembers): New public method.
8020 (Method): `IIteratorContainer' has been replaced by
8023 * expression.cs (VariableReference): New public abstract base
8024 class for `LocalVariableReference', `ParameterReference' and
8027 * codegen.cs (EmitContext): Removed `capture_context',
8028 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
8029 (EmitContext.EmitThis): Removed.
8031 * cs-parser.jay: Replace `iterator_container' with
8034 2006-10-04 Martin Baulig <martin@ximian.com>
8036 * generic.cs (GenericMethod): Don't make this abstract.
8037 (Constraints.Clone): Added dummy implementation.
8039 2006-10-04 Raja R Harinath <harinath@gmail.com>
8042 * namespace.cs (LookForAnyGenericType): Avoid nullref on
8043 'declspaces'. Avoid allocating arrays willy-nilly.
8046 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
8047 cases out of the switch.
8049 2006-09-28 Marek Safar <marek.safar@seznam.cz>
8051 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
8052 message when non-generic type is used with the type arguments.
8053 * expression.cs: Updated.
8055 2006-09-28 Raja R Harinath <rharinath@novell.com>
8058 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
8059 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8060 Change semantics slightly. Don't insist on having only one
8061 temporary EmptyExpression -- just throttle the creation of new ones.
8064 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
8065 non-interfaces too. If no methods are found, don't try to create
8068 2006-09-28 Marek Safar <marek.safar@seznam.cz>
8070 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
8073 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
8074 us produce better error message.
8076 2006-09-27 Marek Safar <marek.safar@seznam.cz>
8078 * expression.cs (Binary.ResolveOperator): Warn about a side effect
8079 of the `|' operator.
8081 * report.cs: A new warning added.
8083 2006-09-27 Martin Baulig <martin@ximian.com>
8085 * generic.cs (GenericMethod): Don't make this abstract.
8087 2006-09-27 Martin Baulig <martin@ximian.com>
8090 (InternalErrorException): Added overloaded ctor taking a params array.
8092 2006-09-26 Marek Safar <marek.safar@seznam.cz>
8094 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8095 Fixed the cases when same error was reported twice.
8097 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8098 now report symbol information.
8100 2006-09-25 Martin Baulig <martin@ximian.com>
8102 * class.cs: Completely unified with the gmcs version.
8104 2006-09-25 Martin Baulig <martin@ximian.com>
8106 * typemanager.cs (TypeManager.IsNullableType): New public function.
8107 (TypeManager.IsNullableTypeOf): Likewise.
8108 (TypeManager.IsNullableValueType): Likewise.
8110 * class.cs (MethodCore): Added the `GenericMethod' argument from
8111 gmcs and also unified all classes derived from `MethodCore' with gmcs.
8113 2006-09-24 Raja R Harinath <harinath@gmail.com>
8115 * convert.cs: Unify with gmcs version.
8117 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8119 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8120 verify them as well.
8122 * report.cs: New warning.
8124 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8126 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8127 for anonymous block with out argument.
8129 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8131 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8132 not used private events only.
8134 2006-09-23 Marek Safar <marek.safar@seznam.cz>
8136 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8138 * const.cs (Const.Define): Check for constant type.
8139 (Const.IsConstantTypeValid): Looks for valid constant types.
8141 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8143 * ecore.cs (EmptyConstantCast): New common class for all constant based
8146 * expression.cs (Is.DoResolve): Handle null constant especially.
8147 (New.DoResolve): Check for new void().
8148 (MemberAccess.DoResolve): Cope with all kind of nulls.
8150 * literal.cs (NullConstant): Uses EmptyConstantCast.
8151 (NullDefault): Based on EmptyConstantCast.
8152 (NullLiteral): Uses EmptyConstantCast.
8154 * statement.cs (Block.ResolveMeta): Check for constant type.
8156 2006-09-22 Martin Baulig <martin@ximian.com>
8158 * delegate.cs, attribute.cs: Merged with the gmcs versions.
8160 2006-09-22 Raja R Harinath <rharinath@novell.com>
8162 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8166 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8167 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
8170 2006-09-22 Martin Baulig <martin@ximian.com>
8172 * ecore.cs: Merged with the gmcs version.
8174 * generic.cs (ConstructedType): New dummy class.
8175 (TypeArguments): Don't make this abstract.
8178 (TypeManager.IsGenericTypeDefinition): New method.
8179 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8181 2006-09-22 Raja R Harinath <rharinath@novell.com>
8183 * expression.cs (ComposedCast): Check for arrays of TypedReference
8184 before creating the type, not after.
8186 2006-09-21 Marek Safar <marek.safar@seznam.cz>
8188 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8189 after ToType change.
8191 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8192 when constant must be implicitly convertible.
8194 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8196 * ecore.cs (NullCast): Derives from NullConstant.
8198 * expression.cs (Is.DoResolve): Removed useless variables.
8199 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8200 (New.Constantify): Add enum support.
8201 (MemberAccess.DoResolve): Add warning when accessing null constant or
8204 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8207 * literal.cs (NullConstant): New abstract class with common
8208 functionality for all null specializations.
8209 (NullDefault): Represents default(X) when result can be
8211 (NullLiteral): Updated.
8213 * report.cs: Add new warning.
8215 2006-09-21 Martin Baulig <martin@ximian.com>
8217 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8219 2006-09-21 Martin Baulig <martin@ximian.com>
8221 * generic.cs (GenericConstraints): New dummy class.
8222 (Constraints): Likewise.
8223 (TypeParameter): Likewise.
8224 (TypeParameterName): Likewise.
8225 (GenericMethod): Likewise.
8227 * typemanager.cs (TypeManager.GetGenericArguments): New method.
8229 * decl.cs: Merged with the gmcs version.
8231 2006-09-21 Raja R Harinath <rharinath@novell.com>
8233 * generic.cs (TypeParameter): Implement IMemberContainer.
8234 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
8236 * rootcontext.cs: Unify with gmcs version.
8238 * report.cs: Unify with gmcs version.
8239 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8240 from gmcs/generics.cs.
8241 * generics.cs (TypeParameter): New dummy class.
8243 * support.cs: Unify with gmcs version.
8245 2006-09-20 Raja R Harinath <rharinath@novell.com>
8247 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8248 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8250 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8251 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8252 * mcs.exe.sources: Add generic.cs.
8254 * codegen.cs: Unify with gmcs version.
8256 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8257 (EmitContext): Add GenericDeclContainer implementation.
8258 * decl.cs (MemberCore, DeclSpace): Likewise.
8259 * namespace.cs: Remove #ifdef GMCS_SOURCE.
8261 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8262 MCS TypeManager has a corresponding dummy method.
8264 2006-09-19 Martin Baulig <martin@ximian.com>
8266 * expression.cs: Completely merged with the gmcs version.
8268 2006-09-19 Martin Baulig <martin@ximian.com>
8270 * expression.cs (Invocation): Merged with the gmcs version.
8271 (ArrayAccess.GetStoreOpcode): Likewise.
8273 2006-09-19 Martin Baulig <martin@ximian.com>
8276 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8277 (TypeManager.IsGenericMethodDefinition): Likewise.
8279 2006-09-19 Martin Baulig <martin@ximian.com>
8282 (TypeManager.IsEqual): Moved the gmcs implementation here.
8283 (TypeManager.DropGenericTypeArguments): Likewise.
8284 (TypeManager.DropGenericMethodArguments): Likewise.
8285 (TypeManager.GetTypeArguments): Moved here from gmcs.
8286 (TypeManager.HasGenericArguments): Likewise.
8288 2006-09-19 Martin Baulig <martin@ximian.com>
8290 * expression.cs (Binary): Merged with the gmcs version.
8292 2006-09-19 Martin Baulig <martin@ximian.com>
8294 * expression.cs (Probe, As, Is): Merged with the gmcs version.
8296 2006-09-19 Martin Baulig <martin@ximian.com>
8298 * typemanager.cs: Merged with the gmcs version.
8300 2006-09-16 Raja R Harinath <rharinath@novell.com>
8302 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8303 * driver.cs: Likewise.
8305 2006-09-16 Marek Safar <marek.safar@seznam.cz>
8308 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8309 only if parent type is class.
8310 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8313 2006-09-15 Marek Safar <marek.safar@seznam.cz>
8316 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8318 * typemanager.cs(CSharpName): Converts NullType to null.
8320 2006-09-15 Martin Baulig <martin@ximian.com>
8323 (TypeManager.GetMethodName): Added mcs implementation.
8324 (TypeManager.IsEqual): Likewise.
8327 (SimpleName.RemoveGenericArity): Added dummy implementation.
8329 * pending.cs: Merged with the gmcs version.
8331 2006-09-15 Martin Baulig <martin@ximian.com>
8333 * statement.cs: Merge with the gmcs version.
8335 2006-09-15 Martin Baulig <martin@ximian.com>
8337 * statement.cs (Switch): Merge with the gmcs implementation
8338 (without nullables), which is newer.
8340 2006-09-15 Martin Baulig <martin@ximian.com>
8342 * statement.cs (Block.Variables): Make this public.
8343 (ToplevelBlock.Parameters): Make this a property.
8344 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8346 2006-09-15 Martin Baulig <martin@ximian.com>
8348 * namespace.cs: Merge with the gmcs version.
8350 2006-09-15 Martin Baulig <martin@ximian.com>
8352 * decl.cs (MemberName): Minor code cleanups.
8354 2006-09-15 Martin Baulig <martin@ximian.com>
8356 * parameter.cs: Merge with the gmcs version.
8358 2006-09-15 Martin Baulig <martin@ximian.com>
8360 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8361 and an error in mcs.
8363 2006-09-15 Martin Baulig <martin@ximian.com>
8365 * flowanalysis.cs: Merged from GMCS; added the generics code into
8366 a `GMCS_SOURCE' conditional so we can share this file.
8368 2006-09-08 Martin Baulig <martin@ximian.com>
8370 * typemanager.cs (TypeManager.interlocked_type): New public field.
8371 (TypeManager.int_interlocked_compare-exchange): New public field.
8372 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8373 enumerator types here and call InitGenericCoreTypes().
8374 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8375 after calling InitEnumUnderlyingTypes().
8378 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8379 `classes_second_stage'.
8381 2006-09-14 Marek Safar <marek.safar@seznam.cz>
8383 * assign.cs, ecore.cs, expression.cs: Share error message text.
8384 * class.cs (FieldMember.Define): Check for varible of static type.
8385 * driver.cs (LoadAssembly): Uses error output for errors.
8386 * statement.cs: Updated.
8388 2006-09-08 Marek Safar <marek.safar@seznam.cz>
8390 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8393 2006-09-07 Martin Baulig <martin@ximian.com>
8396 (MainDriver): Revert r62663 from Marek; see #70506 for details.
8398 2006-08-29 Miguel de Icaza <miguel@novell.com>
8400 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8402 2006-08-17 Miguel de Icaza <miguel@novell.com>
8404 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8405 #52019 and #79064, the use of the \uXXXX sequence in source code
8406 to represent unicode characters.
8408 2006-08-15 Marek Safar <marek.safar@seznam.cz>
8410 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8412 * class.cs, ecore.cs, statement.cs: Merged to one error message.
8414 2006-08-13 Miguel de Icaza <miguel@novell.com>
8416 * assign.cs: Catch attempts to assign to a method groups in += and
8419 2006-08-13 Marek Safar <marek.safar@seznam.cz>
8422 * cs-parser.jay: Don't destroy current array type by typeof of array's.
8424 2006-08-12 Marek Safar <marek.safar@seznam.cz>
8426 * class.cs (Method.Define): Issue a warning when generic method looks like
8428 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8431 2006-08-09 Marek Safar <marek.safar@seznam.cz>
8433 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8435 * decl.cs (MemberCache.FindMembers): When container is interface we need to
8436 search all base interfaces as a member can be ambiguous.
8437 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8438 Constructor member type filter.
8439 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8440 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8441 reporting for returned memberinfos.
8442 * report.cs: Updated.
8443 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8444 version to work on all runtimes.
8445 (TypeManager.RealMemberLookup): Removed members filtering.
8447 2006-08-08 Raja R Harinath <rharinath@novell.com>
8449 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8450 (PropertyExpr.EmitAssign): Likewise.
8451 * expression.cs (Indirection.EmitAssign): Likewise.
8452 (LocalVariableReference.EmitAssign): Likewise.
8453 (ParameterReference.EmitAssign): Likewise.
8454 (Invocation.EmitArguments): Likewise.
8455 (ArrayAccess.EmitAssign): Likewise.
8456 (IndexerAccess.EmitAssign): Likewise.
8457 (This.EmitAssign): Likewise.
8458 (ConditionalLogicalOperator.Emit): Likewise.
8461 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
8462 instead of ArrayList. If the hashtable has a LocalBuilder, don't
8463 leave it in after returning it.
8464 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
8466 2006-08-06 Marek Safar <marek.safar@seznam.cz>
8468 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8471 2006-08-03 Raja R Harinath <rharinath@novell.com>
8473 Fix cs0146-3.cs and cs0146-4.cs.
8474 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8475 enclosing types don't depend on the current type.
8477 2006-08-02 Raja R Harinath <rharinath@novell.com>
8480 * class.cs (TypeContainer.DoDefineMembers): Use
8481 FindBaseMemberWithSameName on Parent, since we're interested in
8482 whether we hide inherited members or not.
8483 (FindBaseMemberWithSameName): Make slightly more robust.
8485 Fix the non-generic testcase from #77396
8486 * decl.cs (DeclSpace.DeclContainer): Remove override.
8488 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8489 declspaces for doppelgangers too.
8490 (UsingEntry): Implement IResolveContext.
8491 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
8492 'this' as the resolve context.
8493 (LocalAliasEntry): Likewise.
8495 Implement parts of #77403
8496 * roottypes.cs (RootDeclSpace): New. Used to represent the
8497 toplevel declaration space. Each namespace declaration introduces
8498 a "partial" root declaretion space.
8499 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8500 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8501 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8502 from 'current_namespace.SlaveDeclSpace'.
8503 (namespace_declaration): Likewise.
8504 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8505 check. It can't happen now.
8506 * decl.cs (DeclSpace.LookupType): Likewise.
8507 * driver.cs (MainDriver): Sanity check.
8509 2006-08-01 Raja R Harinath <rharinath@novell.com>
8511 * decl.cs (DeclSpace.FindNestedType): Remove.
8512 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8513 LookupTypeContainer to get the container of the nested type.
8514 * class.cs (TypeContainer.FindNestedType): Make non-override.
8516 2006-07-31 Raja R Harinath <rharinath@novell.com>
8518 * decl.cs (DeclSpace.PartialContainer): Move field from ...
8519 * class.cs (TypeContainer.PartialContainer): ... here.
8520 (TypeContainer.AddBasesForPart): New helper.
8521 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
8523 * cs-parser.jay (current_class): Convert to DeclSpace.
8524 (struct_declaration, interface_declaration, class_declaration):
8525 Use AddBasesForPart instead of .Bases directly.
8526 * const.cs, iterators.cs: Update to changes.
8528 2006-07-28 Raja R Harinath <rharinath@novell.com>
8530 * class.cs (TypeContainer.AddMemberType): Rename from
8532 (TypeContainer.AddMember): Rename from AddToMemberContainer.
8533 (AddTypeContainer): New. Combine AddClassOrStruct and
8535 (AddPartial): Update. Add 'is_partial' argument.
8536 * roottypes.cs: Update to changes.
8537 * cs-parser.jay (push_current_class): New helper for handling
8538 current_container and current_class.
8539 (struct_declaration, interface_declaration, class_declaration):
8542 2006-07-26 Raja R Harinath <rharinath@novell.com>
8544 * roottypes.cs: Rename from tree.cs.
8546 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8547 * tree.cs (Tree, ITreeDump): Remove types.
8548 * rootcontext.cs (tree, Tree): Remove fields.
8549 (root, ToplevelTypes): New.
8550 * *.cs: Update to rename.
8552 * tree.cs (Tree.RecordDecl): Remove.
8553 (RootTypes.AddToTypeContainer): Record the toplevel type in its
8555 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8557 2006-07-23 Raja R Harinath <harinath@gmail.com>
8559 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8560 DoFlowAnalysis and OmitStructFlowAnalysis here.
8561 (ec.With): Rename from WithUnsafe and generalize.
8562 (ec.WithCheckState): Remove. All users can be handled by 'With'.
8563 (ec.WithFlowAnalyis): New.
8564 * ecore.cs, expression.cs, statement.cs: Update.
8566 2006-07-22 Raja R Harinath <harinath@gmail.com>
8568 * statement.cs (Block.ResolveMeta): Simplify slightly.
8570 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
8571 multiple boolean fields. Convert InUnsafe, constant_check_state,
8572 check_state to flags.
8573 (CheckState, ConstantCheckState): Update.
8574 (InUnsafe): New read-only property.
8575 (FlagsHandle): Rename from CheckStateHandle and convert to handle
8577 (WithUnsafe): New helper similar to WithCheckState.
8578 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8579 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8581 2006-07-21 Raja R Harinath <rharinath@novell.com>
8583 Make comparisons use the same IL irrespective of whether they're
8584 in a 'checked' or 'unchecked' context: one of the issues in #78899
8585 * codegen.cs (EmitContext.CheckState): Make read-only property.
8586 (EmitContext.ConstantCheckState): Likewise.
8587 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8588 helper that implement a save/restore stack for CheckState
8589 values. This is the only way to change check-state.
8590 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8591 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8592 (CheckedExpr.EmitBranchable): New forwarding method.
8593 (UnCheckedExpr): Likewise.
8594 * statement.cs (Block.ResolveMeta): Use WithCheckState.
8595 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8596 (Checked.Resolve, checked.DoEmit): Likewise.
8598 2006-07-20 Miguel de Icaza <miguel@novell.com>
8600 * anonymous.cs: Cache the resolved anonymous delegate, and return
8601 this so that the ResolveTopBlock is only triggered once, not
8604 Currently we trigger ResolvetopBlock twice due to a first pass of
8605 argument check compatibility, and a second pass that does the
8608 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8610 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8612 * rootcontext.cs (Reset): Add helper_classes.
8614 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8617 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8620 2006-07-13 Miguel de Icaza <miguel@novell.com>
8622 * statement.cs (Lock): Handle expressions of type
8623 TypeManager.null_type specially. Fixes #78770
8625 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8627 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8630 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8632 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8633 for accessors as well.
8634 * ecore.cs (EventExpr): Add AccessorTable.
8636 2006-07-01 Marek Safar <marek.safar@seznam.cz>
8639 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8640 for CS0122 where appropriate.
8641 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8643 (Filter): Assembly can be null in the case of top level attributes.
8645 2006-06-25 Marek Safar <marek.safar@seznam.cz>
8649 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8650 is done at global level.
8652 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8654 A fix for #77002, Implemented TypeForwarder support.
8656 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8657 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8658 * typemanager.cs (): Add type_forwarder_attr_type.
8660 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8662 * report.cs: Add CS0469 warning.
8664 2006-06-21 Martin Baulig <martin@ximian.com>
8666 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8667 the `try'-block, so we also report CS0016 etc. there.
8669 2006-06-21 Martin Baulig <martin@ximian.com>
8672 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8674 2006-06-21 Martin Baulig <martin@ximian.com>
8676 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8677 also report CS1686 for parameters.
8679 2006-06-21 Martin Baulig <martin@ximian.com>
8681 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8682 instead of an error if the value is not implicitly convertible to
8683 the switch types; fixes #77964.
8685 2006-06-21 Raja R Harinath <rharinath@novell.com>
8688 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8689 FieldBuilder is null.
8692 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8693 'left' and 'right' before error-checking.
8695 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8697 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8699 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8700 (FieldExpr.DoResolve): likewise.
8701 (PropertyExpr.InstanceResolve): likewise.
8702 (EventExpr.InstanceResolve): likewise.
8704 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8706 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8707 attribute applicable tests for attribute argument.
8709 2006-06-02 Raja R Harinath <rharinath@novell.com>
8712 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8713 (Binary.OverloadResolve_PredefinedIntegral): New.
8714 (Binary.OverloadResolve_PredefinedFloating): New.
8715 (Binary.OverloadResolve_PredefinedString): New.
8716 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8717 Follow the standard more closely, and treat numeric promotions in
8718 terms of overload resolution.
8719 (Binary.CheckShiftArguments): Simplify.
8721 2006-06-01 Raja R Harinath <rharinath@novell.com>
8723 * flowanalysis.cs (MyBitVector): Simplify representation.
8724 (MyBitVector.Clone): Avoid allocating BitArray.
8725 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8726 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8727 (*): Update. Change all references to MyBitVector.And and
8728 MyBitVector.Or to &= and |=.
8730 2006-05-29 Raja R Harinath <rharinath@novell.com>
8733 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8734 to param arguments too.
8736 2006-05-26 Miguel de Icaza <miguel@novell.com>
8738 * cs-parser.jay: Catch another parsing form for arglist being
8739 followed by other arguments. Fixes #78313.
8741 2006-05-24 Raja R Harinath <rharinath@novell.com>
8743 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8744 checking of out parameters to ...
8745 (FlowBranchingToplevel.Merge): ... here.
8746 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8747 set, propagate the origin upward, and only complain if there was
8749 (FlowBranchingException.AddContinueOrigin): Likewise.
8750 (FlowBranchingException.AddReturnOrigin): Likewise.
8751 (FlowBranchingException.AddGotoOrigin): Likewise.
8753 2006-05-23 Raja R Harinath <rharinath@novell.com>
8755 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8756 unreachable, skip it.
8757 (FlowBranchingException.Merge): Always propagate jumps, even if
8758 the finally block renders subsequent code unreachable.
8760 2006-05-18 Raja R Harinath <rharinath@novell.com>
8763 * statement.cs (Goto.Resolve): Move responsibility for resolving
8764 'goto' to FlowBranching.AddGotoOrigin.
8765 (Goto.SetResolvedTarget): New. Callback to set the
8766 LabeledStatement that's the target of the goto.
8767 (Goto.DoEmit): Use Leave instead of Br when crossing an
8768 unwind-protect boundary.
8769 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8770 LookupLabel and adjust to new semantics.
8771 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8772 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8773 Goto.SetResolvedTarget to update target.
8774 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8775 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8776 AddBreakOrigin & co. Delay propagation until ...
8777 (FlowBranchingException.Merge): ... this.
8779 * statement.cs (Block.Resolve): Always depend on flow-branching to
8780 determine unreachability. Kill workaround that originally emitted
8781 only one statement after an "unreachable" label (see infloop in
8784 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8785 This is still "wrong", but anything better would probably need a
8786 multi-pass algorithm.
8787 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8788 usage vector. Force current usage vector to be reachable, to
8789 optimistically signify backward jumps.
8790 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8792 (FlowBranchingLabeled.Merge): New. If no backward jump was
8793 detected, return the original salted-away usage vector instead,
8794 updated with appropriate changes. Print unreachable warning if
8796 * statement.cs (Block.Resolve): Don't print unreachable warning on
8797 a labeled statement.
8799 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8801 * driver.cs: Pass filename without path to AssemblyBuilder's
8802 AddResourceFile. Fixes bug #78407.
8804 2006-05-17 Raja R Harinath <rharinath@novell.com>
8806 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8807 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8808 (FlowBranching.MergeChild): Overwrite
8809 reachability information from Labeled branchings too.
8811 2006-05-16 Raja R Harinath <rharinath@novell.com>
8813 * statement.cs (Goto.Resolve): Merge jump origins here ...
8814 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8816 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8817 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8818 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8819 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8821 * statement.cs (Goto.Resolve): ... not here.
8822 (Goto.Emit): Remove CS1632 check.
8824 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8826 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8829 2006-05-11 Raja R Harinath <rharinath@novell.com>
8831 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8832 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8833 (FlowBranchingException.Label): Likewise.
8835 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8837 (MyBitVector.Or): Use it to avoid losing information (Count).
8838 (FlowBranching.MergeOrigins): Likewise.
8840 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8841 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8842 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8843 (UsageVector.ToString): Simplify.
8844 (UsageVector.MergeSiblings): Move here from ...
8845 (FlowBranching.Merge): ... here.
8846 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8849 2006-05-10 Raja R Harinath <rharinath@novell.com>
8851 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8852 null bitvector is treated as all-true.
8854 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8855 (MyBitVector): Rationalize invariants. 'vector != null' implies
8856 that we have our own copy of the bitvector. Otherwise,
8857 'InheritsFrom == null' implies all inherited bits are true.
8859 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8861 * statement.cs (LocalInfo): Add IsConstant.
8862 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8863 local variable for constants.
8865 2006-05-09 Raja R Harinath <rharinath@novell.com>
8867 * flowanalysis.cs (MyBitVector.Empty): New.
8868 (MyBitVector): Don't allow InheritedFrom to be null.
8869 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8870 (UsageVector, FlowBranching): Update to changes.
8872 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8873 recursion. The 'Parent == null' condition isn't sufficient for
8875 (FlowBranching.AddBreakOrigin): Likewise.
8876 (FlowBranching.AddContinueOrigin): Likewise.
8877 (FlowBranching.AddReturnOrigin): Likewise.
8878 (FlowBranching.StealFinallyClauses): Likewise.
8879 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8880 (FlowBranching.CheckOutParameters): Likewise.
8881 (FlowBranchingToplevel): Terminate all the above recursions here.
8882 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8883 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8885 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8887 (FlowBranchingToplevel): New. Empty for now.
8888 (FlowBranching.MergeTopBlock): Update.
8889 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8890 branching for the anonymous delegate.
8891 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8893 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8894 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8895 information at the start of the merge. Reorganize.
8897 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8899 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8901 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8903 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8904 to newly introduced ctor.
8906 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8907 message to one place.
8908 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8911 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8913 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8915 * ecore.cs (Expression.ResolveAsConstant): Updated.
8917 * statement.cs (ResolveMeta): Updated.
8919 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8921 * cs-parser.jay: __arglist cannot be used in initializer.
8923 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8926 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8929 2006-05-05 Raja R Harinath <rharinath@novell.com>
8931 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8932 (LabeledStatement): Add 'name' parameter.
8933 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8934 (Block.AddLabel): Update to changes.
8935 * cs-parser.jay (labeled_statement): Likewise.
8937 * flowanalysis.cs (BranchingType.Labeled): New.
8938 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8939 (FlowBranchingLabeled): New. Does nothing for now, but will
8940 eventually handle 'goto' flows.
8941 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8942 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8943 that's terminated ...
8944 (Block.Resolve): ... here.
8946 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8947 (UsageVector.MergeFinallyOrigins): Likewise.
8948 (FlowBranching.InTryOrCatch): Likewise.
8949 (FlowBranching.AddFinallyVector): Likewise.
8950 (FlowBranchingException): Update to changes.
8953 * statement.cs (Return.Resolve): Move error checking to ...
8954 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8955 (FlowBranchingException): Handle return origins like break and
8957 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8959 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8962 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8965 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8968 * class.cs (MethodData.Define): Do public accessor check only when method
8969 implements an interface.
8971 2006-05-04 Raja R Harinath <rharinath@novell.com>
8973 Remove special handling of 'break'
8974 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8975 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8976 (UsageVector.Break): Remove.
8977 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8979 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8981 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8982 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8984 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8987 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8988 be the interface member.
8990 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8993 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8994 for emitting small (int) values.
8996 2006-05-03 Raja R Harinath <rharinath@novell.com>
8999 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
9000 control-flow passes through the 'finally' after merging-in all the
9001 control-flows from 'try' and the 'catch' clauses.
9003 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
9004 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
9005 always true at the only non-recursive entry point.
9006 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
9007 FlowBranchingBreakable.
9008 (FlowBranchingLoop): Remove.
9009 * statement.cs (Return.DoResolve): Update to changes.
9012 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
9013 (FlowBranching.CreateBranching): Handle it: create a
9014 FlowBranchingContinuable.
9015 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
9016 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
9017 except that it handles the 'continue' command.
9018 (FlowBranching.UsageVector.MergeOrigins): Rename from
9020 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
9021 except that it overrides AddContinueOrigin.
9022 (FlowBranchingException): Override AddContinueOrigin, similar to
9024 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
9025 Create a new branching around the embedded statement.
9026 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
9027 control flow after the embedded statement.
9028 (Continue.Resolve): Move all error checking to AddContinueOrigin.
9030 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
9031 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
9032 FlowBranchingBreakable.
9033 (FlowBranchingSwitch): Remove.
9036 * statement.cs (Break.Resolve): Simplify. Move responsibility for
9037 error reporting to ...
9038 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
9039 Rename from 'AddBreakVector'. Add new location argument. Return
9040 a bool indicating whether the 'break' crosses an unwind-protect.
9041 (FlowBranchingException.AddBreakOrigin): Add.
9042 (FlowBranchingException.Merge): Propagate 'break's to surrounding
9043 flowbranching after updating with the effects of the 'finally'
9045 (FlowBranchingBreakable): New common base class for
9046 FlowBranchingLoop and FlowBranchingSwitch.
9048 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
9050 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
9052 2006-05-02 Raja R Harinath <rharinath@novell.com>
9054 * statement.cs (Do.Resolve): If the loop is infinite, set the
9056 (While.Resolve, For.Resolve): Set a barrier after the embedded
9057 statement. There's no direct control flow that goes from the end
9058 of the embedded statement to the end of the loop.
9059 * flowanalysis.cs (FlowBranching.Infinite): Remove.
9060 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
9061 above ensure that the reachability is correctly computed.
9063 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
9064 (UsageVector.MergeBreakOrigins): If the current path is
9065 unreachable, treat it as if all parameters/locals are initialized.
9066 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
9067 infinite loops before merging-in break origins.
9069 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
9070 (Reachability.Reachable): Split part into ...
9071 (Reachability.Unreachable): ... this. Simplify.
9072 (Reachability.IsUnreachable): Use 'Unreachable' instead.
9074 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
9075 (Reachability.SetThrowsSometimes): Likewise.
9076 (FlowBranchingBlock.MergeTopBlock): Don't compare against
9077 TriState.Always, use corresponding property.
9078 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
9079 (Block.Resolve): Likewise. Remove some redundant checks.
9081 2006-05-02 Raja R Harinath <harinath@gmail.com>
9083 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
9084 (Reachability.Meet): Don't bother checking AlwaysThrows --
9085 barrier is always set.
9086 (FlowBranchingBlock.Merge): Likewise.
9088 2006-05-01 Raja R Harinath <harinath@gmail.com>
9090 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9091 checks for unreachable.
9093 2006-05-01 Marek Safar <marek.safar@seznam.cz>
9096 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9098 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9099 whether field is really assigned.
9101 2006-04-30 Raja R Harinath <harinath@gmail.com>
9103 * flowanalysis.cs (Reachability): Make 4-argument constructor
9105 (Reachability.Meet): Rename from 'And'. Remove static variant.
9106 (Reachability.Always): Rename from the highly misleading
9107 'Reachability.Never'.
9108 (FlowBranching.Merge): Update to changes. Mark an impossible
9109 situation with a 'throw'.
9110 (*): Update to changes.
9112 2006-04-29 Raja R Harinath <harinath@gmail.com>
9114 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9116 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9117 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9118 (*): Update to changes.
9119 * statement.cs: Update to changes.
9121 2006-04-28 Marek Safar <marek.safar@seznam.cz>
9124 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9126 2006-04-28 Raja R Harinath <harinath@gmail.com>
9128 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9131 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9132 argument to two arguments: an usage-vector and a bool. Move call
9133 to FlowBranching.Merge () ...
9134 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9136 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9137 handling of loop and switch reachability to ...
9138 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9140 2006-04-27 Raja R Harinath <harinath@gmail.com>
9142 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9143 handling to FlowBranchingLoop.InLoop.
9144 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9146 2006-04-26 Marek Safar <marek.safar@seznam.cz>
9149 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9150 anonymous method is allowed from AnonymousContainer here.
9152 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9154 2006-04-24 Raja R Harinath <rharinath@novell.com>
9157 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9159 2006-04-23 Marek Safar <marek.safar@seznam.cz>
9162 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9163 (DoubleConstant.Reduce): Ditto.
9165 2006-04-23 Raja R Harinath <rharinath@novell.com>
9167 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9168 Remove 'lvalue_right_side' argument. Move parts to ...
9169 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9170 (LocalVariable.DoResolveLValue): ... these.
9172 2006-04-21 Raja R Harinath <rharinath@novell.com>
9175 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9176 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9177 (LocalVariableReference.DoResolveBase): Use it to implement new
9179 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9180 (Argument.Resolve): Simplify. Move CS1510 check ...
9181 * ecore.cs (Expression.ResolveLValue): ... here.
9182 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9183 (PropertyExpr.DoResolveLValue): Likewise.
9184 (FieldExpr.Report_AssignToReadonly): Likewise.
9185 (FieldExpr.DoResolve): Add 'out_access' argument. Use
9186 LValueMemberAccess or LValueMemberOutAccess on instance depending
9188 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9189 DoResolve as appropriate.
9191 2006-04-20 Raja R Harinath <rharinath@novell.com>
9194 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9195 implicit conversions on 'out' and 'ref' arguments.
9197 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9198 improve clarity. Remove dead code.
9201 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9202 (Catch.Resolve): Resolve VarBlock if it exists.
9204 2006-04-19 Miguel de Icaza <miguel@novell.com>
9206 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9207 twice, this was some residual code, the enumerator was emitted
9208 properly in the two branche of if later.
9210 2006-04-19 Raja R Harinath <rharinath@novell.com>
9212 * expression.cs (Cast.ResolveLValue): Remove. The result of a
9213 cast is never an lvalue.
9214 (Cast.DoResolve, Cast.ResolveRest): Combine.
9215 (Argument.Emit): Simplify slightly. Move 'Expr is
9216 IMemoryLocation' check ...
9217 (Argument.Resolve): ... here.
9218 (Argument.Error_LValueRequired): Remove. Inline into only user.
9220 Simplifications. Fix cs0191-2.cs
9221 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9222 CS1649 and CS1651 to ...
9223 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
9224 the actual selection of the error code and message to a lookup
9225 table. Add a dummy return value to simplify callsites.
9226 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9227 readonly fields of other instances of the same type. Move CS0197
9229 * expression.cs (Argument.Resolve): ... here. Simplify code.
9230 Ensure that ec.InRefOutArgumentResolving is only set during LValue
9231 resolution of an out or ref argument. The code simplification
9232 above uses this invariant.
9234 2006-04-18 Raja R Harinath <rharinath@novell.com>
9236 Possibly fix #77752. Fix cs1690-[4-7].cs.
9237 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9238 CheckMarshallByRefAccess. Drop parameter.
9239 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
9241 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9243 * report.cs (AllWarnings): Add CS1690.
9244 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9246 (LocalVariableReference.DoResolveBase): Update.
9248 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9250 * class.cs (MethodOrOperator): Moved common parts from method class.
9251 detect obsolete attributes.
9252 (Method.Define): Simplified as it reuses code from base.
9253 (Constructor.ValidAttributeTargets): Fixed issue found during
9255 (Destructor.ValidAttributeTargets): Fixed issue found during
9257 (Operator): Finished refactoring set off by #78020. Operator class is now
9258 ordinary method class.
9260 * anonymous.cs: Updated.
9262 * decl.cs (DeclSpace): Add IsGeneric
9264 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9266 * class.cs (Constructor.Emit): Don't emit the attributes twice.
9268 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9270 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9271 detect obsolete attributes.
9272 (Method.CreateEmitContext): Moved to MethodOrOperator.
9274 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9277 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9278 customized exception to make crash detection easier.
9279 (MethodOrOperator): Started to work on new base class for methods and
9281 (Method): Derives from MethodOrOperator.
9282 (Constructor.Emit): Emits its own attributes.
9283 (AbstractPropertyEventMethod.Emit): Ditto.
9284 (Operator): Derives from MethodOrOperator, will refactor fully in extra
9286 (Operator.Emit): It's temporary more tricky than should be.
9288 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9290 * report.cs (InternalErrorException): Add ctor with inner exception.
9292 2006-04-08 Marek Safar <marek.safar@seznam.cz>
9295 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9298 2006-04-07 Marek Safar <marek.safar@seznam.cz>
9301 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9304 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9306 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9307 attribute is present and Guid not.
9308 (Interface.ApplyAttributeBuilder): Ditto.
9310 * attribute.cs: Add error message.
9312 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9316 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9317 sources (it's composite) so hold them in extra array as they are used in
9318 Emit phase only. It worked in the previous versions by mistake.
9319 (Attribute.Emit): Emit attribute for more owners when exist.
9321 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9322 it has now different behaviour.
9324 2006-04-04 Marek Safar <marek.safar@seznam.cz>
9326 * constant.cs (Constant.IsDefaultInitializer): New method.
9328 * class.cs: Updated.
9330 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9331 re-initialize default values. It saves KBs almost for every assembly.
9332 Thanks Zoltan for the idea.
9333 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9334 (ArrayCreation.DoResolve): Resolve only once.
9335 (ArrayCreation.Emit): Emit static initializer only when it is faster.
9336 (ArrayCreation.GetAttributableValue): Cope with optimized values.
9338 2006-04-03 Zoltan Varga <vargaz@gmail.com>
9340 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9343 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9345 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9346 in an embedded statement too.
9348 2006-04-01 Raja R Harinath <rharinath@novell.com>
9351 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9353 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9357 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9360 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9362 2006-03-31 Marek Safar <marek.safar@seznam.cz>
9364 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9367 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9368 LocalTemporary change.
9370 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9372 (ClassOrStruct.DefineFieldInitializers): Implemented static field
9373 initializers optimization.
9374 (ClassOrStruct.TypeAttr): Moved from modifiers.
9375 (Constructor.CheckBase): Don't crash when static ctor has parameters.
9376 (FieldBase.ResolveInitializer): Resolves initializer.
9377 (FieldBase.HasDefaultInitializer): New property.
9379 * cs-parser.jay: Removed message.
9381 * expression.cs (CompilerGeneratedThis): New specialization.
9383 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9385 2006-03-28 Marek Safar <marek.safar@seznam.cz>
9387 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9389 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9391 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9392 be now EnumConstants only.
9394 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9396 * attribute.cs, driver.cs: Reset more caches.
9398 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9400 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9402 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9404 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9405 for easier reuse. Updated all overrides.
9406 (IntegralConstant): New base class for all integral constants.
9407 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9408 of the constant range, report custom error.
9409 (UIntConstant.Reduce): Fixed uint conversion.
9411 * ecore.cs, literal.cs: Reduce updates.
9413 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9417 * class.cs (Constructor.Define): Removed extra if for default ctors.
9418 A patch from Atsushi Enomoto.
9420 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9422 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9423 GetAttributableValue.
9425 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9428 * convert.cs (ImplicitConversionRequired): Error message moved to
9431 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9432 automatic implicit conversion of an output value.
9433 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9435 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9437 (TypeOf.GetAttributableValue): Add extra handling for object type.
9439 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9440 special error message.
9442 2006-03-25 Marek Safar <marek.safar@seznam.cz>
9444 * class.cs (Constructor.Emit): Don't crash when struct ctor is
9446 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9447 compatible with MS runtime.
9449 2006-03-23 Marek Safar <marek.safar@seznam.cz>
9451 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9452 attribute arguments here.
9454 * class.cs (Indexer.Define): The check was moved to attribute class.
9456 2006-03-22 Marek Safar <marek.safar@seznam.cz>
9458 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9459 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9462 2006-03-22 Raja R Harinath <rharinath@novell.com>
9464 Support ParameterDefaultValueAttribute in gmcs. Also applied to
9465 mcs to keep code differences small.
9466 * attribute.cs (Attribute.GetParameterDefaultValue): New.
9467 * typemanager.cs (parameter_default_value_attribute_type): New.
9468 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
9471 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9473 * expression.cs (StringConcat.Append): Reverted back to no warning state.
9475 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9477 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9479 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9482 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
9484 * doc-bootstrap.cs : fix build.
9486 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9488 * expression.cs (StringConcat.Append): Issue a warning when empty string
9491 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9493 * assign.cs (CompoundAssign.ResolveSource): Removed.
9495 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9498 * class.cs (TypeContainer.FindMethods): Removed.
9499 (TypeContainer.CheckMemberUsage): Made static.
9501 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9503 * constant.cs (CheckRange): Removed unused type argument.
9504 (CheckUnsigned): Removed unused type argument.
9506 * cs-parser.jay: Updated after MemberAccess clean up.
9507 Uses Length for empty string test.
9509 * cs-tokenizer.cs: Uses Length for empty string test.
9510 (IsCastToken): Made static.
9511 (is_hex): Made static.
9512 (real_type_suffix): Made static.
9514 * decl.cs (SetupCache): Made static.
9515 (OnGenerateDocComment): Removed unused ds argument.
9517 * delegate.cs (VerifyDelegate): Removed unused argument.
9519 * doc.cs: Uses Length for empty string test.
9521 * driver.cs: Uses Length for empty string test.
9523 * enum.cs (IsValidEnumType): Made static
9525 * expression.cs (EnumLiftUp): Removed unused argument.
9526 (ResolveMethodGroup): Ditto.
9527 (BetterConversion): Ditto.
9528 (GetVarargsTypes): Ditto.
9529 (UpdateIndices): Ditto.
9530 (ValidateInitializers): Ditto.
9531 (MemberAccess.ctor): Ditto.
9532 (GetIndexersForType): Ditto.
9534 * flowanalysis.cs: (MergeFinally): Removed unused argument.
9536 * iterators.cs: Updated after MemberAccess clean up.
9538 * location.cs: Uses Length for empty string test.
9540 * namespace.cs: Uses Length for empty string test.
9542 * report.cs (CheckWarningCode): Made static.
9544 * statement.cs (LabeledStatement): Removed unused argument.
9546 * typemanager.cs (FilterNone): Removed.
9548 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9550 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9553 * class.cs: Updated.
9555 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9557 * cs-parser.jay.cs: __arglist is not allowed for delegates.
9559 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9563 * expression.cs (VerifyArgumentsCompat): Reverted to double error
9564 reporting, it's more tricky than I thought.
9566 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9570 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
9572 (AnonymousMethod.ImplicitStandardConversionExists): New method.
9573 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9574 Add more error reporting; Fixed issue with params.
9576 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9578 * cs-parser.jay: AnonymousMethod requires host container.
9580 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9582 2006-03-18 Raja R Harinath <harinath@gmail.com>
9584 * class.cs: Change 'TypeContainer ds' constructor argument to
9585 'DeclSpace parent'. Some classes were missed below due to
9586 different naming convention.
9588 * class.cs (MemberCore.Parent): Delete. This makes the
9589 ParentContainer changes below enforceable by the compiler.
9591 Treat pointers to enclosing declaration space as 'DeclSpace', not
9593 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9594 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9596 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9598 (Block.AddThisVariable): Likewise.
9599 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9600 (AbstractPropertyEventMethod.Emit): Likewise.
9601 (AbstractPropertyEventMethod.EmitMethod): Likewise.
9602 (GetMethod.Define, SetMethod.Define): Likewise.
9603 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9604 (DelegateMethod.EmitMethod): Likewise.
9606 Fix regression test-partial-13.cs.
9607 Rationalize use of PartialContainer. Ensure that the partial
9608 class semantics can be tied to type-correctness, i.e., any
9609 violation will cause a compile error.
9610 * class.cs, const.cs: Access all fields that belong to class
9611 TypeContainer via ParentContainer. Arguments of EmitContexts and
9612 Resolve()-like functions still use 'Parent'.
9614 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9615 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9616 (PropertyMethod.CheckModifiers): Remove unused argument.
9617 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9620 2006-03-17 Raja R Harinath <harinath@gmail.com>
9622 Make semantics of PartialContainer simpler.
9623 * decl.cs (DeclSpace.IsPartial): Remove.
9624 * class.cs (TypeContainer.IsPartial): Likewise.
9625 (TypeContainer..ctor): Set PartialContainer to point to self.
9626 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9627 (TypeContainer.FindNestedType): Likewise.
9628 (MemberCore.ParentContainer): Simplify. Remove deprecation.
9630 2006-03-17 Marek Safar <marek.safar@seznam.cz>
9632 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9634 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9636 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9639 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9641 * class.cs (Operator.Define): An error for base conversion was not
9644 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
9646 * iterator.cs : yield break is allowed in try statement which has
9647 catch clauses. Fixed bug #77767.
9649 2006-03-13 Marek Safar <marek.safar@seznam.cz>
9651 A fix for #77593, #77574.
9653 * class.cs (MethodCore.CheckBase): Another if for operator.
9655 2006-03-09 Marek Safar <marek.safar@seznam.cz>
9657 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9660 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9661 (DelegateCreation.ImplicitStandardConversionExists): New method for just
9664 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9667 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9668 Updated after another emitcontext usage was clean up. It should help us to
9669 synchronize with gmcs easier.
9671 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9675 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9676 (Event.Define): ditto
9677 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9679 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9680 Removed redundant code and set NewSlot for Invoke method too.
9682 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9683 (Parameters.MergeGenerated): New method. Use this method when you merge
9684 compiler generated argument with user arguments.
9686 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9688 * attribute.cs (ResolveAsTypeTerminal): Removed.
9690 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9691 specialization for predefined types; 30% speed up.
9692 Finally placed obsolete check to right place.
9693 (Expression.ResolveType): Removed.
9695 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9696 Updated after ResolveType was removed.
9698 * expression.cs (Cast.ctor): Check void cast.
9699 (Binary.ResolveAsTypeTerminal): Is never type.
9700 (Conditional.ResolveAsTypeTerminal): Is never type.
9702 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9704 2006-03-01 Raja R Harinath <rharinath@novell.com>
9707 * expression.cs (ParameterReference.DoResolveBase): Change return
9709 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9713 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9716 * typemanager.cs (GetFullNameSignature): Don't nullref on
9717 protected accessors.
9719 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9721 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9722 these two separated members to simplify the code.
9723 (Attribute.Resolve): Refactored to use new fields and methods.
9724 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9725 implemented obsolete attribute checking.
9726 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9727 implemented obsolete checking again. It look line never ending quest ;-)
9728 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9730 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9732 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9734 *class.cs (Property.Define): Add RegisterProperty call.
9736 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9737 argument groups (only 2).
9739 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9740 encoding expression to arguments.
9741 (Expression.ExprClassToResolveFlags): Just turned to property.
9743 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9744 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9745 optimized as well as implemented support for zero-length attributes.
9747 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9748 Add caching of PropertyInfo's.
9750 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9752 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9753 error multiple times.
9755 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9757 New partial class implementation.
9758 A fix for #77027, #77029, #77403
9760 * attribute.cs (Attributable): Made attributes protected.
9762 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9763 the replacements of ClassPart and PartialContainer.
9764 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9765 (TypeContainer.AddInterface): Ditto.
9766 (TypeContainer.AddPartial): The main method for partial classes. It checks
9767 for errors and merges ModFlags and attributes. At the end class is added to
9769 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9771 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9772 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9773 from the rest of partial classes.
9774 (TypeContainer.GetClassBases): Simplified.
9775 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9777 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9778 (TypeContainer.HasExplicitLayout): Uses Flags now.
9779 (PartialContainer): Removed.
9780 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9781 (StaticClass): Was merged with Class.
9782 (Class.GetClassBases): class and static class bases are verified here.
9783 (Class.TypeAttr): Added static attributes when class is static.
9784 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9785 (MemberBase): In some cases we need to call parent container for partial
9786 class. It should be eliminated but it's not easy now.
9788 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9790 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9791 partial classed to accumulate class comments.
9792 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9794 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9796 * driver.cs (MainDriver): Tree.GetDecl was removed.
9798 * modifiers.cs (Modifiers): Add partial modifier.
9800 * tree.cs (Tree.decl): Removed.
9801 (RootTypes): Started to use this class more often for root types
9804 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9808 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9809 external interface does not have an attribute.
9811 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9813 Another prerequisites for new partial classs implementation.
9815 * attribute.cs (Attribute.Equal): Implemented.
9816 (Attribute.Emit): Changed as attributes can be applied more than twice.
9817 (Attributes.Emit): Check for duplicate attributes here.
9819 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9820 as a parameter, clean-up.
9822 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9826 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9827 contains obsolete attribute check which can in some cases look for base
9828 type of current class which is not initialized yet.
9829 (TypeContainer.BaseType): Replacement of ptype.
9831 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9833 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9835 First of prerequisites for new partial classs implemention.
9837 * attribute.cs (Attributable): Extended by ResolveContext;
9838 Attributes finally have correct context for resolving in all cases.
9839 (AttachTo): Attribute owner is assigned here.
9841 * codegen.cs (IResolveContext): Introduce new interface to hold
9842 all information needed in resolving phase.
9843 (EmitContext): Implements IResolveContext; more clean-up needed here.
9845 * decl.cs (MemberCore): Implemented IResolveContext.
9847 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9848 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9849 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9850 Refactored to use new IResolveContext instead of EmitContext; cleanup
9852 2006-02-06 Miguel de Icaza <miguel@novell.com>
9854 * codegen.cs (EmitScopeInitFromBlock): check here the
9855 capture_context, there is no need to make two calls to the
9858 * anonymous.cs: Add some debugging messages that might help me
9859 track other instances of this problem in the future (the
9860 regression of test 467).
9862 * cs-parser.jay: track the variable block, as we need to initalize
9863 any captured variables declared in this block for the "catch"
9864 portion of the "Try" statement.
9866 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9867 scope initialization for captured variables.
9869 Also, move the emit for the variables after the block location has
9872 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9874 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9876 2006-02-02 Miguel de Icaza <miguel@novell.com>
9878 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9879 commit yesterday, the initialization for the roots is necessary.
9880 What is not necessary is the scope activation.
9882 2006-02-02 Raja R Harinath <rharinath@novell.com>
9884 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9885 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9887 (Argument.Resolve): Remove CS0206 checks.
9889 2006-02-01 Miguel de Icaza <miguel@novell.com>
9891 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9892 scopes for all the roots, the scopes will now be emitted when the
9893 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9895 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9896 code. This reduces a lot of existing cruft.
9898 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9899 that the ScopeInfo is generated as we enter the scope, not at the
9900 time of use, which is what we used to do before.
9902 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9903 every time a Block is about to be emitted if we have a
9906 2006-02-01 Raja R Harinath <rharinath@novell.com>
9908 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9910 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9912 * typemanager.cs (cons_param_array_attribute): Make private.
9913 (Reset): Set it to null.
9914 (InitCoreHelpers): Don't initialize it.
9915 (ConsParamArrayAttribute): New. Initialize it as needed.
9916 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9918 2006-01-31 Miguel de Icaza <miguel@novell.com>
9920 * expression.cs: There might be errors reported during the
9921 selection of applicable methods. If there are errors, do not
9922 continue execution as it will lead the compiler to crash.
9924 2006-01-30 Miguel de Icaza <miguel@novell.com>
9926 * expression.cs: Member access is not allowed on anonymous
9927 methods. Fixes #77402.
9929 2006-01-30 Raja R Harinath <rharinath@novell.com>
9932 * cs-parser.jay (VariableDeclaration): Don't set
9933 current_array_type to null.
9934 (field_declaration, event_declaration, declaration_statement):
9935 Set it to null here.
9937 2006-01-28 Raja R Harinath <harinath@gmail.com>
9939 * typemanager.cs (GenericParameterPosition): New.
9942 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9944 * doc.cs : To process "include" elements, first we should create
9945 another list than XmlNodeList, because it could result in node
9946 removal, which could result in that the XmlNodeList gives up
9949 (Also made code identical to gmcs again.)
9951 2006-01-25 Miguel de Icaza <miguel@novell.com>
9953 * ecore.cs: Introduce an error report that we were not catching
9954 before, if not silent, we must report the error. Gonzalo ran into
9957 2006-01-23 Miguel de Icaza <miguel@novell.com>
9959 A fix for bug: #76957
9961 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9962 ComputeMethodHost before creating the method, this is a new
9965 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9966 that this method references (RegisterScope). The actual scope
9967 where the method is hosted is computed with the ComputeMethodHost
9968 before we create the method.
9970 Moved the Deepest routine here.
9972 (AnonymousContainer.ComputeMethodHost): New routine used to
9973 compute the proper ScopeInfo that will host the anonymous method.
9975 (ScopeInfo): Deal with multiple roots. The problem was that we
9976 did not have a unique root where all ScopeInfos could be hanged
9977 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9980 Remove AdjustMethodScope which is now computed at the end. Remove
9981 LinkScope which did a partial link, instead link all ScopeInfos
9982 before code generation from the new "LinkScopes" routine.
9984 Simplify all the Add* routines as they no longer need to maintain
9985 the tree, they just need to record that they are using variables
9988 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9989 routines to produce the forest of ScopeInfo trees.
9991 * class.cs (TypeContainer.AppendMethod): This is just like
9992 AddMethod, but ensures that an interface implementation method
9993 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9994 methods, but at the end.
9996 We use this functionality to ensure that the generated MoveNext
9997 method in the iterator class is resolved/emitted before the
9998 enumerator methods created.
10000 This is required because the MoveNext method computes the right
10001 ScopeInfo for the method. And the other methods will eventually
10002 need to resolve and fetch information computed from the anonymous
10005 2006-01-21 Raja R Harinath <harinath@gmail.com>
10006 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10008 Fix rest of #76995.
10009 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
10010 the 'aliases' hash.
10011 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
10012 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
10014 2006-01-18 Raja R Harinath <rharinath@novell.com>
10016 Fix #76656, cs0231-2.cs.
10017 * cs-parser.jay (formal_parameter_list): Make error case catch
10019 (parenthesized_expression_0): Add CS1026 check.
10020 (invocation_expression): Remove unused { $$ = lexer.Location }.
10022 2006-01-17 Raja R Harinath <rharinath@novell.com>
10025 * cs-parser.jay (statement_expression): Don't list out the
10026 individual statement-expressions. Convert syntax error into
10029 2006-01-16 Raja R Harinath <rharinath@novell.com>
10032 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
10033 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
10034 CheckIntermediateModification.
10035 (FieldExpr.DoResolve): Add new two-argument version that
10036 allows us to resolve the InstanceExpression as an lvalue.
10037 The one-argument variant is now just a wrapper.
10038 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
10039 Resolve the lhs as an lvalue if the it has a value type.
10040 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
10041 from Assign.DoResolve.
10042 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
10043 resolved as an lvalue.
10044 (PropertyExpr.DoResolve): Update.
10045 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
10046 has a value type. Move CS1612 check here from
10047 CheckIntermediateModification.
10048 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
10049 * expression.cs (EmptyExpression.OutAccess): New. Used as the
10050 'right_side' of a ResolveLValue on an 'out' argument.
10051 (EmptyExpression.LValueMemberAccess): New. Used as the
10052 'right_side' of a propagated ResolveLValue on a value type.
10053 (LocalVariableReference.DoResolveBase): Recognize
10054 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
10056 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
10057 EmptyExpression.Null.
10059 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
10061 * typemanager.cs : added IsGenericParameter(). In mcs it always
10063 * doc.cs : for generic parameters, use GenericParameterPosition,
10066 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
10068 * expression.cs: Fix Console.WriteLine ((this = x).foo);
10070 2006-01-12 Miguel de Icaza <miguel@novell.com>
10072 This fixes the problem where we used ldfld instead of ldflda to
10073 load the "THIS" pointer on captured parameters, when THIS is a
10074 value type. See bug #77205.
10076 * iterators.cs (CapturedThisReference.Emit): Pass false to
10077 EmitThis (we do not need the address).
10079 * codegen.cs (EmitThis): it needs to know whether we need the
10080 address of `this' or not. This is used by value types.
10082 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
10083 every other call passes false.
10085 2006-01-12 Raja R Harinath <rharinath@novell.com>
10088 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
10090 * expression.cs (Invocation.OverloadResolve): Update.
10091 (Invocation.DoResolve): Avoid double resolution of invocation.
10093 2006-01-11 Raja R Harinath <rharinath@novell.com>
10096 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10097 unary negation of floating point types as 0-expr; negation cannot
10098 overflow in floating point types.
10101 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10102 on operands of 'void' type.
10105 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10106 and ExclusiveOr for boolean constants too.
10108 2006-01-09 Raja R Harinath <rharinath@novell.com>
10111 * expression.cs (Invocation.OverloadResolve): Replace reflected
10112 override methods with their base virtual methods, rather than
10113 skipping over them.
10114 * typemanager.cs (TypeManager.GetOverride): New.
10116 2006-01-05 Jb Evain <jbevain@gmail.com>
10118 * class.cs (Property.Define, Indexer.Define): do not tag the
10119 properties as SpecialName | RTSpecialName.
10121 2006-01-04 Miguel de Icaza <miguel@novell.com>
10123 * class.cs (MethodCore.IsDuplicateImplementation): This method was
10124 doing a low-level comparission of parameter types. It was lacking
10125 a check for __argslist.
10127 2005-12-30 Miguel de Icaza <miguel@novell.com>
10129 * expression.cs (ParameterReference.DoResolveBase): Allow
10130 reference parameters if they are local to this block.
10132 This allows the ref and out parameters of a delegate to be used in
10133 an anonymous method, for example:
10135 delegate void set (out int x);
10137 set s = delegate (out int x){
10141 This is used by functionality introduced late in the C# language.
10143 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10144 method that take ref and out parameters.
10146 Fixes #77119 which was a late change in the spec.
10148 2005-12-23 Miguel de Icaza <miguel@novell.com>
10150 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10151 parent if its the same scope. Fixes #77060.
10153 2005-12-21 Miguel de Icaza <miguel@novell.com>
10155 * driver.cs: Report the case of no source files and no -out:
10158 2005-12-20 Raja R Harinath <rharinath@novell.com>
10161 * expression.cs (ComposedCast.GetSignatureForError): Define.
10163 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10167 * namespace.cs (NamespaceEntry): Add extern_aliases as a
10168 ListDictionary, to contain the ExternAliasEntry entries (in
10169 addition to the NamespaceEntry.aliases hashtable). This field is
10170 shared between the original entry and its doppelganger (bodyless
10172 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10173 extern_aliases field.
10174 (NamespaceEntry.Lookup): Move the IsImplicit check after the
10175 lookup in extern_aliases.
10177 2005-12-16 Raja R Harinath <rharinath@novell.com>
10180 * class.cs (TypeContainer.Mark_HasEquals): New.
10181 (TypeContainer.Mark_HasGetHashCode): New.
10182 (ClassPart): Override them.
10183 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10186 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10187 'parent' argument to the base constructor.
10189 Remove all mention of TypeContainer from decl.cs.
10190 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10191 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10192 (DeclSpace.DeclSpace): Likewise.
10193 (DeclSpace.DefineMembers): Remove unused argument.
10194 * cs-parser.jay (pop_current_class): Update to changes. Simplify
10195 debugging check -- we don't care if the debug code throws an
10196 InvalidCastException instead of an InternalErrorException.
10197 * class.cs (TypeContainer.DefineMembers): Update to changes.
10198 (TypeContainer.DoDefineMembers): Likewise.
10199 (TypeContainer.GetMethods): Likewise.
10200 (PropertyMember.Define): Likewise.
10201 (MemberBase.Parent): New property that forwards to
10202 MemberCore.Parent, but ensures that we get a TypeContainer.
10203 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10204 (RootContext.PopulateTypes): Likewise. Remove special case code
10205 for !RootContext.StdLib: DefineMembers is idempotent.
10207 2005-12-14 Miguel de Icaza <miguel@novell.com>
10209 * convert.cs (ExplicitConversionCore): Check the return value from
10210 ExplicitConversionCore which can return null on failure. Fixes #76914
10212 2005-12-13 Marek Safar <marek.safar@seznam.cz>
10214 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10216 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
10218 * doc.cs : The search for referenced namespace was insufficient to
10219 get global one as it used to do. Fixed bug #76965.
10221 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
10223 * doc.cs : check name in cref in the last phase that whether it is
10226 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10228 * cs-tokenizer.cs : reverted the latest change: it somehow broke
10231 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10233 * doc.cs : so it turned out that we cannot skip override check for
10234 interface members. Fixed bug #76954.
10236 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10238 * cs-tokenizer.cs : fixed bug #75984:
10239 - #warning and #error should not be handled when the source line
10241 - #line is not checked strictly when the source line is disabled.
10242 - #define and #undef is on the other hand checked strictly at any
10245 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
10247 * cs-tokenizer.cs : missing Location (actually, filename) in one of
10250 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10252 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10254 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10255 event initializers.
10256 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10257 (FieldBase.Initializer): Initializer is now optional.
10258 (EventField.Define): Only event field can have initializer.
10260 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10262 * const.cs (Const): Reuse initializer.
10264 * cs-parser.jay: Updated after FieldBase changes.
10265 Added current_array_type to simplify array initializers.
10267 * ecore.cs (NullCast.IsDefaultValue): Implemented.
10269 * expression.cs, iterators.cs: Updated.
10271 * namespace.cs (NamespaceEntry): Made UsingFound private.
10273 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10275 * parameterCollection.cs: Obsolete, removed.
10276 * parser.cs: Obsolete, removed.
10278 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10281 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10283 * enum.cs (Enum.Define): Set obsolete context here.
10285 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10288 - FindDocumentedMember() now expects 1) paramList as null
10289 when "we don't have to check the number of parameters" and
10290 2) Type.EmptyTypes when "there is no arguments".
10291 - Introduced FoundMember struct to hold the exact type which was
10292 used to find the documented member (the above change broke
10293 test-xml-044; it might be better just to use DeclaringType than
10294 what MS does, like this change does, but it depends on usage.)
10296 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10298 * doc.cs : documented member might be from DeclaringType for nested
10299 types. Fixed bug #76782.
10301 2005-12-03 Ben Maurer <bmaurer@ximian.com>
10303 * anonymous.cs: Have the param code handle leaving copies on the
10304 stack etc. Allows anonymous params to take part in the assignment
10305 code (++, +=, etc). Fixes bug #76550
10307 * expression.cs: Handle the prepare_for_load/leave_copy by passing
10308 it down to the anon code.
10310 * iterators.cs: Use dummy var here
10312 * codegen.cs: Handle new vars
10314 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10317 * class.cs (MethodData.Define): Set proper Obsolete context.
10319 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10321 (FieldExpr.DoResolve): Ditto.
10323 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10326 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10327 parent is not obsolete.
10329 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
10331 * doc.cs : (FindDocumentedMember) find parameterless members first
10332 and get CS0419 in the early stage. Fixed first case of bug #76727.
10334 2005-11-30 Marek Safar <marek.safar@seznam.cz>
10337 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10338 no error was reported.
10340 *expression.cs (Binary.DoResolve): left can be null.
10342 2005-11-22 Marek Safar <marek.safar@seznam.cz>
10345 * class.cs (MethodData.Emit): Parameters should be labeled first.
10347 2005-11-21 Marek Safar <marek.safar@seznam.cz>
10350 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10352 2005-11-18 Marek Safar <marek.safar@seznam.cz>
10354 * attribute.cs (AreParametersCompliant): Moved to Parameter.
10356 * class.cs (MethodCore): Parameter clean up.
10357 (IMethodData): Added ParameterInfo.
10358 (MethodData): Parameter clean up.
10359 (Indexer.Define): Parameter clean up.
10371 * typemanager.cs: Parameter clean up.
10373 * delegate.cs (Define): Get rid of duplicated code.
10375 * expression.cs (ParameterReference): Removed useless parameters
10377 (Invocation): Ditto.
10379 * parameter.cs (ParamsParameter): New class, params specialization.
10380 (ArglistParameter): Attemp to separate arglist.
10381 (Parameter): Refactored to be reusable and faster.
10382 (Parameter.Modifier): Made understandable.
10383 (Parameters): Changed to be used as a class for `this' assembly
10384 parameters. Refactored to use new specialized classes.
10386 * support.cs (ParameterData): Added Types property.
10387 (InternalParameters): Deleted.
10389 2005-08-20 Martin Baulig <martin@ximian.com>
10391 Merging this patch from GMCS to fix #75867.
10393 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10394 scope if we don't already have it.
10396 2005-11-17 Martin Baulig <martin@ximian.com>
10399 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10400 inherit the scope from our parent. Fixes #76653.
10402 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10404 * doc.cs : the previous patch does not actually fix the bug.
10405 PropertyInfo override check is now implemented and really fixed it.
10406 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10408 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10410 * doc.cs : apply "override filter" also to properties.
10413 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10415 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10416 no need to check overrides. For classes, omit those results from
10417 interfaces since they must exist in the class. Fixed bug #76726.
10419 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10421 * typemanager.cs : (GetFullNameSignature) differentiate indexers
10422 with different parameters. Fixed the second problem in #76685.
10424 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10426 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10427 get expected 'protected' access in CheckValidFamilyAccess()).
10430 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10432 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10433 Fixed bug #76705. CS1569 was incorrectly commented out.
10435 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10437 * doc.cs : use Invocation.IsOverride() to do real override check.
10438 * expression.cs : made Invocation.IsOverride() internal.
10440 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10442 * doc.cs : use TypeManager.FindMembers() instead of (possible)
10443 TypeBuilder.FindMembers() and filter overriden base members out.
10446 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10448 * doc.cs : ref/out parameters are represented as '@' (instead of
10449 '&' in type FullName). Fixed bug #76630 (additionally crefs).
10451 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10453 * doc.cs : when there was no '.' in cref to methods in doc comment,
10454 then parameters were missing in the output. Fixed bug #76691.
10456 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10458 * driver.cs : don't output docs when there is an error.
10461 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10464 Now it should detect indexers. Fixed primary concern in bug #76685.
10465 Fixed CS0419 message to not show the identical member signature in
10468 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10470 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10471 instead of Type.FindMembers() since it does not handle events.
10474 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
10476 * codegen.cs: Fixed typo (speficied -> specified).
10478 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10481 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10483 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10485 * attribute.cs: Changed error message.
10487 * cs-tokenizer.cs: One more check.
10489 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10491 * statement.cs (Block.Resolve): Ignore empty statement.
10493 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10495 * report.cs: Made error/warning methods more strict to avoid
10498 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10499 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10500 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10501 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10503 2005-11-08 Marek Safar <marek.safar@seznam.cz>
10505 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10506 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10508 * class.cs (TypeContainer.IsComImport): New property.
10509 (Constructor.Define): Create proper ctor for ComImport types.
10511 * expression.cs (New.CheckComImport): Fixed.
10513 2005-11-07 Miguel de Icaza <miguel@novell.com>
10515 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10516 that a parameter has been captured does not mean that we do not
10517 have to do the rest of the processing. This fixes the second part
10518 of #76592. If there was another anonymous method capturing
10519 values in the past, the Scope would never be set for the second
10520 method that captured the same parameter.
10522 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10523 properly manipulate the stack. Second part of fix for #76592.
10525 * expression.cs (New): Add support for invoking "new" on
10526 interfaces that have been flagged with the ComImport attribute and
10527 the CoClass. Fixes #76637
10529 * statement.cs (Try.DoEmit): When a variable is captured, do not
10530 try to emit the vi.LocalBuilder variable as it has been captured.
10531 Create a temporary variable and store the results on the
10532 FieldBuilder. Fixes #76642
10534 2005-11-07 Marek Safar <marek.safar@seznam.cz>
10536 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10538 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10540 * expression.cs (Binary.DoResolve): Added && optimalization.
10542 * typemanager.cs (AddUserType): Removed useless argument.
10544 2005-11-04 Marek Safar <marek.safar@seznam.cz>
10546 * statement.cs (Block.variables): Uses ListDictionary.
10548 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10551 * class.cs (PartialContainer.EmitType): Customized to emit
10552 security attributes.
10553 (ClassPart.ApplyAttributeBuilder): Transform security attribute
10554 for partial classes.
10556 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10559 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10560 access has to be fixed.
10562 * typemanager.cs (IsUnmanagedType): Wrong common field type.
10564 2005-11-01 Marek Safar <marek.safar@seznam.cz>
10567 * ecore.cs (NullCast.Reduce): Implemented.
10569 * expression.cs (ArrayCreation.CheckIndices): Correcly check
10572 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10574 (Foreach.Resolve): Catch null properly.
10576 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10578 * cs-tokenizer.cs: Warning text fix.
10580 * driver.cs: AllWarningNumbers exposed on public interface.
10582 * report.cs (): Reviewed warning numbers.
10583 (IsValidWarning): Use binary search.
10585 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10587 * driver.cs: Implemeted resource visibility.
10588 (Resources): New class for code sharing between /res: and
10591 2005-10-28 Marek Safar <marek.safar@seznam.cz>
10594 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10597 * convert (Convert.ImplicitReferenceConversion): NullCast holds
10600 * ecore.cs (NullCast): Child is contant only.
10602 * literal.cs (NullLiteral.Reduce): null can be converted to any
10605 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
10607 * driver.cs: Use Encoding.Default as default code page instead
10610 2005-10-27 Raja R Harinath <rharinath@novell.com>
10613 * expression.cs (Invocation.Error_InvalidArguments): Handle
10614 __arglist parameters.
10615 (Invocation.VerifyArgumentsCompat): Likewise.
10616 * support.cs (ReflectionParameters.GetSignatureForError): Print
10617 __arglist parameters.
10618 (InternalParamters.GetSignatureForError): Likewise.
10619 * parameter.cs (Parameters.GetSignatureForError): Likewise.
10621 2005-10-26 Marek Safar <marek.safar@seznam.cz>
10623 * attribute.cs (GetPropertyValue): Made public.
10625 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10627 Add new property WrapNonExceptionThrows to handle 2.0 assembly
10629 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10632 * driver.cs: Reflect method name change.
10634 * statement.cs (Try.Resolve): Warn when try has both general
10635 exception handlers.
10637 * typemanager.cs: runtime_compatibility_attr_type new predefined
10640 2005-10-26 Raja R Harinath <harinath@gmail.com>
10643 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10644 treat it as an empty parameter list.
10646 2005-10-26 Raja R Harinath <rharinath@novell.com>
10649 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
10650 ResolveAsTypeStep silent.
10651 * statement.cs (Block.AddConstant): Mark block as used.
10652 (Block.ResolveMeta): Avoid piling on error messages
10653 if a constant initializer resolution fails.
10655 2005-10-25 Raja R Harinath <rharinath@novell.com>
10657 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10659 (NamespaceEntry.VerifyAllUsing): New.
10660 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
10661 behaviour. Delegates actual resolution of alias to ...
10662 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
10663 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10665 * driver.cs (Driver.MainDriver): Update.
10667 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10668 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10670 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10672 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10673 RootNamespace.DefineNamespacesForAll.
10675 2005-10-24 Raja R Harinath <harinath@gmail.com>
10677 * typemanager.cs (assemblies, external_aliases, modules)
10678 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10679 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10680 overhead. Move resposibility ...
10681 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10682 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10684 2005-10-23 Raja R Harinath <harinath@gmail.com>
10686 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10687 cached_namespaces. Improve usage.
10688 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10689 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10690 Move from GlobalRootNamespace and simplify.
10691 (RootNamespace.Global): Make instance variable.
10692 (RootNamespace.RootNamespace): Add "alias name" parameter.
10693 (GlobalRootNamespace): Simplify drastically.
10694 (Namespace.Lookup): Don't use GetNamespace.
10695 * typemanager.cs (GetRootNamespace): Rename from
10696 ComputeNamespaceForAlias.
10697 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10699 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10701 * anonymous.cs (AnonymousContainer): Don't crash when container
10704 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10706 * expression.cs (Binary.DoResolve): Warn when comparing same
10709 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10712 * expression.cs (Binary.DoResolve): It looks like there are no
10713 convetsion rules in enum context.
10715 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10717 Add support for extern alias qualifiers.
10718 * typemanager.cs: Move some LookupTypeReflection code
10719 to namespace.cs, to have cleaner code. Added some methods
10720 to help us keep track of the extern aliased references.
10721 * driver.cs: Add suport for extern alias assemblies on command
10722 line and check for their warnings/errors. Also keep track of the
10723 extern aliased assemblies.
10724 * namespace.cs: Move the global functionality of Namespace
10725 to GlobalRootNamespace/RootNamespace. Now the global namespace
10726 is GlobalRootNamespace.Globa. Also the code moved from
10727 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10728 Finally added LocalAliasEntry (AliasEntry before) and
10729 ExternAliasEntry, to handle alias statements.
10730 * cs-parser.jay: Add support in the grammar for extern alias
10732 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10733 Update callings to Namespace (now in GlobalRootNamespace).
10735 2005-10-18 Raja R Harinath <rharinath@novell.com>
10738 * class.cs (TypeContainer.DefineType): Move updating of
10739 topological sort earlier in the code.
10740 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10742 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10745 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10747 * constant.cs (Constant.TryReduce): Moved from Cast class.
10748 (Reduce): Made little bit more OO and fixed missing conversions.
10750 * ecore.cs (Reduce): Implemented.
10751 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10753 * literal.cs (Reduce): Implemented.
10755 * class.cs: Reverted Miguel's wrong commit.
10757 2005-10-14 Miguel de Icaza <miguel@novell.com>
10759 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10761 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10763 * cs-parser.jay, expression.cs : CS0214 was missing error location
10764 for constants. Fixed bug #76404.
10766 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10769 * convert.cs (ExplicitConversionCore): Fixed object->enum
10772 2005-10-10 Raja R Harinath <rharinath@novell.com>
10774 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10775 InstanceExpression.
10776 (PropertyExpr.EmitCall): Likewise.
10777 * expression.cs (Invocation.EmitArguments): Handle case where
10779 (Invocation.EmitCall): Avoid allocating temporary variable if
10780 there are no arguments.
10782 2005-10-07 Raja R Harinath <rharinath@novell.com>
10785 * convert.cs (ImplicitConversionStandard): Move conversion of
10786 void* to arbitrary pointer types ...
10787 (ExplicitConversionStandard): .. here.
10788 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10789 error to always print typenames.
10791 2005-10-07 Raja R Harinath <rharinath@novell.com>
10793 * convert.cs (GetConversionOperator): Rename from
10794 GetConversionOperators. Move operator selection code from ...
10795 (UserDefinedConversion): ... here.
10797 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10799 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10802 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10804 * assign.cs (Assign.DoResolve): Error method changed.
10806 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10808 * const.cs (ResolveValue): Reset in_transit immediately.
10810 * constant.cs: Error method changed.
10812 * convert.cs: Removed useless location parameter.
10813 (ExplicitNumericConversion): Don't do double enum check.
10814 (ExplicitConversionCore): Renamed from ExplicitConversion.
10815 (ExplicitUnsafe): Extracted from ExplicitConversion.
10816 (ExplicitConversion): Uses for error reporting.
10818 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10820 (ResolveBoolean): Uses common error method.
10821 (CastToDecimal): Get rid of ec.
10822 (CastFromDecimal): Optimized.
10823 (ConvCast): Get rid of ec.
10825 * enum.cs (ResolveValue): Reset in_transit immediately.
10826 (Emit): Return after first error.
10828 * expression.cs: Convert changes.
10830 * literal.cs: Error method changed.
10832 * statement.cs: Error method changed.
10834 2005-10-03 Raja R Harinath <rharinath@novell.com>
10836 * support.cs (SeekableStreamReader.Position): Don't error out when
10837 the requested position is just beyond the end of the current
10840 2005-09-28 Raja R Harinath <rharinath@novell.com>
10842 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10843 try to keep in sync with the byte count of the underlying Stream.
10844 However, this limits us to a window size of 2048 characters: i.e.,
10845 the maximum lookahead of our lexer/parser can be 2048 characters.
10847 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10850 * driver.cs: Fix compilation files with full root path.
10852 2005-09-25 Miguel de Icaza <miguel@novell.com>
10854 * report.cs (SymbolRelatedToPreviousError): Format the output so
10855 it does not use an open parenthesis that is never closed.
10857 * driver.cs: Follow coding guidelines
10859 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10862 * const.cs (Const.ResolveValue): Check for assigning non-null
10863 value to reference type.
10865 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10867 * anonymous.cs: Implemented ExprClassName.
10869 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10872 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10875 * class.cs (StaticClass.DefineContainerMembers): Report protected
10878 * codegen.cs: if(ed) PRODUCTION.
10880 * convert.cs (Error_CannotImplicitConversion): Better error
10883 * cs-parser.jay: More error checks.
10885 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10887 * driver.cs (CSCParseOption): Enabled wrong option check.
10889 * ecore.cs (Expression.ExprClassName): Turned to property.
10890 (MemberExpr.CheckIntermediateModification): For checking boxed
10891 value types modification.
10893 * statement.cs (Fixed.Resolve): Expression type must be
10894 convertible to fixed type.
10895 (CollectionForeach.GetEnumeratorFilter,TryType):
10896 Small refactoring for easier error checking.
10898 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10900 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10903 * class.cs (GeneratedBaseInitializer): New class for customization
10904 compiler generated initializers.
10905 (MemberBase.DoDefine): Check Obsolete attribute here.
10906 (FieldMember.DoDefine): Ditto.
10908 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10911 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10912 (MemberCore.GetObsoleteAttribute): Removed argument.
10913 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10914 (MemberCore.CheckObsoleteType): New helper.
10918 * statement.cs: Updates after MemberCore changes.
10920 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10921 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10923 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10924 obsolete attribute for compiler construct.
10925 (As.DoResolve): Cache result.
10927 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10929 2005-09-26 Raja R Harinath <rharinath@novell.com>
10932 * expression.cs (This.VerifyFixed): In a value type T, the type of
10933 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10934 value type R, 'this' is treated as a value parameter.
10936 2005-09-22 Miguel de Icaza <miguel@novell.com>
10938 * statement.cs (Lock): Use the TemporaryVariable class instead of
10939 manually using local variables as those do not work when variables
10942 * ecore.cs: Moved the TemporaryVariable class from being a nested
10943 class inside Foreach to be a public class that can be employed in
10946 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10948 * cs-parser.jay: interface_accessors replaced by
10949 accessor_declarations.
10951 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10954 * statement.cs (GotoCase.Resolve): Convert null constant to
10956 (SwitchLabel.ResolveAndReduce): Ditto.
10957 (SwitchLabel.NullStringCase): Custom null stamp.
10958 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10960 typemanager.cs (CSharpSignature): Don't skip first argument
10963 2005-09-18 Miguel de Icaza <miguel@novell.com>
10965 * driver.cs: Set InEmacs based on the environment variable EMACS.
10967 * location.cs (InEmacs): in this mode, do not report column
10968 location as it confuses Emacs.
10970 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10972 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10973 expression.cs, iterators.cs, literal.cs: Store constants and
10976 * class.cs (MemberBase.ShortName): Pass location.
10978 * cs-parser.jay: Some location fixes.
10980 * ecore.cs (Expression.Location): Made virtual.
10982 2005-09-05 Miguel de Icaza <miguel@novell.com>
10984 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10985 if the underlying types are the same, otherwise we need to produce
10986 code that will do the proper cast.
10988 This was exposed by Marek's constant rewrite which produced
10989 invalid code for the call site:
10991 enum X : long { a }
10992 void Method (X v) {}
10996 This fixes test-49.cs
10998 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
11000 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
11001 Type/Object should be allowed as well. Fixed bug #75968.
11003 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
11005 * expression.cs : (Binary.DoResolve): when one is enum constant and
11006 another is constant 0, then return enum one *as enum type*.
11009 2005-09-02 Raja R Harinath <rharinath@novell.com>
11011 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
11015 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
11016 flow-branching for LocalVariableReferences in case we were invoked
11017 from a MemberAccess.
11018 * expression.cs (LocalVariableReference.VerifyAssigned): New.
11020 (LocalVariableReference.DoResolveBase): ... this.
11021 (MemberAccess.Resolve): Do the check that was disabled during
11024 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
11027 (PartialContainer.Create): check abstract/sealed/static strictly
11028 but abstract/sealed can exist only at one side. Fixed bug #75883.
11030 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
11033 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
11034 specified, don't default to UnmanagedType.I4.
11036 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
11038 * expression.cs : conditional operator should check possibly
11039 incorrect assign expression. Fixed bug #75946.
11041 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
11043 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
11044 Reverting the change. gmcs is much complex than mcs on this matter.
11046 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
11048 * cs-tokenizer.cs : To read another token ahead of the actual
11049 consumption, use new SavedToken and cache token instead of moving
11050 back the stream with SeekableStreamReader (it seemed problematic).
11052 driver.cs : Thus use StreamReader directly.
11053 * support.cs : Thus removed SeekableStreamReader.
11055 2005-08-30 Raja R Harinath <rharinath@novell.com>
11058 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
11059 (ScopeInfo.EmitScopeType): Use it to construct field names from
11060 names of captured locals.
11063 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
11064 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11065 Pass 'target_type' to BoxedCast. Don't default to 'object'.
11066 (ExplicitConversion): Remove enum cases already handled by
11067 implicit conversion. Move implicit conversion check to the beginning.
11068 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
11069 * expression.cs (ArrayCreation.EmitDynamicInitializers):
11070 Don't treat System.Enum as a struct.
11072 2005-08-30 Jb Evain <jbevain@gmail.com>
11074 * attribute.cs: handles as expression in parameters.
11076 2005-08-30 Raja R Harinath <rharinath@novell.com>
11079 * class.cs (TypeContainer.VerifyClsName): Don't use a
11080 PartialContainer when verifying CLS compliance.
11081 (AbstractPropertyEventMethod): Set Parent here, ...
11082 (PropertyMethod): ... not here.
11084 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
11086 * attribute.cs : escaped attribute name should not be allowed to be
11087 resolved (e.g. @class as classAttribute). Fixed bug #75930.
11089 2005-08-29 Raja R Harinath <rharinath@novell.com>
11092 * convert.cs (ImplicitStandardConversionExists): Allow zero also
11093 when converting a long constant to unsigned long.
11094 * expression.cs (Invocation.OverloadResolve): Add sanity check to
11095 detect where IsApplicable and VerifyArgumentsCompat disagree.
11097 2005-08-29 Raja R Harinath <rharinath@novell.com>
11098 and Carlos Alberto Cortez <carlos@unixmexico.org>
11101 * class.cs (TypeContainer.CanElideInitializer): New helper.
11102 (TypeContainer.EmitFieldInitializers): Use it to determine if we
11103 can safely emitting the initializer of a field.
11105 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11107 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11108 allowed inside a switch (without loop). Fixed bug #75433.
11110 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
11112 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11113 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11115 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11117 * driver.cs : kinda reverting the default encoding changes (not exact
11118 revert since I noticed that "codepage:reset" might not work fine).
11120 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11122 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11123 Location. Now getter and setter store location correctly.
11124 (errors/cs0111-12.cs now reports the expected location.)
11126 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11128 * driver.cs : Use default encoding on the environment.
11129 Removed (now that) extra parameter for SeekableStreamReader.
11130 * support.cs : (SeekableStreamReader) third .ctor() argument for
11131 StreamReader is not required (always true). preamble size could
11132 be acquired in simpler and safe way.
11134 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
11136 * cs-parser.jay: report CS0642 at warning level 3
11137 and report CS0642 for an if else statement also
11138 fixes bug #74745. Patch by John Luke (and a bit
11140 Removed extra CS0642 warning check for "while",
11142 * statement.cs: In Block.Resolve(), CS0642 check
11143 is reimplemented to check a sequence of an empty
11144 statement and a block.
11146 Both fix bug #66777.
11148 2005-08-24 Marek Safar <marek.safar@seznam.cz>
11150 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11151 detection until I fix it.
11153 * cs-tokenizer.cs: Changed error message.
11155 * cs-parser.jay: Fixed 2 error locations.
11157 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11158 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11161 * enum.cs (GetSignatureForError): Fixed.
11163 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11167 * typemanager.cs (RegisterProperty): Removed.
11169 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11171 2005-08-24 Raja R Harinath <rharinath@novell.com>
11174 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11175 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11177 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11179 * expression.cs : tiny fix is required for not warning positive ulong.
11182 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11184 * expression.cs : add CS0652 check for constant and integral
11185 expression. Fixed bug #53974.
11187 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11189 * expression.cs : in DoNumericPromotions(), check if there is implicit
11190 conversion overload for string (to check CS0034). Fixed bug #52492.
11192 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11194 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11196 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11198 * ecore.cs : report location when it is *not* Null.
11200 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11206 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11207 correctly. Fixed bug #75721.
11209 2005-08-23 Raja R Harinath <rharinath@novell.com>
11211 * support.cs (SeekableStreamReader.Position): Avoid an expensive
11212 loop that performs 'min (pos, char_count)'.
11215 * expression.cs (Unary.ResolveOperator): Don't discard implicit
11216 converted value in Operator.OnesComplement.
11218 2005-08-22 Ben Maurer <bmaurer@ximian.com>
11220 * anonymous.cs: If the anon method is pulled into a helper class,
11221 it needs to be `internal' not `private'. Fixes runtime behavior on
11224 2005-08-20 Martin Baulig <martin@ximian.com>
11226 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11227 scope if we don't already have it.
11229 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11230 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11233 2005-08-17 Marek Safar <marek.safar@seznam.cz>
11236 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11237 is a partial class.
11239 2005-08-16 Marek Safar <marek.safar@seznam.cz>
11241 The big constants rewrite
11242 Fix #75746, #75685 and more
11243 As a side effect saved 1MB for MWF ;-)
11245 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11246 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11247 enum based for corlib compilation.
11249 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11252 * class.cs (FixedField.Define): Use ResolveAsConstant.
11254 * const.cs (IConstant): Interface constants and enums.
11255 (Const.ResolveValue): New method for constant resolvning.
11256 (ExternalConstant): Constants from imported assemblies.
11258 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11259 conversion; like enums.
11260 (Constant.ToType): Converts this constant to different type.
11261 (Constant.Increment): Adds 1.
11263 * convert.cs (ImplicitConversionRequired): Simplified.
11265 * cs-parser.jay: Create EnumMember directly.
11267 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11269 * doc.cs (GenerateEnumDocComment): Removed.
11271 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11272 (ConvertIntLiteral): Removed.
11273 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11275 * enum.cs (EnumMember): Implement IConstant.
11276 (Enum.IsValidEnumConstant): Removed.
11277 (Enum.GetNextDefaultValue): Removed.
11278 (Enum.FindMembers): Updated.
11279 (Enum.GenerateDocComment): Iterate enum members.
11281 * expression.cs (Cast.TryReduce): Handle enums correctly.
11282 (New.Constantify): Made public.
11283 (MemberAccess.DoResolve): Removed contant specific if(s).
11285 * literal.cs (NullLiteral): Implement new abstract methods.
11287 * statement.cs (GotoCase.Resolve): Use new constant methods.
11288 (SwitchLabel.ResolveAndReduce): Use new constant methods.
11290 * typemanager.cs (LookupEnum): Removed.
11291 (IsEnumType): Fixed to work with corlib.
11292 (RegisterConstant): Removed.
11293 (LookupConstant): Removed.
11294 (GetConstant): Changed to work with IConstant.
11296 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
11298 * location.cs : Fixed overflown (>255) column number.
11300 2005-08-03 Raja R Harinath <rharinath@novell.com>
11302 First cut of the qualified-alias-member feature.
11303 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11305 * cs-parser.jay (DOUBLE_COLON): New token.
11306 (namespace_or_type_name): Add rule for recognizing
11307 qualified-alias-members.
11308 (primary_expression): Likewise.
11309 (element_access): Allow QualifiedAliasMember as a possible
11310 type-bearing expression.
11311 (local_variable_type, local_variable_pointer_type): Likewise.
11312 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
11313 aliases in the current and enclosing namespace declarations.
11314 (NamespaceEntry.UsingAlias): Add CS0440 warning.
11315 * decl.cs (MemberName.is_double_colon): New.
11316 (MemberName.MemberName): Add new constructor for alias-member.
11317 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11318 * expression.cs (QualifiedAliasMember): New expression type.
11320 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11322 * location.cs : it borked when no argument was specified.
11324 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11326 * location.cs : tiny ToString() format fix.
11328 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11330 * statement.cs : oops, it was missing.
11332 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11334 A set of fixes for precise line/column location.
11337 "token" field now holds a file/line "delta", a line number offset
11338 from the segment, and a column number. See also:
11339 http://lists.ximian.com/pipermail/mono-devel-list/2004-
11340 December/009508.html
11341 Removed static IsNull. Use instance IsNull property instead.
11342 * cs-tokenizer.cs :
11343 For some tokens it stores Location. For Identifier it stores
11344 LocatedToken which is a pair of string name and location.
11345 Column numbers are adjusted only at getChar().
11347 Use Location.ToString() for reporting (it now contains column).
11349 Largely modified to use LocatedToken instead of
11350 string (IDENTIFIER), and to acquire Location from some tokens.
11351 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11352 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11354 Now MemberName holds Location. DeclSpace.ctor() receives Location
11355 as a parameter. Removed extra parameters to all derived classes.
11356 Replaced Location.IsNull() with instance property.
11357 * assign.cs, expression.cs :
11358 Added .ctor() overload that omits Location.
11360 Added "nameEscaped" flag that indicates the identifier was escaped
11361 in the source file. This fixes bug #57047.
11363 2005-08-02 Marek Safar <marek.safar@seznam.cz>
11365 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11366 New method, looking for lo-case imported cls type.
11368 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11371 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11373 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11375 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11376 all_imported_types.
11377 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11379 Optimized to save 3.5 MB for SWF compilation.
11381 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11383 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11384 (PartialContainer.Create): Moved logic AddToContainer.
11385 (PartialContainer.MarkForDuplicationCheck): Shares name.
11387 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11390 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11392 (Namespace.GetSignatureForError): New method.
11394 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11395 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11397 2005-08-01 Raja R Harinath <rharinath@novell.com>
11400 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11401 member lookup rather than qualifier_type, since qualifier_type can
11404 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11406 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11409 2005-07-31 Miguel de Icaza <miguel@novell.com>
11411 * statement.cs: Copy the local exception into the exception
11412 captured local. Fixes 75674
11414 2005-07-31 Raja R Harinath <harinath@gmail.com>
11417 * expression.cs (Invocation.OverloadResolve): Don't report error
11418 CS1501 if error CS1502 has been reported.
11419 (New.DoResolve): Delegate CS1501 reporting to
11420 Invocation.OverloadResolve.
11423 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11424 invariant-meaning-in-block property in an enclosing block if
11427 2005-07-29 Marek Safar <marek.safar@seznam.cz>
11429 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11430 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11431 (Switch.CheckSwitch): Just save 50kb for SWF.
11433 2005-07-27 Martin Baulig <martin@ximian.com>
11435 * anonymous.cs (CaptureContext.AddField): Added
11436 `AnonymousContainer am' argument; compute its toplevel scope if
11437 it's not already computed. Fixes #75649.
11439 2005-07-26 Raja R Harinath <rharinath@novell.com>
11442 * class.cs (Constructor.Emit): Reset block to null if the block
11445 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11447 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11449 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11451 * class.cs (MethodData.Define): Check whether accessor implementing
11452 interface is public.
11454 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11456 2005-07-22 Marek Safar <marek.safar@seznam.cz>
11459 * namespace.cs (LookupType): Moved same type check to...
11461 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11462 with the same name.
11464 2005-07-21 Raja R Harinath <rharinath@novell.com>
11466 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11467 already found a typebuilder.
11468 * class.cs (MethodCore.IsDuplicateImplementation): Compare
11469 MemberNames, not strings.
11471 * const.cs (Error_ExpressionMustBeConst):
11472 Rename from Error_EpressionMustBeConst.
11473 * const.cs, class.cs, statement.cd: Update.
11475 2005-07-21 Marek Safar <marek.safar@seznam.cz>
11479 * const.cs (Const.LookupConstantValue): Report missing contant expression
11481 (Error_EpressionMustBeConstant): Only one error method.
11483 * class.cs, statement.c: Updated.
11485 2005-07-20 Raja R Harinath <rharinath@novell.com>
11487 * statement.cs (Block.Flags): Add back HasVarargs.
11488 (Block.flags): Make protected.
11489 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11491 * typemanager.cs (types, typecontainers, user_types): Remove.
11492 (UserTypes, TypeContainers): Likewise.
11493 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11494 (CleanUp, Reset): Update.
11495 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
11496 (GetNestedType): Use Type.GetNestedType.
11497 (CoreLookupType): Take two arguments, the namespace and the
11498 basename of the type. Update to use the Namespace.Lookup
11500 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11501 (RealMemberLookup): Use IsNestedChildOf instead of playing with
11502 string concatenation and substring matches.
11503 * class.cs, enum.cs, delegate.cs: Update to changes.
11505 2005-07-20 Marek Safar <marek.safar@seznam.cz>
11507 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11508 Expression and made virtual.
11510 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11511 (ImplicitStandardConversionExists): Fixed `byte' typo ?
11513 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11515 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11518 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11521 2005-07-18 Marek Safar <marek.safar@seznam.cz>
11524 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11525 AssemblyCultureAttribute is not used on executable.
11528 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11530 2005-07-16 Raja R Harinath <rharinath@novell.com>
11533 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11534 New. Reports CS0252/CS0253.
11535 Mostly taken from preliminary patch by Duncak Mak.
11536 (Binary.DoResolveOperator): Store results of operator lookup.
11537 Use them to detect if we need to warn about unintended reference
11540 2005-07-15 Raja R Harinath <rharinath@novell.com>
11543 * namespace.cs (Namespace.Lookup): Add back location parameter.
11544 (Namespace.LookupType): Add CS0436 report. Add location parameter.
11545 * delegate.cs, ecore.cs, expression.cs: Update to changes.
11547 * codegen.cs (EmitContext.DeclSpace): Make readonly.
11548 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11549 (Namespace.LookupType): ... this.
11550 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11552 * typemanager.cs (LookupTypeReflection): Remove buggy code that
11553 purported to handle pointers.
11554 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11557 2005-07-15 Marek Safar <marek.safar@seznam.cz>
11559 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11562 2005-07-15 Raja R Harinath <rharinath@novell.com>
11564 * namespace.cs (Namespace.Lookup): Drop location parameter.
11565 (NamespaceEntry.LookupAlias): Remove. Merge into ...
11566 (NamespaceEntry.Lookup): ... this.
11567 (NamespaceEntry.Error_AmbiguousTypeReference):
11568 Move here from DeclSpace.
11569 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11571 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11572 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11573 Move to NamespaceEntry.
11574 * delegate.cs, expression.cs: Update to changes.
11576 2005-07-14 Marek Safar <marek.safar@seznam.cz>
11578 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11579 CheckAttributeType and refactored.
11580 (Attribute.ResolvePossibleAttributeType): Changed to reuse
11581 ResolveAsTypeTerminal error handling.
11582 (ResolveAsTypeTerminal): Introduced because of global attributes extra
11584 (GetSignatureForError): Print errors in same way.
11587 * codegen.cs: Reflect attribute GetSignatureForError change.
11590 * expression.cs: Add silent parameter to ResolveAsTypeStep.
11592 * namespace.cs (UsingEntry): Refactored to make fields private.
11595 statement.cs: Error_UnexpectedKind has extra parameter.
11597 2005-07-14 Raja R Harinath <rharinath@novell.com>
11599 * ecore.cs (IAlias): Remove.
11600 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
11601 that implement the interface.
11602 * namespace.cs (Namespace): Likewise.
11603 (Namespace.declspaces): Renamed from 'defined_names'.
11604 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
11605 DeclSpace instead of an IAlias.
11606 * tree.cs (Tree.AddDecl): Update.
11608 2005-07-12 Raja R Harinath <rharinath@novell.com>
11610 * statement.cs (Block.Flags); Remove HasVarargs.
11611 (Block.HasVarargs): Move to ToplevelBlock.
11612 (Block.ThisVariable, Block.AddThisVariable): Likewise.
11613 (Block.Variables): Make protected. Initialize variable hashtable
11615 (Block.AddVariable): Update.
11616 (Block.Resolve): Update to changes.
11617 (ToplevelBlock.HasVarargs): New boolean.
11618 (ToplevelBlock.ThisVariable): Move here from Block.
11619 (ToplevelBlock.AddThisVariable): Likewise.
11620 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
11621 * expression.cs (This.ResolveBase): Update to changes.
11622 (ArglistAccess.DoResolve): Likewise.
11624 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11627 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11629 * class.cs (TypeContainer.VerifyMembers): Distinguish between
11630 not used and not used & assigned.
11631 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11633 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11636 * expression.cs (Is.DoResolve): null is never provided type.
11638 2005-07-08 Marek Safar <marek.safar@seznam.cz>
11641 * cs-parser.jay: Less strict event error rule to catch more errors.
11643 2005-07-08 Martin Baulig <martin@ximian.com>
11645 Fix test-iter-10.cs - distinguish whether we `yield' in a property
11646 gettter (allowed) or setter (not allowed).
11648 * class.cs (Accessor): Implement IIteratorContainer.
11649 (Accessor.Yields): New public field.
11650 (PropertyBase.PropertyMethod.Define): Handle iterators on a
11651 per-accessor basis.
11654 (get_accessor_declaration, set_accessor_declaration): Set the
11655 `yields' flag on the accessor, not the property.
11656 (property_declaration): Do the iterators check on a per-accessor
11657 basis and not for the whole property.
11659 2005-07-08 Martin Baulig <martin@ximian.com>
11661 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11662 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11664 2005-07-07 Marek Safar <marek.safar@seznam.cz>
11667 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11668 (ExtractSecurityPermissionSet): Cope with self referencing security
11669 attributes properly.
11671 * driver.cs (SetOutputFile): Made public property OutputFile.
11673 2005-07-07 Raja R Harinath <rharinath@novell.com>
11676 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11677 has_nonstatic_fields. Make into a FieldBase pointer.
11678 (TypeContainer.AddField): Add CS0282 check.
11679 (TypeContainer.EmitType): Update.
11681 2005-07-06 Miguel de Icaza <miguel@novell.com>
11683 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11684 compare if they start with __.
11686 2005-07-06 Raja R Harinath <rharinath@novell.com>
11688 * statement.cs (Switch.SwitchGoverningType): Only look at
11689 UserCasts that don't need implicit standard conversions to one of
11690 the allowed switch types (Fixes test-322.cs).
11691 (LocalInfo.Resolve): Re-enable sanity-test.
11693 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11695 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11697 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11699 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11701 2005-07-06 Raja R Harinath <rharinath@novell.com>
11704 * ecore.cs (SimpleName.GetSignatureForError): Add.
11705 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11706 (MemberAccess.GetSignatureForError): Add.
11708 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11710 The big error and warning messages review.
11740 * typemanager.cs: Updated.
11742 * class.cs: (MethodCore.SetYields): Moved here to share.
11743 (PropertyMethod.Define): Moved iterator setup here.
11745 * iterators.cs: Add orig_method to have full access to parent
11748 2005-07-05 Raja R Harinath <rharinath@novell.com>
11750 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11751 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11752 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11753 variable of struct type.
11754 * expression.cs (Unary.ResolveOperator): Update to change.
11755 (Indirection.VerifyFixed): Likewise.
11756 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11757 (ParameterReference.VerifyFixed): Value parameters are fixed.
11758 (This.VerifyFixed): Treat 'this' as a value parameter.
11759 * statement.cs (LocalInfo.IsFixed): Remove.
11761 2005-07-01 Martin Baulig <martin@ximian.com>
11763 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11764 `ec.EmitThis ()' to get the correct scope.
11766 2005-07-01 Martin Baulig <martin@ximian.com>
11768 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11769 instance is a ParameterReference; fixes #75299.
11771 2005-07-01 Martin Baulig <martin@ximian.com>
11773 Reverted Marek's latest patch (r46725):
11774 - it contains structural changes which are neither mentioned in
11775 the ChangeLog nor explained anywhere; for example the additional
11776 argument of EmitContext's and Iterator's .ctor's and the
11777 TypeContainer.DefineMembers() change.
11778 - structural changes like this should go in in seperate patches
11779 and not be hidden in a huge patch which just seems to affect
11780 warnings and errors.
11781 a big and hard to understand patch.
11782 - it breaks iterators and causes regressions, for instance in
11785 2005-06-30 Raja R Harinath <rharinath@novell.com>
11788 * expression.cs (Indexers.map): Remove.
11789 (Indexers.Append): Filter out inaccessible setters and getters.
11790 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11793 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11794 Refactored from ...
11795 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11796 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11797 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11798 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11800 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11803 * class.cs (FieldBase.GetInitializerExpression): One more field
11806 2005-06-28 Miguel de Icaza <miguel@novell.com>
11808 * pending.cs: Do not define a proxy if the base method is virtual,
11809 it will be picked up by the runtime (bug 75270).
11811 2005-06-08 Martin Baulig <martin@ximian.com>
11813 The big Iterators rewrite :-)
11815 * iterators.cs: Rewrite this to use the anonymous methods framework.
11817 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11818 before the TypeContainers; see 2test-21.cs.
11821 (TypeContainer.DefineType): Don't create a new EmitContext if we
11822 already have one (this only happens if we're an Iterator).
11823 (TypeContainer.Define): Also call Define() on all our iterators.
11824 (Method.CreateEmitContext): Added support for iterators.
11827 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11828 (AnonymousContainer.CreateMethodHost): Moved here from
11829 AnonymousMethod and made abstract.
11830 (AnonymousContainer.CreateScopeType): New abstract method.
11831 (AnonymousContainer.IsIterator): New public property.
11832 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11833 get the ScopeTypeBuilder rather than manually defining it here.
11834 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11837 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11838 before RootContext.DefineTypes().
11840 * codegen.cs (EmitContext.RemapToProxy): Removed.
11841 (EmitContext.CurrentAnonymousMethod): Changed type from
11842 AnonymousMethod -> AnonymousContainer.
11843 (EmitContext.ResolveTopBlock): Protect from being called twice.
11844 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11845 (EmitContext.EmitThis): Removed the iterators hacks; use the
11846 anonymous methods framework for that.
11849 (ToplevelBlock.Container): Make this a property, not a field.
11850 (ToplevelBlock.ReParent): New public method; move the
11851 ToplevelBlock into a new container.
11852 (Foreach.TemporaryVariable): Simplify.
11854 2005-06-05 Martin Baulig <martin@ximian.com>
11856 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11857 (Block.AddTemporaryVariable): New public method; creates a new
11858 `LocalInfo' for a temporary variable.
11859 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11861 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11862 non-iterator variables.
11864 2005-06-05 Martin Baulig <martin@ximian.com>
11866 * statement.cs (Foreach.TemporaryVariable): Create the
11867 LocalBuilder in the Emit phase and not in Resolve since in some
11868 situations, we don't have an ILGenerator during Resolve; see
11869 2test-19.cs for an example.
11871 2005-06-04 Martin Baulig <martin@ximian.com>
11873 **** Merged r45395 from GCS ****
11875 The big Foreach rewrite - Part II.
11877 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11878 with `PropertyInfo ienumerator_getcurrent'.
11880 * codegen.cs (VariableStorage): Removed.
11883 (Foreach): Derive from Statement, not ExceptionStatement.
11884 (Foreach.CollectionForeach): New nested class. Moved all the code
11885 dealing with collection foreach here.
11886 (Foreach.ForeachHelperMethods): Removed.
11887 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11889 2005-05-23 Martin Baulig <martin@ximian.com>
11891 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11892 don't need to. Fix #75014.
11894 2005-05-20 Martin Baulig <martin@ximian.com>
11896 Merged r44808 from GMCS.
11898 * class.cs (TypeContainer.CircularDepException): Removed.
11899 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11900 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11901 (CS0146) and interface (CS0529) dependencies here.
11903 2005-06-21 Raja R Harinath <rharinath@novell.com>
11905 * expression.cs (Invocation.EmitCall): Fix initialization
11906 'this_call' to reflect current behaviour. Fix indentation.
11908 * convert.cs (FindMostEncompassedType): Add two trivial special
11909 cases (number_of_types == 0 || number_of_types == 1).
11910 (FindMostEncompasingType): Likewise.
11912 2005-06-17 Raja R Harinath <rharinath@novell.com>
11914 Some cleanups preparing for the fix of #75283.
11915 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11917 (EventExpr.InstanceResolve): Likewise.
11918 (EventExpr.DoResolve): Remove redundant checks.
11920 2005-06-10 Duncan Mak <duncan@novell.com>
11922 * cs-tokenizer.cs (process_directives): New flag for controlling
11923 the processing of preprocessor directives.
11924 (x_token): After seeing a '#', return Token.NONE instead of going
11925 to handle_preprocessing_directive() when not processing
11926 directives. This avoids unnecessary processing during the token peek in
11931 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11932 the existing error reporting methods instead of Report.Error.
11934 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11935 after Raja's rewrite.
11937 2005-06-08 Miguel de Icaza <miguel@novell.com>
11939 * class.cs: Small fix.
11941 2005-06-08 Raja R Harinath <rharinath@novell.com>
11944 * class.cs (GetPartialBases): Fix return value check of
11945 part.GetClassBases.
11947 2005-06-07 Raja R Harinath <rharinath@novell.com>
11949 Ensure that partial classes are registered in their enclosing
11950 namespace. Initial part of fix of #75160.
11951 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11952 Register declspace with namespace here, not in
11953 DeclSpace.RecordDecl.
11954 * cs-parser.jay: Pass namespace to RecordDecl.
11955 * class.cs (PartialContainer.Create): Likewise.
11956 (ClassPart.DefineType): New sanity-check. Throws an exception if
11958 * decl.cs (Declspace.RecordDecl): Remove.
11959 * namespace.cs (NamespaceEntry.DefineName): Remove.
11961 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11963 * rootcontext.cs: Reset TargetExt as well.
11965 2005-06-03 Raja R Harinath <rharinath@novell.com>
11967 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11968 -langversion:ISO-1.
11970 2005-06-02 Raja R Harinath <rharinath@novell.com>
11972 Fix #75080, cs0119.cs.
11973 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11975 (Expression.Resolve): ... this. Use it. Remove bogus code
11976 allowing ExprClass.Type and ExprClass.Namespace for
11977 ResolveFlags.VariableOrValue.
11978 (Expression.Resolve) [1-argument variant]: Change default resolve
11979 flags based on language version.
11980 (Expression.Error_UnexpectedKind): Use a simple string array
11981 rather than an ArrayList.
11982 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11983 not ExprClass.Type.
11984 (TypeOfVoid.DoResolve): Likewise.
11985 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11986 flags argument -- it always has the same value.
11988 2005-05-31 Raja R Harinath <rharinath@novell.com>
11991 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11992 Use it in the error message.
11993 * assign.cs, expression.cs, statement.cs: Update.
11995 2005-05-30 Raja R Harinath <rharinath@novell.com>
11998 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11999 the "almostMatchedMember" case too.
12000 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
12001 that failed the accessibility checks to 'almost_match'.
12003 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
12005 * attribute.cs: Use internal MethodBuilder methods to set
12006 ExactSpelling and SetLastError on PInvoke methods, instead
12007 of passing them via charset. Fixes #75060.
12009 2005-05-27 Raja R Harinath <rharinath@novell.com>
12011 * parameter.cs (Parameter): Remove TODO comment.
12012 (Parameter.DefineParameter): Remove Location parameter.
12013 (Parameters.LabelParameters): Likewise.
12014 * class.cs (Constructor.Emit): Update to change.
12015 (MethodData.Emit): Likewise.
12016 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
12017 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
12019 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
12022 Removed Parameters.Location and added Parameter.Location instead.
12023 Removed Location parameter from Emit() and GetSignature().
12030 Modified all related calls.
12032 2005-05-26 Raja R Harinath <rharinath@novell.com>
12034 Improve user-defined conversion handling.
12035 * convert.cs (GetConversionOperators): Rewrite. Return only the
12036 applicable operators.
12037 (AddConversionOperators): New. Helper for GetConversionOperators.
12038 (FindMostEncompassedType, FindMostEncompassingType): Verify that
12039 there is only one most encompassed/encompassing type.
12040 (FindMostSpecificSource, FindMostSpecificTarget): Remove
12041 "applicable operator" handling.
12042 (UserConversion): Move cache here from GetConversionOperators.
12043 Directly cache the chosen operator, rather than the whole
12045 (ExplicitNumericConversion): Fix buggy implementation of Decimal
12046 case. Allow conversion of decimal to sbyte and byte too.
12047 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
12048 New static methods. Used to avoid allocating EmptyExpressions in
12051 2005-05-24 Duncan Mak <duncan@novell.com>
12053 * ecore.cs (CastFromDecimal): New class for casting a decimal to
12054 another class, used in Convert.ExplicitNumericConversion.
12055 (CastToDecimal): New class, similar to above, but casts to
12056 System.Decimal, used in Convert.ImplicitNumericConversion and also
12057 in explicit convesion from double/float to decimal.
12059 * convert.cs (ImplicitNumericConversion): Handle implicit
12060 conversions to System.Decimal.
12061 (ExplicitNumericConversion): handle explicit conversions to
12066 2005-05-20 Miguel de Icaza <miguel@novell.com>
12068 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
12069 know the type at this stage, just break through. Fixes #75008
12071 2005-05-19 Martin Baulig <martin@ximian.com>
12074 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
12075 to disable error reporting.
12077 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
12078 here since we don't want to report an error; see the new test-336.cs.
12080 2005-05-19 Raja R Harinath <rharinath@novell.com>
12082 * statement.cs (ToplevelBlock.GetParameterReference)
12083 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
12084 Move here from class Block.
12085 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
12086 * expression.cs (ParameterReference.DoResolveBase): Likewise.
12088 2005-05-18 Martin Baulig <martin@ximian.com>
12093 (FlowBranching.Reachability): Add non-static public And() and Or()
12095 (FlowBranchingSwitch): New class; do the `break_origins' thing
12096 like in FlowBranchingLoop.
12097 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12098 reachability, not just locals and parameters.
12099 (FlowBranching.MergeChild): Remove some of the hacks for loop and
12100 switch; MergeBreakOrigins() now takes care of that.
12102 2005-05-18 Martin Baulig <martin@ximian.com>
12104 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12105 a loop and may leave it, reset the barrier; fixes #74974.
12107 2005-05-17 Marek Safar <marek.safar@seznam.cz>
12109 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12112 * cs-parser.jay: Catch more lexical errors.
12114 * report.cs: Add one more Error method.
12117 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12119 2005-05-17 Martin Baulig <martin@ximian.com>
12121 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12124 2005-05-16 Raja R Harinath <rharinath@novell.com>
12126 Fix test-382.cs. Emit values of decimal constants.
12127 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12129 (TypeContainer.AddField): ... this.
12130 (TypeContainer.EmitFieldInitializers): Allow the list of fields
12131 with initializers to include 'Const's.
12132 (ClassPart.RegisterFieldForInitialization): Forward to
12134 * const.cs (Const.Const): Pass initializer to base class.
12135 (Const.Define): In case of decimal constants, register them for
12136 initialization in a static constructor.
12138 2005-05-14 Martin Baulig <martin@ximian.com>
12140 * statement.cs (Block.Resolve): Correctly handle unreachable code;
12141 do not call ResolveUnreachable() on unreachable statements in
12142 here, see the comment in the source code.
12144 2005-05-13 Raja R Harinath <rharinath@novell.com>
12147 * expression.cs (BinaryResolveOperator): If one of the operands of
12148 an equality comparison is 'null' and the other is a pointer type,
12149 convert the null to a NullPointer.
12150 * convert.cs (ImplicitReferenceConversion): If the expression is a
12151 NullLiteral and the target type is a pointer type, return a
12152 NullPointer instead.
12153 (ImplicitConversionStandard): Likewise.
12155 2005-05-13 Marek Safar <marek.safar@seznam.cz>
12157 * cs-parser.jay: Set readonly context based on special constructs.
12159 * expression.cs (LocalVariableReference.DoResolveBase): Improved
12160 readonly variable error handling.
12162 * rootcontext.cs (EmitCode): Don't verify members when error
12165 * statement.cs (LocalInfo): Add reaodnly context information.
12166 (SetReadOnlyContext, GetReadOnlyContext): New methods.
12168 2005-05-13 Raja R Harinath <rharinath@novell.com>
12170 * statement.cs (Block.Resolve): Revert change below. Modify fix
12171 for #74041 to initialize 'resolved' to false only for explicit
12172 blocks. Fixes #74873.
12174 2005-05-12 Raja R Harinath <harinath@gmail.com>
12177 * typemanager.cs (unmanaged_enclosing_types): New.
12178 (IsUnmanagedType): Avoid infloops by using
12179 'unmanaged_enclosing_types' to talk with recursive invocations.
12181 2005-05-13 Martin Baulig <martin@ximian.com>
12183 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12184 instance variable, not a local. Fix #74873.
12185 (Block.ResolveUnreachable): Set it to true here.
12187 2005-05-11 Duncan Mak <duncan@novell.com>
12189 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12190 continuing to process for 'arg'.
12191 (handle_preprocessing_directive): Check the argument of the #endif
12192 directive and report error CS1025 if there are any trailing
12195 According to the C# spec, having even whitespace after the #endif
12196 directive is illegal; however, because we call arg.TrimEnd ()
12197 beforehand, we have the same behavior as csc, allowing whitespace
12198 after the directive.
12202 2005-05-11 Marek Safar <marek.safar@seznam.cz>
12206 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12207 (Constructor.GetObsoleteAttribute): Implemented correctly.
12209 2005-05-10 Martin Baulig <martin@ximian.com>
12211 * support.cs (ReflectionParameters.ParameterModifier): Use
12212 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12213 and `ParameterAttributes.In'. Fixes #74884.
12215 2005-05-10 Marek Safar <marek.safar@seznam.cz>
12217 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12219 * expression.cs (Argument.GetParameterModifier): Turned to property.
12220 (Invocation.Error_InvalidArguments): Add more descriptive errors.
12222 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12225 2005-05-09 Raja R Harinath <rharinath@novell.com>
12228 * decl.cs (MemberCache.AddMethods): Register override methods,
12229 rather than non-override methods.
12230 * typemanager.cs (RegisterOverride): New.
12231 (IsOverride): Update.
12233 2005-05-09 Marek Safar <marek.safar@seznam.cz>
12237 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12238 recursive declaration.
12240 * statement.cs (Block.ResolveMeta): Report any error in resolving.
12242 2005-05-06 Marek Safar <marek.safar@seznam.cz>
12244 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12246 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12248 2005-05-05 Raja R Harinath <rharinath@novell.com>
12251 * decl.cs (DeclSpace.FamilyAccessible):
12252 Use TypeManager.IsNestedFamilyAccessible.
12254 Fix reopened #64812.
12255 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12258 2005-05-04 Raja R Harinath <rharinath@novell.com>
12259 Abin Thomas <projectmonokochi@rediffmail.com>
12260 Anoob V E <projectmonokochi@rediffmail.com>
12261 Harilal P R <projectmonokochi@rediffmail.com>
12264 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12265 allow access to all static members.
12267 2005-05-04 Martin Baulig <martin@ximian.com>
12269 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12271 2005-05-04 Martin Baulig <martin@ximian.com>
12275 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12276 section at the end; make things work if `default' is not the last
12279 2005-05-04 Martin Baulig <martin@ximian.com>
12283 * statement.cs (Switch): Replaced the `got_default' field with a
12284 `default_section' one.
12285 (Switch.CheckSwitch): Set `default_section' here.
12286 (Switch.Resolve): If we're a constant switch and the constant is
12287 not found, use the default section.
12289 2005-05-03 Martin Baulig <martin@ximian.com>
12291 * expression.cs (ArrayAccess.EmitGetLength): New public method.
12293 * statement.cs (Foreach.ArrayForeach): New nested class.
12294 (Foreach.TemporaryVariable): New nested class.
12295 (Foreach.EmitArrayForeach): Removed; this is now in the new
12296 ArrayForeach class.
12298 2005-05-03 Raja R Harinath <rharinath@novell.com>
12300 * pending.cs (BaseImplements): Move the #74773 fix here. This is
12302 (VerifyPendingMethods): Revert change below.
12304 * typemanager.cs (IsOverride, RegisterNonOverride): New.
12305 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12306 that used to trigger warning -28. Remove warning -28.
12307 * expression.cs (Invocation.OverloadResolve): Use
12308 TypeManager.IsOverride to distinguish override methods.
12311 * pending.cs (VerifyPendingMethods): If a base type implements the
12312 requested interface, don't bother checking individual methods of
12313 the base type. As a side-effect, this prevents the creation of
12314 unnecessary proxies.
12316 2005-05-02 Martin Baulig <martin@ximian.com>
12320 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12321 Also `And' the locals if the old vector is null.
12322 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12323 null; in this case we basically reset all the variables.
12325 2005-05-02 Martin Baulig <martin@ximian.com>
12329 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12330 Added `FlowBranching branching' argument; always `and' the
12331 variables instead of `or'ing them unless we're an infinite loop.
12333 * statement.cs (While.Resolve): Create a new sibling unless we're
12336 2005-05-02 Martin Baulig <martin@ximian.com>
12340 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12341 arguments; use it instead of creating a new TopLevelBlock.
12342 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12343 our ConstructorInitializer.
12346 (TopLevelBlock.TopLevelBranching): New public property.
12347 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12348 and create our `TopLevelBranching'.
12350 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12351 anonymous method host, use `block.TopLevelBranching' rather than
12352 creating a new branching.
12354 2005-04-20 Miguel de Icaza <miguel@novell.com>
12356 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12357 a ScopeInfo, if any of the current children is a child of the new
12358 entry, move those children there.
12360 2005-04-30 Martin Baulig <martin@ximian.com>
12362 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12363 at the beginning of a SwitchSection. Fix #73335.
12365 2005-04-27 Marek Safar <marek.safar@seznam.cz>
12368 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12370 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12371 (FieldExpr.DoResolve): Obsolete members are ignored for field
12374 2005-04-26 Marek Safar <marek.safar@seznam.cz>
12376 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12377 of arrays detection.
12379 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12381 (Field.VerifyClsCompliance): Volatile fields are not compliant.
12383 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12386 2005-04-25 Ben Maurer <bmaurer@ximian.com>
12388 * cs-parser.jay: Use the prefered version of -unsafe in error
12391 2005-04-22 Marek Safar <marek.safar@seznam.cz>
12393 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12396 2005-04-20 John Luke <john.luke@gmail.com>
12398 * driver.cs: fix typo in error message, --outout to --output
12400 2005-04-20 Marek Safar <marek.safar@seznam.cz>
12402 * codegen.cs (InRefOutArgumentResolving): New field.
12404 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12405 fields outside contructor.
12407 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12409 2005-04-19 Miguel de Icaza <miguel@novell.com>
12411 * anonymous.cs (CaptureContext.EmitParameterInstance): The
12412 parameter code was not completed ever, so it was not as up-to-date
12413 as local variables. Must finish it.
12415 The bug fix was to compare the Toplevel of the block, not the
12416 current block. Thanks for Ben for pointing this out.
12418 2005-04-19 Raja R Harinath <rharinath@novell.com>
12420 * decl.cs (AddMethods): Use the declaring type of the problem
12421 method to determine if we want to squash a warning.
12423 2005-04-19 Marek Safar <marek.safar@seznam.cz>
12425 * attribute.cs: Removed debug output.
12427 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12429 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12432 2005-04-18 Raja R Harinath <rharinath@novell.com>
12435 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12436 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12437 all null comparisons against reference types.
12439 2005-04-18 Marek Safar <marek.safar@seznam.cz>
12442 * class.cs (TypeContainer.CircularDepException) New nested
12444 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12445 (TypeContainer.DefineType): Removed error, reset InTransit before
12447 (Class.DefineType): Throw exception when is in Transit.
12448 Catch exception and report error.
12449 (Struct.DefineType): Throw exception when is in Transit.
12450 Catch exception and report error.
12451 (Interface.DefineType): Throw exception when is in Transit.
12452 Catch exception and report error.
12454 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12455 handle nested exception handlers.
12457 * flowanalysis.cs (InTryWithCatch): New method, search for try with
12460 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12461 InFinally and InCatch storage.
12463 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12464 (Catch.Resolve): Set and Restore ec.InCatch.
12465 (Try.Resolve): Set and Restore ec.InFinally.
12466 (Try.HasCatch): True when try has catch.
12468 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
12470 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12471 for the same event member, so exclude such cases from warning 419.
12474 2005-04-16 Miguel de Icaza <miguel@novell.com>
12476 * expression.cs (Binary.ResolveOperator): Apply patch from John
12477 Luke to fix bug 59864: operators &, | and ^ on enumerations
12478 require that the same enum type on both sides.
12480 * driver.cs: Add warnings to old flag usage, this is to assist
12481 people who produce Makefiles and hope that the Makefiles will be
12484 * class.cs (TypeContainer.EmitType): Moved the definition of the
12485 special $PRIVATE$ field from the resolve phase to the Emit phase.
12486 During resolve we do not know if we are a struct with
12487 HasExplicitLayout, we know this only after the attributes for the
12490 Set the FieldOffset to zero on the dummy field that we create for
12491 the class. Fixes 74590.
12493 2005-04-16 Raja R Harinath <rharinath@novell.com>
12496 * ecore.cs (PropertyExpr.resolved): New.
12497 (DoResolve): Use it to handle a case of double resolution here.
12498 Handle a case of identical-name-and-type-name.
12499 * expression.cs (ArrayCreation.CheckIndices): Avoid double
12500 resolution by storing the results of expression resolution back
12501 into the "probes" array.
12503 2005-04-15 Raja R Harinath <rharinath@novell.com>
12505 Fix cs0208-7.cs and cs0208-8.cs.
12506 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12507 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
12508 error reporting to point out the reason a struct is not unmanaged.
12510 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12512 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
12513 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12515 2005-04-13 Raja R Harinath <rharinath@novell.com>
12518 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12519 IdenticalNameAndTypeName here.
12520 (EventExpr.InstanceResolve): Likewise.
12522 2005-04-13 Marek Safar <marek.safar@seznam.cz>
12524 C# 2.0 DefaultCharSetAttribute implementation
12526 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12527 which allows us to set GlobalNamespace for every resolve.
12528 (Attribute.ResolveArguments): Cut from Resolve.
12529 (Attribute.GetCharSetValue): Returns CharSet named argument.
12530 (Attribute.DefinePInvokeMethod): Gets default charset from
12532 (GlobalAttribute.ResolveAsTypeStep): Override.
12533 (GlobalAttribute.ResolveArguments): Override.
12535 * class.cs (TypeAttr): Is protected.
12537 * codegen.cs (ModuleClass.DefaultCharSet): New member.
12538 (ModuleClass.DefaultCharSetType): New memeber.
12539 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12541 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12542 charset from module.
12544 * delegate.cs (TypeAttr): Override.
12545 (Delegate.DefineType): Use this TypeAttr.
12547 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12548 at very early stage (before types are defined) to resolve model
12549 module attributes. It will probably not work with corlib but it
12552 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12553 charset from module.
12555 * typemanager.cs (default_charset_type): New type.
12557 2005-04-13 Raja R Harinath <rharinath@novell.com>
12559 * decl.cs (MemberCache.AddMethods): Don't warn if
12560 System.Object.Finalize has buggy MethodAttributes.
12562 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12565 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12567 * doc.cs : detect ambiguous reference to overloaded members.
12568 Fixed bug #71603. MS 1.1 csc does not detect it.
12570 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12572 * doc.cs : delegates must not be referenced with parameters.
12575 2005-04-12 Miguel de Icaza <miguel@novell.com>
12577 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12579 2005-04-10 Miguel de Icaza <miguel@novell.com>
12581 * driver.cs (MainDriver): Stop processing if the CLS stage found
12584 (CompilerCallableEntryPoint.InvokeCompiler): Always
12585 reset after execution; Take a TextWriter argument for the
12588 * report.cs: Use the error stream instead of hardcoding stderr.
12590 2005-04-09 Miguel de Icaza <miguel@novell.com>
12592 * class.cs: Reduce code paths to test, too small of an
12593 optimization to make it worth the extra testing. Always perform
12596 2005-04-08 Raja R Harinath <rharinath@novell.com>
12599 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12600 operators that had errors reported on them.
12602 2005-04-08 Marek Safar <marek.safar@seznam.cz>
12604 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12606 (Attribute.Resolve): Add named argument type checking.
12608 * class.cs (FixedField.Define): Use IsPrimitiveType
12610 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12612 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12613 unsafe parameter types.
12615 * statement.cs (Using.ResolveExpression): Add better error description.
12617 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12619 2005-04-08 Raja R Harinath <rharinath@novell.com>
12622 * attribute.cs (Attribute.GetAttributeUsage): Resolve
12623 AttributeUsageAttribute in the emitcontext of the attribute class,
12624 not in the emitcontext of the attributable entity it was attached to.
12625 * cs-parser.jay: Use 'current_class', not 'current_container',
12626 when creating a GlobalAttribute.
12628 2005-04-08 Alp Toker <alp@atoker.com>
12630 * pending.cs: The fix to #58413 failed to compile methods implementing
12631 interfaces with/without params modifiers and vice versa, even though
12632 params modifiers aren't part of the signature. Make the modifier check
12633 less strict as in csc.
12635 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
12636 Anoob V E <projectmonokochi@rediffmail.com>
12637 Harilal P R <projectmonokochi@rediffmail.com>
12640 * pending.cs (TypeAndMethods.mods): New. Store the parameter
12641 modifiers of pending methods.
12642 (PendingImplementation.PendingImplementation): Initialize it.
12643 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12644 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12645 with ParameterData. Add check for modifiers.
12646 * class.cs (MethodData.Define): Update to changes.
12648 2005-04-07 Raja R Harinath <rharinath@novell.com>
12650 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12652 2005-04-07 Marek Safar <marek.safar@seznam.cz>
12654 * class.cs (PropertyMethod.Define): Check private accessor in abstract
12657 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12660 * typemanager.cs: Registered RequiredAttributeAttribute.
12662 2005-04-06 Marek Safar <marek.safar@seznam.cz>
12664 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12665 Warning CS0169 is back at level 3.
12666 (IMethodData.SetMemberIsUsed): New method.
12668 * decl.cs (IsUsed): New value; moved from FieldBase.Status
12669 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12671 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12673 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12675 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12678 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12681 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12682 to avoid the problems with nested types.
12684 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12685 Anoob V.E <projectmonokochi@rediffmail.com>
12686 Harilal P.R <projectmonokochi@rediffmail.com>
12687 Raja R Harinath <rharinath@novell.com>
12690 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12692 * typemanager (GetConstructor): Make public.
12694 2005-04-05 John Luke <john.luke@gmail.com>
12695 Raja R Harinath <rharinath@novell.com>
12698 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12699 struct too. Return false quicker in a few cases.
12700 (VerifyUnManaged): Use it.
12702 2005-04-05 Raja R Harinath <rharinath@novell.com>
12705 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12706 not 'unreachable_seen'.
12708 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12710 * attribute.cs (Attribute.GetValue): Removed unused.
12712 * codegen.cs (CodeGen.TrimExt): Removed unused.
12714 * cs-parser.jay (output): Removed unused.
12716 * cs-tokenizer.cs (hex_digits): Removed unused.
12718 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12720 * expression.cs (Indirection.LoadExprValue): Removed unused.
12721 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12723 * iterators.cs (Iterator.param_types): Removed unused.
12725 * statement.cs (Goto.block): Removed unused.
12726 (ToplevelBlock.did): Removed unused.
12727 (Switch.ResolveConstantSwitch): Removed unused.
12729 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12731 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12734 2005-04-01 Raja R Harinath <rharinath@novell.com>
12736 Fix #74232 and cs0208-3.cs.
12737 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12738 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12739 unmanaged type. Don't use FieldBuilders when 't' is a
12740 TypeBuilder. Use ModFlags and MemberType fields.
12741 * class.cs (MemberBase.member_type): Rename from MemberType.
12742 (MemberBase.MemberType): New property. Determines member_type on
12744 (MemberBase.DoDefine): Don't initialize MemberType here.
12745 (FieldMember.Define): Likewise.
12747 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12750 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12751 Attributes are emitted there.
12753 2005-04-01 Raja R Harinath <rharinath@novell.com>
12755 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12756 keyword in 'partial enum' too.
12757 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12759 Report from Kamil Skalski <nazgul@omega.pl>.
12762 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12763 have partial containers too.
12765 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12766 in block' checks to Block.CheckInvariantMeaningInBlock.
12767 * statement.cs (Block.GetKnownVariableInfo): Make private.
12768 (Block.IsVariableUsedInChildBlock): Remove.
12769 (Block.IsVariableUsedInBlock): Likewise.
12770 (Block.CheckInvariantMeaningInBlock): New. Show location of
12771 conflicting declaration.
12772 (Block.AddVariable): Make error messages less long-winded and more
12773 specific. Show location of conflicting declaration.
12774 * parameter.cs (Parameters.Location): New readonly property.
12776 2005-03-31 Raja R Harinath <rharinath@novell.com>
12778 Clean up semantics of invoking ResolveMemberAccess.
12779 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12780 can have an instance, ensure that we pass in a non-TypeExpression
12781 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12782 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12783 argument. Update to changes and simplify.
12784 (FieldExpr.Emitinstance): Remove CS0120 check.
12785 (PropertyExpr.EmitInstance): Likewise.
12786 * expression.cs (Argument.Resolve): Likewise.
12787 (Invocation.DoResolve): Update to changes in semantics of
12788 InstanceExpression.
12790 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12793 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12796 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12798 2005-03-31 Raja R Harinath <rharinath@novell.com>
12800 Fix difference in behaviour with commandline invocation.
12801 * driver.cs (Driver.Reset): New.
12802 (CompilerCallableEntryPoint): Call it.
12804 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12805 variable" warnings if the boolean expression failed to resolve.
12807 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12809 * attribute.cs: Fix the union of several permissions when some of them
12810 are unrestricted (so the result isn't an unrestricted permission set).
12813 2005-03-30 Raja R Harinath <rharinath@novell.com>
12815 * ecore.cs (MemberExpr): New class. Convert from interface
12817 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12818 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12820 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12821 (MethodGroupExpr.IsExplicitImpl): Remove.
12822 (Expression.GetFieldFromEvent): Remove.
12823 (SimpleName.MemberStaticCheck): Remove.
12824 (SimpleName.DoSimpleNameResolve): Update to changes.
12825 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12826 (MemberAccess.IdenticalNameAndTypeName): Remove.
12827 (MemberAccess.error176): Move to MemberExpr.
12828 (MemberAccess.DoResolve): Update to changes.
12829 (BaseAccess.DoResolve): Likewise.
12831 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12833 C# 2.0 Conditional attribute class implementation
12835 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12836 Analyzes class whether it has attribute which has ConditionalAttribute
12837 and its condition is not defined.
12839 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12840 (Class.IsExcluded): New method. Search for at least one defined
12841 condition in ConditionalAttribute of attribute class.
12843 2005-03-30 Raja R Harinath <rharinath@novell.com>
12845 * ecore.cs (PropertyExpr): Derive from Expression, not
12846 ExpressionStatement.
12847 (PropertyExpr.EmitStatement): Remove.
12849 2005-03-29 Raja R Harinath <rharinath@novell.com>
12852 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12853 internal field "value__" of an enum be private. The examples for
12854 "value__" that I found on MSDN all used FieldAttributes.Private.
12856 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12857 Don't mention IL method attribute names.
12859 Fix #47991. Remove a TODO.
12860 * statement.cs (Block.Toplevel): Make into a field.
12861 (Block.Parameters): Move into ToplevelBlock.
12862 (Block.known_variables): Rename from child_variable_names.
12863 (Block.Block): Remove variants that take Parameters. Initialize
12864 'Toplevel' with the immediately surrounding toplevel block.
12865 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12866 LocalInfo parameter.
12867 (Block.GetKnownVariableInfo): New.
12868 (Block.IsVariableNameUsedInChildBlock): Update.
12869 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12870 the block, even though it may not be in scope.
12871 (Block.AddVariable): Remove Parameters parameter. Use
12872 Toplevel.Parameters instead.
12873 (Block.AddConstant): Remove Parameters parameter.
12874 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12875 (Block.IsParamaterReference): Likewise.
12876 (Block.IsLocalParameter): Likewise. Simplify a lot.
12877 (ToplevelBlock.Parameters): New. Moved from Block.
12878 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12879 initialize Parameters to a non-null value.
12880 * cs-parser.jay: Update to changes.
12881 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12882 simple names that mean different things in the same block. Use
12883 Block.IsVariableNameUsedInBlock.
12885 2005-03-28 Raja R Harinath <rharinath@novell.com>
12887 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12888 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12889 GetTypeHandle. It is possible for a reflected type to derive from
12890 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12891 System.Array during mscorlib compilation).
12892 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12893 contain a method_hash, don't create one either. Don't create a
12894 deep copy of the base cache's method_hash.
12895 (MemberCache.SetupCache): Rename back from DeepCopy.
12896 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12897 already initialized. If we see an override function, add its
12898 underlying base virtual function to the member_hash too.
12900 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12902 2005-03-26 Raja R Harinath <harinath@acm.org>
12905 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12906 fails to resolve, ensure that the LHS is still resolved as an
12909 2005-03-25 Raja R Harinath <harinath@acm.org>
12911 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12913 (Enum.current_ec): Remove.
12914 (Enum.LookupEnumValue): Remove EmitContext argument.
12915 Just uses the one created during DefineType.
12916 (Enum.FindMembers): Update.
12917 * expression.cs (MemberAccess.DoResolve): Update.
12919 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12921 * assign.cs (Assign.DoResolve): Check for CS1717 when
12922 source and target are same (uses Equals).
12924 * expression.cs (LocalVariableReference, ParameterReference,
12925 This): Implemented Equals, GetHashCode.
12927 * statement.cs (Block.GetParameterReference): Removed useless
12930 2005-03-22 Raja R Harinath <rharinath@novell.com>
12933 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12934 blocks before deciding whether the error is cs0136 or cs0128.
12936 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12937 (using_alias_directive, using_namespace_directive): Pass
12938 MemberName, not an expression to Namespace.UsingAlias and
12940 (MakeName): Use the MemberName of the namespace.
12941 * namespace.cs (Namespace.MemberName): New.
12942 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12943 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12945 * decl.cs (MemberName.Name): Make readonly.
12946 (MemberName.FromDotted): New "constructor".
12947 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12948 (MemberCore.Name): Compute from MemberName on demand.
12949 (MemberCore.SetMemberName): Provide a way to change the
12951 (MemberCore.AddToContainer): Don't take a fullname parameter.
12952 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12953 fully qualified name of the container to the member name.
12954 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12955 only if the type is a member of the root container.
12956 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12957 MemberName.Left rather than searching for an embedded ".".
12958 (PartialContainer.CreatePart): Update to changes in RootContext.
12959 (MemberBase.ShortName): Turn into a property. Use
12960 MemberCore.SetMemberName.
12961 (MemberBase.ExplicitInterfaceName): Remove.
12962 (MemberBase.UpdateMemberName): Remove.
12963 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12964 (PropertyBase.SetMemberName): New override.
12965 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12966 (Tree.GetDecl): New.
12967 (Tree.AllDecls): Rename from Decls.
12968 * attribute.cs, enum.cs, report.cs: Update to changes.
12969 * driver.cs (MainDriver): Use MemberName.FromDotted on
12970 RootContext.MainClass.
12972 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12974 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12977 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12979 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12981 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12982 property accessor modifiers.
12984 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12985 fixed buffer attribute (CS1716).
12986 (PropertyMethod.HasCustomAccessModifier): When property accessor
12987 has custom modifier.
12989 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12991 (PropertyExpr.DoResolveLValue): Add CS0272.
12993 2005-03-17 Miguel de Icaza <miguel@novell.com>
12995 * convert.cs: When converting to a pointer, use the proper Conv.U
12996 or Conv.I depending on the source data type.
12998 * cs-tokenizer.cs: Make the size for large decimal constants,
13001 2005-03-17 Martin Baulig <martin@ximian.com>
13003 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
13004 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
13006 2005-03-17 Martin Baulig <martin@ximian.com>
13008 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
13009 to bool so we can return an error condition.
13010 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
13013 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
13015 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
13018 2005-03-16 Raja R Harinath <rharinath@novell.com>
13020 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
13021 Refactor to avoid traversing the list of assemblies, and to avoid
13022 string concatenation.
13023 * typemanager.cs (guid_attr_type): Remove.
13024 (negative_hits, pointers, references): Remove hashes.
13026 (GetConstructedType): New. Uses type_hash to handle constructed
13027 types (arrays, references, pointers).
13028 (GetReferenceType, GetPointerType): Use it.
13029 (GetNestedType): New. Uses type_hash to handle nested types of
13031 (LookupType, LookupTypeDirect): Remove.
13032 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
13033 'types' hash and LookupTypeReflection directly.
13034 (params_string, params_object): Use GetConstructedType.
13035 * namespace.cs (Namespace.cached_types): New. Cache of reflected
13037 (Namespace.Lookup): Use cached_types.
13038 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
13039 provided by old TypeManager.LookupType.
13040 * rootcontext.cs (MakeFQN): Remove.
13041 * decl.cs (DeclSpace.MakeFQN): Likewise.
13042 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
13043 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13044 TypeManager.GetConstructedType.
13045 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
13047 2005-03-15 Marek Safar <marek.safar@seznam.cz>
13049 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
13052 * cs-parser.jay: Reports CS1527 for any namespace element.
13054 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
13057 * expression.cs (ParameterReference.IsAssigned): Changed error to
13059 (Error_WrongNumArguments): Moved CS0245 detection here.
13061 * statement.cs (Return.Resolve): Add CS1622 report.
13063 2005-03-11 Marek Safar <marek.safar@seznam.cz>
13065 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
13067 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
13069 * attribute.cs expression.cs: Get rid of some allocations.
13071 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
13073 * doc.cs : just eliminate the latest change.
13075 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13077 * doc.cs : commented out the latest change. It breaks xml-030.cs
13079 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13081 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
13082 fail. So invoke CreateType() in FindDocumentedType().
13084 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13086 * cs-tokenizer.cs : added IsKeyword().
13087 * doc.cs : Detect keyword incorrectly used as identifier.
13088 Allow identifiers prefixed by @.
13090 2005-03-10 Marek Safar <marek.safar@seznam.cz>
13092 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13093 It caused exception in namespace resolving (again!).
13095 * class.cs (Class.ctor): Removed exit.
13096 (PropertyMethod.ctor): ditto.
13098 * codegen.cs (Codegen.Reset): Reset static data.
13099 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13101 * cs-tokenizer.cs (Cleanup): Removed.
13103 * driver.cs (GetSystemDir): Rewrote to one line command.
13104 It caused problem with unloaded dynamic modules.
13105 (UnixParseOption): Removed Exit.
13106 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13107 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13108 Now can be mcs used as library.
13110 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13113 * location.cs (Reset): Reset static data.
13115 * namespace.cs (Reset): Reset static data.
13117 * report.cs (Report.Reset): Reset static data.
13119 * rootcontext.cs (RootContext.Reset): Reset static data.
13121 * tree.cs (RootTypes.ctor): Use Location.Null
13123 * typemanager.cs (TypeManager.Reset): Reset static data.
13124 (CoreLookupType): Removed Exit.
13125 (TypeHandle.Reset): Reset static data.
13127 2005-03-10 Raja R Harinath <rharinath@novell.com>
13130 * typemanager.cs (ComputeNamespaces): Import namespaces from
13131 referenced modules too.
13133 2005-03-09 Raja R Harinath <rharinath@novell.com>
13135 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13138 2005-03-09 Raja R Harinath <rharinath@novell.com>
13140 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13141 enclosing DeclSpace. This ensures that a name-lookup populates
13142 more caches and there are fewer 'TypeExpression's. Carve out
13143 nested type lookup into ...
13144 (LookupNestedTypeInHierarchy): ... this.
13146 2005-03-09 Raja R Harinath <rharinath@novell.com>
13148 Clean up a few partial-class semantics.
13149 Fixes test-357.cs and cs1618-2.cs.
13150 * cs-parser.jay (struct_declaration): Use 'current_class' as
13151 parent of newly-created struct. Remove call to Register ().
13152 Use 'pop_current_class' to complete handing the current struct.
13153 (interface_declaration): Likewise.
13154 (class_declaration): Likewise.
13155 (enum_declaration): Use 'current_class' as parent of newly created
13157 (delegate_declaration): Likewise.
13158 (pop_current_class): New function. This is used to handle closing
13159 up the 'current_class' and 'current_container', and pointing them
13160 to the enclosing class/container.
13161 (CSharpParser): Initialize 'current_class' too.
13162 * decl.cs (MemberCore): Add check for invariant: a partial
13163 container is not a parsed entity, and thus does not enclose any
13165 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13166 (DeclSpace.BaseTypeExpr): Use it.
13167 (DeclSpace.LookupType): Add check for invariant.
13168 * class.cs (TypeContainer): Add check for invariant: a nested
13169 class should have the same NamespaceEntry as its enclosing class.
13170 (TypeContainer.EmitFieldInitializers): Make virtual.
13171 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13173 (TypeContainer.Register): Remove.
13174 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13175 null. Use TypeResolveEmitContext for resolving base types and
13176 interfaces. Move initialization of Parts.TypeBuilder here from
13178 (TypeContainer.DefineNestedTypes): ... here.
13179 (PartialContainer): Take a Namespace not a NamespaceEntry.
13180 (PartialContainer.Create): Don't use Register. Call the
13181 appropriate Add... function directly.
13182 (ClassPart): Take both the PartialContainer and the enclosing
13183 class as constructor arguments.
13184 (ClassPart.EmitFieldInitializers): Override.
13185 (ClassPart.PartFindNestedTypes): Remove.
13186 (FieldBase.GetInitializerExpression): Resolve the initializer
13187 expression in the emit context of the enclosing class.
13188 * tree.cs (RootTypes): Remove Register ().
13190 2005-03-08 Marek Safar <marek.safar@seznam.cz>
13192 * cs-parser.jay: Removed CS0134.
13194 * driver.cs: Removed CS1901.
13196 * expression.cs (SizeOf.DoResolve): Don't report CS0233
13197 for predefined types.
13199 2005-03-07 Duncan Mak <duncan@novell.com>
13201 * codegen.cs (Save): Catch UnauthorizedAccessException as
13202 well. Fixes bug #73454.
13204 2005-03-07 Marek Safar <marek.safar@seznam.cz>
13206 * cs-tokenizer.cs (xtoken): Add CS1035.
13208 * class.cs (MethodData.Define): Add CS0683.
13209 (FieldMember.ctor): Add CS0681.
13211 2005-03-07 Raja R Harinath <rharinath@novell.com>
13213 * ecore.cs (SimpleName.DoResolve): Rename from
13214 SimpleName.DoResolveAllowStatic.
13215 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13216 Pass 'intermediate' flag to MemberStaticCheck.
13217 (SimpleName.MemberStaticCheck): Skip "static check" only in case
13218 of "intermediate" lookups via MemberAccess.
13219 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
13220 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13222 2005-03-07 Raja R Harinath <rharinath@novell.com>
13225 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13226 slipped in because of variable names that are identical to a
13227 builtin type's BCL equivalent ('string String;', 'int Int32;').
13228 (PropertyExpr.EmitInstance): Likewise.
13230 2005-03-04 Marek Safar <marek.safar@seznam.cz>
13232 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13234 * report.cs (warning_ignore_table): Made public.
13236 2005-03-04 Raja R Harinath <rharinath@novell.com>
13239 * class.cs (MethodData.Emit): Pass 'container' to
13240 container.GetObsoleteAttribute instead of 'container.Parent'.
13242 2005-03-03 Marek Safar <marek.safar@seznam.cz>
13244 * cs-parser.jay: Add 1534 error test.
13246 * iterators.cs (Yield.CheckContext): Add error 1629.
13247 (Iterator.ctor): Save unsafe modifier.
13248 (MoveNextMethod.DoEmit): Restore unsafe context.
13250 * namespace.cs (UsingAlias): Better error message.
13252 2005-03-03 Dan Winship <danw@novell.com>
13254 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13255 the warning message [#73219]
13257 2005-03-03 Raja R Harinath <rharinath@novell.com>
13259 Fix compile with MCS 1.0.0.0.
13260 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13261 w_restore to not depend on string constant folding.
13263 2005-03-03 Raja R Harinath <rharinath@novell.com>
13265 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
13266 CS0246 check to users who passed 'silent = false'.
13267 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13269 (SimpleName.SimpleNameResolve): Update.
13270 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13271 (MemberAccess.IdenticalNameAndTypeName): Update.
13272 * doc.cs (FindDocumentedTypeNonArray): Update.
13274 2005-03-03 Raja R Harinath <rharinath@novell.com>
13276 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13277 * parameters.cs (ComputeAndDefineParameters): Remove.
13278 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13279 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13280 Use GetParameterInfo.
13282 2005-03-02 Marek Safar <marek.safar@seznam.cz>
13284 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13286 2005-03-02 Raja R Harinath <rharinath@novell.com>
13288 Unify DeclSpace.LookupType and DeclSpace.FindType.
13289 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
13290 is in charge of defining nested types on demand.
13291 (DeclSpace.LookupType): Use it when the current_type is a
13292 TypeBuilder. Use LookupTypeDirect for reflected types.
13293 (DeclSpace.FindType): Remove.
13294 (DeclSpace.LookupInterfaceOrClass): Likewise.
13295 (DeclSpace.DefineTypeAndParents): Likewise.
13296 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13297 DeclSpace.LookupType.
13298 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13299 * typemanager.cs (LookupType): Simplify.
13300 (AddUserType): Remove type from negative_hits.
13301 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13302 * class.cs (TypeContainer.FindMembers): Move handling of nested
13304 (TypeContainer.FindMembers_NestedTypes): ... here.
13305 (TypeContainer.FindNestedType): Implement override.
13306 (ClassPart.FindNestedType): Delegate to PartialContainer.
13307 (ClassPart.PartFindNestedType): Looks up the nested types of the
13310 2005-03-02 Martin Baulig <martin@ximian.com>
13312 * class.cs (TypeContainer.DoDefineMembers): We also need a default
13313 static constructor in static classes.
13315 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
13317 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13318 sizeParamIndex is not specified.
13320 2005-03-01 Marek Safar <marek.safar@seznam.cz>
13323 * report.cs (WarningMessage.IsEnabled): Missing null check.
13325 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13327 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13328 in the fields and not in the properties.
13330 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
13332 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
13335 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13337 * attribute.cs: Small refactoring (improved robustness).
13338 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13339 (ValidateGuid): Removed.
13340 (Resolve): Removed referenced to above mentioned.
13341 (GetAttributeUsage): Made private and changed to work without
13343 (GetIndexerAttributeValue): Don't crash.
13344 (GetConditionalAttributeValue): Ditto.
13345 (GetClsCompliantAttributeValue): Ditto.
13346 (ExtractSecurityPermissionSet): All attributes exceptions are
13348 (GetPropertyValue): New helper.
13349 (GetMethodImplOptions): New method.
13350 (DefinePInvokeMethod): Reuse common code. Implemented handling of
13351 some missing properties.
13353 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13354 (Method.ApplyAttributeBuilder): Updated.
13356 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13359 2005-02-28 Raja R Harinath <rharinath@novell.com>
13362 * report.cs (Report.SymbolRelatedToPreviousError): Handle
13363 non-simple types (array, pointer, reference).
13365 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13367 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13369 * class.cs (MethodCore.IsDuplicateImplementation): Special error
13371 (Method.CheckBase): Catch wrong destructor here.
13372 (MethodData.Define): Add errors 550, 668.
13374 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13376 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13378 * pending.cs (VerifyPendingMethods): Add error 551.
13380 * typemanager.cs (CSharpName): Next error report helper.
13382 2005-02-25 Marek Safar <marek.safar@seznam.cz>
13384 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13385 attributes. Removed useless attribute double check.
13386 It saves almost 2MBs for corlib.
13388 2005-02-25 Raja R Harinath <rharinath@novell.com>
13391 * statement.cs (ExpressionStatement.Resolve): Make robust to being
13392 called twice in case of error.
13394 2005-02-23 Chris Toshok <toshok@ximian.com>
13396 Fix compiler portions of #72827.
13397 * statement.cs (Block.Emit): call Begin/EndScope on the
13398 EmitContext instead of the ILGenerator.
13400 * codegen.cs (EmitContext.BeginScope): new method, call
13401 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13403 (EmitContext.BeginScope): same, but EndScope and CloseScope
13405 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13406 offset and call the superclass's OpenScope(int) with it.
13407 (SymbolWriter.CloseScope): get the current il
13408 offset and call superclass's CloseScope(int) with it.
13410 2005-02-23 Marek Safar <marek.safar@seznam.cz>
13412 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13413 CS1677 for out and ref as well.
13415 * class.cs (Method.Define): Add error CS1599 detection.
13417 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13419 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13421 * delegate.cs (Delegate.Define): Add error CS1599 detection.
13423 * support.cs.cs (ModifierDesc): New helper method.
13425 2005-02-23 Raja R Harinath <rharinath@novell.com>
13426 Abin Thomas <projectmonokochi@rediffmail.com>
13427 Anoob V E <projectmonokochi@rediffmail.com>
13428 Harilal P R <projectmonokochi@rediffmail.com>
13430 Fix #57851, #72718.
13431 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13432 MemberLookup (used for error reporting) actually returns a result.
13433 Fix error report number (122, not 112).
13435 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
13436 Anoob V E <projectmonokochi@rediffmail.com>
13437 Harilal P R <projectmonokochi@rediffmail.com>
13440 * pending.cs (PendingImplementation.GetAbstractMethods):
13441 Find NonPublic members too.
13443 2005-02-22 Marek Safar <marek.safar@seznam.cz>
13445 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13448 * class.cs (MethodCore.CheckMethodAgainstBase):
13449 Add error 239 report.
13451 2005-02-21 Raja R Harinath <rharinath@novell.com>
13454 * expression.cs (Invocation.IsApplicable): Make public.
13455 (Invocation.IsParamsMethodApplicable): Likewise.
13456 * delegate.cs (Delegate.VerifyApplicability): Don't use
13457 Invocation.VerifyArgumentCompat for parameter applicability
13458 testing. Use Invocation.IsApplicable and
13459 Invocation.IsParamsMethodApplicable.
13461 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13463 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13465 * class.cs (Operator.Define): Add error 217 report.
13467 2005-02-21 Raja R Harinath <rharinath@novell.com>
13469 * namespace.cs (UsingEntry.Resolve): Undo change below.
13471 2005-02-21 Raja R Harinath <rharinath@novell.com>
13474 * ecore.cs (Expression.MemberLookupFailed): Add argument to
13475 disable the error message when the extended MemberLookup also
13477 (Expression.MemberLookupFinal): Update.
13478 (SimpleName.DoSimpleNameResolve): Update.
13479 * expression.cs (MemberAccess.ResolveNamespaceOrType):
13480 Don't use MemberLookupFinal.
13481 (New.DoResolve): Update.
13482 (BaseAccess.CommonResolve): Update.
13484 2005-02-21 Raja R Harinath <rharinath@novell.com>
13487 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13488 occured previously, don't resolve again.
13490 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13493 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13494 argument. Call ResolveAttributeUsage for unresolved.
13495 when types doesn't match ctor arguments.
13497 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13498 for nested attribute classes.
13499 (Class.attribute_usage): Removed.
13500 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13501 for attribute class.
13503 * ecore.cs (IsAttribute): Removed.
13505 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13507 * rootcontext.cs (RegisterAttribute): Removed, attributes are
13509 (attribute_types): Removed.
13510 (EmitCode): Global attributes are emited as the latest.
13512 2005-02-18 Marek Safar <marek.safar@seznam.cz>
13514 * class.cs (EmitFieldInitializers): Don't emit field initializer
13515 for default values when optimilization is on.
13517 * constant.cs (Constant.IsDefaultValue): New property.
13519 * driver.cs: Add /optimize handling.
13523 * literal.cs: Implement new IsDefaultValue property.
13525 * rootcontext.cs (Optimize): New field, holds /optimize option.
13527 2005-02-18 Raja R Harinath <rharinath@novell.com>
13529 Fix crasher in re-opened #72347.
13530 * namespace.cs (Namespace.Lookup): Return null if
13531 DeclSpace.DefineType returns null.
13534 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13536 2005-02-18 Raja R Harinath <rharinath@novell.com>
13538 Fix remainder of #63202. Change semantics of DoResolveLValue: it
13539 now returns null if it cannot resolve to an lvalue.
13540 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13541 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13542 returned null. Remove check for SimpleName.
13543 (EventExpr.DoResolveLValue): New.
13544 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13545 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
13547 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
13548 avoid CS0131 error.
13549 (Unary.ResolveOperator): Move CS0211 check ...
13550 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
13552 (Unary.DoResolveLValue): Simplify.
13553 (AddressOf.DoResolveLValue): New.
13554 (ArrayAccess.DoResolveLValue): New.
13556 2005-02-16 Marek Safar <marek.safar@seznam.cz>
13558 * attribute.cs (Attribute.Resolve): Add arguments casting for
13559 when types doesn't match ctor arguments.
13561 2005-02-16 Raja R Harinath <rharinath@novell.com>
13563 Fix parts of #63202.
13564 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13565 lookup of operator in base type. Ensure that all checks happen
13566 when the operator resolves to an "op_..." method.
13568 2005-02-15 Raja R Harinath <rharinath@novell.com>
13571 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13572 'ignore_cs0104' parameter. Pass it to ...
13573 (NamespaceEntry.Lookup): ... this.
13574 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13575 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13576 (TypeLookupExpression.DoResolveAsTypeStep): Update.
13577 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13578 Update. Request that cs0104 errors be ignored.
13579 (ComposedCast.ResolveAsTypeStep): Update.
13581 2005-02-14 Raja R Harinath <rharinath@novell.com>
13584 * expression.cs (Invocation.BetterFunction): Remove support for
13585 comparing virtual functions and their overrides.
13586 (Invocation.IsOverride): New.
13587 (Invocation.OverloadResolve): Don't consider 'override' functions
13588 during candidate selection. Store them in a lookaside list.
13589 If the selected method is a 'virtual' function, use the list to
13590 find any overrides that are closer to the LHS type.
13592 2005-02-14 Marek Safar <marek.safar@seznam.cz>
13594 * expression.cs (New.DoResolve): Add complex core type reduction.
13595 (New.Constantify): Converts complex core type syntax like 'new int ()'
13596 to simple constant.
13598 2005-02-14 Raja R Harinath <rharinath@novell.com>
13600 * decl.cs (EntryType.EntryType): New constructor to create an
13601 updated copy of a cache entry.
13602 (MemberCache.AddMethods): Use it.
13603 (MemberCache.ClearDeclaredOnly): Remove.
13604 (MemberCache.MemberCache): Update.
13606 2005-02-11 Miguel de Icaza <miguel@novell.com>
13608 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13609 variable. This one is represents the actual low-level declaration
13610 of the method, as opposed to the semantic level `IsStatic'.
13612 An anonymous method which is hosted into a static method might be
13613 actually an instance method. IsStatic would reflect the
13614 container, while MethodIsStatic represents the actual code
13617 * expression.cs (ParameterReference): Use the new MethodIsStatic
13618 instead of IsStatic.
13620 * anonymous.cs (AnonymousMethod.Compatible): Pass the
13621 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13622 set on the current EmitContext.
13624 * expression.cs (Cast): Overload DoResolveLValue so we can pass
13625 resolve our casted expression as an LValue. This triggers the
13626 proper LValue processing that is later required by Assign.
13630 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13632 2005-02-11 Marek Safar <marek.safar@seznam.cz>
13634 C# 2.0 Fixed buffer implementation
13636 * anonymous.cs: Update after RegisterHelperClass renaming.
13638 * attribute.cs (AttributeTester.fixed_buffer_cache):
13639 Cache of external fixed buffers.
13640 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13641 implementation if field is fixed buffer else null.
13644 (TypeContainer.AddField): Accept FieldMember instead of Field.
13645 (FieldBase.IsFieldClsCompliant): Extracted code from
13646 VerifyClsCompliance descendant customization.
13647 (FixedField): New class handles fixed buffer fields.
13648 (FixedFieldExternal): Keeps information about imported fixed
13650 (IFixedField): Make access to internal or external fixed buffer
13653 * cs-parser.jay: Add fixed buffer parsing.
13655 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13658 * expression.cs (Indirection): Extended implementation to accept
13659 fixed buffer field.
13660 (PointerArithmetic.Emit): Get element from fixed buffer as well.
13661 (ElementAccess.MakePointerAccess): Get type as parameter.
13662 (DoResolve): Add fixed buffer field expression conversion.
13663 (DoResolveLValue): Ditto.
13664 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13665 (ArrayPtr): Derives from FixedBufferPtr.
13666 (ArrayPtr.Emit): Add extra emit for array elements.
13668 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13670 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13671 for compiler generated types.
13672 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13674 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13675 and consume less memory.
13676 (Fixed.Resolve): Add fixed buffer case.
13678 * typemanager.cs (compiler_generated_attr_ctor,
13679 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13680 (HasElementType): Add our own implementation to work on every
13683 2005-02-11 Miguel de Icaza <miguel@novell.com>
13685 * anonymous.cs (CaptureContext): Track whether `this' has been
13688 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13689 only captured `this' if it was implicitly done (instance
13690 methods/variables were used).
13692 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13693 `this' must be captured.
13695 2005-01-30 Miguel de Icaza <miguel@novell.com>
13697 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13698 is null it means that there has been no need to capture anything,
13699 so we just create a sibling.
13701 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13703 Just a partial fix. The other half is fairly elusive.
13705 2005-02-10 Raja R Harinath <rharinath@novell.com>
13707 Fix #52586, cs0121-4.cs.
13708 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13709 and return a hashtable.
13710 (MemberCache.ClearDeclaredOnly): New.
13711 (MemberCache.MemberCache): Update to change. Make a deep copy of
13712 the method_hash of a base type too.
13713 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13714 type methods. Overwrite entries with the same MethodHandle so
13715 that the ReflectedType is correct. The process leaves in base
13716 virtual functions and their overrides as distinct entries.
13717 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13718 matters since it was boxed in a ArrayList before.
13719 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13721 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13722 case of a virtual function and its override (choose the overload
13724 (Invocation.OverloadResolve): Avoid 'override' members during
13725 'applicable_type' calculation.
13727 2005-02-09 Raja R Harinath <rharinath@novell.com>
13729 Combine two near-redundant caches.
13730 * typemanager.cs (method_params): Rename from method_internal_params.
13731 (TypeManager.GetParameterData): New. Replace
13732 Invocation.GetParameterData.
13733 (TypeManager.LookupParametersByBuilder): Remove.
13734 * expression.cs (Invocation.method_parameter_cache): Remove.
13735 (Invocation.GetParameterData): Remove.
13737 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13740 2005-02-08 Raja R Harinath <rharinath@novell.com>
13743 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13744 TypeManager.multicast_delegate_type is null, resolve it by looking
13745 up "System.MulticastDelegate".
13746 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13748 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13749 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13750 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13753 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13754 (LabeledStatement.AddReference): New. Set 'referenced'.
13755 (Goto.Resolve): Use it.
13757 2005-02-05 John Luke <john.luke@gmail.com>
13759 * driver.cs: remove duplicate -doc line in Usage ()
13761 2005-02-04 Raja R Harinath <rharinath@novell.com>
13763 * location.cs (Location.AddFile): Fix CS2002 error report.
13765 2005-02-02 Martin Baulig <martin@ximian.com>
13767 * delegate.cs (Delegate.DefineType): Report an internal error if
13768 TypeManager.multicast_delegate_type is null. See bug #72015 for
13771 2005-02-02 Raja R Harinath <rharinath@novell.com>
13773 Fix a crasher in a variant of #31984.
13774 * const.cs (Constant.CheckBase): New override that defers the
13775 new-or-override check in case the base type hasn't been populated
13777 (Constant.Define): Ensure the new-or-override check is performed.
13779 2005-02-01 Duncan Mak <duncan@ximian.com>
13781 * const.cs (LookupConstantValue): Check that `ce' is not null
13782 before calling GetValue ().
13784 2005-02-01 Raja R Harinath <rharinath@novell.com>
13786 Fix test-334.cs (#69519).
13787 * cs-parser.jay (using_alias_directive): Pass in an expression to
13788 NamespaceEntry.UsingAlias.
13789 (using_namespace_directive): Pass in an expression to
13790 NamespaceEntry.Using.
13791 (namespace_name): Don't flatten to a string.
13792 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13793 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13795 (NamespaceEntry.UsingEntry): Likewise.
13796 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13798 (NamespaceEntry.LookupForUsing): Remove.
13799 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13801 (NamespaceEntry.Lookup): Remove support for dotted names.
13803 2005-02-01 Raja R Harinath <rharinath@novell.com>
13805 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13807 (NamespaceEntry.ImplicitParent): Compute on demand.
13808 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13809 parallels the current.
13810 (NamespaceEntry.LookupForUsing): Use it.
13811 (NamespaceEntry.Lookup): If the current namespace-entry is
13812 implicit, don't search aliases and using tables.
13814 2005-02-01 Raja R Harinath <rharinath@novell.com>
13817 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13819 (TypeContainer.BaseCache): Compute on demand.
13820 (TypeContainer.FindMembers): Define constants and types if they're
13821 not already created.
13822 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13824 * const.cs (Constant.Define): Make idempotent.
13826 2005-01-29 Miguel de Icaza <miguel@novell.com>
13828 * pending.cs: Produce better code (no nops produced by using Ldarg
13831 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13832 i - 1' it should be arg + 1.
13836 2005-01-28 Raja R Harinath <rharinath@novell.com>
13838 * attribute.cs (Attribute.CheckAttributeType): Make private
13840 (Attribute.ResolveType): Make virtual.
13841 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13842 handling of RootContext.Tree.Types.
13844 2005-01-27 Raja R Harinath <rharinath@novell.com>
13846 Update attribute-handling to use the SimpleName/MemberAccess
13848 * cs-parser.jay (attribute): Pass in an expression to the
13849 constructors of Attribute and GlobalAttribute.
13850 * attribute.cs (Attribute): Take an expression for the name.
13851 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13852 passed in attribute name expression.
13853 (Attribute.CheckAttributeType): Use it.
13854 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13855 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13856 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13857 argument to prevent error messages if the lookup fails.
13859 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13861 * expression.cs (Indirection): Implemented IVariable interface
13862 to support indirection in AddressOf operator.
13863 (PointerArithmetic.Emit): Add optimalization for case where
13864 result can be precomputed.
13866 2005-01-26 Martin Baulig <martin@ximian.com>
13868 * class.cs (TypeContainer.AttributeTargets): Return the correct
13869 AttributeTargets depending on our `Kind' instead of throwing an
13870 exception; fixes #71632.
13872 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13875 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13878 2005-01-25 Raja R Harinath <rharinath@novell.com>
13881 * expression.cs (MemberAccess.DoResolve): Don't complain with
13882 cs0572 when the LHS of a member access has identical name and type
13885 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13888 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13890 Create custom PermissionSet only for PermissionSetAttribute.
13892 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13895 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13896 delegates in static class.
13898 2005-01-24 Martin Baulig <martin@ximian.com>
13900 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13901 merging an implicit block, just use its reachability.
13903 * statement.cs (Block.Resolve): Make the unreachable code check
13904 work wrt. implicit blocks; see test-337 from #63842.
13906 2005-01-21 Alp Toker <alp@atoker.com>
13908 * cs-parser.jay: destructor_declaration's container is PartialContainer
13909 not Class when partial types are used, so use Kind prop instead of
13912 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13914 * cs-parser.jay: Improve error reporting when an interface
13915 declares new types.
13917 2005-01-20 Dick Porter <dick@ximian.com>
13919 * support.cs: SeekableStreamReader fix from Sandor Dobos
13920 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13921 chars are read. Fixes bug 70369.
13923 2005-01-20 Raja R Harinath <rharinath@novell.com>
13925 * cs-parser.jay (catch_clause): Simplify current_block handling
13928 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13930 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13931 code with ImplicitStandardConversion to handle the implicit
13932 conversion of method groups into valid delegate invocations.
13934 The problem is that in parameter handling we were using this code
13935 path. Fixes bug #64698
13937 2005-01-19 Raja R Harinath <rharinath@novell.com>
13939 * cs-parser.jay: Fix several infelicities.
13940 - Avoid assigning to the parser value stack. Code like
13941 '$3 = null' is unclean. Synthesize a value for the code block
13943 - Avoid using oob_stack for storing location information. Use ...
13944 (_mark_): ... this. New (empty) rule. Saves the current location
13946 (foreach_statement): Avoid using oob_stack for current_block
13947 handling. Use technique used in for_statement and
13948 using_statement. Synthesize a value for the code block to store
13949 additional intermediate information.
13951 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13953 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13954 of a different type is only allowed to private fields of a
13955 containing type, not on fields of a base class.
13957 See test-174.cs and error cs0122-9.cs
13959 2005-01-13 Raja R Harinath <rharinath@novell.com>
13961 Fix test-335.cs (bug #58126).
13962 * cs-parser.jay (argument): Split out non-expression parts of the
13963 rule into 'non_simple_argument'.
13964 (invocation_expression): Support parenthesized invocations with
13965 multiple arguments, and with single non-simple arguments.
13967 2005-01-13 Raja R Harinath <rharinath@novell.com>
13969 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13972 2005-01-12 Raja R Harinath <rharinath@novell.com>
13974 Fix cs0038-1.cs, cs1640-6.cs.
13975 * ecore.cs (Expression.Resolve): Remove special-case for
13976 SimpleName in error-handling.
13977 (Expression.almostMatchedMembers): Relax access permission to
13979 (Expression.MemberLookupFailed): Handle duplicates in
13980 almostMatchedMembers list.
13981 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13982 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13983 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13984 overload if the passed in MemberInfo is a MethodBase.
13986 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13989 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13990 for non-CAS & merge permission sets properly.
13992 2005-01-11 Raja R Harinath <rharinath@novell.com>
13994 Improve standard-compliance of simple name and member access
13995 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13996 * ecore.cs (FullNamedExpression): New abstract base class
13997 for Namespaces and TypeExpressions.
13998 (ResolveFlags.SimpleName): Remove.
13999 (SimpleName): Remove support for dotted names.
14000 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
14001 DeclSpace.FindType and DeclSpace.LookupType.
14002 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
14003 (Expression.ExprClassName): Make member function.
14004 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
14005 a namespace. Remove creation of dotted "SimpleName"s.
14006 (MemberAccess.DoResolve): Likewise.
14007 * decl.cs (DeclSpace.Cache): Make private.
14008 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
14009 (DeclSpace.FindType): Update.
14010 (DeclSpace.LookupType): Move here from RootContext. Return a
14011 FullNamedExpression.
14012 * namespace.cs (Namespace): Derive from FullNamedExpression
14013 so that it can be part of expression resolution.
14014 (Namespace.Lookup): Return an FullNamedExpression.
14015 (NamespaceEntry.LookupAlias): Lookup aliases only in current
14017 * rootcontext.cs (NamespaceLookup): Remove.
14018 (LookupType): Move to DeclSpace.
14019 * attribute.cs (CheckAttributeType): Update.
14020 * doc.cs (FindDocumentedType): Remove allowAlias argument.
14021 (FindDocumentedTypeNonArray): Likewise.
14023 2005-01-11 Raja R Harinath <rharinath@novell.com>
14025 Fix cs0509.cs, cs1632.cs.
14026 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
14027 is the same as IsInterface.
14028 (TypeContainer.GetClassBases): Likewise.
14029 * statement.cs (LabeledStatement.ig): New field.
14030 (LabeledStatement.LabelTarget): Save ILGenerator which created the
14032 (LabeledStatement.DoEmit): Check that the label was created with
14033 the same ILGenerator.
14035 2005-01-10 Marek Safar <marek.safar@seznam.cz>
14038 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
14039 accessors to its properties.
14041 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
14042 from accessors to property.
14044 2005-01-10 Marek Safar <marek.safar@seznam.cz>
14047 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
14048 only for overrides.
14050 2005-01-08 Miguel de Icaza <miguel@ximian.com>
14052 * attribute.cs: Check for null and empty strings.
14054 I have lost another battle to Paolo.
14056 2005-01-07 Marek Safar <marek.safar@seznam.cz>
14059 * class.cs (PropertyMethod): Set Parent field in ctors.
14060 (SetMethod.InternalParameters): Add unsafe switch hack.
14061 Override MarkForDuplicationCheck where it is appropriate.
14063 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
14064 It says whether container allows members with the same name.
14065 Base default is no.
14066 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
14067 Removed is_method parameter.
14069 2005-01-06 Duncan Mak <duncan@ximian.com>
14071 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
14072 because the previous change led to incorrect reporting of CS1032
14073 ("Cannot define/undefine preprocessor symbols after first token in
14074 file"). Instead of using `tokens_seen' as the only flag that
14075 triggers CS1040, introduce `comments_seen'. This new flag is used
14076 to signify having seen comments on the current line, so it is
14077 unset after a newline.
14079 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
14081 * doc.cs : When searching for a type, find nested type too.
14082 This fixes bug #71040.
14084 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
14087 - Warn missing member comment on those classes which also does not
14088 have doc comments. Fixed bug #71041.
14089 - Don't warn missing doc comment on default constructor.
14092 2005-01-06 Duncan Mak <duncan@ximian.com>
14094 * cs-tokenizer.cs (xtoken): After handling traditional C-style
14095 comments, set `tokens_seen' to true. This allows us to detect
14096 misplaced preprocessor directives (i.e. not at the beginning of
14097 the a line, nor after whitespaces). In that case, report error
14098 CS1040. This fixes bug #56460.
14100 * cs-parser.jay (interface_member_declaration): Add checks for
14101 IsExplicitImpl, and report CS0541 error if an interface member is
14102 defined as an explicit interface declaration.
14104 2005-01-06 Marek Safar <marek.safar@seznam.cz>
14107 * class.cs (PropertyMethod): Set Parent field in ctors.
14108 (SetMethod.InternalParameters): Add unsafe switch hack.
14110 * decl.cs (MemberCore.Parent): Cannot be readonly.
14112 2005-01-06 Raja R Harinath <rharinath@novell.com>
14114 * decl.cs (DeclSpace.ResolveType): Remove.
14115 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14116 Merge in code from ...
14117 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
14118 * class.cs, enum.cs: Update to changes.
14120 2005-01-06 Miguel de Icaza <miguel@ximian.com>
14122 * anonymous.cs: Ensure that we init the scope of our parent if it
14123 has not been initialized yet.
14125 2004-12-30 Duncan Mak <duncan@ximian.com>
14127 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14128 if field.FieldBuilder is null. Fixes #70758.
14130 * convert.cs: Fixed some typos and updated some of the comments.
14131 (ImplicitStandardConversionExists):
14132 (TryImplicitIntConversion): If `target_type' is an interface and
14133 the type of `ic' implements this interface, return true or a new
14134 BoxedCast instead of null. This fixes #70468.
14136 2004-12-29 Duncan Mak <duncan@ximian.com>
14138 * expression.cs (Argument.Emit): Check that Expr is
14139 IMemoryLocation before casting to it, and report CS1510 otherwise.
14143 2004-12-21 Ben Maurer <bmaurer@ximian.com>
14145 * statement.cs (Block.ThisVariable): remove the recursion here, to
14146 make the --profile more sane.
14148 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
14150 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14151 assembly, by JB Evain.
14153 2004-12-17 Raja R Harinath <rharinath@novell.com>
14155 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
14156 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14157 "parent" refers to enclosing type/class. "base" refers to superclass.
14159 2004-12-17 Raja R Harinath <rharinath@novell.com>
14161 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14162 Ensure that we only have GlobalAttributes.
14163 * attribute.cs (Attribute.Emit): Make non-virtual.
14164 (GlobalAttribute.Emit): Remove.
14165 (Attribute.Resolve): Make virtual.
14166 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
14167 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14168 the argument. Don't create one.
14169 (Attribute.GetObsoleteAttribute): Likewise.
14170 (Attribute.GetClsCompliantAttributeValue): Likewise.
14171 * class.cs, decl.cs: Update to changes.
14173 2004-12-17 Marek Safar <marek.safar@seznam.cz>
14175 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14177 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14179 * statement.cs (Foreach.Resolve): Add error 186 report.
14181 2004-12-16 Marek Safar <marek.safar@seznam.cz>
14183 * expression.cs (Conditional.DoResolve): Add warning 429.
14185 * statement.cs (If.Resolve): Add warning 665.
14187 2004-12-16 Raja R Harinath <rharinath@novell.com>
14189 New invariant: RootContext.Tree.Types.NamespaceEntry == null
14190 except when in the parser, and in GlobalAttribute.
14191 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14192 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14193 RootContext.Tree.Types.NamespaceEntry once work is done.
14194 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
14195 and resets RootContext.Tree.Types.NamespaceEntry.
14197 2004-12-15 Marek Safar <marek.safar@seznam.cz>
14199 * cs-parser.jay: Don't create a block for every variable.
14201 2004-12-14 Miguel de Icaza <miguel@ximian.com>
14203 * location.cs: Provide extra information.
14205 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14206 variables from the captured environment, it is the ldarg_0.
14208 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14210 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14213 * class.cs: Changed warning level for 169 to avoid developer
14214 displeasure from warning flooding. It will be changed back when they
14215 fix most of current BCL warnings.
14217 * RootContext.cs: Pushed default WarningLevel to 3.
14219 * statement.cs: Removed unused variable.
14221 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14223 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14224 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14225 Add error 502 report.
14226 (StaticClass.DefineType): Add error 441 report.
14227 (Class.AllowedModifiersProp): New virtual property as temporary
14228 extension to AllowedModifiers.
14229 (Class.DefineType): Add error 418 report. Moved ModFlags check here
14230 to share implementation with StaticClass and don't call virtual
14233 * driver.cs (MainDriver): Add error 1558 test.
14235 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14236 report. Moved error 36 test here.
14238 * statement.cs (Throw.Resolve): Add error 724 report.
14240 * typemanager.cs: Add out_attribute_type core type.
14242 2004-12-13 Marek Safar <marek.safar@seznam.cz>
14244 * class.cs (TypeContainer.VerifyClsCompliance): Add error
14246 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14248 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14251 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14253 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
14254 Add error 3023 report.
14255 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14257 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14260 2004-12-12 John Luke <john.luke@gmail.com>
14262 * driver.cs (AddArgs): take -- into account when
14263 adding arguments, fixes bug 65710
14265 2004-12-12 Martin Baulig <martin@ximian.com>
14267 * expression.cs (Unary.TryReduceNegative): Added support for
14268 SByteConstant and ByteConstant.
14269 (Unary.Reduce): Check error values from TryReduceNegative().
14271 2004-12-10 Marek Safar <marek.safar@seznam.cz>
14273 * attributes.cs (Attribute.Resolve): Avoid multiple error report
14274 and report exception as error 182.
14276 2004-12-10 Raja R Harinath <rharinath@novell.com>
14278 * driver.cs (Main): Fix message when there are warnings.
14280 2004-12-09 Miguel de Icaza <miguel@ximian.com>
14282 * delegate.cs: Fixed my fix from yesterday, sorry about that.
14284 2004-12-09 Marek Safar <marek.safar@seznam.cz>
14286 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
14287 Reduced number of warnings.
14289 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14291 2004-12-08 Miguel de Icaza <miguel@ximian.com>
14293 * driver.cs: Removed message.
14295 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14297 2004-12-08 <vargaz@freemail.hu>
14299 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14301 2004-12-08 Martin Baulig <martin@ximian.com>
14303 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14304 instead of a CS3002 for properties and indexer.
14306 2004-12-08 Martin Baulig <martin@ximian.com>
14308 * decl.cs (MemberName.ToString): Make this work again.
14310 2004-12-08 Marek Safar <marek.safar@seznam.cz>
14312 * attribute.cs (Resolve): Add error 591 detection.
14314 * class.cs (FieldMember.Define): Add error 1547 detection.
14315 (Indexer.Define): Add error 620 detection.
14316 (Operator.Define): Add error 590 detection.
14318 * ecore.cs: Missing argument for error 79.
14320 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14323 2004-12-07 Marek Safar <marek.safar@seznam.cz>
14326 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14329 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
14331 * cs-parser.jay : handle doc comments on implicit/explicit operators.
14332 Some operator comments were suppressed.
14333 * doc.cs : Implicit/explicit operator name in doc comments are like
14334 "op_Explicit(type)~returnType", so added suffix handling.
14336 2004-12-07 Martin Baulig <martin@ximian.com>
14339 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14340 (MemberCore.GetClsCompliantAttributeValue): Likewise.
14341 (DeclSpace.ec): New protected field; store the EmitContext here.
14342 (DeclSpace.EmitContext): New public property; moved here from
14344 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14347 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14348 (Enum.Emit): Don't create a new EmitContext.
14350 * delegate.cs (Delegate.DefineType): Always create the
14353 * iterators.cs (Iterators.DefineIterator): Create a new
14354 EmitContext and store it in `ec'.
14356 2004-08-24 Martin Baulig <martin@ximian.com>
14359 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14360 this for accessibility checks.
14361 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14362 IsNestedFamilyAccessible.
14363 (TypeManager.IsSubclassOf): New method, do what the name actually
14366 2004-12-06 Raja R Harinath <rharinath@novell.com>
14368 Fix crash on cs0657-17.cs.
14369 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14370 Use RootContext.Tree.Types, not 'new RootTypes ()'.
14371 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14372 the case where the NamespaceEntry gets overwritten.
14374 2004-12-06 Marek Safar <marek.safar@seznam.cz>
14376 Fixed #69195, #56821
14377 * ecore.cs (ResolveBoolean): Tiny refactoring.
14379 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14380 of right expression resolving when left is false constant and
14381 operator is LogicalAnd OR true constant and operator is LogicalOr.
14383 * statement.cs (ResolveUnreachable): Always reports warning.
14385 2004-12-05 Miguel de Icaza <miguel@ximian.com>
14387 * class.cs: Distinguish between 1721 and 1722 (just a little help
14388 for the programmer).
14390 2004-12-03 Miguel de Icaza <miguel@ximian.com>
14392 * delegate.cs: Only allow this on new versions of the language.
14394 2004-12-02 Duncan Mak <duncan@ximian.com>
14396 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14398 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14399 here as a static method. Take an additional bool out parameter
14400 `must_do_cs1540_check' for signaling to InstanceResolve.
14401 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14402 member field from PropertyExpr class and made it an argument of
14403 the method instead.
14404 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14405 check for MarshalByRefObject, and report CS0122 instead of CS1540.
14406 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14407 and `remove_accessor' as well as InstanceResolve: report CS0122
14412 2004-12-03 Raja R Harinath <rharinath@novell.com>
14414 Fix test-327.cs, test-328.cs, and put in early infrastructure
14415 for eventually fixing #52697.
14416 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14417 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14418 from other methods.
14419 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14420 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14421 (VerifyUsing, error246): Update.
14422 * rootcontext.cs (RootContext.NamespaceLookup): Just use
14423 'NamespaceEntry.LookupNamespaceOrType'.
14425 2004-12-03 Martin Baulig <martin@ximian.com>
14427 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14428 method as our child, call AnonymousMethod.Compatible() on it.
14430 2004-12-03 Raja R Harinath <rharinath@novell.com>
14432 Disable XML documentation support in 'basic' profile.
14433 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14434 Redirect XmlElement to System.Object.
14435 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14436 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14437 * mcs.exe.sources: Add doc-bootstrap.cs.
14438 * doc-bootstrap.cs: New file. Contains empty stub implementation
14441 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
14443 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14444 comments are allowed.
14446 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14448 * delegate.cs: Add checks for subtypes in paramaters and return values
14449 in VerifyMethod () to add support for Covariance/Contravariance
14452 2004-12-02 Miguel de Icaza <miguel@ximian.com>
14454 * report.cs: Remove extra closing parenthesis.
14456 * convert.cs (Error_CannotImplicitConversion): If the name of the
14457 types are the same, provide some extra information.
14459 * class.cs (FieldBase): Use an unused bit field from the field to
14460 encode the `has_offset' property from the FieldMember. This saves
14461 a couple of Ks on bootstrap compilation.
14463 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14464 method as our child, return the AnonymousMethod resolved
14467 * expression.cs (New.DoResolve): Allow return values from
14468 NewDelegate to also include AnonymousMethods.
14472 2004-12-02 Marek Safar <marek.safar@seznam.cz>
14475 * attribute.cs (Resolve): Improved implementation of params
14476 attribute arguments.
14478 * support.cs (ParameterData): Add HasParams to be faster.
14480 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
14482 all things are for /doc support:
14484 * doc.cs: new file that supports XML documentation generation.
14485 * mcs.exe.sources: added doc.cs.
14487 Handle /doc command line option.
14488 Report error 2006 instead of 5 for missing file name for /doc.
14489 Generate XML documentation when required, after type resolution.
14491 Added support for picking up documentation (/// and /** ... */),
14492 including a new XmlCommentState enumeration.
14494 Added lines to fill Documentation element for field, constant,
14495 property, indexer, method, constructor, destructor, operator, event
14496 and class, struct, interface, delegate, enum.
14497 Added lines to warn incorrect comment.
14499 Added Documentation field (passed only when /doc was specified).
14501 Added DocComment, DocCommentHeader, GenerateDocComment() and
14502 OnGenerateDocComment() and some supporting private members for
14503 /doc feature to MemberCore.
14505 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14507 Added overriden DocCommentHeader.
14509 Added overriden DocCommentHeader and GenerateDocComment().
14511 2004-12-01 Miguel de Icaza <miguel@ximian.com>
14513 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14514 unwrapping the enumeration values, chain to
14515 DoConstantNumericPromotions again, so we can promote things to the
14516 fundamental types (takes care of enums that are bytes, sbytes).
14520 2004-12-01 Raja R Harinath <rharinath@novell.com>
14522 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14523 Fix long-standing bug in type-lookup. Use FindType instead of
14524 LookupType when ec.ResolvingTypeTree.
14525 (Attribute.ResolveType, Attribute.Resolve)
14526 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14528 (Attributes.Search): Remove internal version. Update.
14529 (Attributes.SearchMulti): Update.
14530 (Attributes.GetClsCompliantAttribute): Remove.
14531 (Attributes.GetIndexerNameAttribute): Remove.
14532 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14533 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14534 * class.cs (Indexer.Define): Likewise.
14536 2004-12-01 Marek Safar <marek.safar@seznam.cz>
14539 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14540 MarshallByReference members access.
14542 * expression.cs: Use CheckMarshallByRefAccess;
14543 Better error CS0197 message.
14545 * report.cs: Print whole related error message.
14547 2004-11-30 Raja R Harinath <rharinath@novell.com>
14549 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14550 the current directory to help debugging.
14552 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14554 * class (GetClassBases): Better error 60 report.
14555 (EventProperty): Disabled warning 67 detection.
14557 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14560 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14562 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14565 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14568 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14570 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14572 2004-11-26 Miguel de Icaza <miguel@ximian.com>
14574 * attribute.cs (Attribute.Resolve): Refine error reporting and
14575 report a cs0117 if the identifier does not exist, to distinguish
14576 from 0617 which is a miss-use of the actual identifier.
14578 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14579 between cs0070 and cs0079.
14581 * class.cs (MemberBase.DoDefine): When reporting a wrong
14582 accessibility level, we use MethodCore to compare instead of
14583 Method (this was a regression in some refactoring effort).
14585 So now we correctly report cs0056 again.
14587 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14588 testing the target_type (which was known to be object_type) and
14589 not the source type (which is anonymous_method).
14591 Fixed reporting of error cs1660.
14593 * expression.cs (UserCast.Source): Expose the underlying cast.
14595 * statement.cs (Switch.SwitchGoverningType): Sort the list of
14596 allowed types to find a match to int32 first (most common).
14598 In addition, it ignores any ImplicitUserConversions that did an
14599 internal implicit conversion (as the switch statement allows only
14600 one integral conversion to exist).
14602 * class.cs (PartialContainer.Create): rename `name' to
14603 `member_name' for clarity. Then replace the string calls with a
14604 call to MemberName.GetPartialName, as now using
14605 MemberName.ToString is an error (this is due to the side effects
14606 it had, that were fixed in the past).
14608 This will restore the error reporting on a number of partial class
14609 errors that were missusing this (and getting an exception as a
14610 results, which is now just a plain textual warning, because
14611 yyparse debug output would crash otherwise).
14613 2004-11-26 Raja R Harinath <rharinath@novell.com>
14615 * Makefile (PROGRAM_INSTALL_DIR): Remove.
14617 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14619 * rootcontext.cs (LookupType): Make sure to cache lookups that
14620 don't give us a negative result. This saves about 5% of corlib
14623 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14625 * report.cs (AbstractMessage.Print): messages are sent to stderr
14627 * class.cs (TypeContainer.GetClassBases): It is an error to have a
14628 non-interface in the list of interfaces (at this point, either
14629 parent was properly set, or a base class is being listed in the
14630 interfaces section).
14632 This flags error 1722, and resolves the crash from bug 69259.
14634 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14636 * statement.cs (Using.EmitExpressionFinally): make this work right
14637 for valuetypes. Fixes 69926.
14639 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14641 * const.cs (Const.ChangeType): Cope with the "0 literal can be
14642 converted to an enum" here, before we try to change the underlying
14643 type. This code exists, but it is a different code path than the
14644 one used while encoding constants.
14646 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14647 old bug: when converting from the null literal to a pointer,
14648 return an EmptyCast, not the NullLiteral.
14650 This fixes #69921, the recent null_type changes probably made this
14651 bug more prominent.
14653 (ImplicitReferenceConversionExists): In addition, resynchronized
14654 the code here, so it matches the same code in
14655 ImplicitReferenceConversionExists for the `from any class-type S
14656 to any interface-type T'.
14659 2004-11-25 Marek Safar <marek.safar@seznam.cz>
14661 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14663 2004-11-24 Miguel de Icaza <miguel@ximian.com>
14665 * cs-parser.jay: Use verbosity accordingly.
14667 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14669 * expression.cs (Unary.ResolveOperator): Do not report warning;
14670 AddressOf reads from variable.
14672 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14674 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14678 * attribute.cs (Attributable): Removed CheckTargets.
14679 (Attributes.Emit): Explicit attribute targets are tested here.
14681 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14682 not enabled for interfaces.
14684 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14685 (GetAssemblyName): Ouch next bug there.
14687 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14689 * expression.cs: Error 275 added.
14691 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14693 Fix bug #69177 (Implemented decimal constant support)
14695 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14696 (BinaryFold): Add DecimalConstant.
14698 * const.cs (Define): Decimal constant
14700 (ChangeType): Add decimal type handling.
14701 (LookupConstantValue): Don't set value for decimal type but
14702 emit DecimalConstantAttribute. Needed for constant optimization.
14704 * constant.cs (ToDecimal): New method.
14705 (ConvertToDecimal): New method.
14706 (IntConstant): Implemented ConvertToDecimal.
14707 (DecimalConstant.Emit): Emit optimized version for decimals in
14710 * expression.cs (ResolveOperator): Changed order of constant
14711 reduction to work correctly with native types which have
14712 overloaded operators.
14713 (ResolveMemberAccess): Extract constant value from attribute
14716 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14718 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14719 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14720 (ChangeType): Decimal is special.
14721 (TypeToCoreType): Add decimal type.
14723 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14725 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14728 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14730 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14733 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14735 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14737 * pending.cs (PendingImplementation): Grab only interfaces.
14739 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14741 * statement.cs (ForeachHelperMethods): Add location member and
14742 error 202 detection.
14744 2004-11-19 Raja R Harinath <rharinath@novell.com>
14746 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14747 automatically handled by executable.make.
14748 (PROGRAM): Make profile-specific.
14750 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14752 * expression.cs (DoResolveBase): Fixed wrong warning for out
14755 2004-11-18 Martin Baulig <martin@ximian.com>
14757 Merged latest changes into gmcs. Please keep this comment in
14758 here, it makes it easier for me to see what changed in MCS since
14759 the last time I merged.
14761 2004-11-17 Raja R Harinath <rharinath@novell.com>
14763 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14764 (TypeHandle.GetMemberCache): New.
14765 (TypeHandle.TypeHandle): Update.
14766 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14767 (TypeManager.LookupParentInterfacesCache):
14768 Rename from LookupInterfaceCache. Optimize slightly.
14769 (TypeManager.MemberLookup_FindMembers): Update.
14770 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14771 multi-type variant.
14772 (AddCacheContents): Rename from AddHashtable.
14773 * class.cs (TypeContainer.parent_container): Remove.
14774 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14775 (TypeContainer.DoDefineMembers): Don't initialize it.
14776 Update to name changes.
14778 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14780 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14781 that factors the code to check access modifiers on override.
14783 (PropertyBase): Use the code here.
14785 Patch from Lluis S'anchez, fixes bug #69361.
14787 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14789 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14790 routine that is used to report the use of a captured variable
14791 whose address has been taken.
14793 There are two checks: one when variables are being captured and
14794 the other check is when the address of a variable is taken.
14796 (because an anonymous methods might be resolved before *or* after
14797 the address has been taken) and
14799 * expression.cs (Conditional.DoResolve): Remove the special
14800 casing that Martin added to trueExpr and falseExpr being both
14801 NullLiteral. We get the right behavior now just by introducing
14802 the null_type into the compiler.
14804 * convert.cs (ExplicitConversion): Change the code to use
14805 null_type instead of testing `expr is NullLiteral'.
14806 (ImplicitConversionStandard): use null_type too.
14807 (ImplicitReferenceConversionExists): use null_type too.
14808 (ImplicitReferenceConversion): use null_type too.
14810 * literal.cs: The type of `NullLiteral' is now null_type instead
14812 (Resolve): Set the type here.
14814 * typemanager.cs: Introduce null_type.
14816 2004-11-17 Martin Baulig <martin@ximian.com>
14818 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14819 direction, like FindMembers() does. Fixes #69546, testcase is in
14822 2004-11-16 Martin Baulig <martin@ximian.com>
14824 This is based on a patch from Marek Safar, see bug #69082.
14825 Fixes bugs #63705 and #67130.
14827 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14828 method; create a MemberCache for an interface type and cache the
14831 * decl.cs (IMemberContainer.ParentContainer): Removed.
14832 (IMemberContainer.ParentCache): New property.
14833 (MemberCache.SetupCacheForInterface): Removed.
14834 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14835 to create a cache for an interface's "parent".
14837 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14840 2004-11-16 Martin Baulig <martin@ximian.com>
14842 Merged back from gmcs; these changes already went into gmcs a
14843 couple of weeks ago.
14846 (TypeManager.AddUserType): Removed the `ifaces' argument.
14847 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14849 (TypeManager.AddUserInterface): Removed.
14850 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14852 (TypeManager.GetInterfaces): Likewise.
14853 (TypeManager.GetExplicitInterfaces): Likewise.
14855 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14857 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14858 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14860 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14862 * statement.cs: Avoid adding bools to a hashtable.
14864 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14866 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14867 calling an unsafe method from a safe location.
14869 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14872 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14874 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14876 * namespace.cs (VerifyUsing): use GetPartialName instead of
14879 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14881 * statement.cs (Return.Resolve): Fix regression in typo: if
14882 `in_exc', we have to request a NeedReturnLabel, this was a typo
14883 introduced in the anonymous method check-in. Fixes #69131.
14885 * Indexers were using the ShortName when defining themselves,
14886 causing a regression in the compiler bootstrap when applying the
14887 patch from 2004-11-02 (first part), now they use their full name
14888 and the bug is gone.
14890 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14892 * driver.cs: Strip the path from the names of embedded resources. Fixes
14895 2004-11-04 Raja R Harinath <rharinath@novell.com>
14897 Fix error message regression: cs0104-2.cs.
14898 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14899 (AliasEntry.Resolve): Update.
14900 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14902 (RootContext.LookupType): Update.
14904 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14906 * cs-parser.jay: Add support for handling accessor modifiers
14907 * class: Add support port accessor modifiers and error checking,
14908 define PropertyMethod.Define as virtual (not abstract anymore)
14909 * ecore.cs: Add checking for proeprties access with access modifiers
14910 * iterators.cs: Modify Accessor constructor call based in the modified
14912 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14914 * expression.cs (StringConcat): Handle being called twice,
14915 as when we have a concat in a field init with more than two
14918 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14920 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14921 special case explicit implementations, we should always produce
14922 the .property or .event declaration.
14924 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14925 since it will not return correct data if people use this
14926 unresolved in the presence of using statements (see test-313).
14928 * class.cs (MethodData.Define): If we are an explicit interface
14929 implementation, set the method name to the full name of the
14930 interface plus the name of the method.
14932 Notice that using the method.MethodName.GetFullName() does not
14933 work, as it will only contain the name as declared on the source
14934 file (it can be a shorthand in the presence of using statements)
14935 and not the fully qualifed type name, for example:
14939 class D : ICloneable {
14940 object ICloneable.Clone () {
14944 Would produce a method called `ICloneable.Clone' instead of
14945 `System.ICloneable.Clone'.
14947 * namespace.cs (Alias.Resolve): Use GetPartialName.
14949 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14951 * cs-parser.jay: Add error 1055 report.
14953 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14955 * assign.cs (Assign.DoResolve): Only do the transform of
14956 assignment into a New if the types are compatible, if not, fall
14957 through and let the implicit code deal with the errors and with
14958 the necessary conversions.
14960 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14962 * cs-parser.jay: Add error 1031 report.
14964 * cs-tokenizer.cs: Add location for error 1038.
14966 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14968 * cs-parser.jay: Add error 1016 report.
14970 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14972 * cs-parser.jay: Add errors 1575,1611 report.
14974 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14976 * cs-parser.jay: Add error 1001 report.
14978 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14981 * attribute.cs (GetMarshal): Add method argument for
14982 caller identification.
14984 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14985 agument for GetMarshal and RuntimeMissingSupport.
14987 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14989 * attribute.cs (ExtractSecurityPermissionSet): Removed
14990 TypeManager.code_access_permission_type.
14992 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14994 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14996 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14997 for obsolete use of a variable here. Fixes regression on errors
14998 cs0619-25 and cs0619-26.
15000 2004-10-27 Marek Safar <marek.safar@seznam.cz>
15002 Fix #62358, implemented security attribute encoding.
15004 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
15005 Tests permitted SecurityAction for assembly or other types.
15006 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
15007 data from SecurityPermissionAttribute to PermisionSet class.
15009 * class.cs (ApplyAttributeBuilder): Added special handling
15010 for System.Security.Permissions.SecurityAttribute based types.
15012 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
15013 special handling for System.Security.Permissions.SecurityAttribute
15016 * enum.cs (ApplyAttributeBuilder): Added special handling
15017 for System.Security.Permissions.SecurityAttribute based types.
15019 * parameter.cs (ApplyAttributeBuilder): Added special handling
15020 for System.Security.Permissions.SecurityAttribute based types.
15022 * rootcontext.cs: Next 2 core types.
15024 * typemanager.cs (TypeManager.security_permission_attr_type):
15025 Built in type for the SecurityPermission Attribute.
15026 (code_access_permission_type): Build in type.
15028 2004-10-17 Miguel de Icaza <miguel@ximian.com>
15030 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
15031 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
15032 all of this information into
15033 EmitContext.EmitCapturedVariableInstance.
15035 * codegen.cs (EmitCapturedVariableInstance): move here the
15036 funcionality of emitting an ldarg.0 in the presence of a
15037 remapping. This centralizes the instance emit code.
15039 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
15040 then emit a load of this: it means that we have reached the
15041 topmost ScopeInfo: the one that contains the pointer to the
15042 instance of the class hosting the anonymous method.
15044 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
15045 captures to the topmost CaptureContext.
15047 2004-10-12 Miguel de Icaza <miguel@ximian.com>
15049 * expression.cs (LocalVariableReference): Move the knowledge about
15050 the iterators into codegen's EmitCapturedVariableInstance.
15052 2004-10-11 Miguel de Icaza <miguel@ximian.com>
15054 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
15055 all code paths return a value from an anonymous method (it is the
15056 same as the 161 error, but for anonymous methods).
15058 2004-10-08 Miguel de Icaza <miguel@ximian.com>
15060 The introduction of anonymous methods in the compiler changed
15061 various ways of doing things in the compiler. The most
15062 significant one is the hard split between the resolution phase
15063 and the emission phases of the compiler.
15065 For instance, routines that referenced local variables no
15066 longer can safely create temporary variables during the
15067 resolution phase: they must do so from the emission phase,
15068 since the variable might have been "captured", hence access to
15069 it can not be done with the local-variable operations from the runtime.
15073 (Block.Flags): New flag `IsTopLevel' to indicate that this block
15074 is a toplevel block.
15076 (ToplevelBlock): A new kind of Block, these are the blocks that
15077 are created by the parser for all toplevel method bodies. These
15078 include methods, accessors and anonymous methods.
15080 These contain some extra information not found in regular blocks:
15081 A pointer to an optional CaptureContext (for tracking captured
15082 local variables and parameters). A pointer to the parent
15085 (Return.Resolve): Catch missmatches when returning a value from an
15086 anonymous method (error 1662).
15087 Invoke NeedReturnLabel from the Resolve phase instead of the emit
15090 (Break.Resolve): ditto.
15092 (SwitchLabel): instead of defining the labels during the
15093 resolution phase, we now turned the public ILLabel and ILLabelCode
15094 labels into methods called GetILLabelCode() and GetILLabel() that
15095 only define the label during the Emit phase.
15097 (GotoCase): Track the SwitchLabel instead of the computed label
15098 (its contained therein). Emit the code by using
15099 SwitchLabel.GetILLabelCode ().
15101 (LocalInfo.Flags.Captured): A new flag has been introduce to track
15102 whether the Local has been captured or not.
15104 (LocalInfo.IsCaptured): New property, used to tell whether the
15105 local has been captured.
15107 * anonymous.cs: Vastly updated to contain the anonymous method
15110 The main classes here are: CaptureContext which tracks any
15111 captured information for a toplevel block and ScopeInfo used to
15112 track the activation frames for various local variables.
15114 Each toplevel block has an optional capture context associated
15115 with it. When a method contains an anonymous method both the
15116 toplevel method and the anonymous method will create a capture
15117 context. When variables or parameters are captured, they are
15118 recorded on the CaptureContext that owns them, for example:
15122 MyDelegate d = delegate {
15127 Here `a' will be recorded as captured on the toplevel
15128 CapturedContext, the inner captured context will not have anything
15129 (it will only have data if local variables or parameters from it
15130 are captured in a nested anonymous method.
15132 The ScopeInfo is used to track the activation frames for local
15133 variables, for example:
15135 for (int i = 0; i < 10; i++)
15136 for (int j = 0; j < 10; j++){
15137 MyDelegate d = delegate {
15142 At runtime this captures a single captured variable `i', but it
15143 captures 10 different versions of the variable `j'. The variable
15144 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15145 recorded on a child.
15147 The toplevel ScopeInfo will also track information like the `this'
15148 pointer if instance variables were referenced (this is necessary
15149 as the anonymous method lives inside a nested class in the host
15150 type of the method).
15152 (AnonymousMethod): Expanded to track the Toplevel, implement
15153 `AnonymousMethod.Compatible' to tell whether an anonymous method
15154 can be converted to a target delegate type.
15156 The routine now also produces the anonymous method content
15158 (AnonymousDelegate): A helper class that derives from
15159 DelegateCreation, this is used to generate the code necessary to
15160 produce the delegate for the anonymous method that was created.
15162 * assign.cs: API adjustments for new changes in
15163 Convert.ImplicitStandardConversionExists.
15165 * class.cs: Adjustments to cope with the fact that now toplevel
15166 blocks are of type `ToplevelBlock'.
15168 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15169 insteda of standard blocks.
15171 Flag errors if params arguments are passed to anonymous methods.
15173 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15174 `CurrentAnonymousMethod' which points to the current Anonymous
15175 Method. The variable points to the AnonymousMethod class that
15176 holds the code being compiled. It is set in the new EmitContext
15177 created for the anonymous method.
15179 (EmitContext.Phase): Introduce a variable and an enumeration to
15180 assist in enforcing some rules about when and where we are allowed
15181 to invoke certain methods (EmitContext.NeedsReturnLabel is the
15182 only one that enfonces this right now).
15184 (EmitContext.HaveCaptureInfo): new helper method that returns
15185 whether we have a CapturedContext initialized.
15187 (EmitContext.CaptureVariable): New method used to register that a
15188 LocalInfo must be flagged for capturing.
15190 (EmitContext.CapturedParameter): New method used to register that a
15191 parameters must be flagged for capturing.
15193 (EmitContext.CapturedField): New method used to register that a
15194 field must be flagged for capturing.
15196 (EmitContext.HaveCapturedVariables,
15197 EmitContext.HaveCapturedFields): Return whether there are captured
15198 variables or fields.
15200 (EmitContext.EmitMethodHostInstance): This is used to emit the
15201 instance for the anonymous method. The instance might be null
15202 (static methods), this (for anonymous methods that capture nothing
15203 and happen to live side-by-side with the current method body) or a
15204 more complicated expression if the method has a CaptureContext.
15206 (EmitContext.EmitTopBlock): Routine that drives the emission of
15207 code: it will first resolve the top block, then emit any metadata
15208 and then emit the code. The split is done so that we can extract
15209 any anonymous methods and flag any captured variables/parameters.
15211 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15212 during this phase, the ILGenerator should not be used as labels
15213 and local variables declared here might not be accessible to any
15214 code that is part of an anonymous method.
15216 Exceptions to this include the temporary variables that are
15217 created by some statements internally for holding temporary
15220 (EmitContext.EmitMeta): New routine, in charge of emitting all the
15223 (EmitContext.TemporaryReturn): This method is typically called
15224 from the Emit phase, and its the only place where we allow the
15225 ReturnLabel to be defined other than the EmitMeta. The reason is
15226 that otherwise we would have to duplicate a lot of logic in the
15227 Resolve phases of various methods that today is on the Emit
15230 (EmitContext.NeedReturnLabel): This no longer creates the label,
15231 as the ILGenerator is not valid during the resolve phase.
15233 (EmitContext.EmitThis): Extended the knowledge in this class to
15234 work in anonymous methods in addition to iterators.
15236 (EmitContext.EmitCapturedVariableInstance): This emits whatever
15237 code is necessary on the stack to access the instance to a local
15238 variable (the variable will be accessed as a field).
15240 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15241 EmitContext.EmitAddressOfParameter): Routines to support
15242 parameters (not completed at this point).
15244 Removals: Removed RemapLocal and RemapLocalLValue. We probably
15245 will also remove the parameters.
15247 * convert.cs (Convert): Define a `ConstantEC' which points to a
15248 null. This is just to prefity some code that uses
15249 ImplicitStandardConversion code and do not have an EmitContext
15252 The idea is to flag explicitly that at that point in time, it is
15253 known that the conversion will not trigger the delegate checking
15254 code in implicit conversions (which requires a valid
15257 Everywhere: pass new EmitContext parameter since
15258 ImplicitStandardConversionExists now requires it to check for
15259 anonymous method conversions.
15261 (Convert.ImplicitStandardConversionExists): If the type of an
15262 expression is the anonymous_method_type, and the type is a
15263 delegate, we invoke the AnonymousMethod.Compatible method to check
15264 whether an implicit conversion is possible.
15266 (Convert.ImplicitConversionStandard): Only do implicit method
15267 group conversions if the language level is not ISO_1.
15269 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15270 MethodInfo for the Invoke method. used by Delegate and
15273 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15274 method conversions if the target type is a delegate.
15276 Removed extra debugging nops.
15278 (LocalVariableReference): Turn the `local_info' into a public
15281 Add `prepared' field, the same hack used for FieldExprs to cope
15282 with composed assignments, as Local variables do not necessarily
15283 operate purely on the stack as they used to: they can be captured
15286 Add `temp' for a temporary result, like fields.
15288 Refactor DoResolve and DoResolveLValue into DoResolveBase.
15290 It now copes with Local variables that are captured and emits the
15291 proper instance variable to load it from a field in the captured
15294 (ParameterReference.DoResolveBase): During the resolve phase,
15295 capture parameters if we are in an anonymous method.
15297 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15298 anonymous method, use the EmitContext helper routines to emit the
15299 parameter reference.
15301 * iterators.cs: Set RemapToProxy to true/false during the
15304 * parameters.cs (GetParameterByName): New helper method.
15306 * typemanager.cs (anonymous_method_type) a new type that
15307 represents an anonyous method. This is always an internal type,
15308 used as a fencepost to test against the anonymous-methodness of an
15311 2004-10-20 Marek Safar <marek.safar@seznam.cz>
15313 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15315 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15317 2004-10-18 Martin Baulig <martin@ximian.com>
15319 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15320 `Type' directly, but call ResolveType() on it.
15321 (Catch.Resolve): Likewise.
15322 (Foreach.Resolve): Likewise.
15324 2004-10-18 Martin Baulig <martin@ximian.com>
15326 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15327 `Type' directly, but call ResolveType() on it.
15328 (Probe.DoResolve): Likewise.
15329 (ArrayCreation.LookupType): Likewise.
15330 (TypeOf.DoResolve): Likewise.
15331 (SizeOf.DoResolve): Likewise.
15333 2004-10-18 Martin Baulig <martin@ximian.com>
15335 * expression.cs (Invocation.BetterFunction): Put back
15336 TypeManager.TypeToCoreType().
15338 2004-10-18 Raja R Harinath <rharinath@novell.com>
15340 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15343 2004-10-18 Martin Baulig <martin@ximian.com>
15345 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
15346 `Type' directly, but call ResolveType() on it.
15348 2004-10-18 Martin Baulig <martin@ximian.com>
15350 * class.cs (FieldMember.Define): Don't access the TypeExpr's
15351 `Type' directly, but call ResolveType() on it.
15352 (MemberBase.DoDefine): Likewise.
15354 * expression.cs (New.DoResolve): Don't access the TypeExpr's
15355 `Type' directly, but call ResolveType() on it.
15356 (ComposedCast.DoResolveAsTypeStep): Likewise.
15358 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15359 `Type' directly, but call ResolveType() on it.
15361 2004-10-17 John Luke <john.luke@gmail.com>
15363 * class.cs (Operator.GetSignatureForError): use CSharpName
15365 * parameter.cs (Parameter.GetSignatureForError): Returns
15366 correct name even if was not defined.
15368 2004-10-13 Raja R Harinath <rharinath@novell.com>
15371 * class.cs (TypeContainer.EmitContext): New property.
15372 (DefineNestedTypes): Create an emitcontext for each part.
15373 (MethodCore.DoDefineParameters): Use container's emitcontext.
15374 Pass type array to InternalParameters.
15375 (MemberBase.DoDefine): Use container's emitcontext.
15376 (FieldMember.Define): Likewise.
15377 (Event.Define): Likewise.
15378 (SetMethod.GetParameterInfo): Change argument to EmitContext.
15379 Pass type array to InternalParameters.
15380 (SetIndexerMethod.GetParameterInfo): Likewise.
15381 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15382 * delegate.cs (Define): Pass emitcontext to
15383 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
15384 array to InternalParameters.
15385 * expression.cs (ParameterReference.DoResolveBase): Pass
15386 emitcontext to GetParameterInfo.
15387 (ComposedCast.DoResolveAsTypeStep): Remove check on
15388 ec.ResolvingTypeTree.
15389 * parameter.cs (Parameter.Resolve): Change argument to
15390 EmitContext. Use ResolveAsTypeTerminal.
15391 (Parameter.GetSignature): Change argument to EmitContext.
15392 (Parameters.ComputeSignature): Likewise.
15393 (Parameters.ComputeParameterTypes): Likewise.
15394 (Parameters.GetParameterInfo): Likewise.
15395 (Parameters.ComputeAndDefineParameterTypes): Likewise.
15396 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
15397 * support.cs (InternalParameters..ctor): Remove variant that takes
15399 * typemanager.cs (system_intptr_expr): New.
15400 (InitExpressionTypes): Initialize it.
15402 2004-10-12 Chris Toshok <toshok@ximian.com>
15404 * cs-parser.jay: fix location for try_statement and catch_clause.
15406 2004-10-11 Martin Baulig <martin@ximian.com>
15408 * report.cs: Don't make --fatal abort on warnings, we have
15409 -warnaserror for that.
15411 2004-10-07 Raja R Harinath <rharinath@novell.com>
15413 More DeclSpace.ResolveType avoidance.
15414 * decl.cs (MemberCore.InUnsafe): New property.
15415 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
15416 with newly created EmitContext.
15417 (FieldMember.Define): Likewise.
15418 * delegate.cs (Delegate.Define): Likewise.
15419 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15420 only if normal name-lookup fails.
15421 (TypeExpr.DoResolve): Enable error-checking.
15422 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15423 (SizeOf.DoResolve): Likewise.
15424 (ComposedCast.DoResolveAsTypeStep): Likewise.
15425 (StackAlloc.DoResolve): Likewise.
15426 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15427 (Block.Unsafe): New property.
15428 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15429 (Unsafe): Set 'unsafe' flag of contained block.
15430 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15431 (Fixed.Resolve): Likewise.
15432 (Catch.Resolve): Likewise.
15433 (Using.ResolveLocalVariableDecls): Likewise.
15434 (Foreach.Resolve): Likewise.
15436 2004-10-05 John Luke <john.luke@gmail.com>
15438 * cs-parser.jay: add location to error CS0175
15440 2004-10-04 Miguel de Icaza <miguel@ximian.com>
15442 * ecore.cs (Expression.Constantity): Add support for turning null
15445 * const.cs (Const.Define): Allow constants to be reference types
15446 as long as the value is Null.
15448 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
15450 * namespace.cs (NamespaceEntry.Using): No matter which warning
15451 level is set, check if this namespace name has already been added.
15453 2004-10-03 Ben Maurer <bmaurer@ximian.com>
15455 * expression.cs: reftype [!=]= null should always use br[true,false].
15458 2004-10-03 Marek Safar <marek.safar@seznam.cz>
15461 * attribute.cs: Enum conversion moved to
15462 GetAttributeArgumentExpression to be applied to the all
15465 2004-10-01 Raja R Harinath <rharinath@novell.com>
15467 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15468 * class.c (TypeContainer.DefineType): Flag error if
15469 base types aren't accessible due to access permissions.
15470 * decl.cs (DeclSpace.ResolveType): Move logic to
15471 Expression.ResolveAsTypeTerminal.
15472 (DeclSpace.ResolveTypeExpr): Thin layer over
15473 Expression.ResolveAsTypeTerminal.
15474 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15475 Refactor code into NestedAccess. Use it.
15476 (DeclSpace.NestedAccess): New.
15477 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15478 argument to silence errors. Check access permissions.
15479 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15480 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15481 (Cast.DoResolve): Likewise.
15482 (New.DoResolve): Likewise.
15483 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15484 (TypeOf.DoResolve): Likewise.
15486 * expression.cs (Invocation.BetterConversion): Return the Type of
15487 the better conversion. Implement section 14.4.2.3 more faithfully.
15488 (Invocation.BetterFunction): Make boolean. Make correspondence to
15489 section 14.4.2.2 explicit.
15490 (Invocation.OverloadResolve): Update.
15491 (Invocation): Remove is_base field.
15492 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
15493 (Invocation.Emit): Likewise.
15495 2004-09-27 Raja R Harinath <rharinath@novell.com>
15497 * README: Update to changes.
15499 2004-09-24 Marek Safar <marek.safar@seznam.cz>
15501 * cs-parser.jay: Reverted 642 warning fix.
15503 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15506 * decl.cs (FindMemberWithSameName): Indexer can have more than
15509 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15511 * expression.cs (LocalVariableReference.DoResolveLValue):
15512 Do not report warning 219 for out values.
15513 (EmptyExpression.Null): New member to avoid extra allocations.
15515 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15517 * cs-parser.jay: Fix wrong warning 642 report.
15519 * cs-tokenizer.cs (CheckNextToken): New helper;
15520 Inspect next character if is same as expected.
15522 2004-09-23 Martin Baulig <martin@ximian.com>
15524 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15525 (Convert.ImplicitReferenceConversionExists): Likewise.
15527 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15529 * class.cs (Operator.Define): Add error 448 and 559 report.
15531 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15533 * class.cs (MemberBase.IsTypePermitted): New protected
15534 method for checking error CS0610.
15536 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15538 * class.cs (TypeContainer.HasExplicitLayout): New property
15539 Returns whether container has StructLayout attribute set Explicit.
15540 (FieldMember): New abstract class for consts and fields.
15541 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15542 (Field): Reuse FieldMember.
15544 * const.cs (Const): Reuse FieldMember.
15546 * rootcontext.cs: EmitConstants call moved to class.
15548 2004-09-22 Martin Baulig <martin@ximian.com>
15550 Thanks to Peter Sestoft for this bug report.
15552 * expression.cs (Conditional): If both the `trueExpr' and the
15553 `falseExpr' is a NullLiteral, return a NullLiteral.
15555 2004-09-22 Martin Baulig <martin@ximian.com>
15557 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15558 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15559 for the "get_Current" call.
15561 2004-09-22 Martin Baulig <martin@ximian.com>
15563 Marek and me just fixed one of our oldest bugs: #28562 :-)
15565 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15567 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15568 we're an EnumConstant, just return that.
15569 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15570 an EnumConstant. In this case, we need to use GetValueAsEnumType()
15571 to get the value which'll actually be written into the attribute.
15572 However, we have to use GetValue() to access the attribute's value
15575 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15577 * constant.cs (Constant.IsNegative): New abstract property
15580 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15581 (StackAlloc.DoResolve): Reused IsNegative.
15583 2004-09-21 Martin Baulig <martin@ximian.com>
15585 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15586 if we're used in an iterator, we may be called from different
15589 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15590 we actually have an exception block.
15592 2004-09-20 John Luke <jluke@cfl.rr.com>
15594 * class.cs, cs-parser.jay: Improve the error report for 1520:
15595 report the actual line where the error happens, not where the
15596 class was declared.
15598 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15599 Pass location information that was available elsewhere.
15601 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
15603 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15604 runtime to delay sign assemblies.
15606 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15608 * cs-parser.jay: Do not report the stack trace, this is barely
15611 2004-08-22 John Luke <john.luke@gmail.com>
15613 * driver.cs : check that a resource id is not already used
15614 before adding it, report CS1508 if it is, bug #63637
15616 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15618 * ecore.cs: Removed dead code.
15620 2004-09-18 Marek Safar <marek.safar@seznam.cz>
15622 * class.cs: Do not report warning CS0067 on the interfaces.
15624 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15626 * cs-parser.jay: Add error 504 report.
15628 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15630 * rootcontext.cs: WarningLevel is 4 by default now.
15632 * statement.cs (Fixed.Resolve): Do not null
15635 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15638 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15639 deep search when property is not virtual.
15640 (PropertyExpr.ResolveAccessors): Make one call for both
15643 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15646 * statement.cs: Error 152 report constains also location.
15648 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15651 * const.cs: Explicitly set constant as static.
15653 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15656 * cs-parser.jay: Add error 1017 report.
15658 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15660 Fixed bug #59980, #64224
15661 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15663 * typemanager.cs (IsSpecialMethod): Simplified
15665 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15667 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15668 condition with better params.
15670 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15673 * attribute.cs (Resolve): Property has to have both
15676 2004-09-14 Martin Baulig <martin@ximian.com>
15678 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15680 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15683 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15684 called and is obsolete then this member suppress message
15685 when call is inside next [Obsolete] method or type.
15687 * expression.cs: Use TestObsoleteMethodUsage member.
15689 2004-09-14 Martin Baulig <martin@ximian.com>
15691 * cs-parser.jay: Sync a bit with the GMCS version.
15693 2004-09-14 Martin Baulig <martin@ximian.com>
15695 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15696 (CSharpParser.yacc_verbose_flag): New public field.
15698 * genericparser.cs: Removed.
15700 2004-09-14 Raja R Harinath <rharinath@novell.com>
15702 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15704 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15706 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15708 2004-09-10 Martin Baulig <martin@ximian.com>
15710 Backported my MemberName changes from GMCS into MCS.
15712 - we are now using a special `MemberName' class instead of using
15713 strings; in GMCS, the `MemberName' also contains the type
15716 - changed the grammar rules a bit:
15717 * the old `member_name' is now a `namespace_or_type_name':
15718 The rule is that we use `namespace_or_type_name' everywhere
15719 where we expect either a "member name" (GetEnumerator) or a
15720 "member name" with an explicit interface name
15721 (IEnumerable.GetEnumerator).
15722 In GMCS, the explicit interface name may include type arguments
15723 (IEnumerable<T>.GetEnumerator).
15724 * we use `member_name' instead of just `IDENTIFIER' for
15726 The rule is that we use `member_name' wherever a member may
15727 have type parameters in GMCS.
15729 * decl.cs (MemberName): New public class.
15730 (MemberCore.MemberName): New public readonly field.
15731 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15732 (DeclSpace): Likewise.
15734 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15735 * enum.cs (Enum.ctor): Likewise.
15737 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15739 (AliasEntry.ctor): Take a MemberName, not an Expression.
15740 (AliasEntry.UsingAlias): Likewise.
15742 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15743 (IMethodData.MemberName): Changed type from string to MemberName.
15744 (MemberBase.ExplicitInterfaceName): Likewise.
15745 (AbstractPropertyEventMethod.SetupName): Make this private.
15746 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15747 argument; compute the member name here.
15748 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15749 on the `member.MemberName' and the `prefix'.
15751 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15753 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15754 thus, we get a `MemberName' instead of a `string'. These
15755 declarations may have type parameters in GMCS.
15756 (interface_method_declaration, delegate_declaration): Likewise.
15757 (class_declaration, interface_declaration): Likewise.
15758 (method_header): Use `namespace_or_type_name' instead of
15759 `member_name'. We may be an explicit interface implementation.
15760 (property_declaration, event_declaration): Likewise.
15761 (member_name): This is now just an `IDENTIFIER', not a
15762 `namespace_or_type_name'.
15763 (type_name, interface_type): Removed.
15764 (namespace_or_type_name): Return a MemberName, not an Expression.
15765 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15766 call GetTypeExpression() on the MemberName to get an expression.
15767 (IndexerDeclaration.interface_type): Changed type from string to
15769 (MakeName): Operate on MemberName's instead of string's.
15771 2004-09-13 Raja R Harinath <rharinath@novell.com>
15774 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15775 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15776 lookup to avoid symbols introduced by 'using'.
15777 * rootcontext.cs (NamespaceLookup): Update.
15779 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15781 * class.cs (TypeContainer.DoDefineMembers): Do not call
15782 DefineDefaultConstructor for static classes.
15784 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15786 * attribute.cs (Attribute.Resolve): Add error 653 report.
15788 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15790 (Method.ApplyAttributeBuilder): Add error 685 report.
15791 (Operator.Define): Add error 564 report.
15793 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15795 * expression.cs (Invocation.DoResolve): Add error
15796 245 and 250 report.
15798 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15801 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15803 * class.cs (ConstructorInitializer.Resolve):
15804 Wrong error number (515->516).
15806 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15808 * class.cs (Indexer.Define): Add error 631 report.
15810 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15812 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15814 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15816 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15818 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15820 * cs-parser.jay: Added error CS0241 report.
15822 2004-09-10 Raja R Harinath <rharinath@novell.com>
15824 * cs-parser.jay (fixed_statement): Introduce a scope for the
15825 declaration in the 'fixed' statement.
15827 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15829 * cs-parser.jay: Added CS0230 error report.
15831 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15833 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15835 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15837 * expression.cs (Argument.Resolve): Added error CS0192 and
15840 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15842 C# 2.0 #pragma warning feature
15844 * cs-tokenizer.cs (PreProcessPragma): New method;
15845 Handles #pragma directive.
15847 * report.cs (WarningRegions): New class; Support
15848 class for #pragma warning directive. It tests whether
15849 warning is enabled for a given line.
15851 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15853 * const.cs: Add more descriptive error report, tahnks to
15856 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15858 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15860 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15862 * expression.cs: Apply patch from Ben: Remove dead code from
15863 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15864 as that code just threw an exception anwyays.
15866 * const.cs: Remove the call to the turnintoconstant, for details
15869 * literal.cs: The type of the null-literal is the null type; So
15870 we use a placeholder type (literal.cs:System.Null, defined here)
15873 * expression.cs (Conditional.DoResolve): Remove some old code that
15874 is no longer needed, conversions have been fixed.
15876 (ArrayCreationExpression.DoResolve): Return false if we fail to
15877 resolve the inner expression.
15879 2004-09-07 Raja R Harinath <rharinath@novell.com>
15882 * cs-parser.jay (delegate_declaration): Record a delegate
15883 declaration as a type declaration.
15884 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15886 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15888 * parameter.cs: Do not crash if the type can not be resolved.
15890 * expression.cs: Report errors with unsafe pointers, fixes #64896
15892 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15894 * expression.cs: Pointer arith always needs to do a conv.i
15895 if the operand is a long. fix 65320
15897 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15899 Fixed cs0619-37.cs, cs0619-38.cs
15901 * enum.cs (GetObsoleteAttribute): Removed.
15903 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15904 on Enum member is double staged. The first is tested member
15907 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15909 Fixed #56986, #63631, #65231
15911 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15912 adds member to name container.
15913 (TypeContainer.AddToTypeContainer): New method, adds type to
15915 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15916 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15917 AddOperator): Simplified by reusing AddToMemberContainer.
15918 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15920 (Method.CheckForDuplications): Fixed implementation to test all
15922 (MemberBase): Detection whether member is explicit interface
15923 implementation is now in constructor.
15924 (MemberBase.UpdateMemberName): Handles IndexerName.
15925 (Accessor): Changed to keep also location information.
15926 (AbstractPropertyEventMethod): Is derived from MemberCore.
15927 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15928 will be emited or not.
15929 (PropertyBase.AreAccessorsDuplicateImplementation):
15930 Tests whether accessors are not in collision with some method.
15931 (Operator): Is derived from MethodCore to simplify common
15934 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15936 (DeclSpace.AddToContainer): Adds the member to defined_names
15937 table. It tests for duplications and enclosing name conflicts.
15939 * enum.cs (EnumMember): Clean up to reuse the base structures
15941 2004-09-03 Martin Baulig <martin@ximian.com>
15943 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15944 into TypeContainer, to make partial classes work again.
15946 2004-09-03 Martin Baulig <martin@ximian.com>
15948 * rootcontext.cs (RootContext.V2): Removed.
15950 2004-03-23 Martin Baulig <martin@ximian.com>
15952 * expression.cs (Invocation.OverloadResolve): Added `bool
15953 may_fail' argument and use it instead of the Location.IsNull() hack.
15955 2004-09-03 Martin Baulig <martin@ximian.com>
15957 Merged latest changes into gmcs. Please keep this comment in
15958 here, it makes it easier for me to see what changed in MCS since
15959 the last time I merged.
15961 2004-09-03 Raja R Harinath <rharinath@novell.com>
15964 * expression.cs (BetterConversion): Don't allow either conversion
15965 to be null. Remove redundant implicit conversion test when 'q ==
15966 null' -- when this function is invoked, we already know that the
15967 implicit conversion exists.
15968 (BetterFunction): Assume that 'best' is non-null. Remove
15969 redundant reimplementation of IsApplicable when 'best' is null.
15970 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15971 number of arguments.
15972 (IsAncestralType): Extract from OverloadResolve.
15973 (OverloadResolve): Make robust to the MethodGroupExpr being
15974 unsorted. Implement all the logic of Section 14.5.5.1, and
15975 support overloading of methods from multiple applicable types.
15976 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15978 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15979 (RealError, Warning): Append type of report to related symbol.
15981 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15983 * enum.cs: Fixed CLS-Compliance checks for enum members.
15984 Error tests cs3008-8.cs, cs3014-8.cs
15986 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15988 Fixed bug #62342, #63102
15989 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15990 like ImplementMethod.
15992 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15994 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15997 2004-09-02 Martin Baulig <martin@ximian.com>
15999 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
16000 TypeManager.GetArgumentTypes() rather than calling GetParameters()
16003 2004-09-01 Marek Safar <marek.safar@seznam.cz>
16005 C# 2.0 Static classes implemented
16007 * class.cs (TypeContainer): instance_constructors,
16008 initialized_fields, initialized_static_fields,
16009 default_constructor, base_inteface_types are protected to be
16010 accessible from StaticClass.
16011 (TypeContainer.DefineDefaultConstructor): New virtual method
16012 for custom default constructor generating
16013 (StaticClass): New class to handle "Static classes" feature.
16015 * cs-parser.jay: Handle static keyword on class like instance
16018 * driver.cs: Added "/langversion" command line switch with two
16019 options (iso-1, default).
16021 2004-08-31 Marek Safar <marek.safar@seznam.cz>
16023 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
16025 2004-08-31 Miguel de Icaza <miguel@ximian.com>
16027 * delegate.cs: Style.
16029 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
16031 * delegate.cs: Add seperate instance expr field for miguel.
16033 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
16035 * PointerArithmetic (Resolve): make sure we are not doing
16036 pointer arith on void*. Also, make sure we are resolved
16037 by not setting eclass until resolve.
16039 All callers: Make sure that PointerArithmetic gets resolved.
16041 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
16043 * ArrayCreation (LookupType): If the type does not resolve
16044 to an array, give an error.
16046 2004-08-27 Marek Safar <marek.safar@seznam.cz>
16048 * statement.cs (Try.Resolve): Fixed bug #64222
16050 2004-08-27 Martin Baulig <martin@ximian.com>
16053 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
16056 2004-08-26 Marek Safar <marek.safar@seznam.cz>
16058 * ecore.cs (Constantify): Get underlying type via
16059 System.Enum.GetUnderlyingType to avoid StackOverflow on the
16060 Windows in special cases.
16062 2004-08-26 Marek Safar <marek.safar@seznam.cz>
16064 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
16065 for obtaining also private methods.
16066 (GetRemoveMethod): Used GetRemoveMethod (true)
16067 for obtaining also private methods.
16069 2004-08-24 Martin Baulig <martin@ximian.com>
16071 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
16072 MethodAttributes.HideBySig for operators.
16074 2004-08-23 Martin Baulig <martin@ximian.com>
16076 Back to the old error reporting system :-)
16078 * report.cs (Message): Removed.
16079 (Report.MessageData, ErrorData, WarningData): Removed.
16080 (Report.Error, Warning): Back to the old system.
16082 2004-08-23 Martin Baulig <martin@ximian.com>
16084 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
16086 * class.cs (TypeContainer.ParentContainer): New public virtual
16087 method; replaces the explicit interface implementation.
16088 (ClassPart.ParentContainer): Override.
16090 2004-08-23 Martin Baulig <martin@ximian.com>
16092 * statement.cs (Switch): Added support for constant switches; see
16093 #59428 or test-285.cs.
16095 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16098 * statement.cs (GetEnumeratorFilter): Removed useless
16099 logic because C# specs is strict. GetEnumerator must be
16102 2004-08-22 Martin Baulig <martin@ximian.com>
16104 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16105 a switch and may break, reset the barrier. Fixes #59867.
16107 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16109 CLS-Compliance speed up (~5% for corlib)
16111 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16112 New method. Tests container for CLS-Compliant names
16114 * class.cs (TypeContainer.VerifyClsName): New method.
16115 Checks whether container name is CLS Compliant.
16116 (Constructor): Implements IMethodData.
16118 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16119 low-case table for CLS Compliance test.
16120 (MemberCache.VerifyClsParameterConflict): New method.
16121 Checks method parameters for CS3006 error.
16123 * enum.cs (EnumMember): Is derived from MemberCore.
16124 (Enum.VerifyClsName): Optimized for better performance.
16126 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16128 * report.cs: Renamed Error_T to Error and changed all
16131 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16133 * class.cs (TypeContainer.IndexerArrayList): New inner class
16134 container for indexers.
16135 (TypeContainer.DefaultIndexerName): New constant for default
16136 indexer name. Replaced all "Item" with this constant.
16137 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16139 * typemanager.cs (TypeManager.default_member_ctor): Cache here
16140 DefaultMemberAttribute constructor.
16142 2004-08-05 Martin Baulig <martin@ximian.com>
16144 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16147 2004-08-05 Marek Safar <marek.safar@seznam.cz>
16149 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16150 multi platforms problem.
16152 * compiler.csproj: Included shared files.
16154 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16156 Fix bug 60333, 55971 in the more general way
16157 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16158 Added arg_type argument for constant conversion.
16159 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16161 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16164 * class.cs (TypeContainer ): New inner classes MethodArrayList,
16165 OperatorArrayList, MethodCoreArrayList for typecontainer
16166 containers. Changed class member types to these new types.
16167 (MethodArrayList.DefineMembers): Added test for CS0659.
16169 2004-08-04 Miguel de Icaza <miguel@ximian.com>
16171 * cfold.cs: Synchronize the folding with the code in expression.cs
16172 Binary.DoNumericPromotions for uint operands.
16174 * attribute.cs: Revert patch from Raja, it introduced a regression
16175 while building Blam-1.2.1 (hard to isolate a test case).
16177 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16181 (TypeContainer.Define): Renamed to DefineContainerMembers because of
16183 (MethodCore.parent_method): New member. The method we're overriding
16184 if this is an override method.
16185 (MethodCore.CheckBase): Moved from Method class and made common.
16186 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16188 (MethodCore.CheckForDuplications): New abstract method. For custom
16189 member duplication search in a container
16190 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16191 method and its return type.
16192 (Event.conflict_symbol): New member. Symbol with same name in the
16196 (MemberCache.FindMemberWithSameName): New method. The method
16197 is looking for conflict with inherited symbols.
16199 2004-08-04 Martin Baulig <martin@ximian.com>
16201 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16203 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16205 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16207 * report.cs (Message): New enum for better error, warning reference in
16209 (MessageData): New inner abstract class. It generally handles printing of
16210 error and warning messages.
16211 Removed unused Error, Warning, Message methods.
16213 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16215 Fix for cs0592-8.cs test
16217 (Attributable.ValidAttributeTargets): Made public.
16218 (Attribute.ExplicitTarget): New member for explicit target value.
16219 (Attribute.CheckTargets): Now we translate explicit attribute
16220 target to Target here.
16222 2004-08-03 Ben Maurer <bmaurer@ximian.com>
16224 * ecore.cs (MethodGroupExpr): new IsBase property.
16226 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16228 * delegate.cs (DelegateCreation): store a MethodGroupExpr
16229 rather than an instance expr.
16231 (DelegateCreation.Emit): Use the method group rather than
16232 the instance expression. Also, if you have base.Foo as the
16233 method for a delegate, make sure to emit ldftn, not ldftnvirt.
16235 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
16237 (NewDelegate.DoResolve): Only check for the existance of Invoke
16238 if the method is going to be needed. Use MethodGroupExpr.
16240 (NewDelegate.Emit): Remove, DelegateCreation implements this.
16242 * expression.cs: For pointer arith., make sure to use
16243 the size of the type, not the size of the pointer to
16246 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16249 * class.cs (Class): Added error CS0502 test.
16251 2004-08-03 John Luke <jluke@cfl.rr.com>
16252 Raja R Harinath <rharinath@novell.com>
16255 * attribute.cs (Attribute.complained_before): New flag.
16256 (Attribute.ResolveType, Attribute.Resolve),
16257 (Attribute.DefinePInvokeMethod): Set it.
16258 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16260 2004-08-03 Martin Baulig <martin@ximian.com>
16262 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16263 use a user-defined operator; we still need to do numeric
16264 promotions in case one argument is a builtin type and the other
16265 one has an implicit conversion to that type. Fixes #62322.
16267 2004-08-02 Martin Baulig <martin@ximian.com>
16269 * statement.cs (LocalInfo.Flags): Added `IsThis'.
16270 (LocalInfo.IsThis): New public property.
16271 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16273 2004-08-01 Martin Baulig <martin@ximian.com>
16275 * class.cs (TypeContainer.GetClassBases): Don't set the default
16276 here since we may get called from GetPartialBases().
16277 (TypeContainer.DefineType): If GetClassBases() didn't return a
16278 parent, use the default one.
16280 2004-07-30 Duncan Mak <duncan@ximian.com>
16282 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16284 2004-07-30 Martin Baulig <martin@ximian.com>
16286 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16288 * class.cs (SourceMethod): New public class, derive from the
16289 symbol writer's ISourceMethod.
16290 (Method): Use the new symbol writer API.
16292 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16293 as argument and use the new symbol writer.
16296 (SourceFile): Implement the symbol writer's ISourceFile.
16297 (Location.SymbolDocument): Removed.
16298 (Location.SourceFile): New public property.
16300 * symbolwriter.cs: Use the new symbol writer API.
16302 2004-07-30 Raja R Harinath <rharinath@novell.com>
16304 * Makefile (install-local): Remove. Functionality moved to
16307 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
16309 * Makefile: Install mcs.exe.config file together with mcs.exe.
16310 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16311 correct runtime version.
16313 2004-07-25 Martin Baulig <martin@ximian.com>
16316 (TypeContainer.RegisterOrder): Removed, this was unused.
16317 (TypeContainer, interface_order): Removed.
16318 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16319 TypeContainer as argument since we can also be called with a
16320 `PartialContainer' for a partial class/struct/interface.
16321 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16322 of checking whether we're an `Interface' - we could be a
16323 `PartialContainer'.
16324 (PartialContainer.Register): Override; call
16325 AddClass()/AddStruct()/AddInterface() on our parent.
16327 * cs-parser.jay (interface_member_declaration): Add things to the
16328 `current_container', not the `current_class'.
16330 * rootcontext.cs (RegisterOrder): The overloaded version which
16331 takes an `Interface' was unused, removed.
16333 * typemanager.cs (TypeManager.LookupInterface): Return a
16334 `TypeContainer', not an `Interface'.
16335 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16336 contain a `PartialContainer' for an interface, so check it's
16337 `Kind' to figure out what it is.
16339 2004-07-25 Martin Baulig <martin@ximian.com>
16341 * class.cs (Class.DefaultTypeAttributes): New public constant.
16342 (Struct.DefaultTypeAttributes): Likewise.
16343 (Interface.DefaultTypeAttributes): Likewise.
16344 (PartialContainer.TypeAttr): Override this and add the
16345 DefaultTypeAttributes.
16347 2004-07-25 Martin Baulig <martin@ximian.com>
16349 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16350 we can just use the `Parent' field instead.
16352 2004-07-25 Martin Baulig <martin@ximian.com>
16354 * class.cs (TypeContainer.Emit): Renamed to EmitType().
16356 2004-07-25 Martin Baulig <martin@ximian.com>
16358 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16359 our parts before defining any methods.
16360 (TypeContainer.VerifyImplements): Make this virtual.
16361 (ClassPart.VerifyImplements): Override and call VerifyImplements()
16362 on our PartialContainer.
16364 2004-07-25 Martin Baulig <martin@ximian.com>
16366 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16368 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16369 argument, we can just use the `Parent' field instead.
16372 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
16373 (MemberBase.DoDefine): Likewise.
16375 2004-07-24 Martin Baulig <martin@ximian.com>
16377 * decl.cs (MemberCore.Parent): New public field.
16378 (DeclSpace.Parent): Moved to MemberCore.
16380 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16381 (MemberBase.ctor): Added TypeContainer argument, pass it to our
16383 (FieldBase, Field, Operator): Likewise.
16384 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16385 (EventField, Event): Likewise.
16387 2004-07-23 Martin Baulig <martin@ximian.com>
16389 * class.cs (PartialContainer): New public class.
16390 (ClassPart): New public class.
16391 (TypeContainer): Added support for partial classes.
16392 (TypeContainer.GetClassBases): Splitted some of the functionality
16393 out into GetNormalBases() and GetPartialBases().
16395 * cs-tokenizer.cs (Token.PARTIAL): New token.
16396 (Tokenizer.consume_identifier): Added some hacks to recognize
16397 `partial', but only if it's immediately followed by `class',
16398 `struct' or `interface'.
16400 * cs-parser.jay: Added support for partial clases.
16402 2004-07-23 Martin Baulig <martin@ximian.com>
16404 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16405 a `DeclSpace' and also made it readonly.
16406 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16407 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16408 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16410 * cs-parser.jay: Pass the `current_class', not the
16411 `current_container' (at the moment, this is still the same thing)
16412 to a new Method, Property, Event, Indexer or Constructor.
16414 2004-07-23 Martin Baulig <martin@ximian.com>
16416 * cs-parser.jay (CSharpParser): Added a new `current_class' field
16417 and removed the `current_interface' one.
16418 (struct_declaration, class_declaration, interface_declaration):
16419 Set `current_class' to the newly created class/struct/interface;
16420 set their `Bases' and call Register() before parsing their body.
16422 2004-07-23 Martin Baulig <martin@ximian.com>
16424 * class.cs (Kind): New public enum.
16425 (TypeContainer): Made this class abstract.
16426 (TypeContainer.Kind): New public readonly field.
16427 (TypeContainer.CheckDef): New public method; moved here from
16429 (TypeContainer.Register): New public abstract method.
16430 (TypeContainer.GetPendingImplementations): New public abstract
16432 (TypeContainer.GetClassBases): Removed the `is_class' and
16433 `is_iface' parameters.
16434 (TypeContainer.DefineNestedTypes): Formerly known as
16436 (ClassOrStruct): Made this class abstract.
16438 * tree.cs (RootTypes): New public type.
16440 2004-07-20 Martin Baulig <martin@ximian.com>
16442 * tree.cs (Tree.RecordNamespace): Removed.
16443 (Tree.Namespaces): Removed.
16445 * rootcontext.cs (RootContext.IsNamespace): Removed.
16447 * cs-parser.jay (namespace_declaration): Just create a new
16448 NamespaceEntry here.
16450 2004-07-20 Martin Baulig <martin@ximian.com>
16452 * statement.cs (ExceptionStatement): New abstract class. This is
16453 now used as a base class for everyone who's using `finally'.
16454 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16455 our local variables before using them.
16457 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16458 virtual method. This is used by Yield.Resolve() to "steal" an
16459 outer block's `finally' clauses.
16460 (FlowBranchingException): The .ctor now takes an ExceptionStatement
16463 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16464 version which takes an ExceptionStatement. This version must be
16465 used to create exception branchings.
16468 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16469 (Iterator.EmitMoveNext): Added exception support; protect the
16470 block with a `fault' clause, properly handle 'finally' clauses.
16471 (Iterator.EmitDispose): Run all the `finally' clauses here.
16473 2004-07-20 Martin Baulig <martin@ximian.com>
16475 * iterator.cs: This is the first of a set of changes in the
16476 iterator code. Match the spec more closely: if we're an
16477 IEnumerable, then GetEnumerator() must be called. The first time
16478 GetEnumerator() is called, it returns the current instance; all
16479 subsequent invocations (if any) must create a copy.
16481 2004-07-19 Miguel de Icaza <miguel@ximian.com>
16483 * expression.cs: Resolve the constant expression before returning
16486 2004-07-19 Martin Baulig <martin@ximian.com>
16488 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16489 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16490 the return type of the new EmitContext.
16492 2004-07-18 Martin Baulig <martin@ximian.com>
16494 * class.cs (Property.Define): Fix iterators.
16496 * iterators.cs (Iterator.Define): Moved the
16497 `container.AddInterator (this)' call here from the .ctor; only do
16498 it if we resolved successfully.
16500 2004-07-17 Miguel de Icaza <miguel@ximian.com>
16502 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16503 `true' for preprocessing directives that we parse. The return
16504 value indicates whether we should return to regular tokenizing or
16505 not, not whether it was parsed successfully.
16507 In the past if we were in: #if false ... #line #endif, we would
16508 resume parsing after `#line'. See bug 61604.
16510 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16511 building: IsEnumType should return true only for enums, not for
16512 enums or System.Enum itself. This fixes #61593.
16514 Likely what happened is that corlib was wrong: mcs depended on
16515 this bug in some places. The bug got fixed, we had to add the
16516 hack, which caused bug 61593.
16518 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16519 that was a workaround for the older conditions.
16521 2004-07-16 Ben Maurer <bmaurer@ximian.com>
16523 * assign.cs: IAssignMethod has a new interface, as documented
16524 inline. All assignment code now uses this new api.
16526 * ecore.cs, expression.cs: All classes which implement
16527 IAssignMethod now use the new interface.
16529 * expression.cs (Invocation): add a hack to EmitCall so that
16530 IndexerAccess can be the target of a compound assignment without
16531 evaluating its arguments twice.
16533 * statement.cs: Handle changes in Invocation api.
16535 2004-07-16 Martin Baulig <martin@ximian.com>
16537 * iterators.cs: Rewrote this. We're now using one single Proxy
16538 class for both the IEnumerable and the IEnumerator interface and
16539 `Iterator' derives from Class so we can use the high-level API.
16541 * class.cs (TypeContainer.AddIterator): New method.
16542 (TypeContainer.DoDefineType): New protected virtual method, which
16543 is called from DefineType().
16544 (TypeContainer.DoDefineMembers): Call DefineType() and
16545 DefineMembers() on all our iterators.
16546 (TypeContainer.Emit): Call Emit() on all our iterators.
16547 (TypeContainer.CloseType): Call CloseType() on all our iterators.
16549 * codegen.cs (EmitContext.CurrentIterator): New public field.
16551 2004-07-15 Martin Baulig <martin@ximian.com>
16554 (TypeManager.not_supported_exception_type): New type.
16556 2004-07-14 Martin Baulig <martin@ximian.com>
16558 * iterators.cs: Use real error numbers.
16560 2004-07-14 Martin Baulig <martin@ximian.com>
16562 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16563 requires this to be a System.Collection.IEnumerable and not a
16564 class implementing that interface.
16565 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
16567 2004-07-13 Marek Safar <marek.safar@seznam.cz>
16569 * class.cs: Fixed previous fix, it broke some error tests.
16571 2004-07-12 Martin Baulig <martin@ximian.com>
16573 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16576 2004-07-09 Miguel de Icaza <miguel@ximian.com>
16578 * assign.cs (LocalTemporary): Add new argument: is_address,If
16579 `is_address' is true, then the value that we store is the address
16580 to the real value, and not the value itself.
16582 * ecore.cs (PropertyExpr): use the new local temporary
16583 stuff to allow us to handle X.Y += z (where X is a struct)
16585 2004-07-08 Martin Baulig <martin@ximian.com>
16587 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16588 not always return, just like we're doing in Using.Resolve().
16590 2004-07-07 Miguel de Icaza <miguel@ximian.com>
16592 * cs-parser.jay (fixed_statement): flag this as Pinned.
16594 2004-07-06 Miguel de Icaza <miguel@ximian.com>
16596 * typemanager.cs (TypeManager): Removed MakePinned method, this
16597 mechanism is replaced with the .NET 2.x compatible mechanism of
16598 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16600 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
16601 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16602 `IsFixed' property which has a different meaning.
16604 2004-07-02 Raja R Harinath <rharinath@novell.com>
16606 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16607 visible from inside a nested class, not just the names of the
16608 immediately enclosing class.
16609 Fix for bug #60730.
16611 2004-06-24 Raja R Harinath <rharinath@novell.com>
16613 * expression.cs (BetterConversion): Remove buggy special-case
16614 handling of "implicit constant expression conversions". At this
16615 point, we already know that the conversion is possible -- we're
16616 only checking to see which is better.
16618 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16620 * cs-parser.jay: Added error CS0210 test.
16622 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16624 * cs-parser.jay: Added error CS0134 test.
16626 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16629 * cs-parser.jay: Added error CS0145 test.
16631 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16633 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16635 2004-06-23 Ben Maurer <bmaurer@ximian.com>
16637 * expression.cs (StackAlloc.Resolve): The argument may not
16638 be a constant; deal with this case.
16640 2004-06-23 Marek Safar <marek.safar@seznam.cz>
16642 * attribute.cs (IndexerName_GetIndexerName): Renamed to
16643 GetIndexerAttributeValue.
16644 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16646 * class.cs (Indexer.Define): Added error tests for CS0415,
16649 2004-06-23 Miguel de Icaza <miguel@ximian.com>
16651 * attribute.cs (Attribute.Resolve): Keep field code in sync with
16654 2004-06-23 Martin Baulig <martin@ximian.com>
16656 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16657 neither return nor throw, reset the barrier as well. Fixes #60457.
16659 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
16661 * class.cs : EventAttributes is now set to None by default.
16662 This fixes bug #60459.
16664 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16667 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16668 Don't throw exception but return null (it's sufficient now).
16670 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16672 * typemanager.cs (GetArgumentTypes): Faster implementation.
16674 2004-06-18 Martin Baulig <martin@ximian.com>
16676 * attribute.cs (Attribute.Resolve): Check whether we're an
16677 EmptyCast which a Constant child. Fixes #60333.
16679 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16681 * statement.cs (EmitCollectionForeach): Account for the fact that
16682 not all valuetypes are in areas which we can take the address of.
16683 For these variables, we store to a temporary variable. Also, make
16684 sure that we dont emit a `callvirt' on a valuetype method.
16686 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16688 * expression.cs (StackAlloc.DoReSolve): Added test for
16689 negative parameter (CS0247).
16691 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16694 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16696 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16699 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16702 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16704 Fix bug #58254 & cs1555.cs, cs1556.cs
16705 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16707 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16709 * cs-parser.jay: Added error CS1669 test for indexers.
16711 2004-06-11 Martin Baulig <martin@ximian.com>
16713 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16714 call this twice: for params and varargs methods.
16716 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16719 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16721 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16723 * attribute.cs (Attribute.GetValidTargets): Made public.
16726 (AbstractPropertyEventMethod): New class for better code sharing.
16727 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16729 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16731 2004-06-11 Raja R Harinath <rharinath@novell.com>
16734 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16735 that the call to Resolve is part of a MemberAccess.
16736 (Expression.Resolve): Use it for SimpleName resolution.
16737 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16738 Add 'intermediate' boolean argument.
16739 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16740 error message when the SimpleName can be resolved ambiguously
16741 between an expression and a type.
16742 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16744 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16745 call on the left-side.
16747 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16750 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16752 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16754 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16756 2004-06-11 Martin Baulig <martin@ximian.com>
16758 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16759 varargs methods if applicable.
16761 2004-06-11 Martin Baulig <martin@ximian.com>
16763 * expression.cs (Invocation.EmitCall): Don't use
16764 `method.CallingConvention == CallingConventions.VarArgs' since the
16765 method could also have `CallingConventions.HasThis'.
16767 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16769 * class.cs (Event.GetSignatureForError): Implemented.
16770 Fixed crash in error test cs3010.cs
16772 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16774 * cs-tokenizer.cs: Change the way we track __arglist to be
16775 consistent with the other keywords.
16777 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16779 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16782 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16784 * codegen.cs: Check that all referenced assemblies have a strongname
16785 before strongnaming the compiled assembly. If not report error CS1577.
16786 Fix bug #56563. Patch by Jackson Harper.
16787 * typemanager.cs: Added a method to return all referenced assemblies.
16788 Fix bug #56563. Patch by Jackson Harper.
16790 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16793 (Method.ApplyAttributeBuilder): Moved and added conditional
16794 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16797 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16799 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16802 * class.cs: (EventField.attribute_targets): Changed default target.
16804 2004-06-08 Martin Baulig <martin@ximian.com>
16806 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16808 2004-06-08 Martin Baulig <martin@ximian.com>
16810 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16812 2004-06-07 Martin Baulig <martin@ximian.com>
16814 Added support for varargs methods.
16816 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16819 * cs-parser.jay: Added support for `__arglist'.
16821 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16823 * expression.cs (Argument.AType): Added `ArgList'.
16824 (Invocation): Added support for varargs methods.
16825 (ArglistAccess): New public class.
16826 (Arglist): New public class.
16828 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16830 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16831 a method's top-level block if the method has varargs.
16833 * support.cs (ReflectionParameters, InternalParameters): Added
16834 support for varargs methods.
16836 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16838 * class.cs: Provide location in indexer error report.
16840 * driver.cs: Use standard names.
16842 * namespace.cs: Catch the use of using after a namespace has been
16843 declared also on using aliases.
16845 2004-06-03 Raja R Harinath <rharinath@novell.com>
16848 * typemanager.cs (closure_private_ok, closure_invocation_type)
16849 (closure_qualifier_type, closure_invocation_assembly)
16850 (FilterWithClosure): Move to ...
16851 (Closure): New internal nested class.
16852 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16853 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16854 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16855 (MemberLookup, MemberLookupFailed): Use it.
16856 * expression.cs (New.DoResolve): Treat the lookup for the
16857 constructor as being qualified by the 'new'ed type.
16858 (Indexers.GetIndexersForTypeOrInterface): Update.
16860 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16863 (GetConditionalAttributeValue): New method. Returns
16864 condition of ConditionalAttribute.
16865 (SearchMulti): New method. Returns all attributes of type 't'.
16866 Use it when attribute is AllowMultiple = true.
16867 (IsConditionalMethodExcluded): New method.
16870 (Method.IsExcluded): Implemented. Returns true if method has conditional
16871 attribute and the conditions is not defined (method is excluded).
16872 (IMethodData): Extended interface for ConditionalAttribute support.
16873 (PropertyMethod.IsExcluded): Implemented.
16876 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16879 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16882 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16884 * expression.cs (ArrayCreationExpression): Make this just an
16885 `expression'. It can't be a statement, so the code here was
16888 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16891 * typemanager.cs (GetFullNameSignature): New method for
16894 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16897 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16898 Use this method when MethodBuilder is null.
16899 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16900 Added test for error CS0626 (MONO reports error for this situation).
16901 (IMethodData.GetSignatureForError): Extended interface.
16903 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16906 (AttributeTester.GetObsoleteAttribute): Returns instance of
16907 ObsoleteAttribute when type is obsolete.
16910 (TypeContainer.VerifyObsoleteAttribute): Override.
16911 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16912 (MethodCode.VerifyObsoleteAttribute): Override.
16913 (MemberBase.VerifyObsoleteAttribute): Override.
16916 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16917 and report proper error.
16920 Delegate.VerifyObsoleteAttribute): Override.
16923 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16924 and report proper error.
16925 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16928 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16932 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16933 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16934 Added test for ObsoleteAttribute.
16937 (Catch): Derived from Statement.
16939 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16941 Fixed bug #59071 & cs0160.cs
16943 * statement.cs (Try.Resolve): Check here whether order of catch
16944 clauses matches their dependencies.
16946 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16948 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16949 caused a regression: #59343. Referencing nested classes from an
16950 assembly stopped working.
16952 2004-05-31 Martin Baulig <martin@ximian.com>
16954 MCS is now frozen for beta 2.
16956 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16958 * convert.cs: add a trivial cache for overload operator resolution.
16960 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16962 * decl.cs: If possible, use lookuptypedirect here. We can only do
16963 this if there is no `.' after the namespace. Avoids using
16964 LookupType, which does lots of slow processing.
16965 (FindNestedType) New method, does what it says :-).
16966 * namespace.cs: use LookupTypeDirect.
16967 * rootcontext.cs: use membercache, if possible.
16968 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16970 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16973 According to the spec,
16975 In a member access of the form E.I, if E is a single identifier,
16976 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16977 field, property, localvariable, or parameter with the same type as
16978 the meaning of E as a type-name (§3.8), then both possible
16979 meanings of E are permitted.
16981 We did not check that E as a simple-name had the same type as E as
16984 This trivial check gives us 5-7% on bootstrap time.
16986 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16988 * expression.cs (Invocation.OverloadResolve): Avoid the
16989 use of hashtables and boxing here by allocating on demand.
16991 2004-05-30 Martin Baulig <martin@ximian.com>
16993 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16994 we're doing a silent lookup. Don't try to lookup nested types in
16995 TypeManager.object_type (thanks to Ben Maurer).
16997 2004-05-30 Martin Baulig <martin@ximian.com>
16999 Committing a patch from Ben Maurer.
17001 * rootcontext.cs (RootContext.LookupType): Cache negative results.
17003 2004-05-29 Martin Baulig <martin@ximian.com>
17005 * class.cs (IMethodData.ShouldIgnore): New method.
17007 * typemanager.cs (TypeManager.MethodFlags): Don't take a
17008 `Location' argument, we don't need it anywhere. Use
17009 `IMethodData.ShouldIgnore ()' instead of
17010 `MethodData.GetMethodFlags ()'.
17011 (TypeManager.AddMethod): Removed.
17012 (TypeManager.AddMethod2): Renamed to AddMethod.
17014 2004-05-29 Martin Baulig <martin@ximian.com>
17016 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
17018 * convert.cs (Convert.ImplicitReferenceConversion): If we're
17019 converting from a class type S to an interface type and we already
17020 have an object on the stack, don't box it again. Fixes #52578.
17022 2004-05-29 Martin Baulig <martin@ximian.com>
17024 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17025 Added support for `params' parameters. Fixes #59267.
17027 2004-05-29 Martin Baulig <martin@ximian.com>
17029 * literal.cs (NullPointer): Provide a private .ctor which sets
17030 `type' to TypeManager.object_type. Fixes #59048.
17032 2004-05-29 Martin Baulig <martin@ximian.com>
17034 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
17035 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
17037 * ecore.cs (EventExpr.instance_expr): Make the field private.
17039 2004-05-26 Marek Safar <marek.safar@seznam.cz>
17041 Fixed bug #50080 & cs0214-2.cs
17042 * expression.cs (Cast.DoResolve): Check unsafe context here.
17044 * statement.cs (Resolve.DoResolve): Likewise.
17046 2004-05-26 Martin Baulig <martin@ximian.com>
17048 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
17050 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
17051 (RootContext.LookupType): Pass down the `silent' flag.
17053 2004-05-25 Martin Baulig <martin@ximian.com>
17056 (MethodGroupExpr.IdenticalTypeName): New public property.
17057 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
17058 expression actually refers to a type.
17060 2004-05-25 Martin Baulig <martin@ximian.com>
17062 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
17063 for #56176 and made it actually work.
17065 2004-05-25 Martin Baulig <martin@ximian.com>
17067 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
17068 (FieldExpr, PropertyExpr): Override and implement
17069 CacheTemporaries. Fixes #52279.
17071 2004-05-25 Miguel de Icaza <miguel@ximian.com>
17073 * location.cs: In the new compiler listing a file twice is a
17074 warning, not an error.
17076 2004-05-24 Martin Baulig <martin@ximian.com>
17078 * enum.cs (Enum.DefineType): For the `BaseType' to be a
17079 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
17081 2004-05-24 Martin Baulig <martin@ximian.com>
17083 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
17084 walking the `using' list. Fixes #53921.
17086 2004-05-24 Martin Baulig <martin@ximian.com>
17088 * const.cs (Const.LookupConstantValue): Added support for
17089 EmptyCast's; fixes #55251.
17091 2004-05-24 Martin Baulig <martin@ximian.com>
17093 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17094 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17095 which does the CS0135 check. The reason is that we first need to
17096 check whether the variable actually exists.
17098 2004-05-24 Martin Baulig <martin@ximian.com>
17100 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17101 than RootContext.LookupType() to find the explicit interface
17102 type. Fixes #58584.
17104 2004-05-24 Raja R Harinath <rharinath@novell.com>
17106 * Makefile: Simplify. Use executable.make.
17107 * mcs.exe.sources: New file. List of sources of mcs.exe.
17109 2004-05-24 Anders Carlsson <andersca@gnome.org>
17113 Use the invariant culture when doing String.Compare for CLS case
17116 2004-05-23 Martin Baulig <martin@ximian.com>
17118 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17119 don't have any dots. Fixes #52622, added cs0246-8.cs.
17121 * namespace.cs (NamespaceEntry.Lookup): Likewise.
17123 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17125 * class.cs (MemberBase.Define): Reuse MemberType member for
17126 resolved type. Other methods can use it too.
17128 2004-05-23 Martin Baulig <martin@ximian.com>
17130 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17131 the variable also exists in the current block (otherwise, we need
17132 to report a CS0103). Fixes #58670.
17134 2004-05-23 Martin Baulig <martin@ximian.com>
17136 * flowanalysis.cs (Reachability.Reachable): Compute this
17137 on-the-fly rather than storing it as a field.
17139 2004-05-23 Martin Baulig <martin@ximian.com>
17141 * flowanalysis.cs (Reachability.And): Manually compute the
17142 resulting `barrier' from the reachability.
17144 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17147 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17148 instance of ObsoleteAttribute when symbol is obsolete.
17151 (IMethodData): Extended interface for ObsoleteAttribute support.
17153 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17155 * attribute.cs: Fix bug #55970
17157 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17161 (GetObsoleteAttribute): New method. Creates the instance of
17163 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17164 ObsoleteAttribute when member is obsolete.
17165 (AttributeTester.Report_ObsoleteMessage): Common method for
17166 Obsolete error/warning reporting.
17169 (TypeContainer.base_classs_type): New member for storing parent type.
17172 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17173 for this MemberCore.
17175 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17177 * attribute.cs, const.cs: Fix bug #58590
17179 2004-05-21 Martin Baulig <martin@ximian.com>
17181 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17182 out parameters if the end of the method is unreachable. Fixes
17185 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17187 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17188 Hari was right, why extra method.
17190 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17192 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17194 2004-05-20 Martin Baulig <martin@ximian.com>
17196 Merged this back from gmcs to keep the differences to a minumum.
17198 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17199 instead of a Declspace.
17200 (Attribute.ResolveType): Likewise.
17201 (Attributes.Search): Likewise.
17202 (Attributes.Contains): Likewise.
17203 (Attributes.GetClsCompliantAttribute): Likewise.
17205 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17207 (MethodData.ApplyAttributes): Take an EmitContext instead of a
17210 2004-05-19 Marek Safar <marek.safar@seznam.cz>
17212 Fix bug #58688 (MCS does not report error when the same attribute
17215 * attribute.cs (Attribute.Emit): Distinction between null and default.
17217 2004-05-19 Raja R Harinath <rharinath@novell.com>
17219 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17220 of a top-level attribute without an attribute target.
17221 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
17223 (Attribute.Conditional_GetConditionName),
17224 (Attribute.Obsolete_GetObsoleteMessage): Update.
17225 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
17226 part of ScanForIndexerName.
17227 (Attribute.CanIgnoreInvalidAttribute): New function.
17228 (Attribute.ScanForIndexerName): Move to ...
17229 (Attributes.ScanForIndexerName): ... here.
17230 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17231 (Attributes.Search): New internal variant that can choose not to
17232 complain if types aren't resolved. The original signature now
17234 (Attributes.GetClsCompliantAttribute): Use internal variant, with
17235 complaints suppressed.
17236 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17237 only if it not useful.
17238 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17239 top-level for attributes that are shared between the assembly
17240 and a top-level class.
17241 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17242 * class.cs: Update to reflect changes.
17243 (DefineIndexers): Fuse loops.
17244 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
17245 a couple more variants of attribute names.
17247 2004-05-18 Marek Safar <marek.safar@seznam.cz>
17249 Fix bug #52585 (Implemented explicit attribute declaration)
17252 (Attributable.ValidAttributeTargets): New abstract method. It gets
17253 list of valid attribute targets for explicit target declaration.
17254 (Attribute.Target): It holds target itself.
17255 (AttributeSection): Removed.
17256 (Attribute.CheckTargets): New method. It checks whether attribute
17257 target is valid for the current element.
17260 (EventProperty): New class. For events that are declared like
17261 property (with add and remove accessors).
17262 (EventField): New class. For events that are declared like field.
17265 * cs-parser.jay: Implemented explicit attribute target declaration.
17267 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
17268 Override ValidAttributeTargets.
17271 (ReturnParameter): Class for applying custom attributes on
17273 (ParameterAtribute): New class. Class for applying custom
17274 attributes on the parameter type.
17276 2004-05-17 Miguel de Icaza <miguel@ximian.com>
17278 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17281 (Method): Allow UNSAFE here.
17283 * modifiers.cs: Support unsafe reporting.
17285 2004-05-17 Marek Safar <marek.safar@seznam.cz>
17287 * decl.cs: Fix bug #58478.
17289 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17291 * statement.cs: When checking for unreachable code on an EmptyStatement,
17292 set the location. Fixes bug #58488.
17294 2004-05-13 Miguel de Icaza <miguel@ximian.com>
17296 * driver.cs: Add -pkg handling.
17298 From Gonzalo: UseShelLExecute=false
17300 2004-05-12 Marek Safar <marek.safar@seznam.cz>
17303 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17305 (Attribute.IsClsCompliaceRequired): Moved to base for better
17307 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17308 when attribute is AttributeUsageAttribute.
17309 (Attribute.GetValidTargets): Simplified.
17310 (Attribute.GetAttributeUsage): New method returns AttributeUsage
17311 attribute for this type.
17312 (Attribute.ApplyAttributes): Method renamed to Emit and make
17314 (GlobalAttributeSection): New class for special handling of global
17315 attributes (assembly, module).
17316 (AttributeSection.Emit): New method.
17318 * class.cs: Implemented Attributable abstract methods.
17319 (MethodCore.LabelParameters): Moved to Parameter class.
17320 (Accessor): Is back simple class.
17321 (PropertyMethod): Implemented Attributable abstract class.
17322 (DelegateMethod): Implemented Attributable abstract class.
17323 (Event): New constructor for disctintion between normal Event
17324 and Event with accessors.
17326 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17328 * codegen.cs, const.cs, decl.cs, delegate.cs:
17329 (CommonAssemblyModulClass): Implemented Attributable abstract class
17332 * enum.cs: Implement IAttributeSupport interface.
17333 (EnumMember): New class for emum members. Implemented Attributable
17337 (ParameterBase): Is abstract.
17338 (ReturnParameter): New class for easier [return:] attribute handling.
17340 * typemanager.cs: Removed builder_to_attr.
17342 2004-05-11 Raja R Harinath <rharinath@novell.com>
17345 * attribute.cs (Attribute.GetPositionalValue): New function.
17346 * class.cs (TypeContainer.VerifyMembers): New function.
17347 (TypeContainer.Emit): Use it.
17348 (ClassOrStruct): New base class for Class and Struct.
17349 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
17350 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17352 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17353 then each non-static field should have a FieldOffset attribute.
17354 Otherwise, none of the fields should have a FieldOffset attribute.
17355 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
17356 and FieldOffset attributes.
17357 * typemanager.cs (TypeManager.struct_layout_attribute_type)
17358 (TypeManager.field_offset_attribute_type): New core types.
17359 (TypeManager.InitCoreTypes): Initialize them.
17361 2004-05-11 Michal Moskal <malekith@pld-linux.org>
17363 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17364 Return correct type.
17367 2004-05-09 Miguel de Icaza <miguel@ximian.com>
17369 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17370 be implicitly converted to ulong.
17372 * expression.cs: The logic for allowing operator &, | and ^ worked
17373 was wrong, it worked before because we did not report an error in
17374 an else branch. Fixes 57895.
17376 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17377 allow volatile fields to be reference types.
17379 2004-05-07 Miguel de Icaza <miguel@ximian.com>
17381 * driver.cs: Add support for /debug-
17383 2004-05-07 Raja R Harinath <rharinath@novell.com>
17385 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
17386 Add a 'complain' parameter to silence errors.
17387 (Attribute.Resolve): Update to changes. Put in sanity check to catch
17388 silently overlooked type-resolutions.
17389 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17390 to reflect changes.
17391 (Attributes.Search): New function.
17392 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17393 (Attributes.GetAttributeFullName): Remove hack.
17394 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
17395 Update to reflect changes.
17396 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17397 Use Attributes.Search instead of nested loops.
17399 2004-05-07 Marek Safar <marek.safar@seznam.cz>
17402 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17403 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17404 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17406 * report.cs: (Report.Warning): Renamed to Warning_T because of
17407 parameter collision.
17409 2004-05-05 Raja R Harinath <rharinath@novell.com>
17411 * expression.cs (MemberAccess.ResolveMemberAccess):
17412 Exit with non-zero status after Report.Error.
17413 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17415 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17417 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17419 * support.cs: Don't hang when the file is empty.
17421 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17423 * support.cs: In SeekableStreamReader, compute the preamble size of the
17424 underlying stream. Position changes should take into account that initial
17427 2004-05-03 Todd Berman <tberman@sevenl.net>
17429 * driver.cs: remove unused GetSysVersion function.
17431 2004-05-03 Todd Berman <tberman@sevenl.net>
17433 * driver.cs: Remove the hack from saturday, as well as the hack
17434 from jackson (LoadAssemblyFromGac), also adds the CWD to the
17435 link_paths to get that bit proper.
17437 2004-05-01 Todd Berman <tberman@sevenl.net>
17439 * driver.cs: Try a LoadFrom before a Load, this checks the current
17440 path. This is currently a bug in mono that is be fixed, however, this
17441 provides a workaround for now. This will be removed when the bug
17444 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
17446 * CryptoConvert.cs: Updated to latest version. Fix issue with
17447 incomplete key pairs (#57941).
17449 2004-05-01 Todd Berman <tberman@sevenl.net>
17451 * driver.cs: Remove '.' from path_chars, now System.* loads properly
17454 2004-04-30 Jackson Harper <jackson@ximian.com>
17456 * codegen.cs: Open keys readonly.
17458 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17460 * typemanager.cs: don't report cyclic struct layout when a struct
17461 contains 2 or more fields of the same type. Failed for Pango.AttrShape
17462 which has 2 Pango.Rectangle fields.
17464 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
17466 * expression.cs: Handle IntPtr comparisons with IL code
17467 rather than a method call.
17469 2004-04-29 Martin Baulig <martin@ximian.com>
17471 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
17472 the list of PropertyInfo's in class hierarchy and find the
17473 accessor. Fixes #56013.
17475 2004-04-29 Martin Baulig <martin@ximian.com>
17477 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17479 2004-04-29 Martin Baulig <martin@ximian.com>
17481 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17483 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17485 2004-04-29 Martin Baulig <martin@ximian.com>
17487 * class.cs (ConstructorInitializer.Resolve): Check whether the
17488 parent .ctor is accessible. Fixes #52146.
17490 2004-04-29 Martin Baulig <martin@ximian.com>
17492 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17494 * statement.cs (Using.EmitLocalVariableDecls): Use
17495 TypeManager.idisposable_type, not typeof (IDisposable).
17496 (Foreach.EmitCollectionForeach): Added support for valuetypes.
17498 2004-04-29 Martin Baulig <martin@ximian.com>
17500 * class.cs (Event.Define): Don't emit the field and don't set
17501 RTSpecialName and SpecialName for events on interfaces. Fixes
17504 2004-04-29 Raja R Harinath <rharinath@novell.com>
17506 Refactor Attribute.ApplyAttributes.
17507 * attribute.cs (Attributable): New base class for objects that can
17508 have Attributes applied on them.
17509 (Attribute): Make AttributeUsage fields public.
17510 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17511 (Attribute.IsInternalCall): New property.
17512 (Attribute.UsageAttr): Convert to a public read-only property.
17513 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17514 (Attribute.ResolveType, Attribute.Resolve)
17515 (Attribute.ScanForIndexerName): Update to reflect changes.
17516 (Attribute.CheckAttributeTarget): Re-format.
17517 (Attribute.ApplyAttributes): Refactor, to various
17518 Attributable.ApplyAttributeBuilder methods.
17519 * decl.cs (MemberCore): Make Attributable.
17520 * class.cs (Accessor): Make Attributable.
17521 (MethodData.ApplyAttributes): Use proper attribute types, not
17523 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17524 (TypeContainer.ApplyAttributeBuilder)
17525 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17526 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
17527 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17528 (Operator.ApplyAttributeBuilder): New factored-out methods.
17529 * const.cs (Const.ApplyAttributeBuilder): Likewise.
17530 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17531 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17532 * parameter.cs (ParameterBase): New Attributable base class
17533 that can also represent Return types.
17534 (Parameter): Update to the changes.
17536 2004-04-29 Jackson Harper <jackson@ximian.com>
17538 * driver.cs: Prefer the corlib system version when looking for
17539 assemblies in the GAC. This is still a hack, but its a better hack
17542 2004-04-29 Marek Safar <marek.safar@seznam.cz>
17544 * decl.cs, enum.cs: Improved error 3005 reporting.
17546 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17547 (related_symbols): New private member for list of symbols
17548 related to reported error/warning.
17550 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17552 2004-04-29 Martin Baulig <martin@ximian.com>
17554 * ecore.cs (Expression.Constantify): If we're an enum and
17555 TypeManager.TypeToCoreType() doesn't give us another type, use
17556 t.UnderlyingSystemType. Fixes #56178.
17558 2004-04-29 Martin Baulig <martin@ximian.com>
17560 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17561 interfaces and for each interface, only add members directly
17562 declared in that interface. Fixes #53255.
17564 2004-04-28 Martin Baulig <martin@ximian.com>
17566 * expression.cs (ConditionalLogicalOperator): Use a temporary
17567 variable for `left' to avoid that we evaluate it more than once;
17570 2004-04-28 Martin Baulig <martin@ximian.com>
17572 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17575 2004-04-28 Martin Baulig <martin@ximian.com>
17577 * statement.cs (LocalInfo.Resolve): Check whether the type is not
17580 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17581 whether the type is not void (CS1547).
17583 2004-04-28 Martin Baulig <martin@ximian.com>
17585 * expression.cs (Unary.DoResolveLValue): Override this and report
17586 CS0131 for anything but Operator.Indirection.
17588 2004-04-28 Martin Baulig <martin@ximian.com>
17590 Committing a patch from Ben Maurer; see bug #50820.
17592 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17595 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17598 2004-04-28 Martin Baulig <martin@ximian.com>
17600 Committing a patch from Ben Maurer; see bug #50820.
17602 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17605 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17608 2004-04-28 Martin Baulig <martin@ximian.com>
17610 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17611 (Block.AddLabel): Call DoLookupLabel() to only search in the
17614 2004-04-28 Martin Baulig <martin@ximian.com>
17616 * cfold.cs (ConstantFold.BinaryFold): Added special support for
17617 comparing StringConstants and NullLiterals in Equality and Inequality.
17619 2004-04-28 Jackson Harper <jackson@ximian.com>
17621 * driver.cs: Attempt to load referenced assemblies from the
17622 GAC. This is the quick and dirty version of this method that
17623 doesnt take into account versions and just takes the first
17624 canidate found. Will be good enough for now as we will not have more
17625 then one version installed into the GAC until I update this method.
17627 2004-04-28 Martin Baulig <martin@ximian.com>
17629 * typemanager.cs (TypeManager.CheckStructCycles): New public
17630 static method to check for cycles in the struct layout.
17632 * rootcontext.cs (RootContext.PopulateTypes): Call
17633 TypeManager.CheckStructCycles() for each TypeContainer.
17634 [Note: We only need to visit each type once.]
17636 2004-04-28 Martin Baulig <martin@ximian.com>
17638 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17640 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17641 success and added `out object value'. Use a `bool resolved' field
17642 to check whether we've already been called rather than
17643 `ConstantValue != null' since this breaks for NullLiterals.
17645 2004-04-28 Raja R Harinath <rharinath@novell.com>
17647 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17648 setting of this flag, since the 'set' method may be non-public.
17650 2004-04-28 Raja R Harinath <rharinath@novell.com>
17652 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17653 check on current_vector.Block.
17655 2004-04-27 Martin Baulig <martin@ximian.com>
17657 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17658 a field initializer. Fixes #56459.
17660 2004-04-27 Martin Baulig <martin@ximian.com>
17662 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17663 we're not attempting to use an indexer. Fixes #52154.
17665 2004-04-27 Martin Baulig <martin@ximian.com>
17667 * statement.cs (Return): Don't create a return label if we don't
17668 need it; reverts my change from January 20th. Thanks to Ben
17671 2004-04-27 Martin Baulig <martin@ximian.com>
17673 According to the spec, `goto' can only leave a nested scope, but
17676 * statement.cs (Block.LookupLabel): Only lookup in the current
17677 block, don't recurse into parent or child blocks.
17678 (Block.AddLabel): Check in parent and child blocks, report
17679 CS0140/CS0158 if we find a duplicate.
17680 (Block): Removed this indexer for label lookups.
17681 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17682 this already does the error reporting for us.
17685 (FlowBranching.UsageVector.Block): New public variable; may be null.
17686 (FlowBranching.CreateSibling): Added `Block' argument.
17687 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17688 label for the target of a `goto' and check whether we're not
17689 leaving a `finally'.
17691 2004-04-27 Martin Baulig <martin@ximian.com>
17693 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17694 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17697 2004-04-27 Martin Baulig <martin@ximian.com>
17699 * statement.cs (Block.AddLabel): Also check for implicit blocks
17700 and added a CS0158 check.
17702 2004-04-27 Martin Baulig <martin@ximian.com>
17704 * flowanalysis.cs (FlowBranchingLoop): New class.
17705 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17706 UsageVector's instead of an ArrayList.
17707 (FlowBranching.Label): Likewise.
17708 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17709 (FlowBranching.AddBreakVector): New method.
17711 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17713 * attribute.cs: Small regression fix: only convert the type if we
17714 the type is different, fixes System.Drawing build.
17716 2004-04-27 Martin Baulig <martin@ximian.com>
17718 * attribute.cs (Attribute.Resolve): If we have a constant value
17719 for a named field or property, implicity convert it to the correct
17722 2004-04-27 Raja R Harinath <rharinath@novell.com>
17724 * statement.cs (Block.Block): Implicit blocks share
17725 'child_variable_names' fields with parent blocks.
17726 (Block.AddChildVariableNames): Remove.
17727 (Block.AddVariable): Mark variable as "used by a child block" in
17728 every surrounding block.
17729 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17730 been used in a child block, complain about violation of "Invariant
17731 meaning in blocks" rule.
17732 * cs-parser.jay (declare_local_variables): Don't use
17733 AddChildVariableNames.
17734 (foreach_statement): Don't create an implicit block: 'foreach'
17735 introduces a scope.
17737 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17739 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17740 converting from 0L to ulong. Fixes 57522.
17742 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17744 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17745 derived class hides via 'new' keyword field from base class (test-242.cs).
17746 TODO: Handle this in the more general way.
17748 * class.cs (CheckBase): Ditto.
17750 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17752 * decl.cs (caching_flags): New member for storing cached values
17754 (MemberCore.Flags): New enum where bit flags for caching_flags
17756 (MemberCore.cls_compliance): Moved to caching_flags.
17757 (DeclSpace.Created): Moved to caching_flags.
17759 * class.cs: Use caching_flags instead of DeclSpace.Created
17761 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17763 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17764 if we are only a derived class, not a nested class.
17766 * typemanager.cs: Same as above, but do this at the MemberLookup
17767 level (used by field and methods, properties are handled in
17768 PropertyExpr). Allow for the qualified access if we are a nested
17771 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17773 * class.cs: Refactoring.
17774 (IMethodData): New inteface; Holds links to parent members
17775 to avoid member duplication (reduced memory allocation).
17776 (Method): Implemented IMethodData interface.
17777 (PropertyBase): New inner classes for get/set methods.
17778 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17779 (Event): New inner classes for add/remove methods.
17780 (Event.DelegateMethod): Implemented IMethodData interface.
17782 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17783 EmitContext (related to class.cs refactoring).
17785 2004-04-21 Raja R Harinath <rharinath@novell.com>
17787 * delegate.cs (Delegate.VerifyApplicability): If the number of
17788 arguments are the same as the number of parameters, first try to
17789 verify applicability ignoring any 'params' modifier on the last
17793 2004-04-16 Raja R Harinath <rharinath@novell.com>
17795 * class.cs (TypeContainer.AddIndexer): Use
17796 'ExplicitInterfaceName' to determine if interface name was
17797 explicitly specified. 'InterfaceType' is not initialized at this time.
17798 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17799 Indexers array is already in the required order. Initialize
17800 'IndexerName' only if there are normal indexers.
17801 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17802 (TypeContainer.Emit): Emit DefaultMember attribute only if
17803 IndexerName is initialized.
17806 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17808 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17811 2004-04-15 Raja R Harinath <rharinath@novell.com>
17813 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17817 * attribute.cs (Attribute.Resolve): Check for duplicate named
17821 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17823 * iterators.cs (MarkYield): track whether we are in an exception,
17824 and generate code accordingly. Use a temporary value to store the
17825 result for our state.
17827 I had ignored a bit the interaction of try/catch with iterators
17828 since their behavior was not entirely obvious, but now it is
17829 possible to verify that our behavior is the same as MS .NET 2.0
17833 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17835 * iterators.cs: Avoid creating temporaries if there is no work to
17838 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17839 Enumerations, use TypeManager.EnumToUnderlying and call
17842 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17845 (This.Emit): Use EmitContext.EmitThis to emit our
17848 (This.EmitAssign): Ditto.
17850 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17851 codepaths, we will move all the functionality into
17854 (FieldExpr.EmitAssign): Ditto.
17856 This fixes several hidden bugs that I uncovered while doing a code
17857 review of this today.
17859 * codegen.cs (EmitThis): reworked so the semantics are more clear
17860 and also support value types "this" instances.
17862 * iterators.cs: Changed so that for iterators in value types, we
17863 do not pass the value type as a parameter.
17865 Initialization of the enumerator helpers is now done in the caller
17866 instead of passing the parameters to the constructors and having
17867 the constructor set the fields.
17869 The fields have now `assembly' visibility instead of private.
17871 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17873 * expression.cs (Argument.Resolve): Check if fields passed as ref
17874 or out are contained in a MarshalByRefObject.
17876 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17877 another compiler type.
17879 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17881 * class.cs (Indexer.Define): use the new name checking method.
17882 Also, return false on an error.
17883 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17884 (is_identifier_[start/part]_character): make static.
17886 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17888 * expression.cs (Binary.ResolveOperator): Do no append strings
17889 twice: since we can be invoked more than once (array evaluation)
17890 on the same concatenation, take care of this here. Based on a fix
17891 from Ben (bug #56454)
17893 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17895 * codegen.cs: Fix another case where CS1548 must be reported (when
17896 delay-sign isn't specified and no private is available #56564). Fix
17897 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17898 error when MCS is used on the MS runtime and we need to delay-sign
17899 (which seems unsupported by AssemblyBuilder - see #56621).
17901 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17903 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17904 (TypeManager.ComputeNamespaces): Faster implementation for
17907 * compiler.csproj: Updated AssemblyName to mcs.
17909 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17911 * rootcontext.cs: Add new types to the boot resolution.
17913 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17914 MulticastDelegate is not allowed.
17916 * typemanager.cs: Add new types to lookup: System.TypedReference
17919 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17920 check for TypedReference or ArgIterator, they are not allowed.
17922 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17923 makes us properly catch 1510 in some conditions (see bug 56016 for
17926 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17928 * CryptoConvert.cs: update from corlib version
17931 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17933 * class.cs (Indexer.Define): Check indexername declaration
17935 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17937 * attribute.cs (IsClsCompliant): Fixed problem with handling
17938 all three states (compliant, not-compliant, undetected).
17940 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17942 * attribute.cs (Attribute): Location is now public.
17943 (Resolve): Store resolved arguments (pos_values) in attribute class.
17944 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17945 (GetClsCompliantAttributeValue): New method that gets
17946 CLSCompliantAttribute value.
17947 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17948 if exists else null.
17949 (AttributeTester): New class for CLS-Compliant verification routines.
17951 * class.cs (Emit): Add CLS-Compliant verification.
17952 (Method.GetSignatureForError): Implemented.
17953 (Constructor.GetSignatureForError): Implemented
17954 (Constructor.HasCompliantArgs): Returns if constructor has
17955 CLS-Compliant arguments.
17956 (Constructor.Emit): Override.
17957 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17958 is needed to test only parameters.
17959 (FieldBase.GetSignatureForError): Implemented.
17960 (TypeContainer): New member for storing base interfaces.
17961 (TypeContainer.FindMembers): Search in base interfaces too.
17963 * codegen.cs (GetClsComplianceAttribute): New method that gets
17964 assembly or module CLSCompliantAttribute value.
17965 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17967 (ModuleClass.Emit): Add error 3012 test.
17969 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17971 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17972 state for all decl types.
17973 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17974 if CLS-Compliant tests are required.
17975 (IsClsCompliaceRequired): New method. Analyze whether code
17976 must be CLS-Compliant.
17977 (IsExposedFromAssembly): New method. Returns true when MemberCore
17978 is exposed from assembly.
17979 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17980 value or gets cached value.
17981 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17982 is explicitly marked with CLSCompliantAttribute.
17983 (IsIdentifierClsCompliant): New abstract method. This method is
17984 used to testing error 3005.
17985 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17986 for identifier and parameters CLS-Compliant testing.
17987 (VerifyClsCompliance): New method. The main virtual method for
17988 CLS-Compliant verifications.
17989 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17990 null. I don't know why is null (too many public members !).
17991 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17992 and get value of first CLSCompliantAttribute that found.
17994 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17995 (VerifyClsCompliance): Override and add extra tests.
17997 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17998 clscheck- disable CLS-Compliant verification event if assembly is has
17999 CLSCompliantAttribute(true).
18001 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
18002 ApllyAttribute is now called in emit section as in the other cases.
18003 Possible future Emit integration.
18004 (IsIdentifierClsCompliant): New override.
18005 (VerifyClsCompliance): New override.
18006 (GetEnumeratorName): Returns full enum name.
18008 * parameter.cs (GetSignatureForError): Implemented.
18010 * report.cs (WarningData): New struct for Warning message information.
18011 (LocationOfPreviousError): New method.
18012 (Warning): New method. Reports warning based on the warning table.
18013 (Error_T): New method. Reports error based on the error table.
18015 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
18016 verifications are done here.
18018 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
18020 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
18021 CLSCompliantAttribute.
18022 (all_imported_types): New member holds all imported types from other
18024 (LoadAllImportedTypes): New method fills static table with exported types
18025 from all referenced assemblies.
18026 (Modules): New property returns all assembly modules.
18028 2004-03-30 Miguel de Icaza <miguel@ximian.com>
18030 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
18031 throwing a parser error.
18033 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
18034 which removes the hardcoded get_/set_ prefixes for properties, as
18035 IL allows for the properties to be named something else.
18039 * expression.cs: Do not override operand before we know if it is
18040 non-null. Fix 56207
18042 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18044 * typemanager.cs: support for pinned variables.
18046 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18048 * decl.cs, typemanager.cs: Avoid using an arraylist
18049 as a buffer if there is only one result set.
18051 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18053 * expression.cs: Make sure you cant call a static method
18054 with an instance expression, bug #56174.
18056 2004-03-29 Miguel de Icaza <miguel@ximian.com>
18058 * class.cs (IsDuplicateImplementation): Improve error reporting to
18059 flag 663 (method only differs in parameter modifier).
18061 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
18062 in preprocessor directives.
18064 * location.cs (LookupFile): Allow for the empty path.
18066 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
18067 better approach for some of that patch, but its failing with the
18068 CharSet enumeration. For now try/catch will do.
18070 * typemanager.cs: Do not crash if a struct does not have fields.
18073 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18075 * expression.cs: cs0213, cant fix a fixed expression.
18078 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18080 * cs-parser.jay: detect invalid embeded statements gracefully.
18083 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18085 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
18088 the invocation type may not be a subclass of the tye of the item/
18089 The type of the item must be a subclass of the invocation item.
18094 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
18096 * attribute.cs: Added methods to get a string and a bool from an
18097 attribute. Required to information from AssemblyKeyFileAttribute,
18098 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18099 * codegen.cs: Modified AssemblyName creation to include support for
18100 strongnames. Catch additional exceptions to report them as CS1548.
18101 * compiler.csproj: Updated include CryptoConvert.cs.
18102 * compiler.csproj.user: Removed file - user specific configuration.
18103 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
18104 Mono.Security assembly. The original class is maintained and tested in
18105 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18106 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18107 like CSC 8.0 (C# v2) supports.
18108 * Makefile: Added CryptoConvert.cs to mcs sources.
18109 * rootcontext.cs: Added new options for strongnames.
18111 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
18113 * driver.cs: For --expect-error, report error code `2'
18114 if the program compiled with no errors, error code `1' if
18115 it compiled with an error other than the one expected.
18117 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
18119 * compiler.csproj: Updated for Visual Studio .NET 2003.
18120 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18121 * compiler.sln: Updated for Visual Studio .NET 2003.
18123 2004-03-24 Ravi Pratap M <ravi@ximian.com>
18125 * expression.cs: Fix bug #47234. We basically need to apply the
18126 rule that we prefer the conversion of null to a reference type
18127 when faced with a conversion to 'object' (csc behaviour).
18129 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18131 * statement.cs: Shorter form for foreach, eliminates
18132 a local variable. r=Martin.
18134 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18136 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18137 checks if we can use brtrue/brfalse to test for 0.
18138 * expression.cs: use the above in the test for using brtrue/brfalse.
18139 cleanup code a bit.
18141 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18143 * expression.cs: Rewrite string concat stuff. Benefits:
18145 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18146 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18147 rather than a concat chain.
18149 * typemanager.cs: Add lookups for more concat overloads.
18151 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18153 * expression.cs: Emit shorter il code for array init.
18170 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
18172 * statement.cs: Before, two switch blocks would be merged if the
18173 total size of the blocks (end_item - begin_item + 1) was less than
18174 two times the combined sizes of the blocks.
18176 Now, it will only merge if after the merge at least half of the
18181 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
18183 * class.cs : csc build fix for GetMethods(). See bug #52503.
18185 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
18187 * expression.cs: Make sure fp comparisons work with NaN.
18188 This fixes bug #54303. Mig approved this patch a long
18189 time ago, but we were not able to test b/c the runtime
18192 2004-03-19 Miguel de Icaza <miguel@ximian.com>
18194 * ecore.cs (TypExpr.GetHashCode): implement this overload.
18196 2004-03-19 Martin Baulig <martin@ximian.com>
18198 * class.cs (MemberCore.IsDuplicateImplementation): Report the
18199 error here and not in our caller.
18201 2004-03-19 Martin Baulig <martin@ximian.com>
18203 * interface.cs: Completely killed this file.
18204 (Interface): We're now a TypeContainer and live in class.cs.
18206 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18207 argument; we're now also called for interfaces.
18208 (TypeContainer.DefineMembers): Allow this method being called
18210 (TypeContainer.GetMethods): New public method; formerly known as
18211 Interface.GetMethod(). This is used by PendingImplementation.
18212 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18213 it's now private and non-static.
18214 (Interface): Moved this here; it's now implemented similar to
18216 (Method, Property, Event, Indexer): Added `bool is_interface'
18217 argument to their .ctor's.
18218 (MemberBase.IsInterface): New public field.
18220 * cs-parser.jay: Create normal Method, Property, Event, Indexer
18221 instances instead of InterfaceMethod, InterfaceProperty, etc.
18222 (opt_interface_base): Removed; we now use `opt_class_base' instead.
18223 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18225 2004-03-19 Martin Baulig <martin@ximian.com>
18227 * class.cs (MethodCore.IsDuplicateImplementation): New private
18228 method which does the CS0111 checking.
18229 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18230 Use IsDuplicateImplementation().
18232 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
18234 * decl.cs (FindMemberToOverride): New method to find the correct
18235 method or property to override in the base class.
18237 - Make Method/Property use the above method to find the
18238 version in the base class.
18239 - Remove the InheritableMemberSignatureCompare as it is now
18242 This patch makes large code bases much faster to compile, as it is
18243 O(n) rather than O(n^2) to do this validation.
18245 Also, it fixes bug 52458 which is that nested classes are not
18246 taken into account when finding the base class member.
18248 Reviewed/Approved by Martin.
18250 2004-03-17 Marek Safar <marek.safar@seznam.cz>
18252 * interface.cs: In all interface classes removed redundant
18253 member initialization.
18255 2004-03-16 Martin Baulig <martin@ximian.com>
18257 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18259 2004-03-15 Miguel de Icaza <miguel@ximian.com>
18261 * decl.cs (DefineTypeAndParents): New helper method to define a
18262 type's containers before the type itself is defined; This is a
18263 bug exposed by the recent changes to Windows.Forms when an
18264 implemented interface was defined inside a class that had not been
18267 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18269 (Check): Loop correctly to report errors modifiers
18270 (UNSAFE was not in the loop, since it was the same as TOP).
18272 * interface.cs: Every interface member now takes a ModFlags,
18273 instead of a "is_new" bool, which we set on the base MemberCore.
18275 Every place where we called "UnsafeOk" in the interface, now we
18276 call the proper member (InterfaceMethod.UnsafeOK) instead to get
18277 the unsafe settings from the member declaration instead of the
18278 container interface.
18280 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
18282 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18283 `set_indexer_name' to the pending bits (one per type).
18285 We fixed a bug today that was picking the wrong method to
18286 override, since for properties the existing InterfaceMethod code
18287 basically ignored the method name. Now we make sure that the
18288 method name is one of the valid indexer names.
18290 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
18292 * support.cs (SeekableStreamReader): Keep track of stream byte
18293 positions and don't mix them with character offsets to the buffer.
18295 Patch from Gustavo Giráldez
18297 2004-03-15 Marek Safar <marek.safar@seznam.cz>
18299 * interface.cs (InterfaceSetGetBase): Removed double member
18300 initialization, base class does it as well.
18302 2004-03-13 Martin Baulig <martin@ximian.com>
18304 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18305 when compiling corlib.
18307 2004-03-13 Miguel de Icaza <miguel@ximian.com>
18309 * convert.cs (ExplicitConversion): We were reporting an error on
18310 certain conversions (object_type source to a value type, when the
18311 expression was `null') before we had a chance to pass it through
18312 the user defined conversions.
18314 * driver.cs: Replace / and \ in resource specifications to dots.
18317 * class.cs: Add check for duplicate operators. Fixes 52477
18319 2004-03-11 Miguel de Icaza <miguel@ximian.com>
18321 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18322 that are in the middle of the statements, not only at the end.
18325 * class.cs (TypeContainer.AddField): No longer set the
18326 `HaveStaticConstructor' flag, now we call it
18327 `UserDefineStaticConstructor' to diferentiate the slightly
18328 semantic difference.
18330 The situation is that we were not adding BeforeFieldInit (from
18331 Modifiers.TypeAttr) to classes that could have it.
18332 BeforeFieldInit should be set to classes that have no static
18337 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18339 And most importantly Zoltan's comment:
18341 http://bugzilla.ximian.com/show_bug.cgi?id=44229
18343 "I think beforefieldinit means 'it's ok to initialize the type sometime
18344 before its static fields are used', i.e. initialization does not need
18345 to be triggered by the first access to the type. Setting this flag
18346 helps the JIT to compile better code, since it can run the static
18347 constructor at JIT time, and does not need to generate code to call it
18348 (possibly lots of times) at runtime. Unfortunately, mcs does not set
18349 this flag for lots of classes like String.
18351 csc sets this flag if the type does not have an explicit static
18352 constructor. The reasoning seems to be that if there are only static
18353 initalizers for a type, and no static constructor, then the programmer
18354 does not care when this initialization happens, so beforefieldinit
18357 This bug prevents the AOT compiler from being usable, since it
18358 generates so many calls to mono_runtime_class_init that the AOT code
18359 is much slower than the JITted code. The JITted code is faster,
18360 because it does not generate these calls if the vtable is type is
18361 already initialized, which is true in the majority of cases. But the
18362 AOT compiler can't do this."
18364 2004-03-10 Miguel de Icaza <miguel@ximian.com>
18366 * class.cs (MethodData.Emit): Refactor the code so symbolic
18367 information is generated for destructors; For some reasons we
18368 were taking a code path that did not generate symbolic information
18371 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
18373 * class.cs: Create a Constructor.CheckBase method that
18374 takes care of all validation type code. The method
18375 contains some code that was moved from Define.
18377 It also includes new code that checks for duplicate ctors.
18378 This fixes bug #55148.
18380 2004-03-09 Joshua Tauberer <tauberer@for.net>
18382 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18383 a { ... }-style array creation invokes EmitStaticInitializers
18384 which is not good for reference-type arrays. String, decimal
18385 and now null constants (NullCast) are not counted toward
18386 static initializers.
18388 2004-03-05 Martin Baulig <martin@ximian.com>
18390 * location.cs (SourceFile.HasLineDirective): New public field;
18391 specifies whether the file contains or is referenced by a "#line"
18393 (Location.DefineSymbolDocuments): Ignore source files which
18394 either contain or are referenced by a "#line" directive.
18396 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
18398 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18399 direct access to our parent, so check the method inline there.
18401 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
18403 * expression.cs (Invocation.EmitCall): Miguel's last commit
18404 caused a regression. If you had:
18409 In Foo the implict this would be null.
18411 2004-02-27 Miguel de Icaza <miguel@ximian.com>
18413 * expression.cs (Invocation.EmitCall): If the method is not
18414 virtual, do not emit a CallVirt to it, use Call.
18416 * typemanager.cs (GetFullNameSignature): Improve the method to
18417 cope with ".ctor" and replace it with the type name.
18419 * class.cs (ConstructorInitializer.Resolve): Now the method takes
18420 as an argument the ConstructorBuilder where it is being defined,
18421 to catch the recursive constructor invocations.
18423 2004-02-26 Miguel de Icaza <miguel@ximian.com>
18425 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18426 routines to check if a type is an enumerable/enumerator allow
18427 classes that implement the IEnumerable or IEnumerator interfaces.
18429 * class.cs (Property, Operator): Implement IIteratorContainer, and
18430 implement SetYields.
18432 (Property.Define): Do the block swapping for get_methods in the
18433 context of iterators. We need to check if Properties also
18434 include indexers or not.
18436 (Operator): Assign the Block before invoking the
18437 OperatorMethod.Define, so we can trigger the Iterator code
18440 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
18441 Property and Operator classes are not created when we parse the
18442 declarator but until we have the block completed, so we use a
18443 singleton SimpleIteratorContainer.Simple to flag whether the
18444 SetYields has been invoked.
18446 We propagate this setting then to the Property or the Operator to
18447 allow the `yield' to function.
18449 2004-02-25 Marek Safar <marek.safar@seznam.cz>
18451 * codegen.cs: Implemented attribute support for modules.
18452 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18453 Assembly/Module functionality.
18455 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18456 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18457 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18459 2004-02-16 Marek Safar <marek.safar@seznam.cz>
18461 * interface.cs (FindMembers): The operation is performed on all base
18462 interfaces and not only on the first. It is required for future CLS Compliance patch.
18464 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
18466 * statement.cs, codegen.cs:
18467 This patch deals with patterns such as:
18469 public class List : IEnumerable {
18471 public MyEnumerator GetEnumerator () {
18472 return new MyEnumerator(this);
18475 IEnumerator IEnumerable.GetEnumerator () {
18479 public struct MyEnumerator : IEnumerator {
18484 Before, there were a few things we did wrong:
18485 1) we would emit callvirt on a struct, which is illegal
18486 2) we emited ldarg when we needed to emit ldarga
18487 3) we would mistakenly call the interface methods on an enumerator
18488 type that derived from IEnumerator and was in another assembly. For example:
18490 public class MyEnumerator : IEnumerator
18492 Would have the interface methods called, even if there were public impls of the
18493 method. In a struct, this lead to invalid IL code.
18495 2004-02-11 Marek Safar <marek.safar@seznam.cz>
18497 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18500 * delegate.cs (Define): Fixed crash when delegate type is undefined.
18502 2004-02-11 Miguel de Icaza <miguel@ximian.com>
18504 * cs-parser.jay: Fix small regression: we were not testing V2
18505 compiler features correctly.
18507 * interface.cs: If the emit context is null, then create one
18509 2004-02-09 Marek Safar <marek.safar@seznam.cz>
18511 * decl.cs (GetSignatureForError): New virtual method to get full name
18512 for error messages.
18514 * attribute.cs (IAttributeSupport): New interface for attribute setting.
18515 Now it is possible to rewrite ApplyAttributes method to be less if/else.
18517 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18518 Duplicated members and code in these classes has been removed.
18519 Better encapsulation in these classes.
18521 2004-02-07 Miguel de Icaza <miguel@ximian.com>
18523 * assign.cs (Assign.DoResolve): When dealing with compound
18524 assignments, there is a new rule in ECMA C# 2.4 (might have been
18525 there before, but it is documented here) that states that in:
18529 If b is of type int, and the `op' is a shift-operator, then the
18530 above is evaluated as:
18534 * expression.cs (Binary.ResolveOperator): Instead of testing for
18535 int/uint/long/ulong, try to implicitly convert to any of those
18536 types and use that in pointer arithmetic.
18538 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18539 method to print information for from the type, not from the
18540 null-method we were given.
18542 2004-02-01 Duncan Mak <duncan@ximian.com>
18544 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18545 parsing for cmd, fixes bug #53694.
18547 2004-02-04 Marek Safar <marek.safar@seznam.cz>
18549 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18550 in the member name duplication tests. Property and operator name duplication
18551 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18553 2004-02-03 Marek Safar <marek.safar@seznam.cz>
18555 * interface.cs (PopulateMethod): Fixed crash when interface method
18556 returns not existing type (error test cs0246-3.cs).
18558 2004-02-02 Ravi Pratap M <ravi@ximian.com>
18560 * cs-parser.jay (interface_accessors): Re-write actions to also
18561 store attributes attached to get and set methods. Fix spelling
18564 (inteface_property_declaration): Modify accordingly.
18566 (InterfaceAccessorInfo): New helper class to store information to pass
18567 around between rules that use interface_accessors.
18569 * interface.cs (Emit): Apply attributes on the get and set
18570 accessors of properties and indexers too.
18572 * attribute.cs (ApplyAttributes): Modify accordingly to use the
18573 right MethodBuilder when applying attributes to the get and set accessors.
18575 2004-01-31 Miguel de Icaza <miguel@ximian.com>
18577 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18579 2004-01-26 Miguel de Icaza <miguel@ximian.com>
18581 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18583 2004-01-25 Miguel de Icaza <miguel@ximian.com>
18585 * cs-parser.jay: Remove YIELD token, instead use the new grammar
18586 changes that treat `yield' specially when present before `break'
18587 or `return' tokens.
18589 * cs-tokenizer.cs: yield is no longer a keyword.
18591 2004-01-23 Marek Safar <marek.safar@seznam.cz>
18593 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18594 setting for default constructors.
18595 For default constructors are almost every time set wrong Modifier. The
18596 generated IL code has been alright. But inside mcs this values was
18597 wrong and this was reason why several of my CLS Compliance tests
18600 2004-01-22 Martin Baulig <martin@ximian.com>
18602 * cs-parser.jay (namespace_or_type_name): Return an Expression,
18603 not a QualifiedIdentifier. This is what `type_name_expression'
18604 was previously doing.
18605 (type_name_expression): Removed; the code is now in
18606 `namespace_or_type_name'.
18607 (qualified_identifier): Removed, use `namespace_or_type_name'
18609 (QualifiedIdentifier): Removed this class.
18611 2004-01-22 Martin Baulig <martin@ximian.com>
18613 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18614 not a string as alias name.
18616 2004-01-21 Miguel de Icaza <miguel@ximian.com>
18618 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18619 #52730 bug, and instead compute correctly the need to use a
18620 temporary variable when requesting an address based on the
18621 static/instace modified of the field and the constructor.
18623 2004-01-21 Martin Baulig <martin@ximian.com>
18625 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18626 class and namespace before looking up aliases. Fixes #52517.
18628 2004-01-21 Martin Baulig <martin@ximian.com>
18630 * flowanalysis.cs (UsageVector.Merge): Allow variables being
18631 assinged in a 'try'; fixes exception4.cs.
18633 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18634 * class.cs : Implemented parameter-less constructor for TypeContainer
18636 * decl.cs: Attributes are now stored here. New property OptAttributes
18638 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18640 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18642 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18644 * typemanager.cs (CSharpSignature): Now reports also inner class name.
18645 (CSharpSignature): New method for indexer and property signature.
18647 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18649 * pending.cs (IsVirtualFilter): Faster implementation.
18651 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18653 * typemanager.cs: Avoid inclusion of same assembly more than once.
18655 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18657 * cs-parser.jay: Fixed problem where the last assembly attribute
18658 has been applied also to following declaration (class, struct, etc.)
18660 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18662 * class.cs: Added error CS0538, CS0539 reporting.
18663 Fixed crash on Microsoft runtime when field type is void.
18665 * cs-parser.jay: Added error CS0537 reporting.
18667 * pending.cs: Added error CS0535 reporting.
18668 Improved error report for errors CS0536, CS0534.
18670 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18672 Merge a few bits from the Anonymous Method MCS tree.
18674 * statement.cs (ToplevelBlock): New class for toplevel methods,
18675 will hold anonymous methods, lifted variables.
18677 * cs-parser.jay: Create toplevel blocks for delegates and for
18678 regular blocks of code.
18680 2004-01-20 Martin Baulig <martin@ximian.com>
18682 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18683 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18684 and `NeedExplicitReturn'; added `IsLastStatement'.
18685 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18686 have a `ReturnLabel' or we're not unreachable.
18688 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18689 child's reachability; don't just override ours with it. Fixes
18690 #58058 (lluis's example).
18691 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18692 InFinally(), InLoop(), InSwitch() and
18693 BreakCrossesTryCatchBoundary() methods.
18695 * statement.cs (Return): Do all error checking in Resolve().
18696 Unless we are the last statement in a top-level block, always
18697 create a return label and jump to it.
18698 (Break, Continue): Do all error checking in Resolve(); also make
18699 sure we aren't leaving a `finally'.
18700 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18701 statement in a top-level block.
18702 (Block.Flags): Added `IsDestructor'.
18703 (Block.IsDestructor): New public property.
18705 2004-01-20 Martin Baulig <martin@ximian.com>
18707 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18709 2004-01-20 Martin Baulig <martin@ximian.com>
18711 * statement.cs (Statement.ResolveUnreachable): New public method.
18712 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18713 (Block.Resolve): Resolve unreachable statements.
18715 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18717 * expression.cs: We need to fix the case where we do
18718 not have a temp variable here.
18720 * assign.cs: Only expression compound assignments need
18721 temporary variables.
18723 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18725 * flowanalysis.cs: Reduce memory allocation in a few ways:
18726 - A block with no variables should not allocate a bit
18728 - A method with no out parameters does not need any tracking
18729 for assignment of the parameters, so we need not allocate
18732 public readonly Type[] VariableTypes;
18733 public readonly string[] VariableNames;
18734 Are redundant. The data is already stored in the variable
18735 map, so we need not allocate another array for it.
18736 - We need to add alot of checks for if (params | locals) == null
18737 due to the first two changes.
18739 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18741 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18742 implement IMemoryLocation, we store a copy on a local variable and
18743 take the address of it. Patch from Benjamin Jemlich
18745 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18746 to use a special "type_name_expression" rule which reduces the
18747 number of "QualifiedIdentifier" classes created, and instead
18748 directly creates MemberAccess expressions.
18750 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18752 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18753 that fixes #52853. Null literal assignment to ValueType
18755 * class.cs (MethodData.Emit): Instead of checking the name of the
18756 method to determine if its a destructor, create a new derived
18757 class from Method called Destructor, and test for that.
18759 * cs-parser.jay: Create a Destructor object instead of a Method.
18761 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18765 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18767 * expression.cs (Binary.ResolveOperator): Perform an implicit
18768 conversion from MethodGroups to their delegate types on the
18769 Addition operation.
18771 * delegate.cs: Introduce a new class DelegateCreation that is the
18772 base class for `NewDelegate' and `ImplicitDelegateCreation',
18773 factor some code in here.
18775 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18776 conversion from MethodGroups to compatible delegate types.
18778 * ecore.cs (Expression.Resolve): Do not flag error 654
18779 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18780 we allow conversions from MethodGroups to delegate types now.
18782 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18783 assignments in v2 either.
18785 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18787 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18788 static read-only fields in ctors.
18790 Applied patch from Benjamin Jemlich
18792 * expression.cs (UnaryMutator): Avoid leaking local variables.
18794 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18796 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18797 here to return true, as they can be used like this:
18799 (XXX) int.MEMBER ()
18801 Fixed 49836 and all the other dups
18803 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18805 * driver.cs: Implement /win32res and /win32icon.
18807 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18809 * cs-parser.jay: Add a rule to improve error handling for the
18810 common mistake of placing modifiers after the type.
18812 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18814 * cs-parser.jay (interface_event_declaration): Catch
18815 initialization of events on interfaces, and report cs0068
18817 * cs-parser.jay (interface_event_declaration): Catch
18818 initialization of events.
18820 * ecore.cs: Better report missing constructors.
18822 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18823 the error reporting done in the wrong place. Fix.
18825 * expression.cs (Binary.ResolveOperator): Catch the
18826 operator + (E x, E y) error earlier, and later allow for implicit
18827 conversions in operator +/- (E e, U x) from U to the underlying
18830 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18831 52596, if the container class is abstract, the default constructor
18832 is protected otherwise its public (before, we were always public).
18834 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18837 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18838 Jemlich that fixes bug #52597, MCS was generating invalid code for
18839 idisposable structs. Thanks to Ben for following up with this
18842 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18844 * driver.cs: Allow assemblies without code to be generated, fixes
18847 2004-01-07 Nick Drochak <ndrochak@gol.com>
18849 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18851 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18853 * cs-parser.jay: Add rules to improve error reporting if fields or
18854 methods are declared at the namespace level (error 116)
18856 * Add rules to catch event add/remove
18858 2004-01-04 David Sheldon <dave-mono@earth.li>
18860 * expression.cs: Added matching ")" to error message for
18863 2004-01-03 Todd Berman <tberman@gentoo.org>
18865 * ecore.cs, attribute.cs:
18866 Applying fix from #52429.
18868 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18870 * ecore.cs, expression.cs, statement.cs:
18871 Total rewrite of how we handle branching. We
18872 now handle complex boolean expressions with fewer
18873 jumps. As well if (x == 0) no longer emits a ceq.
18875 if (x is Foo) is much faster now, because we generate
18878 Overall, we get a pretty big improvement on our benchmark
18879 tests. The code we generate is smaller and more readable.
18881 I did a full two-stage bootstrap. The patch was reviewed
18882 by Martin and Miguel.
18884 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18886 * cs-parser.jay: Make primary_expression not take a QI.
18887 we dont need this because the member_access rule covers
18888 us here. So we replace the rule with just IDENTIFIER.
18890 This has two good effects. First, we remove a s/r conflict.
18891 Second, we allocate many fewer QualifiedIdentifier objects.
18893 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18895 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18896 set the correct information via SRE. This prevents
18897 hanging on the MS runtime. Fixes #29374.
18899 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18901 * convert.cs: correctly handle conversions to value types
18902 from Enum and ValueType as unboxing conversions.
18904 Fixes bug #52569. Patch by Benjamin Jemlich.
18906 2004-01-02 Ravi Pratap <ravi@ximian.com>
18908 * expression.cs (BetterConversion): Prefer int -> uint
18909 over int -> ulong (csc's behaviour). This fixed bug #52046.
18911 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18913 * decl.cs (MemberCache.FindMembers): now returns a
18916 * typemanager.cs: In general, go with with ^^.
18917 (CopyNewMethods): take an IList.
18918 (RealMemberLookup): Only allocate an arraylist
18919 if we copy from two sets of methods.
18921 This change basically does two things:
18922 1) Fewer array lists allocated due to CopyNewMethods.
18923 2) the explicit cast in MemberList costed ALOT.
18925 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18927 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18928 a hashtable to avoid needless string allocations when an identifier is
18929 used more than once (the common case).
18931 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18933 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18934 is broken, it will not return anything. So, we
18935 have to use the information we have in mcs to
18938 * typemanager.cs: Add a cache for GetInterfaces,
18939 since this will now be used more often (due to ^^)
18941 (GetExplicitInterfaces) New method that gets the
18942 declared, not effective, interfaces on a type
18943 builder (eg, if you have interface IFoo, interface
18944 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18947 This patch makes MCS able to bootstrap itself on
18950 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18952 * expression.cs: Remove the Nop's that Miguel put
18955 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18957 * report.cs, codegen.cs: Give the real stack trace to
18958 the error when an exception is thrown.
18960 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18962 * decl.cs: only allocate hashtables for ifaces if
18965 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18967 * expression.cs: fix the error from cs0121-2.cs
18968 (a parent interface has two child interfaces that
18969 have a function with the same name and 0 params
18970 and the function is called through the parent).
18972 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18974 * class.cs, rootcontext.cs, typmanager.cs: do not
18977 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18979 * codegen.cs: remove stack for the ec flow branching.
18980 It is already a linked list, so no need.
18982 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18984 * Makefile: Allow custom profiler here.
18986 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18988 * typemanager.cs (LookupType):
18989 - Use a static char [], because split takes
18990 a param array for args, so it was allocating
18992 - Do not store true in a hashtable, it boxes.
18994 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18996 * flowanalysis.cs: bytify common enums.
18998 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19000 * modifiers.cs: Add a new set of flags for the
19001 flags allowed on explicit interface impls.
19002 * cs-parser.jay: catch the use of modifiers in
19003 interfaces correctly.
19004 * class.cs: catch private void IFoo.Blah ().
19006 All related to bug #50572.
19008 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19010 * decl.cs: Rewrite the consistant accessability checking.
19011 Accessability is not linear, it must be implemented in
19012 a tableish way. Fixes #49704.
19014 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19016 * expression.cs: Handle negation in a checked context.
19017 We must use subtraction from zero. Fixes #38674.
19019 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
19021 * class.cs: Ignore static void main in DLLs.
19022 * rootcontext.cs: Handle the target type here,
19023 since we are have to access it from class.cs
19024 * driver.cs: account for the above.
19026 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
19028 * report.cs: Give line numbers and files if available.
19030 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
19032 * driver.cs: Implement /addmodule.
19034 * typemanager.cs: Change 'modules' field so it now contains Modules not
19037 2003-12-20 Martin Baulig <martin@ximian.com>
19039 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
19040 (FieldBase.IsAssigned): Removed this field.
19041 (FieldBase.SetAssigned): New public method.
19042 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
19044 2003-12-20 Martin Baulig <martin@ximian.com>
19046 * expression.cs (LocalVariableReference.DoResolve): Don't set
19047 `vi.Used' if we're called from DoResolveLValue().
19049 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
19050 returns the usage vector it just merged into the current one -
19051 pass this one to UsageWarning().
19052 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
19053 of the `EmitContext', don't call this recursively on our children.
19055 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
19057 * driver.cs: Implement /target:module.
19059 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
19061 * support.cs (CharArrayHashtable): New helper class.
19063 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
19064 char arrays, not strings, so we can avoid creating a string in
19065 consume_identifier if the identifier is a keyword.
19067 2003-12-16 Martin Baulig <martin@ximian.com>
19069 * statement.cs (LocalInfo.Assigned): Removed this property.
19070 (LocalInfo.Flags): Removed `Assigned'.
19071 (LocalInfo.IsAssigned): New public method; takes the EmitContext
19072 and uses flow analysis.
19073 (Block.UsageWarning): Made this method private.
19074 (Block.Resolve): Call UsageWarning() if appropriate.
19076 * expression.cs (LocalVariableReference.DoResolve): Always set
19077 LocalInfo.Used here.
19079 2003-12-13 Martin Baulig <martin@ximian.com>
19081 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
19082 any value here; we're now using flow analysis to figure out
19083 whether a statement/block returns a value.
19085 2003-12-13 Martin Baulig <martin@ximian.com>
19087 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
19089 (FlowBranching.MergeFinally): Don't call
19090 `branching.CheckOutParameters()' here, this is called in
19092 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19093 when adding the `finally' vector.
19095 2003-12-13 Martin Baulig <martin@ximian.com>
19098 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19099 actually work and also fix #48962.
19101 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
19103 * decl.cs: Do not check System.Object for nested types,
19104 since we know it does not have any. Big bang for buck:
19107 Run 1: 8.35 seconds
19108 Run 2: 8.32 seconds
19109 corlib: 17.99 seconds
19111 Run 1: 8.17 seconds
19112 Run 2: 8.17 seconds
19113 corlib: 17.39 seconds
19115 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
19117 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19118 time we are returning 0 members, so we save alot here.
19120 2003-12-11 Martin Baulig <martin@ximian.com>
19122 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19123 `MergeChild()', also just take the `FlowBranching' as argument;
19124 call Merge() on it and return the result.
19125 (FlowBranching.Merge): We don't need to do anything if we just
19128 2003-12-11 Martin Baulig <martin@ximian.com>
19130 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19131 them in an `ArrayList' to reduce memory usage. Thanks to Ben
19132 Maurer for this idea.
19134 2003-12-11 Martin Baulig <martin@ximian.com>
19136 * flowanalysis.cs (MergeResult): This class is now gone; we now
19137 use the `UsageVector' for this. The reason for this is that if a
19138 branching just has one sibling, we don't need to "merge" them at
19139 all - that's the next step to do.
19140 (FlowBranching.Merge): We now return a `UsageVector' instead of a
19143 2003-12-11 Martin Baulig <martin@ximian.com>
19145 Reworked flow analyis and made it more precise and bug-free. The
19146 most important change is that we're now using a special `Reachability'
19147 class instead of having "magic" meanings of `FlowReturns'. I'll
19148 do some more cleanups and optimizations and also add some more
19149 documentation this week.
19151 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19152 largely reworked this class.
19153 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19154 the new `Reachability' class instead of having "magic" values here.
19155 (FlowBranching): We're now using an instance of `Reachability'
19156 instead of having separate `Returns', `Breaks' etc. fields.
19158 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19159 based on flow analysis; ignore the return value of block.Emit ().
19161 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
19163 * driver.cs typemanager.cs: Find the mono extensions to corlib even
19164 if they are private.
19166 2003-12-09 Martin Baulig <martin@ximian.com>
19168 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19169 call them directly on the UsageVector.
19171 2003-12-09 Martin Baulig <martin@ximian.com>
19173 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19174 Changed return type from `FlowReturns' to `Reachability'.
19176 2003-12-09 Martin Baulig <martin@ximian.com>
19178 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19179 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19180 `Reachable' fields with a single `Reachability' one.
19182 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19184 * class.cs (FindMembers): Remove foreach's.
19189 Run 1: 8.74 seconds
19190 Run 2: 8.71 seconds
19193 Run 1: 8.64 seconds
19194 Run 2: 8.58 seconds
19197 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19202 This patch does a few things:
19203 1. EmptyStatement is now a singleton, so it is never reallocated.
19204 2. All blah is EmptyStatement constructs have been changed to
19205 blah == EmptyStatement.Value, which is much faster and valid
19206 now that EmptyStatement is a singleton.
19207 3. When resolving a block, rather than allocating a new array for
19208 the non-empty statements, empty statements are replaced with
19209 EmptyStatement.Value
19210 4. Some recursive functions have been made non-recursive.
19211 Mainly the performance impact is from (3), however (1) and (2) are needed for
19212 this to work. (4) does not make a big difference in normal situations, however
19213 it makes the profile look saner.
19218 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19219 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19220 Total memory allocated: 56397 KB
19223 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19224 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19225 Total memory allocated: 55666 KB
19227 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19229 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19230 than the hashtable in a hashtable version
19232 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19233 we always end up concating a string. This results in a huge perf
19234 loss, because many strings have to be tracked by the GC. In this
19235 patch, we first use a hashtable that works with two keys, so that
19236 the strings do not need to be concat'ed.
19240 Run 1: 8.74 seconds
19241 Run 2: 8.71 seconds
19244 Run 1: 8.65 seconds
19245 Run 2: 8.56 seconds
19247 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19249 * Makefile: Add a new target `do-time' that does a quick and simple
19250 profile, leaving easy to parse output.
19252 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
19254 * codegen.cs (Init): Create the dynamic assembly with
19255 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19257 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
19259 * support.cs: Make the PtrHashtable use only one
19260 instance of its comparer.
19262 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
19264 * typemanager.cs: Fix lookup of GetNamespaces.
19266 2003-11-29 Miguel de Icaza <miguel@ximian.com>
19268 * expression.cs: Removed redundant line.
19270 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19271 ArrayLists, use for loops with bounds.
19273 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19276 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19277 arraylists, use for loop with bounds.
19279 The above three changes give us a 0.071 second performance
19280 improvement out of 3.294 seconds down to 3.223. On my machine
19281 the above changes reduced the memory usage by 1,387 KB during
19282 compiler bootstrap.
19284 * cs-parser.jay (QualifiedIdentifier): New class used to represent
19285 QualifiedIdentifiers. Before we created a new string through
19286 concatenation, and mostly later on, the result would be
19287 manipulated by DecomposeQI through string manipulation.
19289 This reduced the compiler memory usage for bootstrapping from
19290 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19291 compile times in 0.05 seconds.
19293 2003-11-28 Dick Porter <dick@ximian.com>
19295 * support.cs: Do string compares with the Invariant culture.
19303 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19304 the comparison is done with the Invariant culture.
19306 2003-11-27 Miguel de Icaza <miguel@ximian.com>
19308 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19309 GetEnumerator method.
19311 (ProbeCollectionType): Iterate starting at the most specific type
19312 upwards looking for a GetEnumerator
19314 * expression.cs: Shift count can be up to 31 for int/uint and 63
19317 2003-11-26 Miguel de Icaza <miguel@ximian.com>
19319 * statement.cs (Block.LookupLabel): Also look for the label on the
19320 children blocks. Use a hash table to keep track of visited
19323 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19324 we actually did transform the other operand, otherwise fall back
19325 to the common codepath that casts to long.
19327 * cs-tokenizer.cs: Use the same code pattern as the int case.
19328 Maybe I should do the parsing myself, and avoid depending on the
19329 Parse routines to get this done.
19331 2003-11-25 Miguel de Icaza <miguel@ximian.com>
19333 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19334 which fixes bug 51347. This time test it.
19336 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19337 attributes for example can not tell the difference between these.
19338 The difference was only a syntax feature of the language.
19340 * attribute.cs: Apply attributes to delegates.
19342 * delegate.cs: Call the apply attributes method.
19344 2003-11-24 Miguel de Icaza <miguel@ximian.com>
19346 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19347 comparing 0 vs Byte.MinValue, not the value
19349 (ImplicitConversionRequired): When reporting a conversion error,
19350 use error 31 to print out the constant error instead of the
19353 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19354 which fixes bug 51347.
19356 2003-11-22 Miguel de Icaza <miguel@ximian.com>
19358 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
19359 which fixes the -warnaserror command line option.
19361 2003-11-21 Miguel de Icaza <miguel@ximian.com>
19363 * cfold.cs (DoNumericPromotions): During constant folding of
19364 additions on UIntConstant, special case intconstants with
19365 IntConstants like we do on the expression binary operator.
19367 2003-11-12 Miguel de Icaza <miguel@ximian.com>
19369 * convert.cs (ImplicitReferenceConversion): We were missing a case
19370 (System.Enum are not value types or class types, so we need to
19371 classify them separatedly).
19373 * driver.cs: We do not support error 2007.
19375 2003-11-12 Jackson Harper <jackson@ximian.com>
19377 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19378 system directory. Also use the full file name so users can
19379 libraries names mscorlib-o-tron.dll in a non system dir.
19381 2003-11-10 Martin Baulig <martin@ximian.com>
19383 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19384 (TypeManager.InitCoreTypes): Initialize them here, but instead of
19385 calling `ResolveType()' on them, directly assign their `Type'.
19387 2003-11-08 Martin Baulig <martin@ximian.com>
19389 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19390 return value and the `out parent' parameter.
19391 (TypeContainer.DefineType): Moved the CS0644 check into
19392 GetClassBases(). Don't pass the interface types to the
19393 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19394 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19396 * ecore.cs (TypeExpr.IsAttribute): New property.
19397 (TypeExpr.GetInterfaces): New method.
19399 * interface.cs (Interface.GetInterfaceTypeByName): Return a
19400 TypeExpr instead of a Type.
19401 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19402 (Interface.DefineType): Don't pass the interface types to the
19403 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19404 them later and then call `TypeBulider.AddInterfaceImplementation()'.
19406 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19407 instead of a `Type[]'.
19408 (TypeManager.RegisterBuilder): Likewise.
19409 (TypeManager.AddUserInterface): Likewise.
19410 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19411 `Type[]' and also return a `TypeExpr[]'.
19412 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19414 2003-11-08 Martin Baulig <martin@ximian.com>
19416 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19419 2003-11-08 Martin Baulig <martin@ximian.com>
19421 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19422 TypeManager.ResolveExpressionTypes().
19424 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19425 instead of an Expression.
19426 (TypeExpr): This is now an abstract base class for `TypeExpression'.
19427 (TypeExpression): New public class; formerly known as `TypeExpr'.
19429 * expression.cs (ComposedCast): Derive from TypeExpr.
19431 * typemanager.cs (TypeManager.system_*_expr): These are now
19432 TypExpr's instead of Expression's.
19433 (TypeManager.ResolveExpressionTypes): New public static function;
19434 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19437 2003-11-06 Miguel de Icaza <miguel@ximian.com>
19439 * expression.cs (New.DoResolve): Do not dereference value that
19440 might be a null return.
19442 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19443 sure that the constant value has the right type. Fixes an
19444 unreported bug, similar to 50425.
19446 * const.cs (Const.LookupConstantValue): Call
19447 ImplicitStandardConversionExists before doing a conversion to
19448 avoid havng the TypeManager.ChangeType do conversions.
19450 Reduced the number of casts used
19452 (Const.ChangeType): New routine to enable reuse of the constant
19453 type changing code from statement.
19455 * typemanager.cs (ChangeType): Move common initialization to
19456 static global variables.
19460 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19461 every value type to go through, even if it was void. Fix that.
19463 * cs-tokenizer.cs: Use is_identifier_start_character on the start
19464 character of the define, and the is_identifier_part_character for
19465 the rest of the string.
19467 2003-11-05 Miguel de Icaza <miguel@ximian.com>
19469 * expression.cs (UnaryMutator.EmitCode): When I updated
19470 LocalVariableReference.DoResolve, I overdid it, and dropped an
19471 optimization done on local variable references.
19473 2003-11-04 Miguel de Icaza <miguel@ximian.com>
19475 * ecore.cs: Convert the return from Ldlen into an int.
19477 2003-10-20 Miguel de Icaza <miguel@ximian.com>
19479 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19480 the accessibility, this is a special case for toplevel non-public
19481 classes (internal for instance).
19483 2003-10-20 Nick Drochak <ndrochak@gol.com>
19485 * ecore.cs: Fix typo and build. Needed another right paren.
19487 2003-10-19 Miguel de Icaza <miguel@ximian.com>
19489 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
19490 `internal' case regular and protected, but not allowing protected
19491 to be evaluated later. Bug 49840
19493 2003-10-15 Miguel de Icaza <miguel@ximian.com>
19495 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19496 to kb.Nlast, and not the kb.nFirst to isolate the switch
19499 Extract the underlying type, so enumerations of long/ulong are
19500 treated like long/ulong.
19502 2003-10-14 Miguel de Icaza <miguel@ximian.com>
19504 * expression.cs (New): Overload the meaning of RequestedType to
19505 track the possible creation of the NewDelegate type, since
19506 DoResolve is invoked more than once for new constructors on field
19509 See bugs: #48800 and #37014
19511 * cs-parser.jay (declare_local_constants): Take an arraylist
19512 instead of a single constant.
19514 (local_constant_declaration): It should take a
19515 constant_declarators, not a constant_declarator. Fixes 49487
19517 * convert.cs: Fix error report.
19519 2003-10-13 Jackson Harper <jackson@ximian.com>
19521 * typemanager.cs (TypeToCoreType): Add float and double this fixes
19524 2003-10-09 Martin Baulig <martin@ximian.com>
19526 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19528 (MethodCore.DoDefineParameters): Removed the TypeContainer
19529 argument; use the DeclSpace which was passed to the .ctor instead.
19530 (MethodCore.CheckParameter): Take a DeclSpace instead of a
19531 TypeContainer; we only need a DeclSpace here.
19533 2003-10-09 Martin Baulig <martin@ximian.com>
19535 * class.cs (MethodData): Added additional `DeclSpace ds' argument
19537 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19538 EmitContext's .ctor.
19540 2003-10-09 Martin Baulig <martin@ximian.com>
19542 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19543 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19544 AsAccessible(), moved them as well.
19546 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19548 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19550 * cs-parser.jay : Renamed yyName to yyNames related to jay.
19552 2003-10-07 Miguel de Icaza <miguel@ximian.com>
19554 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19555 generation for >=, as spotted by Paolo, bug 48679.
19556 Patch from David Waite.
19558 * cs-tokenizer.cs: Add handling for #pragma.
19560 * cs-parser.jay: Allow for both yield and yield return in the
19561 syntax. The anti-cobolization of C# fight will go on!
19563 * class.cs (TypeBuilder.DefineType): Catch error condition here
19564 (Parent.DefineType erroring out and returning null).
19566 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19567 coping with enumerations variables, we were mistakenly processing
19568 them as a regular value type instead of built-in types. Fixes the
19571 * typemanager.cs (IsBuiltinOrEnum): New method.
19573 2003-09-30 Miguel de Icaza <miguel@ximian.com>
19575 * cs-parser.jay: Upgrade: yield now needs the return clause.
19577 2003-09-19 Martin Baulig <martin@ximian.com>
19579 * decl.cs (MemberCache.SetupCacheForInterface): Take a
19580 `MemberCache parent' argument. Normally, an interface doesn't
19581 have a parent type except System.Object, but we use this in gmcs
19582 for generic type parameters.
19584 2003-09-18 Martin Baulig <martin@ximian.com>
19586 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19587 on `type.IsInterface'; don't check whether the type has a parent
19588 to determine whether it's an interface.
19590 2003-09-15 Martin Baulig <martin@ximian.com>
19592 * class.cs (TypeContainer.DefineType): Added an error flag to
19593 avoid reporting duplicate CS0146's ("class definition is
19596 * driver.cs (Driver.MainDriver): Abort if
19597 RootContext.ResolveTree() reported any errors.
19599 2003-09-07 Martin Baulig <martin@ximian.com>
19601 * report.cs (Error, Warning): Added overloaded versions which take
19602 a `params object[] args' and call String.Format().
19604 2003-09-07 Martin Baulig <martin@ximian.com>
19606 * decl.cs (DeclSpace..ctor): Don't call
19607 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19608 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
19609 (DeclSpace.RecordDecl): New method.
19611 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19613 2003-09-02 Ravi Pratap <ravi@ximian.com>
19615 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19616 value attributes to be applied to ParameterBuilders.
19618 * class.cs (MethodCore.LabelParameters): Make static and more
19619 generic so that it can be used from other places - like interface
19620 methods, for instance.
19622 * interface.cs (Interface.Emit): Call LabelParameters before
19623 emitting attributes on the InterfaceMethod.
19625 2003-08-26 Martin Baulig <martin@ximian.com>
19627 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19628 resolving aliases; fixes #47927.
19630 2003-08-26 Martin Baulig <martin@ximian.com>
19632 * statement.cs (Using.DoResolve): This is internally emitting a
19633 try/finally clause, so we need to set ec.NeedExplicitReturn if we
19634 do not always return. Fixes #47681.
19636 2003-08-26 Martin Baulig <martin@ximian.com>
19638 * decl.cs (MemberCore): Moved WarningNotHiding(),
19639 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19641 (AdditionResult): Make this nested in DeclSpace.
19642 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19643 argument; call NamespaceEntry.Define() unless we're nested in a
19646 * namespace.cs (Namespace.DefineName): New public function. This
19647 is called from DeclSpace's .ctor to add
19648 (Namespace.Lookup): Include DeclSpaces in the lookup.
19650 * class.cs (Operator): Derive from MemberBase, not MemberCore.
19652 * const.cs (Const): Derive from MemberBase, not MemberCore.
19654 2003-08-25 Martin Baulig <martin@ximian.com>
19656 * convert.cs (Convert.ExplicitReferenceConversion): When
19657 converting from an interface type to a class, unbox if the target
19658 type is a struct type. Fixes #47822.
19660 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19662 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19665 2003-08-22 Martin Baulig <martin@ximian.com>
19667 * class.cs (TypeManager.DefineType): When defining a nested type,
19668 call DefineType() on our parent; fixes #47801.
19670 2003-08-22 Martin Baulig <martin@ximian.com>
19672 * class.cs (MethodData.Define): While checking if a method is an
19673 interface implementation, improve the test a bit more to fix #47654.
19675 2003-08-22 Martin Baulig <martin@ximian.com>
19677 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19678 correctly; fixes #47722.
19680 2003-08-22 Martin Baulig <martin@ximian.com>
19682 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19683 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19685 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19687 2003-08-22 Martin Baulig <martin@ximian.com>
19689 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19690 can only be assigned in static constructors. Fixes #47161.
19692 2003-08-22 Martin Baulig <martin@ximian.com>
19694 Rewrote and improved the flow analysis code.
19696 * flowbranching.cs (FlowBranching): Make this class abstract.
19697 (FlowBranching.CreateBranching): New static function to create a
19698 new flow branching.
19699 (FlowBranchingBlock, FlowBranchingException): New classes.
19700 (FlowBranching.UsageVector.Type): New public readonly field.
19701 (FlowBranching.UsageVector.Breaks): Removed the setter.
19702 (FlowBranching.UsageVector.Returns): Removed the setter.
19703 (FlowBranching.UsageVector): Added Break(), Return(),
19704 NeverReachable() and Throw() methods to modify the reachability.
19705 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19706 done by FlowBranching.Merge().
19707 (FlowBranching.UsageVector.MergeChild): New method; merges the
19708 merge result into the current vector.
19709 (FlowBranching.Merge): New abstract method to merge a branching.
19711 2003-08-12 Martin Baulig <martin@ximian.com>
19713 * expression.cs (Indirection.CacheTemporaries): Create the
19714 LocalTemporary with the pointer type, not its element type.
19716 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19718 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19719 token was a keyword or not.
19721 Add `error' options where an IDENTIFIER was expected; Provide
19722 CheckToken and CheckIdentifierToken convenience error reporting
19725 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19727 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19728 NameSpaceEntry NameSpaceEntry.
19730 (LookupInterfaceOrClass): Avoid creating a full qualified name
19731 from namespace and name: avoid doing lookups when we know the
19732 namespace is non-existant. Use new Tree.LookupByNamespace which
19733 looks up DeclSpaces based on their namespace, name pair.
19735 * driver.cs: Provide a new `parser verbose' to display the
19736 exception thrown during parsing. This is turned off by default
19737 now, so the output of a failure from mcs is more graceful.
19739 * namespace.cs: Track all the namespaces defined in a hashtable
19742 (IsNamespace): New method
19744 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19746 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19747 we know that we need to concatenate (full typename can never be
19752 * statement.cs: Use a bitfield; Do not initialize to null things
19753 which are done by the constructor by default.
19755 * cs-parser.jay: bug fix, parameter was 4, not 3.
19757 * expression.cs: Just use the property;
19759 * statement.cs: No need for GetVariableInfo method.
19761 2003-08-08 Martin Baulig <martin@ximian.com>
19763 * flowanalysis.cs (FlowReturns): This is now nested in the
19764 `FlowBranching' class.
19765 (MyBitVector): Moved this here from statement.cs.
19766 (FlowBranching.SiblingType): New enum type.
19767 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19769 2003-08-07 Martin Baulig <martin@ximian.com>
19771 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19772 `FlowBranching' class and called `BranchingType'.
19774 2003-08-07 Martin Baulig <martin@ximian.com>
19776 * flowanalysis.cs: Moved all the control flow analysis code into
19779 2003-08-07 Martin Baulig <martin@ximian.com>
19781 * assign.cs (Assign.DoResolve): `target' must either be an
19782 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19785 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19787 * expression.cs (BinaryMethod): This kind of expression is created by the
19788 Binary class if it determines that the operator has to be handled
19791 (BinaryDelegate): This kind of expression is created if we are
19792 dealing with a + or - operator on delegates.
19794 (Binary): remove method, argumetns, and DelegateOperator: when
19795 dealing with methods,
19797 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19799 * statement.cs (Block): use bitfields for the three extra booleans
19800 we had in use. Remove unused topblock parameter.
19802 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19804 * assign.cs: Drop extra unneeded tests.
19806 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19808 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19810 * statement.cs (Foreach): Use VariableStorage instead of
19813 * codegen.cs (VariableStorage): New class used by clients that
19814 require a variable stored: locals or fields for variables that
19815 need to live across yield.
19817 Maybe provide a convenience api for EmitThis+EmitLoad?
19819 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19822 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19824 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19825 RemapParameterLValue): New methods that are used to turn a
19826 precomputed FieldInfo into an expression like this:
19830 The idea is to use this instead of making LocalVariableReference
19831 have more than one meaning.
19833 * cs-parser.jay: Add error production to BASE.
19835 * ecore.cs: Deal with TypeManager.GetField returning null, which
19836 is now a valid return value.
19838 (FieldExprNoAddress): New expression for Fields whose address can
19841 * expression.cs (LocalVariableReference): During the resolve
19842 phases, create new expressions if we are in a remapping context.
19843 Remove code that dealt with remapping here.
19845 (ParameterReference): same.
19847 (ProxyInstance): New expression, like the `This' expression, but
19848 it is born fully resolved. We know what we are doing, so remove
19849 the errors that are targeted to user-provided uses of `this'.
19851 * statement.cs (Foreach): our variable is now stored as an
19852 Expression; During resolution, follow the protocol, dont just
19853 assume it will return this.
19855 2003-08-06 Martin Baulig <martin@ximian.com>
19857 * support.cs (SeekableStreamReader.cs): New public class.
19859 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19860 SeekableStreamReader instead of the normal StreamReader.
19862 2003-08-04 Martin Baulig <martin@ximian.com>
19864 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19865 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19866 deambiguate casts and delegate invocations.
19867 (parenthesized_expression): Use the new tokens to ensure this is
19868 not a cast of method invocation.
19870 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19871 when reading a `)' and Deambiguate_CloseParens () was previously
19874 * expression.cs (ParenthesizedExpression): New class. This is
19875 just used for the CS0075 test.
19876 (Binary.DoResolve): Check for CS0075.
19878 2003-07-29 Ravi Pratap <ravi@ximian.com>
19880 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19881 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19882 reference comparison.
19884 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19885 examine the ReturnType for equality - this is necessary in the
19886 cases of implicit and explicit operators whose signature also
19887 includes the return type.
19889 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19891 * namespace.cs: Cache the result of the namespace computation,
19892 instead of computing it every time.
19894 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19896 * decl.cs: Use a global arraylist that we reuse over invocations
19897 to avoid excesive memory consumption. Reduces memory usage on an
19898 mcs compile by one meg (45 average).
19900 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19901 private, work around that.
19903 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19905 * literal.cs (IntLiteral): Define Zero and One static literals.
19907 * cs-parser.jay (integer_literal): use static literals to reduce
19908 memory usage for the most used literals (0, 1 and -1). 211kb
19909 reduced in memory usage.
19911 Replace all calls to `new ArrayList' with `new
19912 ArrayList(4)' which is a good average number for most allocations,
19913 and also requires only 16 bytes of memory for its buffer by
19916 This reduced MCS memory usage in seven megabytes for the RSS after
19919 2003-07-28 Ravi Pratap <ravi@ximian.com>
19921 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19922 handle params methods the correct way by forming only one
19923 applicable set with params and normal methods in them. Earlier we
19924 were looking at params methods only if we found no normal methods
19925 which was not the correct thing to do.
19927 (Invocation.BetterFunction): Take separate arguments indicating
19928 when candidate and the best method are params methods in their
19931 This fixes bugs #43367 and #46199.
19933 * attribute.cs: Documentation updates.
19935 (CheckAttribute): Rename to CheckAttributeTarget.
19936 (GetValidPlaces): Rename to GetValidTargets.
19938 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19939 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19943 2003-07-28 Martin Baulig <martin@ximian.com>
19945 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19946 name when looking up the base class of a nested class. Fixes #46977.
19948 2003-07-26 Martin Baulig <martin@ximian.com>
19950 * expression.cs (Indexers.Indexer): New nested struct; contains
19951 getter, setter and the indexer's type.
19952 (Indexers.Properties): This is now an ArrayList of
19953 Indexers.Indexer's.
19954 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19955 indexer doesn't have any getters.
19957 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19958 for embedded property and indexer assignments.
19960 2003-07-26 Martin Baulig <martin@ximian.com>
19962 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19963 preprocessor directive is not the first non-whitespace character
19966 2003-07-26 Martin Baulig <martin@ximian.com>
19968 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19969 namespace parsing, follow the spec more closely.
19971 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19972 NamespaceEntry.Lookup().
19974 2003-07-25 Martin Baulig <martin@ximian.com>
19976 * MethodCore.cs (OverridesSomething): New public field; it's set
19977 from TypeContainer.DefineMembers if this method overrides
19978 something (which doesn't need to be a method). Fix #39462.
19980 2003-07-25 Ravi Pratap <ravi@ximian.com>
19982 * typemanager.cs (GetMembers): Ensure that the list of members is
19983 reversed. This keeps things in sync.
19985 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19986 find an AttributeUsage attribute.
19988 * expression.cs (Invocation.OverloadResolve): Perform the check
19989 which disallows Invoke to be directly called on a Delegate.
19991 (Error_InvokeOnDelegate): Report error cs1533.
19993 2003-07-25 Martin Baulig <martin@ximian.com>
19995 * expression.cs (Indexers.GetIndexersForType): Only look in the
19996 interface hierarchy if the requested type is already an
19997 interface. Fixes #46788 while keeping #46502 fixed.
19999 2003-07-25 Martin Baulig <martin@ximian.com>
20001 * class.cs (TypeContainer.DefineMembers): Check whether all
20002 readonly fields have been assigned and report warning CS0649 if
20005 * statement.cs (LocalInfo.IsFixed): Always return true if this is
20008 2003-07-24 Ravi Pratap <ravi@ximian.com>
20010 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
20011 returned from GetMethods to make things consistent with the
20012 assumptions MCS makes about ordering of methods.
20014 This should comprehensively fix bug #45127 and it does :-)
20016 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
20017 ordering is actually reverse.
20019 * Clean up some debug messages I left lying around.
20021 * interface.cs (Populate*): Get rid of code which emits attributes
20022 since the stage in which we emit attributes is the 'Emit' stage,
20023 not the define stage.
20025 (Emit): Move attribute emission for interface members here.
20027 2003-07-22 Ravi Pratap <ravi@ximian.com>
20029 * expression.cs (Invocation.OverloadResolve): Follow the spec more
20030 closely: we eliminate methods in base types when we have an
20031 applicable method in a top-level type.
20033 Please see section 14.5.5.1 for an exact description of what goes
20036 This fixes bug #45127 and a host of other related to corlib compilation.
20038 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
20039 array is the method corresponding to the top-level type (this is
20040 because of the changes made to icall.c) so we change this
20043 (MethodGroupExpr.Name): This too.
20045 * typemanager.cs (GetElementType): New method which does the right
20046 thing when compiling corlib.
20048 * everywhere: Make use of the above in the relevant places.
20050 2003-07-22 Martin Baulig <martin@ximian.com>
20052 * cs-parser.jay (invocation_expression): Moved
20053 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
20054 `cast_expression', but create a InvocationOrCast which later
20055 resolves to either an Invocation or a Cast.
20057 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
20058 method; call this before EmitStatement() to make sure that this
20059 expression can be used as a statement.
20061 * expression.cs (InvocationOrCast): New class; resolves to either
20062 an Invocation or a Cast.
20064 * statement.cs (StatementExpression): Call ResolveStatement() on
20065 the ExpressionStatement before emitting it.
20067 2003-07-21 Martin Baulig <martin@ximian.com>
20069 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
20070 `ref' and `out' attributes match; fixes #46220.
20071 (MemberAccess.ResolveMemberAccess): You can't reference a type
20072 through an expression; fixes #33180.
20073 (Indexers.GetIndexersForType): Don't return the indexers from
20074 interfaces the class implements; fixes #46502.
20076 2003-07-21 Martin Baulig <martin@ximian.com>
20078 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
20079 CS0661 checks; fixes bug #30442.
20081 2003-07-21 Martin Baulig <martin@ximian.com>
20083 * decl.cs (AdditionResult): Added `Error'.
20085 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
20087 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
20088 makes cs0031.cs actually work.
20090 2003-07-20 Martin Baulig <martin@ximian.com>
20092 * namespace.cs: Fixed that bug which caused a crash when compiling
20093 the debugger's GUI.
20095 2003-07-20 Miguel de Icaza <miguel@ximian.com>
20097 * typemanager.cs (LookupTypeReflection): Never expose types which
20098 are NotPublic, NestedPrivate, NestedAssembly, or
20099 NestedFamANDAssem. We used to return these, and later do a check
20100 that would report a meaningful error, but the problem is that we
20101 would not get the real match, if there was a name override.
20103 2003-07-18 Miguel de Icaza <miguel@ximian.com>
20105 * namespace.cs (Namespace, Name): Do not compute the namespace
20106 name dynamically, compute it in the constructor. This reduced
20107 memory usage by 1697 KB.
20109 * driver.cs: Use --pause to pause at the end.
20111 2003-07-17 Peter Williams <peter@newton.cx>
20113 * Makefile: Change the name of the test target so that it doesn't
20114 conflict with the recursive test target.
20116 2003-07-17 Miguel de Icaza <miguel@ximian.com>
20118 * expression.cs (LocalVariableReference.Emit, EmitAssign,
20119 AddressOf): Do not use EmitThis, that was wrong, use the actual
20122 2003-07-15 Miguel de Icaza <miguel@ximian.com>
20124 * class.cs (MethodData.Define): While checking if a method is an
20125 interface implementation, improve the test: If we are not public
20126 (use new test here: use the computed MethodAttributes directly,
20127 instead of the parsed modifier flags) check if the `implementing'
20128 method comes from an interface or not.
20130 * pending.cs (VerifyPendingMethods): Slightly better error
20133 * makefile: add test target that does the mcs bootstrap.
20135 2003-07-16 Ravi Pratap <ravi@ximian.com>
20137 * interface.cs (Define): Do nothing here since there are no
20138 members to populate etc. Move the attribute emission out of here
20139 since this was just totally the wrong place to put it. Attribute
20140 application happens during the 'Emit' phase, not in the 'Define'
20143 (Emit): Add this method and move the attribute emission here
20145 * rootcontext.cs (EmitCode): Call the Emit method on interface
20148 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20150 * expression.cs (OverloadResolve): Report error only if Location
20151 is not 'Null' which means that there was a probe going on.
20153 2003-07-14 Martin Baulig <martin@ximian.com>
20155 * expression.cs (ConditionalLogicalOperator): New public class to
20156 implement user defined conditional logical operators.
20157 This is section 14.11.2 in the spec and bug #40505.
20159 2003-07-14 Martin Baulig <martin@ximian.com>
20161 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20163 2003-07-14 Martin Baulig <martin@ximian.com>
20165 * codegen.cs (EmitContext.InFixedInitializer): New public field.
20167 * ecore.cs (IVariable.VerifyFixed): New interface method.
20169 * expression.cs (Unary.ResolveOperator): When resolving the `&'
20170 operator, check whether the variable is actually fixed. Fixes bug
20171 #36055. Set a variable definitely assigned when taking its
20172 address as required by the spec.
20174 * statement.cs (LocalInfo.IsFixed): New field.
20175 (LocalInfo.MakePinned): Set `IsFixed' to true.
20177 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20179 * attribute.cs (Attribute.Resolve): While doing a Member lookup
20180 for .ctors, ensure that we only ask for members declared in the
20181 attribute type (BindingFlags.DeclaredOnly).
20185 * expression.cs (Error_WrongNumArguments): Report error 1501
20186 correctly the way CSC does.
20188 2003-07-13 Martin Baulig <martin@ximian.com>
20190 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20191 lookup on the fully qualified name, to make things like "X.X" work
20192 where "X.X" is a fully qualified type name, but we also have a
20193 namespace "X" in the using list. Fixes #41975.
20195 2003-07-13 Martin Baulig <martin@ximian.com>
20197 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20198 function. If we're a CompoundAssign, we need to create an embedded
20199 CompoundAssign, not an embedded Assign.
20200 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20203 2003-07-13 Martin Baulig <martin@ximian.com>
20205 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20206 work to fix bug #46088.
20208 2003-07-13 Ravi Pratap <ravi@ximian.com>
20210 * class.cs (Operator.Emit): Do not emit attributes here - it is
20211 taken care of by the Method class that we delegate too. This takes
20212 care of bug #45876.
20214 2003-07-10 Martin Baulig <martin@ximian.com>
20216 * expression.cs (TypeOfVoid): New class.
20217 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
20219 2003-07-10 Martin Baulig <martin@ximian.com>
20221 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20224 2003-07-10 Martin Baulig <martin@ximian.com>
20226 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20227 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20229 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20231 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20233 2003-07-10 Martin Baulig <martin@ximian.com>
20235 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20236 of decimal. Fixes #42850.
20238 NOTE: I also fixed the created byte blob, but this doesn't work on
20239 the MS runtime and csc never produces any byte blobs for decimal
20242 2003-07-10 Martin Baulig <martin@ximian.com>
20244 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20245 structs; fixes #32068.
20246 (Block.AddChildVariableNames): Fixed #44302.
20248 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20250 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20252 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20254 * attribute.cs: And this test is onger needed.
20256 2003-07-08 Martin Baulig <martin@ximian.com>
20258 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20259 inaccessible types. Fixes #36313.
20261 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20263 * namespace.cs (NamespaceEntry): Create implicit entries for all
20264 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20265 implicit entries for N1.N2 and N1.
20267 2003-07-08 Martin Baulig <martin@ximian.com>
20269 Rewrote the handling of namespaces to fix a lot of the issues
20270 wrt. `using' aliases etc.
20272 * namespace.cs (Namespace): Splitted this class into a
20273 per-assembly `Namespace' and a per-file `NamespaceEntry'.
20275 * typemanager.cs (TypeManager.IsNamespace): Removed.
20276 (TypeManager.ComputeNamespaces): Only compute namespaces from
20277 loaded assemblies here, not the namespaces from the assembly we're
20278 currently compiling.
20280 2003-07-08 Martin Baulig <martin@ximian.com>
20282 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20284 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20286 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20289 I thought about the memory savings here, but LookupTypeReflection
20290 is used under already very constrained scenarios. Compiling
20291 corlib or mcs only exposes one hit, so it would not really reduce
20292 any memory consumption.
20294 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20296 * typemanager.cs: fixes bug #45889 by only adding public types from
20297 other assemblies to the list of known types.
20299 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20301 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20302 on the type we resolved.
20304 2003-07-05 Martin Baulig <martin@ximian.com>
20306 * pending.cs (PendingImplementation.ParentImplements): Don't
20307 create the proxy if the parent is abstract.
20309 * class.cs (TypeContainer.DefineIndexers): Process explicit
20310 interface implementations first. Fixes #37714.
20312 2003-07-04 Miguel de Icaza <miguel@ximian.com>
20314 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20315 defined recursively; but since we modify the input parameters
20316 (left is set to `this' temporarily), we reset this value if the
20317 left_is_explicit is false, which gives the original semantics to
20320 * literal.cs (NullPointer): new class used to represent a null
20321 literal in a pointer context.
20323 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20324 type is a pointer, use a NullPointer object instead of a
20325 NullLiteral. Closes 43687
20327 (ExplicitConversion): Convert pointer values using
20328 the conv opcode to the proper type.
20330 * ecore.cs (New): change ValueTypeVariable property into a method,
20331 that returns whether the valuetype is suitable for being used.
20333 * expression.cs (Binary.DoNumericPromotions): Only return if we
20334 the int constant was a valid uint, and we can return both left and
20335 right as uints. If not, we continue processing, to trigger the
20336 type conversion. This fixes 39018.
20338 * statement.cs (Block.EmitMeta): During constant resolution, set
20339 the CurrentBlock property on the emitcontext, so that we resolve
20340 constants propertly.
20342 2003-07-02 Martin Baulig <martin@ximian.com>
20344 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20345 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20347 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20348 than emitting it here.
20350 * statement.cs: Fixed some more flow analysis bugs.
20352 2003-07-02 Martin Baulig <martin@ximian.com>
20354 * class.cs (MethodData.Define): When implementing interface
20355 methods, set Final unless we're Virtual.
20357 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20358 check work for interface methods.
20360 2003-07-01 Martin Baulig <martin@ximian.com>
20362 * ecore.cs (EmitContext.This): Replaced this property with a
20363 GetThis() method which takes a Location argument. This ensures
20364 that we get the correct error location for a CS0188.
20366 2003-07-01 Miguel de Icaza <miguel@ximian.com>
20368 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20369 ImplicitStandardConversion.
20371 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20373 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
20375 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20378 2003-06-30 Miguel de Icaza <miguel@ximian.com>
20380 * class.cs (Constructor.Define): Turn off initlocals for unsafe
20383 (MethodData.Define): Turn off initlocals for unsafe methods.
20385 2003-06-29 Miguel de Icaza <miguel@ximian.com>
20387 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20388 complete; Fixes #37521.
20390 * delegate.cs: Use Modifiers.TypeAttr to compute the
20391 TypeAttributes, instead of rolling our own. This makes the flags
20392 correct for the delegates.
20394 2003-06-28 Miguel de Icaza <miguel@ximian.com>
20396 * class.cs (Constructor.Define): Set the private flag for static
20397 constructors as well.
20399 * cs-parser.jay (statement_expression): Set the return value to
20400 null, to avoid a crash when we catch an error.
20402 2003-06-24 Miguel de Icaza <miguel@ximian.com>
20404 * cs-parser.jay: Applied patch from Jackson that adds support for
20405 extern and unsafe modifiers to destructor declarations.
20407 * expression.cs: Report error 21 if the user is trying to index a
20410 * driver.cs: Add an error message, suggested by the bug report.
20412 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20413 if we do not have a ": this ()" constructor initializer. Fixes 45149
20415 2003-06-14 Miguel de Icaza <miguel@ximian.com>
20417 * namespace.cs: Add some information to reduce FAQs.
20419 2003-06-13 Miguel de Icaza <miguel@ximian.com>
20421 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20422 underlying enumeration types. Fixes #43915.
20424 * expression.cs: Treat ushort/short as legal values to be used in
20425 bitwise operations.
20427 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20429 * delegate.cs: transfer custom attributes for paramenters from
20430 the delegate declaration to Invoke and BeginInvoke.
20432 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20434 * attribute.cs: handle custom marshalers and emit marshal info
20437 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
20439 * makefile.gnu: Added anonymous.cs to the compiler sources.
20441 2003-05-28 Miguel de Icaza <miguel@ximian.com>
20443 * iterators.cs: Change the name of the proxy class to include two
20446 * cs-parser.jay: Update grammar to include anonymous methods.
20448 * anonymous.cs: new file.
20450 2003-05-27 Miguel de Icaza <miguel@ximian.com>
20452 * class.cs (Field.Define): Add missing test for pointers and
20455 2003-05-27 Ravi Pratap <ravi@ximian.com>
20457 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20458 we use the stobj opcode.
20460 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20461 since it wasn't the correct fix.
20463 It still is puzzling that we are required to use stobj for IntPtr
20464 which seems to be a ValueType.
20466 2003-05-26 Miguel de Icaza <miguel@ximian.com>
20468 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20469 during regular simple name resolution. Now, the trick is that
20470 instead of returning for processing the simplename, we do a
20471 TypeManager.LookupType (ie, a rooted lookup as opposed to a
20472 contextual lookup type). If a match is found, return that, if
20473 not, return for further composition.
20475 This fixes long-standing 30485.
20477 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20478 using the address to initialize an object, do an Stobj instead of
20479 using the regular Stelem.
20481 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20482 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20483 Because if we are a BaseIndexerAccess that value will be true.
20486 * statement.cs (GotoCase.Resolve): Return after reporting an
20487 error, do not attempt to continue.
20489 * expression.cs (PointerArithmetic.Emit): If our operand is a
20490 long, convert our constants to match the operand before
20491 multiplying. Convert to I type before adding. Fixes 43670.
20493 2003-05-14 Ravi Pratap <ravi@ximian.com>
20495 * enum.cs (ImplicitConversionExists) : Rename to
20496 ImplicitEnumConversionExists to remove ambiguity.
20498 * ecore.cs (NullCast): New type of cast expression class which
20499 basically is very similar to EmptyCast with the difference being
20500 it still is a constant since it is used only to cast a null to
20502 (eg. (string) null)
20504 * convert.cs (ImplicitReferenceConversion): When casting a null
20505 literal, we return a NullCast.
20507 * literal.cs (NullLiteralTyped): Remove - I don't see why this
20508 should be around anymore.
20510 The renaming (reported was slightly wrong). Corrections:
20512 ConvertImplicitStandard -> ImplicitConversionStandard
20513 ConvertExplicitStandard -> ExplicitConversionStandard
20515 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20516 before passing them in !
20518 * convert.cs (ImplicitConversionStandard): When comparing for
20519 equal expr and target types, ensure that expr is not a
20522 In general, we must not be checking (expr_type ==
20523 target_type) in the top level conversion methods
20524 (ImplicitConversion, ExplicitConversion etc). This checking is
20525 done in the methods that they delegate to.
20527 2003-05-20 Miguel de Icaza <miguel@ximian.com>
20529 * convert.cs: Move Error_CannotConvertType,
20530 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20531 ImplicitNumericConversion, ImplicitConversionExists,
20532 ImplicitUserConversionExists, StandardConversionExists,
20533 FindMostEncompassedType, FindMostSpecificSource,
20534 FindMostSpecificTarget, ImplicitUserConversion,
20535 ExplicitUserConversion, GetConversionOperators,
20536 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20537 TryImplicitIntConversion, Error_CannotConvertImplicit,
20538 ConvertImplicitRequired, ConvertNumericExplicit,
20539 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20540 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20543 Perform the following renames:
20545 StandardConversionExists -> ImplicitStandardConversionExists
20546 ConvertImplicit -> ImplicitConversion
20547 ConvertImplicitStandard -> ImplicitStandardConversion
20548 TryImplicitIntConversion -> ImplicitIntConversion
20549 ConvertImplicitRequired -> ImplicitConversionRequired
20550 ConvertNumericExplicit -> ExplicitNumericConversion
20551 ConvertReferenceExplicit -> ExplicitReferenceConversion
20552 ConvertExplicit -> ExplicitConversion
20553 ConvertExplicitStandard -> ExplicitStandardConversion
20555 2003-05-19 Martin Baulig <martin@ximian.com>
20557 * statement.cs (TypeInfo.StructInfo): Made this type protected.
20558 (TypeInfo): Added support for structs having structs as fields.
20560 * ecore.cs (FieldExpr): Implement IVariable.
20561 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20562 VariableInfo for the field.
20564 2003-05-18 Martin Baulig <martin@ximian.com>
20566 * expression.cs (This.DoResolve): Report a CS0027 if we're
20567 emitting a field initializer.
20569 2003-05-18 Martin Baulig <martin@ximian.com>
20571 * expression.cs (This.ResolveBase): New public function.
20572 (This.DoResolve): Check for CS0188.
20574 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20577 * ecore.cs (MethodGroupExpr.DoResolve): Set the
20578 `instance_expression' to null if we don't have any non-static
20581 2003-05-18 Martin Baulig <martin@ximian.com>
20583 Reworked the way how local variables and parameters are handled by
20584 the flow analysis code.
20586 * statement.cs (TypeInfo, VariableMap): New public classes.
20587 (VariableInfo): New public class. This is now responsible for
20588 checking whether a variable has been assigned. It is used for
20589 parameters and local variables.
20590 (Block.EmitMeta): Take the InternalParameters as argument; compute
20591 the layout of the flow vectors here.
20592 (Block.LocalMap, Block.ParameterMap): New public properties.
20593 (FlowBranching): The .ctor doesn't get the InternalParameters
20594 anymore since Block.EmitMeta() now computes the layout of the flow
20596 (MyStructInfo): This class is now known as `StructInfo' and nested
20597 in `TypeInfo'; we don't access this directly anymore.
20599 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20600 property and removed IsAssigned(), IsFieldAssigned(),
20601 SetAssigned() and SetFieldAssigned(); we now call them on the
20602 VariableInfo so we don't need to duplicate this code everywhere.
20604 * expression.cs (ParameterReference): Added `Block block' argument
20606 (LocalVariableReference, ParameterReference, This): The new
20607 VariableInfo class is now responsible for all the definite
20610 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20611 IsParameterAssigned, SetParameterAssigned): Removed.
20613 2003-05-18 Martin Baulig <martin@ximian.com>
20615 * typemanager.cs (InitCoreTypes): Try calling
20616 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20617 the 3-args-version. Corlib now also needs our `void_type'.
20618 (GetMethod): Added overloaded version which takes an optional
20619 `bool report_errors' to allow lookups of optional methods.
20621 2003-05-12 Martin Baulig <martin@ximian.com>
20623 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20624 only used for locals and not for parameters.
20626 2003-05-12 Miguel de Icaza <miguel@ximian.com>
20628 * support.cs (InternalParameters.ParameterType): Return the
20629 ExternalType of the parameter.
20631 * parameter.cs (Parameter.ExternalType): drop the two arguments,
20634 2003-05-11 Miguel de Icaza <miguel@ximian.com>
20636 * class.cs (MethodData.Define): Do not set the `newslot' on
20637 interface members, if they are also flagged as "override".
20639 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20640 better code for ++i and i++. This only works for static fields
20641 and local variables.
20643 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20644 want to pull the DeclSpace out of the builder_to_declspace instead
20645 of the TypeBuilder (like in TypeContainer.FindMembers).
20647 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20648 instead of LookupTypeContainer. Fixes the crash on .NET for
20649 looking up interface members.
20651 * const.cs: Create our own emit context during the Definition
20652 stage, so that constants are evaluated in the proper context, when
20653 a recursive definition happens.
20655 2003-05-11 Martin Baulig <martin@ximian.com>
20657 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
20658 new block for a switch section.
20659 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20660 the adding/lookup in the switch block. Fixes #39828.
20662 2003-05-09 Miguel de Icaza <miguel@ximian.com>
20664 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20665 functionality: I needed to convert the data after I had performed
20666 the add/sub operation into the operands type size.
20668 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20669 pass the type for the box operation, otherwise the resulting
20670 object would have been of type object.
20672 (BoxedCast): Add constructor to specify the type to box as.
20674 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20676 * iterators.cs: I was reusing the `count' variable inadvertently,
20677 take steps to not allow this to happen.
20679 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20681 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20682 by creating an array at the point where the params starts and
20683 putting all those arguments there, then adjusting the size of the
20686 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20688 * expression.cs (New.AddressOf): Implement interface
20689 IMemoryLocation. This is used when the `new' operator is used in
20690 the context of an invocation to a method on a value type.
20692 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20695 * namespace.cs: Also check the using aliases here.
20697 * driver.cs: Move the test for using validity after the types have
20698 been entered, so we do a single pass that also includes the using
20701 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20702 in the regular case. CreateSiblingForFinally is doing extra
20705 * attribute.cs (GetAttributeArgumentExpression): Store the result
20706 on an out value, and use the return value to indicate failure
20707 instead of using null (which is a valid return for Constant.GetValue).
20709 * statement.cs: Perform the analysis flow for the increment
20710 portion after the statement, because this will be the real flow of
20711 execution. Fixes #42385
20713 * codegen.cs (EmitContext.EmitArgument,
20714 EmitContext.EmitStoreArgument): New helper functions when the
20715 RemapToProxy flag is set.
20717 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20720 Add support for remapping parameters.
20722 * iterators.cs: Propagate parameter values; Store parameter
20723 values in the proxy classes.
20725 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20727 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20728 need a proxy reference; I do not know what I was thinking
20730 * cs-parser.jay (constructor_initializer): catch another error,
20731 and display nice message.
20733 (field_declaration): catch void field declaration
20734 to flag a better error.
20736 * class.cs (MemberBase.CheckBase): Report an error instead of a
20737 warning if a new protected member is declared in a struct.
20738 (Field.Define): catch the error of readonly/volatile.
20740 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20742 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20743 volatile variable is taken
20745 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20747 * statement.cs (Fixed.Resolve): Report an error if we are not in
20750 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20752 * typemanager.cs: reuse the code that handles type clashes for
20753 delegates and enumerations.
20755 * class.cs (Report28): Always report.
20757 * expression.cs (EncodeAsAttribute): Allow nulls here.
20759 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20761 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20762 the functionality for testing whether an expression is valid for
20763 an attribute here. Also handle the case of arrays of elements
20766 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20767 encoding a linear array into an array of objects that are suitable
20768 to be passed to an CustomAttributeBuilder.
20770 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20772 * ecore.cs: (FieldExpr): Handle field remapping here.
20774 * iteratators.cs: Pass the instance variable (if the method is an
20775 instance method) to the constructors, so we can access the field
20776 variables on the class.
20778 TODO: Test this with structs. I think the THIS variable on
20779 structs might have to be a pointer, and not a refenrece
20781 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20783 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20784 local variables to fields in a proxy class.
20786 * iterators.cs (PopulateProxy): Rename our internal fields to
20788 Create a <THIS> field if we are an instance method, so we can
20789 reference our parent container variables.
20790 (MapVariable): Called back from the EmitContext code to enter a
20791 new variable to field mapping into the proxy class (we just create
20795 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20796 for using the remapped locals to fields.
20798 I placed the code here, because that gives the same semantics to
20799 local variables, and only changes the Emit code.
20801 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20802 statements inside iterators.
20803 (VariableInfo): Add a FieldBuilder for the cases when we are
20804 remapping local variables to fields in a proxy class
20806 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20807 current_block != null.
20809 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20810 not cope with strings, as it has been moved to the
20811 TableSwitchEmit. Fixed bug in switch generation.
20813 * expression.cs (New.DoResolve): Provide more context for the user
20814 when reporting an error.
20816 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20819 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20820 check the permissions for it. Note than in a type-resolution
20821 context the check was already present in DeclSpace.ResolveType,
20822 but was missing from the MemberAccess.
20824 (ArrayCreation.CheckIndices): warn if the user has
20825 more nested levels of expressions, but there are no more
20826 dimensions specified. Avoids crash on bug 41906.
20828 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20830 * statement.cs (Block): replace Implicit bool, for a generic
20832 New flag: `Unchecked'. This is used during the EmitMeta phase
20833 (which is out-of-line with the regular Resolve/Emit process for a
20834 statement, as this is done ahead of time, but still gets a chance
20835 to call constant resolve).
20837 (Block.Flags): new enum for adding a new flag.
20839 (Block.EmitMeta): track the state of unchecked.
20841 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20842 to enable constant resolution to work there as well.
20844 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20846 * typemanager.cs (ienumerable_type): Also look up
20847 System.Collections.IEnumerable.
20849 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20851 TODO: Test more than one conditional per method.
20853 * class.cs (Indexer.Define): Report the location where the user is
20854 referencing the unsupported feature.
20856 (MethodData): Overload the use of `conditionals' to
20857 minimize the creation of needless ArrayLists. This saves roughly
20858 212kb on my machine.
20860 (Method): Implement the new IIteratorContainer interface.
20861 (Method.SetYields): Implement the method by setting the ModFlags
20862 to contain METHOD_YIELDS.
20864 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20865 which just got set to null.
20867 * iterators.cs: New file.
20869 (Yield, YieldBreak): New statements.
20871 * statement.cs (Return.Resolve): Flag an error if we are used in
20872 an iterator method.
20874 * codegen.cs (InIterator): New flag set if the code is being
20875 compiled in an iterator method.
20877 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20878 internal modifier, and we just use it to avoid adding extra
20879 fields, as this is seldom used.
20881 * cs-parser.jay: Add yield_statement (yield and yield break).
20883 * driver.cs: New flag -v2 to turn on version 2 features.
20885 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20886 hashtable when v2 is enabled.
20888 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20890 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20891 there is already a namespace defined with this name.
20893 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20894 people upgraded their corlibs.
20896 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20897 always use fully qualified types, no need to use the compiler
20900 (TypeManager.IsNamespace): Use binarysearch.
20902 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20903 AddDelegate): I did not quite use the new IsValid API properly: I
20904 have to pass the short-name and the fullname. I was passing only
20905 the basename instead of the fullname sometimes.
20907 (TypeContainer.DefineType): call NamespaceClash.
20909 * interface.cs (Interface.DefineType): use NamespaceClash before
20912 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20915 * enum.cs: (Enum.DefineType): use NamespaceClash before
20918 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20919 speed increase. First, use the negative_hits cache when we get a
20920 negative. Second, add the type with its full original name
20921 instead of the new . and + encoded name (reflection uses + to
20922 separate type from a nested type). Use LookupTypeReflection
20923 directly which bypasses the type->name hashtable (that we already
20924 know does not contain the type.
20926 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20927 location/container type.
20929 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20931 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20933 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20935 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20936 method is being referenced in the method group from a static
20937 context, and report error 120 if so.
20939 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20942 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20943 is created, we create the A namespace).
20945 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20948 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20950 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20951 invocation to ModuleBuilder.GetType with the same values will
20952 return a new type instance, so we need to cache its return
20955 * expression.cs (Binary.ResolveOperator): Only allow the compare
20956 operators on enums if they are of the same type.
20958 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20959 types of ValueType on their own case. Before we were giving them
20960 the same treatment as objects.
20962 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20963 fullname. Short name is used to compare against container name.
20964 Fullname is used to check against defined namespace names.
20966 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20967 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20969 (Method.CheckBase): Call parent.
20970 (MemberBase.CheckBase): Check for protected members on sealed
20972 (PropertyBase.CheckBase): Call parent.
20973 (Field.Define): Call parent.
20975 * report.cs: Negative error codes are now mapped to 8000 - code,
20976 so that the display is render more nicely.
20978 * typemanager.cs: Do not use try/catch, instead report a regular
20981 (GetPointerType, GetReferenceType): These methods provide
20982 mechanisms to obtain the T* and T& from a T. We had the code
20983 previously scattered around the code base, and it also used
20984 TypeManager.LookupType that would go through plenty of caches.
20985 This one goes directly to the type source.
20987 In some places we did the Type.GetType followed by
20988 ModuleBuilder.GetType, but not in others, so this unifies the
20989 processing as well.
20991 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20992 statements now that we have namespace information.
20994 * typemanager.cs (IsNamespace): New method, returns whether the
20995 string presented is a namespace or not.
20997 (ComputeNamespaces): New public entry point, computes the list of
20998 available namespaces, using the GetNamespaces API call in Mono, or
20999 the slower version in MS.NET.
21001 Now before we start the semantic analysis phase, we have a
21002 complete list of namespaces including everything that the user has
21005 Deleted old code to cache namespaces in .nsc files.
21007 2003-04-17 Miguel de Icaza <miguel@ximian.com>
21009 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
21010 class/struct location definition Location for the implicit
21011 constructor location.
21013 (Operator.Define): Use the location of the operator for the
21014 implicit Method definition.
21016 (Constructor.Emit): use the constructor location for the implicit
21017 base initializer constructor.
21019 * ecore.cs: Remove ITypeExpression. This interface is now gone,
21020 and the Expression class now contains two new methods:
21022 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
21023 isolate type lookup from the rest of the resolution process.
21025 Since we use Expressions to hold type definitions due to the way
21026 we parse the input we have historically overloaded Resolve to
21027 perform the Type lookups if a special flag is passed. Now this is
21028 eliminated and two methods take their place.
21030 The differences in the two methods between xStep and xTerminal is
21031 that xStep is involved in our current lookup system that uses
21032 SimpleNames to compose a name, while xTerminal is used just to
21033 catch the case where the simplename lookup failed.
21035 2003-04-16 Miguel de Icaza <miguel@ximian.com>
21037 * expression.cs (ResolveMemberAccess): Remove redundant code.
21038 TypeExpr expressions are always born fully resolved.
21040 * interface.cs (PopulateMethod): Do not lookup the types twice.
21041 We were doing it once during SemanticAnalysis and once during
21044 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
21045 in local variable type definitions, were being returned as a
21046 SimpleName (we decomposed everything into a string), that is
21047 because primary_expression was being used instead of a type in the
21048 grammar (reduce/reduce conflicts).
21050 The part that was wrong is that we converted the expression into a
21051 string (an oversimplification in one hand, compounded with primary
21052 expressions doing string concatenation).
21058 Would return "A.B.C[]" as a SimpleName. This stopped things like
21059 using clauses from working on this particular context. And a type
21060 was being matched directly against "A.B.C[]".
21062 We now use the correct approach, and allow for ComposedCast to be
21063 part of the unary expression. So the "A.B.C []" become a composed
21064 cast of "A.B.C" (as a nested group of MemberAccess with a
21065 SimpleName at the end) plus the rank composition "[]".
21069 2003-04-10 Miguel de Icaza <miguel@ximian.com>
21071 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
21072 for the access level checking.
21074 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
21075 `TypeContainer container', because I kept getting confused when I
21076 was debugging this code.
21078 * expression.cs (Indexers): Instead of tracking getters/setters,
21079 we now track them in parallel. We create one arraylist less, but
21080 most importantly it is possible now for the LValue code to find a
21081 matching get for a set.
21083 (IndexerAccess.DoResolveLValue): Update the code.
21084 GetIndexersForType has been modified already to extract all the
21085 indexers from a type. The code assumed it did not.
21087 Also make the code set the correct return type for the indexer.
21088 This was fixed a long time ago for properties, but was missing for
21089 indexers. It used to be void_type.
21091 (Binary.Emit): Test first for doubles instead of
21092 floats, as they are more common.
21094 (Binary.EmitBranchable): Use the .un version of the branch opcodes
21095 when dealing with floats and the <=, >= operators. This fixes bug
21098 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21099 to load the array value by emitting a load on the foreach variable
21100 type. This was incorrect.
21102 We now emit the code to load an element using the the array
21103 variable type, and then we emit the conversion operator.
21107 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
21109 * attribute.cs: Avoid allocation of ArrayLists in the common case.
21111 2003-04-09 Miguel de Icaza <miguel@ximian.com>
21113 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21114 test for protection before we test for signatures.
21116 (MethodSignature.ToString): implement.
21118 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21119 to the case where we reduced into a LongConstant.
21121 * decl.cs (CheckAccessLevel): If the type is an array, we can not
21122 depend on whether the information is acurrate, because the
21123 Microsoft runtime will always claim that the array type is public,
21124 regardless of the real state.
21126 If the type is a pointer, another problem happens: the type is
21127 reported as non-public in Microsoft.
21129 In both cases we have to call CheckAccessLevel recursively with
21130 the underlying type as the argument to be tested.
21132 2003-04-08 Miguel de Icaza <miguel@ximian.com>
21134 * assign.cs (Assign.Emit): If we are dealing with a compound
21135 assignment expression, we should use the code path that stores the
21136 intermediate result in a temporary value. This fixes #40903.
21138 *expression.cs (Indirection.ToString): Provide ToString method for
21141 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
21143 * class.cs: Null out fields holding references to Block objects so
21144 they can be garbage collected.
21146 * expression.cs (OverloadResolve): Remove unused local.
21148 2003-04-07 Martin Baulig <martin@ximian.com>
21150 * codegen.cs (EmitContext.CurrentFile): New public field.
21151 (EmitContext.Mark): Use the CurrentFile to check whether the
21152 location is in the correct file.
21153 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21155 2003-04-07 Martin Baulig <martin@ximian.com>
21157 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21159 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21160 location. [FIXME: The location argument which gets passed to this
21161 method is sometimes wrong!]
21163 2003-04-07 Nick Drochak <ndrochak@gol.com>
21165 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21167 2003-04-07 Miguel de Icaza <miguel@ximian.com>
21169 * expression.cs (Indirection.EmitAssign): We were using the
21170 temporary, but returning immediately instead of continuing the
21173 2003-04-06 Martin Baulig <martin@ximian.com>
21175 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21176 if it's a nested child, but also deriving from the outer class.
21179 * typemanager.cs (IsNestedChildOf): Make this work if it's a
21180 nested child, but also deriving from the outer class. See
21182 (FilterWithClosure): We may access private members of the outer
21183 class if we're a nested child and deriving from the outer class.
21184 (RealMemberLookup): Only set `closure_private_ok' if the
21185 `original_bf' contained BindingFlags.NonPublic.
21187 2003-04-05 Martin Baulig <martin@ximian.com>
21189 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21191 2003-04-02 Miguel de Icaza <miguel@ximian.com>
21193 * class.cs (Event.Define): Do not allow abstract events to have
21196 2003-04-01 Miguel de Icaza <miguel@ximian.com>
21198 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21199 block in event declarations.
21201 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21202 value type, get its address.
21204 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21205 leaving a class on the stack instead of a boolean value (int
21206 0/1). Change the code so we compare against null, and then the
21207 result against zero.
21209 * class.cs (TypeContainer.GetClassBases): We were checking for the
21210 parent class being sealed too late.
21212 * expression.cs (Binary.Emit): For <= and >= when dealing with
21213 floating point values, use cgt.un and clt.un instead of cgt and
21216 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
21218 * statement.cs: Apply the same optimization as MS: skip the
21219 GetEnumerator returning an IEnumerator, and use the one returning a
21220 CharEnumerator instead. This allows us to avoid the try-finally block
21223 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
21225 * cs-parser.jay: Attributes cannot be applied to
21226 namespaces. Fixes #40473
21228 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21231 (Add*): check if the name is valid using the full name for constants,
21232 fields, properties and events.
21234 2003-03-28 Miguel de Icaza <miguel@ximian.com>
21236 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21237 char constants to be part of the enumeration.
21239 * expression.cs (Conditional.DoResolve): Add support for operator
21240 true. Implements the missing functionality from 14.12
21242 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21243 operator true/false as required by the spec.
21245 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21246 implicit conversion to boolean.
21248 * statement.cs (Statement.ResolveBoolean): A boolean expression is
21249 also one where the type implements `operator true'.
21251 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21252 get an expression that will invoke operator true based on an
21255 (GetConversionOperators): Removed the hack that called op_True
21258 (Expression.ResolveBoolean): Move this from Statement.
21260 2003-03-17 Miguel de Icaza <miguel@ximian.com>
21262 * ecore.cs (FieldExpr): do not allow initialization of initonly
21263 fields on derived classes
21265 2003-03-13 Martin Baulig <martin@ximian.com>
21267 * statement.cs (Block.Emit): Call ig.BeginScope() and
21268 ig.EndScope() when compiling with debugging info; call
21269 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21271 2003-03-08 Miguel de Icaza <miguel@ximian.com>
21273 * expression.cs (Indexers): Do not construct immediately, allow
21274 for new members to be appended as we go. Fixes 38143
21276 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21278 * expression.cs: save/restore context when resolving an unchecked
21281 2003-03-05 Miguel de Icaza <miguel@ximian.com>
21283 * cfold.cs: Catch division by zero in modulus operator during
21286 2003-03-03 Miguel de Icaza <miguel@ximian.com>
21288 * interface.cs (Interface.DefineMembers): Avoid defining members
21291 2003-02-27 Miguel de Icaza <miguel@ximian.com>
21293 * driver.cs: handle the +/- options for -noconfig
21295 * statement.cs (Unckeched.Resolve): Also track the state of
21296 unchecked in the Resolve phase.
21298 2003-02-27 Martin Baulig <martin@ximian.com>
21300 * ecore.cs (Expression.MemberLookup): Don't create a
21301 MethodGroupExpr for something which is not a method. Fixes #38291.
21303 2003-02-25 Miguel de Icaza <miguel@ximian.com>
21305 * class.cs (MemberBase.CheckParameters): Also check that the type
21306 is unmanaged if it is a pointer.
21308 * expression.cs (SizeOf.Resolve): Add location information.
21310 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21311 a managed type is declared.
21313 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21314 parameter modifiers as well. Fixes bug 38606
21316 * class.cs: Very sad. Am backing out the speed up changes
21317 introduced by the ArrayList -> Array in the TypeContainer, as they
21318 were not actually that much faster, and introduced a bug (no error
21319 reports on duplicated methods).
21321 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21322 source first, this will guarantee that we have a valid expression
21323 before calling in lower levels functions that will require a
21324 resolved object. Then use this original_source in the
21325 target.ResolveLValue instead of the original source that was
21328 Another change. Use target.Resolve instead of LValueResolve.
21329 Although we are resolving for LValues, we will let the Assign code
21330 take care of that (it will be called again from Resolve). This
21331 basically allows code like this:
21333 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21334 class Y { void A (X x) { x [0] += o; }
21336 The problem was that the indexer was trying to resolve for
21337 set_Item (idx, object o) and never finding one. The real set_Item
21338 was set_Item (idx, X). By delaying the process we get the right
21343 2003-02-23 Martin Baulig <martin@ximian.com>
21345 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21346 while calling DoEmit ().
21348 * codegen.cs (EmitContext.Mark): Don't mark locations in other
21349 source files; if you use the #line directive inside a method, the
21350 compiler stops emitting line numbers for the debugger until it
21351 reaches the end of the method or another #line directive which
21352 restores the original file.
21354 2003-02-23 Martin Baulig <martin@ximian.com>
21356 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21358 2003-02-23 Martin Baulig <martin@ximian.com>
21360 * statement.cs (Block.AddChildVariableNames): We need to call this
21361 recursively, not just for our immediate children.
21363 2003-02-23 Martin Baulig <martin@ximian.com>
21365 * class.cs (Event.Define): Always make the field private, like csc does.
21367 * typemanager.cs (TypeManager.RealMemberLookup): Make events
21368 actually work, fixes bug #37521.
21370 2003-02-23 Miguel de Icaza <miguel@ximian.com>
21372 * delegate.cs: When creating the various temporary "Parameters"
21373 classes, make sure that we call the ComputeAndDefineParameterTypes
21374 on those new parameters (just like we do with the formal ones), to
21375 allow them to be resolved in the context of the DeclSpace.
21377 This fixes the bug that Dick observed in Bugzilla #38530.
21379 2003-02-22 Miguel de Icaza <miguel@ximian.com>
21381 * expression.cs (ResolveMemberAccess): When resolving a constant,
21382 do not attempt to pull a constant if the value was not able to
21383 generate a valid constant.
21385 * const.cs (LookupConstantValue): Do not report more errors than required.
21387 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21389 * expression.cs: fixes bug #38328.
21391 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21393 * class.cs: Changed all the various members that can be part of a
21394 class from being an ArrayList to be an Array of the right type.
21395 During the DefineType type_list, interface_list, delegate_list and
21396 enum_list are turned into types, interfaces, delegates and enums
21399 And during the member population, indexer_list, event_list,
21400 constant_list, field_list, instance_constructor_list, method_list,
21401 operator_list and property_list are turned into their real arrays.
21403 Although we could probably perform this operation earlier, for
21404 good error reporting we need to keep the lists and remove the
21405 lists for longer than required.
21407 This optimization was triggered by Paolo profiling the compiler
21408 speed on the output of `gen-sample-program.pl' perl script.
21410 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21411 not crash in methods like MemberLookupFailed that use this field.
21413 This problem arises when the compiler fails to resolve a type
21414 during interface type definition for example.
21416 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21418 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21419 inherit from System.Object, so we have to stop at null, not only
21420 when reaching System.Object.
21422 2003-02-17 Miguel de Icaza <miguel@ximian.com>
21424 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21425 DeclaredOnly because the parent indexer might have had a different
21426 name, but did not loop until the top of the hierarchy was reached.
21428 The problem this one fixes is 35492: when a class implemented an
21429 indexer from an interface, we were getting the interface method
21430 (which was abstract) and we were flagging an error (can not invoke
21433 This also keeps bug 33089 functioning, and test-148 functioning.
21435 * typemanager.cs (IsSpecialMethod): The correct way of figuring
21436 out if a method is special is to see if it is declared in a
21437 property or event, or whether it is one of the predefined operator
21438 names. This should fix correctly #36804.
21440 2003-02-15 Miguel de Icaza <miguel@ximian.com>
21442 The goal here is to remove the dependency on EmptyCast.Peel ().
21443 Killing it completely.
21445 The problem is that currently in a number of places where
21446 constants are expected, we have to "probe" for an EmptyCast, and
21447 Peel, which is not the correct thing to do, as this will be
21448 repetitive and will likely lead to errors.
21450 The idea is to remove any EmptyCasts that are used in casts that
21451 can be reduced to constants, so we only have to cope with
21454 This bug hunt was triggered by Bug 37363 and the desire to remove
21455 the duplicate pattern where we were "peeling" emptycasts to check
21456 whether they were constants. Now constants will always be
21459 * ecore.cs: Use an enumconstant here instead of wrapping with
21462 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21463 throwing me off. By handling this we can get rid of a few hacks.
21465 * statement.cs (Switch): Removed Peel() code.
21467 2003-02-14 Miguel de Icaza <miguel@ximian.com>
21469 * class.cs: Location information for error 508
21471 * expression.cs (New.DoResolve): Add a guard against double
21472 resolution of an expression.
21474 The New DoResolve might be called twice when initializing field
21475 expressions (see EmitFieldInitializers, the call to
21476 GetInitializerExpression will perform a resolve on the expression,
21477 and later the assign will trigger another resolution
21479 This leads to bugs (#37014)
21481 * delegate.cs: The signature for EndInvoke should contain any ref
21482 or out parameters as well. We were not doing this in the past.
21484 * class.cs (Field.Define): Do not overwrite the type definition
21485 inside the `volatile' group. Turns out that volatile enumerations
21486 were changing the type here to perform a validity test, which
21489 2003-02-12 Miguel de Icaza <miguel@ximian.com>
21491 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21492 and structs, we do not want to load the instance variable
21494 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21495 enum_type has to be handled like an object reference (implicit
21496 conversions exists from this to object), but the regular IsClass
21497 and IsValueType tests will never return true for this one.
21499 Also we use TypeManager.IsValueType instead of type.IsValueType,
21500 just for consistency with the rest of the code (this is only
21501 needed if we ever use the construct exposed by test-180.cs inside
21502 corlib, which we dont today).
21504 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
21506 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21509 2003-02-09 Martin Baulig <martin@ximian.com>
21511 * namespace.cs (Namespace..ctor): Added SourceFile argument.
21512 (Namespace.DefineNamespaces): New static public method; this is
21513 called when we're compiling with debugging to add all namespaces
21514 to the symbol file.
21516 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21517 pass it to the Namespace's .ctor.
21519 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21520 and MethodBase arguments; pass the namespace ID to the symwriter;
21521 pass the MethodBase instead of the token to the symwriter.
21522 (SymbolWriter.DefineNamespace): New method to add a namespace to
21525 2003-02-09 Martin Baulig <martin@ximian.com>
21527 * symbolwriter.cs: New file. This is a wrapper around
21528 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
21529 methods here in near future.
21531 2003-02-09 Martin Baulig <martin@ximian.com>
21533 * codegen.cs (EmitContext.Mark): Just pass the arguments to
21534 ILGenerator.MarkSequencePoint() which are actually used by the
21537 2003-02-09 Martin Baulig <martin@ximian.com>
21539 * location.cs (SourceFile): New public sealed class. This
21540 contains the name and an index which is used in the location's token.
21541 (Location): Reserve an appropriate number of bits in the token for
21542 the source file instead of walking over that list, this gives us a
21543 really huge performance improvement when compiling with debugging.
21545 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21546 `SourceFile' argument instead of a string.
21547 (Driver.ProcessFile): Add all the files via Location.AddFile(),
21548 but don't parse/tokenize here, we need to generate the list of all
21549 source files before we do that.
21550 (Driver.ProcessFiles): New static function. Parses/tokenizes all
21553 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21554 instead of a string.
21556 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21559 2003-02-09 Martin Baulig <martin@ximian.com>
21561 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21562 filename on `#line default'.
21564 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21566 * statement.cs: don't clear the pinned var when the fixed statement
21567 returns from the method (fixes bug#37752).
21569 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21571 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
21574 2003-02-07 Martin Baulig <martin@ximian.com>
21576 * driver.cs: Removed the `--debug-args' command line argument.
21578 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21579 automatically by the AsssemblyBuilder.
21580 (CodeGen.InitializeSymbolWriter): We don't need to call any
21581 initialization function on the symbol writer anymore. This method
21582 doesn't take any arguments.
21584 2003-02-03 Miguel de Icaza <miguel@ximian.com>
21586 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21587 from referenced assemblies as well.
21589 2003-02-02 Martin Baulig <martin@ximian.com>
21591 * class.cs (MethodData.Emit): Generate debugging info for external methods.
21593 2003-02-02 Martin Baulig <martin@ximian.com>
21595 * class.cs (Constructor.Emit): Open the symbol writer before
21596 emitting the constructor initializer.
21597 (ConstructorInitializer.Emit): Call ec.Mark() to allow
21598 single-stepping through constructor initializers.
21600 2003-01-30 Miguel de Icaza <miguel@ximian.com>
21602 * class.cs: Handle error 549: do not allow virtual methods in
21605 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21607 * decl.cs: Check access levels when resolving types
21609 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21611 * statement.cs: Add parameters and locals set in catch blocks that might
21612 return to set vector
21614 2003-01-29 Miguel de Icaza <miguel@ximian.com>
21616 * class.cs (Operator): Set the SpecialName flags for operators.
21618 * expression.cs (Invocation.DoResolve): Only block calls to
21619 accessors and operators on SpecialName methods.
21621 (Cast.TryReduce): Handle conversions from char constants.
21624 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21626 * statement.cs: small memory and time optimization in FlowBranching.
21628 2003-01-28 Pedro Mart <yoros@wanadoo.es>
21630 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21631 problem that the last fix but in the other sid (Set).
21633 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21634 access when there is no indexer in the hierarchy.
21636 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21638 * class.cs: Combine some if statements.
21640 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21642 * driver.cs: fixed bug #37187.
21644 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
21646 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21647 any indexer, it's needed to build a list with all the indexers in the
21648 hierarchy (AllGetters), else we have problems. Fixes #35653.
21650 2003-01-23 Miguel de Icaza <miguel@ximian.com>
21652 * class.cs (MethodData.Define): It is wrong for an interface
21653 implementation to be static in both cases: explicit and implicit.
21654 We were only handling this in one case.
21656 Improve the if situation there to not have negations.
21658 * class.cs (Field.Define): Turns out that we do not need to check
21659 the unsafe bit on field definition, only on usage. Remove the test.
21661 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21663 * driver.cs: use assembly.Location instead of Codebase (the latest
21664 patch made mcs fail when using MS assemblies).
21666 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
21668 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21669 get the path to *corlib.dll.
21671 2003-01-21 Nick Drochak <ndrochak@gol.com>
21675 * typemanager.cs: Remove compiler warnings
21677 2003-01-20 Duncan Mak <duncan@ximian.com>
21679 * AssemblyInfo.cs: Bump the version number to 0.19.
21681 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21683 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21685 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21687 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21689 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21691 * cs-parser.jay: Small fix: we were not comparing the constructor
21692 name correctly. Thanks to Zoltan for the initial pointer.
21694 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21696 * cs-tokenizer.cs: Set file name when specified with #line
21698 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21700 * cs-parser.jay: Only perform the constructor checks here if we
21701 are named like the class; This will help provider a better
21702 error. The constructor path is taken when a type definition is
21703 not found, but most likely the user forgot to add the type, so
21704 report that rather than the constructor error.
21706 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21708 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21711 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21713 * cs-parser.jay: Add cleanup call.
21715 2003-01-13 Duncan Mak <duncan@ximian.com>
21717 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21718 consistent with other methods.
21720 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21722 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21724 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21726 * attribute.cs: only set GuidAttr to true when we have a
21729 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21733 * typemanager.cs: fixes to allow mcs compile corlib with the new
21734 Type.IsSubclassOf fix.
21736 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21738 * expression.cs (LocalVariableReference.DoResolve): Classify a
21739 constant as a value, not as a variable. Also, set the type for
21742 * cs-parser.jay (fixed_statement): take a type instead of a
21743 pointer_type, so we can produce a better error message later.
21745 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21748 (For.DoEmit): Make inifinite loops have a
21749 non-conditional branch back.
21751 (Fixed.DoEmit): First populate the pinned variables, then emit the
21752 statement, then clear the variables. Before I was emitting the
21753 code once for each fixed piece.
21756 2003-01-08 Martin Baulig <martin@ximian.com>
21758 * statement.cs (FlowBranching.MergeChild): A break in a
21759 SWITCH_SECTION does not leave a loop. Fixes #36155.
21761 2003-01-08 Martin Baulig <martin@ximian.com>
21763 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21764 lives in the same number space than `param_map'. Fixes #36154.
21766 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21768 * cs-parser.jay (constructor_declaration): Set the
21769 Constructor.ModFlags before probing for it. This makes the
21770 compiler report 514, 515 and 132 (the code was there, but got
21773 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21774 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21775 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21777 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21779 * enum.cs: create the enum static fields using the enum type.
21781 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21783 * class.cs: don't try to create the ParamBuilder for the return
21784 type if it's not needed (and handle it breaking for the ms runtime
21787 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21789 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21791 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21793 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21794 the command. This showed up while compiling the JANET source
21795 code, which used \r as its only newline separator.
21797 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21799 * class.cs (Method.Define): If we are an operator (because it
21800 reuses our code), then set the SpecialName and HideBySig. #36128
21802 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21804 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21805 exception, report error 120 `object reference required'.
21807 * driver.cs: Add --pause option, used during to measure the size
21808 of the process as it goes with --timestamp.
21810 * expression.cs (Invocation.DoResolve): Do not allow methods with
21811 SpecialName to be invoked.
21813 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21815 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21816 number before adding it.
21818 2002-12-21 Ravi Pratap <ravi@ximian.com>
21820 * ecore.cs (StandardImplicitConversion): When in an unsafe
21821 context, we allow conversion between void * to any other pointer
21822 type. This fixes bug #35973.
21824 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21826 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21827 is not thrown when extensionless outputs are used
21829 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21831 * rootcontext.cs: fixed compilation of corlib.
21833 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21835 * attribute.cs (Attributes.Contains): Add new method.
21837 * class.cs (MethodCore.LabelParameters): if the parameter is an
21838 `out' parameter, check that no attribute `[In]' has been passed.
21840 * enum.cs: Handle the `value__' name in an enumeration.
21842 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21844 * decl.cs: Added special case to allow overrides on "protected
21847 2002-12-18 Ravi Pratap <ravi@ximian.com>
21849 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21850 since it makes much more sense.
21852 (Attributes.ctor): Don't require a Location parameter.
21854 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21856 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21857 since we already have that information per attribute.
21859 * everywhere : make appropriate changes.
21861 * class.cs (LabelParameters): Write the code which actually
21862 applies attributes to the return type. We can't do this on the MS
21863 .NET runtime so we flag a warning in the case an exception is
21866 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21868 * const.cs: Handle implicit null conversions here too.
21870 2002-12-17 Ravi Pratap <ravi@ximian.com>
21872 * class.cs (MethodCore.LabelParameters): Remove the extra
21873 Type [] parameter since it is completely unnecessary. Instead
21874 pass in the method's attributes so that we can extract
21875 the "return" attribute.
21877 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21879 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21880 of ignoring it and letting the compile continue.
21882 * typemanager.cs (ChangeType): use an extra argument to return an
21883 error condition instead of throwing an exception.
21885 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21887 * expression.cs (Unary.TryReduce): mimic the code for the regular
21888 code path. Perform an implicit cast in the cases where we can
21889 implicitly convert to one of the integral types, and then reduce
21890 based on that constant. This fixes bug #35483.
21892 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21894 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21896 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21898 * namespace.cs: fixed bug #35489.
21900 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21902 * class.cs: Remove some dead code.
21904 * cs-parser.jay: Estimate the number of methods needed
21905 (RootContext.MethodCount);
21907 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21908 numbers instead of StringBuilders.
21910 * support.cs (PtrHashtable): Add constructor with initial size;
21911 We can now reduce reallocations of the method table.
21913 2002-12-10 Ravi Pratap <ravi@ximian.com>
21915 * attribute.cs (ApplyAttributes): Keep track of the emitted
21916 attributes on a per-target basis. This fixes bug #35413.
21918 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21920 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21921 default to the Windows 1252 encoding.
21923 (UnixParseOption): Support version, thanks to Alp for the missing
21926 * AssemblyInfo.cs: Add nice assembly information.
21928 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21931 * cs-parser.jay: Allow a trailing comma before the close bracked
21932 in the attribute_section production.
21934 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21935 address of the instance was being taken, I will take this out,
21936 because we take the address of the object immediately here.
21938 2002-12-09 Ravi Pratap <ravi@ximian.com>
21940 * typemanager.cs (AreMultipleAllowed): Take care of the most
21941 obvious case where attribute type is not in the current assembly -
21944 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21946 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21947 definitions, instead of doing that afterwards.
21949 Also we use a nice little hack, depending on the constructor, we
21950 know if we are a "composed" name or a simple name. Hence, we
21951 avoid the IndexOf test, and we avoid
21953 * codegen.cs: Add code to assist in a bug reporter to track down
21954 the source of a compiler crash.
21956 2002-12-07 Ravi Pratap <ravi@ximian.com>
21958 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21959 types have been emitted for a given element and flag an error
21960 if something which does not have AllowMultiple set is used more
21963 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21964 attribute types and their corresponding AllowMultiple properties
21966 (AreMultipleAllowed): Check the property for a given type.
21968 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21969 property in the case we have a TypeContainer.
21971 (Attributes.AddAttribute): Detect duplicates and just skip on
21972 adding them. This trivial fix catches a pretty gross error in our
21973 attribute emission - global attributes were being emitted twice!
21975 Bugzilla bug #33187 is now fixed.
21977 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21979 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21980 instead of pp_and).
21982 * expression.cs (Binary.ResolveOperator): I can only use the
21983 Concat (string, string, string) and Concat (string, string,
21984 string, string) if the child is actually a concatenation of
21987 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21989 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21990 context where we need a 2-character lookahead.
21992 * pending.cs (PendingImplementation): Rework so we can keep track
21993 of interface types all the time, and flag those which were
21994 implemented by parents as optional.
21996 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21998 * expression.cs (Binary.ResolveOperator): Use
21999 String.Concat(string,string,string) or
22000 String.Concat(string,string,string,string) when possible.
22002 * typemanager: More helper methods.
22005 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
22007 * pending.cs: remove the bogus return from GetMissingInterfaces()
22008 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
22010 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22012 * namespace.cs: avoid duplicated 'using xxx' being added to
22013 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
22014 when we get more than one 'using' statement for the same namespace.
22015 Report a CS0105 warning for it.
22017 2002-11-30 Miguel de Icaza <miguel@ximian.com>
22019 * cs-tokenizer.cs (consume_identifier): use read directly, instead
22020 of calling getChar/putback, uses internal knowledge of it.
22022 (xtoken): Reorder tokenizer so most common patterns are checked
22023 first. This reduces the compilation time in another 5% (from 8.11s
22024 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
22026 The parsing time is 22% of the compilation in mcs, and from that
22027 64% is spent on the tokenization process.
22029 I tried using a binary search for keywords, but this is slower
22030 than the hashtable. Another option would be to do a couple of
22033 * Not use a StringBuilder, instead use an array of chars,
22034 with a set value. Notice that this way we could catch
22035 the 645 error without having to do it *afterwards*.
22037 * We could write a hand-parser to avoid the hashtable
22038 compares altogether.
22040 The identifier consumption process takes 37% of the tokenization
22041 time. Another 15% is spent on is_number. 56% of the time spent
22042 on is_number is spent on Int64.Parse:
22044 * We could probably choose based on the string length to
22045 use Int32.Parse or Int64.Parse and avoid all the 64-bit
22048 Another 3% is spend on wrapping `xtoken' in the `token' function.
22050 Handle 0xa0 as whitespace (#34752)
22052 2002-11-26 Miguel de Icaza <miguel@ximian.com>
22054 * typemanager.cs (IsCLRType): New routine to tell whether a type
22055 is one of the builtin types.
22057 Maybe it needs to use TypeCodes to be faster. Maybe we could use
22058 typecode in more places instead of doing pointer comparissions.
22059 We could leverage some knowledge about the way the typecodes are
22062 New code to cache namespaces in assemblies, it is currently not
22063 invoked, to be used soon.
22065 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
22067 * expression.cs (Binary.ResolveOperator): specially handle
22068 strings, and do not perform user-defined operator overloading for
22071 2002-11-24 Miguel de Icaza <miguel@ximian.com>
22073 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
22074 internalcall as it is a pretty simple operation; Avoid whenever
22075 possible to call Char.IsLetter.
22077 (consume_identifier): Cut by half the number of
22078 hashtable calls by merging the is_keyword and GetKeyword behavior.
22080 Do not short-circuit, because if we do, we
22081 report errors (ie, #if false && true would produce an invalid
22085 2002-11-24 Martin Baulig <martin@ximian.com>
22087 * expression.cs (Cast.TryReduce): If we're in checked syntax,
22088 check constant ranges and report a CS0221. Fixes #33186.
22090 2002-11-24 Martin Baulig <martin@ximian.com>
22092 * cs-parser.jay: Make this work for uninitialized variable
22093 declarations in the `for' initializer. Fixes #32416.
22095 2002-11-24 Martin Baulig <martin@ximian.com>
22097 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22098 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
22100 2002-11-24 Martin Baulig <martin@ximian.com>
22102 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22103 argument; if true, we also check for user-defined conversions.
22104 This is only needed if both arguments are of a user-defined type.
22105 Fixes #30443, added test-175.cs.
22106 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22108 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22110 2002-11-24 Martin Baulig <martin@ximian.com>
22112 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22113 function to get the store opcode.
22114 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22115 only emit the Ldelema if the store opcode is Stobj. You must run
22116 both test-34 and test-167 to test this. Fixes #34529.
22118 2002-11-23 Martin Baulig <martin@ximian.com>
22120 * ecore.cs (Expression.MemberLookup): Added additional
22121 `qualifier_type' argument which is used when we're being called
22122 from MemberAccess.DoResolve() and null if we're called from a
22124 (Expression.MemberLookupFailed): New method to report errors; this
22125 does the CS1540 check and reports the correct error message.
22127 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22128 argument for the CS1540 check and redone the way how we're dealing
22129 with private members. See the comment in the source code for details.
22130 (FilterWithClosure): Reverted this back to revision 1.197; renamed
22131 `closure_start_type' to `closure_qualifier_type' and check whether
22132 it's not null. It was not this filter being broken, it was just
22133 being called with the wrong arguments.
22135 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22136 and pass it the correct `qualifier_type'; this also does the error
22139 2002-11-22 Miguel de Icaza <miguel@ximian.com>
22141 * expression.cs (Invocation.EmitParams): If the we are dealing
22142 with a non-built-in value type, load its address as well.
22144 (ArrayCreation): Use a a pretty constant instead
22145 of the hardcoded value 2. Use 6 instead of 2 for the number of
22146 static initializers.
22148 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22149 because they are not really value types, just glorified integers.
22151 * driver.cs: Do not append .exe, the CSC compiler does not do it.
22153 * ecore.cs: Remove redundant code for enumerations, make them use
22154 the same code path as everything else, fixes the casting issue
22155 with enumerations in Windows.Forms.
22157 * attribute.cs: Do only cast to string if it is a string, the
22158 validation happens later.
22160 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22161 people upgrade their corlibs.
22163 * ecore.cs: Oops, enumerations were not following the entire code path
22165 2002-11-21 Miguel de Icaza <miguel@ximian.com>
22167 * typemanager.cs (FilterWithClosure): Commented out the test for
22168 1540 in typemanager.cs, as it has problems when accessing
22169 protected methods from a parent class (see test-174.cs).
22171 * attribute.cs (Attribute.ValidateGuid): new method.
22172 (Attribute.Resolve): Use above.
22174 2002-11-19 Miguel de Icaza <miguel@ximian.com>
22176 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22178 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22179 handling for enumerations, as we only needed the TypeContainer
22180 functionality to begin with (this is required for the fix below to
22181 work for enums that reference constants in a container class for
22184 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22186 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22187 a valid TypeBuilder to perform lookups on.o
22189 * class.cs (InheritableMemberSignatureCompare): Use true in the
22190 call to GetGetMethod and GetSetMethod, because we are comparing
22191 the signature, and we need to get the methods *even* if they are
22194 (PropertyBase.CheckBase): ditto.
22196 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22197 GotoCase.Resolve): Use Peel on EmpytCasts.
22199 * ecore.cs (EmptyCast): drop child, add Peel method.
22201 2002-11-17 Martin Baulig <martin@ximian.com>
22203 * ecore.cs (EmptyCast.Child): New public property.
22205 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22206 label resolved to an EmptyCast. Fixes #34162.
22207 (GotoCase.Resolve): Likewise.
22208 (Block.EmitMeta): Likewise.
22210 2002-11-17 Martin Baulig <martin@ximian.com>
22212 * expression.cs (Invocation.BetterConversion): Prefer int over
22213 uint; short over ushort; long over ulong for integer literals.
22214 Use ImplicitConversionExists instead of StandardConversionExists
22215 since we also need to check for user-defined implicit conversions.
22216 Fixes #34165. Added test-173.cs.
22218 2002-11-16 Martin Baulig <martin@ximian.com>
22220 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22221 with the `true' and `false' literals. Fixes #33151.
22223 2002-11-16 Martin Baulig <martin@ximian.com>
22225 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22226 October 22nd; don't do the cs1540 check for static members.
22228 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22229 now using our own filter here and doing the cs1540 check again.
22231 2002-11-16 Martin Baulig <martin@ximian.com>
22233 * support.cs (InternalParameters): Don't crash if we don't have
22234 any fixed parameters. Fixes #33532.
22236 2002-11-16 Martin Baulig <martin@ximian.com>
22238 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22239 when looking up static methods to make this work on Windows.
22242 2002-11-16 Martin Baulig <martin@ximian.com>
22244 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22245 a setter rather than using PropertyInfo.CanWrite.
22247 2002-11-15 Nick Drochak <ndrochak@gol.com>
22249 * class.cs: Allow acces to block member by subclasses. Fixes build
22252 2002-11-14 Martin Baulig <martin@ximian.com>
22254 * class.cs (Constructor.Emit): Added the extern/block check.
22257 2002-11-14 Martin Baulig <martin@ximian.com>
22259 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22260 iteration while looking for indexers, this is needed because the
22261 indexer may have a different name in our base classes. Fixed the
22262 error reporting (no indexers at all, not get accessor, no
22263 overloaded match). Fixes bug #33089.
22264 (IndexerAccess.DoResolveLValue): Likewise.
22266 2002-11-14 Martin Baulig <martin@ximian.com>
22268 * class.cs (PropertyBase.CheckBase): Make this work for multiple
22269 indexers. Fixes the first part of bug #33089.
22270 (MethodSignature.InheritableMemberSignatureCompare): Added support
22273 2002-11-13 Ravi Pratap <ravi@ximian.com>
22275 * attribute.cs (Attribute.Resolve): Catch the
22276 NullReferenceException and report it since it isn't supposed to
22279 2002-11-12 Miguel de Icaza <miguel@ximian.com>
22281 * expression.cs (Binary.EmitBranchable): Also handle the cases for
22282 LogicalOr and LogicalAnd that can benefit from recursively
22283 handling EmitBranchable. The code now should be nice for Paolo.
22285 2002-11-08 Miguel de Icaza <miguel@ximian.com>
22287 * typemanager.cs (LookupType): Added a negative-hit hashtable for
22288 the Type lookups, as we perform quite a number of lookups on
22289 non-Types. This can be removed once we can deterministically tell
22290 whether we have a type or a namespace in advance.
22292 But this might require special hacks from our corlib.
22296 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22297 and double which avoids a conversion from an integer to a double.
22299 * expression.cs: tiny optimization, avoid calling IsConstant,
22300 because it effectively performs the lookup twice.
22302 2002-11-06 Miguel de Icaza <miguel@ximian.com>
22304 But a bogus return here to keep the semantics of the old code
22305 until the Mono runtime is fixed.
22307 * pending.cs (GetMissingInterfaces): New method used to remove all
22308 the interfaces that are already implemented by our parent
22309 classes from the list of pending methods.
22311 * interface.cs: Add checks for calls after ResolveTypeExpr.
22313 2002-11-05 Miguel de Icaza <miguel@ximian.com>
22315 * class.cs (Class.Emit): Report warning 67: event not used if the
22316 warning level is beyond 3.
22318 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22319 being a NullLiteral.
22321 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22324 * class.cs (TypeContainer.GetClassBases): Cover a missing code
22325 path that might fail if a type can not be resolved.
22327 * expression.cs (Binary.Emit): Emit unsigned versions of the
22330 * driver.cs: use error 5.
22332 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22334 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22336 2002-11-01 Miguel de Icaza <miguel@ximian.com>
22338 * cs-parser.jay (switch_section): A beautiful patch from Martin
22339 Baulig that fixed 33094.
22341 2002-10-31 Miguel de Icaza <miguel@ximian.com>
22343 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22344 Check whether the base is abstract and report an error if so.
22346 * expression.cs (IndexerAccess.DoResolveLValue,
22347 IndexerAccess.DoResolve): ditto.
22349 (Invocation.DoResolve): ditto.
22351 (Invocation.FullMethodDesc): Improve the report string.
22353 * statement.cs (Block): Eliminate IsVariableDefined as it is
22354 basically just a wrapper for GetVariableInfo.
22356 * ecore.cs (SimpleName): Use new
22358 * support.cs (ReflectionParamter.ParameterType): We unwrap the
22359 type, as we return the actual parameter ref/unref state on a
22362 2002-10-30 Miguel de Icaza <miguel@ximian.com>
22364 * support.cs: Return proper flags REF/OUT fixing the previous
22367 * expression.cs: Reverted last patch, that was wrong. Is_ref is
22368 not used to mean `ref' but `ref or out' in ParameterReference
22370 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22371 full type signature instead of calling TypeManger.CSharpName
22374 * support.cs (InternalParameters.ParameterDesc): Do not compare
22375 directly to the modflags, because REF/OUT will actually be bitsets
22378 * delegate.cs (VerifyMethod): Check also the modifiers.
22380 * cs-tokenizer.cs: Fix bug where floating point values with an
22381 exponent where a sign was missing was ignored.
22383 * driver.cs: Allow multiple assemblies to be specified in a single
22386 2002-10-28 Miguel de Icaza <miguel@ximian.com>
22388 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
22389 because identifiers after a parenthesis would end up in this kind
22390 of production, and we needed to desamiguate it for having casts
22393 (UserDefinedType *) xxx
22395 2002-10-24 Miguel de Icaza <miguel@ximian.com>
22397 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22398 we should set on the Bindingflags.NonPublic, but not turn on
22399 private_ok. private_ok controls whether a Private member is
22400 returned (this is chekced on the filter routine), while the
22401 BindingFlags.NonPublic just controls whether private/protected
22402 will be allowed. This fixes the problem part of the problem of
22403 private properties being allowed to be used in derived classes.
22405 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22406 so we can call the children DoResolveLValue method (this will
22407 properly signal errors on lvalue assignments to base properties)
22409 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22410 getter are null, and we have a property info, we know that this
22411 happened because the lookup failed, so we report an error 122 for
22412 protection level violation.
22414 We also silently return if setter and getter are null in the
22415 resolve functions, this condition only happens if we have flagged
22416 the error before. This is the other half of the problem.
22418 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22419 not have accessibility information, that is why we were returning
22420 true in the filter function in typemanager.cs.
22422 To properly report 122 (property is inaccessible because of its
22423 protection level) correctly, we report this error in ResolveAccess
22424 by failing if both the setter and the getter are lacking (ie, the
22427 DoResolve and DoLResolve have been modified to check for both
22428 setter/getter being null and returning silently, the reason being
22429 that I did not want to put the knowledge about this error in upper
22432 int old = Report.Errors;
22433 x = new PropertyExpr (...);
22434 if (old != Report.Errors)
22439 So the property expr is returned, but it is invalid, so the error
22440 will be flagged during the resolve process.
22442 * class.cs: Remove InheritablePropertySignatureCompare from the
22443 class, as we no longer depend on the property signature to compute
22444 whether it is possible to implement a method or not.
22446 The reason is that calling PropertyInfo.GetGetMethod will return
22447 null (in .NET, in Mono it works, and we should change this), in
22448 cases where the Get Method does not exist in that particular
22453 class X { public virtual int A { get { return 1; } } }
22455 class Z : Y { public override int A { get { return 2; } } }
22457 Would fail in Z because the parent (Y) would not have the property
22458 defined. So we avoid this completely now (because the alternative
22459 fix was ugly and slow), and we now depend exclusively on the
22462 (PropertyBase.CheckBase): Use a method-base mechanism to find our
22463 reference method, instead of using the property.
22465 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22466 routines are gone now.
22468 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22469 names, they were incorrectly named.
22471 * cs-tokenizer.cs: Return are more gentle token on failure.
22473 * pending.cs (PendingImplementation.InterfaceMethod): This routine
22474 had an out-of-sync index variable, which caused it to remove from
22475 the list of pending methods the wrong method sometimes.
22477 2002-10-22 Miguel de Icaza <miguel@ximian.com>
22479 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22480 CanWrite, because those refer to this particular instance of the
22481 property, and do not take into account the fact that we can
22482 override single members of a property.
22484 Constructor requires an EmitContext. The resolution process does
22485 not happen here, but we need to compute the accessors before,
22486 because the resolution does not always happen for properties.
22488 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22489 subclass, before we did not update this flag, but we did update
22492 (GetAccessors): Drop this routine, as it did not work in the
22493 presence of partially overwritten set/get methods.
22495 Notice that this broke the cs1540 detection, but that will require
22498 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22502 * driver.cs: issue a warning instead of an error if we don't support
22503 debugging for the platform. Also ignore a couple of errors that may
22504 arise when trying to write the symbols. Undo my previous patch.
22506 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22508 * driver.cs: ignore /debug switch except for Unix platforms.
22510 2002-10-23 Nick Drochak <ndrochak@gol.com>
22512 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22514 2002-10-21 Miguel de Icaza <miguel@ximian.com>
22516 * driver.cs: Do not make mcs-debug conditional, so we do not break
22517 builds that use it.
22519 * statement.cs (UsageVector.MergeChildren): I would like Martin to
22520 review this patch. But basically after all the children variables
22521 have been merged, the value of "Breaks" was not being set to
22522 new_breaks for Switch blocks. I think that it should be set after
22523 it has executed. Currently I set this to the value of new_breaks,
22524 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22525 conservative, but I do not understand this code very well.
22527 I did not break anything in the build, so that is good ;-)
22529 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22531 2002-10-20 Mark Crichton <crichton@gimp.org>
22533 * cfold.cs: Fixed compile blocker. Really fixed it this time.
22535 2002-10-20 Nick Drochak <ndrochak@gol.com>
22537 * cfold.cs: Fixed compile blocker.
22539 2002-10-20 Miguel de Icaza <miguel@ximian.com>
22541 * driver.cs: I was chekcing the key, not the file.
22543 2002-10-19 Ravi Pratap <ravi@ximian.com>
22545 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22546 message that we were generating - we just need to silently return
22549 2002-10-19 Miguel de Icaza <miguel@ximian.com>
22551 * class.cs (Event.Define): Change my previous commit, as this
22552 breaks the debugger. This is a temporary hack, as it seems like
22553 the compiler is generating events incorrectly to begin with.
22555 * expression.cs (Binary.ResolveOperator): Added support for
22556 "U operator - (E x, E y)"
22558 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22561 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22562 init-only variables, but this path did not take into account that
22563 there might be also instance readonly variables. Correct this
22566 This fixes bug 32253
22568 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22571 * driver.cs: Change the extension for modules to `netmodule'
22573 * cs-parser.jay: Improved slightly the location tracking for
22574 the debugger symbols.
22576 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22577 modifiers that were specified instead of the hardcoded value
22578 (FamAndAssem). This was basically ignoring the static modifier,
22579 and others. Fixes 32429.
22581 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22582 fixed a bug in the process (32476)
22584 * expression.cs (ArrayAccess.EmitAssign): Patch from
22585 hwang_rob@yahoo.ca that fixes bug 31834.3
22587 2002-10-18 Miguel de Icaza <miguel@ximian.com>
22589 * driver.cs: Make the module extension .netmodule.
22591 2002-10-16 Miguel de Icaza <miguel@ximian.com>
22593 * driver.cs: Report an error if the resource file is not found
22594 instead of crashing.
22596 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22597 false, like Emit does.
22599 2002-10-16 Nick Drochak <ndrochak@gol.com>
22601 * typemanager.cs: Remove unused private member. Also reported mcs
22602 bug to report this as a warning like csc.
22604 2002-10-15 Martin Baulig <martin@gnome.org>
22606 * statement.cs (Statement.Emit): Made this a virtual method; emits
22607 the line number info and calls DoEmit().
22608 (Statement.DoEmit): New protected abstract method, formerly knows
22609 as Statement.Emit().
22611 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22613 2002-10-11 Miguel de Icaza <miguel@ximian.com>
22615 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22616 have fixed a remaining problem: not every AddXXXX was adding a
22617 fully qualified name.
22619 Now everyone registers a fully qualified name in the DeclSpace as
22620 being defined instead of the partial name.
22622 Downsides: we are slower than we need to be due to the excess
22623 copies and the names being registered this way.
22625 The reason for this is that we currently depend (on the corlib
22626 bootstrap for instance) that types are fully qualified, because
22627 we dump all the types in the namespace, and we should really have
22628 types inserted into the proper namespace, so we can only store the
22629 basenames in the defined_names array.
22631 2002-10-10 Martin Baulig <martin@gnome.org>
22633 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22634 from bug #31834, see the bug report for a testcase which is
22637 2002-10-10 Martin Baulig <martin@gnome.org>
22639 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22640 flow analysis code for this.
22642 * statement.cs (Do, While, For): Tell the flow analysis code about
22644 (FlowBranching.UsageVector): Added support for infinite loops.
22645 (Block.Resolve): Moved the dead code elimination here and use flow
22648 2002-10-09 Miguel de Icaza <miguel@ximian.com>
22650 * class.cs (Field.Define): Catch cycles on struct type
22653 * typemanager.cs (IsUnmanagedtype): Do not recursively check
22654 fields if the fields are static. We only need to check instance
22657 * expression.cs (As.DoResolve): Test for reference type.
22659 * statement.cs (Using.ResolveExpression): Use
22660 ConvertImplicitRequired, not ConvertImplicit which reports an
22662 (Using.ResolveLocalVariableDecls): ditto.
22664 * expression.cs (Binary.ResolveOperator): Report errors in a few
22665 places where we had to.
22667 * typemanager.cs (IsUnmanagedtype): Finish implementation.
22669 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22671 * expression.cs: Use StoreFromPtr instead of extracting the type
22672 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22674 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22675 an enumeration value to a System.Enum, but System.Enum is not a
22676 value type, but an class type, so we need to box.
22678 (Expression.ConvertExplicit): One codepath could return
22679 errors but not flag them. Fix this. Fixes #31853
22681 * parameter.cs (Resolve): Do not allow void as a parameter type.
22683 2002-10-06 Martin Baulig <martin@gnome.org>
22685 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22686 if it's a class type and not a struct. Fixes #31815.
22688 2002-10-06 Martin Baulig <martin@gnome.org>
22690 * statement.cs: Reworked the flow analysis code a bit to make it
22691 usable for dead code elimination.
22693 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22695 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22697 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22699 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22700 to fix the test 165, will investigate deeper.
22702 2002-10-04 Martin Baulig <martin@gnome.org>
22704 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22705 finally blocks actually work.
22706 (Try.Resolve): We don't need to create a sibling for `finally' if
22707 there is no finally block.
22709 2002-10-04 Martin Baulig <martin@gnome.org>
22711 * class.cs (Constructor.Define): The default accessibility for a
22712 non-default constructor is private, not public.
22714 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22716 * class.cs (Constructor): Make AllowedModifiers public, add
22719 * cs-parser.jay: Perform the modifiers test here, as the
22720 constructor for the Constructor class usually receives a zero
22721 because of the way we create it (first we create, later we
22722 customize, and we were never checking the modifiers).
22724 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22725 is a version of LookupTypeReflection that includes the type-name
22726 cache. This can be used as a fast path for functions that know
22727 the fully qualified name and are only calling into *.GetType() to
22728 obtain a composed type.
22730 This is also used by TypeManager.LookupType during its type
22733 (LookupType): We now also track the real type name, as sometimes
22734 we can get a quey for the real type name from things like
22735 ComposedCast. This fixes bug 31422.
22737 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22738 complete type fullname, it does not have to go through the type
22739 resolution system to obtain the composed version of the type (for
22740 obtaining arrays or pointers).
22742 (Conditional.Emit): Use the EmitBoolExpression to
22743 generate nicer code, as requested by Paolo.
22745 (ArrayCreation.CheckIndices): Use the patch from
22746 hwang_rob@yahoo.ca to validate the array initializers.
22748 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22750 * class.cs (ConstructorInitializer.Emit): simplify code by using
22751 Invocation.EmitCall, and at the same time, fix the bugs in calling
22752 parent constructors that took variable arguments.
22754 * ecore.cs (Expression.ConvertNumericExplicit,
22755 Expression.ImplicitNumericConversion): Remove the code that
22756 manually wrapped decimal (InternalTypeConstructor call is now gone
22759 * expression.cs (Cast.TryReduce): Also handle decimal types when
22760 trying to perform a constant fold on the type.
22762 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22764 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22765 that only turned off an error report, and did nothing else.
22767 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22769 * driver.cs: Handle and ignore /fullpaths
22771 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22773 * expression.cs (Binary.ResolveOperator): Catch the case where
22774 DoNumericPromotions returns true,
22776 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22778 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22780 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22783 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22785 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22786 conversion exists, but it is also required that the conversion be
22787 performed. This manifested in "(Type64Enum) 2".
22789 * class.cs (TypeManager.AddMethod): The fix is not to change
22790 AddEnum, because that one was using a fully qualified name (every
22791 DeclSpace derivative does), but to change the AddMethod routine
22792 that was using an un-namespaced name. This now correctly reports
22793 the duplicated name.
22795 Revert patch until I can properly fix it. The issue
22796 is that we have a shared Type space across all namespaces
22797 currently, which is wrong.
22799 Options include making the Namespace a DeclSpace, and merge
22800 current_namespace/current_container in the parser.
22802 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22804 * cs-parser.jay: Improve error reporting when we get a different
22805 kind of expression in local_variable_type and
22806 local_variable_pointer_type.
22808 Propagate this to avoid missleading errors being reported.
22810 * ecore.cs (ImplicitReferenceConversion): treat
22811 TypeManager.value_type as a target just like object_type. As
22816 Is valid, and needs to result in the int 1 being boxed before it
22817 is assigned to the value type v.
22819 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22820 to validate the enumeration name.
22822 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22823 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22824 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22826 * ecore.cs (TryImplicitIntConversion): When doing an
22827 implicit-enumeration-conversion, check if the type is 64-bits and
22828 perform a conversion before passing to EnumConstant.
22830 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22832 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22833 report ambiguous type references. Unlike the MS version, we
22834 report what the ambiguity is. Innovation at work ;-)
22836 (DeclSpace.FindType): Require a location argument to
22837 display when we display an ambiguous error.
22839 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22841 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22843 * expression.cs (EmitDynamicInitializers): Apply patch from
22844 hwang_rob@yahoo.ca that fixes the order in which we emit our
22847 2002-09-21 Martin Baulig <martin@gnome.org>
22849 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22850 delegate takes no arguments.
22852 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22854 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22857 * expression.cs: Extract the underlying type.
22859 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22861 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22863 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22865 * class.cs (TypeContainer.DefineType): We can not use the nice
22866 PackingSize with the size set to 1 DefineType method, because it
22867 will not allow us to define the interfaces that the struct
22870 This completes the fixing of bug 27287
22872 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22873 means also structs. This fixes part of the problem.
22874 (Expresion.ImplicitReferenceConversionExists): ditto.
22876 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22877 error if there were no errors reported during the type lookup
22878 process, to avoid duplicates or redundant errors. Without this
22879 you would get an ambiguous errors plus a type not found. We have
22880 beaten the user enough with the first error.
22882 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22885 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22886 during the resolution process, stop the lookup, this avoids
22887 repeated error reports (same error twice).
22889 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22891 * typemanager.cs (LookupType): Redo the type lookup code to match
22892 the needs of System.Reflection.
22894 The issue is that System.Reflection requires references to nested
22895 types to begin with a "+" sign instead of a dot. So toplevel
22896 types look like: "NameSpace.TopLevelClass", and nested ones look
22897 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22900 2002-09-19 Martin Baulig <martin@gnome.org>
22902 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22903 says that a method always returns or always throws an exception,
22904 don't report the CS0161.
22906 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22907 set `Returns = new_returns'.
22909 2002-09-19 Martin Baulig <martin@gnome.org>
22911 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22912 to an enum constant, check for a CS0176.
22914 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22916 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22917 for operators that must be in pairs and report errors.
22919 * ecore.cs (SimpleName.DoResolveType): During the initial type
22920 resolution process, when we define types recursively, we must
22921 check first for types in our current scope before we perform
22922 lookups in the enclosing scopes.
22924 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22926 (Invocation.VerifyArgumentsCompat): Call
22927 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22928 I thought we were supposed to always call this, but there are a
22929 few places in the code where we dont do it.
22931 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22933 * driver.cs: Add support in -linkres and -resource to specify the
22934 name of the identifier.
22936 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22938 * ecore.cs (StandardConversionExists): Sync with the conversion
22939 code: allow anything-* to void* conversions.
22941 (FindMostSpecificSource): Use an Expression argument
22942 instead of a Type, because we might be handed over a Literal which
22943 gets a few more implicit conversions that plain types do not. So
22944 this information was being lost.
22946 Also, we drop the temporary type-holder expression when not
22949 2002-09-17 Martin Baulig <martin@gnome.org>
22951 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22952 this is an explicit interface implementation.
22954 2002-09-17 Martin Baulig <martin@gnome.org>
22956 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22957 different `IndexerName' attributes.
22959 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22960 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22961 virtual CommonResolve().
22963 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22965 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22966 and convert that to the UnderlyingType.
22968 * statement.cs (Foreach.Resolve): Indexers are just like variables
22969 or PropertyAccesses.
22971 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22972 inside quoted strings, we were not doing this before.
22974 2002-09-16 Martin Baulig <martin@gnome.org>
22976 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22977 resolve it. This is needed for the definite assignment check of the
22978 instance expression, fixes bug #29846.
22979 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22981 2002-09-16 Nick Drochak <ndrochak@gol.com>
22983 * parameter.cs: Fix compile error. Cannot reference static member
22984 from an instance object. Is this an mcs bug?
22986 2002-09-14 Martin Baulig <martin@gnome.org>
22988 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22989 multiple times. Fixes bug #30295, added test-166.cs.
22991 2002-09-14 Martin Baulig <martin@gnome.org>
22993 * statement.cs (Block.Emit): Don't emit unreachable code.
22994 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22995 `break' statements.
22996 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22998 2002-09-14 Martin Baulig <martin@gnome.org>
23000 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
23003 2002-09-14 Martin Baulig <martin@gnome.org>
23005 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
23006 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
23007 be false on the ms runtime.
23009 2002-09-13 Martin Baulig <martin@gnome.org>
23011 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
23012 the CS0038 error message.
23014 2002-09-12 Miguel de Icaza <miguel@ximian.com>
23016 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
23017 constant inside, return it.
23019 2002-09-12 Martin Baulig <martin@gnome.org>
23021 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
23022 implicit conversion can be done between enum types.
23024 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
23025 check whether an implicit conversion to the current enum's UnderlyingType
23026 exists and report an error if not.
23028 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
23029 without debugging support.
23031 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
23032 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
23034 2002-09-12 Martin Baulig <martin@gnome.org>
23036 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
23038 * ecore.cs (IMemberExpr.DeclaringType): New property.
23039 (SimpleName.SimpleNameResolve): Check whether we're accessing a
23040 nonstatic member of an outer type (CS0038).
23042 2002-09-11 Miguel de Icaza <miguel@ximian.com>
23044 * driver.cs: Activate the using-error detector at warning level
23045 4 (at least for MS-compatible APIs).
23047 * namespace.cs (VerifyUsing): Small buglett fix.
23049 * pending.cs (PendingImplementation): pass the container pointer.
23051 * interface.cs (GetMethods): Allow for recursive definition. Long
23052 term, I would like to move every type to support recursive
23053 definitions, not the current ordering mechanism that we have right
23056 The situation is this: Attributes are handled before interfaces,
23057 so we can apply attributes to interfaces. But some attributes
23058 implement interfaces, we will now handle the simple cases
23059 (recursive definitions will just get an error).
23061 * parameter.cs: Only invalidate types at the end if we fail to
23064 2002-09-09 Martin Baulig <martin@gnome.org>
23066 * ecore.cs (PropertyExpr.Emit): Also check for
23067 TypeManager.system_int_array_get_length so this'll also work when
23068 compiling corlib. Fixes #30003.
23070 2002-09-09 Martin Baulig <martin@gnome.org>
23072 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
23073 and throw an exception if we can't get the type's size. Fixed #30040,
23076 2002-09-09 Martin Baulig <martin@gnome.org>
23078 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
23080 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
23081 context. Fixes bug #30027.
23083 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
23084 virtual functions. Fixes bug #30043, added test-164.cs.
23086 2002-09-08 Ravi Pratap <ravi@ximian.com>
23088 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
23090 2002-09-08 Nick Drochak <ndrochak@gol.com>
23092 * driver.cs: Use an object to get the windows codepage since it's not a
23095 2002-09-08 Miguel de Icaza <miguel@ximian.com>
23097 * statement.cs (For.Emit): for infinite loops (test == null)
23098 return whether there is a break inside, not always "true".
23100 * namespace.cs (UsingEntry): New struct to hold the name of the
23101 using definition, the location where it is defined, and whether it
23102 has been used in a successful type lookup.
23104 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23109 2002-09-06 Ravi Pratap <ravi@ximian.com>
23111 * attribute.cs : Fix incorrect code which relied on catching
23112 a NullReferenceException to detect a null being passed in
23113 where an object was expected.
23115 2002-09-06 Miguel de Icaza <miguel@ximian.com>
23117 * statement.cs (Try): flag the catch variable as assigned
23119 * expression.cs (Cast): Simplified by using ResolveType instead of
23120 manually resolving.
23122 * statement.cs (Catch): Fix bug by using ResolveType.
23124 2002-09-06 Ravi Pratap <ravi@ximian.com>
23126 * expression.cs (BetterConversion): Special case for when we have
23127 a NullLiteral as the argument and we have to choose between string
23128 and object types - we choose string the way csc does.
23130 * attribute.cs (Attribute.Resolve): Catch the
23131 NullReferenceException and report error #182 since the Mono
23132 runtime no more has the bug and having this exception raised means
23133 we tried to select a constructor which takes an object and is
23136 2002-09-05 Ravi Pratap <ravi@ximian.com>
23138 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23139 message (1502, 1503) when we can't locate a method after overload
23140 resolution. This is much more informative and closes the bug
23143 * interface.cs (PopulateMethod): Return if there are no argument
23144 types. Fixes a NullReferenceException bug.
23146 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23147 expressions too. Previously we were checking only in one place for
23148 positional arguments leaving out named arguments.
23150 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23151 type to the enum type is not allowed. Remove code corresponding to
23154 (ConvertNumericExplicit): Allow explicit conversions from
23155 the underlying type to enum type. This precisely follows the spec
23156 and closes a bug filed by Gonzalo.
23158 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23161 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23163 2002-09-03 Miguel de Icaza <miguel@ximian.com>
23165 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23166 it was important that we stored the right value after the
23167 reduction in `converted'.
23169 2002-09-04 Martin Baulig <martin@gnome.org>
23171 * location.cs (Location.SymbolDocument): Use full pathnames for the
23174 2002-08-30 Miguel de Icaza <miguel@ximian.com>
23176 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23177 of the expression resolve mechanism, because that will catch the
23178 SimpleName error failures.
23180 (Conditional): If we can not resolve the
23181 expression, return, do not crash.
23183 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23186 (location): display token name instead of its number.
23188 2002-08-28 Martin Baulig <martin@gnome.org>
23190 * expression.cs (Binary.ResolveOperator): Don't silently return
23191 but return an error if an operator cannot be applied between two
23194 2002-08-28 Martin Baulig <martin@gnome.org>
23196 * class.cs (Constructor.Define): Set the permission attributes
23197 correctly instead of making all constructors public.
23199 2002-08-28 Martin Baulig <martin@gnome.org>
23201 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23202 for private members before reporting a CS0103; if we find anything,
23205 2002-08-28 Martin Baulig <martin@gnome.org>
23207 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23208 to check whether `closure_start_type == closure_invocation_type',
23209 we also need to check whether `m.DeclaringType == closure_invocation_type'
23210 before bypassing the permission checks. We might be accessing
23211 protected/private members from the base class.
23212 (TypeManager.RealMemberLookup): Only set private_ok if private
23213 members were requested via BindingFlags.NonPublic.
23215 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23217 * expression.cs (MemberAccess.ResolveMemberAccess): Set
23218 MethodGroupExpr.IsExplicitImpl if appropriate.
23219 (Invocation.DoResolve): Don't report the CS0120 for explicit
23220 interface implementations.
23222 2002-08-27 Martin Baulig <martin@gnome.org>
23224 * expression.cs (Invocation.DoResolve): If this is a static
23225 method and we don't have an InstanceExpression, we must report
23228 2002-08-25 Martin Baulig <martin@gnome.org>
23230 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23231 `==' between a valuetype and an object.
23233 2002-08-25 Miguel de Icaza <miguel@ximian.com>
23235 * ecore.cs (TypeExpr): Provide a ToString method.
23237 2002-08-24 Martin Baulig <martin@gnome.org>
23239 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23240 now called proggie.dbg and it's a binary file.
23242 2002-08-23 Martin Baulig <martin@gnome.org>
23244 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23246 2002-08-23 Martin Baulig <martin@gnome.org>
23248 * struct.cs (MyStructInfo.ctor): Make this work with empty
23249 structs; it's not allowed to use foreach() on null.
23251 2002-08-23 Martin Baulig <martin@gnome.org>
23253 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23254 writer the full pathname of the generated assembly.
23256 2002-08-23 Martin Baulig <martin@gnome.org>
23258 * statements.cs (FlowBranching.UsageVector.MergeChildren):
23259 A `finally' block never returns or breaks; improved handling of
23262 2002-08-23 Martin Baulig <martin@gnome.org>
23264 * statement.cs (Throw.Resolve): Allow `throw null'.
23266 2002-08-23 Martin Baulig <martin@gnome.org>
23268 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23269 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23270 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
23271 MemberLookup would return a wrong event if this is an explicit
23272 interface implementation and the class has an event with the same
23275 2002-08-23 Martin Baulig <martin@gnome.org>
23277 * statement.cs (Block.AddChildVariableNames): New public method.
23278 (Block.AddChildVariableName): Likewise.
23279 (Block.IsVariableNameUsedInChildBlock): Likewise.
23280 (Block.AddVariable): Check whether a variable name has already
23281 been used in a child block.
23283 * cs-parser.jay (declare_local_variables): Mark all variable names
23284 from the current block as being used in a child block in the
23287 2002-08-23 Martin Baulig <martin@gnome.org>
23289 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23290 find the symbol writer.
23292 * driver.cs: csc also allows the arguments to /define being
23293 separated by commas, not only by semicolons.
23295 2002-08-23 Martin Baulig <martin@gnome.org>
23297 * interface.cs (Interface.GetMembers): Added static check for events.
23299 2002-08-15 Martin Baulig <martin@gnome.org>
23301 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23302 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23304 * ecore.cs (Expression.MemberLookup): Added documentation and explained
23305 why the MethodData.EmitDestructor() change was necessary.
23307 2002-08-20 Martin Baulig <martin@gnome.org>
23309 * class.cs (TypeContainer.FindMembers): Added static check for events.
23311 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23313 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23314 use Type.GetEvents(), not Type.FindMembers().
23316 2002-08-20 Martin Baulig <martin@gnome.org>
23318 * decl.cs (MemberCache): Added a special method cache which will
23319 be used for method-only searched. This ensures that a method
23320 search will return a MethodInfo with the correct ReflectedType for
23323 2002-08-20 Martin Baulig <martin@gnome.org>
23325 * decl.cs (DeclSpace.FindMembers): Made this public.
23327 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23329 * delegate.cs: fixed build on windows.
23330 [FIXME: Filed as bug #29150: MCS must report these errors.]
23332 2002-08-19 Ravi Pratap <ravi@ximian.com>
23334 * ecore.cs (StandardConversionExists): Return a false
23335 if we are trying to convert the void type to anything else
23336 since that is not allowed.
23338 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23339 we flag error 70 in the event an event is trying to be accessed
23340 directly from outside the declaring type.
23342 2002-08-20 Martin Baulig <martin@gnome.org>
23344 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23345 MemberCache from typemanager.cs to decl.cs.
23347 2002-08-19 Martin Baulig <martin@gnome.org>
23349 * class.cs (TypeContainer): Implement IMemberContainer.
23350 (TypeContainer.DefineMembers): Create the MemberCache.
23351 (TypeContainer.FindMembers): Do better BindingFlags checking; only
23352 return public members if BindingFlags.Public was given, check
23353 whether members are static.
23355 2002-08-16 Martin Baulig <martin@gnome.org>
23357 * decl.cs (DeclSpace.Define): Splitted this in Define and
23358 DefineMembers. DefineMembers is called first and initializes the
23361 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
23362 DefineMembers() on all our DeclSpaces.
23364 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23365 but call DefineMembers() on all nested interfaces. We call their
23366 Define() in our new Define() function.
23368 * interface.cs (Interface): Implement IMemberContainer.
23369 (Interface.Define): Moved all code except the attribute stuf to
23371 (Interface.DefineMembers): Initialize the member cache.
23373 * typemanager.cs (IMemberFinder): Removed this interface, we don't
23374 need this anymore since we can use MemberCache.FindMembers directly.
23376 2002-08-19 Martin Baulig <martin@gnome.org>
23378 * typemanager.cs (MemberCache): When creating the cache for an
23379 interface type, add all inherited members.
23380 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23381 to `out bool used_cache' and documented it.
23382 (TypeManager.MemberLookup): If we already used the cache in the first
23383 iteration, we don't need to do the interfaces check.
23385 2002-08-19 Martin Baulig <martin@gnome.org>
23387 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
23388 here from IMemberFinder and don't implement this interface anymore.
23389 (DeclSpace.MemberCache): Moved here from IMemberFinder.
23391 * typemanager.cs (IMemberFinder): This interface is now only used by
23392 classes which actually support the member cache.
23393 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23394 since we only put DeclSpaces into this Hashtable.
23395 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23396 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23398 2002-08-16 Martin Baulig <martin@gnome.org>
23400 * typemanager.cs (ICachingMemberFinder): Removed.
23401 (IMemberFinder.MemberCache): New property.
23402 (TypeManager.FindMembers): Merged this with RealFindMembers().
23403 This function will never be called from TypeManager.MemberLookup()
23404 so we can't use the cache here, just the IMemberFinder.
23405 (TypeManager.MemberLookup_FindMembers): Check whether the
23406 IMemberFinder has a MemberCache and call the cache's FindMembers
23408 (MemberCache): Rewrote larger parts of this yet another time and
23409 cleaned it up a bit.
23411 2002-08-15 Miguel de Icaza <miguel@ximian.com>
23413 * driver.cs (LoadArgs): Support quoting.
23415 (Usage): Show the CSC-like command line arguments.
23417 Improved a few error messages.
23419 2002-08-15 Martin Baulig <martin@gnome.org>
23421 * typemanager.cs (IMemberContainer.Type): New property.
23422 (IMemberContainer.IsInterface): New property.
23424 The following changes are conditional to BROKEN_RUNTIME, which is
23425 defined at the top of the file.
23427 * typemanager.cs (MemberCache.MemberCache): Don't add the base
23428 class'es members, but add all members from TypeHandle.ObjectType
23429 if we're an interface.
23430 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23431 is the current type.
23432 (MemberCache.CacheEntry.Container): Removed this field.
23433 (TypeHandle.GetMembers): Include inherited members.
23435 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23437 * typemanager.cs: fixed compilation and added a comment on a field that
23440 2002-08-15 Martin Baulig <martin@gnome.org>
23442 * class.cs (ConstructorInitializer.Resolve): In the
23443 Expression.MemberLookup call, use the queried_type as
23446 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23447 declared' attribute, it's always true.
23448 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23449 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23450 temporary wrapper for FindMembers which tells MemberLookup whether
23451 members from the base classes are included in the return value.
23452 This will go away soon.
23453 (TypeManager.MemberLookup): Use this temporary hack here; once the
23454 new MemberCache is completed, we don't need to do the DeclaredOnly
23455 looping here anymore since the MemberCache will take care of this.
23456 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23457 (MemberCache): When creating the MemberCache for a class, get
23458 members from the current class and all its base classes.
23459 (MemberCache.CacheEntry.Container): New field. This is a
23460 temporary hack until the Mono runtime is fixed to distinguish
23461 between ReflectedType and DeclaringType. It allows us to use MCS
23462 with both the MS runtime and the unfixed Mono runtime without
23463 problems and without accecting performance.
23464 (MemberCache.SearchMembers): The DeclaredOnly looping from
23465 TypeManager.MemberLookup is now done here.
23467 2002-08-14 Martin Baulig <martin@gnome.org>
23469 * statement.cs (MyStructInfo.MyStructInfo): Don't call
23470 Type.GetFields on dynamic types but get the fields from the
23471 corresponding TypeContainer.
23472 (MyStructInfo.GetStructInfo): Added check for enum types.
23474 * typemanager.cs (MemberList.IsSynchronized): Implemented.
23475 (MemberList.SyncRoot): Implemented.
23476 (TypeManager.FilterWithClosure): No need to check permissions if
23477 closure_start_type == closure_invocation_type, don't crash if
23478 closure_invocation_type is null.
23480 2002-08-13 Martin Baulig <martin@gnome.org>
23482 Rewrote TypeContainer.FindMembers to use a member cache. This
23483 gives us a speed increase of about 35% for the self-hosting MCS
23484 build and of about 15-20% for the class libs (both on GNU/Linux).
23486 * report.cs (Timer): New class to get enhanced profiling. This
23487 whole class is "TIMER" conditional since it remarkably slows down
23490 * class.cs (MemberList): New class. This is an IList wrapper
23491 which we're now using instead of passing MemberInfo[]'s around to
23492 avoid copying this array unnecessarily.
23493 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23494 (ICachingMemberFinder, IMemberContainer): New interface.
23495 (TypeManager.FilterWithClosure): If `criteria' is null, the name
23496 has already been checked, otherwise use it for the name comparision.
23497 (TypeManager.FindMembers): Renamed to RealMemberFinder and
23498 provided wrapper which tries to use ICachingMemberFinder.FindMembers
23499 if possible. Returns a MemberList, not a MemberInfo [].
23500 (TypeHandle): New class, implements IMemberContainer. We create
23501 one instance of this class per type, it contains a MemberCache
23502 which is used to do the member lookups.
23503 (MemberCache): New class. Each instance of this class contains
23504 all members of a type and a name-based hash table.
23505 (MemberCache.FindMembers): This is our new member lookup
23506 function. First, it looks up all members of the requested name in
23507 the hash table. Then, it walks this list and sorts out all
23508 applicable members and returns them.
23510 2002-08-13 Martin Baulig <martin@gnome.org>
23512 In addition to a nice code cleanup, this gives us a performance
23513 increase of about 1.4% on GNU/Linux - not much, but it's already
23514 half a second for the self-hosting MCS compilation.
23516 * typemanager.cs (IMemberFinder): New interface. It is used by
23517 TypeManager.FindMembers to call FindMembers on a TypeContainer,
23518 Enum, Delegate or Interface.
23519 (TypeManager.finder_to_member_finder): New PtrHashtable.
23520 (TypeManager.finder_to_container): Removed.
23521 (TypeManager.finder_to_delegate): Removed.
23522 (TypeManager.finder_to_interface): Removed.
23523 (TypeManager.finder_to_enum): Removed.
23525 * interface.cs (Interface): Implement IMemberFinder.
23527 * delegate.cs (Delegate): Implement IMemberFinder.
23529 * enum.cs (Enum): Implement IMemberFinder.
23531 * class.cs (TypeContainer): Implement IMemberFinder.
23533 2002-08-12 Martin Baulig <martin@gnome.org>
23535 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23537 2002-08-12 Martin Baulig <martin@gnome.org>
23539 * ecore.cs (ITypeExpression): New interface for expressions which
23541 (TypeExpression): Renamed to TypeLookupExpression.
23542 (Expression.DoResolve): If we're doing a types-only lookup, the
23543 expression must implement the ITypeExpression interface and we
23544 call DoResolveType() on it.
23545 (SimpleName): Implement the new ITypeExpression interface.
23546 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23547 hack, the situation that we're only looking up types can't happen
23548 anymore when this method is called. Moved the type lookup code to
23549 DoResolveType() and call it.
23550 (SimpleName.DoResolveType): This ITypeExpression interface method
23551 is now doing the types-only lookup.
23552 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23553 (ResolveFlags): Added MaskExprClass.
23555 * expression.cs (MemberAccess): Implement the ITypeExpression
23557 (MemberAccess.DoResolve): Added support for a types-only lookup
23558 when we're called via ITypeExpression.DoResolveType().
23559 (ComposedCast): Implement the ITypeExpression interface.
23561 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
23562 Expression.Resolve() with ResolveFlags.Type instead.
23564 2002-08-12 Martin Baulig <martin@gnome.org>
23566 * interface.cs (Interface.Define): Apply attributes.
23568 * attribute.cs (Attribute.ApplyAttributes): Added support for
23569 interface attributes.
23571 2002-08-11 Martin Baulig <martin@gnome.org>
23573 * statement.cs (Block.Emit): Only check the "this" variable if we
23574 do not always throw an exception.
23576 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23577 whether the property has a set accessor.
23579 2002-08-11 Martin Baulig <martin@gnome.org>
23581 Added control flow analysis support for structs.
23583 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23584 with control flow analysis turned off.
23585 (IVariable): New interface.
23586 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23587 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23588 (FieldExpr.DoResolve): Resolve the instance expression with flow
23589 analysis turned off and do the definite assignment check after the
23590 resolving when we know what the expression will resolve to.
23592 * expression.cs (LocalVariableReference, ParameterReference):
23593 Implement the new IVariable interface, only call the flow analysis
23594 code if ec.DoFlowAnalysis is true.
23595 (This): Added constructor which takes a Block argument. Implement
23596 the new IVariable interface.
23597 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23598 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23599 This does the definite assignment checks for struct members.
23601 * class.cs (Constructor.Emit): If this is a non-static `struct'
23602 constructor which doesn't have any initializer, call
23603 Block.AddThisVariable() to tell the flow analysis code that all
23604 struct elements must be initialized before control returns from
23607 * statement.cs (MyStructInfo): New public class.
23608 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23609 argument to this indexer. If non-zero, check an individual struct
23610 member, not the whole struct.
23611 (FlowBranching.CheckOutParameters): Check struct members.
23612 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23613 overloaded versions of these methods which take an additional
23614 `int field_idx' argument to check struct members.
23615 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23616 overloaded versions of these methods which take an additional
23617 `string field_name' argument to check struct member.s
23618 (VariableInfo): Implement the IVariable interface.
23619 (VariableInfo.StructInfo): New public property. Returns the
23620 MyStructInfo instance of the variable if it's a struct or null.
23621 (Block.AddThisVariable): New public method. This is called from
23622 Constructor.Emit() for non-static `struct' constructor which do
23623 not have any initializer. It creates a special variable for the
23624 "this" instance variable which will be checked by the flow
23625 analysis code to ensure that all of the struct's fields are
23626 initialized before control returns from the constructor.
23627 (UsageVector): Added support for struct members. If a
23628 variable/parameter is a struct with N members, we reserve a slot
23629 in the usage vector for each member. A struct is considered fully
23630 initialized if either the struct itself (slot 0) or all its
23631 members are initialized.
23633 2002-08-08 Martin Baulig <martin@gnome.org>
23635 * driver.cs (Driver.MainDriver): Only report an error CS5001
23636 if there were no compilation errors.
23638 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23639 `UnsafeContext' property to determine whether the parent is in
23640 unsafe context rather than checking the parent's ModFlags:
23641 classes nested in an unsafe class are unsafe as well.
23643 2002-08-08 Martin Baulig <martin@gnome.org>
23645 * statement.cs (UsageVector.MergeChildren): Distinguish between
23646 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23647 we return. Added test17() and test18() to test-154.cs.
23649 2002-08-08 Martin Baulig <martin@gnome.org>
23651 * typemanager.cs (TypeManager.FilterWithClosure): If we have
23652 Family access, make sure the invoking type isn't a subclass of the
23653 queried type (that'd be a CS1540).
23655 * ecore.cs (Expression.MemberLookup): Added overloaded version of
23656 this method which takes an additional `Type invocation_type'.
23658 * expression.cs (BaseAccess.DoResolve): Use the base type as
23659 invocation and query type.
23660 (MemberAccess.DoResolve): If the lookup failed and we're about to
23661 report a CS0122, try a lookup with the ec.ContainerType - if this
23662 succeeds, we must report a CS1540.
23664 2002-08-08 Martin Baulig <martin@gnome.org>
23666 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23667 (MethodGroupExpr): Implement the IMemberExpr interface.
23669 * expression (MemberAccess.ResolveMemberAccess): No need to have
23670 any special code for MethodGroupExprs anymore, they're now
23673 2002-08-08 Martin Baulig <martin@gnome.org>
23675 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23676 Family, FamANDAssem and FamORAssem permissions.
23677 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23679 2002-08-08 Martin Baulig <martin@gnome.org>
23681 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23682 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23685 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23687 * driver.cs: implemented /resource option to embed managed resources.
23689 2002-08-07 Martin Baulig <martin@gnome.org>
23691 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23692 (FieldBase.HasFieldInitializer): New public property.
23693 (FieldBase.GetInitializerExpression): New public method. Resolves and
23694 returns the field initializer and makes sure it is only resolved once.
23695 (TypeContainer.EmitFieldInitializers): Call
23696 FieldBase.GetInitializerExpression to get the initializer, this ensures
23697 that it isn't resolved multiple times.
23699 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23700 the resolving process (SimpleName/MemberLookup) that we're currently
23701 emitting a field initializer (which must not access any instance members,
23702 this is an error CS0236).
23704 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23705 argument, if the `IsFieldInitializer' flag is set, we must report and
23706 error CS0236 and not an error CS0120.
23708 2002-08-07 Martin Baulig <martin@gnome.org>
23710 * ecore.cs (IMemberExpr): New public interface.
23711 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23712 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23713 if the expression is an IMemberExpr.
23715 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23716 to be null, implicitly default to `this' if we're non-static in
23717 this case. Simplified the code a lot by using the new IMemberExpr
23718 interface. Also fixed bug #28176 here.
23720 2002-08-06 Martin Baulig <martin@gnome.org>
23722 * cs-parser.jay (SimpleLookup): Removed. We need to create
23723 ParameterReferences during semantic analysis so that we can do a
23724 type-only search when resolving Cast, TypeOf and SizeOf.
23725 (block): Pass the `current_local_parameters' to the Block's
23728 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23729 argument to the constructor.
23730 (ConstructorInitializer.Resolve): Create a temporary implicit
23731 block with the parameters.
23733 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23734 references here if we aren't doing a type-only search.
23736 * statement.cs (Block): Added constructor which takes a
23737 `Parameters parameters' argument.
23738 (Block.Parameters): New public property.
23740 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23741 to `Parameters' and made it public readonly.
23743 2002-08-06 Martin Baulig <martin@gnome.org>
23745 * ecore.cs (Expression.Warning): Made this public as well.
23747 * report.cs (Report.Debug): Print the contents of collections.
23749 2002-08-06 Martin Baulig <martin@gnome.org>
23751 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23752 used to tell Resolve() which kinds of expressions it may return.
23753 (Expression.Resolve): Added overloaded version of this method which
23754 takes a `ResolveFlags flags' argument. This can be used to tell
23755 Resolve() which kinds of expressions it may return. Reports a
23757 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23758 ResolveFlags.SimpleName.
23759 (Expression.Error118): Added overloaded version of this method which
23760 takes a `ResolveFlags flags' argument. It uses the flags to determine
23761 which kinds of expressions are allowed.
23763 * expression.cs (Argument.ResolveMethodGroup): New public method.
23764 Resolves an argument, but allows a MethodGroup to be returned.
23765 This is used when invoking a delegate.
23767 * TODO: Updated a bit.
23769 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23771 Fixed compilation with csc.
23773 * ecore.cs: Expression.Error made public. Is this correct? Should
23774 Warning be made public too?
23776 * expression.cs: use ea.Location instead of ea.loc.
23777 [FIXME: Filed as bug #28607: MCS must report these errors.]
23779 2002-08-06 Martin Baulig <martin@gnome.org>
23781 * ecore.cs (Expression.loc): Moved the location here instead of
23782 duplicating it in all derived classes.
23783 (Expression.Location): New public property.
23784 (Expression.Error, Expression.Warning): Made them non-static and
23785 removed the location argument.
23786 (Expression.Warning): Added overloaded version which takes an
23787 `int level' argument.
23788 (Expression.Error118): Make this non-static and removed the
23789 expression and location arguments.
23790 (TypeExpr): Added location argument to the constructor.
23792 * expression.cs (StaticCallExpr): Added location argument to
23794 (Indirection, PointerArithmetic): Likewise.
23795 (CheckedExpr, UnCheckedExpr): Likewise.
23796 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23797 (StringPtr): Likewise.
23800 2002-08-05 Martin Baulig <martin@gnome.org>
23802 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23804 * assign.cs (Assign.DoResolve): Check whether the source
23805 expression is a value or variable.
23807 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23808 while resolving the corresponding blocks.
23810 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23811 an error, don't silently return null.
23813 * statement.cs (Block.AddVariable): Do the error reporting here
23814 and distinguish between CS0128 and CS0136.
23815 (Block.DoResolve): Report all unused labels (warning CS0164).
23816 (LabeledStatement): Pass the location to the constructor.
23817 (LabeledStatement.HasBeenReferenced): New property.
23818 (LabeledStatement.Resolve): Set it to true here.
23820 * statement.cs (Return.Emit): Return success even after reporting
23821 a type mismatch error (CS0126 or CS0127), this is what csc does and
23822 it avoids confusing the users with any consecutive errors.
23824 2002-08-05 Martin Baulig <martin@gnome.org>
23826 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23828 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23830 * expression.cs (MemberAccess.DoResolve): Silently return if an
23831 error has already been reported.
23833 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23834 error has already been reported.
23836 2002-08-05 Martin Baulig <martin@gnome.org>
23838 * statement.cs (UsageVector): Only initialize the `parameters'
23839 vector if we actually have any "out" parameters.
23841 2002-08-05 Martin Baulig <martin@gnome.org>
23843 * expression.cs (Binary.ResolveOperator): When combining delegates,
23844 they must have the same type.
23846 2002-08-05 Martin Baulig <martin@gnome.org>
23848 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23849 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23850 work with the ms runtime and we also don't need it: if we're a
23851 PropertyBuilder and not in the `indexer_arguments' hash, then we
23852 are a property and not an indexer.
23854 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23855 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23856 since the latter one doesn't work with the ms runtime.
23858 2002-08-03 Martin Baulig <martin@gnome.org>
23860 Fixed bugs #27998 and #22735.
23862 * class.cs (Method.IsOperator): New public field.
23863 (Method.CheckBase): Report CS0111 if there's already a method
23864 with the same parameters in the current class. Report CS0508 when
23865 attempting to change the return type of an inherited method.
23866 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23867 and it's not marked abstract or extern.
23868 (PropertyBase): New abstract base class for Property and Indexer.
23869 (PropertyBase.CheckBase): Moved here from Property and made it work
23871 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23872 the same so we can reuse it there.
23873 (Property, Indexer): Derive from PropertyBase.
23874 (MethodSignature.inheritable_property_signature_filter): New delegate
23875 to find properties and indexers.
23877 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23878 argument and improved error reporting.
23880 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23881 EmptyReadOnlyParameters and made it a property.
23883 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23884 version of this method which takes a `PropertyInfo indexer'.
23885 (TypeManager.RegisterIndexer): New method.
23887 * class.cs: Added myself as author of this file :-)
23889 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23891 * class.cs: fixed compilation on windoze.
23893 2002-08-03 Martin Baulig <martin@gnome.org>
23895 * interface.cs (Interface.GetInterfaceBases): Check whether all
23896 base interfaces are at least as accessible than the current one.
23898 * class.cs (TypeContainer.GetClassBases): Check whether base types
23899 are at least as accessible than the current type.
23900 (TypeContainer.AsAccessible): Implemented and made non-static.
23901 (MemberBase.CheckParameters): Report errors if the accessibility
23904 * delegate.cs (Delegate.Delegate): The default visibility is
23905 internal for top-level types and private for nested types.
23906 (Delegate.Define): Report errors if the accessibility checks fail.
23908 * enum.cs (Enum.Enum): The default visibility is internal for
23909 top-level types and private for nested types.
23910 (Enum.DefineType): Compute the correct visibility.
23912 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23913 function which takes a `bool is_toplevel' instead of a TypeContainer.
23915 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23918 2002-08-02 Martin Baulig <martin@gnome.org>
23920 * expression.cs (LocalVariableReferenc): Added constructor which
23921 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23922 (LocalVariableReference.IsReadOnly): New property.
23923 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23924 variable is readonly, use our own readonly flag to do this; you can
23925 use the new constructor to get a writable reference to a read-only
23928 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23929 reference to the local variable.
23931 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23933 * rootcontext.cs (ResolveCore): Also include System.Exception
23935 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23936 we reach an EmptyStatement.
23938 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23941 * expression.cs (Binary.ResolveOperator): Check error result in
23944 use brtrue/brfalse directly and avoid compares to null.
23946 2002-08-02 Martin Baulig <martin@gnome.org>
23948 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23949 Fixes bug #28407, added test-155.cs.
23951 2002-08-01 Martin Baulig <martin@gnome.org>
23953 * class.cs (Event.EmitDefaultMethod): Make this work with static
23954 events. Fixes #28311, added verify-3.cs.
23956 2002-08-01 Martin Baulig <martin@gnome.org>
23958 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23959 `is_disposable' fields.
23960 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23961 `hm.is_disposable' if we're using the collection pattern.
23962 (Foreach.EmitCollectionForeach): Use the correct type for the
23963 enumerator's local variable, only emit the try/finally block if
23964 necessary (fixes #27713).
23966 2002-08-01 Martin Baulig <martin@gnome.org>
23968 * ecore.cs (Expression.report118): Renamed to Error118 and made
23971 * statement.cs (Throw.Resolve): Check whether the expression is of
23972 the correct type (CS0118) and whether the type derives from
23973 System.Exception (CS0155).
23974 (Catch.Resolve): New method. Do the type lookup here and check
23975 whether it derives from System.Exception (CS0155).
23976 (Catch.CatchType, Catch.IsGeneral): New public properties.
23978 * typemanager.cs (TypeManager.exception_type): Added.
23980 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23982 * driver.cs: Updated About function.
23984 2002-07-31 Martin Baulig <martin@gnome.org>
23986 Implemented Control Flow Analysis.
23988 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23989 (EmitContext.CurrentBranching): Added.
23990 (EmitContext.StartFlowBranching): Added.
23991 (EmitContext.EndFlowBranching): Added.
23992 (EmitContext.KillFlowBranching): Added.
23993 (EmitContext.IsVariableAssigned): Added.
23994 (EmitContext.SetVariableAssigned): Added.
23995 (EmitContext.IsParameterAssigned): Added.
23996 (EmitContext.SetParameterAssigned): Added.
23997 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23998 Added control flow analysis stuff here.
24000 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
24001 resolve the expression as lvalue.
24002 (LocalVariableReference.DoResolve): Check whether the variable has
24003 already been assigned.
24004 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
24005 the parameter as assigned here.
24006 (ParameterReference.DoResolve): Check whether the parameter has already
24008 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
24009 expression as lvalue.
24011 * statement.cs (FlowBranching): New class for the flow analysis code.
24012 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
24013 (LabeledStatement.IsDefined): New public property.
24014 (LabeledStatement.AddUsageVector): New public method to tell flow
24015 analyis that the label may be reached via a forward jump.
24016 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
24018 (VariableInfo.Number): New public field. This is used by flow analysis
24019 to number all locals of a block.
24020 (Block.CountVariables): New public property. This is the number of
24021 local variables in this block (including the locals from all parent
24023 (Block.EmitMeta): Number all the variables.
24025 * statement.cs: Added flow analysis support to all classes.
24027 2002-07-31 Martin Baulig <martin@gnome.org>
24029 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
24030 To get debugging messages, compile mcs with /define:MCS_DEBUG and
24031 then use this argument.
24033 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
24035 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
24036 use this to specify /define options.
24038 2002-07-29 Martin Baulig <martin@gnome.org>
24040 * statement.cs (Fixed): Moved all code that does variable lookups
24041 and resolvings from Emit to Resolve.
24043 * statement.cs (For): Moved all code that does variable lookups
24044 and resolvings from Emit to Resolve.
24046 * statement.cs (Using): Moved all code that does variable lookups
24047 and resolvings from Emit to Resolve.
24049 2002-07-29 Martin Baulig <martin@gnome.org>
24051 * attribute.cs (Attribute.Resolve): Explicitly catch a
24052 System.NullReferenceException when creating the
24053 CustromAttributeBuilder and report a different warning message.
24055 2002-07-29 Martin Baulig <martin@gnome.org>
24057 * support.cs (ParameterData.ParameterName): Added method to
24058 get the name of a parameter.
24060 * typemanager.cs (TypeManager.IsValueType): New public method.
24062 2002-07-29 Martin Baulig <martin@gnome.org>
24064 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
24065 is a flag which specifies that it's either ref or out.
24066 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
24067 the out parameter to `out Parameter.Modifier mod', also set the
24068 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
24070 * support.cs (InternalParameters.ParameterModifier): Distinguish
24071 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24072 Parameter.Modifier.ISBYREF flag if it's either ref or out.
24074 * expression.cs (Argument.GetParameterModifier): Distinguish
24075 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24076 Parameter.Modifier.ISBYREF flag if it's either ref or out.
24078 2002-07-29 Martin Baulig <martin@gnome.org>
24080 * expression.cs (ParameterReference.ParameterReference): Added
24081 `Location loc' argument to the constructor.
24083 * cs-parser.jay: Pass location to ParameterReference.
24085 2002-07-28 Miguel de Icaza <miguel@ximian.com>
24087 * statement.cs (Try): Initialize the location.
24089 * cs-parser.jay: pass location to Try.
24091 * expression.cs (Unary.Reduce): Change the prototype to return
24092 whether a constant fold could be performed or not. The result is
24093 returned in an out parameters. In the case of Indirection and
24094 AddressOf, we want to perform the full tests.
24096 2002-07-26 Miguel de Icaza <miguel@ximian.com>
24098 * statement.cs (Statement.Emit): Flag dead code.
24100 2002-07-27 Andrew Birkett <andy@nobugs.org>
24102 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24104 2002-07-27 Martin Baulig <martin@gnome.org>
24106 * class.cs (MethodData.Define): Put back call to
24107 TypeManager.AddMethod(), accidentally commented this out.
24109 * report.cs (Debug): New public method to print debugging information,
24110 this is `[Conditional ("DEBUG")]'.
24112 2002-07-26 Martin Baulig <martin@gnome.org>
24114 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24115 (switch_statement): Push the current_block to the switch_stack and
24116 pop it again when we're done with the switch.
24117 (switch_section): The new block is a child of the current_block.
24118 Fixes bug #24007, added test-152.cs.
24120 2002-07-27 Martin Baulig <martin@gnome.org>
24122 * expression.cs (Invocation.EmitArguments): When calling a varargs
24123 function with only its fixed arguments, we need to pass an empty
24126 2002-07-27 Martin Baulig <martin@gnome.org>
24128 Mono 0.13 has been released.
24130 2002-07-25 Miguel de Icaza <miguel@ximian.com>
24132 * driver.cs: Rename --resource to --linkres, because that is what
24133 we do currently, we dont support --resource yet.
24135 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24137 2002-07-25 Martin Baulig <martin@gnome.org>
24139 * class.cs (MethodData): New public class. This is a `method builder'
24140 class for a method or one accessor of a Property/Indexer/Event.
24141 (MethodData.GetMethodFlags): Moved here from MemberBase.
24142 (MethodData.ApplyAttributes): Likewise.
24143 (MethodData.ApplyObsoleteAttribute): Likewise.
24144 (MethodData.ApplyConditionalAttribute): Likewise.
24145 (MethodData.ApplyDllImportAttribute): Likewise.
24146 (MethodData.CheckAbstractAndExternal): Likewise.
24147 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24148 (MethodData.Emit): Formerly known as Method.Emit().
24149 (MemberBase): Moved everything which was specific to a single
24150 accessor/method to MethodData.
24151 (Method): Create a new MethodData and call Define() and Emit() on it.
24152 (Property, Indexer, Event): Create a new MethodData objects for each
24153 accessor and call Define() and Emit() on them.
24155 2002-07-25 Martin Baulig <martin@gnome.org>
24157 Made MethodCore derive from MemberBase to reuse the code from there.
24158 MemberBase now also checks for attributes.
24160 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24161 (MemberBase.GetMethodFlags): Moved here from class Method and marked
24163 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24164 `CallingConventions cc' and `Attributes opt_attrs' arguments.
24165 (MemberBase.ApplyAttributes): New virtual method; applies the
24166 attributes to a method or accessor.
24167 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24168 (MemberBase.ApplyConditionalAttribute): Likewise.
24169 (MemberBase.ApplyDllImportAttribute): Likewise.
24170 (MemberBase.CheckAbstractAndExternal): Likewise.
24171 (MethodCore.ParameterTypes): This is now a property instead of a
24172 method, it's initialized from DoDefineParameters().
24173 (MethodCore.ParameterInfo): Removed the set accessor.
24174 (MethodCore.DoDefineParameters): New protected virtual method to
24175 initialize ParameterTypes and ParameterInfo.
24176 (Method.GetReturnType): We can now simply return the MemberType.
24177 (Method.GetMethodFlags): Override the MemberBase version and add
24178 the conditional flags.
24179 (Method.CheckBase): Moved some code from Define() here, call
24180 DoDefineParameters() here.
24181 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24182 here to avoid some larger code duplication.
24183 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24184 ensure that abstract and external accessors don't declare a body.
24186 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24187 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24188 lookup in the attribute's parent classes, so we need to abort as soon
24189 as we found the first match.
24190 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24191 the attribute has no arguments.
24193 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24196 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24198 * cs-parser.jay: reverted previous patch.
24200 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24202 * cs-parser.jay: fixed bug #22119.
24204 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24206 * attribute.cs: fixed compilation. The error was:
24207 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
24208 be assigned to before control leaves the current method."
24209 [FIXME: Filed as bug #28186: MCS must report this error.]
24211 2002-07-25 Martin Baulig <martin@gnome.org>
24213 * attribute.cs (Attribute.Conditional_GetConditionName): New static
24214 method to pull the condition name ouf of a Conditional attribute.
24215 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24216 the obsolete message and error flag out of an Obsolete attribute.
24218 * class.cs (Method.GetMethodFlags): New public method to get the
24219 TypeManager.MethodFlags for this method.
24220 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24222 (Method.Define): Get and apply the Obsolete and Conditional attributes;
24223 if we're overriding a virtual function, set the new private variable
24224 `parent_method'; call the new TypeManager.AddMethod().
24226 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
24227 the MethodBuilder and the Method in a PtrHashtable.
24228 (TypeManager.builder_to_method): Added for this purpose.
24229 (TypeManager.MethodFlags): Added IsObsoleteError.
24230 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
24231 Obsolete and Conditional arguments in MethodBuilders. If we discover
24232 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24233 the message from the attribute.
24235 2002-07-24 Martin Baulig <martin@gnome.org>
24237 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24238 preprocessor directives, ensure that the argument to #define/#undef is
24239 exactly one identifier and that it's actually an identifier.
24241 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24244 2002-07-24 Martin Baulig <martin@gnome.org>
24246 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24247 initialize it to TypeManager.object_type in the constructor.
24248 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24249 of the `hm.get_current' method if we're using the collection pattern.
24250 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24251 for the explicit conversion to make it work when we're using the collection
24252 pattern and the `Current' property has a different return type than `object'.
24255 2002-07-24 Martin Baulig <martin@gnome.org>
24257 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24258 does not match, but don't report any errors. This method is called in
24259 order for all methods in a MethodGroupExpr until a matching method is
24260 found, so we don't want to bail out if the first method doesn't match.
24261 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24262 matches, report the 123. Fixes #28070.
24264 2002-07-24 Martin Baulig <martin@gnome.org>
24266 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24267 TypeManager.TypeToCoreType() to the top of the method so the
24268 following equality checks will work. Fixes #28107.
24270 2002-07-24 Martin Baulig <martin@gnome.org>
24272 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24273 operand is of type uint, and the other operand is of type sbyte,
24274 short or int, the operands are converted to type long." -
24275 Actually do what this comment already told us. Fixes bug #28106,
24278 2002-07-24 Martin Baulig <martin@gnome.org>
24280 * class.cs (MethodBase): New abstract class. This is now a base
24281 class for Property, Indexer and Event to avoid some code duplication
24282 in their Define() and DefineMethods() methods.
24283 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24284 generic methods for Define() and DefineMethods().
24285 (FieldBase): Derive from MemberBase, not MemberCore.
24286 (Property): Derive from MemberBase, not MemberCore.
24287 (Property.DefineMethod): Moved all the code from this method to the
24288 new MethodBase.DefineAccessor(), just call it with appropriate
24290 (Property.Define): Call the new Property.DoDefine(), this does some
24291 sanity checks and we don't need to duplicate the code everywhere.
24292 (Event): Derive from MemberBase, not MemberCore.
24293 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24294 accessors, this will also make them work with interface events.
24295 (Indexer): Derive from MemberBase, not MemberCore.
24296 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24297 (Indexer.Define): Use the new MethodBase functions.
24299 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24300 argument to the constructor.
24301 (Interface.FindMembers): Added support for interface events.
24302 (Interface.PopluateEvent): Implemented.
24304 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
24306 2002-07-22 Miguel de Icaza <miguel@ximian.com>
24308 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24309 but this is required to check for a method name being the same as
24310 the containing class.
24314 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24316 * interface.cs: initialize variable.
24318 2002-07-23 Martin Baulig <martin@gnome.org>
24320 Implemented the IndexerName attribute in interfaces.
24322 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24323 name if this is an explicit interface implementation.
24324 (Indexer.InterfaceIndexerName): New public variable. If we're
24325 implementing an interface indexer, this is the IndexerName in that
24326 interface. Otherwise, it's the IndexerName.
24327 (Indexer.DefineMethod): If we're implementing interface indexer,
24328 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
24329 and Pending.ImplementIndexer methods.
24330 (Indexer.Define): Also define the PropertyBuilder if we're
24331 implementing an interface indexer and this is neither an explicit
24332 interface implementation nor do the IndexerName match the one in
24335 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24336 If a method is defined here, then we always need to create a proxy
24337 for it. This is used when implementing interface indexers.
24338 (Pending.IsInterfaceIndexer): New public method.
24339 (Pending.ImplementIndexer): New public method.
24340 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24341 This is used when implementing interface indexers to define a proxy
24343 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24344 define a proxy if necessary.
24346 * interface.cs (Interface.IndexerName): New public variable.
24347 (Interface.PopulateIndexer): Set the IndexerName.
24348 (Interface.DefineIndexers): New private method. Populate all the
24349 indexers and make sure their IndexerNames match.
24351 * typemanager.cs (IndexerPropertyName): Added support for interface
24354 2002-07-22 Martin Baulig <martin@gnome.org>
24356 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24357 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24358 ret if HasReturnLabel.
24359 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24362 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24363 and set the ec.LoopBeginTryCatchLevel.
24364 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24365 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24366 the current ec.TryCatchLevel, the branch goes out of an exception
24367 block. In this case, we need to use Leave and not Br.
24369 2002-07-22 Martin Baulig <martin@gnome.org>
24371 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24372 block unless the block does not always return or it is contained in
24373 another try { ... } catch { ... } block. Fixes bug #26506.
24374 Added verify-1.cs to the test suite.
24376 2002-07-22 Martin Baulig <martin@gnome.org>
24378 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24379 then we do not always return. Fixes bug #24985.
24381 2002-07-22 Martin Baulig <martin@gnome.org>
24383 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24384 lookup on a per-class level; ie. walk up the class hierarchy until we
24385 found at least one applicable method, then choose the best among them.
24386 Fixes bug #24463 and test-29.cs.
24388 2002-07-22 Martin Baulig <martin@gnome.org>
24390 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24391 return types of the methods. The return type is not part of the
24392 signature and we must not check it to make the `new' modifier work.
24393 Fixes bug #27999, also added test-147.cs.
24394 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24396 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24397 on the method's return type.
24399 2002-07-21 Martin Baulig <martin@gnome.org>
24401 * assign.cs: Make this work if the rightmost source is a constant and
24402 we need to do an implicit type conversion. Also adding a few more tests
24403 to test-38.cs which should have caught this.
24405 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24406 target in the makefile for this. The makefile.gnu is primarily intended
24407 for end-users who don't want to debug the compiler.
24409 2002-07-21 Martin Baulig <martin@gnome.org>
24411 * assign.cs: Improved the Assign class so it can now handle embedded
24412 assignments (X = Y = Z = something). As a side-effect this'll now also
24413 consume less local variables. test-38.cs now passes with MCS, added
24414 a few new test cases to that test.
24416 2002-07-20 Martin Baulig <martin@gnome.org>
24418 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24419 instructions. Fixes bug #27977, also added test-146.cs.
24421 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24423 * cs-tokenizer.cs: fixed getHex ().
24425 2002-07-19 Martin Baulig <martin@gnome.org>
24427 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24428 not Type.GetType() to lookup the array type. This is needed when
24429 we're constructing an array of a user-defined type.
24430 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24431 single-dimensional arrays, but also for single-dimensial arrays of
24434 2002-07-19 Martin Baulig <martin@gnome.org>
24436 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24437 this function is called, it's not allowed to share LocalBuilders
24438 among ILGenerators.
24440 2002-07-19 Martin Baulig <martin@gnome.org>
24442 * expression.cs (Argument.Resolve): Report an error 118 when trying
24443 to pass a type as argument.
24445 2002-07-18 Martin Baulig <martin@gnome.org>
24447 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24448 Conv_R_Un for the signed `long' type.
24450 2002-07-15 Miguel de Icaza <miguel@ximian.com>
24452 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24453 `expr' for the temporary result, as that will fail if we do
24454 multiple resolves on the same expression.
24456 2002-07-05 Miguel de Icaza <miguel@ximian.com>
24458 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24459 ec.TypeContainer for looking up aliases.
24461 * class.cs (TypeContainer): Remove LookupAlias from here.
24463 * decl.cs (DeclSpace); Move here.
24465 2002-07-01 Miguel de Icaza <miguel@ximian.com>
24467 * class.cs (FindMembers): Only call filter if the constructor
24468 bulider is not null.
24470 Also handle delegates in `NestedTypes' now. Now we will perform
24471 type lookups using the standard resolution process. This also
24474 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24475 This uses Expressions (the limited kind that can be parsed by the
24476 tree) instead of strings.
24478 * expression.cs (ComposedCast.ToString): Implement, used to flag
24479 errors since now we have to render expressions.
24481 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
24484 * ecore.cs (SimpleName.ToString): ditto.
24486 * cs-parser.jay: Instead of using strings to assemble types, use
24487 Expressions to assemble the type (using SimpleName, ComposedCast,
24488 MemberAccess). This should fix the type lookups in declarations,
24489 because we were using a different code path for this.
24491 * statement.cs (Block.Resolve): Continue processing statements
24492 even when there is an error.
24494 2002-07-17 Miguel de Icaza <miguel@ximian.com>
24496 * class.cs (Event.Define): Also remove the `remove' method from
24497 the list of pending items.
24499 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24500 generate more compact code.
24502 2002-07-17 Martin Baulig <martin@gnome.org>
24504 * const.cs (Const.LookupConstantValue): Add support for constant
24505 `unchecked' and `checked' expressions.
24506 Also adding test case test-140.cs for this.
24508 2002-07-17 Martin Baulig <martin@gnome.org>
24510 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24511 check whether mi.ReturnType implements the IEnumerator interface; the
24512 `==' and the IsAssignableFrom() will fail in this situation.
24514 2002-07-16 Ravi Pratap <ravi@ximian.com>
24516 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
24519 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24521 * expression.cs: fixed bug #27811.
24523 2002-07-14 Miguel de Icaza <miguel@ximian.com>
24525 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24526 Molaro: when we are a ref, the value already contains a pointer
24527 value, do not take the address of it.
24529 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24530 * removed mb-parser.jay and mb-tokenizer.cs
24532 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24534 * expression.cs: check against the building corlib void type.
24536 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24538 * ecore.cs: fix for valuetype static readonly fields: when
24539 initializing them, we need their address, not the address of a copy.
24541 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24543 * typemanager.cs: register also enum_type in corlib.
24545 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24547 * class.cs: allow calling this (but not base) initializers in structs.
24549 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24551 * ecore.cs: make sure we compare against the building base types
24554 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24556 * typemanager.cs: fix TypeToCoreType() to handle void and object
24557 (corlib gets no more typerefs after this change).
24559 2002-07-12 Miguel de Icaza <miguel@ximian.com>
24561 * expression.cs (ArrayCreation.EmitArrayArguments): use
24562 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24564 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24565 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
24566 array indexes, the runtime actually forbids them.
24568 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24569 for array arguments here.
24571 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24572 instead of the default for ValueTypes.
24574 (New.DoEmit): Use IsValueType instead of
24575 IsSubclassOf (value_type)
24576 (New.DoResolve): ditto.
24577 (Invocation.EmitCall): ditto.
24579 * assign.cs (Assign): ditto.
24581 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24582 Statements *are* currently doing part of their resolution during
24585 Expressions do always resolve during resolve, but statements are
24586 only required to propagate resolution to their children.
24588 2002-07-11 Miguel de Icaza <miguel@ximian.com>
24590 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24592 (LoadAssembly): Do not add the dll if it is already specified
24594 (MainDriver): Add the System directory to the link path at the end,
24595 after all the other -L arguments.
24597 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24598 wrong opcode for loading bytes and bools (ldelem.i1 instead of
24599 ldelem.u1) and using the opposite for sbytes.
24601 This fixes Digger, and we can finally run it.
24603 * driver.cs (UnixParseOption): Move the option parsing here.
24604 (CSCParseOption): Implement CSC-like parsing of options.
24606 We now support both modes of operation, the old Unix way, and the
24607 new CSC-like way. This should help those who wanted to make cross
24608 platform makefiles.
24610 The only thing broken is that /r:, /reference: and /lib: are not
24611 implemented, because I want to make those have the same semantics
24612 as the CSC compiler has, and kill once and for all the confussion
24613 around this. Will be doing this tomorrow.
24615 * statement.cs (Unsafe.Resolve): The state is checked during
24616 resolve, not emit, so we have to set the flags for IsUnsfe here.
24618 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24620 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24621 not catch the Error_ObjectRefRequired in SimpleName (as it is
24622 possible to have a class/instance variable name that later gets
24623 deambiguated), we have to check this here.
24625 2002-07-10 Ravi Pratap <ravi@ximian.com>
24627 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24628 make static and put into Expression.
24630 (Event.Define): Register the private field of the event with the
24631 TypeManager so that GetFieldFromEvent can get at it.
24633 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24634 keep track of the private field associated with an event which
24637 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24640 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24642 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24644 * expression.cs (Binary.EmitBranchable): this routine emits the
24645 Binary expression in a branchable context. This basically means:
24646 we need to branch somewhere, not just get the value on the stack.
24648 This works together with Statement.EmitBoolExpression.
24650 * statement.cs (Statement.EmitBoolExpression): Use
24653 2002-07-09 Miguel de Icaza <miguel@ximian.com>
24655 * statement.cs (For): Reduce the number of jumps in loops.
24657 (For): Implement loop inversion for the For statement.
24659 (Break): We can be breaking out of a Try/Catch controlled section
24660 (foreach might have an implicit try/catch clause), so we need to
24661 use Leave instead of Br.
24663 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24664 now). If the instace expression supports IMemoryLocation, we use
24665 the AddressOf method from the IMemoryLocation to extract the
24666 address instead of emitting the instance.
24668 This showed up with `This', as we were emitting the instance
24669 always (Emit) instead of the Address of This. Particularly
24670 interesting when This is a value type, as we dont want the Emit
24671 effect (which was to load the object).
24673 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24675 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24677 * statement.cs (Checked): Set the CheckedState during the resolve
24678 process too, as the ConvCast operations track the checked state on
24679 the resolve process, and not emit.
24681 * cs-parser.jay (namespace_member_declaration): Flag that we have
24682 found a declaration when we do. This is used to flag error 1529
24684 * driver.cs: Report ok when we display the help only.
24686 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24688 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24690 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24692 * cs-tokenizer.cs (define): We also have to track locally the
24693 defines. AllDefines is just used for the Conditional Attribute,
24694 but we also need the local defines for the current source code.
24696 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24698 * statement.cs (While, For, Do): These loops can exit through a
24699 Break statement, use this information to tell whether the
24700 statement is the last piece of code.
24702 (Break): Flag that we break.
24704 * codegen.cs (EmitContexts): New `Breaks' state variable.
24706 2002-07-03 Martin Baulig <martin@gnome.org>
24708 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24709 modifiers in method declarations in structs. Otherwise, you won't
24710 be able to override things like Object.Equals().
24712 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24714 * class.cs (Method, Property, Indexer): Do not allow the public
24715 modifier to be used in explicit interface implementations.
24717 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24718 override modifiers in method declarations in structs
24720 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24722 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24723 integer or real overflow, report an error
24725 2002-07-02 Martin Baulig <martin@gnome.org>
24727 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24728 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24729 to tell the runtime about our newly created System.Object and
24730 System.ValueType types.
24732 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24734 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24735 struct instead of Ldarg/Starg.
24737 2002-07-02 Martin Baulig <martin@gnome.org>
24739 * expression.cs (Indirection.Indirection): Call
24740 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24742 2002-07-02 Martin Baulig <martin@gnome.org>
24744 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24745 ValueType, call TypeManager.TypeToCoreType() on it.
24746 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24747 the OpCodes.Newarr argument.
24749 2002-07-02 Martin Baulig <martin@gnome.org>
24751 * expression.cs (Invocation.EmitCall): When compiling corlib,
24752 replace all calls to the system's System.Array type to calls to
24753 the newly created one.
24755 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24756 System.Array methods.
24757 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24758 from the system's System.Array type which must be replaced.
24760 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24762 * typemanager.cs: load unverifiable_code_ctor so we can build
24763 corlib using the correct type. Avoid using GetTypeCode() with
24765 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24766 TypeManager.object_type to allow building corlib.
24768 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24770 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24772 2002-07-01 Martin Baulig <martin@gnome.org>
24774 * class.cs: Make the last change actually work, we need to check
24775 whether `ifaces != null' to avoid a crash.
24777 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24779 * class.cs: when we build structs without fields that implement
24780 interfaces, we need to add the interfaces separately, since there is
24781 no API to both set the size and add the interfaces at type creation
24784 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24786 * expression.cs: the dimension arguments to the array constructors
24787 need to be converted if they are a long.
24789 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24791 * class.cs: don't emit ldarg.0 if there is no parent constructor
24792 (fixes showstopper for corlib).
24794 2002-06-29 Martin Baulig <martin@gnome.org>
24796 MCS now compiles corlib on GNU/Linux :-)
24798 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24799 ie. check for MethodImplOptions.InternalCall.
24801 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24802 and TypeManager.attribute_type are null, so we must explicitly check
24803 whether parent is not null to find out whether it's an attribute type.
24804 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24805 and SetBuilder, not only if the property is neither abstract nor external.
24806 This is necessary to set the MethodImplOptions on the accessor methods.
24807 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24808 SetBuilder, see Property.Emit().
24810 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24811 populate "System.Object", "System.ValueType" and "System.Attribute" since
24812 they've already been populated from BootCorlib_PopulateCoreTypes().
24814 2002-06-29 Martin Baulig <martin@gnome.org>
24816 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24817 is the NullLiteral, we also need to make sure that target_type is not
24820 2002-06-29 Martin Baulig <martin@gnome.org>
24822 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24823 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24824 before calling BootstrapCorlib_ResolveDelegate ().
24826 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24828 * statement.cs: fixed build-breaker. All tests passed ok.
24830 2002-06-27 Martin Baulig <martin@gnome.org>
24832 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24833 for System.Decimal when compiling corlib.
24835 2002-06-27 Martin Baulig <martin@gnome.org>
24837 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24838 switch blocks which contain nothing but a default clause.
24840 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24842 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24844 2002-06-27 Martin Baulig <martin@gnome.org>
24846 * ecore.cs (PropertyExpr.PropertyExpr): Call
24847 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24849 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24850 is already a TypeBuilder.
24852 2002-06-27 Martin Baulig <martin@gnome.org>
24854 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24855 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24856 the "from an array-type to System.Array" case. This makes it work
24857 when compiling corlib.
24859 2002-06-27 Martin Baulig <martin@gnome.org>
24861 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24862 non-static PropertyExpr, set its InstanceExpression. This makes
24863 the `ICollection.Count' property work in System/Array.cs.
24865 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24867 * driver.cs: Made error handling more consistent. Errors now
24868 tracked by Report class, so many methods which used to return int
24869 now return void. Main() now prints success/failure and
24870 errors/warnings message.
24872 Renamed '--probe' compiler argument to '--expect-error'. Removed
24873 the magic number return values (123 and 124). Now, if the
24874 expected error occurs, the compiler exits with success (exit value
24875 0). If the compilation completes without seeing that particular
24876 error, the compiler exits with failure (exit value 1). The
24877 makefile in mcs/errors has been changed to handle the new behaviour.
24879 * report.cs: Made 'expected error' number a property and renamed
24880 it from 'Probe' to 'ExpectedError'.
24882 * genericparser.cs: Removed error handling support, since it is
24883 now all done by Report class.
24885 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24886 class, so parse() no longer returns an int.
24888 * namespace.cs: Use Report.Error instead of GenericParser.error
24890 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24892 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24893 TypeContainer.AddOperator): At the front of the list put the
24894 explicit implementations, so they get resolved/defined first.
24896 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24898 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24899 interface type is implemented by this TypeContainer. Used during
24900 explicit interface implementation.
24902 (Property.Define, Indexer.Define, Method.Define): Validate that
24903 the given interface in the explicit implementation is one of the
24904 base classes for the containing type.
24906 Also if we are explicitly implementing an interface, but there is
24907 no match in the pending implementation table, report an error.
24909 (Property.Define): Only define the property if we are
24910 not explicitly implementing a property from an interface. Use the
24911 correct name also for those properties (the same CSC uses,
24912 although that is really not needed).
24914 (Property.Emit): Do not emit attributes for explicitly implemented
24915 properties, as there is no TypeBuilder.
24917 (Indexer.Emit): ditto.
24919 Hiding then means that we do not really *implement* a pending
24920 implementation, which makes code fail.
24922 2002-06-22 Martin Baulig <martin@gnome.org>
24924 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24925 the return value of Object.GetType(). [FIXME: we need to do this whenever
24926 we get a type back from the reflection library].
24928 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24930 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24932 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24934 * attribute.cs: Return null if we can not look up the type.
24936 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24937 the interface types found.
24939 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24940 interface types found.
24942 * typemanager.cs (GetInterfaces): Make this routine returns alll
24943 the interfaces and work around the lame differences between
24944 System.Type and System.Reflection.Emit.TypeBuilder in the results
24945 result for GetInterfaces.
24947 (ExpandInterfaces): Given an array of interface types, expand and
24948 eliminate repeated ocurrences of an interface. This expands in
24949 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24952 2002-06-21 Martin Baulig <martin@gnome.org>
24954 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24957 2002-06-21 Martin Baulig <martin@gnome.org>
24959 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24960 and called with one of the core types, return the corresponding typebuilder for
24963 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24966 2002-06-21 Martin Baulig <martin@gnome.org>
24968 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24969 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24970 (Expression.ConvertReferenceExplicit): Likewise.
24972 * expression.cs (ElementAccess.DoResolve): Likewise.
24973 (ElementAccess.DoResolveLValue): Likewise.
24975 2002-06-10 Martin Baulig <martin@gnome.org>
24977 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24978 add the "value" parameter to the parameter list.
24980 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24983 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24985 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24986 the argument to an int, uint, long or ulong, per the spec. Also
24987 catch negative constants in array creation.
24989 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24991 * class.cs: do not allow the same interface to appear twice in
24992 the definition list.
24994 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24996 * ecore.cs: don't use ldlen with System.Array.
24998 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25000 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
25002 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25004 * modifiers.cs: produce correct field attributes for protected
25005 internal. Easy fix so miguel can work on ther harder stuff:-)
25007 2002-06-18 Miguel de Icaza <miguel@ximian.com>
25009 * pending.cs: New file. Move the code from class.cs here.
25010 Support clearning the pending flag for all methods (when not doing
25011 explicit interface implementation).
25013 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25015 * rootcontext.cs: added a couple more types needed to bootstrap.
25017 2002-06-17 Miguel de Icaza <miguel@ximian.com>
25019 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
25020 constructor in the type, instead of any constructor in the type
25021 hierarchy. Thanks to Paolo for finding this bug (it showed up as
25022 a bug in the Mono runtime when applying the params attribute).
25024 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
25025 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
25027 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
25029 * expression.cs (Unary.ResolveOperator): Use TypeManager
25030 to resolve the type.
25032 2002-06-13 Ravi Pratap <ravi@ximian.com>
25034 * cs-parser.jay (enum_member_declaration): Pass in the attributes
25037 * enum.cs (AddEnumMember): Add support to store the attributes associated
25038 with each member too.
25040 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
25041 field builders too - this takes care of the enum member case.
25043 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
25045 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
25046 address-of operator on both value types and pointers.
25048 2002-06-10 Martin Baulig <martin@gnome.org>
25050 * interface.cs (Interface.PopulateIndexer): Add the indexer's
25051 PropertyBuilder to the `property_builders' list.
25053 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
25054 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
25055 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
25056 find any indexers which are inherited from an interface.
25058 2002-06-09 Martin Baulig <martin@gnome.org>
25060 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
25061 the same type as the constant if necessary. There's also a test-130.cs
25064 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
25066 * typemanager.cs (TypeManager.ChangeType): Previously known as
25067 Enum.ChangeEnumType().
25069 2002-06-09 Martin Baulig <martin@gnome.org>
25071 * expression.cs (Cast.TryReduce): Added support for consts.
25073 2002-06-08 Ravi Pratap <ravi@ximian.com>
25075 * class.cs (Accessor): Hold attributes information so we can pass
25078 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
25079 Modify to pass in attributes attached to the methods.
25081 (add_accessor_declaration, remove_accessor_declaration): Ditto.
25083 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
25084 to handle the Accessor kind :-)
25086 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
25088 2002-06-08 Martin Baulig <martin@gnome.org>
25090 * expression.cs (Unary.TryReduceNegative): Added support for
25093 2002-06-08 Martin Baulig <martin@gnome.org>
25095 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25096 name can't be found in the `defined_names' - the caller will do a
25097 MemberLookup in this case and thus find methods in System.Enum
25098 such as Enum.IsDefined().
25100 2002-06-08 Martin Baulig <martin@gnome.org>
25102 * enum.cs (Enum.ChangeEnumType): This is a custom version of
25103 Convert.ChangeType() which works with TypeBuilder created types.
25104 (Enum.LookupEnumValue, Enum.Define): Use it here.
25106 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25107 `TypeBuilder.BaseType != null' check.
25108 (TypeContainer.FindMembers): Only lookup parent members if we
25109 actually have a parent.
25110 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25111 (ConstructorInitializer.Resolve): Likewise.
25113 * interface.cs (Interface.FindMembers): Added
25114 `TypeBuilder.BaseType != null' check.
25116 * rootcontext.cs (RootContext.ResolveCore): Added
25117 "System.Runtime.CompilerServices.IndexerNameAttribute" to
25118 classes_second_stage.
25120 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25121 debug_type and trace_type when compiling with --nostdlib.
25123 2002-06-07 Martin Baulig <martin@gnome.org>
25125 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25126 (AddField): Set it to true when adding a non-static field.
25127 (DefineType): Use `have_nonstatic_fields' to find out whether we
25128 have non-static fields, not `Fields != null'.
25130 2002-06-02 Miguel de Icaza <miguel@ximian.com>
25132 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25133 dereferencing a null on the static-field code path)
25135 2002-05-30 Martin Baulig <martin@gnome.org>
25137 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25138 to take command line arguments. Use reflection to call the new
25139 custom `Initialize' function on the symbol writer and pass it the
25140 command line arguments.
25142 * driver.cs (--debug-args): New command line argument to pass command
25143 line arguments to the symbol writer.
25145 2002-05-28 Miguel de Icaza <miguel@ximian.com>
25147 * assign.cs (DoResolve): Forgot to do the implicit conversion to
25148 the target type for indexers and properties. Thanks to Joe for
25151 2002-05-27 Miguel de Icaza <miguel@ximian.com>
25153 * typemanager.cs (MethodFlags): returns the method flags
25154 (Obsolete/ShouldIgnore) that control warning emission and whether
25155 the invocation should be made, or ignored.
25157 * expression.cs (Invocation.Emit): Remove previous hack, we should
25158 not do this on matching a base type, we should do this based on an attribute
25160 Only emit calls to System.Diagnostics.Debug and
25161 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25162 on the command line.
25164 * rootcontext.cs: Global settings for tracing and debugging.
25166 * cs-tokenizer.cs (define): New utility function to track
25167 defines. Set the global settings for TRACE and DEBUG if found.
25169 2002-05-25 Ravi Pratap <ravi@ximian.com>
25171 * interface.cs (Populate*): Pass in the TypeContainer as well as
25172 the DeclSpace as parameters so that we can create EmitContexts and
25173 then use that to apply attributes etc.
25175 (PopulateMethod, PopulateEvent, PopulateProperty)
25176 (PopulateIndexer): Apply attributes everywhere.
25178 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25181 (ApplyAttributes): Update accordingly.
25183 We now apply interface attributes for all members too.
25185 2002-05-26 Miguel de Icaza <miguel@ximian.com>
25187 * class.cs (Indexer.Define); Correctly check if we are explicit
25188 implementation (instead of checking the Name for a ".", we
25189 directly look up if the InterfaceType was specified).
25191 Delay the creation of the PropertyBuilder.
25193 Only create the PropertyBuilder if we are not an explicit
25194 interface implementation. This means that explicit interface
25195 implementation members do not participate in regular function
25196 lookups, and hence fixes another major ambiguity problem in
25197 overload resolution (that was the visible effect).
25199 (DefineMethod): Return whether we are doing an interface
25202 * typemanager.cs: Temporary hack until we get attributes in
25203 interfaces (Ravi is working on that) and we get IndexerName
25204 support in interfaces.
25206 * interface.cs: Register the indexers as properties.
25208 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25209 warning, I have verified that this is a bug in the .NET runtime
25210 (JavaScript suffers of the same problem).
25212 * typemanager.cs (MemberLookup): When looking up members for
25213 interfaces, the parent of an interface is the implicit
25214 System.Object (so we succeed in searches of Object methods in an
25215 interface method invocation. Example: IEnumerable x; x.ToString
25218 2002-05-25 Miguel de Icaza <miguel@ximian.com>
25220 * class.cs (Event): Events should also register if they do
25221 implement the methods that an interface requires.
25223 * typemanager.cs (MemberLookup); use the new GetInterfaces
25226 (GetInterfaces): The code used to lookup interfaces for a type is
25227 used in more than one place, factor it here.
25229 * driver.cs: Track the errors at the bottom of the file, we kept
25232 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25233 instance if the method we are calling is static!
25235 2002-05-24 Miguel de Icaza <miguel@ximian.com>
25237 * attribute.cs (ApplyAttributes): Make this function filter out
25238 the IndexerName attribute (as that attribute in reality is never
25239 applied) and return the string constant for the IndexerName
25242 * class.cs (TypeContainer.Emit): Validate that all the indexers
25243 have the same IndexerName attribute, and if so, set the
25244 DefaultName attribute on the class.
25246 * typemanager.cs: The return value might contain other stuff (not
25247 only methods). For instance, consider a method with an "Item"
25248 property and an Item method.
25250 * class.cs: If there is a problem with the parameter types,
25253 2002-05-24 Ravi Pratap <ravi@ximian.com>
25255 * ecore.cs (ImplicitConversionExists): Wrapper function which also
25256 looks at user defined conversion after making a call to
25257 StandardConversionExists - we need this for overload resolution.
25259 * expression.cs : Update accordingly the various method calls.
25261 This fixes 2 bugs filed against implicit user defined conversions
25263 2002-05-22 Miguel de Icaza <miguel@ximian.com>
25265 * statement.cs: Track the result of the assignment.
25267 2002-05-21 Miguel de Icaza <miguel@ximian.com>
25269 * expression.cs (MemberAccess): Improved error reporting for
25270 inaccessible members.
25272 2002-05-22 Martin Baulig <martin@gnome.org>
25274 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
25275 itself with debugging support.
25277 2002-05-22 Martin Baulig <martin@gnome.org>
25279 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25280 Removed, this isn't needed anymore.
25282 2002-05-20 Martin Baulig <martin@gnome.org>
25284 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25285 be underlying type for an enum.
25287 2002-05-20 Miguel de Icaza <miguel@ximian.com>
25289 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25290 that splits out the loading of just the core types.
25292 * rootcontext.cs (ResolveCore): Split the struct resolution in
25293 two, so we can load the enumeration underlying types before any
25296 * expression.cs (Is): Bandaid until we fix properly Switch (see
25297 bug #24985 for details).
25299 * typemanager.cs (ImplementsInterface): The hashtable will contain
25300 a null if there are no interfaces implemented.
25302 2002-05-18 Miguel de Icaza <miguel@ximian.com>
25304 * cs-parser.jay (indexer_declarator): It is fine to have array
25307 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25309 * typemanager.cs: (RegisterBuilder): New function used to register
25310 TypeBuilders that implement interfaces. Since
25311 TypeBuilder.GetInterfaces (as usual) does not work with lame
25313 (AddUserType): register interfaces.
25315 (ImplementsInterface): Use the builder_to_ifaces hash if we are
25316 dealing with TypeBuilder. Also, arrays are showing up as
25317 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25318 methods can not be invoked on them!
25320 * ecore.cs (ExplicitReferenceConversionExists): Made public.
25321 (ImplicitReferenceConversionExists): Split out from
25322 StandardConversionExists.
25324 * expression.cs (As): We were only implementing one of the three
25325 cases for the as operator. We now implement them all.
25326 (Is): Implement the various other cases for Is as well.
25328 * typemanager.cs (CACHE): New define used to control if we want or
25329 not the FindMembers cache. Seems to have a negative impact on
25330 performance currently
25332 (MemberLookup): Nested types have full acess to
25333 enclosing type members
25335 Remove code that coped with instance/static returns for events, we
25336 now catch this in RealFindMembers.
25338 (RealFindMembers): only perform static lookup if the instance
25339 lookup did not return a type or an event.
25341 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25343 * assign.cs (CompoundAssign): We pass more semantic information
25344 now to Compound Assignments than we did before: now we have all
25345 the information at hand, and now we resolve the target *before* we
25346 do the expression expansion, which allows the "CacheValue" method
25347 to have the effect we intended (before, a [x] += 1 would generate
25348 two differen ArrayAccess expressions from the ElementAccess,
25349 during the resolution process).
25351 (CompoundAssign.DoResolve): Resolve target and original_source here.
25353 2002-05-16 Miguel de Icaza <miguel@ximian.com>
25355 * expression.cs (ArrayAccess): dropped debugging information.
25357 * typemanager.cs: Small bug fix: I was always returning i_members,
25358 instead of one of i_members or s_members (depending on which had
25361 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
25362 method is invoked before any code generation takes place, and it
25363 is a mechanism to inform that the expression will be invoked more
25364 than once, and that the method should use temporary values to
25365 avoid having side effects
25367 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25369 * ecore.cs (Expression.CacheTemporaries): Provide empty default
25372 * expression.cs (Indirection, ArrayAccess): Add support for
25373 CacheTemporaries in these two bad boys.
25375 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25376 ldobj or ldind_ref.
25377 (StoreFromPtr): Handle stobj as well.
25379 * expression.cs (UnaryMutator): Share more code.
25381 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25382 down: I was not tracking the Filter function as well, which
25383 was affecting the results of the cache.
25385 2002-05-15 Miguel de Icaza <miguel@ximian.com>
25387 * attribute.cs: Remove the hack to handle the CharSet property on
25390 2002-05-14 Miguel de Icaza <miguel@ximian.com>
25392 * attribute.cs (DoResolve): More uglyness, we now only try to
25393 resolve the attribute partially, to extract the CharSet
25394 information (only if we are a StructLayout attribute). Otherwise
25396 (GetExtraTypeInfo): Add some code to conditionally kill in the
25397 future this. I am more and more convinced that the .NET
25398 framework has special code to handle the attribute setting on
25401 * expression.cs (IsParamsMethodApplicable): Revert my previous
25402 foreach change here, it was wrong.
25404 2002-05-13 Miguel de Icaza <miguel@ximian.com>
25406 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25407 (pp_expr): do not abort on unknown input, just return.
25408 (eval): abort if there are pending chars.
25410 * attribute.cs (Attribute.Resolve): Positional parameters are
25411 optional. Deal with that case.
25413 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25414 the Ansi/Unicode/Auto information for the type.
25416 (TypeContainer.DefineType): instantiate the EmitContext here, as
25417 we will be using it during the type definition (to resolve
25418 attributes) and during the emit phase.
25420 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25421 to pull type information out of the attributes
25423 (Attribute.Resolve): track the constructor builder, and allow for
25424 multiple invocations (structs and classes will use this).
25426 * ecore.cs (MemberLookupFinal): new version with all the
25427 parameters customizable.
25429 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25430 constructors. Return if the result value is null (as the error
25431 would have been flagged already by MemberLookupFinal)
25433 Do not allow instances of abstract classes or interfaces to be
25436 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25437 We have to compare the assembly property here when dealing with
25438 FamANDAssem and Assembly access modifiers, because we might be
25439 creating an assembly from *modules* (that means that we are not
25440 getting TypeBuilders for types defined in other modules that are
25441 part of this assembly).
25443 (Method.Emit): If the method is marked abstract and has a body,
25446 (TypeContainer.DefineMembers): If both the defined member and the
25447 parent name match are methods, then do not emit any warnings: let
25448 the Method.Define routine take care of flagging warnings. But if
25449 there is a mismatch (method overrides something else, or method is
25450 overriwritten by something, then emit warning).
25452 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25453 set to null, this means `do not check for the return type on the
25456 (Method.Define): set the return type for the method signature to
25457 null, so that we get methods with the same name and parameters and
25458 different return types. This is used to flag warning 114 (you are
25459 hiding a method, and you probably want to use the new/override
25462 * typemanager.cs (MemberLookup): Implemented proper access
25463 control, closing a long standing set of bug reports. The problem
25464 was that the Framework only has two bits: Public and NonPublic,
25465 and NonPublic includes private and protected methods, but we need
25466 to enforce the FamANDAssem, FamOrAssem and Family.
25468 2002-05-11 Miguel de Icaza <miguel@ximian.com>
25470 * statement.cs (GotoCase): Return true: Ammounts to giving up
25471 knowledge on whether we return or not, and letting the other case
25472 be responsible for it.
25474 2002-05-10 Miguel de Icaza <miguel@ximian.com>
25476 * driver.cs: Do not load directories for each file processed, only
25477 do it if there is a pattern.
25479 * ecore.cs: Report readonly assigns here as well, as we might have
25480 been resolved only by MemberAccess.
25482 (SimpleName.SimpleNameResolve): Also be useful for LValue
25483 resolution. We need this to propagate assign to local readonly variables
25485 * typemanager.cs: Use a ptrhashtable for the criteria, because we
25486 do not want to reuse potential criteria memory.
25488 * class.cs (MyEventBuilder): Set reflected_type;
25490 * ecore.cs (Constantify): Added support for constifying bools.
25492 (RootContext.LookupType): Added a cache for values looked up in
25493 the declaration space.
25495 * typemanager.cs (FindMembers): Now is a front-end to
25496 RealFindMembers, and provides a two-level hashtable-based cache to
25499 15% performance improvement: from 22.5 to 19.2 seconds.
25501 * expression.cs (IsParamsMethodApplicable): use foreach.
25502 (Invocation.DoResolve): ditto.
25503 (New.DoResolve): ditto.
25504 (ArrayCreation.DoResolve): ditto.
25506 * ecore.cs (FindMostEncompassingType): use foreach.
25508 * delegate.cs (NewDelegate.DoResolve): Use foreach
25510 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25511 (RemoveMethods): use foreach.
25513 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25514 nested foreach statements instead of for, and also break out of
25515 the inner loop once a match is found.
25517 (Invocation.OverloadResolve): Use foreach, simplify the code.
25519 2002-05-08 Miguel de Icaza <miguel@ximian.com>
25521 * cfold.cs (BinaryFold): During an enumeration evaluation context,
25522 we actually unwrap the expression to allow for extra information
25525 * expression.cs: Use Shr_Un on unsigned operations.
25527 2002-05-08 Ravi Pratap <ravi@ximian.com>
25529 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
25530 applicable operators was not being considered correctly. This closes
25531 the bug Miguel reported.
25533 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25535 * attribute.cs: check that the type derives from System.Attribute
25536 and report the correct error in that case (moved the duplicate code to
25537 its own method, too).
25539 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25541 * attribute.cs: lookup attribute type name as the spec says: first the
25542 bare attribute name and then name + "Attribute" (nant compiles with
25543 mcs after this fix).
25545 2002-05-07 Miguel de Icaza <miguel@ximian.com>
25547 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
25548 Because of the way we parse things, we should try to see if a
25549 UIntConstant can fit in an integer.
25551 2002-05-07 Ravi Pratap <ravi@ximian.com>
25553 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25554 when we are in an explicit context.
25556 (ConvertReferenceExplicit): When converting from Iface type S to Class
25557 T make sure the rules are implemented as an OR.
25559 * parameter.cs (ParameterType): Make it a property for now although the
25560 purpose really isn't anything immediate.
25562 * expression.cs (Is*Applicable): Do better checking on the parameter type
25563 of a ref/out parameter. The ones from the system assemblies are already
25564 marked with the correct type so we don't need to do any correction.
25566 * ecore.cs (StandardConversionExists): Conversion from Interface types to
25567 the object type is standard too so include that.
25569 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25571 * ecore.cs (StandardConversionExists): Augment with missing code:
25572 deal with IntConstant, LongConstants and Enumerations.
25574 * assign.cs: Report the error, instead of failing silently
25576 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25577 typecontainer that they are declared, because the
25578 typecontainer/namespace will have the list of using clauses that
25579 need to be applied.
25581 Assembly Attributes were escaping the normal registration
25584 (EmitCode): Apply attributes within an EmitContext that represents
25585 the container they were declared on.
25587 * cs-parser.jay: Track bases for structs. How did I get this wrong?
25589 2002-05-06 Ravi Pratap <ravi@ximian.com>
25591 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25592 Revamp completely - make much cleaner as we now operate only
25595 (FindMostSpecificSource, FindMostSpecificTarget): New methods
25596 to implement the logic detailed in the spec more correctly.
25598 (UserDefinedConversion): Update accordingly.
25600 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25602 * statement.cs: Return flow analysis information up.
25604 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25607 (token): Do not consume an extra character before calling
25610 2002-05-06 Piers Haken <piersh@friskit.com>
25612 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25614 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25616 * class.cs (Constructor.Emit): Set the IsStatic flag in the
25617 EmitContext during the instance constructor initializer
25618 resolution, to stop access to instance variables.
25620 This is mandated by the spec, last paragraph of the `constructor
25621 initializers' section.
25623 2002-05-05 Miguel de Icaza <miguel@ximian.com>
25625 * cs-parser.jay, class.cs (Accessor): new class used to represent
25626 an accessor (get or set). In the past we used `null' to represent
25627 a missing accessor. But this is ambiguous because there was no
25628 way to tell in abstract indexers/properties if one of them was
25631 Now there is a way of addressing that.
25633 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25634 instead of FindMembers.
25636 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25637 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25639 * attribute.cs: Treat indexers and properties as the same in terms
25640 of applying attributes
25642 * ecore.cs (FindMostEncompassedType): Use statically initialized
25643 EmptyExpressions()s like we do elsewhere to avoid creating useless
25644 objects (and we take this out of the tight loop).
25646 (GetConversionOperators): Move the code to extract the actual
25647 operators to a separate routine to clean things up.
25649 2002-05-04 Miguel de Icaza <miguel@ximian.com>
25651 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25652 events are always registered FieldBuilders.
25654 * class.cs (FieldBase): New class shared by Fields
25656 * delegate.cs: If we are a toplevel delegate, use our full name.
25657 If we are a nested delegate, then only use our tail name.
25659 2002-05-02 Ravi Pratap <ravi@ximian.com>
25661 * expression.cs (IsApplicable): Ensure that we add the "&" to
25662 ref/out types before comparing it with the type of the argument.
25664 (IsParamsMethodApplicable): Ditto.
25666 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
25669 * delegate.cs : Handle the case when we have more than one applicable
25670 method. Flag an error only when we finish checking all.
25672 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25674 * expression.cs: Add support for boolean static initializers.
25676 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25678 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25680 * parameter.cs (ComputeParameterTypes,
25681 ComputeAndDefineParameterTypes): Better error handling: now we
25682 clear the `types' cache if we fail during any of the type lookups.
25683 We also return the status code correctly to our caller
25685 * delegate.cs: If we fail to define a delegate, abort the extra
25688 * expression.cs (Binary.ResolveOperator): for
25689 operator==(object,object) and operator !=(object, object) we also
25690 have to verify that there is an implicit conversion from one to
25693 (ArrayAccess.DoResolve): Array Access can operate on
25696 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25698 * assign.cs (CompoundAssign): A new class used as a "flag" that
25699 the assignment actually is happening as part of a compound
25700 assignment operator.
25702 During compound assignment, a few new rules exist to enable things
25709 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25710 to the type of x) if y is implicitly convertible to the type of x,
25711 and the operator is a builtin operator and the return type of the
25712 operator is explicitly convertible to the type of x.
25714 * rootcontext.cs: Reset warning level to 2. 4 catches various
25715 "interesting" features in mcs, we must clean this up at some
25716 point, but currently am trying to kill other bugs ;-)
25718 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25719 in container classes as well.
25721 * expression.cs (Binary.ResolveOperator): Handle string case
25722 before anything else (as operator overloading does emit an error
25723 before doing anything else).
25725 This code could go away when we move to a table driven model, but
25726 i could not come up with a good plan last night.
25728 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25730 * typemanager.cs (CSharpName): reimplementation using regex.
25731 * class.cs: added null check for fields in Emit
25732 * rootcontext.cs: set warninglevel to 4
25734 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25736 * typemanager.cs (CSharpName): reimplemented with Lupus
25739 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25741 * statement.cs (If): correclty implement Resolve, because we were
25742 not catching sem errors in there. The same process is needed
25744 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25747 (Statement.Warning_DeadCodeFound): Factorize code.
25748 (While): Report dead code here too.
25750 (Statement): Added Resolve virtual method to allow
25751 for resolution split from the emit code.
25753 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25755 * statement.cs (EmitBoolExpression): No longer try to resolve the
25757 (MakeBoolean): New utility function that resolve, implicitly
25758 converts to boolean and tags the expression.
25761 (If, Do): Implement dead code elimination.
25762 (While): Implement loop inversion
25764 (Do, While, For, If): Resolve the expression prior to calling our
25767 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25770 - added method Report28 (warning: program has more than one entry point)
25771 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25772 - modified method Method.Define, the part at the end of the method
25774 * rootcontext.cs: added static public Location EntryPointLocation;
25776 * ../errors/cs0028.cs : Add test case for the above warning.
25779 - modified method CSharpName to allow arrays of primitive type to
25780 be printed nicely (e.g. instead of System.Int32[][] it now prints
25782 - added method CSharpSignature: returns the signature of a method
25783 in string format to be used in reporting errors, warnings, etc.
25785 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25788 2002-04-26 Ravi Pratap <ravi@ximian.com>
25790 * delegate.cs (Define): Fix extremely silly bug where I was
25791 setting the type of the 'object' parameter of the BeginInvoke
25792 method to System.IAsyncResult instead of System.Object ;-)
25794 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25796 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25799 (Constructor.Emit): return if we fail to initialize the
25800 constructor. Another door closed!
25802 * expression.cs (New.DoResolve): Improve error message (from -6 to
25803 1501). Use DeclaredOnly lookup to find the exact constructor.
25805 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25806 loop. This is useful.
25808 * cs-parser.jay: Adjust the default parameters so that destructors
25809 have the proper signature.
25811 2002-04-26 Martin Baulig <martin@gnome.org>
25813 * driver.cs (LoadAssembly): If `assembly' contains any characters
25814 which are only valid in path names and not in assembly names
25815 (currently slash, backslash and point), use Assembly.LoadFrom ()
25816 instead of Assembly.Load () on the `assembly' (before iteration
25817 over the link_paths).
25819 2002-04-26 Martin Baulig <martin@gnome.org>
25821 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25823 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25825 * class.cs (Property): use the new typemanager.MemberLookup
25827 (TypeContainer.MemberLookup): Implement using the
25828 TypeManager.MemberLookup now.
25830 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25831 and return MemberInfos, so that these can be used without an
25832 EmitContext (what we had before).
25834 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25836 * expression.cs: Fix the case where the argument to params if the
25837 type of the params. I omitted handling this before. Fixed
25839 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25841 * driver.cs: Call BootCorlib_PopulateCoreType
25843 * class.cs (Property.CheckBase): Check for properties only, not
25846 * interface.cs: Temporary hack: try/catch around the
25847 CustomAttributeBuilder, because I am getting an exception that I
25850 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25851 types whose definitions are required to be there (attributes are
25852 defined before standard types).
25854 Compute definitions as we boot the various types, as they are used
25855 immediately (value_type class will need object_type, but if we do
25856 not initialize object_type, we will pass a null, which will let
25857 the runtime pick the System.Object from the existing corlib, which
25858 is not what we want).
25860 2002-04-22 Patrik Torstensson <totte@labs2.com>
25862 * cs-tokenizer.cs: fixed a number of trim() issues.
25864 2002-04-22 Ravi Pratap <ravi@ximian.com>
25866 * expression.cs (Argument.Type): Ensure that we return the correct
25867 type when we have out or ref parameters [in which case we
25870 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25872 * class.cs (Property, Indexer): Allow extern modifier in there.
25874 * typemanager.cs (InitBaseTypes): Initializes object_type and
25875 value_type, since those will be used early on during the bootstrap
25876 process to compile corlib.
25878 (InitCoreTypes): Move code from here to InitBaseTypes.
25880 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25882 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25883 single-dimension arrays as using the ldlen opcode.
25885 Daniel Lewis discovered this optimization.
25887 * typemanager.cs: Add signature for System.Array::get_Length
25889 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25891 * statement.cs: report the error when the foreach does not apply to an
25892 array nor a collection.
25894 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25896 * expression.cs: Add implicit conversions to the operator ~.
25898 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25900 * typemanager.cs: Locate the decimal constructor.
25902 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25904 * attribute.cs: use the new property of TypeOf.
25905 * expression.cs: added 'get' property around typearg.
25907 These changes fix a build breaker reported by NickD. Is this the
25908 correct way to fix? If not, please, revert my changes and make it
25911 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25913 * attribute.cs: Add support for typeof in attribute invocations.
25914 I am not sure that this is right though.
25916 2002-04-14 Duncan Mak <duncan@ximian.com>
25918 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25919 Binary.Operator.Division case.
25921 2002-04-13 Ravi Pratap <ravi@ximian.com>
25923 * class.cs (DefineType): Ensure that we do a proper check on
25924 attribute types and also register it with the TypeManager.
25926 (TypeContainer.Targets): The default for attribute types is
25927 AttributeTargets.All.
25929 * attribute.cs (ApplyAttributes): Registering the attribute type
25930 is done elsewhere, not when we discover we have a Usage attribute.
25932 2002-04-12 Ravi Pratap <ravi@ximian.com>
25934 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25935 and get rid of is_delegate parameter.
25937 * everywhere : update.
25939 2002-04-12 Ravi Pratap <ravi@ximian.com>
25941 * cs-parser.jay (compilation_unit): Revamp completely to use
25942 some new ideas that I got from Rhys' grammar to solve the problems
25943 with assembly level attributes.
25945 (outer_declaration): New grammar production.
25947 (attribute_sections): Add.
25949 (opt_attributes): Base on attribute_sections
25951 (namespace_declaration): Allow opt_attributes to tackle the case
25952 when we have assembly level attributes - we are clever in this
25955 * attribute.cs (ApplyAttributes): Do not worry about assembly
25956 attributes in the non-global context.
25958 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25959 instead of SetGlobalAttributes.
25961 * class.cs, rootcontext.cs : Ensure we define and generate
25962 attribute types before anything else.
25964 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25965 and flag the new error -20 for the case when the attribute type
25966 does not have valid targets specified. csc does not catch this.
25968 * ../errors/errors.txt : update for error # -20
25970 2002-04-11 Ravi Pratap <ravi@ximian.com>
25972 * support.cs (InternalParameters.ParameterModifier): Do some null
25973 checking and return sane values.
25975 * class.cs (Method.Define): If we are a PInvoke method, ensure
25976 that we are static and extern. Report error # 601
25978 * ../errors/cs0601.cs : Add test case for the above error.
25980 2002-04-07 Ravi Pratap <ravi@ximian.com>
25982 * rootcontext.cs (attribute_types): We need to keep type of
25983 all attribute types separately and emit code for them first.
25985 (RegisterAttribute) : Implement.
25987 * class.cs (DefineType): Check if the current Type is a custom
25988 attribute type and register it accordingly.
25990 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25991 adding the first attribute twice and rename to
25993 (SetGlobalAttributes): this.
25995 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25998 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25999 if we are processing global arguments. Hmm, I am unsure of this.
26001 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26003 * expression.cs: added static array of strings to avoid calling
26004 Enum.ToString () for Operator in Binary. Significant recover of
26007 2002-04-10 Miguel de Icaza <miguel@ximian.com>
26009 * class.cs (FindMembers): Allow the Builders of the various
26010 members to be null. If they are skip them. This only happens
26011 during the PInvoke declaration.
26013 2002-04-09 Miguel de Icaza <miguel@ximian.com>
26015 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
26016 failure, so we do not keep going afterwards.
26018 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
26019 wanted to pass `false' as the `is_delegate' argument. If this is
26020 the case, why not use delegate_type == null to mean `is_delegate =
26021 false' and anything else as is_delegate = true.
26023 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
26025 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
26026 code for the section, not the beginning of the tests.
26028 2002-04-08 Miguel de Icaza <miguel@ximian.com>
26030 * cfold.cs: Handle operator + (Enum x, Underlying x)
26032 * expression.cs (Binary): same. Warn about errors where we have
26033 Enum/Enum in operator + as well.
26035 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
26038 - added support for switch(bool)
26039 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
26040 - add TableSwitchEmit() to handle table-based switch statements
26042 2002-04-05 Ravi Pratap <ravi@ximian.com>
26044 * expression.cs (Invocation.OverloadResolve): Factor out code which
26045 does parameter compatibility checking with arguments so that we can
26046 re-use the code even from Delegate.VerifyApplicability
26048 (VerifyArgumentsCompat): Move above code here.
26050 * delegate.cs (VerifyApplicability): Get rid of duplicate code
26051 and instead make a call to the above method.
26053 2002-03-31 Ravi Pratap <ravi@ximian.com>
26055 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
26056 We use it to keep track of classes which are attribute types.
26058 2002-04-02 Miguel de Icaza <miguel@ximian.com>
26060 * delegate.cs (Delegate.Define): Correctly define the types in the
26061 presence of fixed and array parameters.
26063 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
26066 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
26067 include NonPublic after the first iteration.
26069 * class.cs (Indexer.CheckBase): Only check if both parents are
26072 * cs-parser.jay (accessor_body): If empty, set to null.
26074 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
26075 same code path here to resolve constants names that we did have in
26076 MemberAccess.DoResolve. There is too much code duplicated here.
26078 2002-04-01 Miguel de Icaza <miguel@ximian.com>
26080 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
26082 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
26085 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
26086 tokens, numbers and strings.
26088 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26091 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26092 asyncronous parameters and the regular parameters.
26094 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26095 specify the target directory.
26097 * expression.cs: (This.DoResolve): Simplify
26098 (As.Emit): Optimize, do not generate IsInst if the expression is
26099 always of the given type.
26101 (Is.DoResolve): Bug fix, we were reporting both always/never for
26104 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26105 creating too many unnecessary arrays.
26107 2002-03-31 Miguel de Icaza <miguel@ximian.com>
26109 * class.cs (EmitFieldInitializer): Use Assign expression to assign
26110 fields instead of rolling our own initializer. Takes care of all
26111 implicit conversions, and drops unnecessary static checks/argument.
26113 2002-03-31 Dick Porter <dick@ximian.com>
26115 * driver.cs: use the GetDirectories() return values properly, and
26116 use "/" as path separator.
26118 2002-03-30 Miguel de Icaza <miguel@ximian.com>
26120 * expression.cs (Unary): Optimize - - expr into expr.
26121 (Binary): Optimize a + (-b) into a -b.
26123 * codegen.cs (CodeGen): Made all methods static.
26125 2002-03-29 Miguel de Icaza <miguel@ximian.com>
26129 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26130 TypeBuilder property.
26132 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26135 * tree.cs: Removed the various RecordXXXX, and replaced with a
26136 single RecordDecl. Removed all the accessor methods, and just
26137 left a single access point Type
26139 * enum.cs: Rename DefineEnum to DefineType.
26141 * decl.cs: New abstract method `DefineType' used to unify the
26142 Defines for Enumerations, Interfaces, TypeContainers and
26145 (FindType): Moved LookupInterfaceOrClass here. Moved the
26146 LookupBaseClasses method that used to live in class.cs and
26147 interface.cs here, and renamed to FindType.
26149 * delegate.cs: Implement DefineType. Take advantage of the
26150 refactored pattern for locating the parent builder without taking
26151 the parent_builder argument (which we know does not work if we are
26152 nested, and triggering a toplevel definition).
26154 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26156 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26157 accessibility of a member has changed during override and report
26160 * class.cs (Method.Define, Property.Define): Only complain on
26161 overrides if the method is private, any other accessibility is
26162 fine (and since we just checked the permission is the same, we are
26165 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26166 and elif are processed always. The other pre-processing
26167 directives are only processed if we are "taking" the path
26169 2002-03-29 Martin Baulig <martin@gnome.org>
26171 * class.cs (Method.Emit): Only emit symbolic debugging info if the
26172 current location is not Null.
26174 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26175 a separate method so we can profile it.
26177 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26178 `span.Seconds' are just seconds, but no minutes or hours.
26179 (MainDriver): Profile the CodeGen.SaveSymbols calls.
26181 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26183 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26184 Remove the gratuitous set of Final:
26186 // If an interface implementation, then we can set Final.
26187 if (((flags & MethodAttributes.Abstract) == 0) &&
26188 implementing.DeclaringType.IsInterface)
26189 flags |= MethodAttributes.Final;
26191 I do not know what I was smoking when I used that.
26194 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26195 step into fixing the name resolution issues for delegates and
26196 unifying the toplevel name resolution.
26198 2002-03-28 Martin Baulig <martin@gnome.org>
26200 * class.cs (Method.Emit): If we have a symbol writer, call its
26201 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26202 tell it about the current method.
26204 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26205 writer that we're going to emit the first byte of IL code for a new
26206 statement (a new source line).
26207 (EmitContext.EmitTopBlock): If we have a symbol writer, call
26208 EmitContext.Mark() before emitting any code.
26210 * location.cs (SymbolDocument): Return null when we're Null.
26212 * statement.cs (Statement): Moved the `Location loc' variable here.
26213 (Statement.EmitBoolExpression): If we have a symbol writer, call
26214 ec.Mark() before emitting any code to tell it that we're at the
26215 beginning of a new statement.
26216 (StatementExpression): Added `Location' argument to the constructor.
26217 (Block): Added public readonly variable `StartLocation' and public
26218 variable `EndLocation'. The latter is to be set using SetEndLocation().
26219 (Block): Added constructor which takes a start and end location.
26220 (Block.SetEndLocation): New method. This sets the end location.
26221 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26222 local variables we create.
26223 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26224 each statement and do also mark the begin and end of the block.
26226 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26227 tell it the current lexer.Location, use Location.Null for the end of the
26229 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26230 current block, set its end location using SetEndLocation().
26231 (statement_expression): StatementExpression constructor now takes the
26232 lexer.Location as additional argument.
26233 (for_statement, declare_local_variables): Likewise.
26234 (declare_local_variables): When creating a new implicit block, use the
26235 new Block constructor and pass it the lexer.Location.
26237 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26239 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26240 members also on the parent interfaces recursively.
26242 2002-03-27 Miguel de Icaza <miguel@ximian.com>
26244 * report.cs: Use new formats, since Gonzalo finished the missing
26247 * expression.cs (Binary.ResolveOperator): added missing operator|
26248 operator& and operator^ for bool/bool.
26250 * cs-parser.jay: CheckDef now takes a Location argument that is
26251 used to report errors more precisly (instead of reporting the end
26252 of a definition, we try to track something which is a lot closer
26253 to the source of the problem).
26255 * cs-tokenizer.cs: Track global token use, so we can properly flag
26256 the use of #define/#undef after the first token has been seen.
26258 Also, rename the reportXXXX to Error_DescriptiveName
26260 * decl.cs (DeclSpace.IsTopLevel): Move property here from
26261 TypeContainer, so that Enum and Interface can use this too.
26263 * class.cs (TypeContainer.LookupInterfaceOrClass,
26264 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26265 `builder' argument. Typically this was used to pass the parent
26266 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26269 The problem is that a nested class could trigger the definition of
26270 a toplevel class, and the builder would be obviously wrong in that
26273 So we drop this argument, and we compute dynamically the
26274 TypeBuilder/ModuleBuilder (the correct information was available
26275 to us anyways from DeclSpace.Parent)
26277 * interface.cs (Interface.DefineInterface): Drop builder
26278 parameter cleanup like class.cs
26280 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
26283 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26286 (Try.Emit): Propagate the returns value from the statement.
26288 (Return.Emit): Even if we are leavning
26290 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26292 * modifiers.cs: Fix the computation of MethodAttributes flags.
26294 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26296 * driver.cs: allow compilation of files that start with '/'.
26297 Add a default case when checking the argument of --target.
26299 2002-03-25 Miguel de Icaza <miguel@ximian.com>
26301 * interface.cs: Implement the same search algorithm for types in
26302 the interface code.
26304 * delegate.cs: Do not allow multiple definition.
26306 * Recovered ChangeLog that got accidentally amputated
26308 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26310 * rootcontext.cs: Load manually enum to allow core classes to
26311 contain enumerations.
26313 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26314 Update to new static methods in TypeManager.
26316 * typemanager.cs (GetMethod, GetConstructor): Use our
26317 implementation of FindMembers to find the members, since during
26318 corlib compilation, the types are TypeBuilders and GetMethod and
26319 GetConstructor do not work.
26321 Make all methods in TypeManager static.
26323 (InitCodeHelpers): Split the functionality from
26324 the InitCodeTypes function.
26326 * driver.cs: Call InitCodeHelpers after we have populated the
26329 * cs-parser.jay (delegate_declaration): we did not used to compute
26330 the delegate name correctly for void delegates.
26332 2002-03-24 Miguel de Icaza <miguel@ximian.com>
26334 * rootcontext.cs (RootContext): Init the interface_resolve_order
26335 and type_container_resolve_order always.
26337 (ResolveCore, BootstrapCorlib_ResolveClass,
26338 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26339 compiler when compiling with --nostdlib
26341 * class.cs (TypeContainer.DefineType): Check that our parent is
26342 not null. This test is most important when we are bootstraping
26345 * codegen.cs: Split out the symbol writing code.
26347 2002-03-25 Martin Baulig <martin@gnome.org>
26349 * driver.cs (-g): Made -g an alias for --debug.
26351 2002-03-24 Martin Baulig <martin@gnome.org>
26353 * codegen.cs (SymbolWriter): New public variable. Returns the
26354 current symbol writer.
26355 (CodeGen): Added `bool want_debugging_support' argument to the
26356 constructor. If true, tell the ModuleBuild that we want debugging
26357 support and ask it for the ISymbolWriter.
26358 (Save): If we have a symbol writer, call it's Close() method after
26359 saving the assembly.
26361 * driver.c (--debug): New command line argument to create a
26362 debugger information file.
26364 * location.cs (SymbolDocument): New public property. Returns an
26365 ISymbolDocumentWriter object for the current source file or null
26366 if we don't have a symbol writer.
26368 2002-03-21 Miguel de Icaza <miguel@ximian.com>
26370 * driver.cs (LoadAssembly): Correctly return when all the paths
26371 have been tried and not before.
26373 * statement.cs (Switch.Emit): return the actual coverage for this
26374 statement (returns/not-returns)
26376 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26377 switch of the statement if we are the last switch section. That
26378 kills two problems: try/catch problems (we used to emit an empty
26379 nop at the end) and switch statements where all branches would
26382 2002-03-19 Miguel de Icaza <miguel@ximian.com>
26384 * driver.cs: Add default assemblies (the equivalent to the
26385 Microsoft CSC.RSP file)
26387 * cs-tokenizer.cs: When updating `cols and setting it to zero,
26388 also update tokens_seen and set it to false.
26390 * driver.cs: Implement --recurse for Mike.
26392 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26393 correctly splitting out the paths.
26395 2002-03-18 Miguel de Icaza <miguel@ximian.com>
26397 * interface.cs (Interface.PopulateProperty): Instead of using
26398 `parent' as the declaration space for the set parameters, use
26401 * support.cs (InternalParameters): InternalParameters constructor
26402 takes a DeclSpace instead of a TypeContainer.
26404 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26405 types are being initialized, load the address of it before calling
26408 (New): Provide a mechanism to disable the generation of local
26409 value type temporaries when the caller will be providing us with
26410 an address to store it.
26412 (ArrayCreation.EmitDynamicInitializers): Use it.
26414 2002-03-17 Miguel de Icaza <miguel@ximian.com>
26416 * expression.cs (Invocation.EmitArguments): Only probe for array
26417 property if there is more than one argument. Sorry about that.
26419 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26420 empty param arrays.
26422 * class.cs (Method.LabelParameters): Fix incorrect code path that
26423 prevented the `ParamArrayAttribute' from being applied to the
26426 2002-03-16 Miguel de Icaza <miguel@ximian.com>
26428 * support.cs (ReflectionParameters): Correctly compute whether the
26429 last argument is a params array. Fixes the problem with
26432 * typemanager.cs: Make the assemblies array always be non-null
26433 (empty, but non-null)
26435 * tree.cs (RecordDecl): New function that abstracts the recording
26436 of names. This reports error 101, and provides a pointer to the
26437 previous declaration. Fixes a crash in the compiler.
26439 * cs-parser.jay (constructor_declaration): Update to new grammar,
26440 and provide a constructor_body that can be empty.
26442 2002-03-15 Miguel de Icaza <miguel@ximian.com>
26444 * driver.cs: Add support for --resources.
26446 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26447 Make all types for the various array helper methods be integer.
26449 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26450 CheckState to ConvCast.
26452 (ConvCast): Now it takes a `checked' state argument, to avoid
26453 depending on the emit context for the conversion, and just using
26454 the resolve time setting.
26456 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26457 instead of Invocation.EmitArguments. We do not emit the original
26458 arguments, instead we emit those which have been converted to
26459 unsigned int expressions.
26461 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26463 * codegen.cs: ditto.
26465 * expression.cs (LocalVariableReference): Drop the use of the
26466 Store function that depended on the variable index.
26468 * statement.cs (VariableInfo): Drop the `Idx' property from this
26469 class, as this is not taking into account the indexes for
26470 temporaries tat we generate during the execution, getting the
26473 * class.cs: First emit class initializers, then call the parent
26476 * expression.cs (Binary): Fix opcode emision.
26477 (UnaryMutator.EmitCode): Support checked code generation
26479 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26480 matches for events for both the Static and Instance scans,
26481 pointing to the same element. Fix that.
26483 2002-03-14 Miguel de Icaza <miguel@ximian.com>
26485 * rootcontext.cs (ResolveTree): Always set the
26486 interface_resolve_order, because nested interfaces will be calling
26489 * class.cs (GetInterfaceOrClass): Track the same resolution
26490 process used by TypeManager.LookupType. This fixes the nested
26491 type lookups in class declarations (separate path from
26494 (TypeContainer.DefineType): Also define nested interfaces.
26495 (TypeContainer.RegisterOrder): New public function used to
26496 register the order in which child interfaces need to be closed.
26498 Nested interfaces need to be closed after their parents have been
26501 * interface.cs (InterfaceAttr): Put all the logic for computing
26502 the interface attribute here.
26504 (DefineInterface): Register our interface order with the
26505 RootContext or with the TypeContainer depending on the case.
26507 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26509 * cs-parser.jay: rework foreach statement to work with the new
26510 changes to the policy on SimpleNames.
26512 * report.cs: support Stacktrace on warnings as well.
26514 * makefile: drop --unsafe and /unsafe from the compile.
26516 2002-03-13 Ravi Pratap <ravi@ximian.com>
26518 * ecore.cs (StandardConversionExists): Modify to take an Expression
26519 as the first parameter. Ensure we do null -> reference type conversion
26522 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26523 temporary Expression objects.
26525 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26527 * interface.cs: workaround bug in method overloading resolution
26528 (there is already a bugzilla bug for it).
26530 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26532 We could also solve this problem by having a separate path for
26533 performing type lookups, instead of DoResolve, we could have a
26534 ResolveType entry point, and only participating pieces of the
26535 production (simplename, deref, array) would implement this.
26537 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26538 signal SimpleName to only resolve type names and not attempt to
26539 resolve anything else.
26541 * expression.cs (Cast): Set the flag.
26543 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26545 * class.cs: Only report 108 if there is no `new' modifier.
26547 * cs-parser.jay: rework foreach statement to work with the new
26548 changes to the policy on SimpleNames.
26550 * report.cs: support Stacktrace on warnings as well.
26552 * makefile: drop --unsafe and /unsafe from the compile.
26554 2002-03-11 Miguel de Icaza <miguel@ximian.com>
26556 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26557 lookups here, instead of doing that at parse time. This means
26558 that our grammar will not introduce `LocalVariableReferences' as
26559 expressions at this point. That solves the problem of code like
26563 static void Main ()
26567 This is only half the fix. The full fix requires parameters to
26568 also be handled in this way.
26570 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26571 makes the use more obvious of the DeclSpace. The
26572 ec.TypeContainer.TypeBuilder is now only used to pull the
26573 TypeBuilder for it.
26575 My theory is that I can get rid of the TypeBuilder completely from
26576 the EmitContext, and have typecasts where it is used (from
26577 DeclSpace to where it matters).
26579 The only pending problem is that the code that implements Aliases
26580 is on TypeContainer, and probably should go in DeclSpace.
26582 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26583 lookups here, instead of doing that at parse time. This means
26584 that our grammar will not introduce `LocalVariableReferences' as
26585 expressions at this point. That solves the problem of code like
26589 static void Main ()
26593 This is only half the fix. The full fix requires parameters to
26594 also be handled in this way.
26596 * class.cs (Property.DefineMethod): When implementing an interface
26597 method, set newslot, when implementing an abstract method, do not
26598 set the flag (before we tried never setting it, or always setting
26599 it, which is the difference).
26600 (Indexer.DefineMethod): same.
26601 (Method.DefineMethod): same.
26603 * ecore.cs: Only set the status used flag if we get back a Field.
26605 * attribute.cs: Temporary hack, so Paolo can keep working.
26607 2002-03-08 Ravi Pratap <ravi@ximian.com>
26609 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26610 the unmanaged type in the case we have a MarshalAs attribute.
26612 (Resolve): Handle the case when we are parsing the special MarshalAs
26613 attribute [we need to store the unmanaged type to use later]
26615 * typemanager.cs (marshal_as_attr_type): Built in type for the
26616 MarshalAs Attribute.
26618 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
26619 on parameters and accordingly set the marshalling info.
26621 2002-03-09 Miguel de Icaza <miguel@ximian.com>
26623 * class.cs: Optimizing slightly by removing redundant code after
26624 we switched to the `NoTypes' return value.
26625 (Property.DefineMethod): use NoTypes here too.
26627 This fixes the bug I introduced in my last batch of changes.
26629 2002-03-05 Ravi Pratap <ravi@ximian.com>
26631 * tree.cs (RecordEnum): Add. We now keep track of enums too.
26633 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26634 Enums since those are types too.
26636 * cs-parser.jay (enum_declaration): Record enums as we parse them.
26638 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
26639 thanks to a call during the lookup process.
26641 2002-03-07 Miguel de Icaza <miguel@ximian.com>
26643 * statement.cs (Foreach): Lots of work to accomodate a particular
26644 kind of foreach statement that I had not kept in mind. It is
26645 possible to have foreachs on classes that provide a GetEnumerator
26646 method that return objects that implement the "pattern" for using
26647 a foreach, there is no need to support GetEnumerator
26650 This is needed to compile nant.
26652 * decl.cs: Only report 114 if the member is not `Finalize' and if
26653 the warning level is at least 2.
26655 * class.cs: Moved the compare function from Method to
26658 (MethodSignature.InheritableMemberSignatureCompare): Add new
26659 filter function that is used to extract inheritable methods from a
26662 (Method.Define): Use the new `inheritable_method_signature_filter'
26665 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26668 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26670 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26672 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26674 * expression.cs: Pass location information to
26675 ConvertImplicitStandard.
26677 * class.cs: Added debugging code to track return values from
26680 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26682 * expression.cs (Is.DoResolve): If either side of the `is' is an
26683 interface, do not flag the warning.
26685 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26688 * report.cs: Allow for --fatal to be used with --probe.
26690 * typemanager.cs (NoTypes): Move the definition for the empty Type
26693 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26695 (TypeContainer.DefineProxy): New function used to proxy to parent
26696 implementations when implementing interfaces.
26697 (TypeContainer.ParentImplements): used to lookup if our parent
26698 implements a public function that is required by an interface.
26699 (TypeContainer.VerifyPendingMethods): Hook this up.
26701 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26702 `modules' and `assemblies' arraylists into arrays. We only grow
26703 these are the very early start up of the program, so this improves
26704 the speedof LookupType (nicely measured).
26706 * expression.cs (MakeByteBlob): Replaced unsafe code with
26707 BitConverter, as suggested by Paolo.
26709 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26710 folding of string concatenation, but if either side is a string,
26711 and the other is not, then return null, and let the runtime use
26712 the concatenation on the string plus the object (using
26713 `Object.ToString').
26715 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26717 Constant Folding has been implemented now.
26719 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26720 the error instead on types that are not supported in one's
26723 * constant.cs (Constant and all children): New set of functions to
26724 perform implict and explicit conversions.
26726 * ecore.cs (EnumConstant): Implement the new functions to perform
26727 conversion by proxying to the child expression.
26729 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26730 own separate setting that can not be turned off from the command
26731 line using --unchecked or --checked and is only controlled using
26732 the checked/unchecked statements and expressions. This setting is
26733 used by the constant folder to flag errors.
26735 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26736 ConstantCheckState as well.
26738 During Resolve, they also have to flag the state, because the
26739 constant folder runs completely in the Resolve phase.
26741 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26744 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26746 * cfold.cs: New file, this file contains the constant folder.
26748 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26749 argument to track whether we are using the resulting address to
26750 load or store a value and provide better error messages.
26752 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26753 new AddressOf arguments.
26755 * statement.cs (Foreach.EmitCollectionForeach): Update
26757 * expression.cs (Argument.Emit): Call AddressOf with proper
26758 arguments to track usage.
26760 (New.DoEmit): Call AddressOf with new arguments.
26762 (Unary.Emit): Adjust AddressOf call.
26764 2002-03-01 Ravi Pratap <ravi@ximian.com>
26766 * cs-parser.jay (member_access): Change the case for pre-defined types
26767 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26770 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26773 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26774 essentially like methods and apply attributes like MethodImplOptions to them too.
26776 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26779 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26780 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26783 * Update code everywhere accordingly.
26785 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26787 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26789 2002-02-28 Ravi Pratap <ravi@ximian.com>
26791 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26792 try performing lookups against those instead of jumping straight into using
26793 the 'using' clauses.
26795 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26797 (LookupType): Perform lookups in implicit parents too.
26799 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26800 sequence as RootContext.LookupType.
26802 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26803 the various cases of namespace lookups into this method.
26805 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26807 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26808 in positional arguments)
26810 * class.cs (Operator): Update the AllowedModifiers to contain
26813 * cs-parser.jay: Update operator declaration to allow for the
26814 operator body to be empty.
26816 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26819 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26821 * class.cs (Method.Emit): Label parameters.
26823 * driver.cs: Return 1 or 0 as the program exit code.
26825 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26827 * expression.cs: Special case the `null' object when trying to
26828 auto-compute the type, as anything can be explicitly converted to
26831 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26832 spotting this Paolo.
26834 (Expression.ImplicitNumericConversion): Perform comparissions of
26835 the type using the underlying type in the case of an enumeration
26836 rather than using the enumeration type for the compare.
26838 Cope with the underlying == type case, which is not possible to
26841 (Expression.ConvertNumericExplicit): Perform comparissions of
26842 the type using the underlying type in the case of an enumeration
26843 rather than using the enumeration type for the compare.
26845 * driver.cs: If the user does not supply an extension, assume .exe
26847 * cs-parser.jay (if_statement): Rewrote so that we can track the
26848 location for the if statement.
26850 * expression.cs (Binary.ConstantFold): Only concat strings when
26851 the operation is "+", not everything ;-)
26853 * statement.cs (Statement.EmitBoolExpression): Take a location
26855 (If, While, Do): Track location.
26857 * expression.cs (Binary.ResolveOperator): In the object + string
26858 case, I was missing a call to ConvertImplicit
26860 2002-02-25 Ravi Pratap <ravi@ximian.com>
26862 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26863 Location arguments. Ensure we use RootContext.LookupType to do our work
26864 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26866 * interface.cs (PopulateMethod): Handle the type of the parameter being
26869 * expression.cs (Invocation.BetterFunction): Handle the case when we
26870 have a params method with no fixed arguments and a call is made with no
26873 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26875 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26876 the verbatim-string-literal
26878 * support.cs (InternalParameters.ParameterModifier): handle null
26880 (InternalParameters.ParameterType): ditto.
26882 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26883 duplicating the name of the variable parameter.
26884 (GetParameterByName): Fix bug where we were not looking up array
26885 paramters if they were the only present (thanks Paolo!).
26886 (GetParameterInfo): We only have an empty set of types if both
26887 fixed and array are set to null.
26888 (GetParameterInfo-idx): Handle FixedParameter == null
26890 * cs-parser.jay: Handle the case where there is no catch
26891 statements (missing null test).
26893 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26895 * driver.cs (MainDriver): Be conservative on our command line
26898 Catch DirectoryNotFoundException when calling GetFiles.
26900 (SplitPathAndPattern): Used to split the input specification into
26901 a path and a pattern that we can feed to Directory.GetFiles.
26903 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26905 * statement.cs (Fixed): Implement the last case of the Fixed
26906 statement (string handling).
26908 * expression.cs (StringPtr): New class used to return a char * to
26909 a string; Used by the Fixed statement.
26911 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26913 * expression.cs (Binary.ResolveOperator): Remove redundant
26914 MemberLookup pn parent type.
26915 Optimize union call, we do not need a union if the types are the same.
26916 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26919 Specialize the use of MemberLookup everywhere, instead of using
26920 the default settings.
26922 (StackAlloc): Implement stackalloc keyword.
26924 * cs-parser.jay: Add rule to parse stackalloc.
26926 * driver.cs: Handle /h, /help, /?
26928 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26929 before we supported unsafe code.
26931 * makefile: add --unsafe to the self compilation of mcs.
26933 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26935 * expression.cs (PointerArithmetic): New class that is used to
26936 perform pointer arithmetic.
26937 (Binary.Resolve): Handle pointer arithmetic
26938 Handle pointer comparission.
26939 (ArrayPtr): Utility expression class that is used to take the
26940 address of an array.
26942 (ElementAccess): Implement array access for pointers
26944 * statement.cs (Fixed): Implement fixed statement for arrays, we
26945 are missing one more case before we are done.
26947 * expression.cs (Indirection): Implement EmitAssign and set the
26948 ExprClass to Variable. This allows pointer dereferences to be
26949 treated as variables, and to have values assigned to them.
26951 * ecore.cs (Expression.StoreFromPtr): New utility function to
26952 store values dereferencing.
26954 2002-02-20 Ravi Pratap <ravi@ximian.com>
26956 * expression.cs (Binary.ResolveOperator): Ensure that we are
26957 not trying to operate on a void type - this fixes the reported
26960 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26961 the parent implementation is sealed.
26963 * ../errors/cs0239.cs : Add.
26965 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26967 * typemanager.cs (unverifiable_code_type): Corresponds to
26968 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26969 which have unsafe code in them.
26971 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26974 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26976 * cs-tokenizer.cs: Add support for @"litreal strings"
26978 Make tokenizer accept pre-processor directives
26979 on any column (remove the old C-like limitation).
26981 * rootcontext.cs (EmitCode): Emit any global attributes.
26982 (AddGlobalAttributes): Used to keep track of assembly attributes.
26984 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26986 * cs-parser.jay: Add support for global attributes.
26988 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26990 * expression.cs (Indirection): New helper class. Unary will
26991 create Indirection classes to be able to implement the
26992 IMemoryLocation interface on it.
26994 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26996 * cs-parser.jay (fixed_statement): reference the right statement.
26998 * statement.cs (Fixed.Emit): Finish implementing the fixed
26999 statement for the &x case.
27001 2002-02-14 Miguel de Icaza <miguel@ximian.com>
27003 * class.cs (Property.Define, Method.Define): Remove newslot when
27006 * modifiers.cs: My use of NewSlot when `Abstract' was set was
27007 wrong. NewSlot should only be used if the `new' keyword is present.
27009 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
27010 locating our system dir. Sorry about this.
27012 2002-02-13 Miguel de Icaza <miguel@ximian.com>
27014 * driver.cs (GetSystemDir): Compute correctly the location of our
27015 system assemblies. I was using the compiler directory instead of
27016 the library directory.
27018 2002-02-13 Ravi Pratap <ravi@ximian.com>
27020 * expression.cs (BetterFunction): Put back in what Miguel commented out
27021 since it is the correct fix. The problem is elsewhere ;-)
27023 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
27024 parameters of the parms method are themselves compatible or not !
27026 (StandardConversionExists): Fix very dangerous bug where we were forgetting
27027 to check that a class implements an interface before saying that an implicit
27028 conversion was allowed. Use ImplementsInterface to do the checking.
27030 2002-02-13 Miguel de Icaza <miguel@ximian.com>
27032 * class.cs (Method.Define): Track whether we are an explicit
27033 implementation or not. And only call DefineMethodOverride if we
27034 are an explicit implementation.
27036 (Property.DefineMethod): Ditto.
27038 2002-02-11 Ravi Pratap <ravi@ximian.com>
27040 * expression.cs (BetterFunction): Catch hideous bug which was
27041 preventing us from detecting ambiguous calls due to implicit casts i.e
27044 2002-01-29 Miguel de Icaza <miguel@ximian.com>
27046 * support.cs (Pair): Remove un-needed method. I figured why I was
27047 getting the error in cs-parser.jay, the variable in a foreach loop
27048 is readonly, and the compiler does not really treat this as a variable.
27050 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
27051 instead of EQUALS in grammar.
27053 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
27055 * expression.cs (Unary.DoResolve): Check whether the argument is
27058 2002-01-28 Miguel de Icaza <miguel@ximian.com>
27060 * support.cs: Api for Pair to set a value. Despite the fact that
27061 the variables are public the MS C# compiler refuses to compile
27062 code that accesses the field if the variable is part of a foreach
27065 * statement.cs (Fixed): Begin implementation of the fixed
27068 (Block.AddVariable): Return the VariableInfo on success and null
27069 on failure instead of true/false.
27071 * cs-parser.jay (foreach): Catch errors on variables already
27072 defined (we were ignoring this value before) and properly unwind
27073 the block hierarchy
27075 (fixed_statement): grammar for the fixed statement.
27077 2002-01-25 Miguel de Icaza <miguel@ximian.com>
27079 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
27080 pointer types to be incretemented.
27082 (SizeOf): Implement.
27084 * cs-parser.jay (pointer_member_access): Implement
27085 expr->IDENTIFIER production.
27087 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
27088 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27091 (Unary): Implement indirection.
27093 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27094 use in non-unsafe context).
27096 (SimpleName.DoResolve): Check for pointers in field access on safe
27099 (Expression.LoadFromPtr): Factor the load-indirect code in this
27100 function. This was duplicated in UnboxCast and ParameterReference
27102 2002-01-24 Miguel de Icaza <miguel@ximian.com>
27104 * expression.cs (ComposedCast): report an error if a pointer cast
27105 is used in a safe region.
27107 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27108 pointer type casts in unsafe context.
27110 * codegen.cs (EmitContext): Set up IsUnsafe.
27112 * cs-parser.jay (non_expression_type): Add productions for pointer
27115 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27116 code. We should not use force into static mode if the method is
27117 not virtual. Fixes bug in MIS
27119 * statement.cs (Do.Emit, While.Emit, For.Emit,
27120 Statement.EmitBoolExpression): Add support to Do and While to
27121 propagate infinite loop as `I do return' semantics.
27123 Improve the For case to also test for boolean constants.
27125 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27126 to the list of attributes we can add.
27128 Remove `EmitContext' argument.
27130 * class.cs (Method.Define): Apply parameter attributes.
27131 (Constructor.Define): Apply parameter attributes.
27132 (MethodCore.LabelParameters): Move here the core of labeling
27135 * support.cs (ReflectionParameters.ParameterModifier,
27136 InternalParameters.ParameterModifier): Use IsByRef on the type and
27137 only return the OUT bit for these parameters instead of in/out/ref
27140 This is because I miss-understood things. The ParameterInfo.IsIn
27141 and IsOut represent whether the parameter has the [In] and [Out]
27144 2002-01-22 Miguel de Icaza <miguel@ximian.com>
27146 * ecore.cs (FieldExpr.Emit): Release temporaries.
27148 * assign.cs (LocalTemporary.Release): new function.
27150 * codegen.cs (EmitContext.GetTemporaryStorage,
27151 EmitContext.FreeTemporaryStorage): Rework the way we deal with
27152 temporary storage. Now we can "put back" localbuilders when we
27155 2002-01-21 Miguel de Icaza <miguel@ximian.com>
27157 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27158 need to make a copy of the variable to generate verifiable code.
27160 2002-01-19 Miguel de Icaza <miguel@ximian.com>
27162 * driver.cs: Compute dynamically the system directory.
27164 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27165 Slower, but more generally useful. Used by the abstract
27166 registering implementation.
27168 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27169 the rules for the special rule on Type/instances. First check if
27170 we have the same name, and if so, try that special static path
27171 rather than the instance path.
27173 2002-01-18 Miguel de Icaza <miguel@ximian.com>
27175 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27178 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27179 Enum, ValueType, Delegate or Array for non-corlib compiles.
27181 * cs-tokenizer.cs: Catch long identifiers (645)
27183 * typemanager.cs (IndexerPropetyName): Ravi never tested this
27186 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27187 fix, we were returning too early, so we were not registering
27188 pending methods from abstract classes.
27190 Do not register pending methods if the class is abstract.
27192 * expression.cs (Conditional.DoResolve): Report circular implicit
27193 conversions when we neecd to compute it for conditional
27196 (Is.DoResolve): If the expression is always of the provided type,
27197 flag warning 183. If the expression can not ever be of the
27198 provided type flag warning 184.
27200 * class.cs: Catch 169 as well.
27202 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27205 2002-01-18 Nick Drochak <ndrochak@gol.com>
27207 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
27209 2002-01-17 Miguel de Icaza <miguel@ximian.com>
27211 * interface.cs: (PopulateMethod): Check for pointers being defined
27212 only if the unsafe context is active.
27213 (PopulateProperty): ditto.
27214 (PopulateIndexer): ditto.
27216 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27217 specified. If pointers are present, make sure that they are
27218 present in an unsafe context.
27219 (Constructor, Constructor.Define): ditto.
27220 (Field, Field.Define): ditto.
27221 (Property, Property.Define): ditto.
27222 (Event, Event.Define): ditto.
27224 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27225 hashtable if there are classes or structs defined.
27227 * expression.cs (LocalVariableReference.DoResolve): Simplify this
27228 code, as the constant resolution moved.
27230 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27231 the metadata, so we can flag error 133.
27233 * decl.cs (MemberCore.UnsafeOK): New function to test that a
27234 pointer is being declared in an unsafe context.
27236 2002-01-16 Miguel de Icaza <miguel@ximian.com>
27238 * modifiers.cs (Modifiers.Check): Require a Location argument.
27239 Report error 227 for Unsafe use.
27241 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27243 * statement.cs (For.Emit): If the test is null, then report that
27244 we do `return', as we wont reach anything afterwards.
27246 (Switch.SwitchGoverningType): Track the expression that matched
27249 * driver.cs: Allow negative numbers as an error code to flag.
27251 * cs-parser.jay: Handle 1551.
27253 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27255 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27257 * cs-parser.jay: Report 1518 (type declaration can only contain
27258 class, struct, interface, enum or delegate)
27260 (switch_label): Report 1523 (keywords `case' or `default' must
27263 (opt_switch_sections): Report 1522 (empty switch)
27265 * driver.cs: Report 1515 (response file specified multiple times)
27266 Report 1516 (Source file specified multiple times).
27268 * expression.cs (Argument.Resolve): Signal 1510
27270 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27271 access not allowed in static code)
27273 2002-01-11 Ravi Pratap <ravi@ximian.com>
27275 * typemanager.cs (IsPointerType): Utility method which we are going
27278 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27279 the object type, so we take care of that.
27281 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27283 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27284 added to non-params parameters :-)
27286 * typemanager.cs (CSharpName): Include 'void' type too.
27288 (void_ptr_type): Include in the set of core types.
27290 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
27293 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
27296 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
27297 completely forgotten about it.
27299 2002-01-10 Ravi Pratap <ravi@ximian.com>
27301 * cs-parser.jay (pointer_type): Add. This begins our implementation
27302 of parsing rules for unsafe code.
27304 (unsafe_statement): Implement.
27306 (embedded_statement): Modify to include the above.
27308 * statement.cs (Unsafe): Implement new class for unsafe blocks.
27310 * codegen.cs (EmitContext.InUnsafe): Add. This determines
27311 if the current context is an unsafe one.
27313 * cs-parser.jay (local_variable_pointer_type): Since local variable types
27314 are handled differently, we need separate rules for them.
27316 (local_variable_declaration): Update to use local_variable_pointer_type
27317 to allow variable declarations of unmanaged pointer types.
27319 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27320 in unsafe contexts.
27322 * ../errors/cs0214.cs : Add.
27324 2002-01-16 Nick Drochak <ndrochak@gol.com>
27326 * makefile: remove 'response' file when cleaning.
27328 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27330 * cs-parser.jay: Report 1524.
27332 2002-01-14 Miguel de Icaza <miguel@ximian.com>
27334 * typemanager.cs (RegisterMethod): drop checking if we have
27335 registered this from here
27337 2002-01-12 Miguel de Icaza <miguel@ximian.com>
27339 * class.cs (Method.EmitDestructor): Implement calling our base
27342 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27343 value of InFinally.
27345 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27346 this routine and will wrap the call in a try/catch block. Deal
27349 2002-01-11 Miguel de Icaza <miguel@ximian.com>
27351 * ecore.cs (Expression.MemberLookup): instead of taking a
27352 parameter `same_type' that was used to tell whether we could
27353 access private members we compute our containing type from the
27356 (FieldExpr): Added partial support for volatile fields. This does
27357 not work for volatile fields exposed from assemblies, as I can not
27358 figure out how to extract the modreq from it.
27360 Updated all the source files to use this.
27362 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27363 because it is referenced by MemberLookup very often.
27365 2002-01-09 Ravi Pratap <ravi@ximian.com>
27367 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27368 TypeBuilder.GetCustomAttributes to retrieve what we need.
27370 Get rid of redundant default_member_attr_type as this is the same as
27371 default_member_type which already exists.
27373 * interface.cs, attribute.cs : Update accordingly.
27375 2002-01-08 Miguel de Icaza <miguel@ximian.com>
27377 * typemanager.cs: Enable IndexerPropertyName again. It does not
27378 work for TYpeBuilders though. Ravi, can you please fix this?
27380 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27382 * expression.cs (Argument.Emit): Handle the case of ref objects
27383 being passed to ref functions;
27385 (ParameterReference.EmitLoad): Loads the content of the pointer
27386 without dereferencing.
27388 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27390 * cs-tokenizer.cs: Implemented the pre-processing expressions.
27392 2002-01-08 Ravi Pratap <ravi@ximian.com>
27394 * class.cs (Indexer.DefineMethod): Incorporate the interface
27395 type in the name of the method if we are doing explicit interface
27398 * expression.cs (ConversionExists): Remove as it is completely obsolete.
27400 (BetterConversion): Fix extremely trivial bug where we were referring to
27401 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27404 * ../errors/bug16.cs : Add although we have fixed it.
27406 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27408 * expression.cs (BaseIndexer): Begin implementation.
27410 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27412 * cs-parser.jay (indexer_declarator): Use qualified_identifier
27413 production directly to remove a shift/reduce, and implement
27414 explicit interface implementation.
27416 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27417 after a floating point suffix.
27419 * expression.cs (DoNumericPromotions): Improved the conversion for
27420 uint/uint. If we have a constant, we avoid doing a typecast to a
27423 * class.cs (Indexer): Implement explicit interface implementation
27426 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27428 * class.cs: make the default instance constructor public and hidebysig.
27430 2001-01-03 Ravi Pratap <ravi@ximian.com>
27432 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27433 so we can call it from elsewhere.
27435 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27436 we emit it internally if the class has a defined indexer; otherwise the user
27437 emits it by decorating the class definition with the DefaultMemberAttribute.
27439 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27440 attribute is not used on a type which defines an indexer.
27442 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27443 character when we skip whitespace.
27445 * ../errors/cs0646.cs : Add.
27447 2002-01-03 Miguel de Icaza <miguel@ximian.com>
27449 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27452 * makefile: Add practical target `mcs3.exe' which builds the third
27453 generation compiler.
27455 * expression.cs (New): Fix structures constructor calling.
27457 * class.cs (Property, Method, Indexer): Emit Final flag on the
27458 method if we are an interface implementation and we are not
27461 * ecore.cs (PropertyExpr): New public field `IsBase', tells
27462 whether this property is referencing a `base' method.
27464 * expression.cs (Invocation.EmitCall): take an extra argument:
27465 is_base, this is used to determine whether the `call' or
27466 `callvirt' opcode should be used.
27469 * delegate.cs: update EmitCall.
27471 * class.cs (Method.Define): Set NewSlot for the cases where we are
27472 not implementing an interface method.
27474 (Property.Define): ditto.
27476 2002-01-02 Miguel de Icaza <miguel@ximian.com>
27478 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27479 'r'. Allows mcs to parse itself fully.
27481 2002-01-02 Ravi Pratap <ravi@ximian.com>
27483 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27484 of the number of initializers that require the InitializeArray method.
27486 (CheckIndices): Store the Expression in all cases - not the plain value. Also
27487 update the above field where necessary.
27489 (MakeByteBlob): Update accordingly.
27491 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
27494 (EmitDynamicInitializers): Update in accordance with the new optimization.
27496 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27497 same OpCode applies.
27499 * cs-parser.jay : Fix some glaring errors I introduced.
27501 2002-01-01 Ravi Pratap <ravi@ximian.com>
27503 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27504 so that we can check for name clashes there too.
27506 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27507 for interface indexers.
27509 * interfaces.cs (Define): Emit the default member attribute.
27511 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27512 variable was being referred to while setting the value ;-)
27514 2002-01-01 Miguel de Icaza <miguel@ximian.com>
27516 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27517 byte-by-byte information when we know the data is zero.
27519 Make the block always a multiple of 4, because
27520 DefineInitializedData has a bug.
27522 * assign.cs: Fix, we should assign from the temporary, not from
27525 * expression.cs (MakeByteBlob): Fix my incorrect code.
27527 2001-12-31 Miguel de Icaza <miguel@ximian.com>
27529 * typemanager.cs (EnumToUnderlying): This function is used to get
27530 the underlying type from an enumeration, because it does not
27533 * constant.cs: Use the I4_S form for values between -128 and 127.
27535 * statement.cs (Block.LookupLabel): Looks up a label.
27536 (Block): Drop support for labeled blocks.
27538 (LabeledStatement): New kind of statement that represents a label
27541 (Goto): Finally implement this bad boy.
27543 * cs-parser.jay: Update to reflect new mechanism to implement
27546 2001-12-30 Miguel de Icaza <miguel@ximian.com>
27548 * codegen.cs (EmitContext.This): a codegen property that keeps the
27549 a single instance of this instead of creating many different this
27552 * delegate.cs (Delegate.DoResolve): Update to use the property;
27554 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27556 * expression.cs (BaseAccess.DoResolve): Ditto.
27558 2001-12-29 Ravi Pratap <ravi@ximian.com>
27560 * typemanager.cs (methodimpl_attr_type): Add to hold the type
27561 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27563 (InitCoreTypes): Update accordingly.
27565 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27566 so we can quickly store the state.
27568 (ApplyAttributes): Set the correct implementation flags
27569 for InternalCall methods.
27571 2001-12-29 Miguel de Icaza <miguel@ximian.com>
27573 * expression.cs (EmitCall): if a method is not virtual, then do
27574 not use callvirt on it.
27576 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27577 user defined stuff) requires the use of stobj, which takes an
27578 address on the stack instead of an array and an index. So emit
27579 the Ldelema operation for it.
27581 (EmitStoreOpcode): Use stobj for valuetypes.
27583 (UnaryMutator.EmitCode): Use the right 1 value depending on
27584 whether we are dealing with int64/uint64, float or doubles.
27586 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27587 constructors that I implemented last night.
27589 (Constructor.IsDefault): Fix to work properly for static
27592 * cs-parser.jay (CheckDef): report method signature errors.
27593 Update error number 103 to be 132.
27595 * decl.cs: New AdditionResult enumeration value: MethodExists.
27596 Although we do this check for methods later on in the semantic
27597 analysis, catching repeated default constructors is so easy that
27598 we catch these here.
27600 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27603 (ParameterReference.EmitAssign, Emit): handle
27606 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27607 (ArrayAccess.EmitStoreOpcode): ditto.
27609 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27611 * expression.cs (MakeByteBlob): Complete all the missing types
27612 (uint, short, ushort, byte, sbyte)
27614 * class.cs: Only init instance field initializers on instance
27617 Rename `constructors' to instance_constructors.
27619 (TypeContainer.AddConstructor): Only add constructors to the list
27620 if it is not static.
27622 Make sure that we handle default_static_constructor independently
27623 everywhere where we handle instance_constructors
27625 2001-12-28 Miguel de Icaza <miguel@ximian.com>
27627 * class.cs: Do not lookup or create a base initializer for a
27628 static constructor.
27630 (ConstructorInitializer.Resolve): use the proper type to lookup
27633 * cs-parser.jay: Report error 1585 (modifiers between type and name).
27635 * enum.cs, interface.cs: Remove CloseType, this is taken care by
27638 * decl.cs: CloseType is now an virtual method, the default
27639 implementation just closes this type.
27641 2001-12-28 Ravi Pratap <ravi@ximian.com>
27643 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27644 to PreserveSig by default. Also emit HideBySig on such methods.
27646 Basically, set the defaults to standard values.
27648 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27649 argument, if candidate is better, it can't be worse than the best !
27651 (Invocation): Re-write bits to differentiate between methods being
27652 applicable in their expanded form and their normal form - for params
27655 Get rid of use_standard everywhere as only standard conversions are allowed
27656 in overload resolution.
27658 More spec conformance.
27660 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27662 * driver.cs: Add --timestamp, to see where the compiler spends
27665 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27666 `this' in static code.
27668 (SimpleName.DoResolve): Implement in terms of a helper function
27669 that allows static-references to be passed upstream to
27672 (Expression.ResolveWithSimpleName): Resolve specially simple
27673 names when called by MemberAccess to implement the special
27676 (Expression.ImplicitReferenceConversion): Handle conversions from
27677 Null to reference types before others, as Null's type is
27680 * expression.cs (Invocation.EmitCall): Handle the special case of
27681 calling methods declared on a reference type from a ValueType
27682 (Base classes System.Object and System.Enum)
27684 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27685 the left hand side is a TypeExpr, not on every enumeration.
27687 (Binary.Resolve): If types are reference types, then do a cast to
27688 object on operators != and == of both arguments.
27690 * typemanager.cs (FindMembers): Extract instance and static
27691 members if requested.
27693 * interface.cs (PopulateProperty): Use void_type instead of null
27694 as the return type for the setter method.
27696 (PopulateIndexer): ditto.
27698 2001-12-27 Ravi Pratap <ravi@ximian.com>
27700 * support.cs (ReflectionParameters): Fix minor bug where we
27701 were examining the wrong parameter for the ParamArray attribute.
27703 Cope with requests for the type of the parameter at position
27704 greater than the params parameter's. We now return the element
27705 type of the params array as that makes more sense.
27707 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27708 accordingly as we no longer have to extract the element type
27711 (Invocation.OverloadResolve): Update.
27713 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27715 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27716 against IEnumerator, test whether the return value is a descendant
27717 of the IEnumerator interface.
27719 * class.cs (Indexer.Define): Use an auxiliary method to implement
27720 the other bits of the method definition. Begin support for
27721 explicit interface implementation.
27723 (Property.DefineMethod): Use TypeManager.void_type instead of null
27724 for an empty return value.
27726 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27728 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27729 dealing with a FieldExpr which is composed of a FieldBuilder, in
27730 the code path we did extract the constant, but we should have
27731 obtained the underlying value to be able to cast it (otherwise we
27732 end up in an infinite loop, this is what Ravi was running into).
27734 (ArrayCreation.UpdateIndices): Arrays might be empty.
27736 (MemberAccess.ResolveMemberAccess): Add support for section
27737 14.5.4.1 that deals with the special case of E.I when E is a type
27738 and something else, that I can be a reference to a static member.
27740 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27741 handle a particular array type to create byte blobs, it is just
27742 something we dont generate byteblobs for.
27744 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27747 * location.cs (Push): remove the key from the hashtable that we
27748 are about to add. This happens for empty files.
27750 * driver.cs: Dispose files after we have parsed them.
27752 (tokenize): new function that only runs the tokenizer on its
27753 input, for speed testing.
27755 2001-12-26 Ravi Pratap <ravi@ximian.com>
27757 * class.cs (Event.Define): Define the private field only if there
27758 are no accessors defined.
27760 * expression.cs (ResolveMemberAccess): If there is no associated
27761 field with the event, that means we have an event defined with its
27762 own accessors and we should flag error cs0070 since transforming
27763 ourselves into a field is not valid in that case.
27765 * ecore.cs (SimpleName.DoResolve): Same as above.
27767 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27768 and charset to sane values.
27770 2001-12-25 Ravi Pratap <ravi@ximian.com>
27772 * assign.cs (DoResolve): Perform check on events only if they
27773 are being accessed outside the declaring type.
27775 * cs-parser.jay (event_declarations): Update rules to correctly
27776 set the type of the implicit parameter etc.
27778 (add_accessor, remove_accessor): Set current local parameters.
27780 * expression.cs (Binary): For delegate addition and subtraction,
27781 cast the return value from the method into the appropriate delegate
27784 2001-12-24 Ravi Pratap <ravi@ximian.com>
27786 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27787 of these as the workaround is unnecessary.
27789 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27790 delegate data - none of that is needed at all.
27792 Re-write bits to extract the instance expression and the delegate method
27795 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27798 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27799 of attaching attributes instead of duplicating code everywhere.
27801 * everywhere : Update code to do attribute emission using the above method.
27803 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27805 * expression.cs (IsParamsMethodApplicable): if there are not
27806 parameters, return immediately.
27808 * ecore.cs: The 0 literal can be implicity converted to an enum
27811 (SimpleName.DoResolve): First lookup the type, then lookup the
27814 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27815 want to get its address. If the InstanceExpression is not
27816 addressable, store the result in a temporary variable, then get
27819 * codegen.cs: Only display 219 errors on warning level or above.
27821 * expression.cs (ArrayAccess): Make it implement the
27822 IMemoryLocation interface.
27824 (Binary.DoResolve): handle the operator == (object a, object b)
27825 and operator != (object a, object b) without incurring into a
27826 BoxedCast (because 5 != o should never be performed).
27828 Handle binary enumerator operators.
27830 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27831 value type, otherwise use Ldelem_ref.
27833 Use precomputed names;
27835 (AddressOf): Implement address of
27837 * cs-parser.jay (labeled_statement): Fix recursive block
27838 addition by reworking the production.
27840 * expression.cs (New.DoEmit): New has a special case:
27842 If we are dealing with a ValueType, we have a few
27843 situations to deal with:
27845 * The target of New is a ValueType variable, that is
27846 easy, we just pass this as the variable reference
27848 * The target of New is being passed as an argument,
27849 to a boxing operation or a function that takes a
27852 In this case, we need to create a temporary variable
27853 that is the argument of New.
27856 2001-12-23 Ravi Pratap <ravi@ximian.com>
27858 * rootcontext.cs (LookupType): Check that current_type is not null before
27859 going about looking at nested types.
27861 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27862 not implement the IAssignMethod interface any more.
27864 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27865 where we tranform them into FieldExprs if they are being resolved from within
27866 the declaring type.
27868 * ecore.cs (SimpleName.DoResolve): Do the same here.
27870 * assign.cs (DoResolve, Emit): Clean up code considerably.
27872 * ../errors/bug10.cs : Add.
27874 * ../errors/cs0070.cs : Add.
27876 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27878 * assign.cs : Get rid of EventIsLocal everywhere.
27880 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27882 * ecore.cs (ConvertIntLiteral): finished the implementation.
27884 * statement.cs (SwitchLabel): Convert the value we are using as a
27885 key before looking up the table.
27887 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27889 * codegen.cs (EmitTopBlock): Require a Location argument now.
27891 * cs-parser.jay (constructor_declarator): We need to setup
27892 current_local_parameters before we parse the
27893 opt_constructor_initializer, to allow the variables to be bound
27894 to the constructor arguments.
27896 * rootcontext.cs (LookupType): First lookup nested classes in our
27897 class and our parents before we go looking outside our class.
27899 * expression.cs (ConstantFold): Extract/debox the values at the
27902 * rootcontext.cs (EmitCode): Resolve the constants first before we
27903 resolve the types. This is not really needed, but it helps debugging.
27905 * statement.cs: report location.
27907 * cs-parser.jay: pass location to throw statement.
27909 * driver.cs: Small bug fix.
27911 * report.cs: Updated format to be 4-zero filled digits.
27913 2001-12-22 Ravi Pratap <ravi@ximian.com>
27915 * expression.cs (CheckIndices): Fix minor bug where the wrong
27916 variable was being referred to ;-)
27918 (DoEmit): Do not call EmitStaticInitializers when the
27919 underlying type is System.Object.
27921 2001-12-21 Ravi Pratap <ravi@ximian.com>
27923 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27924 and do the usual workaround for SRE.
27926 * class.cs (MyEventBuilder.EventType): New member to get at the type
27927 of the event, quickly.
27929 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27931 * assign.cs (Assign.DoResolve): Handle the case when the target
27932 is an EventExpr and perform the necessary checks.
27934 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27937 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27939 (EventExpr): Set the type in the constructor itself since we
27940 are meant to be born fully resolved.
27942 (EventExpr.Define): Revert code I wrote earlier.
27944 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27945 instance expression is null. The instance expression is a This in that case
27946 or a null, depending on whether it is a static method or not.
27948 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27949 refers to more than one method.
27951 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27952 and accordingly flag errors.
27954 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27956 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27958 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27960 * location.cs (ToString): Provide useful rutine.
27962 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27964 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27965 objects, return the actual integral boxed.
27967 * statement.cs (SwitchLabel): define an ILLabel for each
27970 (Switch.CheckSwitch): If the value is a Literal, extract
27971 the underlying literal.
27973 Also in the unused hashtable we had, add the SwitchLabel so we can
27974 quickly look this value up.
27976 * constant.cs: Implement a bunch of new constants. Rewrite
27977 Literal based on this. Made changes everywhere to adapt to this.
27979 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27980 dereferencing array only once, and also copes with enumrations.
27982 bytes are two bytes wide, not one.
27984 (Cast): Perform constant conversions.
27986 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27987 wrappers to the literals here.
27989 * expression.cs (DoNumericPromotions): long literals can converted
27990 to ulong implicity (this is taken care of elsewhere, but I was
27991 missing this spot).
27993 * ecore.cs (Expression.Literalize): Make the return type Literal,
27994 to improve type checking.
27996 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27998 2001-12-20 Miguel de Icaza <miguel@ximian.com>
28000 * literal.cs: Revert code from ravi that checked the bounds. The
28001 bounds are sane by the definition of the type itself.
28003 * typemanager.cs: Fix implementation of ImplementsInterface. We
28004 need to actually look up in our parent hierarchy for interfaces
28007 * const.cs: Use the underlying type for enumerations
28009 * delegate.cs: Compute the basename for the delegate creation,
28010 that should fix the delegate test case, and restore the correct
28011 Type Lookup semantics in rootcontext
28013 * rootcontext.cs: Revert Ravi's last patch. The correct way of
28014 referencing a nested type with the Reflection API is using the "+"
28017 * cs-parser.jay: Do not require EOF token at the end.
28019 2001-12-20 Ravi Pratap <ravi@ximian.com>
28021 * rootcontext.cs (LookupType): Concatenate type names with
28022 a '.' instead of a '+' The test suite passes again.
28024 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
28025 field of the enumeration.
28027 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
28028 the case when the member is an EventExpr.
28030 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
28031 static has an associated instance expression.
28033 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
28035 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
28037 * class.cs (Event.Define): Register event and perform appropriate checks
28040 We define the Add and Remove methods even if the use provides none because
28041 in that case, we provide default implementations ourselves.
28043 Define a private field of the type of the event. This is done by the CSC compiler
28044 and we should be doing it too ;-)
28046 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
28047 More methods we use in code we generate.
28049 (multicast_delegate_type, delegate_type): Two separate types since the distinction
28052 (InitCoreTypes): Update accordingly for the above.
28054 * class.cs (Event.Emit): Generate code for default accessors that we provide
28056 (EmitDefaultMethod): Do the job in the above.
28058 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
28061 2001-12-20 Miguel de Icaza <miguel@ximian.com>
28063 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
28064 builders even if we were missing one.
28066 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
28067 pass the Basename as our class name instead of the Name. The
28068 basename will be correctly composed for us.
28070 * parameter.cs (Paramters): Now takes a Location argument.
28072 * decl.cs (DeclSpace.LookupType): Removed convenience function and
28073 make all the code call directly LookupType in RootContext and take
28074 this chance to pass the Location information everywhere.
28076 * Everywhere: pass Location information.
28078 2001-12-19 Miguel de Icaza <miguel@ximian.com>
28080 * class.cs (Constructor.Define): Updated way of detecting the
28081 length of the parameters.
28083 (TypeContainer.DefineType): Use basename as the type name for
28086 (TypeContainer.Define): Do not recursively define types here, as
28087 definition is taken care in order by the RootContext.
28089 * tree.cs: Keep track of namespaces in a per-file basis.
28091 * parameter.cs (Parameter.ComputeSignature): Update to use
28094 (Parameters.GetSignature): ditto.
28096 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28097 instead of a TypeContainer.
28099 (Interface.SemanticAnalysis): Use `this' instead of our parent to
28100 resolve names. Because we need to be resolve in our context, not
28103 * driver.cs: Implement response files.
28105 * class.cs (TypeContainer.DefineType): If we are defined, do not
28106 redefine ourselves.
28108 (Event.Emit): Emit the code for add/remove handlers.
28109 (Event.Define): Save the MethodBuilders for add/remove.
28111 * typemanager.cs: Use pair here too.
28113 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28114 DictionaryEntry requires the first argument to be non-null.
28116 (enum_declaration): Compute full name for registering the
28119 (delegate_declaration): Instead of using
28120 formal_parameter_list, use opt_formal_parameter_list as the list
28123 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28124 (EventParsing): New property that controls whether `add' and
28125 `remove' are returned as tokens or identifiers (for events);
28127 2001-12-19 Ravi Pratap <ravi@ximian.com>
28129 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28130 use MyEventBuilder only and let it wrap the real builder for us.
28132 (MyEventBuilder): Revamp constructor etc.
28134 Implement all operations that we perform on EventBuilder in precisely the same
28137 (FindMembers): Update to use the EventBuilder member.
28139 (Event.Emit): Update accordingly.
28141 2001-12-18 Ravi Pratap <ravi@ximian.com>
28143 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28144 by calling the appropriate methods.
28146 (GetCustomAttributes): Make stubs as they cannot possibly do anything
28149 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28151 2001-12-17 Ravi Pratap <ravi@ximian.com>
28153 * delegate.cs (Delegate.Populate): Check that the return type
28154 and various parameters types are indeed accessible.
28156 * class.cs (Constructor.Define): Same here.
28158 (Field.Define): Ditto.
28160 (Event.Define): Ditto.
28162 (Operator.Define): Check that the underlying Method defined itself
28163 correctly - so it's MethodBuilder should not be null.
28165 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28166 expression happens to be null.
28168 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28169 members but as of now we don't seem to be able to do anything really useful with it.
28171 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28172 not the EventBuilder.
28174 2001-12-18 Miguel de Icaza <miguel@ximian.com>
28176 * cs-tokenizer.cs: Add support for defines.
28177 Add support for #if, #elif, #else, #endif
28179 (eval_var): evaluates a variable.
28180 (eval): stubbed for evaluating functions.
28182 * cs-parser.jay: Pass the defines information
28184 * driver.cs: Add --define command line option.
28186 * decl.cs: Move MemberCore here.
28188 Make it the base class for DeclSpace. This allows us to catch and
28189 report 108 and 109 for everything now.
28191 * class.cs (TypeContainer.Define): Extract all the members
28192 before populating and emit the warning 108 (new keyword required
28193 to override) instead of having each member implement this.
28195 (MemberCore.Define): New abstract method, we will be using this in
28196 the warning reporting engine in Populate.
28198 (Operator.Define): Adjust to new MemberCore protocol.
28200 * const.cs (Const): This does not derive from Expression, it is a
28201 temporary object we use to create fields, it is a MemberCore.
28203 * class.cs (Method.Define): Allow the entry point to be in a
28206 * driver.cs: Rewrite the argument handler to clean it up a bit.
28208 * rootcontext.cs: Made it just an auxiliary namespace feature by
28209 making everything static.
28211 * driver.cs: Adapt code to use RootContext type name instead of
28214 * delegate.cs: Remove RootContext argument.
28216 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28219 * class.cs (Event.Define): The lookup can fail.
28221 * cs-tokenizer.cs: Begin implementation of pre-procesor.
28223 * expression.cs: Resolve the this instance before invoking the code.
28225 2001-12-17 Miguel de Icaza <miguel@ximian.com>
28227 * cs-parser.jay: Add a production in element_access that allows
28228 the thing to become a "type" reference. This way we can parse
28229 things like "(string [])" as a type.
28231 Note that this still does not handle the more complex rules of
28235 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
28237 * ecore.cs: (CopyNewMethods): new utility function used to
28238 assemble the list of methods from running FindMembers.
28240 (MemberLookup): Rework FindMembers so that
28242 2001-12-16 Miguel de Icaza <miguel@ximian.com>
28244 * class.cs (TypeContainer): Remove Delegates who fail to be
28247 * delegate.cs (Populate): Verify that we dont get null return
28248 values. TODO: Check for AsAccessible.
28250 * cs-parser.jay: Use basename to emit error 574 (destructor should
28251 have the same name as container class), not the full name.
28253 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28254 possible representation.
28256 Also implements integer type suffixes U and L.
28258 2001-12-15 Miguel de Icaza <miguel@ximian.com>
28260 * expression.cs (ArrayCreation.DoResolve): We need to do the
28261 argument resolution *always*.
28263 * decl.cs: Make this hold the namespace. Hold the root context as
28265 (LookupType): Move here.
28267 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28269 * location.cs (Row, Name): Fixed the code, it was always returning
28270 references to the first file.
28272 * interface.cs: Register properties defined through interfaces.
28274 * driver.cs: Add support for globbing on the command line
28276 * class.cs (Field): Make it derive from MemberCore as well.
28279 2001-12-15 Ravi Pratap <ravi@ximian.com>
28281 * class.cs (Event::Define): Check that the type of the event is a delegate
28282 type else flag error #66.
28284 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28287 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28288 values of EntryPoint, CharSet etc etc.
28290 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28292 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28293 be null and we should ignore this. I am not sure if this is really clean. Apparently,
28294 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28295 which needs this to do its work.
28297 * ../errors/cs0066.cs : Add.
28299 2001-12-14 Miguel de Icaza <miguel@ximian.com>
28301 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28304 * class.cs: (MethodSignature.MethodSignature): Removed hack that
28305 clears out the parameters field.
28306 (MemberSignatureCompare): Cleanup
28308 (MemberCore): New base class used to share code between MethodCore
28311 (RegisterRequiredImplementations) BindingFlags.Public requires
28312 either BindingFlags.Instace or Static. Use instance here.
28314 (Property): Refactored code to cope better with the full spec.
28316 * parameter.cs (GetParameterInfo): Return an empty array instead
28319 * class.cs (Property): Abstract or extern properties have no bodies.
28321 * parameter.cs (GetParameterInfo): return a zero-sized array.
28323 * class.cs (TypeContainer.MethodModifiersValid): Move all the
28324 method modifier validation to the typecontainer so we can reuse
28325 this on properties.
28327 (MethodCore.ParameterTypes): return an empty sized array of types.
28329 (Property.Define): Test property modifier validity.
28331 Add tests for sealed/override too.
28333 (Method.Emit): abstract or extern methods have no bodies.
28335 2001-12-14 Ravi Pratap <ravi@ximian.com>
28337 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28340 (Method::Define, ::Emit): Modify accordingly.
28342 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28344 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28346 * makefile: Pass in /unsafe.
28348 2001-12-13 Miguel de Icaza <miguel@ximian.com>
28350 * class.cs (MakeKey): Kill routine.
28352 * class.cs (TypeContainer.Define): Correctly define explicit
28353 method implementations (they require the full interface name plus
28356 * typemanager.cs: Deply the PtrHashtable here and stop using the
28357 lame keys. Things work so much better.
28359 This of course broke everyone who depended on `RegisterMethod' to
28360 do the `test for existance' test. This has to be done elsewhere.
28362 * support.cs (PtrHashtable): A hashtable that avoid comparing with
28363 the object stupid Equals method (because, that like fails all over
28364 the place). We still do not use it.
28366 * class.cs (TypeContainer.SetRequiredInterface,
28367 TypeContainer.RequireMethods): Killed these two routines and moved
28368 all the functionality to RegisterRequiredImplementations.
28370 (TypeContainer.RegisterRequiredImplementations): This routine now
28371 registers all the implementations required in an array for the
28372 interfaces and abstract methods. We use an array of structures
28373 which can be computed ahead of time to reduce memory usage and we
28374 also assume that lookups are cheap as most classes will not
28375 implement too many interfaces.
28377 We also avoid creating too many MethodSignatures.
28379 (TypeContainer.IsInterfaceMethod): Update and optionally does not
28380 clear the "pending" bit if we find that there are problems with
28383 (TypeContainer.VerifyPendingMethods): Update to report errors of
28384 methods that look like implementations but are not.
28386 (TypeContainer.Define): Add support for explicit interface method
28389 2001-12-12 Miguel de Icaza <miguel@ximian.com>
28391 * typemanager.cs: Keep track of the parameters here instead of
28392 being a feature of the TypeContainer.
28394 * class.cs: Drop the registration of parameters here, as
28395 InterfaceMethods are also interface declarations.
28397 * delegate.cs: Register methods with the TypeManager not only with
28398 the TypeContainer. This code was buggy.
28400 * interface.cs: Full registation here.
28402 2001-12-11 Miguel de Icaza <miguel@ximian.com>
28404 * expression.cs: Remove reducer for binary expressions, it can not
28407 * const.cs: Put here the code that used to go into constant.cs
28409 * constant.cs: Put here the code for constants, this is a new base
28410 class for Literals.
28412 * literal.cs: Make Literal derive from Constant.
28414 2001-12-09 Miguel de Icaza <miguel@ximian.com>
28416 * statement.cs (Return.Emit): Report error 157 if the user
28417 attempts to return from a finally block.
28419 (Return.Emit): Instead of emitting a return, jump to the end of
28422 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28423 LocalBuilder to store the result of the function. ReturnLabel is
28424 the target where we jump.
28427 2001-12-09 Radek Doulik <rodo@ximian.com>
28429 * cs-parser.jay: remember alias in current namespace
28431 * ecore.cs (SimpleName::DoResolve): use aliases for types or
28434 * class.cs (LookupAlias): lookup alias in my_namespace
28436 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28438 (LookupAlias): lookup alias in this and if needed in parent
28441 2001-12-08 Miguel de Icaza <miguel@ximian.com>
28445 * rootcontext.cs: (ModuleBuilder) Made static, first step into
28446 making things static. I need this to avoid passing the
28447 TypeContainer when calling ParameterType.
28449 * support.cs (InternalParameters.ParameterType): Remove ugly hack
28450 that did string manipulation to compute the type and then call
28451 GetType. Use Parameter.ParameterType instead.
28453 * cs-tokenizer.cs: Consume the suffix for floating values.
28455 * expression.cs (ParameterReference): figure out whether this is a
28456 reference parameter or not. Kill an extra variable by computing
28457 the arg_idx during emission.
28459 * parameter.cs (Parameters.GetParameterInfo): New overloaded
28460 function that returns whether a parameter is an out/ref value or not.
28462 (Parameter.ParameterType): The type of the parameter (base,
28463 without ref/out applied).
28465 (Parameter.Resolve): Perform resolution here.
28466 (Parameter.ExternalType): The full type (with ref/out applied).
28468 * statement.cs (Using.Emit, Using.EmitExpression): Implement
28469 support for expressions on the using statement.
28471 2001-12-07 Miguel de Icaza <miguel@ximian.com>
28473 * statement.cs (Using.EmitLocalVariableDecls): Split the
28474 localvariable handling of the using statement.
28476 (Block.EmitMeta): Keep track of variable count across blocks. We
28477 were reusing slots on separate branches of blocks.
28479 (Try.Emit): Emit the general code block, we were not emitting it.
28481 Check the type of the declaration to be an IDisposable or
28482 something that can be implicity converted to it.
28484 Emit conversions if required.
28486 * ecore.cs (EmptyExpression): New utility class.
28487 (Expression.ImplicitConversionExists): New utility function.
28489 2001-12-06 Miguel de Icaza <miguel@ximian.com>
28491 * statement.cs (Using): Implement.
28493 * expression.cs (LocalVariableReference): Support read only variables.
28495 * statement.cs: Remove the explicit emit for the Leave opcode.
28496 (VariableInfo): Add a readonly field.
28498 2001-12-05 Miguel de Icaza <miguel@ximian.com>
28500 * ecore.cs (ConvCast): new class used to encapsulate the various
28501 explicit integer conversions that works in both checked and
28502 unchecked contexts.
28504 (Expression.ConvertNumericExplicit): Use new ConvCast class to
28505 properly generate the overflow opcodes.
28507 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28509 * statement.cs: The correct type for the EmptyExpression is the
28510 element_type, not the variable type. Ravi pointed this out.
28512 2001-12-04 Ravi Pratap <ravi@ximian.com>
28514 * class.cs (Method::Define): Handle PInvoke methods specially
28515 by using DefinePInvokeMethod instead of the usual one.
28517 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28518 above to do the task of extracting information and defining the method.
28520 2001-12-04 Ravi Pratap <ravi@ximian.com>
28522 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28523 of the condition for string type.
28525 (Emit): Move that here.
28527 (ArrayCreation::CheckIndices): Keep string literals in their expression
28530 (EmitDynamicInitializers): Handle strings appropriately.
28532 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28534 * codegen.cs (EmitContext): Replace multiple variables with a
28535 single pointer to the current Switch statement.
28537 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28540 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28544 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28547 (Foreach.Emit): Foreach on arrays was not setting
28548 up the loop variables (for break/continue).
28550 (GotoCase): Semi-implented.
28552 2001-12-03 Ravi Pratap <ravi@ximian.com>
28554 * attribute.cs (CheckAttribute): Handle system attributes by using
28555 Attribute.GetAttributes to examine information we need.
28557 (GetValidPlaces): Same here.
28559 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28561 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28563 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28565 (Method::Define): Set appropriate flags if we have a DllImport attribute.
28567 (Method::Emit): Handle the case when we are a PInvoke method.
28569 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28571 * expression.cs: Use ResolveWithSimpleName on compound names.
28573 2001-12-02 Ravi Pratap <ravi@ximian.com>
28575 * constant.cs (EmitConstant): Make sure we resolve the associated expression
28576 before trying to reduce it.
28578 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28580 * constant.cs (LookupConstantValue): Implement.
28582 (EmitConstant): Use the above in emitting the constant.
28584 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28585 that are user-defined by doing a LookupConstantValue on them.
28587 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28590 2001-11-29 Miguel de Icaza <miguel@ximian.com>
28592 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28594 (BaseAccess.DoResolve): Implement.
28596 (MemberAccess.DoResolve): Split this routine into a
28597 ResolveMemberAccess routine that can be used independently
28599 2001-11-28 Miguel de Icaza <miguel@ximian.com>
28601 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28602 As that share bits of the implementation. Is returns a boolean,
28603 while As returns the Type that is being probed.
28605 2001-12-01 Ravi Pratap <ravi@ximian.com>
28607 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28608 instead of a Literal - much easier.
28610 (EnumInTransit): Remove - utterly useless :-)
28612 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28614 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28616 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28617 chain when we have no associated expression.
28619 2001-11-30 Ravi Pratap <ravi@ximian.com>
28621 * constant.cs (Define): Use Location while reporting the errror.
28623 Also emit a warning when 'new' is used and there is no inherited
28626 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
28629 (LookupEnumValue): Implement to lookup an enum member's value and define it
28632 (Populate): Re-write accordingly to use the above routine.
28634 2001-11-27 Miguel de Icaza <miguel@ximian.com>
28636 * expression.cs (This): Fix prototype for DoResolveLValue to
28637 override the base class DoResolveLValue.
28639 * cs-parser.cs: Report errors cs574 and cs575 (destructor
28642 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28643 (we need to load the address of the field here). This fixes
28646 (FieldExpr.DoResolveLValue): Call the DoResolve
28647 function to initialize the Instance expression.
28649 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28650 correctly the GetEnumerator operation on a value type.
28652 * cs-parser.jay: Add more simple parsing error catches.
28654 * statement.cs (Switch): Add support for string switches.
28655 Handle null specially.
28657 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
28659 2001-11-28 Ravi Pratap <ravi@ximian.com>
28661 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28663 (declare_local_constant): New helper function.
28665 * statement.cs (AddConstant): Keep a separate record of constants
28667 (IsConstant): Implement to determine if a variable is a constant.
28669 (GetConstantExpression): Implement.
28671 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28673 * statement.cs (IsVariableDefined): Re-write.
28675 2001-11-27 Ravi Pratap <ravi@ximian.com>
28677 * class.cs (TypeContainer::FindMembers): Look for constants
28678 in the case when we are looking for MemberTypes.Field
28680 * expression.cs (MemberAccess::DoResolve): Check that in the
28681 case we are a FieldExpr and a Literal, we are not being accessed
28682 by an instance reference.
28684 * cs-parser.jay (local_constant_declaration): Implement.
28686 (declaration_statement): Implement for constant declarations.
28688 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28690 * statement.cs (Switch): Catch double defaults.
28692 (Switch): More work on the switch() statement
28693 implementation. It works for integral values now, need to finish
28697 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28699 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28700 integer literals into other integer literals. To be used by
28703 2001-11-24 Ravi Pratap <ravi@ximian.com>
28705 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28708 (EmitDynamicInitializers): Cope with the above since we extract data
28709 directly from ArrayData now.
28711 (ExpectInitializers): Keep track of whether initializers are mandatory
28714 (Bounds): Make it a hashtable to prevent the same dimension being
28715 recorded for every element in that dimension.
28717 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28720 Also fix bug which was causing the indices to be emitted in the reverse
28723 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28725 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28726 unfinished. They do not work, because the underlying code is
28729 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28731 * cs-parser.jay: Remove bogus fixme.
28733 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28734 on Switch statement.
28736 2001-11-23 Ravi Pratap <ravi@ximian.com>
28738 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28741 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28742 parameter. Apparently, any expression is allowed.
28744 (ValidateInitializers): Update accordingly.
28746 (CheckIndices): Fix some tricky bugs thanks to recursion.
28748 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28749 I was being completely brain-dead.
28751 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28752 and re-write acordingly.
28754 (DelegateInvocation): Re-write accordingly.
28756 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28758 (MakeByteBlob): Handle types more correctly.
28760 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28761 initialization from expressions but it is incomplete because I am a complete
28764 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28766 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28767 on If. Basically, we have to return `true' (ie, we do return to
28768 our caller) only if both branches of the if return.
28770 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28771 short-circuit operators, handle them as short circuit operators.
28773 (Cast.DoResolve): Resolve type.
28774 (Cast.Cast): Take an expression as the target type.
28776 * cs-parser.jay (cast_expression): Remove old hack that only
28777 allowed a limited set of types to be handled. Now we take a
28778 unary_expression and we resolve to a type during semantic
28781 Use the grammar productions from Rhys to handle casts (this is
28782 not complete like Rhys syntax yet, we fail to handle that corner
28783 case that C# has regarding (-x), but we will get there.
28785 2001-11-22 Ravi Pratap <ravi@ximian.com>
28787 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28788 field which is an array type.
28790 * cs-parser.jay (declare_local_variables): Support array initialization too.
28792 * typemanager.cs (MakeKey): Implement.
28794 (everywhere): Use the above appropriately.
28796 * cs-parser.jay (for_statement): Update for array initialization while
28797 declaring variables.
28799 * ecore.cs : The error message was correct, it's the variable's names that
28800 were misleading ;-) Make the code more readable.
28802 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28803 the correct type etc.
28805 (ConvertExplicit): Handle Enum types by examining the underlying type.
28807 2001-11-21 Ravi Pratap <ravi@ximian.com>
28809 * parameter.cs (GetCallingConvention): Always return
28810 CallingConventions.Standard for now.
28812 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28814 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28815 and `r' after calling DoNumericPromotions.
28817 * ecore.cs: Fix error message (the types were in the wrong order).
28819 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28820 BindingFlags.Instance as well
28822 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28823 implicit int literal conversion in an empty cast so that we
28824 propagate the right type upstream.
28826 (UnboxCast): new class used to unbox value types.
28827 (Expression.ConvertExplicit): Add explicit type conversions done
28830 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28831 the target type before applying the implicit LongLiterals to ULong
28834 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28836 * cs-parser.jay (for_statement): Reworked the way For works: now
28837 we declare manually any variables that are introduced in
28838 for_initializer to solve the problem of having out-of-band code
28839 emition (that is what got for broken).
28841 (declaration_statement): Perform the actual variable declaration
28842 that used to be done in local_variable_declaration here.
28844 (local_variable_declaration): Do not declare anything, just pass
28845 the information on a DictionaryEntry
28847 2001-11-20 Ravi Pratap <ravi@ximian.com>
28849 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28850 re-write of the logic to now make it recursive.
28852 (UpdateIndices): Re-write accordingly.
28854 Store element data in a separate ArrayData list in the above methods.
28856 (MakeByteBlob): Implement to dump the array data into a byte array.
28858 2001-11-19 Ravi Pratap <ravi@ximian.com>
28860 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28863 * constant.cs (Define): Implement.
28865 (EmitConstant): Re-write fully.
28867 Pass in location info.
28869 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28872 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28873 DictionaryEntry since we need location info too.
28875 (constant_declaration): Update accordingly.
28877 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28878 code into another method : UpdateIndices.
28880 2001-11-18 Ravi Pratap <ravi@ximian.com>
28882 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28883 some type checking etc.
28885 2001-11-17 Ravi Pratap <ravi@ximian.com>
28887 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28888 bits to provide dimension info if the user skips doing that.
28890 Update second constructor to store the rank correctly.
28892 2001-11-16 Ravi Pratap <ravi@ximian.com>
28894 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28895 and try to implement.
28897 * ../errors/cs0150.cs : Add.
28899 * ../errors/cs0178.cs : Add.
28901 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28903 * statement.cs: Implement foreach on multi-dimensional arrays.
28905 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28906 name of the params argument.
28908 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28909 initializing the array.
28911 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28912 we can use this elsewhere.
28914 * statement.cs: Finish implementation of foreach for single
28917 * cs-parser.jay: Use an out-of-band stack to pass information
28918 around, I wonder why I need this.
28920 foreach_block: Make the new foreach_block the current_block.
28922 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28923 function used to return a static Parameters structure. Used for
28924 empty parameters, as those are created very frequently.
28926 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28928 2001-11-15 Ravi Pratap <ravi@ximian.com>
28930 * interface.cs : Default modifier is private, not public. The
28931 make verify test passes again.
28933 2001-11-15 Ravi Pratap <ravi@ximian.com>
28935 * support.cs (ReflectionParameters): Fix logic to determine
28936 whether the last parameter is a params one. Test 9 passes again.
28938 * delegate.cs (Populate): Register the builders we define with
28939 RegisterParameterForBuilder. Test 19 passes again.
28941 * cs-parser.jay (property_declaration): Reference $6 instead
28942 of $$ to get at the location.
28944 (indexer_declaration): Similar stuff.
28946 (attribute): Ditto.
28948 * class.cs (Property): Register parameters for the Get and Set methods
28949 if they exist. Test 23 passes again.
28951 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28952 call to EmitArguments as we are sure there aren't any params arguments.
28953 Test 32 passes again.
28955 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28956 IndexOutOfRangeException.
28958 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28959 Test 33 now passes again.
28961 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28963 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28964 broke a bunch of things. Will have to come up with a better way
28965 of tracking locations.
28967 * statement.cs: Implemented foreach for single dimension arrays.
28969 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28971 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28972 an error. This removes the lookup from the critical path.
28974 * cs-parser.jay: Removed use of temporary_loc, which is completely
28977 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28979 * support.cs (ReflectionParameters.ParameterModifier): Report
28980 whether the argument is a PARAMS argument or not.
28982 * class.cs: Set the attribute `ParamArrayAttribute' on the
28983 parameter argument.
28985 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28986 and cons_param_array_attribute (ConstructorInfo for
28987 ParamArrayAttribute).,
28989 * codegen.cs: Emit the return using the `Return' statement, that
28990 way we can report the error correctly for missing return values.
28992 * class.cs (Method.Emit): Clean up.
28994 * expression.cs (Argument.Resolve): Take another argument: the
28995 location where this argument is used. Notice that this is not
28996 part of the "Argument" class as to reduce the size of the
28997 structure (we know the approximate location anyways).
28999 Test if the argument is a variable-reference, if not, then
29000 complain with a 206.
29002 (Argument.Emit): Emit addresses of variables.
29004 (Argument.FullDesc): Simplify.
29006 (Invocation.DoResolve): Update for Argument.Resolve.
29008 (ElementAccess.DoResolve): ditto.
29010 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
29011 method should be virtual, as this method is always virtual.
29013 (NewDelegate.DoResolve): Update for Argument.Resolve.
29015 * class.cs (ConstructorInitializer.DoResolve): ditto.
29017 * attribute.cs (Attribute.Resolve): ditto.
29019 2001-11-13 Miguel de Icaza <miguel@ximian.com>
29021 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
29023 * expression.cs (ParameterReference): Drop IStackStorage and implement
29024 IAssignMethod instead.
29026 (LocalVariableReference): ditto.
29028 * ecore.cs (FieldExpr): Drop IStackStorage and implement
29029 IAssignMethod instead.
29031 2001-11-13 Miguel de Icaza <miguel@ximian.com>
29033 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
29034 enumerations that are used in heavily used structures derive from
29035 byte in a laughable and pathetic attempt to reduce memory usage.
29036 This is the kind of pre-optimzations that you should not do at
29037 home without adult supervision.
29039 * expression.cs (UnaryMutator): New class, used to handle ++ and
29040 -- separatedly from the other unary operators. Cleans up the
29041 code, and kills the ExpressionStatement dependency in Unary.
29043 (Unary): Removed `method' and `Arguments' from this class, making
29044 it smaller, and moving it all to SimpleCall, so I can reuse this
29045 code in other locations and avoid creating a lot of transient data
29046 strucutres when not required.
29048 * cs-parser.jay: Adjust for new changes.
29050 2001-11-11 Miguel de Icaza <miguel@ximian.com>
29052 * enum.cs (Enum.Populate): If there is a failure during
29055 * cs-parser.jay (opt_enum_base): we used to catch type errors
29056 here, but this is really incorrect. The type error should be
29057 catched during semantic analysis.
29059 2001-12-11 Ravi Pratap <ravi@ximian.com>
29061 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
29062 current_local_parameters as expected since I, in my stupidity, had forgotten
29065 * attribute.cs (GetValidPlaces): Fix stupid bug.
29067 * class.cs (Method::Emit): Perform check on applicability of attributes.
29069 (Constructor::Emit): Ditto.
29071 (Field::Emit): Ditto.
29073 (Field.Location): Store location information.
29075 (Property, Event, Indexer, Operator): Ditto.
29077 * cs-parser.jay (field_declaration): Pass in location for each field.
29079 * ../errors/cs0592.cs : Add.
29081 2001-11-12 Ravi Pratap <ravi@ximian.com>
29083 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
29085 (InitCoreTypes): Update accordingly.
29087 (RegisterAttrType, LookupAttr): Implement.
29089 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
29090 info about the same.
29092 (Resolve): Update to populate the above as necessary.
29094 (Error592): Helper.
29096 (GetValidPlaces): Helper to the above.
29098 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29100 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29102 2001-11-12 Ravi Pratap <ravi@ximian.com>
29104 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29106 * ../errors/cs0617.cs : Add.
29108 2001-11-11 Ravi Pratap <ravi@ximian.com>
29110 * enum.cs (Emit): Rename to Populate to be more consistent with what
29111 we expect it to do and when exactly it is called.
29113 * class.cs, rootcontext.cs : Update accordingly.
29115 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29116 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29118 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29120 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29121 of a fieldinfo using the above, when dealing with a FieldBuilder.
29123 2001-11-10 Ravi Pratap <ravi@ximian.com>
29125 * ../errors/cs0031.cs : Add.
29127 * ../errors/cs1008.cs : Add.
29129 * ../errrors/cs0543.cs : Add.
29131 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29134 (FindMembers): Implement.
29136 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29137 enums and delegates too.
29139 (enum_types): Rename to builder_to_enum.
29141 (delegate_types): Rename to builder_to_delegate.
29143 * delegate.cs (FindMembers): Implement.
29145 2001-11-09 Ravi Pratap <ravi@ximian.com>
29147 * typemanager.cs (IsEnumType): Implement.
29149 * enum.cs (Emit): Re-write parts to account for the underlying type
29150 better and perform checking etc.
29152 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29153 of the underlying type.
29155 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29158 * enum.cs (error31): Helper to report error #31.
29160 * cs-parser.jay (enum_declaration): Store location of each member too.
29162 * enum.cs (member_to_location): New hashtable.
29164 (AddEnumMember): Update location hashtable.
29166 (Emit): Use the location of each member while reporting errors.
29168 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29170 * cs-parser.jay: A for_initializer if is a
29171 local_variable_declaration really ammount to have an implicit
29172 block with the variable declaration and no initializer for for.
29174 * statement.cs (For.Emit): Cope with null initializers.
29176 This fixes the infinite loop on for initializers.
29178 2001-11-08 Miguel de Icaza <miguel@ximian.com>
29180 * enum.cs: More cleanup.
29182 * ecore.cs: Remove dead code.
29184 * class.cs (Property.Emit): More simplification.
29185 (Event.Emit): ditto.
29187 Reworked to have less levels of indentation.
29189 2001-11-08 Ravi Pratap <ravi@ximian.com>
29191 * class.cs (Property): Emit attributes.
29201 * enum.cs (Emit): Ditto.
29203 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29206 * class.cs (Field, Event, etc.): Move attribute generation into the
29207 Emit method everywhere.
29209 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29210 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29211 as we had no way of defining nested enums !
29213 * rootcontext.cs : Adjust code accordingly.
29215 * typemanager.cs (AddEnumType): To keep track of enum types separately.
29217 2001-11-07 Ravi Pratap <ravi@ximian.com>
29219 * expression.cs (EvalConstantExpression): Move into ecore.cs
29221 * enum.cs (Enum): Rename some members and make them public and readonly
29222 according to our convention.
29224 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29227 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29229 (Enum::Emit): Write a simple version for now which doesn't try to compute
29230 expressions. I shall modify this to be more robust in just a while.
29232 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29234 (TypeContainer::CloseType): Create the Enum types too.
29236 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29238 * expression.cs (EvalConstantExpression): Get rid of completely.
29240 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29241 user-defined values and other cases.
29243 (IsValidEnumLiteral): Helper function.
29245 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
29246 out there in the case we had a literal FieldExpr.
29248 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29250 (Literalize): Revamp a bit to take two arguments.
29252 (EnumLiteral): New class which derives from Literal to wrap enum literals.
29254 2001-11-06 Ravi Pratap <ravi@ximian.com>
29256 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29258 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29260 (Resolve): Use the above to ensure we have proper initializers.
29262 2001-11-05 Ravi Pratap <ravi@ximian.com>
29264 * expression.cs (Expression::EvalConstantExpression): New method to
29265 evaluate constant expressions.
29267 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29269 2001-11-07 Miguel de Icaza <miguel@ximian.com>
29271 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29274 (Binary.ResolveOperator): Handle operator != (object a, object b)
29275 and operator == (object a, object b);
29277 (Binary.DoNumericPromotions): Indicate whether the numeric
29278 promotion was possible.
29280 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29283 Made the ArrayAccess implement interface IAssignMethod instead of
29284 IStackStore as the order in which arguments are passed reflects
29287 * assign.cs: Instead of using expr.ExprClass to select the way of
29288 assinging, probe for the IStackStore/IAssignMethod interfaces.
29290 * typemanager.cs: Load InitializeArray definition.
29292 * rootcontext.cs (RootContext.MakeStaticData): Used to define
29293 static data that can be used to initialize arrays.
29295 2001-11-05 Miguel de Icaza <miguel@ximian.com>
29297 * expression.cs: Handle operator== and operator!= for booleans.
29299 (Conditioal.Reduce): Implement reducer for the ?: operator.
29301 (Conditional.Resolve): Implement dead code elimination.
29303 (Binary.Resolve): Catch string literals and return a new
29304 concatenated string.
29306 (Unary.Reduce): Implement reduction of unary expressions.
29308 * ecore.cs: Split out the expression core handling here.
29310 (Expression.Reduce): New method used to perform constant folding
29311 and CSE. This is needed to support constant-expressions.
29313 * statement.cs (Statement.EmitBoolExpression): Pass true and false
29314 targets, and optimize for !x.
29316 2001-11-04 Ravi Pratap <ravi@ximian.com>
29318 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29319 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29320 set custom atttributes.
29322 * literal.cs (Literal::GetValue): New abstract method to return the actual
29323 value of the literal, cast as an object.
29325 (*Literal): Implement GetValue method.
29327 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29328 expressions to the arraylist but objects of type Argument.
29330 * class.cs (TypeContainer::Emit): Emit our attributes too.
29332 (Method::Emit, Constructor::Emit): Ditto.
29334 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29335 to be ignoring earlier.
29337 2001-11-03 Ravi Pratap <ravi@ximian.com>
29339 * attribute.cs (AttributeSection::Define): Implement to do the business
29340 of constructing a CustomAttributeBuilder.
29342 (Attribute): New trivial class. Increases readability of code.
29344 * cs-parser.jay : Update accordingly.
29346 (positional_argument_list, named_argument_list, named_argument): New rules
29348 (attribute_arguments): Use the above so that we are more correct.
29350 2001-11-02 Ravi Pratap <ravi@ximian.com>
29352 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29353 to perform all checks for a method with a params parameter.
29355 (Invocation::OverloadResolve): Update to use the above method and therefore
29356 cope correctly with params method invocations.
29358 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
29361 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29362 constructors in our parent too because we can't afford to miss out on
29365 * attribute.cs (AttributeSection): New name for the class Attribute
29367 Other trivial changes to improve readability.
29369 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29370 use the new class names.
29372 2001-11-01 Ravi Pratap <ravi@ximian.com>
29374 * class.cs (Method::Define): Complete definition for params types too
29376 (Indexer::Define): Ditto.
29378 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29379 Cope everywhere with a request for info about the array parameter.
29381 2001-11-01 Ravi Pratap <ravi@ximian.com>
29383 * tree.cs (RecordNamespace): Fix up to check for the correct key.
29385 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
29386 local_variable_type to extract the string corresponding to the type.
29388 (local_variable_type): Fixup the action to use the new helper method.
29390 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
29393 * expression.cs : Clean out code which uses the above.
29395 2001-10-31 Ravi Pratap <ravi@ximian.com>
29397 * typemanager.cs (RegisterMethod): Check if we already have an existing key
29398 and bale out if necessary by returning a false.
29400 (RegisterProperty): Ditto.
29402 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29403 and print out appropriate error messages.
29405 * interface.cs (everywhere): Ditto.
29407 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29408 location to constructor.
29410 * class.cs (Property, Event, Indexer): Update accordingly.
29412 * ../errors/cs111.cs : Added.
29414 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29415 of a method, as laid down by the spec.
29417 (Invocation::OverloadResolve): Use the above method.
29419 2001-10-31 Ravi Pratap <ravi@ximian.com>
29421 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29422 now take a TypeContainer and a Parameters object.
29424 (ParameterData): Modify return type of ParameterModifier method to be
29425 Parameter.Modifier and not a string.
29427 (ReflectionParameters, InternalParameters): Update accordingly.
29429 * expression.cs (Argument::GetParameterModifier): Same here.
29431 * support.cs (InternalParameters::ParameterType): Find a better way of determining
29432 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29433 symbol in it at all so maybe this is only for now.
29435 2001-10-30 Ravi Pratap <ravi@ximian.com>
29437 * support.cs (InternalParameters): Constructor now takes an extra argument
29438 which is the actual Parameters class.
29440 (ParameterDesc): Update to provide info on ref/out modifiers.
29442 * class.cs (everywhere): Update call to InternalParameters to pass in
29443 the second argument too.
29445 * support.cs (ParameterData): Add ParameterModifier, which is a method
29446 to return the modifier info [ref/out etc]
29448 (InternalParameters, ReflectionParameters): Implement the above.
29450 * expression.cs (Argument::ParameterModifier): Similar function to return
29451 info about the argument's modifiers.
29453 (Invocation::OverloadResolve): Update to take into account matching modifiers
29456 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29457 a new SetFormalParameters object which we pass to InternalParameters.
29459 2001-10-30 Ravi Pratap <ravi@ximian.com>
29461 * expression.cs (NewArray): Merge into the ArrayCreation class.
29463 2001-10-29 Ravi Pratap <ravi@ximian.com>
29465 * expression.cs (NewArray): Merge classes NewBuiltinArray and
29466 NewUserdefinedArray into one as there wasn't much of a use in having
29469 * expression.cs (Argument): Change field's name to ArgType from Type.
29471 (Type): New readonly property which returns the proper type, taking into
29472 account ref/out modifiers.
29474 (everywhere): Adjust code accordingly for the above.
29476 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29477 whether we are emitting for a ref or out parameter.
29479 * expression.cs (Argument::Emit): Use the above field to set the state.
29481 (LocalVariableReference::Emit): Update to honour the flag and emit the
29484 * parameter.cs (Attributes): Set the correct flags for ref parameters.
29486 * expression.cs (Argument::FullDesc): New function to provide a full desc.
29488 * support.cs (ParameterData): Add method ParameterDesc to the interface.
29490 (ReflectionParameters, InternalParameters): Implement the above method.
29492 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29495 (Invocation::FullMethodDesc): Ditto.
29497 2001-10-29 Miguel de Icaza <miguel@ximian.com>
29499 * cs-parser.jay: Add extra production for the second form of array
29502 * expression.cs (ArrayCreation): Update to reflect the above
29505 * Small changes to prepare for Array initialization.
29507 2001-10-28 Miguel de Icaza <miguel@ximian.com>
29509 * typemanager.cs (ImplementsInterface): interface might be null;
29510 Deal with this problem;
29512 Also, we do store negative hits on the cache (null values), so use
29513 this instead of calling t.GetInterfaces on the type everytime.
29515 2001-10-28 Ravi Pratap <ravi@ximian.com>
29517 * typemanager.cs (IsBuiltinType): New method to help determine the same.
29519 * expression.cs (New::DoResolve): Get rid of array creation code and instead
29520 split functionality out into different classes.
29522 (New::FormArrayType): Move into NewBuiltinArray.
29524 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29527 (NewBuiltinArray): New class to handle creation of built-in arrays.
29529 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29530 account creation of one-dimensional arrays.
29532 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29534 (NewUserdefinedArray::DoResolve): Implement.
29536 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29538 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29539 we maintain inside the TypeManager. This is necessary to perform lookups on the
29542 (LookupType): Update to perform GetType on the module builders too.
29544 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29546 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29548 2001-10-23 Ravi Pratap <ravi@ximian.com>
29550 * expression.cs (New::DoResolve): Implement guts of array creation.
29552 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29554 2001-10-27 Miguel de Icaza <miguel@ximian.com>
29556 * expression.cs: Fix bug I introduced lsat night that broke
29559 (Expression.Resolve): Report a 246 error (can not resolve name)
29560 if we find a SimpleName in the stream.
29562 (Expression.ResolveLValue): Ditto.
29564 (Expression.ResolveWithSimpleName): This function is a variant of
29565 ResolveName, this one allows SimpleNames to be returned without a
29566 warning. The only consumer of SimpleNames is MemberAccess
29568 2001-10-26 Miguel de Icaza <miguel@ximian.com>
29570 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29571 might arrive here. I have my doubts that this is correct.
29573 * statement.cs (Lock): Implement lock statement.
29575 * cs-parser.jay: Small fixes to support `lock' and `using'
29577 * cs-tokenizer.cs: Remove extra space
29579 * driver.cs: New flag --checked, allows to turn on integer math
29582 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29583 Threading.Monitor.Exit
29585 2001-10-23 Miguel de Icaza <miguel@ximian.com>
29587 * expression.cs (IndexerAccess::DoResolveLValue): Set the
29588 Expression Class to be IndexerAccess.
29590 Notice that Indexer::DoResolve sets the eclass to Value.
29592 2001-10-22 Miguel de Icaza <miguel@ximian.com>
29594 * class.cs (TypeContainer::Emit): Emit code for indexers.
29596 * assign.cs (IAssignMethod): New interface implemented by Indexers
29597 and Properties for handling assignment.
29599 (Assign::Emit): Simplify and reuse code.
29601 * expression.cs (IndexerAccess, PropertyExpr): Implement
29602 IAssignMethod, clean up old code.
29604 2001-10-22 Ravi Pratap <ravi@ximian.com>
29606 * typemanager.cs (ImplementsInterface): New method to determine if a type
29607 implements a given interface. Provides a nice cache too.
29609 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29612 (ConvertReferenceExplicit): Ditto.
29614 * delegate.cs (Delegate::Populate): Update to define the parameters on the
29615 various methods, with correct names etc.
29617 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
29618 Operator.UnaryNegation.
29620 * cs-parser.jay (operator_declarator): Be a little clever in the case where
29621 we have a unary plus or minus operator.
29623 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
29626 * everywhere : update accordingly.
29628 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29631 * class.cs (Method::Define): For the case where we are implementing a method
29632 inherited from an interface, we need to set the MethodAttributes.Final flag too.
29633 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29635 2001-10-21 Ravi Pratap <ravi@ximian.com>
29637 * interface.cs (FindMembers): Implement to work around S.R.E
29640 * typemanager.cs (IsInterfaceType): Implement.
29642 (FindMembers): Update to handle interface types too.
29644 * expression.cs (ImplicitReferenceConversion): Re-write bits which
29645 use IsAssignableFrom as that is not correct - it doesn't work.
29647 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29648 and accordingly override EmitStatement.
29650 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29651 using the correct logic :-)
29653 2001-10-19 Ravi Pratap <ravi@ximian.com>
29655 * ../errors/cs-11.cs : Add to demonstrate error -11
29657 2001-10-17 Miguel de Icaza <miguel@ximian.com>
29659 * assign.cs (Assign::Resolve): Resolve right hand side first, and
29660 then pass this as a hint to ResolveLValue.
29662 * expression.cs (FieldExpr): Add Location information
29664 (FieldExpr::LValueResolve): Report assignment to readonly
29667 (Expression::ExprClassFromMemberInfo): Pass location information.
29669 (Expression::ResolveLValue): Add new method that resolves an
29672 (Expression::DoResolveLValue): Default invocation calls
29675 (Indexers): New class used to keep track of indexers in a given
29678 (IStackStore): Renamed from LValue, as it did not really describe
29679 what this did. Also ResolveLValue is gone from this interface and
29680 now is part of Expression.
29682 (ElementAccess): Depending on the element access type
29684 * typemanager.cs: Add `indexer_name_type' as a Core type
29685 (System.Runtime.CompilerServices.IndexerNameAttribute)
29687 * statement.cs (Goto): Take a location.
29689 2001-10-18 Ravi Pratap <ravi@ximian.com>
29691 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29692 if two delegates are compatible.
29694 (NewDelegate::DoResolve): Update to take care of the case when
29695 we instantiate a delegate from another delegate.
29697 * typemanager.cs (FindMembers): Don't even try to look up members
29698 of Delegate types for now.
29700 2001-10-18 Ravi Pratap <ravi@ximian.com>
29702 * delegate.cs (NewDelegate): New class to take care of delegate
29705 * expression.cs (New): Split the delegate related code out into
29706 the NewDelegate class.
29708 * delegate.cs (DelegateInvocation): New class to handle delegate
29711 * expression.cs (Invocation): Split out delegate related code into
29712 the DelegateInvocation class.
29714 2001-10-17 Ravi Pratap <ravi@ximian.com>
29716 * expression.cs (New::DoResolve): Implement delegate creation fully
29717 and according to the spec.
29719 (New::DoEmit): Update to handle delegates differently.
29721 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29722 because of which we were printing out arguments in reverse order !
29724 * delegate.cs (VerifyMethod): Implement to check if the given method
29725 matches the delegate.
29727 (FullDelegateDesc): Implement.
29729 (VerifyApplicability): Implement.
29731 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29732 delegate invocations too.
29734 (Invocation::Emit): Ditto.
29736 * ../errors/cs1593.cs : Added.
29738 * ../errors/cs1594.cs : Added.
29740 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29742 2001-10-16 Ravi Pratap <ravi@ximian.com>
29744 * typemanager.cs (intptr_type): Core type for System.IntPtr
29746 (InitCoreTypes): Update for the same.
29748 (iasyncresult_type, asynccallback_type): Ditto.
29750 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29753 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29756 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29757 the builders for the 4 members of a delegate type :-)
29759 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29762 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29764 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29766 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29768 * statement.cs (Break::Emit): Implement.
29769 (Continue::Emit): Implement.
29771 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29772 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29773 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29774 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29777 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29778 properties that track the label for the current loop (begin of the
29779 loop and end of the loop).
29781 2001-10-15 Ravi Pratap <ravi@ximian.com>
29783 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29784 use of emitting anything at all.
29786 * class.cs, rootcontext.cs : Get rid of calls to the same.
29788 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29790 (Populate): Define the constructor correctly and set the implementation
29793 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29796 (AddDelegateType): Implement.
29798 (IsDelegateType): Implement helper method.
29800 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29802 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29803 and accordingly handle it.
29805 * delegate.cs (Populate): Take TypeContainer argument.
29806 Implement bits to define the Invoke method. However, I still haven't figured out
29807 how to take care of the native int bit :-(
29809 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29810 Qualify the name of the delegate, not its return type !
29812 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29815 (StandardConversionExists): Checking for array types turns out to be recursive.
29817 (ConvertReferenceExplicit): Implement array conversion.
29819 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29821 2001-10-12 Ravi Pratap <ravi@ximian.com>
29823 * cs-parser.jay (delegate_declaration): Store the fully qualified
29824 name as it is a type declaration.
29826 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29829 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29830 as TypeContainer::DefineType.
29832 (Populate): Method in which all the definition of the various methods (Invoke)
29835 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29838 (CloseDelegate): Finally creates the delegate.
29840 * class.cs (TypeContainer::DefineType): Update to define delegates.
29841 (Populate, Emit and CloseType): Do the same thing here too.
29843 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29844 delegates in all these operations.
29846 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29848 * expression.cs: LocalTemporary: a new expression used to
29849 reference a temporary that has been created.
29851 * assign.cs: Handle PropertyAccess back here, so that we can
29852 provide the proper semantic access to properties.
29854 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29855 a few more explicit conversions.
29857 * modifiers.cs: `NEW' modifier maps to HideBySig.
29859 * expression.cs (PropertyExpr): Make this into an
29860 ExpressionStatement, and support the EmitStatement code path.
29862 Perform get/set error checking, clean up the interface.
29864 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29865 them into toplevel access objects.
29867 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29869 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29872 * typemanager.cs: Keep track here of our PropertyBuilders again to
29873 work around lameness in SRE.
29875 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29877 * expression.cs (LValue::LValueResolve): New method in the
29878 interface, used to perform a second resolution pass for LValues.
29880 (This::DoResolve): Catch the use of this in static methods.
29882 (This::LValueResolve): Implement.
29884 (This::Store): Remove warning, assigning to `this' in structures
29887 (Invocation::Emit): Deal with invocation of
29888 methods on value types. We need to pass the address to structure
29889 methods rather than the object itself. (The equivalent code to
29890 emit "this" for structures leaves the entire structure on the
29891 stack instead of a pointer to it).
29893 (ParameterReference::DoResolve): Compute the real index for the
29894 argument based on whether the method takes or not a `this' pointer
29895 (ie, the method is static).
29897 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29898 value types returned from functions when we need to invoke a
29899 method on the sturcture.
29902 2001-10-11 Ravi Pratap <ravi@ximian.com>
29904 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29905 defining the type in the Modulebuilder or Typebuilder. This is to take
29906 care of nested types which need to be defined on the TypeBuilder using
29907 DefineNestedMethod.
29909 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29910 methods in RootContext, only ported to be part of TypeContainer.
29912 (TypeContainer::GetInterfaceOrClass): Ditto.
29914 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29916 * interface.cs (Interface::DefineInterface): New method. Does exactly
29917 what RootContext.CreateInterface did earlier, only it takes care of nested types
29920 (Interface::GetInterfaces): Move from RootContext here and port.
29922 (Interface::GetInterfaceByName): Same here.
29924 * rootcontext.cs (ResolveTree): Re-write.
29926 (PopulateTypes): Re-write.
29928 * class.cs (TypeContainer::Populate): Populate nested types too.
29929 (TypeContainer::Emit): Emit nested members too.
29931 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29932 instead just use the name argument passed in as it is already fully
29935 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29936 to TypeContainer mapping to see if a type is user-defined.
29938 * class.cs (TypeContainer::CloseType): Implement.
29940 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29941 the default constructor.
29943 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29946 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29948 * interface.cs (CloseType): Create the type here.
29950 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29953 Remove all the methods which are now in TypeContainer.
29955 2001-10-10 Ravi Pratap <ravi@ximian.com>
29957 * delegate.cs (Define): Re-write bits to define the delegate
29960 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29962 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29964 * expression.cs (ImplicitReferenceConversion): handle null as well
29965 as a source to convert to any reference type.
29967 * statement.cs (Return): Perform any implicit conversions to
29968 expected return type.
29970 Validate use of return statement.
29972 * codegen.cs (EmitContext): Pass the expected return type here.
29974 * class.cs (Method, Constructor, Property): Pass expected return
29975 type to EmitContext.
29977 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29979 * expression.cs: Make DoResolve take an EmitContext instead of a
29982 Replaced `l' and `location' for `loc', for consistency.
29984 (Error, Warning): Remove unneeded Tc argument.
29986 * assign.cs, literal.cs, constant.cs: Update to new calling
29989 * codegen.cs: EmitContext now contains a flag indicating whether
29990 code is being generated in a static method or not.
29992 * cs-parser.jay: DecomposeQI, new function that replaces the old
29993 QualifiedIdentifier. Now we always decompose the assembled
29994 strings from qualified_identifier productions into a group of
29997 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29999 * rootcontext.cs: Deal with field-less struct types correctly now
30000 by passing the size option to Define Type.
30002 * class.cs: Removed hack that created one static field.
30004 2001-10-07 Miguel de Icaza <miguel@ximian.com>
30006 * statement.cs: Moved most of the code generation here.
30008 2001-10-09 Ravi Pratap <ravi@ximian.com>
30010 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
30013 (ElementAccess): Remove useless bits for now - keep checks as the spec
30016 2001-10-08 Ravi Pratap <ravi@ximian.com>
30018 * expression.cs (ElementAccess::DoResolve): Remove my crap code
30019 and start performing checks according to the spec.
30021 2001-10-07 Ravi Pratap <ravi@ximian.com>
30023 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
30024 rank_specifiers instead.
30026 (rank_specifiers): Change the order in which the rank specifiers are stored
30028 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
30030 * expression.cs (ElementAccess): Implement the LValue interface too.
30032 2001-10-06 Ravi Pratap <ravi@ximian.com>
30034 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
30035 except that user defined conversions are not included.
30037 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
30038 perform the conversion of the return type, if necessary.
30040 (New::DoResolve): Check whether we are creating an array or an object
30041 and accordingly do the needful.
30043 (New::Emit): Same here.
30045 (New::DoResolve): Implement guts of array creation.
30047 (New::FormLookupType): Helper function.
30049 2001-10-07 Miguel de Icaza <miguel@ximian.com>
30051 * codegen.cs: Removed most of the code generation here, and move the
30052 corresponding code generation bits to the statement classes.
30054 Added support for try/catch/finalize and throw.
30056 * cs-parser.jay: Added support for try/catch/finalize.
30058 * class.cs: Catch static methods having the flags override,
30059 virtual or abstract.
30061 * expression.cs (UserCast): This user cast was not really doing
30062 what it was supposed to do. Which is to be born in fully resolved
30063 state. Parts of the resolution were being performed at Emit time!
30067 2001-10-05 Miguel de Icaza <miguel@ximian.com>
30069 * expression.cs: Implicity convert the result from UserCast.
30071 2001-10-05 Ravi Pratap <ravi@ximian.com>
30073 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
30074 prevented it from working correctly.
30076 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
30077 merely ConvertImplicit.
30079 2001-10-05 Miguel de Icaza <miguel@ximian.com>
30081 * typemanager.cs: Make the LookupTypeContainer function static,
30082 and not per-instance.
30084 * class.cs: Make static FindMembers (the one that takes a Type
30087 * codegen.cs: Add EmitForeach here.
30089 * cs-parser.jay: Make foreach a toplevel object instead of the
30090 inline expansion, as we need to perform semantic analysis on it.
30092 2001-10-05 Ravi Pratap <ravi@ximian.com>
30094 * expression.cs (Expression::ImplicitUserConversion): Rename to
30095 UserDefinedConversion.
30097 (Expression::UserDefinedConversion): Take an extra argument specifying
30098 whether we look for explicit user conversions too.
30100 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30102 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30104 (ExplicitUserConversion): Make it a call to UserDefinedConversion
30105 with the appropriate arguments.
30107 * cs-parser.jay (cast_expression): Record location too.
30109 * expression.cs (Cast): Record location info.
30111 (Expression::ConvertExplicit): Take location argument.
30113 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30114 to determine if we are doing explicit conversions.
30116 (UserCast::Emit): Update accordingly.
30118 (Expression::ConvertExplicit): Report an error if everything fails.
30120 * ../errors/cs0030.cs : Add.
30122 2001-10-04 Miguel de Icaza <miguel@ximian.com>
30124 * modifiers.cs: If the ABSTRACT keyword is present, also set the
30125 virtual and newslot bits.
30127 * class.cs (TypeContainer::RegisterRequiredImplementations):
30128 Record methods we need.
30130 (TypeContainer::MakeKey): Helper function to make keys for
30131 MethodBases, since the Methodbase key is useless.
30133 (TypeContainer::Populate): Call RegisterRequiredImplementations
30134 before defining the methods.
30136 Create a mapping for method_builders_to_methods ahead of time
30137 instead of inside a tight loop.
30139 (::RequireMethods): Accept an object as the data to set into the
30140 hashtable so we can report interface vs abstract method mismatch.
30142 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30144 * report.cs: Make all of it static.
30146 * rootcontext.cs: Drop object_type and value_type computations, as
30147 we have those in the TypeManager anyways.
30149 Drop report instance variable too, now it is a global.
30151 * driver.cs: Use try/catch on command line handling.
30153 Add --probe option to debug the error reporting system with a test
30156 * report.cs: Add support for exiting program when a probe
30157 condition is reached.
30159 2001-10-03 Ravi Pratap <ravi@ximian.com>
30161 * expression.cs (Binary::DoNumericPromotions): Fix the case when
30162 we do a forcible conversion regardless of type, to check if
30163 ForceConversion returns a null.
30165 (Binary::error19): Use location to report error.
30167 (Unary::error23): Use location here too.
30169 * ../errors/cs0019.cs : Check in.
30171 * ../errors/cs0023.cs : Check in.
30173 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30174 case of a non-null MethodInfo object with a length of 0 !
30176 (Binary::ResolveOperator): Flag error if overload resolution fails to find
30177 an applicable member - according to the spec :-)
30178 Also fix logic to find members in base types.
30180 (Unary::ResolveOperator): Same here.
30182 (Unary::report23): Change name to error23 and make first argument a TypeContainer
30183 as I was getting thoroughly confused between this and error19 :-)
30185 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30186 (::FindMostEncompassedType): Implement.
30187 (::FindMostEncompassingType): Implement.
30188 (::StandardConversionExists): Implement.
30190 (UserImplicitCast): Re-vamp. We now need info about most specific
30191 source and target types so that we can do the necessary conversions.
30193 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30194 mathematical union with no duplicates.
30196 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30198 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30199 in order from base classes to child classes, so that we can in
30200 child classes look up in our parent for method names and
30201 attributes (required for handling abstract, virtual, new, override
30202 constructs: we need to instrospect our base class, and if we dont
30203 populate the classes in order, the introspection might be
30204 incorrect. For example, a method could query its parent before
30205 the parent has any methods and would determine that the parent has
30206 no abstract methods (while it could have had them)).
30208 (RootContext::CreateType): Record the order in which we define the
30211 2001-10-02 Miguel de Icaza <miguel@ximian.com>
30213 * class.cs (TypeContainer::Populate): Also method definitions can
30214 fail now, keep track of this.
30216 (TypeContainer::FindMembers): Implement support for
30217 DeclaredOnly/noDeclaredOnly flag.
30219 (Constructor::Emit) Return the ConstructorBuilder.
30221 (Method::Emit) Return the MethodBuilder.
30222 Check for abstract or virtual methods to be public.
30224 * rootcontext.cs (RootContext::CreateType): Register all the
30225 abstract methods required for the class to be complete and the
30226 interface methods that must be implemented.
30228 * cs-parser.jay: Report error 501 (method requires body if it is
30229 not marked abstract or extern).
30231 * expression.cs (TypeOf::Emit): Implement.
30233 * typemanager.cs: runtime_handle_type, new global type.
30235 * class.cs (Property::Emit): Generate code for properties.
30237 2001-10-02 Ravi Pratap <ravi@ximian.com>
30239 * expression.cs (Unary::ResolveOperator): Find operators on base type
30240 too - we now conform exactly to the spec.
30242 (Binary::ResolveOperator): Same here.
30244 * class.cs (Operator::Define): Fix minor quirk in the tests.
30246 * ../errors/cs0215.cs : Added.
30248 * ../errors/cs0556.cs : Added.
30250 * ../errors/cs0555.cs : Added.
30252 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30254 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30255 single integer which is really efficient
30257 2001-10-01 Ravi Pratap <ravi@ximian.com>
30259 * expression.cs (Expression::ImplicitUserConversion): Use location
30260 even in the case when we are examining True operators.
30262 * class.cs (Operator::Define): Perform extensive checks to conform
30263 with the rules for operator overloading in the spec.
30265 * expression.cs (Expression::ImplicitReferenceConversion): Implement
30266 some of the other conversions mentioned in the spec.
30268 * typemanager.cs (array_type): New static member for the System.Array built-in
30271 (cloneable_interface): For System.ICloneable interface.
30273 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30274 we start resolving the tree and populating types.
30276 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30278 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30280 * expression.cs (Expression::ExprClassFromMemberInfo,
30281 Expression::Literalize): Create literal expressions from
30282 FieldInfos which are literals.
30284 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30285 type casts, because they were wrong. The test suite in tests
30288 (ImplicitNumericConversion): ushort to ulong requires a widening
30291 Int32 constant to long requires widening cast as well.
30293 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30294 for integers because the type on the stack is not i4.
30296 2001-09-30 Miguel de Icaza <miguel@ximian.com>
30298 * expression.cs (report118): require location argument.
30300 * parameter.cs: Do not dereference potential null value.
30302 * class.cs: Catch methods that lack the `new' keyword when
30303 overriding a name. Report warnings when `new' is used without
30304 anything being there to override.
30306 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30308 * class.cs: Only add constructor to hashtable if it is non-null
30309 (as now constructors can fail on define).
30311 (TypeManager, Class, Struct): Take location arguments.
30313 Catch field instance initialization in structs as errors.
30315 accepting_filter: a new filter for FindMembers that is static so
30316 that we dont create an instance per invocation.
30318 (Constructor::Define): Catch errors where a struct constructor is
30321 * cs-parser.jay: Pass location information for various new
30324 * delegate.cs (Delegate): take a location argument.
30326 * driver.cs: Do not call EmitCode if there were problesm in the
30327 Definition of the types, as many Builders wont be there.
30329 * decl.cs (Decl::Decl): Require a location argument.
30331 * cs-tokenizer.cs: Handle properly hex constants that can not fit
30332 into integers, and find the most appropiate integer for it.
30334 * literal.cs: Implement ULongLiteral.
30336 * rootcontext.cs: Provide better information about the location of
30337 failure when CreateType fails.
30339 2001-09-29 Miguel de Icaza <miguel@ximian.com>
30341 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30344 * expression.cs (Binary::CheckShiftArguments): Add missing type
30346 (Binary::ResolveOperator): Add type to the logical and and logical
30347 or, Bitwise And/Or and Exclusive Or code paths, it was missing
30350 (Binary::DoNumericPromotions): In the case where either argument
30351 is ulong (and most signed types combined with ulong cause an
30352 error) perform implicit integer constant conversions as well.
30354 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30356 * expression.cs (UserImplicitCast): Method should always be
30358 (Invocation::BetterConversion): Simplified test for IntLiteral.
30360 (Expression::ImplicitNumericConversion): Split this routine out.
30361 Put the code that performs implicit constant integer conversions
30364 (Expression::Resolve): Become a wrapper around DoResolve so we can
30365 check eclass and type being set after resolve.
30367 (Invocation::Badness): Remove this dead function
30369 (Binary::ResolveOperator): Do not compute the expensive argumnets
30370 unless we have a union for it.
30372 (Probe::Emit): Is needs to do an isinst and then
30373 compare against null.
30375 (::CanConvert): Added Location argument. If the Location argument
30376 is null (Location.Null), then we do not report errors. This is
30377 used by the `probe' mechanism of the Explicit conversion. We do
30378 not want to generate an error for something that the user
30379 explicitly requested to be casted. But the pipeline for an
30380 explicit cast first tests for potential implicit casts.
30382 So for now, if the Location is null, it means `Probe only' to
30383 avoid adding another argument. Might have to revise this
30386 (ClassCast): New class used to type cast objects into arbitrary
30387 classes (used in Explicit Reference Conversions).
30389 Implement `as' as well.
30391 Reverted all the patches from Ravi below: they were broken:
30393 * The use of `level' as a mechanism to stop recursive
30394 invocations is wrong. That was there just to catch the
30395 bug with a strack trace but not as a way of addressing
30398 To fix the problem we have to *understand* what is going
30399 on and the interactions and come up with a plan, not
30400 just get things going.
30402 * The use of the type conversion cache that I proposed
30403 last night had an open topic: How does this work across
30404 protection domains. A user defined conversion might not
30405 be public in the location where we are applying the
30406 conversion, a different conversion might be selected
30407 (ie, private A->B (better) but public B->A (worse),
30408 inside A, A->B applies, but outside it, B->A will
30411 * On top of that (ie, even if the above is solved),
30412 conversions in a cache need to be abstract. Ie, `To
30413 convert from an Int to a Short use an OpcodeCast', not
30414 `To convert from an Int to a Short use the OpcodeCast on
30415 the variable 5' (which is what this patch was doing).
30417 2001-09-28 Ravi Pratap <ravi@ximian.com>
30419 * expression.cs (Invocation::ConversionExists): Re-write to use
30420 the conversion cache
30422 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30423 cache all conversions done, not just user-defined ones.
30425 (Invocation::BetterConversion): The real culprit. Use ConversionExists
30426 to determine if a conversion exists instead of acutually trying to
30427 perform the conversion. It's faster too.
30429 (Expression::ConvertExplicit): Modify to use ConversionExists to check
30430 and only then attempt the implicit conversion.
30432 2001-09-28 Ravi Pratap <ravi@ximian.com>
30434 * expression.cs (ConvertImplicit): Use a cache for conversions
30435 already found. Check level of recursion and bail out if necessary.
30437 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30439 * typemanager.cs (string_concat_string_string, string_concat_object_object):
30440 Export standard methods that we expect for string operations.
30442 * statement.cs (Block::UsageWarning): Track usage of variables and
30443 report the errors for not used variables.
30445 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30448 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30450 * codegen.cs: remove unnneded code
30452 * expression.cs: Removed BuiltinTypeAccess class
30454 Fix the order in which implicit conversions are
30457 The previous fixed dropped support for boxed conversions (adding a
30458 test to the test suite now)
30460 (UserImplicitCast::CanConvert): Remove test for source being null,
30461 that code is broken. We should not feed a null to begin with, if
30462 we do, then we should track the bug where the problem originates
30463 and not try to cover it up here.
30465 Return a resolved expression of type UserImplicitCast on success
30466 rather than true/false. Ravi: this is what I was talking about,
30467 the pattern is to use a static method as a "constructor" for
30470 Also, do not create arguments until the very last minute,
30471 otherwise we always create the arguments even for lookups that
30472 will never be performed.
30474 (UserImplicitCast::Resolve): Eliminate, objects of type
30475 UserImplicitCast are born in a fully resolved state.
30477 * typemanager.cs (InitCoreTypes): Init also value_type
30478 (System.ValueType).
30480 * expression.cs (Cast::Resolve): First resolve the child expression.
30482 (LValue): Add new method AddressOf to be used by
30485 Change the argument of Store to take an EmitContext instead of an
30486 ILGenerator, because things like FieldExpr need to be able to call
30487 their children expression to generate the instance code.
30489 (Expression::Error, Expression::Warning): Sugar functions for
30492 (Expression::MemberLookup): Accept a TypeContainer instead of a
30493 Report as the first argument.
30495 (Expression::ResolvePrimary): Killed. I still want to improve
30496 this as currently the code is just not right.
30498 (Expression::ResolveMemberAccess): Simplify, but it is still
30501 (Unary::Resolve): Catch errors in AddressOf operators.
30503 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30504 index to a byte for the short-version, or the compiler will choose
30505 the wrong Emit call, which generates the wrong data.
30507 (ParameterReference::Emit, ::Store): same.
30509 (FieldExpr::AddressOf): Implement.
30511 * typemanager.cs: TypeManager: made public variable instead of
30514 * driver.cs: document --fatal.
30516 * report.cs (ErrorMessage, WarningMessage): new names for the old
30517 Error and Warning classes.
30519 * cs-parser.jay (member_access): Turn built-in access to types
30520 into a normal simplename
30522 2001-09-27 Ravi Pratap <ravi@ximian.com>
30524 * expression.cs (Invocation::BetterConversion): Fix to cope
30525 with q being null, since this was introducing a bug.
30527 * expression.cs (ConvertImplicit): Do built-in conversions first.
30529 2001-09-27 Ravi Pratap <ravi@ximian.com>
30531 * expression.cs (UserImplicitCast::Resolve): Fix bug.
30533 2001-09-27 Ravi Pratap <ravi@ximian.com>
30535 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30536 I had introduced long ago (what's new ?).
30538 * expression.cs (UserImplicitCast::CanConvert): Static method to do
30539 the work of all the checking.
30540 (ConvertImplicit): Call CanConvert and only then create object if necessary.
30541 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30543 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30544 that is the right way.
30546 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
30547 overloading resolution. Use everywhere instead of cutting and pasting code.
30549 (Binary::ResolveOperator): Use MakeUnionSet.
30551 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
30552 we have to convert to bool types. Not complete yet.
30554 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30556 * typemanager.cs (TypeManager::CSharpName): support ushort.
30558 * expression.cs (Expression::TryImplicitIntConversion): Attempts
30559 to provide an expression that performsn an implicit constant int
30560 conversion (section 6.1.6).
30561 (Expression::ConvertImplicitRequired): Reworked to include
30562 implicit constant expression conversions.
30564 (Expression::ConvertNumericExplicit): Finished.
30566 (Invocation::Emit): If InstanceExpression is null, then it means
30567 that we perform a call on this.
30569 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30571 * expression.cs (Unary::Emit): Remove some dead code.
30572 (Probe): Implement Resolve and Emit for `is'.
30573 (Expression::ConvertImplicitRequired): Attempt to do constant
30574 expression conversions here. Maybe should be moved to
30575 ConvertImplicit, but I am not sure.
30576 (Expression::ImplicitLongConstantConversionPossible,
30577 Expression::ImplicitIntConstantConversionPossible): New functions
30578 that tell whether is it possible to apply an implicit constant
30579 expression conversion.
30581 (ConvertNumericExplicit): Started work on explicit numeric
30584 * cs-parser.jay: Update operator constants.
30586 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30587 (Parameters::GetSignature): Hook up VerifyArgs here.
30588 (Parameters::VerifyArgs): Verifies that no two arguments have the
30591 * class.cs (Operator): Update the operator names to reflect the
30592 ones that the spec expects (as we are just stringizing the
30595 * expression.cs (Unary::ResolveOperator): Fix bug: Use
30596 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30597 previous usage did only work for our methods.
30598 (Expression::ConvertImplicit): Handle decimal implicit numeric
30599 conversions as well.
30600 (Expression::InternalTypeConstructor): Used to invoke constructors
30601 on internal types for default promotions.
30603 (Unary::Emit): Implement special handling for the pre/post
30604 increment/decrement for overloaded operators, as they need to have
30605 the same semantics as the other operators.
30607 (Binary::ResolveOperator): ditto.
30608 (Invocation::ConversionExists): ditto.
30609 (UserImplicitCast::Resolve): ditto.
30611 2001-09-26 Ravi Pratap <ravi@ximian.com>
30613 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30614 operator, return after emitting body. Regression tests pass again !
30616 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30617 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30618 (Invocation::OverloadResolve): Ditto.
30619 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30621 * everywhere : update calls to the above methods accordingly.
30623 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30625 * assign.cs (Assign): Make it inherit from ExpressionStatement.
30627 * expression.cs (ExpressionStatement): New base class used for
30628 expressions that can appear in statements, so that we can provide
30629 an alternate path to generate expression that do not leave a value
30632 (Expression::Emit, and all the derivatives): We no longer return
30633 whether a value is left on the stack or not. Every expression
30634 after being emitted leaves a single value on the stack.
30636 * codegen.cs (EmitContext::EmitStatementExpression): Use the
30637 facilties of ExpressionStatement if possible.
30639 * cs-parser.jay: Update statement_expression.
30641 2001-09-25 Miguel de Icaza <miguel@ximian.com>
30643 * driver.cs: Change the wording of message
30645 2001-09-25 Ravi Pratap <ravi@ximian.com>
30647 * expression.cs (Binary::ResolveOperator): Had forgottten to set
30648 the type of the expression to the return type of the method if
30649 we have an overloaded operator match ! The regression tests pass again !
30650 (Unary::ResolveOperator): Ditto.
30652 * expression.cs (Invocation::ConversionExists): Correct the member lookup
30653 to find "op_Implicit", not "implicit" ;-)
30654 (UserImplicitCast): New class to take care of user-defined implicit conversions.
30655 (ConvertImplicit, ForceConversion): Take TypeContainer argument
30657 * everywhere : Correct calls to the above accordingly.
30659 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30660 (ConvertImplicit): Do user-defined conversion if it exists.
30662 2001-09-24 Miguel de Icaza <miguel@ximian.com>
30664 * assign.cs: track location.
30665 (Resolve): Use implicit conversions on assignment.
30667 * literal.cs: Oops. Not good, Emit of short access values should
30668 pass (Bytes) or the wrong argument will be selected.
30670 * expression.cs (Unary::Emit): Emit code for -expr.
30672 (Unary::ResolveOperator): Handle `Substract' for non-constants
30673 (substract from zero from the non-constants).
30674 Deal with Doubles as well.
30676 (Expression::ConvertImplicitRequired): New routine that reports an
30677 error if no implicit conversion exists.
30679 (Invocation::OverloadResolve): Store the converted implicit
30680 expressions if we make them
30682 2001-09-24 Ravi Pratap <ravi@ximian.com>
30684 * class.cs (ConstructorInitializer): Take a Location argument.
30685 (ConstructorBaseInitializer): Same here.
30686 (ConstructorThisInitializer): Same here.
30688 * cs-parser.jay : Update all calls accordingly.
30690 * expression.cs (Unary, Binary, New): Take location argument.
30691 Update accordingly everywhere.
30693 * cs-parser.jay : Update all calls to the above to take a location
30696 * class.cs : Ditto.
30698 2001-09-24 Ravi Pratap <ravi@ximian.com>
30700 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30701 (Invocation::BetterConversion): Same here
30702 (Invocation::ConversionExists): Ditto.
30704 (Invocation::ConversionExists): Implement.
30706 2001-09-22 Ravi Pratap <ravi@ximian.com>
30708 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30709 Also take an additional TypeContainer argument.
30711 * All over : Pass in TypeContainer as argument to OverloadResolve.
30713 * typemanager.cs (CSharpName): Update to check for the string type and return
30716 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30719 2001-09-21 Ravi Pratap <ravi@ximian.com>
30721 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30722 (Invocation::BetterFunction): Implement.
30723 (Invocation::BetterConversion): Implement.
30724 (Invocation::ConversionExists): Skeleton, no implementation yet.
30726 Okay, things work fine !
30728 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30730 * typemanager.cs: declare and load enum_type, delegate_type and
30733 * expression.cs (Expression::Emit): Now emit returns a value that
30734 tells whether a value is left on the stack or not. This strategy
30735 might be reveted tomorrow with a mechanism that would address
30736 multiple assignments.
30737 (Expression::report118): Utility routine to report mismatches on
30740 (Unary::Report23): Report impossible type/operator combination
30743 (Unary::IsIncrementableNumber): Whether the type can be
30744 incremented or decremented with add.
30745 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30747 (Unary::ResolveOperator): Implement ++, !, ~,
30749 (Invocation::Emit): Deal with new Emit convetion.
30751 * All Expression derivatives: Updated their Emit method to return
30752 whether they leave values on the stack or not.
30754 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30755 stack for expressions that are statements.
30757 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30759 * expression.cs (LValue): New interface. Must be implemented by
30761 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30764 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30765 interface for generating code, simplifies the code.
30767 2001-09-20 Ravi Pratap <ravi@ximian.com>
30769 * expression.cs (everywhere): Comment out return statements in ::Resolve
30770 methods to avoid the warnings.
30772 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30774 * driver.cs (parse): Report error 2001 if we can not open the
30777 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30780 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30783 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30784 otherwise nested blocks end up with the same index.
30786 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30788 * expression.cs: Instead of having FIXMEs in the Resolve
30789 functions, throw exceptions so it is obvious that we are facing a
30792 * cs-parser.jay (invocation_expression): Pass Location information.
30794 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30795 Use a basename for those routines because .NET does not like paths
30798 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30801 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30803 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30804 are loading the correct data types (throws an exception if not).
30805 (TypeManager::InitCoreTypes): Use CoreLookupType
30807 * expression.cs (Unary::ResolveOperator): return the child
30808 expression for expressions which are just +expr.
30809 (Unary::ResolveOperator): Return negative literals for -LITERAL
30810 expressions (otherwise they are Unary {Literal}).
30811 (Invocation::Badness): Take into account `Implicit constant
30812 expression conversions'.
30814 * literal.cs (LongLiteral): Implement long literal class.
30815 (IntLiteral): export the `Value' of the intliteral.
30817 2001-09-19 Ravi Pratap <ravi@ximian.com>
30819 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30821 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30822 instead of 'Operator'
30824 * expression.cs (Binary::ResolveOperator): Update accordingly.
30825 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30828 * cs-parser.jay (unary_expression): Update to use the new names.
30830 * gen-treedump.cs (GetUnary): Same here.
30832 * expression.cs (Unary::Resolve): Implement.
30833 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30834 operators are found instead of making noise ;-)
30835 (Unary::ResolveOperator): New method to do precisely the same thing which
30836 Binary::ResolveOperator does for Binary expressions.
30837 (Unary.method, .Arguments): Add.
30838 (Unary::OperName): Implement.
30839 (Unary::ForceConversion): Copy and Paste !
30841 * class.cs (Operator::Define): Fix a small bug for the case when we have
30844 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30845 for the inbuilt operators. Only overloading works for now ;-)
30847 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30849 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30850 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30852 * expression.cs (This::Emit): Implement.
30853 (This::Resolve): Implement.
30854 (TypeOf:Resolve): Implement.
30855 (Expression::ResolveSimpleName): Add an implicit this to instance
30857 (MemberAccess::Resolve): Deal with Parameters and Fields.
30858 Bind instance variable to Field expressions.
30859 (FieldExpr::Instance): New field used to track the expression that
30860 represents the object instance.
30861 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30863 (FieldExpr::Emit): Implement.
30865 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30866 the last instruction contains a return opcode to avoid generating
30867 the last `ret' instruction (this generates correct code, and it is
30868 nice to pass the peverify output).
30870 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30871 initializer for static and instance variables.
30872 (Constructor::Emit): Allow initializer to be null in the case of
30873 static constructors. Only emit initializer for instance
30876 (TypeContainer::FindMembers): Return a null array if there are no
30879 Also fix the code for the MemberTypes.Method branch, as it was not
30880 scanning that for operators (or tried to access null variables before).
30882 * assign.cs (Assign::Emit): Handle instance and static fields.
30886 * driver.cs: Stop compilation if there are parse errors.
30888 * cs-parser.jay (constructor_declaration): Provide default base
30889 initializer for non-static constructors.
30890 (constructor_declarator): Do not provide a default base
30891 initializers if none was specified.
30892 Catch the fact that constructors should not have parameters.
30894 * class.cs: Do not emit parent class initializers for static
30895 constructors, that should be flagged as an error.
30897 2001-09-18 Ravi Pratap <ravi@ximian.com>
30899 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30900 Move back code into TypeContainer::Populate.
30902 2001-09-18 Ravi Pratap <ravi@ximian.com>
30904 * class.cs (TypeContainer::AddConstructor): Fix the check to
30905 compare against Name, not Basename.
30906 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30908 * cs-parser.jay : Update accordingly.
30910 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30911 for methods, don't forget to look into the operators too.
30912 (RegisterMethodBuilder): Helper method to take care of this for
30913 methods, constructors and operators.
30914 (Operator::Define): Completely revamp.
30915 (Operator.OperatorMethod, MethodName): New fields.
30916 (TypeContainer::Populate): Move the registering of builders into
30917 RegisterMethodBuilder.
30918 (Operator::Emit): Re-write.
30920 * expression.cs (Binary::Emit): Comment out code path to emit method
30921 invocation stuff for the case when we have a user defined operator. I am
30922 just not able to get it right !
30924 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30926 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30929 (Expression::MemberLookup): Provide a version that allows to
30930 specify the MemberTypes and BindingFlags.
30932 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30933 so it was not fetching variable information from outer blocks.
30935 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30936 Beforefieldinit as it was buggy.
30938 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30939 that Ravi put here.
30941 * class.cs (Constructor::Emit): Only emit if block is not null.
30942 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30943 deal with this by semantically definining it as if the user had
30946 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30947 constructors as we now "emit" them at a higher level.
30949 (TypeContainer::DefineDefaultConstructor): Used to define the
30950 default constructors if none was provided.
30952 (ConstructorInitializer): Add methods Resolve and Emit.
30954 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30956 2001-09-17 Ravi Pratap <ravi@ximian.com>
30958 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30959 the default constructor builder with our hashtable for methodbuilders
30962 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30963 and argument_count is 0 in which case we have a match.
30964 (Binary::ResolveOperator): More null checking and miscellaneous coding
30967 2001-09-17 Ravi Pratap <ravi@ximian.com>
30969 * rootcontext.cs (IsNameSpace): Compare against null.
30971 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30973 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30974 and Unary::Operator.
30976 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30979 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30980 we have overloaded operators.
30981 (Binary::ResolveOperator): Implement the part which does the operator overload
30984 * class.cs (Operator::Emit): Implement.
30985 (TypeContainer::Emit): Emit the operators we have too.
30987 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30988 the case when we have a user-defined operator.
30990 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30992 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30994 2001-09-16 Ravi Pratap <ravi@ximian.com>
30996 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30997 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30998 (Constructor::Emit): Implement.
30999 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
31000 if we have no work to do.
31001 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
31004 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
31005 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
31007 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
31010 2001-09-15 Ravi Pratap <ravi@ximian.com>
31012 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
31014 (Tree::RecordNamespace): Method to do what the name says ;-)
31015 (Tree::Namespaces): Property to get at the namespaces hashtable.
31017 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
31020 * rootcontext.cs (IsNamespace): Fixed it :-)
31022 2001-09-14 Miguel de Icaza <miguel@ximian.com>
31024 * class.cs (TypeContainer::FindMembers): Add support for
31026 (MethodCore): New class that encapsulates both the shared aspects
31027 of a Constructor and a Method.
31028 (Method, Constructor): Factored pieces into MethodCore.
31030 * driver.cs: Added --fatal which makes errors throw exceptions.
31031 Load System assembly as well as part of the standard library.
31033 * report.cs: Allow throwing exceptions on errors for debugging.
31035 * modifiers.cs: Do not use `parent', instead use the real type
31036 container to evaluate permission settings.
31038 * class.cs: Put Ravi's patch back in. He is right, and we will
31039 have to cope with the
31041 2001-09-14 Ravi Pratap <ravi@ximian.com>
31043 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
31044 FamORAssem, not FamANDAssem.
31046 2001-09-14 Miguel de Icaza <miguel@ximian.com>
31048 * driver.cs: Added --parse option that only parses its input files
31051 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
31052 incorrect. IsTopLevel is not used to tell whether an object is
31053 root_types or not (that can be achieved by testing this ==
31054 root_types). But to see if this is a top-level *class* (not
31055 necessarly our "toplevel" container).
31057 2001-09-14 Ravi Pratap <ravi@ximian.com>
31059 * enum.cs (Enum::Define): Modify to call the Lookup method on the
31060 parent instead of a direct call to GetType.
31062 2001-09-14 Ravi Pratap <ravi@ximian.com>
31064 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
31065 Modifiers.TypeAttr. This should just be a call to that method.
31067 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
31068 object so that we can determine if we are top-level or not.
31070 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
31073 * enum.cs (Enum::Define): Ditto.
31075 * modifiers.cs (FieldAttr): Re-write.
31077 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
31078 (TypeContainer::HaveStaticConstructor): New property to provide access
31079 to precisely that info.
31081 * modifiers.cs (MethodAttr): Re-write.
31082 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
31084 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
31085 of top-level types as claimed.
31087 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31089 * expression.cs (MemberLookup): Fruitless attempt to lookup
31090 constructors. Maybe I need to emit default constructors? That
31091 might be it (currently .NET emits this for me automatically).
31092 (Invocation::OverloadResolve): Cope with Arguments == null.
31093 (Invocation::EmitArguments): new function, shared by the new
31094 constructor and us.
31095 (Invocation::Emit): Handle static and instance methods. Emit
31096 proper call instruction for virtual or non-virtual invocations.
31097 (New::Emit): Implement.
31098 (New::Resolve): Implement.
31099 (MemberAccess:Resolve): Implement.
31100 (MethodGroupExpr::InstanceExpression): used conforming to the spec
31101 to track instances.
31102 (FieldExpr::Resolve): Set type.
31104 * support.cs: Handle empty arguments.
31106 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31107 SimpleLookup): Auxiliary routines to help parse a qualifier
31110 Update qualifier_identifier rule.
31112 * codegen.cs: Removed debugging messages.
31114 * class.cs: Make this a global thing, this acts just as a "key" to
31115 objects that we might have around.
31117 (Populate): Only initialize method_builders_to_methods once.
31119 * expression.cs (PropertyExpr): Initialize type from the
31122 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31123 Resolve pattern. Attempt to implicitly convert value to boolean.
31126 * expression.cs: Set the type for the int32/int32 argument case.
31127 (Binary::ResolveOperator): Set the return type to boolean for
31128 comparission operators
31130 * typemanager.cs: Remove debugging print code.
31132 (Invocation::Resolve): resolve type.
31134 * class.cs: Allocate a MemberInfo of the correct size, as the code
31135 elsewhere depends on the test to reflect the correct contents.
31137 (Method::) Keep track of parameters, due to System.Reflection holes
31139 (TypeContainer::Populate): Keep track of MethodBuilders to Method
31142 (TypeContainer::FindMembers): Use ArrayList and then copy an array
31143 of the exact size and return that.
31145 (Class::LookupMethodByBuilder): New function that maps
31146 MethodBuilders to its methods. Required to locate the information
31147 on methods because System.Reflection bit us again.
31149 * support.cs: New file, contains an interface ParameterData and
31150 two implementations: ReflectionParameters and InternalParameters
31151 used to access Parameter information. We will need to grow this
31154 * expression.cs (Invocation::GetParameterData): implement a cache
31155 and a wrapper around the ParameterData creation for methods.
31156 (Invocation::OverloadResolve): Use new code.
31158 2001-09-13 Ravi Pratap <ravi@ximian.com>
31160 * class.cs (TypeContainer::EmitField): Remove and move into
31161 (Field::Define): here and modify accordingly.
31162 (Field.FieldBuilder): New member.
31163 (TypeContainer::Populate): Update accordingly.
31164 (TypeContainer::FindMembers): Implement.
31166 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31168 * statement.cs: (VariableInfo::VariableType): New field to be
31169 initialized with the full type once it is resolved.
31171 2001-09-12 Miguel de Icaza <miguel@ximian.com>
31173 * parameter.cs (GetParameterInfo): Use a type cache to compute
31174 things only once, and to reuse this information
31176 * expression.cs (LocalVariableReference::Emit): Implement.
31177 (OpcodeCast::Emit): fix.
31179 (ParameterReference::Resolve): Implement.
31180 (ParameterReference::Emit): Implement.
31182 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31183 that are expressions need to stay as Expressions.
31185 * typemanager.cs (CSharpName): Returns the C# name of a type if
31188 * expression.cs (Expression::ConvertImplicit): New function that
31189 implements implicit type conversions.
31191 (Expression::ImplicitReferenceConversion): Implements implicit
31192 reference conversions.
31194 (EmptyCast): New type for transparent casts.
31196 (OpcodeCast): New type for casts of types that are performed with
31197 a sequence of bytecodes.
31199 (BoxedCast): New type used for casting value types into reference
31200 types. Emits a box opcode.
31202 (Binary::DoNumericPromotions): Implements numeric promotions of
31203 and computation of the Binary::Type.
31205 (Binary::EmitBranchable): Optimization.
31207 (Binary::Emit): Implement code emission for expressions.
31209 * typemanager.cs (TypeManager): Added two new core types: sbyte
31212 2001-09-12 Ravi Pratap <ravi@ximian.com>
31214 * class.cs (TypeContainer::FindMembers): Method which does exactly
31215 what Type.FindMembers does, only we don't have to use reflection. No
31216 implementation yet.
31218 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31219 typecontainer objects as we need to get at them.
31220 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31222 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31223 typecontainer object.
31225 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31226 of just a Report object.
31228 2001-09-11 Ravi Pratap <ravi@ximian.com>
31230 * class.cs (Event::Define): Go back to using the prefixes "add_" and
31232 (TypeContainer::Populate): Now define the delegates of the type too.
31233 (TypeContainer.Delegates): Property to access the list of delegates defined
31236 * delegates.cs (Delegate::Define): Implement partially.
31238 * modifiers.cs (TypeAttr): Handle more flags.
31240 2001-09-11 Ravi Pratap <ravi@ximian.com>
31242 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31244 (Operator::Define): Re-write logic to get types by using the LookupType method
31245 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31246 (Indexer::Define): Ditto.
31247 (Event::Define): Ditto.
31248 (Property::Define): Ditto.
31250 2001-09-10 Ravi Pratap <ravi@ximian.com>
31252 * class.cs (TypeContainer::Populate): Now define operators too.
31253 (TypeContainer.Operators): New property to access the list of operators
31255 (Operator.OperatorMethodBuilder): New member to hold the method builder
31256 for the operator we are defining.
31257 (Operator::Define): Implement.
31259 2001-09-10 Ravi Pratap <ravi@ximian.com>
31261 * class.cs (Event::Define): Make the prefixes of the accessor methods
31262 addOn_ and removeOn_
31264 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31265 of the location being passed in too. Ideally, this should go later since all
31266 error reporting should be done through the Report object.
31268 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31269 (Populate): Iterate thru the indexers we have and define them too.
31270 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31271 for the get and set accessors.
31272 (Indexer::Define): Implement.
31274 2001-09-09 Miguel de Icaza <miguel@ximian.com>
31276 * expression.cs (Binary::Resolve): Beginning of it. I scratched
31277 my previous implementation, did not work.
31279 * typemanager.cs: Add a couple of missing types (the longs).
31281 * literal.cs: Use TypeManager.bool_type instead of getting it.
31283 * expression.cs (EventExpr): New kind of expressions.
31284 (Expressio::ExprClassFromMemberInfo): finish
31286 2001-09-08 Miguel de Icaza <miguel@ximian.com>
31288 * assign.cs: Emit stores to static fields differently.
31290 2001-09-08 Ravi Pratap <ravi@ximian.com>
31292 * Merge in changes and adjust code to tackle conflicts. Backed out my
31293 code in Assign::Resolve ;-)
31295 2001-09-08 Ravi Pratap <ravi@ximian.com>
31297 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31298 instead Report.Error and also pass in the location.
31299 (CSharpParser::Lexer): New readonly property to return the reference
31300 to the Tokenizer object.
31301 (declare_local_variables): Use Report.Error with location instead of plain
31305 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31306 (Operator.CheckBinaryOperator): Ditto.
31308 * cs-parser.jay (operator_declarator): Update accordingly.
31310 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31311 (CheckBinaryOperator): Same here.
31313 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31314 on the name without any prefixes of namespace names etc. This is because we
31315 already might have something already fully qualified like
31316 'System.Console.WriteLine'
31318 * assign.cs (Resolve): Begin implementation. Stuck ;-)
31320 2001-09-07 Ravi Pratap <ravi@ximian.com>
31322 * cs-tokenizer.cs (location): Return a string which also contains
31325 * expression.cs (ElementAccess): New class for expressions of the
31326 type 'element access.'
31327 (BaseAccess): New class for expressions of the type 'base access.'
31328 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31331 * cs-parser.jay (element_access): Implement action.
31332 (base_access): Implement actions.
31333 (checked_expression, unchecked_expression): Implement.
31335 * cs-parser.jay (local_variable_type): Correct and implement.
31336 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31338 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31340 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31341 name and the specifiers.
31343 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31345 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
31346 making them all public ;-)
31348 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31351 2001-09-07 Miguel de Icaza <miguel@ximian.com>
31353 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31355 (FieldExpr, PropertyExprs): New resolved expressions.
31356 (SimpleName::MemberStaticCheck): Perform static checks for access
31357 to non-static fields on static methods. Maybe this should be
31358 generalized for MemberAccesses.
31359 (SimpleName::ResolveSimpleName): More work on simple name
31362 * cs-parser.jay (primary_expression/qualified_identifier): track
31363 the parameter index.
31365 * codegen.cs (CodeGen::Save): Catch save exception, report error.
31366 (EmitContext::EmitBoolExpression): Chain to expression generation
31367 instead of temporary hack.
31368 (::EmitStatementExpression): Put generic expression code generation.
31370 * assign.cs (Assign::Emit): Implement variable assignments to
31371 local variables, parameters and fields.
31373 2001-09-06 Miguel de Icaza <miguel@ximian.com>
31375 * statement.cs (Block::GetVariableInfo): New method, returns the
31376 VariableInfo for a variable name in a block.
31377 (Block::GetVariableType): Implement in terms of GetVariableInfo
31379 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31380 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31382 2001-09-06 Ravi Pratap <ravi@ximian.com>
31384 * cs-parser.jay (operator_declaration): Continue on my quest : update
31385 to take attributes argument.
31386 (event_declaration): Ditto.
31387 (enum_declaration): Ditto.
31388 (indexer_declaration): Ditto.
31390 * class.cs (Operator::Operator): Update constructor accordingly.
31391 (Event::Event): Ditto.
31393 * delegate.cs (Delegate::Delegate): Same here.
31395 * enum.cs (Enum::Enum): Same here.
31397 2001-09-05 Ravi Pratap <ravi@ximian.com>
31399 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31401 * ../tests/cs0658.cs : New file to demonstrate error 0658.
31403 * attribute.cs (Attributes): New class to encapsulate all attributes which were
31404 being passed around as an arraylist.
31405 (Attributes::AddAttribute): Method to add attribute sections.
31407 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31408 (struct_declaration): Update accordingly.
31409 (constant_declaration): Update.
31410 (field_declaration): Update.
31411 (method_header): Update.
31412 (fixed_parameter): Update.
31413 (parameter_array): Ditto.
31414 (property_declaration): Ditto.
31415 (destructor_declaration): Ditto.
31417 * class.cs (Struct::Struct): Update constructors accordingly.
31418 (Class::Class): Ditto.
31419 (Field::Field): Ditto.
31420 (Method::Method): Ditto.
31421 (Property::Property): Ditto.
31422 (TypeContainer::OptAttribute): update property's return type.
31424 * interface.cs (Interface.opt_attributes): New member.
31425 (Interface::Interface): Update to take the extra Attributes argument.
31427 * parameter.cs (Parameter::Parameter): Ditto.
31429 * constant.cs (Constant::Constant): Ditto.
31431 * interface.cs (InterfaceMemberBase): New OptAttributes field.
31432 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
31433 the attributes as a parameter.
31434 (InterfaceProperty): Update constructor call.
31435 (InterfaceEvent): Ditto.
31436 (InterfaceMethod): Ditto.
31437 (InterfaceIndexer): Ditto.
31439 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
31440 pass the attributes too.
31441 (interface_event_declaration): Ditto.
31442 (interface_property_declaration): Ditto.
31443 (interface_method_declaration): Ditto.
31444 (interface_declaration): Ditto.
31446 2001-09-05 Miguel de Icaza <miguel@ximian.com>
31448 * class.cs (Method::Define): Track the "static Main" definition to
31449 create an entry point.
31451 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31452 EntryPoint if we find it.
31454 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31455 (EmitContext::ig): Make this variable public.
31457 * driver.cs: Make the default output file be the first file name
31458 with the .exe extension.
31460 Detect empty compilations
31462 Handle various kinds of output targets. Handle --target and
31463 rename -t to --dumper.
31465 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31466 methods inherited from Expression return now an Expression. This
31467 will is used during the tree rewriting as we resolve them during
31470 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31471 the spec. Missing entirely is the information about
31472 accessability of elements of it.
31474 (Expression::ExprClassFromMemberInfo): New constructor for
31475 Expressions that creates a fully initialized Expression based on
31476 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31479 (Invocation::Resolve): Begin implementing resolution of invocations.
31481 * literal.cs (StringLiteral): Implement Emit.
31483 2001-09-05 Ravi Pratap <ravi@ximian.com>
31485 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31488 2001-09-04 Ravi Pratap <ravi@ximian.com>
31490 * cs-parser.jay (attribute_arguments): Implement actions.
31491 (attribute): Fix bug in production. Implement action.
31492 (attribute_list): Implement.
31493 (attribute_target): Implement.
31494 (attribute_target_specifier, opt_target_specifier): Implement
31495 (CheckAttributeTarget): New method to check if the attribute target
31497 (attribute_section): Implement.
31498 (opt_attributes): Implement.
31500 * attribute.cs : New file to handle attributes.
31501 (Attribute): Class to hold attribute info.
31503 * cs-parser.jay (opt_attribute_target_specifier): Remove production
31504 (attribute_section): Modify production to use 2 different rules to
31505 achieve the same thing. 1 s/r conflict down !
31506 Clean out commented, useless, non-reducing dimension_separator rules.
31508 * class.cs (TypeContainer.attributes): New member to hold list
31509 of attributes for a type.
31510 (Struct::Struct): Modify to take one more argument, the attribute list.
31511 (Class::Class): Ditto.
31512 (Field::Field): Ditto.
31513 (Method::Method): Ditto.
31514 (Property::Property): Ditto.
31516 * cs-parser.jay (struct_declaration): Update constructor call to
31517 pass in the attributes too.
31518 (class_declaration): Ditto.
31519 (constant_declaration): Ditto.
31520 (field_declaration): Ditto.
31521 (method_header): Ditto.
31522 (fixed_parameter): Ditto.
31523 (parameter_array): Ditto.
31524 (property_declaration): Ditto.
31526 * constant.cs (Constant::Constant): Update constructor similarly.
31527 Use System.Collections.
31529 * parameter.cs (Parameter::Parameter): Update as above.
31531 2001-09-02 Ravi Pratap <ravi@ximian.com>
31533 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31534 (TypeContainer.delegates): New member to hold list of delegates.
31536 * cs-parser.jay (delegate_declaration): Implement the action correctly
31537 this time as I seem to be on crack ;-)
31539 2001-09-02 Miguel de Icaza <miguel@ximian.com>
31541 * rootcontext.cs (RootContext::IsNamespace): new function, used to
31542 tell whether an identifier represents a namespace.
31544 * expression.cs (NamespaceExpr): A namespace expression, used only
31545 temporarly during expression resolution.
31546 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31547 utility functions to resolve names on expressions.
31549 2001-09-01 Miguel de Icaza <miguel@ximian.com>
31551 * codegen.cs: Add hook for StatementExpressions.
31553 * class.cs: Fix inverted test for static flag in methods.
31555 2001-09-02 Ravi Pratap <ravi@ximian.com>
31557 * class.cs (Operator::CheckUnaryOperator): Correct error number used
31558 to make it coincide with MS' number.
31559 (Operator::CheckBinaryOperator): Ditto.
31561 * ../errors/errors.txt : Remove error numbers added earlier.
31563 * ../errors/cs1019.cs : Test case for error # 1019
31565 * ../errros/cs1020.cs : Test case for error # 1020
31567 * cs-parser.jay : Clean out commented cruft.
31568 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31569 used anywhere - non-reducing rule.
31570 (namespace_declarations): Non-reducing rule - comment out.
31572 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31573 with TypeContainer::AddEnum.
31575 * delegate.cs : New file for delegate handling classes.
31576 (Delegate): Class for declaring delegates.
31578 * makefile : Update.
31580 * cs-parser.jay (delegate_declaration): Implement.
31582 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
31584 * class.cs (Event::Define): Implement.
31585 (Event.EventBuilder): New member.
31587 * class.cs (TypeContainer::Populate): Update to define all enums and events
31589 (Events): New property for the events arraylist we hold. Shouldn't we move to using
31590 readonly fields for all these cases ?
31592 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31594 * class.cs (Property): Revamp to use the convention of making fields readonly.
31595 Accordingly modify code elsewhere.
31597 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31598 the Define method of the Property class.
31600 * class.cs : Clean up applied patch and update references to variables etc. Fix
31602 (TypeContainer::Populate): Update to define all the properties we have. Also
31603 define all enumerations.
31605 * enum.cs (Define): Implement.
31607 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31609 * cs-parser.jay (overloadable_operator): The semantic value is an
31610 enum of the Operator class.
31611 (operator_declarator): Implement actions.
31612 (operator_declaration): Implement.
31614 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31615 validity of definitions.
31616 (Operator::CheckBinaryOperator): Static method to check for binary operators
31617 (TypeContainer::AddOperator): New method to add an operator to a type.
31619 * cs-parser.jay (indexer_declaration): Added line to actually call the
31620 AddIndexer method so it gets added ;-)
31622 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
31623 already taken care of by the MS compiler ?
31625 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31627 * class.cs (Operator): New class for operator declarations.
31628 (Operator::OpType): Enum for the various operators.
31630 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31632 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31633 ostensibly handle this in semantic analysis.
31635 * cs-parser.jay (general_catch_clause): Comment out
31636 (specific_catch_clauses, specific_catch_clause): Ditto.
31637 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31638 (catch_args, opt_catch_args): New productions.
31639 (catch_clause): Rewrite to use the new productions above
31640 (catch_clauses): Modify accordingly.
31641 (opt_catch_clauses): New production to use in try_statement
31642 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31643 and re-write the code in the actions to extract the specific and
31644 general catch clauses by being a little smart ;-)
31646 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31647 Hooray, try and catch statements parse fine !
31649 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31651 * statement.cs (Block::GetVariableType): Fix logic to extract the type
31652 string from the hashtable of variables.
31654 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31655 I end up making that mistake ;-)
31656 (catch_clauses): Fixed gross error which made Key and Value of the
31657 DictionaryEntry the same : $1 !!
31659 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31661 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31663 * cs-parser.jay (event_declaration): Correct to remove the semicolon
31664 when the add and remove accessors are specified.
31666 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31668 * cs-parser.jay (IndexerDeclaration): New helper class to hold
31669 information about indexer_declarator.
31670 (indexer_declarator): Implement actions.
31671 (parsing_indexer): New local boolean used to keep track of whether
31672 we are parsing indexers or properties. This is necessary because
31673 implicit_parameters come into picture even for the get accessor in the
31674 case of an indexer.
31675 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31677 * class.cs (Indexer): New class for indexer declarations.
31678 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31679 (TypeContainer::indexers): New member to hold list of indexers for the
31682 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31684 * cs-parser.jay (add_accessor_declaration): Implement action.
31685 (remove_accessor_declaration): Implement action.
31686 (event_accessors_declaration): Implement
31687 (variable_declarators): swap statements for first rule - trivial.
31689 * class.cs (Event): New class to hold information about event
31691 (TypeContainer::AddEvent): New method to add an event to a type
31692 (TypeContainer::events): New member to hold list of events.
31694 * cs-parser.jay (event_declaration): Implement actions.
31696 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31698 * cs-parser.jay (dim_separators): Implement. Make it a string
31699 concatenating all the commas together, just as they appear.
31700 (opt_dim_separators): Modify accordingly
31701 (rank_specifiers): Update accordingly. Basically do the same
31702 thing - instead, collect the brackets here.
31703 (opt_rank_sepcifiers): Modify accordingly.
31704 (array_type): Modify to actually return the complete type string
31705 instead of ignoring the rank_specifiers.
31706 (expression_list): Implement to collect the expressions
31707 (variable_initializer): Implement. We make it a list of expressions
31708 essentially so that we can handle the array_initializer case neatly too.
31709 (variable_initializer_list): Implement.
31710 (array_initializer): Make it a list of variable_initializers
31711 (opt_array_initializer): Modify accordingly.
31713 * expression.cs (New::NType): Add enumeration to help us
31714 keep track of whether we have an object/delegate creation
31715 or an array creation.
31716 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31717 members to hold data about array creation.
31718 (New:New): Modify to update NewType
31719 (New:New): New Overloaded contructor for the array creation
31722 * cs-parser.jay (array_creation_expression): Implement to call
31723 the overloaded New constructor.
31725 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31727 * class.cs (TypeContainer::Constructors): Return member
31728 constructors instead of returning null.
31730 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31732 * typemanager.cs (InitCoreTypes): Initialize the various core
31733 types after we have populated the type manager with the user
31734 defined types (this distinction will be important later while
31735 compiling corlib.dll)
31737 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31738 on Expression Classification. Now all expressions have a method
31739 `Resolve' and a method `Emit'.
31741 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31742 generation from working. Also add some temporary debugging
31745 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31747 * codegen.cs: Lots of code generation pieces. This is only the
31748 beginning, will continue tomorrow with more touches of polish. We
31749 handle the fundamentals of if, while, do, for, return. Others are
31750 trickier and I need to start working on invocations soon.
31752 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31755 * codegen.cs (EmitContext): New struct, used during code
31756 emission to keep a context. Most of the code generation will be
31759 * cs-parser.jay: Add embedded blocks to the list of statements of
31760 this block. So code generation proceeds in a top down fashion.
31762 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31764 * statement.cs: Add support for multiple child blocks.
31766 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31768 * codegen.cs (EmitCode): New function, will emit the code for a
31769 Block of code given a TypeContainer and its ILGenerator.
31771 * statement.cs (Block): Standard public readonly optimization.
31772 (Block::Block constructors): Link children.
31773 (Block::Child): Child Linker.
31774 (Block::EmitVariables): Emits IL variable declarations.
31776 * class.cs: Drop support for MethodGroups here, delay until
31778 (Method::): Applied the same simplification that I did before, and
31779 move from Properties to public readonly fields.
31780 (Method::ParameterTypes): Returns the parameter types for the
31781 function, and implements a cache that will be useful later when I
31782 do error checking and the semantic analysis on the methods is
31784 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31785 and made a method, optional argument tells whether this is a class
31786 or a structure to apply the `has-this' bit.
31787 (Method::GetCallingConvention): Implement, returns the calling
31789 (Method::Define): Defines the type, a second pass is performed
31790 later to populate the methods.
31792 (Constructor::ParameterTypes): implement a cache similar to the
31793 one on Method::ParameterTypes, useful later when we do semantic
31796 (TypeContainer::EmitMethod): New method. Emits methods.
31798 * expression.cs: Removed MethodGroup class from here.
31800 * parameter.cs (Parameters::GetCallingConvention): new method.
31802 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31804 * class.cs (TypeContainer::Populate): Drop RootContext from the
31807 (Constructor::CallingConvention): Returns the calling convention.
31808 (Constructor::ParameterTypes): Returns the constructor parameter
31811 (TypeContainer::AddConstructor): Keep track of default constructor
31812 and the default static constructor.
31814 (Constructor::) Another class that starts using `public readonly'
31815 instead of properties.
31817 (Constructor::IsDefault): Whether this is a default constructor.
31819 (Field::) use readonly public fields instead of properties also.
31821 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31822 track of static constructors; If none is used, turn on
31823 BeforeFieldInit in the TypeAttributes.
31825 * cs-parser.jay (opt_argument_list): now the return can be null
31826 for the cases where there are no arguments.
31828 (constructor_declarator): If there is no implicit `base' or
31829 `this', then invoke the default parent constructor.
31831 * modifiers.cs (MethodAttr): New static function maps a set of
31832 modifiers flags into a MethodAttributes enum
31833 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31834 MethodAttr, TypeAttr to represent the various mappings where the
31835 modifiers are used.
31836 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31838 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31840 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31843 * interface.cs (PopulateIndexer): Implemented the code generator
31844 for interface indexers.
31846 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31848 * interface.cs (InterfaceMemberBase): Now we track the new status
31851 (PopulateProperty): Implement property population. Woohoo! Got
31852 Methods and Properties going today.
31854 Removed all the properties for interfaces, and replaced them with
31855 `public readonly' fields.
31857 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31859 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31860 initialize their hashtables/arraylists only when they are needed
31861 instead of doing this always.
31863 * parameter.cs: Handle refs and out parameters.
31865 * cs-parser.jay: Use an ArrayList to construct the arguments
31866 instead of the ParameterCollection, and then cast that to a
31869 * parameter.cs: Drop the use of ParameterCollection and use
31870 instead arrays of Parameters.
31872 (GetParameterInfo): Use the Type, not the Name when resolving
31875 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31877 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31878 and instead use public readonly fields.
31880 * class.cs: Put back walking code for type containers.
31882 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31884 * class.cs (MakeConstant): Code to define constants.
31886 * rootcontext.cs (LookupType): New function. Used to locate types
31889 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31891 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31892 this System.Reflection code is. Kudos to Microsoft
31894 * typemanager.cs: Implement a type cache and avoid loading all
31895 types at boot time. Wrap in LookupType the internals. This made
31896 the compiler so much faster. Wow. I rule!
31898 * driver.cs: Make sure we always load mscorlib first (for
31899 debugging purposes, nothing really important).
31901 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31902 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31904 * rootcontext.cs: Lookup types on their namespace; Lookup types
31905 on namespaces that have been imported using the `using' keyword.
31907 * class.cs (TypeContainer::TypeAttr): Virtualize.
31908 (Class::TypeAttr): Return attributes suitable for this bad boy.
31909 (Struct::TypeAttr): ditto.
31910 Handle nested classes.
31911 (TypeContainer::) Remove all the type visiting code, it is now
31912 replaced with the rootcontext.cs code
31914 * rootcontext.cs (GetClassBases): Added support for structs.
31916 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31918 * interface.cs, statement.cs, class.cs, parameter.cs,
31919 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31920 Drop use of TypeRefs, and use strings instead.
31922 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31926 * class.cs (Struct::Struct): set the SEALED flags after
31927 checking the modifiers.
31928 (TypeContainer::TypeAttr): new property, returns the
31929 TypeAttributes for a class.
31931 * cs-parser.jay (type_list): Oops, list production was creating a
31932 new list of base types.
31934 * rootcontext.cs (StdLib): New property.
31935 (GetInterfaceTypeByName): returns an interface by type name, and
31936 encapsulates error handling here.
31937 (GetInterfaces): simplified.
31938 (ResolveTree): Encapsulated all the tree resolution here.
31939 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31942 * driver.cs: Add support for --nostdlib, to avoid loading the
31943 default assemblies.
31944 (Main): Do not put tree resolution here.
31946 * rootcontext.cs: Beginning of the class resolution.
31948 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31950 * rootcontext.cs: Provide better error reporting.
31952 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31954 * rootcontext.cs (CreateInterface): Handle the case where there
31955 are no parent interfaces.
31957 (CloseTypes): Routine to flush types at the end.
31958 (CreateInterface): Track types.
31959 (GetInterfaces): Returns an array of Types from the list of
31960 defined interfaces.
31962 * typemanager.c (AddUserType): Mechanism to track user types (puts
31963 the type on the global type hash, and allows us to close it at the
31966 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31968 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31969 RecordInterface instead.
31971 * cs-parser.jay: Updated to reflect changes above.
31973 * decl.cs (Definition): Keep track of the TypeBuilder type that
31974 represents this type here. Not sure we will use it in the long
31975 run, but wont hurt for now.
31977 * driver.cs: Smaller changes to accomodate the new code.
31979 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31982 * rootcontext.cs (CreateInterface): New method, used to create
31983 the System.TypeBuilder type for interfaces.
31984 (ResolveInterfaces): new entry point to resolve the interface
31986 (CodeGen): Property, used to keep track of the code generator.
31988 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31990 * cs-parser.jay: Add a second production for delegate_declaration
31993 (enum_body): Put an opt_comma here instead of putting it on
31994 enum_body or enum_member_declarations so we can handle trailing
31995 commas on enumeration members. Gets rid of a shift/reduce.
31997 (type_list): Need a COMMA in the middle.
31999 (indexer_declaration): Tell tokenizer to recognize get/set
32001 * Remove old targets.
32003 * Re-add the parser target.
32005 2001-07-13 Simon Cozens <simon@simon-cozens.org>
32007 * cs-parser.jay: Add precendence rules for a number of operators
32008 ot reduce the number of shift/reduce conflicts in the grammar.
32010 2001-07-17 Miguel de Icaza <miguel@ximian.com>
32012 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
32015 Get rid of old crufty code.
32017 * rootcontext.cs: Use this to keep track of the parsed
32018 representation and the defined types available to the program.
32020 * gen-treedump.cs: adjust for new convention.
32022 * type.cs: Split out the type manager, and the assembly builder
32025 * typemanager.cs: the type manager will live here now.
32027 * cil-codegen.cs: And the code generator here.
32029 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
32031 * makefile: Fixed up for easy making.
32033 2001-07-13 Simon Cozens <simon@simon-cozens.org>
32035 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
32038 (unary_expression): Expand pre_increment_expression and
32039 post_decrement_expression to reduce a shift/reduce.
32041 2001-07-11 Simon Cozens
32043 * cs-tokenizer.cs: Hex numbers should begin with a 0.
32045 Improve allow_keyword_as_indent name.
32047 2001-06-19 Miguel de Icaza <miguel@ximian.com>
32049 * Adjustments for Beta2.
32051 2001-06-13 Miguel de Icaza <miguel@ximian.com>
32053 * decl.cs: Added `Define' abstract method.
32054 (InTransit): new property, used to catch recursive definitions.
32056 * interface.cs: Implement `Define'.
32058 * modifiers.cs: Map Modifiers.constants to
32059 System.Reflection.TypeAttribute flags.
32061 * class.cs: Keep track of types and user-defined types.
32062 (BuilderInit): New method for creating an assembly
32063 (ResolveType): New function to launch the resolution process, only
32064 used by interfaces for now.
32066 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
32067 that are inserted into the name space.
32069 2001-06-08 Miguel de Icaza <miguel@ximian.com>
32071 * ARGH. I have screwed up my tree so many times due to the use of
32072 rsync rather than using CVS. Going to fix this at once.
32074 * driver.cs: Objetify driver. Load assemblies, use assemblies to
32077 2001-06-07 Miguel de Icaza <miguel@ximian.com>
32079 * Experiment successful: Use System.Type rather that our own
32082 2001-05-25 Miguel de Icaza <miguel@ximian.com>
32084 * cs-parser.jay: Removed nsAliases from here.
32086 Use new namespaces, handle `using XXX;'
32088 * namespace.cs: Reimplemented namespace handling, use a recursive
32089 definition of the class. Now we can keep track of using clauses
32090 and catch invalid using clauses.
32092 2001-05-24 Miguel de Icaza <miguel@ximian.com>
32094 * gen-treedump.cs: Adapted for all the renaming.
32096 * expression.cs (Expression): this class now has a Type property
32097 which returns an expression Type.
32099 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32100 `Type', as this has a different meaning now in the base
32102 2001-05-22 Miguel de Icaza <miguel@ximian.com>
32104 * interface.cs, class.cs: Removed from all the sources the
32105 references to signature computation, as we can not do method
32106 signature computation during the parsing time, as we are not
32107 trying to solve at that point distinguishing:
32111 void a (NS.Blah x) {}
32114 Which depending on the context might be valid or not, as we do not
32115 know if Blah is the same thing as NS.Blah at that point.
32117 * Redid everything so the code uses TypeRefs now instead of
32118 Types. TypeRefs are just temporary type placeholders, that need
32119 to be resolved. They initially have a pointer to a string and the
32120 current scope in which they are used. This is used later by the
32121 compiler to resolve the reference to an actual Type.
32123 * DeclSpace is no longer a CIR.Type, and neither are
32124 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
32125 are all DeclSpaces, but no Types.
32127 * type.cs (TypeRefManager): This implements the TypeRef manager,
32128 which keeps track of all the types that need to be resolved after
32129 the parsing has finished.
32131 2001-05-13 Miguel de Icaza <miguel@ximian.com>
32133 * ARGH. We are going to have to store `foreach' as a class rather
32134 than resolving it, as we need to verify error 1579 after name
32135 resolution. *OR* we could keep a flag that says `This request to
32136 IEnumerator comes from a foreach statement' which we can then use
32137 to generate the error.
32139 2001-05-10 Miguel de Icaza <miguel@ximian.com>
32141 * class.cs (TypeContainer.AddMethod): we now add methods to the
32142 MethodGroup instead of the method hashtable.
32144 * expression.cs: Add MethodGroup abstraction, which gets us one
32145 step closer to the specification in the way we handle method
32148 * cs-parser.jay (primary_expression): qualified_identifier now
32149 tried to match up an identifier to a local variable reference or
32150 to a parameter reference.
32152 current_local_parameters is now a parser global variable that
32153 points to the current parameters for the block, used during name
32156 (property_declaration): Now creates an implicit `value' argument to
32159 2001-05-09 Miguel de Icaza <miguel@ximian.com>
32161 * parameter.cs: Do not use `param' arguments as part of the
32162 signature, per the spec.
32164 2001-05-08 Miguel de Icaza <miguel@ximian.com>
32166 * decl.cs: Base class for classes, structs and interfaces. This
32167 is the "Declaration Space"
32169 * cs-parser.jay: Use CheckDef for checking declaration errors
32170 instead of having one on each function.
32172 * class.cs: Factor out some code for handling error handling in
32173 accordance to the "Declarations" section in the "Basic Concepts"
32174 chapter in the ECMA C# spec.
32176 * interface.cs: Make all interface member classes derive from
32177 InterfaceMemberBase.
32179 2001-05-07 Miguel de Icaza <miguel@ximian.com>
32181 * Many things: all interfaces are parsed and generated in
32182 gen-treedump. Support for member variables, constructors,
32183 destructors, properties, constants is there.
32185 Beginning of the IL backend, but very little done, just there for
32188 2001-04-29 Miguel de Icaza <miguel@ximian.com>
32190 * cs-parser.jay: Fix labeled statement.
32192 * cs-tokenizer.cs (escape): Escape " and ' always.
32193 ref_line, ref_name: keep track of the line/filename as instructed
32194 by #line by the compiler.
32197 2001-04-27 Miguel de Icaza <miguel@ximian.com>
32199 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32200 to match the values in System.CodeDOM.
32202 Divid renamed to Divide.
32204 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32206 (Statements.set): remove.
32208 * System.CodeDOM/CodeCatchClause.cs: always have a valid
32211 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32212 falseStatements always have valid values.
32214 * cs-parser.jay: Use System.CodeDOM now.