1 2007-03-20 Martin Baulig <martin@ximian.com>
3 * class.cs (TypeContainer.Interfaces): Removed; they're now
4 included in `TypeContainer.Types'.
6 2007-03-20 Martin Baulig <martin@ximian.com>
8 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
10 * class.cs (TypeContainer.CreateType): New public method. This is
11 now called before DefineType() to create the TypeBuilders.
12 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
13 has already been created by CreateType().
14 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
15 don't resolve our base classes here; this has been moved into
16 DefineBaseTypes(). We're now called from CreateType().
17 (TypeContainer.DefineBaseTypes): New private method; resolve our
18 base classes here. We're now called from DefineType().
21 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
22 our types first to create all the TypeBuilders. After that, call
23 TypeContainer.DefineType() on all the types which'll resolve their
24 base classes and setup the resolve order.
26 2007-03-20 Martin Baulig <martin@ximian.com>
28 * class.cs (TypeContainer.Enums): Removed; they're now included in
29 `TypeContainer.Types'.
31 2007-03-20 Martin Baulig <martin@ximian.com>
34 (TypeContainer.DefineType): Don't call ResolveMembers() here.
35 (TypeContainer.DoResolveMembers): Call DefineType() on our
36 `compiler_generated' classes; moved here from DefineNestedTypes().
39 (RootContext.ResolveTree): Call ResolveMembers() on all
40 TypeContainer's in the `type_container_resolve_order'.
42 2007-03-19 Marek Safar <marek.safar@gmail.com>
44 * class.cs: Use corlib to handle InternalMethodImplAttribute.
46 2007-03-17 Marek Safar <marek.safar@gmail.com>
48 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
51 2007-03-17 Marek Safar <marek.safar@gmail.com>
53 * class.cs: More optimizations for type parameters.
55 2007-03-15 Marek Safar <marek.safar@gmail.com>
57 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
59 * ecore.cs, parameter.cs: More common code for both corlibs.
61 * typemanager.cs (IsGenericMethod): Simplified.
63 2007-03-15 Raja R Harinath <rharinath@novell.com>
65 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
67 * statement.cs, iterators.cs, lambda.cs: Update to changes.
69 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
70 unconditionally. Simplify explanation.
71 (Try.Resolve, Using.Resolve): Likewise.
73 2007-03-15 Martin Baulig <martin@ximian.com>
77 * decl.cs (DeclSpace): If we're a partial class, use our
78 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
80 2007-03-15 Raja R Harinath <rharinath@novell.com>
82 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
84 (FlowBranching.UsageVector): Update to changes.
85 (FlowBranching.MergeSiblings): Likewise.
86 * statement.cs: Likewise.
88 2007-03-15 Martin Baulig <martin@ximian.com>
93 (MemberCache): Added a special .ctor for type parameters.
96 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
99 2007-03-09 Martin Baulig <martin@ximian.com>
101 * enum.cs (Enum): Make this a TypeContainer.
102 (EnumMember): Derive from `Const'.
105 (Const.DoResolveValue): New protected virtual method; move most of
106 the functionality of ResolveValue() here so we can override it in
108 (Const.CreateConstantReference): Make this virtual.
110 * class.cs (Kind): Add `Kind.Enum'.
111 (TypeContainer.Emit): Don't emit the enums here; they're already
112 in the `RootContext.typecontainer_resolve_order'.
114 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
115 here; they're already in the `typecontainer_resolve_order'.
117 * ecore.cs (EnumConstant.ConvertImplicitly): Add
118 TypeManager.DropGenericTypeArguments().
121 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
122 (TypeManager.IsEnumType): Likewise.
123 (TypeManager.EnumToUnderlying): Likewise.
124 (TypeManager.IsEqual): Add support for enums.
126 2007-03-12 Raja R Harinath <rharinath@novell.com>
128 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
129 DefaultParameterValueAttribute to be undefined, say if System.dll
132 2007-03-11 Marek Safar <marek.safar@gmail.com>
134 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
137 2007-03-10 Marek Safar <marek.safar@gmail.com>
139 * class.cs, parameter.cs: Unified parameters verification.
141 2007-03-08 Martin Baulig <martin@ximian.com>
143 * cs-parser.jay (constructor_header): Pass the location to the
144 newly created TopLevelBlock.
146 2007-03-07 Martin Baulig <martin@ximian.com>
148 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
150 2007-03-06 Miguel de Icaza <miguel@novell.com>
152 * convert.cs (ExplicitReferenceConversionExists): Sync this method
153 with the changes from David, fixes the build.
155 2007-03-05 David Mitchell <dmitchell@logos.com>
157 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
158 and its base interfaces to a one-dimensional array type S[],
159 provided there is an implicit or explicit reference conversion
162 2007-03-03 Marek Safar <marek.safar@gmail.com>
164 * cs-tokenizer.cs: Implemented basic linq grammar.
166 * driver.cs: Set linq lang version on demand.
168 2007-02-26 Marek Safar <marek.safar@gmail.com>
170 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
172 2007-02-25 Marek Safar <marek.safar@gmail.com>
174 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
177 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
179 Check property and event extern attributes.
181 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
184 2007-02-24 Marek Safar <marek.safar@gmail.com>
187 * ecore.cs: Don't report ambiguity error when methods have same parent.
189 2007-02-23 Marek Safar <marek.safar@gmail.com>
192 * class.cs, cs-parser.jay: Event property can host anonymous methods.
194 2007-02-22 Marek Safar <marek.safar@gmail.com>
196 * attribute.cs: Enable ExtensionAttribute presence test.
198 2007-02-22 Marek Safar <marek.safar@gmail.com>
200 * class.cs: Warn about missing GetHashCode only when Equals is override.
202 * decl.cs: Check accessibility of type arguments.
204 * typemanager.cs: Correctly report nullable array.
206 2007-02-20 Marek Safar <marek.safar@gmail.com>
208 * class.cs, report.cs: Capture more details when things go wrong.
210 2007-02-20 Marek Safar <marek.safar@gmail.com>
213 * cs-parser.jay: Anonymous container starts at constructor declaration
214 and not at block beginning because it has to be usable in constructor
217 * statement.cs: Use context location and not block one for error reporting.
219 2007-02-18 Marek Safar <marek.safar@gmail.com>
222 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
225 2007-02-18 Marek Safar <marek.safar@gmail.com>
227 A fix for bug #80493 by Atsushi Enomoto
228 * cs-parser.jay: Ignore invalid attribute target.
230 2007-02-18 Marek Safar <marek.safar@gmail.com>
232 * cs-tokenizer.cs: Ignore '\0' as white space character.
234 2007-02-17 Miguel de Icaza <miguel@novell.com>
236 * cs-parser.jay: Add support for lambda expressions to the mcs
239 * lambda.cs: Only clone when we are probing, not on the final call
240 (Compatible is the final call).
242 * statement.cs (CloneContext): Introduce class to provide block
243 remapping during clone.
245 All statements Clone themselves now.
247 (Clone): special handling for blocks, when we clone a block, we
248 register the block inside this routine, as children of the block
249 might trigger a lookup.
251 * expression.cs: Add support for CloneContext in all expressions.
253 2007-02-17 Marek Safar <marek.safar@gmail.com>
256 * statement.cs: Report ambiguous warning when interfaces are not related.
258 2007-02-15 Marek Safar <marek.safar@gmail.com>
260 C# 3.0 extension methods.
262 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
263 cannot be used directly.
265 * class.cs (Class.Emit): Emit extension attribute if any class method
267 (Method.Define): Add basic extension method validation conditions.
268 (Method.Emit): Emit extension attribute for method.
270 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
271 extension method exists. Currently we follow same approach as Microsoft
272 does, emit even if a method or a class are private but this can change
275 * cs-parser.jay: Add handling of `this' keyword in method parameters
278 * decl.cs (DeclSpace.IsStaticClass): New property.
279 (MemberCache.FindExtensionMethods): Looks for extension methods with
280 defined name and extension type.
282 * doc.cs: Updated after OverloadResolve changes.
284 * driver.cs: Add new soft reference to System.Core.dll.
286 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
287 (ExtensionMethodGroupExpr): Represents group of extension methods.
289 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
290 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
291 to MethodGroupExpr and made non-static for easier customization.
292 (Invocation.DoResolve): Add extension method lookup when no standard
294 (MemberAccess.DoResolve): Try extension methods if no member exists.
296 * modifiers.cs: Add METHOD_EXTENSION modifier.
298 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
299 as well as candidate extension type.
300 (ComputeNamespaces): When assembly constains extension methods registers
302 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
303 extension method lookup.
304 (Namespace.LookupExtensionMethod): Looks for extension method in this
306 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
307 find a method which matches name and extensionType.
309 * parameter.cs (Parameter): Add This modifer.
310 (HasExtensionMethodModifier): New property.
311 (Resolve): Add extension parameter check.
312 (ModFlags): turned to property to exclude this modifier as it is not real
314 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
316 * support.cs (ParameterData): Add ExtensionMethodType.
317 (ReflectionParameters): Implemented ExtensionMethodType interface property.
319 * typemanager.cs: Add type and ctor extension attribute type.
321 2007-02-15 Miguel de Icaza <miguel@novell.com>
323 * report.cs (DisableErrors, EnableErrors): used to prevent error
324 output when we are "trying" to compile various methods with
327 * ecore.cs (Expression): Add Clone method that calls the virtual
328 CloneTo method. The current CloneTo method in Expression throws
329 an exception so we can track down all the places where this must
330 be implemented (not using abstract, because that would be a lot of
331 up-front-work before we can start testing the implementation
334 Important: we only need Clone capabilities for expressions created
335 by the parser, as the expressions we will be cloning are
336 expressions in the pre-resolved state. This vastly simplifies
339 (SimpleName): Add CloneTo that does nothing.
340 (EmptyCast): Add CloneTo.
342 * expression.cs (Binary): Implement CloneTo.
343 (Invocation.IsApplicable): Store the current ec in
344 EmitContext.TempEc and restore it on return. This is used so we
345 do not have to sprinkle hundres of methods with an extra
346 EmitContext, we know that the only user is the lambda expression
347 ImplicitConversionExists code.
349 (Argument): Add Cloning capabilities.
350 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
351 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
352 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
353 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
354 IndexerAccess): Add Clone capability.
356 (LocalVariableReference, This): TODO: needs cloned Block mapping.
358 (Argument): Add cloning capability.
360 * assign.cs (Assign): Implement CloneTo.
362 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
364 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
365 version by calling Convert with the EmitContext (that we are
366 currently storing in ec, this is not great, but will do for now,
367 to avoid passing EmitContext parameters to hundreds of functions
368 that do not need them now).
370 (SetExpression): Remove, it is not needed.
372 (ContextualReturn): Implement CloneTo.
374 * statement.cs (Statement): Implement cloning infrastructure,
375 similar to expressions.
377 (Block): Partial implementation of Clone for statements.
379 (Return): Implement clone.
381 * constant.cs (Constant.CloneTo): New method, does nothing.
383 * codegen.cs (TempEc): Add a static EmitContext as a temporary
384 solution, until we decide how to exactly do this.
386 2007-02-14 Marek Safar <marek.safar@gmail.com>
389 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
390 a property is override we need to use second accessor.
392 2007-02-13 Marek Safar <marek.safar@gmail.com>
395 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
398 2007-02-13 Marek Safar <marek.safar@gmail.com>
400 Another fix for bug #80749
401 * pending.cs: Abstract class has priority over interfaces.
403 2007-02-13 Marek Safar <marek.safar@gmail.com>
405 Another fix for bug #80749
406 * pending.cs: Abstract class has priority over interfaces.
408 2007-02-13 Marek Safar <marek.safar@gmail.com>
410 Another fix for bug #80749
411 * pending.cs: Abstract class has priority over interfaces.
413 2007-02-13 Marek Safar <marek.safar@gmail.com>
415 Another fix for bug #80749
416 * pending.cs: Abstract class has priority over interfaces.
418 2007-02-13 Marek Safar <marek.safar@gmail.com>
420 * class.cs Better error message.
422 * driver.cs: Add shorter versions of -optimize option.
424 2007-02-13 Martin Baulig <martin@ximian.com>
426 * class.cs (Constructor.Emit): Check the return value of
427 ec.ResolveTopBlock() and return on error.
429 2007-02-13 Raja R Harinath <rharinath@novell.com>
431 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
432 message to fix error message regression.
434 2007-02-12 Marek Safar <marek.safar@gmail.com>
436 * delegate.cs: Delegate creation expression cannot be of Nullable type.
438 2007-02-12 Marek Safar <marek.safar@gmail.com>
441 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
442 its parent container.
444 * class.cs (DefineFieldInitializers): Each initializer can has different
449 2007-02-11 Miguel de Icaza <miguel@novell.com>
451 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
452 now all the heavy lifting to check that embedded statements or
453 expressions have the right form is done in the ContextualReturn.
455 (ContextualReturn): New class.
457 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
458 method that can be invoked to report 201, so we do not replicate
461 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
463 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
464 treating tabs as spaces.
466 2007-02-09 Marek Safar <marek.safar@gmail.com>
468 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
469 * assign.cs: Use full implicit conversion for right side check.
471 2007-02-09 Marek Safar <marek.safar@gmail.com>
473 * statement.cs (Switch): Switch over boolean type is not standardized.
475 2007-02-08 Marek Safar <marek.safar@gmail.com>
478 * decl.cs (FindBaseEvent): Don't use method cache for events.
480 2007-02-07 Marek Safar <marek.safar@gmail.com>
482 * cs-parser.jay: Better syntax error handling.
484 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
485 instead of underlying type value.
487 2007-02-06 Marek Safar <marek.safar@gmail.com>
489 * driver.cs: Check define identifier before is registered.
491 * namespace.cs: Use existing error message.
493 * report.cs: New warning.
495 2007-02-06 Marek Safar <marek.safar@gmail.com>
498 * expression.cs: Delegate Invoke method can be called directly.
500 2007-02-06 Marek Safar <marek.safar@gmail.com>
503 * class.cs (IsEntryPoint): The Main method can have params modifier.
505 2007-02-04 Miguel de Icaza <miguel@novell.com>
507 * parameter.cs (Parameter, Parameters): Add Clone method.
509 * anonymous.cs (Compatible): Turn method into virtual method, so
510 LambdaExpression can implement a different behavior.
512 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
513 out the basic checking here, so it can be used by
516 * lambda.cs: Introduce "Compatible" function that will do the
519 2007-02-02 Marek Safar <marek.safar@gmail.com>
521 * attribute.cs: Unified one error message.
523 * class.cs (Class): Use type attributes and not properties to test static
525 (IsEntryPoint): Don's pass local variable.
527 * convert.cs: Removed duplicate check.
529 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
531 * driver.cs: Don't crash when soft reference does not exist.
533 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
534 (UsingEntry): Removed redundant allocation.
536 * parameter.cs: Add fast path for type parameters.
538 * support.cs: Don't allocate attribute when it's not used.
540 2007-01-30 Miguel de Icaza <miguel@novell.com>
543 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
544 this into a virtual method, so we can override it in LambdaExpression.
546 * driver.cs: Improve diagnostics in case of failure.
548 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
549 write a function that is slightly more complex and that parses:
551 type identifier [, type identifier]* )
553 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
556 (canEmpty ? i >= 0 : i > 0)
558 2007-01-30 Raja R Harinath <rharinath@novell.com>
560 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
561 exception on possibly valid code.
563 2007-01-29 Raja R Harinath <rharinath@novell.com>
565 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
567 (parse_opt_type_arguments): Remove. It's almost the same as
569 (parse_namespace_or_typename): Use parse_less_than.
571 2007-01-28 Miguel de Icaza <miguel@novell.com>
573 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
574 this bug took a few hours to find, because the state saved and
575 restored by PushPosition and PopPosition was ignoring the state of
576 parse_generic_less_than.
578 I can also now remove the handling of OP_LT and OP_GT, this solves
581 * cs-tokenizer.cs: store the location for the ARROW token, we use
584 (PushPosition, PopPosition): save/restore also `current_token',
585 restore `parse_generic_less_than' (was missing).
587 (parse_opt_type_arguments): use parse_type, not
588 parse_namespace_or_typename to parse types.
590 * lambda.cs: Empty new file, will eventually have the lambda
591 expression implementation.
593 * lambda.test: used to test the internal tokenizer.
595 * report.cs (FeatureIsNotISO1): Rename from
596 FeatureIsNotStandardized, because it was about the language level
597 (1 vs 2) it was not about standarization.
599 (FeatureRequiresLINQ): New.
601 * support.cs (SeekableStreamReader): Only require that the reader
602 is a TextReader, not a StreamReader, so we can plug StringReader.
604 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
605 given position in the input stream the following tokens can be
606 parsed as a type followed by an identifier.
608 (is_punct): after a '(' if parse_type_and_parameter returns true,
609 then return a special token OPEN_PARENS_LAMBDA which is used to
610 avoid reduce/reduce errors in the grammar for the
611 lambda_expression rules.
613 (parse_type): implement a type parser inside the
614 tokenizer, the parser only returns true or false depending on
615 whether the input at a given position can be parsed as a type.
617 (peek_token): new method used during type parsing.
619 2007-01-28 Raja R Harinath <rharinath@novell.com>
622 * anonymous.cs (ScopeInfo.InflateParameters): New.
623 (AnonymousContainer.Resolve): Use it to redirect types of
626 2007-01-27 Raja R Harinath <rharinath@novell.com>
629 * expression.cs (Error_InvalidArguments): Don't use two different
630 messages for CS1503. Use ExtraInformation and
631 SymbolRelatedToPreviousError instead.
634 * decl.cs (DeclSpace.initialize_type_params): Don't access
635 'type_params' of a partial class directly.
637 2007-01-26 Miguel de Icaza <miguel@novell.com>
639 * constant.cs: Removed a handful of out-of-range checks that were
642 2007-01-25 Marek Safar <marek.safar@gmail.com>
644 * expression.cs (CheckUselessComparison): Add additional check for char
647 * namespace.cs: Fixed typo.
649 2007-01-23 Miguel de Icaza <miguel@novell.com>
651 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
652 gone, instead we inline the test, preventing the needless casts to
653 longs, ulongs and doubles for the parameters, avoiding calls to
654 methods that overchecked stuff, and instead inlined things
657 2007-01-20 Marek Safar <marek.safar@gmail.com>
659 * cs-parser.jay: Better parameter error handling.
661 2007-01-17 Marek Safar <marek.safar@gmail.com>
663 A fix for bug #80368, #80522
664 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
665 whether array initializer contains constants only.
666 (ArrayCreation.Emit): Use better formula to decide when
667 are array initializers for static initialization.
668 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
669 have to emit even constants otherwise they are pre-initialized.
671 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
672 Raja R Harinath <rharinath@novell.com>
674 Fix emit order of 'get' vs. 'set'.
675 * support.cs (Accessors): New.
676 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
677 Note the order in which accessors are declared in the source.
678 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
679 Refactored from Property.Define and Indexer.Define.
680 (PropertyBase.DefineAccessors): New helper that calls the above in
681 appropriate order as noted by the parser.
682 (Property.Define, Indexer.Define): Update to changes.
683 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
685 2007-01-17 Raja R Harinath <rharinath@novell.com>
687 Fix cs0029-6.cs and gcs0029-2.cs (regression)
688 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
689 there's an implicit conversion from the current type to the target
690 type before converting the underlying constant.
692 2007-01-16 Marek Safar <marek.safar@gmail.com>
694 * const.cs (ResolveValue): Updated after constant conversion was made more
697 * constant.cs (GetAttributableValue): constant to object conversion is
698 used for attributes only.
699 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
700 constant conversions.
701 (LongConstant.ConvertImplicitly): Ditto.
703 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
704 (ImplicitConversionStandard): Handle constant conversion as extra step.
705 It solves the issue when constant conversion was called indirectly like
706 inside array initializer and constant folding was skipped.
708 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
711 * statement.cs(ImplicitConversionStandard): Updated after constant
712 conversion was made more generic.
714 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
716 * expression.cs (As.DoResolve): Use GenericConstraints instead of
717 Constraints, solves the problem where the compiler incorrectly
718 reported that a type parameter was not constrained to a class (Bug
721 2007-01-14 Marek Habersack <grendello@gmail.com>
723 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
725 2007-01-14 Marek Safar <marek.safar@gmail.com>
728 * assign.cs (FieldInitializer): New class implements field
729 initializer statement.
731 * attribute.cs: Update after FieldMember rename.
733 * class.cs (PropertyBasedMember): New common class for property based
735 (InterfaceMemberBase): New base class for all members which can be used as
736 an interface members.
737 (MethodCore): Moved really common code to InterfaceMemberBase.
738 (Method.Define): Equal and GetHasCode detection is relevant for methods
740 (MethodData.Define): Don't assume that public event implements an
741 interface automatically.
742 (MethodData.DefineMethodBuilder): Issue an error even if only extern
744 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
745 (FieldMember): Merged with FieldBase.
746 (EventProperty.AEventPropertyAccessor): New specialization to check whether
747 event extern modifier can be used.
748 (EventField.EventFieldAccessor): Moved event field specific code here.
749 (Event.AllowedModifiers): Even event can be extern.
750 (Event.FindOutBaseMethod): New override specific to events.
751 (Indexer.parameters): Reintroduce parameters because base class holds
752 only properties common data.
753 (Indexer.CheckForDuplications): Indexers are threated as methods so we
754 need do extra parameters check.
756 * const.cs: Update after FieldMember rename.
758 * decl.cs (MemberCache.FindBaseEvent): New method.
760 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
761 to reflect that indexer is now derived from PropertyBased.
763 * ecore.cs (GetMemberType): Made public.
764 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
767 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
769 * typemanager.cs (CSharpSignature): Correctly print event accessors.
770 (RegisterEvent): Removed.
771 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
772 (GetPrivateFieldOfEvent): Renamed to GetEventField.
774 2007-01-11 Raja R Harinath <rharinath@novell.com>
777 * statement.cs (CollectionForeach.TryType): Prefer generic
778 GetEnumerator over non-generic variant. Fix code to follow comments.
780 2007-01-09 Raja R Harinath <rharinath@novell.com>
783 * support.cs (ReflectionParameter): Don't use an invalid index on
784 the generic parameter data.
786 2007-01-08 Miguel de Icaza <miguel@novell.com>
788 * driver.cs: Just add a tiny bit of infrastructure.
790 2007-01-02 Marek Safar <marek.safar@gmail.com>
792 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
793 where field type is struct from current assembly.
795 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
798 2007-01-02 Marek Safar <marek.safar@gmail.com>
801 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
804 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
806 (Namespace.LookupType): Always use core types from corlib when speficied.
808 * report.cs: A new warning.
810 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
811 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
812 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
814 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
815 (InitCoreTypes): Set expression type of object_type and value_type
816 immediately after lookup.
818 2007-01-01 Miguel de Icaza <miguel@novell.com>
820 * cs-tokenizer.cs: Accept Pc class characters (Connector
821 Punctuation) as valid identifiers. Fixes #78259
823 * expression.cs (Invocation.DoResolve): Moved the check for the
824 use of `this' for doing method calls to the Invocation resolution
825 step, after overload resolution has taken place instead of doing
826 the check at the low-level `This.DoResolve' level.
828 The `This.DoResolve'Â happens before overload resolution, so it has
829 no way of knowing if the method that will be called will be
830 instace or static, triggering an erroneous report for cs0188 (Bug
833 We now do the check for instance method invocations after we know
834 what method will be called.
836 (This.CheckThisUsage): Move the actual use of this structure
837 checking into its own method and expose it.
839 * Everywhere that called Error_ValueCannotBeConverted: pass a new
842 Exceptions: Null.ConvertImplicitly,
843 Constant.ImplicitConversionRequired as there are too many call
844 sites for passing the ec.
846 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
847 EmitContext, if the value is null, then we do not try to provide
848 the extra information from the error (If a userdefined conversion
849 exists, as UserDefinedConversion requires a non null-EmitContext).
853 2006-12-30 Raja R Harinath <rharinath@novell.com>
855 * flowanalysis.cs (MyBitVector): Document some invariants.
856 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
857 introduced below, and add a couple of others,
859 2006-12-30 Marek Safar <marek.safar@gmail.com>
861 * attribute.cs (GetMethodObsoleteAttribute): Uses new
862 GetPropertyFromAccessor and GetEventFromAccessor.
864 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
865 overrides non-obsolete one.
866 (Indexer.Define): Error message has been moved to the parser.
868 * cs-parser.jay: Better syntax errors handling.
870 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
871 when an invocation has no arguments.
873 * ecore.cs: Removed not used caching.
875 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
878 * report.cs: Add a new warning.
880 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
882 * typemanager.cs (enumeration_type): Removed.
883 (CSharpSignature): Reuses IsSpecialMethod.
884 (IsEqual): Hack for MS BCL.
885 (GetPropertyFromAccessor): New method.
886 (GetEventFromAccessor): New method.
887 (IsSpecialMethod): Fixed to handle more cases.
889 2006-12-30 Marek Safar <marek.safar@gmail.com>
891 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
892 Made white spaces array static.
894 * ecore.cs (RemoveGenericArity): Optimized.
896 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
898 (MyBitVector.initialize_vector): Simplified.
900 2006-12-22 Miguel de Icaza <miguel@novell.com>
902 * ecore.cs: Am not entirely happy with this hack, but it seems to
903 address the issue in 80257 (a small test case for
906 I set the MethodGroupExpr.Type to an internal compiler type
907 (itself in this case) to force the resolution to take place. Why
908 it does not take place with a null is beyond me.
910 2006-12-20 Marek Safar <marek.safar@gmail.com>
913 * expression.cs (ResolveOperator): Consider user defined conversion for
914 logical and operator too.
915 (EmitBranchable): Optimization for logical and when full constant folding
916 could not be applied but one operand is constant.
918 2006-12-19 Marek Safar <marek.safar@gmail.com>
920 * class.cs (GetClassBases): Write 5 times every day, will never use
921 FullName for error reporting.
923 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
925 2006-12-19 Martin Baulig <martin@ximian.com>
927 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
928 the symbol file info here.
930 2006-12-18 Marek Safar <marek.safar@gmail.com>
932 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
933 of `elseif' is taking then following sections are not taking.
934 Fixes an issue reported on mono mailing list.
936 2006-12-18 Marek Safar <marek.safar@gmail.com>
939 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
940 a caller is not taking.
942 2006-12-18 Raja R Harinath <rharinath@novell.com>
944 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
945 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
946 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
947 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
948 * class.cs: Update to changes.
950 2006-12-17 Marek Safar <marek.safar@gmail.com>
953 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
956 * class.cs (ResolveMembers): Register an iterator in current container and
959 2006-12-16 Raja R Harinath <rharinath@novell.com>
962 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
963 satisfy a params annotated parameter.
965 2006-12-16 Marek Safar <marek.safar@gmail.com>
968 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
969 paramters correctly and not rely on hacks in Parameters class.
970 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
972 (Invocation.VerifyArgumentsCompat): Ditto.
973 (Invocation.EmitArguments): Changed to correctly emit params arguments at
976 * parameter.cs (HasParams): Don't assume that params is the last one.
978 * support.cs (ReflectionParameters.ctor): Look for params attribute
980 (ReflectionParameters.ParameterType): Removed hack when we returned last
981 parameter for out of range parameters.
982 (ParameterName, ParameterModifier): Ditto.
984 2006-12-14 Marek Safar <marek.safar@gmail.com>
987 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
988 when assembly is not CLS compliant but type is. I have no idea why is this
991 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
993 2006-12-13 Miguel de Icaza <miguel@novell.com>
995 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
996 in struct constructors, they are basically no-ops.
998 2006-12-12 Marek Safar <marek.safar@gmail.com>
1000 * cs-tokenizer.cs (Position): Save preprocessor status too.
1002 2006-12-12 Marek Safar <marek.safar@gmail.com>
1004 A fix for bug #77794
1005 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1007 2006-12-12 Marek Safar <marek.safar@gmail.com>
1009 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1011 (pp_expr): Report error for an invalid expression.
1012 (handle_preprocessing_directive): Simplified; add more error checking.
1014 2006-12-11 Marek Safar <marek.safar@gmail.com>
1016 A fix for bug #74939
1017 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1018 directives handling.
1020 2006-12-10 Marek Safar <marek.safar@gmail.com>
1022 A fix for bugs #80093, and #75984
1023 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1024 logic, it seems to me as it worked before "by coincidence".
1025 (xtoken): Simplified to use reworked handle_preprocessing_directive.
1026 (cleanup): Enabled endif check.
1028 2006-12-09 Marek Safar <marek.safar@gmail.com>
1030 A fix for bug #80162
1031 * statement.cs (CollectionForeach.TryType): Generics and non-generics
1032 enumerators are never ambiguous.
1034 2006-12-08 Raja R Harinath <rharinath@novell.com>
1037 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1039 2006-12-06 Marek Safar <marek.safar@gmail.com>
1041 A fix for bug #80144
1042 * class.cs (EventProperty.Define): Explicit implementation means
1043 that an even is used.
1045 2006-12-06 Marek Safar <marek.safar@gmail.com>
1047 Fixes the operators implementation (part II)
1049 * cfold.cs (DoConstantNumericPromotions): Renamed to
1050 DoBinaryNumericPromotions and simplified.
1051 (BinaryFold): Couple of conversion fixes; simplified.
1053 * constant.cs, ecore.cs, literal.cs
1054 (ToType): Renamed to ConvertImplicitly.
1055 (Reduce): Renamed to ConvertExplicitly.
1057 * class.cs, convert.cs: Updated.
1059 * expression.cs: TryReduce doesn't throw an exception.
1061 2006-12-01 Marek Safar <marek.safar@gmail.com>
1063 A fix for bug #80108
1064 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1067 2006-11-30 Marek Safar <marek.safar@gmail.com>
1069 Fixes unary operators implementation (part I)
1072 * cfold.cs (Error_CompileTimeOverflow): Made internal
1074 * const.cs (IConstant): Changed to use reference to constant and
1075 not constant itself.
1076 Updated IConstant implementations.
1078 * constant.cs (CreateConstant): New factory method.
1079 Updated IConstant implementation.
1081 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1083 * ecore.cs: Updated to use CreateConstantReference.
1085 * enum.cs: Reflects IConstant changes.
1087 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1089 * literal.cs (NullConstant): Change to be independently usable.
1091 2006-11-29 Martin Baulig <martin@ximian.com>
1093 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1094 we need to emit the scope initializer before calling the base .ctor.
1096 * anonymous.cs: Merged back from the new anonymous methods branch.
1097 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1099 * expression.cs (ParameterReference.DoResolveBase): Create a
1100 "normal" ScopeInfo when capturing parameters rather than using the
1101 root scope; this makes things work with anonymous methods having
1105 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1107 2006-11-22 Marek Safar <marek.safar@gmail.com>
1109 A fix for bug #79987
1110 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1111 check to a base class.
1112 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1113 only when assembly has missing attribute.
1114 * report.cs: Update.
1116 2006-11-21 Marek Safar <marek.safar@gmail.com>
1118 * cs-tokenizer.cs: Merged with gmcs version.
1120 2006-11-20 Marek Safar <marek.safar@gmail.com>
1123 * cs-parser.jay: Better error message when partial keyword is misplaced.
1125 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
1127 A fix for bug #79810
1128 report.cs: CS1058 only applies to 2.0 profile (gmcs).
1129 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1130 a RuntimeWrappedException by default.
1132 2006-11-18 Marek Safar <marek.safar@gmail.com>
1134 A fix for bug #79843
1135 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1137 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1139 2006-11-18 Marek Safar <marek.safar@gmail.com>
1141 * driver.cs, namespace.cs: Uses faster IndexOf version.
1143 2006-11-17 Marek Safar <marek.safar@gmail.com>
1145 A fix for bug #79941
1146 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1148 (Operator.Define): Implicit/Explicit operator of same type is duplicate
1149 even if internal name is different.
1150 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1151 (UserDefinedConversion): Simplified as the operators cannot be internal.
1152 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1154 (MethodLookup): Replaced EmitContext with parentType.
1155 * expression.cs: Updated.
1157 2006-11-09 Raja R Harinath <rharinath@novell.com>
1159 * driver.cs (BadAssembly): Handle all the ugliness of
1160 DefineDynamicAssembly.
1162 2006-11-08 Raja R Harinath <rharinath@novell.com>
1164 Address parts of #58244 -- most of what's left is in the runtime
1165 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
1166 CS1509 error checks, and handle them for all assembly loads, not
1167 just the first invocation.
1168 (LoadModule): Likewise. Move handling of 'adder_method' ...
1169 * codegen.cs (AssemblyClass.AddModule): ... here.
1171 2006-11-02 Marek Safar <marek.safar@gmail.com>
1173 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1174 IEnumerable<T> is ambiguous.
1176 2006-10-31 Marek Safar <marek.safar@gmail.com>
1178 A fix for bug #67689
1179 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1180 GetEnumerator is ambiguous.
1182 * report.cs: Add new warning.
1184 2006-10-29 Marek Safar <marek.safar@gmail.com>
1186 A fix for bug #78602
1187 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1188 to protected member can be nested type.
1190 2006-10-28 Marek Safar <marek.safar@gmail.com>
1192 A fix for bug #78965
1193 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1194 to protected member must derive from current type.
1196 2006-10-27 Marek Safar <marek.safar@gmail.com>
1198 assign.cs: Reuses error method.
1200 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1201 instead of type for constants.
1202 (Expression.Error_ValueAssignment): Common error method.
1204 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1207 2006-10-27 Marek Safar <marek.safar@gmail.com>
1209 A fix for bug #79081
1210 * expression.cs (MemberAccess.DoResolve): Check nested type
1213 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
1215 * doc.cs : nested delegates were not handled. Fixed bug #79754.
1217 2006-10-26 Marek Safar <marek.safar@gmail.com>
1219 A fix for bug #76591
1220 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1222 2006-10-26 Marek Safar <marek.safar@gmail.com>
1224 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1225 type forwarder of the same type multiple times.
1227 2006-10-26 Raja R Harinath <rharinath@novell.com>
1230 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1231 instance as an rvalue, even when we later resolve as an lvalue.
1233 2006-10-25 Martin Baulig <martin@ximian.com>
1235 * anonymous.cs: Fix #79673.
1237 2006-10-24 Marek Safar <marek.safar@seznam.cz>
1239 A fix for bug #79666
1240 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1241 ignored when is optimized (= default value) as its value is already set.
1243 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1245 A fix for bug #79724
1246 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1247 TypeContainer for type lookup.
1249 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1251 A fix for bug #79231
1252 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1253 * expression.cs (OverloadResolve): Always convert type name for
1255 (ResolveNamespaceOrType): Don't confuse a nested type with any
1258 2006-10-18 Martin Baulig <martin@ximian.com>
1260 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1262 2006-10-17 Miguel de Icaza <miguel@novell.com>
1264 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1265 an int32, but requesting an int64 from the conversion
1267 2006-10-12 Martin Baulig <martin@ximian.com>
1270 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
1272 2006-10-12 Martin Baulig <martin@ximian.com>
1275 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1277 2006-10-11 Miguel de Icaza <miguel@novell.com>
1279 * convert.cs: Remove broken code: I was doing the "Existance"
1280 tests for Implicit conversions.
1282 2006-10-10 Miguel de Icaza <miguel@novell.com>
1284 * convert.cs: Added one missing case in
1285 ImplicitStandardConversionExists uint64 to intptr.
1289 * typemanager.cs (uintptr_type): another core known type.
1291 * ecore.cs (OperatorCast): routine used to do cast operations that
1292 depend on op_Explicit. We could change some of the Decimal
1293 conversions to use this.
1295 This one has a probe mechanism that checks both types for an op_
1296 which it coudl be used to eliminate two classes: CastToDecimal
1297 and CastFromDecimal.
1299 * convert.cs: Implement the conversions documented in #59800
1301 2006-10-10 Martin Baulig <martin@ximian.com>
1303 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1304 before RootScope.ResolveMembers().
1306 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1307 `CurrentType' if appropriate.
1309 2006-10-09 Marek Safar <marek.safar@seznam.cz>
1311 A fix for bug #78568
1312 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1313 when contains binary operators.
1314 * cs-parser.jay: Updated.
1316 2006-10-09 Martin Baulig <martin@ximian.com>
1319 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1320 moved that into Define() and also do the other type parameter
1321 checks there. Fixes #79094. Added gtest-292.cs.
1324 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1325 since that doesn't include type parameters; don't use `Ldelema'
1326 for type parameters. Fixes #78980. Added gtest-293.cs.
1328 2006-10-08 Marek Safar <marek.safar@seznam.cz>
1331 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1332 conversion is allowed.
1334 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1336 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1337 error reporting when no error occurs.
1339 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1341 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1344 2006-10-06 Raja R Harinath <rharinath@novell.com>
1347 * class.cs (DefineTypeBuilder): Check circular dependencies before
1348 setting the parent of the TypeBuilder.
1349 (CheckRecursiveDefinition): Don't use 'BaseType', since
1350 it may not be valid until after DefineTypeBuilder. Use
1351 'base_type' instead.
1353 2006-10-04 Martin Baulig <martin@ximian.com>
1355 Merged the Anonymous Methods patch.
1357 * anonymous.cs, iterators.cs: The new anonymous methods code.
1359 * statement.cs (Variable): New public abstract class.
1360 (LocalInfo.Variable): New public property.
1361 (LocalInfo.ResolveVariable): New public method.
1362 (Block.Flags): Add `IsIterator'.
1363 (Block.AddVariable): Improved the CS0136 check.
1364 (Block.AnonymousChildren): New public property.
1365 (Block.AddAnonymousChild): New public method.
1366 (ToplevelBlock): Update to use the new anonymous method framework.
1367 (ToplevelBlock.ctor): `container' is now a `Block' and not a
1368 `ToplevelBlock'; this is required to correctly implement the
1370 (Fixed, Using): Use `TemporaryVariable' instead of directly
1371 creating the `LocalBuilder'.
1373 * parameter.cs (Parameter.ResolveVariable): New public method.
1374 (Parameters.ResolveVariable): Likewise.
1376 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1378 * class.cs (TypeContainer): Replaced the `iterators' list and
1379 corresponding methods with a list of `CompilerGeneratedClass'es.
1380 (TypeContainer.ResolveMembers): New public method.
1381 (Method): `IIteratorContainer' has been replaced by
1384 * expression.cs (VariableReference): New public abstract base
1385 class for `LocalVariableReference', `ParameterReference' and
1388 * codegen.cs (EmitContext): Removed `capture_context',
1389 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1390 (EmitContext.EmitThis): Removed.
1392 * cs-parser.jay: Replace `iterator_container' with
1395 2006-10-04 Martin Baulig <martin@ximian.com>
1397 * generic.cs (GenericMethod): Don't make this abstract.
1398 (Constraints.Clone): Added dummy implementation.
1400 2006-10-04 Raja R Harinath <harinath@gmail.com>
1403 * namespace.cs (LookForAnyGenericType): Avoid nullref on
1404 'declspaces'. Avoid allocating arrays willy-nilly.
1407 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1408 cases out of the switch.
1410 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1412 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1413 message when non-generic type is used with the type arguments.
1414 * expression.cs: Updated.
1416 2006-09-28 Raja R Harinath <rharinath@novell.com>
1419 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1420 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1421 Change semantics slightly. Don't insist on having only one
1422 temporary EmptyExpression -- just throttle the creation of new ones.
1425 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1426 non-interfaces too. If no methods are found, don't try to create
1429 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1431 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1434 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1435 us produce better error message.
1437 2006-09-27 Marek Safar <marek.safar@seznam.cz>
1439 * expression.cs (Binary.ResolveOperator): Warn about a side effect
1440 of the `|' operator.
1442 * report.cs: A new warning added.
1444 2006-09-27 Martin Baulig <martin@ximian.com>
1446 * generic.cs (GenericMethod): Don't make this abstract.
1448 2006-09-27 Martin Baulig <martin@ximian.com>
1451 (InternalErrorException): Added overloaded ctor taking a params array.
1453 2006-09-26 Marek Safar <marek.safar@seznam.cz>
1455 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1456 Fixed the cases when same error was reported twice.
1458 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1459 now report symbol information.
1461 2006-09-25 Martin Baulig <martin@ximian.com>
1463 * class.cs: Completely unified with the gmcs version.
1465 2006-09-25 Martin Baulig <martin@ximian.com>
1467 * typemanager.cs (TypeManager.IsNullableType): New public function.
1468 (TypeManager.IsNullableTypeOf): Likewise.
1469 (TypeManager.IsNullableValueType): Likewise.
1471 * class.cs (MethodCore): Added the `GenericMethod' argument from
1472 gmcs and also unified all classes derived from `MethodCore' with gmcs.
1474 2006-09-24 Raja R Harinath <harinath@gmail.com>
1476 * convert.cs: Unify with gmcs version.
1478 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1480 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1481 verify them as well.
1483 * report.cs: New warning.
1485 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1487 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1488 for anonymous block with out argument.
1490 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1492 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1493 not used private events only.
1495 2006-09-23 Marek Safar <marek.safar@seznam.cz>
1497 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1499 * const.cs (Const.Define): Check for constant type.
1500 (Const.IsConstantTypeValid): Looks for valid constant types.
1502 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1504 * ecore.cs (EmptyConstantCast): New common class for all constant based
1507 * expression.cs (Is.DoResolve): Handle null constant especially.
1508 (New.DoResolve): Check for new void().
1509 (MemberAccess.DoResolve): Cope with all kind of nulls.
1511 * literal.cs (NullConstant): Uses EmptyConstantCast.
1512 (NullDefault): Based on EmptyConstantCast.
1513 (NullLiteral): Uses EmptyConstantCast.
1515 * statement.cs (Block.ResolveMeta): Check for constant type.
1517 2006-09-22 Martin Baulig <martin@ximian.com>
1519 * delegate.cs, attribute.cs: Merged with the gmcs versions.
1521 2006-09-22 Raja R Harinath <rharinath@novell.com>
1523 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1527 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1528 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
1531 2006-09-22 Martin Baulig <martin@ximian.com>
1533 * ecore.cs: Merged with the gmcs version.
1535 * generic.cs (ConstructedType): New dummy class.
1536 (TypeArguments): Don't make this abstract.
1539 (TypeManager.IsGenericTypeDefinition): New method.
1540 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1542 2006-09-22 Raja R Harinath <rharinath@novell.com>
1544 * expression.cs (ComposedCast): Check for arrays of TypedReference
1545 before creating the type, not after.
1547 2006-09-21 Marek Safar <marek.safar@seznam.cz>
1549 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1550 after ToType change.
1552 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1553 when constant must be implicitly convertible.
1555 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1557 * ecore.cs (NullCast): Derives from NullConstant.
1559 * expression.cs (Is.DoResolve): Removed useless variables.
1560 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1561 (New.Constantify): Add enum support.
1562 (MemberAccess.DoResolve): Add warning when accessing null constant or
1565 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1568 * literal.cs (NullConstant): New abstract class with common
1569 functionality for all null specializations.
1570 (NullDefault): Represents default(X) when result can be
1572 (NullLiteral): Updated.
1574 * report.cs: Add new warning.
1576 2006-09-21 Martin Baulig <martin@ximian.com>
1578 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1580 2006-09-21 Martin Baulig <martin@ximian.com>
1582 * generic.cs (GenericConstraints): New dummy class.
1583 (Constraints): Likewise.
1584 (TypeParameter): Likewise.
1585 (TypeParameterName): Likewise.
1586 (GenericMethod): Likewise.
1588 * typemanager.cs (TypeManager.GetGenericArguments): New method.
1590 * decl.cs: Merged with the gmcs version.
1592 2006-09-21 Raja R Harinath <rharinath@novell.com>
1594 * generic.cs (TypeParameter): Implement IMemberContainer.
1595 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
1597 * rootcontext.cs: Unify with gmcs version.
1599 * report.cs: Unify with gmcs version.
1600 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1601 from gmcs/generics.cs.
1602 * generics.cs (TypeParameter): New dummy class.
1604 * support.cs: Unify with gmcs version.
1606 2006-09-20 Raja R Harinath <rharinath@novell.com>
1608 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1609 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1611 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1612 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1613 * mcs.exe.sources: Add generic.cs.
1615 * codegen.cs: Unify with gmcs version.
1617 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1618 (EmitContext): Add GenericDeclContainer implementation.
1619 * decl.cs (MemberCore, DeclSpace): Likewise.
1620 * namespace.cs: Remove #ifdef GMCS_SOURCE.
1622 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1623 MCS TypeManager has a corresponding dummy method.
1625 2006-09-19 Martin Baulig <martin@ximian.com>
1627 * expression.cs: Completely merged with the gmcs version.
1629 2006-09-19 Martin Baulig <martin@ximian.com>
1631 * expression.cs (Invocation): Merged with the gmcs version.
1632 (ArrayAccess.GetStoreOpcode): Likewise.
1634 2006-09-19 Martin Baulig <martin@ximian.com>
1637 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1638 (TypeManager.IsGenericMethodDefinition): Likewise.
1640 2006-09-19 Martin Baulig <martin@ximian.com>
1643 (TypeManager.IsEqual): Moved the gmcs implementation here.
1644 (TypeManager.DropGenericTypeArguments): Likewise.
1645 (TypeManager.DropGenericMethodArguments): Likewise.
1646 (TypeManager.GetTypeArguments): Moved here from gmcs.
1647 (TypeManager.HasGenericArguments): Likewise.
1649 2006-09-19 Martin Baulig <martin@ximian.com>
1651 * expression.cs (Binary): Merged with the gmcs version.
1653 2006-09-19 Martin Baulig <martin@ximian.com>
1655 * expression.cs (Probe, As, Is): Merged with the gmcs version.
1657 2006-09-19 Martin Baulig <martin@ximian.com>
1659 * typemanager.cs: Merged with the gmcs version.
1661 2006-09-16 Raja R Harinath <rharinath@novell.com>
1663 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1664 * driver.cs: Likewise.
1666 2006-09-16 Marek Safar <marek.safar@seznam.cz>
1669 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1670 only if parent type is class.
1671 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1674 2006-09-15 Marek Safar <marek.safar@seznam.cz>
1677 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1679 * typemanager.cs(CSharpName): Converts NullType to null.
1681 2006-09-15 Martin Baulig <martin@ximian.com>
1684 (TypeManager.GetMethodName): Added mcs implementation.
1685 (TypeManager.IsEqual): Likewise.
1688 (SimpleName.RemoveGenericArity): Added dummy implementation.
1690 * pending.cs: Merged with the gmcs version.
1692 2006-09-15 Martin Baulig <martin@ximian.com>
1694 * statement.cs: Merge with the gmcs version.
1696 2006-09-15 Martin Baulig <martin@ximian.com>
1698 * statement.cs (Switch): Merge with the gmcs implementation
1699 (without nullables), which is newer.
1701 2006-09-15 Martin Baulig <martin@ximian.com>
1703 * statement.cs (Block.Variables): Make this public.
1704 (ToplevelBlock.Parameters): Make this a property.
1705 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1707 2006-09-15 Martin Baulig <martin@ximian.com>
1709 * namespace.cs: Merge with the gmcs version.
1711 2006-09-15 Martin Baulig <martin@ximian.com>
1713 * decl.cs (MemberName): Minor code cleanups.
1715 2006-09-15 Martin Baulig <martin@ximian.com>
1717 * parameter.cs: Merge with the gmcs version.
1719 2006-09-15 Martin Baulig <martin@ximian.com>
1721 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1722 and an error in mcs.
1724 2006-09-15 Martin Baulig <martin@ximian.com>
1726 * flowanalysis.cs: Merged from GMCS; added the generics code into
1727 a `GMCS_SOURCE' conditional so we can share this file.
1729 2006-09-08 Martin Baulig <martin@ximian.com>
1731 * typemanager.cs (TypeManager.interlocked_type): New public field.
1732 (TypeManager.int_interlocked_compare-exchange): New public field.
1733 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1734 enumerator types here and call InitGenericCoreTypes().
1735 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1736 after calling InitEnumUnderlyingTypes().
1739 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1740 `classes_second_stage'.
1742 2006-09-14 Marek Safar <marek.safar@seznam.cz>
1744 * assign.cs, ecore.cs, expression.cs: Share error message text.
1745 * class.cs (FieldMember.Define): Check for varible of static type.
1746 * driver.cs (LoadAssembly): Uses error output for errors.
1747 * statement.cs: Updated.
1749 2006-09-08 Marek Safar <marek.safar@seznam.cz>
1751 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1754 2006-09-07 Martin Baulig <martin@ximian.com>
1757 (MainDriver): Revert r62663 from Marek; see #70506 for details.
1759 2006-08-29 Miguel de Icaza <miguel@novell.com>
1761 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1763 2006-08-17 Miguel de Icaza <miguel@novell.com>
1765 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1766 #52019 and #79064, the use of the \uXXXX sequence in source code
1767 to represent unicode characters.
1769 2006-08-15 Marek Safar <marek.safar@seznam.cz>
1771 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1773 * class.cs, ecore.cs, statement.cs: Merged to one error message.
1775 2006-08-13 Miguel de Icaza <miguel@novell.com>
1777 * assign.cs: Catch attempts to assign to a method groups in += and
1780 2006-08-13 Marek Safar <marek.safar@seznam.cz>
1783 * cs-parser.jay: Don't destroy current array type by typeof of array's.
1785 2006-08-12 Marek Safar <marek.safar@seznam.cz>
1787 * class.cs (Method.Define): Issue a warning when generic method looks like
1789 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1792 2006-08-09 Marek Safar <marek.safar@seznam.cz>
1794 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1796 * decl.cs (MemberCache.FindMembers): When container is interface we need to
1797 search all base interfaces as a member can be ambiguous.
1798 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1799 Constructor member type filter.
1800 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1801 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1802 reporting for returned memberinfos.
1803 * report.cs: Updated.
1804 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1805 version to work on all runtimes.
1806 (TypeManager.RealMemberLookup): Removed members filtering.
1808 2006-08-08 Raja R Harinath <rharinath@novell.com>
1810 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1811 (PropertyExpr.EmitAssign): Likewise.
1812 * expression.cs (Indirection.EmitAssign): Likewise.
1813 (LocalVariableReference.EmitAssign): Likewise.
1814 (ParameterReference.EmitAssign): Likewise.
1815 (Invocation.EmitArguments): Likewise.
1816 (ArrayAccess.EmitAssign): Likewise.
1817 (IndexerAccess.EmitAssign): Likewise.
1818 (This.EmitAssign): Likewise.
1819 (ConditionalLogicalOperator.Emit): Likewise.
1822 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
1823 instead of ArrayList. If the hashtable has a LocalBuilder, don't
1824 leave it in after returning it.
1825 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
1827 2006-08-06 Marek Safar <marek.safar@seznam.cz>
1829 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1832 2006-08-03 Raja R Harinath <rharinath@novell.com>
1834 Fix cs0146-3.cs and cs0146-4.cs.
1835 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1836 enclosing types don't depend on the current type.
1838 2006-08-02 Raja R Harinath <rharinath@novell.com>
1841 * class.cs (TypeContainer.DoDefineMembers): Use
1842 FindBaseMemberWithSameName on Parent, since we're interested in
1843 whether we hide inherited members or not.
1844 (FindBaseMemberWithSameName): Make slightly more robust.
1846 Fix the non-generic testcase from #77396
1847 * decl.cs (DeclSpace.DeclContainer): Remove override.
1849 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1850 declspaces for doppelgangers too.
1851 (UsingEntry): Implement IResolveContext.
1852 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1853 'this' as the resolve context.
1854 (LocalAliasEntry): Likewise.
1856 Implement parts of #77403
1857 * roottypes.cs (RootDeclSpace): New. Used to represent the
1858 toplevel declaration space. Each namespace declaration introduces
1859 a "partial" root declaretion space.
1860 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1861 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1862 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1863 from 'current_namespace.SlaveDeclSpace'.
1864 (namespace_declaration): Likewise.
1865 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1866 check. It can't happen now.
1867 * decl.cs (DeclSpace.LookupType): Likewise.
1868 * driver.cs (MainDriver): Sanity check.
1870 2006-08-01 Raja R Harinath <rharinath@novell.com>
1872 * decl.cs (DeclSpace.FindNestedType): Remove.
1873 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1874 LookupTypeContainer to get the container of the nested type.
1875 * class.cs (TypeContainer.FindNestedType): Make non-override.
1877 2006-07-31 Raja R Harinath <rharinath@novell.com>
1879 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1880 * class.cs (TypeContainer.PartialContainer): ... here.
1881 (TypeContainer.AddBasesForPart): New helper.
1882 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1884 * cs-parser.jay (current_class): Convert to DeclSpace.
1885 (struct_declaration, interface_declaration, class_declaration):
1886 Use AddBasesForPart instead of .Bases directly.
1887 * const.cs, iterators.cs: Update to changes.
1889 2006-07-28 Raja R Harinath <rharinath@novell.com>
1891 * class.cs (TypeContainer.AddMemberType): Rename from
1893 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1894 (AddTypeContainer): New. Combine AddClassOrStruct and
1896 (AddPartial): Update. Add 'is_partial' argument.
1897 * roottypes.cs: Update to changes.
1898 * cs-parser.jay (push_current_class): New helper for handling
1899 current_container and current_class.
1900 (struct_declaration, interface_declaration, class_declaration):
1903 2006-07-26 Raja R Harinath <rharinath@novell.com>
1905 * roottypes.cs: Rename from tree.cs.
1907 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1908 * tree.cs (Tree, ITreeDump): Remove types.
1909 * rootcontext.cs (tree, Tree): Remove fields.
1910 (root, ToplevelTypes): New.
1911 * *.cs: Update to rename.
1913 * tree.cs (Tree.RecordDecl): Remove.
1914 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1916 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1918 2006-07-23 Raja R Harinath <harinath@gmail.com>
1920 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1921 DoFlowAnalysis and OmitStructFlowAnalysis here.
1922 (ec.With): Rename from WithUnsafe and generalize.
1923 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1924 (ec.WithFlowAnalyis): New.
1925 * ecore.cs, expression.cs, statement.cs: Update.
1927 2006-07-22 Raja R Harinath <harinath@gmail.com>
1929 * statement.cs (Block.ResolveMeta): Simplify slightly.
1931 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1932 multiple boolean fields. Convert InUnsafe, constant_check_state,
1933 check_state to flags.
1934 (CheckState, ConstantCheckState): Update.
1935 (InUnsafe): New read-only property.
1936 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1938 (WithUnsafe): New helper similar to WithCheckState.
1939 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1940 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1942 2006-07-21 Raja R Harinath <rharinath@novell.com>
1944 Make comparisons use the same IL irrespective of whether they're
1945 in a 'checked' or 'unchecked' context: one of the issues in #78899
1946 * codegen.cs (EmitContext.CheckState): Make read-only property.
1947 (EmitContext.ConstantCheckState): Likewise.
1948 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1949 helper that implement a save/restore stack for CheckState
1950 values. This is the only way to change check-state.
1951 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1952 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1953 (CheckedExpr.EmitBranchable): New forwarding method.
1954 (UnCheckedExpr): Likewise.
1955 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1956 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1957 (Checked.Resolve, checked.DoEmit): Likewise.
1959 2006-07-20 Miguel de Icaza <miguel@novell.com>
1961 * anonymous.cs: Cache the resolved anonymous delegate, and return
1962 this so that the ResolveTopBlock is only triggered once, not
1965 Currently we trigger ResolvetopBlock twice due to a first pass of
1966 argument check compatibility, and a second pass that does the
1969 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1971 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1973 * rootcontext.cs (Reset): Add helper_classes.
1975 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1978 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1981 2006-07-13 Miguel de Icaza <miguel@novell.com>
1983 * statement.cs (Lock): Handle expressions of type
1984 TypeManager.null_type specially. Fixes #78770
1986 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1988 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1991 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1993 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1994 for accessors as well.
1995 * ecore.cs (EventExpr): Add AccessorTable.
1997 2006-07-01 Marek Safar <marek.safar@seznam.cz>
2000 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2001 for CS0122 where appropriate.
2002 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2004 (Filter): Assembly can be null in the case of top level attributes.
2006 2006-06-25 Marek Safar <marek.safar@seznam.cz>
2010 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2011 is done at global level.
2013 2006-06-24 Marek Safar <marek.safar@seznam.cz>
2015 A fix for #77002, Implemented TypeForwarder support.
2017 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2018 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2019 * typemanager.cs (): Add type_forwarder_attr_type.
2021 2006-06-24 Marek Safar <marek.safar@seznam.cz>
2023 * report.cs: Add CS0469 warning.
2025 2006-06-21 Martin Baulig <martin@ximian.com>
2027 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2028 the `try'-block, so we also report CS0016 etc. there.
2030 2006-06-21 Martin Baulig <martin@ximian.com>
2033 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2035 2006-06-21 Martin Baulig <martin@ximian.com>
2037 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2038 also report CS1686 for parameters.
2040 2006-06-21 Martin Baulig <martin@ximian.com>
2042 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2043 instead of an error if the value is not implicitly convertible to
2044 the switch types; fixes #77964.
2046 2006-06-21 Raja R Harinath <rharinath@novell.com>
2049 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2050 FieldBuilder is null.
2053 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2054 'left' and 'right' before error-checking.
2056 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
2058 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2060 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2061 (FieldExpr.DoResolve): likewise.
2062 (PropertyExpr.InstanceResolve): likewise.
2063 (EventExpr.InstanceResolve): likewise.
2065 2006-06-04 Marek Safar <marek.safar@seznam.cz>
2067 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2068 attribute applicable tests for attribute argument.
2070 2006-06-02 Raja R Harinath <rharinath@novell.com>
2073 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2074 (Binary.OverloadResolve_PredefinedIntegral): New.
2075 (Binary.OverloadResolve_PredefinedFloating): New.
2076 (Binary.OverloadResolve_PredefinedString): New.
2077 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2078 Follow the standard more closely, and treat numeric promotions in
2079 terms of overload resolution.
2080 (Binary.CheckShiftArguments): Simplify.
2082 2006-06-01 Raja R Harinath <rharinath@novell.com>
2084 * flowanalysis.cs (MyBitVector): Simplify representation.
2085 (MyBitVector.Clone): Avoid allocating BitArray.
2086 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2087 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2088 (*): Update. Change all references to MyBitVector.And and
2089 MyBitVector.Or to &= and |=.
2091 2006-05-29 Raja R Harinath <rharinath@novell.com>
2094 * cs-parser.jay (formal_parameter_list): Extend the pattern below
2095 to param arguments too.
2097 2006-05-26 Miguel de Icaza <miguel@novell.com>
2099 * cs-parser.jay: Catch another parsing form for arglist being
2100 followed by other arguments. Fixes #78313.
2102 2006-05-24 Raja R Harinath <rharinath@novell.com>
2104 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2105 checking of out parameters to ...
2106 (FlowBranchingToplevel.Merge): ... here.
2107 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2108 set, propagate the origin upward, and only complain if there was
2110 (FlowBranchingException.AddContinueOrigin): Likewise.
2111 (FlowBranchingException.AddReturnOrigin): Likewise.
2112 (FlowBranchingException.AddGotoOrigin): Likewise.
2114 2006-05-23 Raja R Harinath <rharinath@novell.com>
2116 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2117 unreachable, skip it.
2118 (FlowBranchingException.Merge): Always propagate jumps, even if
2119 the finally block renders subsequent code unreachable.
2121 2006-05-18 Raja R Harinath <rharinath@novell.com>
2124 * statement.cs (Goto.Resolve): Move responsibility for resolving
2125 'goto' to FlowBranching.AddGotoOrigin.
2126 (Goto.SetResolvedTarget): New. Callback to set the
2127 LabeledStatement that's the target of the goto.
2128 (Goto.DoEmit): Use Leave instead of Br when crossing an
2129 unwind-protect boundary.
2130 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2131 LookupLabel and adjust to new semantics.
2132 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2133 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2134 Goto.SetResolvedTarget to update target.
2135 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2136 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2137 AddBreakOrigin & co. Delay propagation until ...
2138 (FlowBranchingException.Merge): ... this.
2140 * statement.cs (Block.Resolve): Always depend on flow-branching to
2141 determine unreachability. Kill workaround that originally emitted
2142 only one statement after an "unreachable" label (see infloop in
2145 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2146 This is still "wrong", but anything better would probably need a
2147 multi-pass algorithm.
2148 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2149 usage vector. Force current usage vector to be reachable, to
2150 optimistically signify backward jumps.
2151 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2153 (FlowBranchingLabeled.Merge): New. If no backward jump was
2154 detected, return the original salted-away usage vector instead,
2155 updated with appropriate changes. Print unreachable warning if
2157 * statement.cs (Block.Resolve): Don't print unreachable warning on
2158 a labeled statement.
2160 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
2162 * driver.cs: Pass filename without path to AssemblyBuilder's
2163 AddResourceFile. Fixes bug #78407.
2165 2006-05-17 Raja R Harinath <rharinath@novell.com>
2167 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2168 * flowanalysis.cs (FlowBranchingLabeled): ... here.
2169 (FlowBranching.MergeChild): Overwrite
2170 reachability information from Labeled branchings too.
2172 2006-05-16 Raja R Harinath <rharinath@novell.com>
2174 * statement.cs (Goto.Resolve): Merge jump origins here ...
2175 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2177 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2178 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
2179 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
2180 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2182 * statement.cs (Goto.Resolve): ... not here.
2183 (Goto.Emit): Remove CS1632 check.
2185 2006-05-14 Marek Safar <marek.safar@seznam.cz>
2187 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2190 2006-05-11 Raja R Harinath <rharinath@novell.com>
2192 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2193 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2194 (FlowBranchingException.Label): Likewise.
2196 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
2198 (MyBitVector.Or): Use it to avoid losing information (Count).
2199 (FlowBranching.MergeOrigins): Likewise.
2201 * flowanalysis.cs (UsageVector.IsDirty): Remove.
2202 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2203 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2204 (UsageVector.ToString): Simplify.
2205 (UsageVector.MergeSiblings): Move here from ...
2206 (FlowBranching.Merge): ... here.
2207 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2210 2006-05-10 Raja R Harinath <rharinath@novell.com>
2212 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2213 null bitvector is treated as all-true.
2215 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2216 (MyBitVector): Rationalize invariants. 'vector != null' implies
2217 that we have our own copy of the bitvector. Otherwise,
2218 'InheritsFrom == null' implies all inherited bits are true.
2220 2006-05-09 Marek Safar <marek.safar@seznam.cz>
2222 * statement.cs (LocalInfo): Add IsConstant.
2223 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2224 local variable for constants.
2226 2006-05-09 Raja R Harinath <rharinath@novell.com>
2228 * flowanalysis.cs (MyBitVector.Empty): New.
2229 (MyBitVector): Don't allow InheritedFrom to be null.
2230 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2231 (UsageVector, FlowBranching): Update to changes.
2233 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2234 recursion. The 'Parent == null' condition isn't sufficient for
2236 (FlowBranching.AddBreakOrigin): Likewise.
2237 (FlowBranching.AddContinueOrigin): Likewise.
2238 (FlowBranching.AddReturnOrigin): Likewise.
2239 (FlowBranching.StealFinallyClauses): Likewise.
2240 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2241 (FlowBranching.CheckOutParameters): Likewise.
2242 (FlowBranchingToplevel): Terminate all the above recursions here.
2243 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2244 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2246 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
2248 (FlowBranchingToplevel): New. Empty for now.
2249 (FlowBranching.MergeTopBlock): Update.
2250 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2251 branching for the anonymous delegate.
2252 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2254 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2255 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2256 information at the start of the merge. Reorganize.
2258 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2260 * class.cs (MethodData.Define): Method cannot implement interface accessor.
2262 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2264 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2265 to newly introduced ctor.
2267 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2268 message to one place.
2269 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2272 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2274 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2276 * ecore.cs (Expression.ResolveAsConstant): Updated.
2278 * statement.cs (ResolveMeta): Updated.
2280 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2282 * cs-parser.jay: __arglist cannot be used in initializer.
2284 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2287 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2290 2006-05-05 Raja R Harinath <rharinath@novell.com>
2292 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2293 (LabeledStatement): Add 'name' parameter.
2294 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2295 (Block.AddLabel): Update to changes.
2296 * cs-parser.jay (labeled_statement): Likewise.
2298 * flowanalysis.cs (BranchingType.Labeled): New.
2299 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2300 (FlowBranchingLabeled): New. Does nothing for now, but will
2301 eventually handle 'goto' flows.
2302 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2303 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2304 that's terminated ...
2305 (Block.Resolve): ... here.
2307 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2308 (UsageVector.MergeFinallyOrigins): Likewise.
2309 (FlowBranching.InTryOrCatch): Likewise.
2310 (FlowBranching.AddFinallyVector): Likewise.
2311 (FlowBranchingException): Update to changes.
2314 * statement.cs (Return.Resolve): Move error checking to ...
2315 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2316 (FlowBranchingException): Handle return origins like break and
2318 (FlowBranching.UsageVector.CheckOutParameters): Remove.
2320 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2323 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2326 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2329 * class.cs (MethodData.Define): Do public accessor check only when method
2330 implements an interface.
2332 2006-05-04 Raja R Harinath <rharinath@novell.com>
2334 Remove special handling of 'break'
2335 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2336 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
2337 (UsageVector.Break): Remove.
2338 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2340 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2342 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2343 UsageVector.Breaks (). Don't set NeedsReturnLabel.
2345 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2348 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2349 be the interface member.
2351 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2354 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2355 for emitting small (int) values.
2357 2006-05-03 Raja R Harinath <rharinath@novell.com>
2360 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2361 control-flow passes through the 'finally' after merging-in all the
2362 control-flows from 'try' and the 'catch' clauses.
2364 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2365 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
2366 always true at the only non-recursive entry point.
2367 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2368 FlowBranchingBreakable.
2369 (FlowBranchingLoop): Remove.
2370 * statement.cs (Return.DoResolve): Update to changes.
2373 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2374 (FlowBranching.CreateBranching): Handle it: create a
2375 FlowBranchingContinuable.
2376 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2377 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2378 except that it handles the 'continue' command.
2379 (FlowBranching.UsageVector.MergeOrigins): Rename from
2381 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2382 except that it overrides AddContinueOrigin.
2383 (FlowBranchingException): Override AddContinueOrigin, similar to
2385 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2386 Create a new branching around the embedded statement.
2387 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
2388 control flow after the embedded statement.
2389 (Continue.Resolve): Move all error checking to AddContinueOrigin.
2391 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2392 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2393 FlowBranchingBreakable.
2394 (FlowBranchingSwitch): Remove.
2397 * statement.cs (Break.Resolve): Simplify. Move responsibility for
2398 error reporting to ...
2399 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2400 Rename from 'AddBreakVector'. Add new location argument. Return
2401 a bool indicating whether the 'break' crosses an unwind-protect.
2402 (FlowBranchingException.AddBreakOrigin): Add.
2403 (FlowBranchingException.Merge): Propagate 'break's to surrounding
2404 flowbranching after updating with the effects of the 'finally'
2406 (FlowBranchingBreakable): New common base class for
2407 FlowBranchingLoop and FlowBranchingSwitch.
2409 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2411 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2413 2006-05-02 Raja R Harinath <rharinath@novell.com>
2415 * statement.cs (Do.Resolve): If the loop is infinite, set the
2417 (While.Resolve, For.Resolve): Set a barrier after the embedded
2418 statement. There's no direct control flow that goes from the end
2419 of the embedded statement to the end of the loop.
2420 * flowanalysis.cs (FlowBranching.Infinite): Remove.
2421 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
2422 above ensure that the reachability is correctly computed.
2424 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2425 (UsageVector.MergeBreakOrigins): If the current path is
2426 unreachable, treat it as if all parameters/locals are initialized.
2427 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
2428 infinite loops before merging-in break origins.
2430 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2431 (Reachability.Reachable): Split part into ...
2432 (Reachability.Unreachable): ... this. Simplify.
2433 (Reachability.IsUnreachable): Use 'Unreachable' instead.
2435 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2436 (Reachability.SetThrowsSometimes): Likewise.
2437 (FlowBranchingBlock.MergeTopBlock): Don't compare against
2438 TriState.Always, use corresponding property.
2439 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2440 (Block.Resolve): Likewise. Remove some redundant checks.
2442 2006-05-02 Raja R Harinath <harinath@gmail.com>
2444 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2445 (Reachability.Meet): Don't bother checking AlwaysThrows --
2446 barrier is always set.
2447 (FlowBranchingBlock.Merge): Likewise.
2449 2006-05-01 Raja R Harinath <harinath@gmail.com>
2451 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2452 checks for unreachable.
2454 2006-05-01 Marek Safar <marek.safar@seznam.cz>
2457 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2459 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2460 whether field is really assigned.
2462 2006-04-30 Raja R Harinath <harinath@gmail.com>
2464 * flowanalysis.cs (Reachability): Make 4-argument constructor
2466 (Reachability.Meet): Rename from 'And'. Remove static variant.
2467 (Reachability.Always): Rename from the highly misleading
2468 'Reachability.Never'.
2469 (FlowBranching.Merge): Update to changes. Mark an impossible
2470 situation with a 'throw'.
2471 (*): Update to changes.
2473 2006-04-29 Raja R Harinath <harinath@gmail.com>
2475 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2477 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2478 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2479 (*): Update to changes.
2480 * statement.cs: Update to changes.
2482 2006-04-28 Marek Safar <marek.safar@seznam.cz>
2485 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2487 2006-04-28 Raja R Harinath <harinath@gmail.com>
2489 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2492 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2493 argument to two arguments: an usage-vector and a bool. Move call
2494 to FlowBranching.Merge () ...
2495 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2497 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2498 handling of loop and switch reachability to ...
2499 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2501 2006-04-27 Raja R Harinath <harinath@gmail.com>
2503 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2504 handling to FlowBranchingLoop.InLoop.
2505 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2507 2006-04-26 Marek Safar <marek.safar@seznam.cz>
2510 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2511 anonymous method is allowed from AnonymousContainer here.
2513 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2515 2006-04-24 Raja R Harinath <rharinath@novell.com>
2518 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2520 2006-04-23 Marek Safar <marek.safar@seznam.cz>
2523 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2524 (DoubleConstant.Reduce): Ditto.
2526 2006-04-23 Raja R Harinath <rharinath@novell.com>
2528 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2529 Remove 'lvalue_right_side' argument. Move parts to ...
2530 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2531 (LocalVariable.DoResolveLValue): ... these.
2533 2006-04-21 Raja R Harinath <rharinath@novell.com>
2536 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2537 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2538 (LocalVariableReference.DoResolveBase): Use it to implement new
2540 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2541 (Argument.Resolve): Simplify. Move CS1510 check ...
2542 * ecore.cs (Expression.ResolveLValue): ... here.
2543 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2544 (PropertyExpr.DoResolveLValue): Likewise.
2545 (FieldExpr.Report_AssignToReadonly): Likewise.
2546 (FieldExpr.DoResolve): Add 'out_access' argument. Use
2547 LValueMemberAccess or LValueMemberOutAccess on instance depending
2549 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2550 DoResolve as appropriate.
2552 2006-04-20 Raja R Harinath <rharinath@novell.com>
2555 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2556 implicit conversions on 'out' and 'ref' arguments.
2558 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2559 improve clarity. Remove dead code.
2562 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2563 (Catch.Resolve): Resolve VarBlock if it exists.
2565 2006-04-19 Miguel de Icaza <miguel@novell.com>
2567 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2568 twice, this was some residual code, the enumerator was emitted
2569 properly in the two branche of if later.
2571 2006-04-19 Raja R Harinath <rharinath@novell.com>
2573 * expression.cs (Cast.ResolveLValue): Remove. The result of a
2574 cast is never an lvalue.
2575 (Cast.DoResolve, Cast.ResolveRest): Combine.
2576 (Argument.Emit): Simplify slightly. Move 'Expr is
2577 IMemoryLocation' check ...
2578 (Argument.Resolve): ... here.
2579 (Argument.Error_LValueRequired): Remove. Inline into only user.
2581 Simplifications. Fix cs0191-2.cs
2582 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2583 CS1649 and CS1651 to ...
2584 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
2585 the actual selection of the error code and message to a lookup
2586 table. Add a dummy return value to simplify callsites.
2587 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2588 readonly fields of other instances of the same type. Move CS0197
2590 * expression.cs (Argument.Resolve): ... here. Simplify code.
2591 Ensure that ec.InRefOutArgumentResolving is only set during LValue
2592 resolution of an out or ref argument. The code simplification
2593 above uses this invariant.
2595 2006-04-18 Raja R Harinath <rharinath@novell.com>
2597 Possibly fix #77752. Fix cs1690-[4-7].cs.
2598 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2599 CheckMarshallByRefAccess. Drop parameter.
2600 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
2602 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2604 * report.cs (AllWarnings): Add CS1690.
2605 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2607 (LocalVariableReference.DoResolveBase): Update.
2609 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2611 * class.cs (MethodOrOperator): Moved common parts from method class.
2612 detect obsolete attributes.
2613 (Method.Define): Simplified as it reuses code from base.
2614 (Constructor.ValidAttributeTargets): Fixed issue found during
2616 (Destructor.ValidAttributeTargets): Fixed issue found during
2618 (Operator): Finished refactoring set off by #78020. Operator class is now
2619 ordinary method class.
2621 * anonymous.cs: Updated.
2623 * decl.cs (DeclSpace): Add IsGeneric
2625 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2627 * class.cs (Constructor.Emit): Don't emit the attributes twice.
2629 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2631 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2632 detect obsolete attributes.
2633 (Method.CreateEmitContext): Moved to MethodOrOperator.
2635 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2638 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2639 customized exception to make crash detection easier.
2640 (MethodOrOperator): Started to work on new base class for methods and
2642 (Method): Derives from MethodOrOperator.
2643 (Constructor.Emit): Emits its own attributes.
2644 (AbstractPropertyEventMethod.Emit): Ditto.
2645 (Operator): Derives from MethodOrOperator, will refactor fully in extra
2647 (Operator.Emit): It's temporary more tricky than should be.
2649 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2651 * report.cs (InternalErrorException): Add ctor with inner exception.
2653 2006-04-08 Marek Safar <marek.safar@seznam.cz>
2656 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2659 2006-04-07 Marek Safar <marek.safar@seznam.cz>
2662 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2665 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2667 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2668 attribute is present and Guid not.
2669 (Interface.ApplyAttributeBuilder): Ditto.
2671 * attribute.cs: Add error message.
2673 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2677 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2678 sources (it's composite) so hold them in extra array as they are used in
2679 Emit phase only. It worked in the previous versions by mistake.
2680 (Attribute.Emit): Emit attribute for more owners when exist.
2682 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2683 it has now different behaviour.
2685 2006-04-04 Marek Safar <marek.safar@seznam.cz>
2687 * constant.cs (Constant.IsDefaultInitializer): New method.
2689 * class.cs: Updated.
2691 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2692 re-initialize default values. It saves KBs almost for every assembly.
2693 Thanks Zoltan for the idea.
2694 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2695 (ArrayCreation.DoResolve): Resolve only once.
2696 (ArrayCreation.Emit): Emit static initializer only when it is faster.
2697 (ArrayCreation.GetAttributableValue): Cope with optimized values.
2699 2006-04-03 Zoltan Varga <vargaz@gmail.com>
2701 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2704 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2706 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2707 in an embedded statement too.
2709 2006-04-01 Raja R Harinath <rharinath@novell.com>
2712 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2714 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2718 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2721 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2723 2006-03-31 Marek Safar <marek.safar@seznam.cz>
2725 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2728 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2729 LocalTemporary change.
2731 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2733 (ClassOrStruct.DefineFieldInitializers): Implemented static field
2734 initializers optimization.
2735 (ClassOrStruct.TypeAttr): Moved from modifiers.
2736 (Constructor.CheckBase): Don't crash when static ctor has parameters.
2737 (FieldBase.ResolveInitializer): Resolves initializer.
2738 (FieldBase.HasDefaultInitializer): New property.
2740 * cs-parser.jay: Removed message.
2742 * expression.cs (CompilerGeneratedThis): New specialization.
2744 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2746 2006-03-28 Marek Safar <marek.safar@seznam.cz>
2748 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2750 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2752 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2753 be now EnumConstants only.
2755 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2757 * attribute.cs, driver.cs: Reset more caches.
2759 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2761 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2763 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2765 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2766 for easier reuse. Updated all overrides.
2767 (IntegralConstant): New base class for all integral constants.
2768 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2769 of the constant range, report custom error.
2770 (UIntConstant.Reduce): Fixed uint conversion.
2772 * ecore.cs, literal.cs: Reduce updates.
2774 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2778 * class.cs (Constructor.Define): Removed extra if for default ctors.
2779 A patch from Atsushi Enomoto.
2781 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2783 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2784 GetAttributableValue.
2786 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2789 * convert.cs (ImplicitConversionRequired): Error message moved to
2792 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2793 automatic implicit conversion of an output value.
2794 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2796 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2798 (TypeOf.GetAttributableValue): Add extra handling for object type.
2800 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2801 special error message.
2803 2006-03-25 Marek Safar <marek.safar@seznam.cz>
2805 * class.cs (Constructor.Emit): Don't crash when struct ctor is
2807 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2808 compatible with MS runtime.
2810 2006-03-23 Marek Safar <marek.safar@seznam.cz>
2812 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2813 attribute arguments here.
2815 * class.cs (Indexer.Define): The check was moved to attribute class.
2817 2006-03-22 Marek Safar <marek.safar@seznam.cz>
2819 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2820 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2823 2006-03-22 Raja R Harinath <rharinath@novell.com>
2825 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2826 mcs to keep code differences small.
2827 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2828 * typemanager.cs (parameter_default_value_attribute_type): New.
2829 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2832 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2834 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2836 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2838 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2840 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2843 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2845 * doc-bootstrap.cs : fix build.
2847 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2849 * expression.cs (StringConcat.Append): Issue a warning when empty string
2852 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2854 * assign.cs (CompoundAssign.ResolveSource): Removed.
2856 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2859 * class.cs (TypeContainer.FindMethods): Removed.
2860 (TypeContainer.CheckMemberUsage): Made static.
2862 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2864 * constant.cs (CheckRange): Removed unused type argument.
2865 (CheckUnsigned): Removed unused type argument.
2867 * cs-parser.jay: Updated after MemberAccess clean up.
2868 Uses Length for empty string test.
2870 * cs-tokenizer.cs: Uses Length for empty string test.
2871 (IsCastToken): Made static.
2872 (is_hex): Made static.
2873 (real_type_suffix): Made static.
2875 * decl.cs (SetupCache): Made static.
2876 (OnGenerateDocComment): Removed unused ds argument.
2878 * delegate.cs (VerifyDelegate): Removed unused argument.
2880 * doc.cs: Uses Length for empty string test.
2882 * driver.cs: Uses Length for empty string test.
2884 * enum.cs (IsValidEnumType): Made static
2886 * expression.cs (EnumLiftUp): Removed unused argument.
2887 (ResolveMethodGroup): Ditto.
2888 (BetterConversion): Ditto.
2889 (GetVarargsTypes): Ditto.
2890 (UpdateIndices): Ditto.
2891 (ValidateInitializers): Ditto.
2892 (MemberAccess.ctor): Ditto.
2893 (GetIndexersForType): Ditto.
2895 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2897 * iterators.cs: Updated after MemberAccess clean up.
2899 * location.cs: Uses Length for empty string test.
2901 * namespace.cs: Uses Length for empty string test.
2903 * report.cs (CheckWarningCode): Made static.
2905 * statement.cs (LabeledStatement): Removed unused argument.
2907 * typemanager.cs (FilterNone): Removed.
2909 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2911 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2914 * class.cs: Updated.
2916 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2918 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2920 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2924 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2925 reporting, it's more tricky than I thought.
2927 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2931 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2933 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2934 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2935 Add more error reporting; Fixed issue with params.
2937 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2939 * cs-parser.jay: AnonymousMethod requires host container.
2941 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2943 2006-03-18 Raja R Harinath <harinath@gmail.com>
2945 * class.cs: Change 'TypeContainer ds' constructor argument to
2946 'DeclSpace parent'. Some classes were missed below due to
2947 different naming convention.
2949 * class.cs (MemberCore.Parent): Delete. This makes the
2950 ParentContainer changes below enforceable by the compiler.
2952 Treat pointers to enclosing declaration space as 'DeclSpace', not
2954 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2955 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2957 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2959 (Block.AddThisVariable): Likewise.
2960 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2961 (AbstractPropertyEventMethod.Emit): Likewise.
2962 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2963 (GetMethod.Define, SetMethod.Define): Likewise.
2964 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2965 (DelegateMethod.EmitMethod): Likewise.
2967 Fix regression test-partial-13.cs.
2968 Rationalize use of PartialContainer. Ensure that the partial
2969 class semantics can be tied to type-correctness, i.e., any
2970 violation will cause a compile error.
2971 * class.cs, const.cs: Access all fields that belong to class
2972 TypeContainer via ParentContainer. Arguments of EmitContexts and
2973 Resolve()-like functions still use 'Parent'.
2975 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2976 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2977 (PropertyMethod.CheckModifiers): Remove unused argument.
2978 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2981 2006-03-17 Raja R Harinath <harinath@gmail.com>
2983 Make semantics of PartialContainer simpler.
2984 * decl.cs (DeclSpace.IsPartial): Remove.
2985 * class.cs (TypeContainer.IsPartial): Likewise.
2986 (TypeContainer..ctor): Set PartialContainer to point to self.
2987 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2988 (TypeContainer.FindNestedType): Likewise.
2989 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2991 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2993 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2995 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2997 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3000 2006-03-15 Marek Safar <marek.safar@seznam.cz>
3002 * class.cs (Operator.Define): An error for base conversion was not
3005 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
3007 * iterator.cs : yield break is allowed in try statement which has
3008 catch clauses. Fixed bug #77767.
3010 2006-03-13 Marek Safar <marek.safar@seznam.cz>
3012 A fix for #77593, #77574.
3014 * class.cs (MethodCore.CheckBase): Another if for operator.
3016 2006-03-09 Marek Safar <marek.safar@seznam.cz>
3018 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3021 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3022 (DelegateCreation.ImplicitStandardConversionExists): New method for just
3025 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3028 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3029 Updated after another emitcontext usage was clean up. It should help us to
3030 synchronize with gmcs easier.
3032 2006-03-04 Marek Safar <marek.safar@seznam.cz>
3036 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3037 (Event.Define): ditto
3038 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3040 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3041 Removed redundant code and set NewSlot for Invoke method too.
3043 * parameter.cs (Parameters.ctor): Add custom, type ctor.
3044 (Parameters.MergeGenerated): New method. Use this method when you merge
3045 compiler generated argument with user arguments.
3047 2006-03-03 Marek Safar <marek.safar@seznam.cz>
3049 * attribute.cs (ResolveAsTypeTerminal): Removed.
3051 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3052 specialization for predefined types; 30% speed up.
3053 Finally placed obsolete check to right place.
3054 (Expression.ResolveType): Removed.
3056 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3057 Updated after ResolveType was removed.
3059 * expression.cs (Cast.ctor): Check void cast.
3060 (Binary.ResolveAsTypeTerminal): Is never type.
3061 (Conditional.ResolveAsTypeTerminal): Is never type.
3063 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3065 2006-03-01 Raja R Harinath <rharinath@novell.com>
3068 * expression.cs (ParameterReference.DoResolveBase): Change return
3070 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3074 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3077 * typemanager.cs (GetFullNameSignature): Don't nullref on
3078 protected accessors.
3080 2006-02-27 Marek Safar <marek.safar@seznam.cz>
3082 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3083 these two separated members to simplify the code.
3084 (Attribute.Resolve): Refactored to use new fields and methods.
3085 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3086 implemented obsolete attribute checking.
3087 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3088 implemented obsolete checking again. It look line never ending quest ;-)
3089 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3091 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3093 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3095 *class.cs (Property.Define): Add RegisterProperty call.
3097 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3098 argument groups (only 2).
3100 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3101 encoding expression to arguments.
3102 (Expression.ExprClassToResolveFlags): Just turned to property.
3104 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3105 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3106 optimized as well as implemented support for zero-length attributes.
3108 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3109 Add caching of PropertyInfo's.
3111 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3113 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3114 error multiple times.
3116 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3118 New partial class implementation.
3119 A fix for #77027, #77029, #77403
3121 * attribute.cs (Attributable): Made attributes protected.
3123 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3124 the replacements of ClassPart and PartialContainer.
3125 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3126 (TypeContainer.AddInterface): Ditto.
3127 (TypeContainer.AddPartial): The main method for partial classes. It checks
3128 for errors and merges ModFlags and attributes. At the end class is added to
3130 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3132 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3133 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3134 from the rest of partial classes.
3135 (TypeContainer.GetClassBases): Simplified.
3136 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3138 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3139 (TypeContainer.HasExplicitLayout): Uses Flags now.
3140 (PartialContainer): Removed.
3141 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3142 (StaticClass): Was merged with Class.
3143 (Class.GetClassBases): class and static class bases are verified here.
3144 (Class.TypeAttr): Added static attributes when class is static.
3145 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3146 (MemberBase): In some cases we need to call parent container for partial
3147 class. It should be eliminated but it's not easy now.
3149 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3151 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3152 partial classed to accumulate class comments.
3153 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3155 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3157 * driver.cs (MainDriver): Tree.GetDecl was removed.
3159 * modifiers.cs (Modifiers): Add partial modifier.
3161 * tree.cs (Tree.decl): Removed.
3162 (RootTypes): Started to use this class more often for root types
3165 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3169 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3170 external interface does not have an attribute.
3172 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3174 Another prerequisites for new partial classs implementation.
3176 * attribute.cs (Attribute.Equal): Implemented.
3177 (Attribute.Emit): Changed as attributes can be applied more than twice.
3178 (Attributes.Emit): Check for duplicate attributes here.
3180 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3181 as a parameter, clean-up.
3183 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3187 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3188 contains obsolete attribute check which can in some cases look for base
3189 type of current class which is not initialized yet.
3190 (TypeContainer.BaseType): Replacement of ptype.
3192 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3194 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3196 First of prerequisites for new partial classs implemention.
3198 * attribute.cs (Attributable): Extended by ResolveContext;
3199 Attributes finally have correct context for resolving in all cases.
3200 (AttachTo): Attribute owner is assigned here.
3202 * codegen.cs (IResolveContext): Introduce new interface to hold
3203 all information needed in resolving phase.
3204 (EmitContext): Implements IResolveContext; more clean-up needed here.
3206 * decl.cs (MemberCore): Implemented IResolveContext.
3208 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3209 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3210 parameter.cs, statement.cs, tree.cs, typemanager.cs:
3211 Refactored to use new IResolveContext instead of EmitContext; cleanup
3213 2006-02-06 Miguel de Icaza <miguel@novell.com>
3215 * codegen.cs (EmitScopeInitFromBlock): check here the
3216 capture_context, there is no need to make two calls to the
3219 * anonymous.cs: Add some debugging messages that might help me
3220 track other instances of this problem in the future (the
3221 regression of test 467).
3223 * cs-parser.jay: track the variable block, as we need to initalize
3224 any captured variables declared in this block for the "catch"
3225 portion of the "Try" statement.
3227 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3228 scope initialization for captured variables.
3230 Also, move the emit for the variables after the block location has
3233 2006-02-06 Marek Safar <marek.safar@seznam.cz>
3235 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3237 2006-02-02 Miguel de Icaza <miguel@novell.com>
3239 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3240 commit yesterday, the initialization for the roots is necessary.
3241 What is not necessary is the scope activation.
3243 2006-02-02 Raja R Harinath <rharinath@novell.com>
3245 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3246 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3248 (Argument.Resolve): Remove CS0206 checks.
3250 2006-02-01 Miguel de Icaza <miguel@novell.com>
3252 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3253 scopes for all the roots, the scopes will now be emitted when the
3254 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
3256 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3257 code. This reduces a lot of existing cruft.
3259 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3260 that the ScopeInfo is generated as we enter the scope, not at the
3261 time of use, which is what we used to do before.
3263 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3264 every time a Block is about to be emitted if we have a
3267 2006-02-01 Raja R Harinath <rharinath@novell.com>
3269 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3271 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3273 * typemanager.cs (cons_param_array_attribute): Make private.
3274 (Reset): Set it to null.
3275 (InitCoreHelpers): Don't initialize it.
3276 (ConsParamArrayAttribute): New. Initialize it as needed.
3277 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3279 2006-01-31 Miguel de Icaza <miguel@novell.com>
3281 * expression.cs: There might be errors reported during the
3282 selection of applicable methods. If there are errors, do not
3283 continue execution as it will lead the compiler to crash.
3285 2006-01-30 Miguel de Icaza <miguel@novell.com>
3287 * expression.cs: Member access is not allowed on anonymous
3288 methods. Fixes #77402.
3290 2006-01-30 Raja R Harinath <rharinath@novell.com>
3293 * cs-parser.jay (VariableDeclaration): Don't set
3294 current_array_type to null.
3295 (field_declaration, event_declaration, declaration_statement):
3296 Set it to null here.
3298 2006-01-28 Raja R Harinath <harinath@gmail.com>
3300 * typemanager.cs (GenericParameterPosition): New.
3303 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
3305 * doc.cs : To process "include" elements, first we should create
3306 another list than XmlNodeList, because it could result in node
3307 removal, which could result in that the XmlNodeList gives up
3310 (Also made code identical to gmcs again.)
3312 2006-01-25 Miguel de Icaza <miguel@novell.com>
3314 * ecore.cs: Introduce an error report that we were not catching
3315 before, if not silent, we must report the error. Gonzalo ran into
3318 2006-01-23 Miguel de Icaza <miguel@novell.com>
3320 A fix for bug: #76957
3322 * iterators.cs (MoveNextMethod.CreateMethodHost): call
3323 ComputeMethodHost before creating the method, this is a new
3326 * anonymous.cs (AnonymousContainer): Now we track all the scopes
3327 that this method references (RegisterScope). The actual scope
3328 where the method is hosted is computed with the ComputeMethodHost
3329 before we create the method.
3331 Moved the Deepest routine here.
3333 (AnonymousContainer.ComputeMethodHost): New routine used to
3334 compute the proper ScopeInfo that will host the anonymous method.
3336 (ScopeInfo): Deal with multiple roots. The problem was that we
3337 did not have a unique root where all ScopeInfos could be hanged
3338 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
3341 Remove AdjustMethodScope which is now computed at the end. Remove
3342 LinkScope which did a partial link, instead link all ScopeInfos
3343 before code generation from the new "LinkScopes" routine.
3345 Simplify all the Add* routines as they no longer need to maintain
3346 the tree, they just need to record that they are using variables
3349 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3350 routines to produce the forest of ScopeInfo trees.
3352 * class.cs (TypeContainer.AppendMethod): This is just like
3353 AddMethod, but ensures that an interface implementation method
3354 (IEnumerable.XXX) is not inserted at the beginning of the queue of
3355 methods, but at the end.
3357 We use this functionality to ensure that the generated MoveNext
3358 method in the iterator class is resolved/emitted before the
3359 enumerator methods created.
3361 This is required because the MoveNext method computes the right
3362 ScopeInfo for the method. And the other methods will eventually
3363 need to resolve and fetch information computed from the anonymous
3366 2006-01-21 Raja R Harinath <harinath@gmail.com>
3367 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3370 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3372 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3373 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3375 2006-01-18 Raja R Harinath <rharinath@novell.com>
3377 Fix #76656, cs0231-2.cs.
3378 * cs-parser.jay (formal_parameter_list): Make error case catch
3380 (parenthesized_expression_0): Add CS1026 check.
3381 (invocation_expression): Remove unused { $$ = lexer.Location }.
3383 2006-01-17 Raja R Harinath <rharinath@novell.com>
3386 * cs-parser.jay (statement_expression): Don't list out the
3387 individual statement-expressions. Convert syntax error into
3390 2006-01-16 Raja R Harinath <rharinath@novell.com>
3393 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3394 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
3395 CheckIntermediateModification.
3396 (FieldExpr.DoResolve): Add new two-argument version that
3397 allows us to resolve the InstanceExpression as an lvalue.
3398 The one-argument variant is now just a wrapper.
3399 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3400 Resolve the lhs as an lvalue if the it has a value type.
3401 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3402 from Assign.DoResolve.
3403 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3404 resolved as an lvalue.
3405 (PropertyExpr.DoResolve): Update.
3406 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3407 has a value type. Move CS1612 check here from
3408 CheckIntermediateModification.
3409 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3410 * expression.cs (EmptyExpression.OutAccess): New. Used as the
3411 'right_side' of a ResolveLValue on an 'out' argument.
3412 (EmptyExpression.LValueMemberAccess): New. Used as the
3413 'right_side' of a propagated ResolveLValue on a value type.
3414 (LocalVariableReference.DoResolveBase): Recognize
3415 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3417 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3418 EmptyExpression.Null.
3420 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
3422 * typemanager.cs : added IsGenericParameter(). In mcs it always
3424 * doc.cs : for generic parameters, use GenericParameterPosition,
3427 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
3429 * expression.cs: Fix Console.WriteLine ((this = x).foo);
3431 2006-01-12 Miguel de Icaza <miguel@novell.com>
3433 This fixes the problem where we used ldfld instead of ldflda to
3434 load the "THIS" pointer on captured parameters, when THIS is a
3435 value type. See bug #77205.
3437 * iterators.cs (CapturedThisReference.Emit): Pass false to
3438 EmitThis (we do not need the address).
3440 * codegen.cs (EmitThis): it needs to know whether we need the
3441 address of `this' or not. This is used by value types.
3443 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3444 every other call passes false.
3446 2006-01-12 Raja R Harinath <rharinath@novell.com>
3449 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3451 * expression.cs (Invocation.OverloadResolve): Update.
3452 (Invocation.DoResolve): Avoid double resolution of invocation.
3454 2006-01-11 Raja R Harinath <rharinath@novell.com>
3457 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3458 unary negation of floating point types as 0-expr; negation cannot
3459 overflow in floating point types.
3462 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3463 on operands of 'void' type.
3466 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3467 and ExclusiveOr for boolean constants too.
3469 2006-01-09 Raja R Harinath <rharinath@novell.com>
3472 * expression.cs (Invocation.OverloadResolve): Replace reflected
3473 override methods with their base virtual methods, rather than
3475 * typemanager.cs (TypeManager.GetOverride): New.
3477 2006-01-05 Jb Evain <jbevain@gmail.com>
3479 * class.cs (Property.Define, Indexer.Define): do not tag the
3480 properties as SpecialName | RTSpecialName.
3482 2006-01-04 Miguel de Icaza <miguel@novell.com>
3484 * class.cs (MethodCore.IsDuplicateImplementation): This method was
3485 doing a low-level comparission of parameter types. It was lacking
3486 a check for __argslist.
3488 2005-12-30 Miguel de Icaza <miguel@novell.com>
3490 * expression.cs (ParameterReference.DoResolveBase): Allow
3491 reference parameters if they are local to this block.
3493 This allows the ref and out parameters of a delegate to be used in
3494 an anonymous method, for example:
3496 delegate void set (out int x);
3498 set s = delegate (out int x){
3502 This is used by functionality introduced late in the C# language.
3504 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3505 method that take ref and out parameters.
3507 Fixes #77119 which was a late change in the spec.
3509 2005-12-23 Miguel de Icaza <miguel@novell.com>
3511 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3512 parent if its the same scope. Fixes #77060.
3514 2005-12-21 Miguel de Icaza <miguel@novell.com>
3516 * driver.cs: Report the case of no source files and no -out:
3519 2005-12-20 Raja R Harinath <rharinath@novell.com>
3522 * expression.cs (ComposedCast.GetSignatureForError): Define.
3524 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3528 * namespace.cs (NamespaceEntry): Add extern_aliases as a
3529 ListDictionary, to contain the ExternAliasEntry entries (in
3530 addition to the NamespaceEntry.aliases hashtable). This field is
3531 shared between the original entry and its doppelganger (bodyless
3533 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3534 extern_aliases field.
3535 (NamespaceEntry.Lookup): Move the IsImplicit check after the
3536 lookup in extern_aliases.
3538 2005-12-16 Raja R Harinath <rharinath@novell.com>
3541 * class.cs (TypeContainer.Mark_HasEquals): New.
3542 (TypeContainer.Mark_HasGetHashCode): New.
3543 (ClassPart): Override them.
3544 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3547 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3548 'parent' argument to the base constructor.
3550 Remove all mention of TypeContainer from decl.cs.
3551 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3552 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3553 (DeclSpace.DeclSpace): Likewise.
3554 (DeclSpace.DefineMembers): Remove unused argument.
3555 * cs-parser.jay (pop_current_class): Update to changes. Simplify
3556 debugging check -- we don't care if the debug code throws an
3557 InvalidCastException instead of an InternalErrorException.
3558 * class.cs (TypeContainer.DefineMembers): Update to changes.
3559 (TypeContainer.DoDefineMembers): Likewise.
3560 (TypeContainer.GetMethods): Likewise.
3561 (PropertyMember.Define): Likewise.
3562 (MemberBase.Parent): New property that forwards to
3563 MemberCore.Parent, but ensures that we get a TypeContainer.
3564 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3565 (RootContext.PopulateTypes): Likewise. Remove special case code
3566 for !RootContext.StdLib: DefineMembers is idempotent.
3568 2005-12-14 Miguel de Icaza <miguel@novell.com>
3570 * convert.cs (ExplicitConversionCore): Check the return value from
3571 ExplicitConversionCore which can return null on failure. Fixes #76914
3573 2005-12-13 Marek Safar <marek.safar@seznam.cz>
3575 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3577 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
3579 * doc.cs : The search for referenced namespace was insufficient to
3580 get global one as it used to do. Fixed bug #76965.
3582 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
3584 * doc.cs : check name in cref in the last phase that whether it is
3587 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3589 * cs-tokenizer.cs : reverted the latest change: it somehow broke
3592 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3594 * doc.cs : so it turned out that we cannot skip override check for
3595 interface members. Fixed bug #76954.
3597 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3599 * cs-tokenizer.cs : fixed bug #75984:
3600 - #warning and #error should not be handled when the source line
3602 - #line is not checked strictly when the source line is disabled.
3603 - #define and #undef is on the other hand checked strictly at any
3606 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
3608 * cs-tokenizer.cs : missing Location (actually, filename) in one of
3611 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3613 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3615 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3617 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3618 (FieldBase.Initializer): Initializer is now optional.
3619 (EventField.Define): Only event field can have initializer.
3621 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3623 * const.cs (Const): Reuse initializer.
3625 * cs-parser.jay: Updated after FieldBase changes.
3626 Added current_array_type to simplify array initializers.
3628 * ecore.cs (NullCast.IsDefaultValue): Implemented.
3630 * expression.cs, iterators.cs: Updated.
3632 * namespace.cs (NamespaceEntry): Made UsingFound private.
3634 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3636 * parameterCollection.cs: Obsolete, removed.
3637 * parser.cs: Obsolete, removed.
3639 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3642 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3644 * enum.cs (Enum.Define): Set obsolete context here.
3646 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3649 - FindDocumentedMember() now expects 1) paramList as null
3650 when "we don't have to check the number of parameters" and
3651 2) Type.EmptyTypes when "there is no arguments".
3652 - Introduced FoundMember struct to hold the exact type which was
3653 used to find the documented member (the above change broke
3654 test-xml-044; it might be better just to use DeclaringType than
3655 what MS does, like this change does, but it depends on usage.)
3657 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3659 * doc.cs : documented member might be from DeclaringType for nested
3660 types. Fixed bug #76782.
3662 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3664 * anonymous.cs: Have the param code handle leaving copies on the
3665 stack etc. Allows anonymous params to take part in the assignment
3666 code (++, +=, etc). Fixes bug #76550
3668 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3669 it down to the anon code.
3671 * iterators.cs: Use dummy var here
3673 * codegen.cs: Handle new vars
3675 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3678 * class.cs (MethodData.Define): Set proper Obsolete context.
3680 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3682 (FieldExpr.DoResolve): Ditto.
3684 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3687 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3688 parent is not obsolete.
3690 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3692 * doc.cs : (FindDocumentedMember) find parameterless members first
3693 and get CS0419 in the early stage. Fixed first case of bug #76727.
3695 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3698 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3699 no error was reported.
3701 *expression.cs (Binary.DoResolve): left can be null.
3703 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3706 * class.cs (MethodData.Emit): Parameters should be labeled first.
3708 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3711 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3713 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3715 * attribute.cs (AreParametersCompliant): Moved to Parameter.
3717 * class.cs (MethodCore): Parameter clean up.
3718 (IMethodData): Added ParameterInfo.
3719 (MethodData): Parameter clean up.
3720 (Indexer.Define): Parameter clean up.
3732 * typemanager.cs: Parameter clean up.
3734 * delegate.cs (Define): Get rid of duplicated code.
3736 * expression.cs (ParameterReference): Removed useless parameters
3738 (Invocation): Ditto.
3740 * parameter.cs (ParamsParameter): New class, params specialization.
3741 (ArglistParameter): Attemp to separate arglist.
3742 (Parameter): Refactored to be reusable and faster.
3743 (Parameter.Modifier): Made understandable.
3744 (Parameters): Changed to be used as a class for `this' assembly
3745 parameters. Refactored to use new specialized classes.
3747 * support.cs (ParameterData): Added Types property.
3748 (InternalParameters): Deleted.
3750 2005-08-20 Martin Baulig <martin@ximian.com>
3752 Merging this patch from GMCS to fix #75867.
3754 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3755 scope if we don't already have it.
3757 2005-11-17 Martin Baulig <martin@ximian.com>
3760 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3761 inherit the scope from our parent. Fixes #76653.
3763 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3765 * doc.cs : the previous patch does not actually fix the bug.
3766 PropertyInfo override check is now implemented and really fixed it.
3767 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3769 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3771 * doc.cs : apply "override filter" also to properties.
3774 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3776 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3777 no need to check overrides. For classes, omit those results from
3778 interfaces since they must exist in the class. Fixed bug #76726.
3780 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3782 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3783 with different parameters. Fixed the second problem in #76685.
3785 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3787 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3788 get expected 'protected' access in CheckValidFamilyAccess()).
3791 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3793 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3794 Fixed bug #76705. CS1569 was incorrectly commented out.
3796 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3798 * doc.cs : use Invocation.IsOverride() to do real override check.
3799 * expression.cs : made Invocation.IsOverride() internal.
3801 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3803 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3804 TypeBuilder.FindMembers() and filter overriden base members out.
3807 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3809 * doc.cs : ref/out parameters are represented as '@' (instead of
3810 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3812 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3814 * doc.cs : when there was no '.' in cref to methods in doc comment,
3815 then parameters were missing in the output. Fixed bug #76691.
3817 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3819 * driver.cs : don't output docs when there is an error.
3822 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3825 Now it should detect indexers. Fixed primary concern in bug #76685.
3826 Fixed CS0419 message to not show the identical member signature in
3829 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3831 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3832 instead of Type.FindMembers() since it does not handle events.
3835 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3837 * codegen.cs: Fixed typo (speficied -> specified).
3839 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3842 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3844 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3846 * attribute.cs: Changed error message.
3848 * cs-tokenizer.cs: One more check.
3850 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3852 * statement.cs (Block.Resolve): Ignore empty statement.
3854 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3856 * report.cs: Made error/warning methods more strict to avoid
3859 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3860 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3861 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3862 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3864 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3866 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3867 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3869 * class.cs (TypeContainer.IsComImport): New property.
3870 (Constructor.Define): Create proper ctor for ComImport types.
3872 * expression.cs (New.CheckComImport): Fixed.
3874 2005-11-07 Miguel de Icaza <miguel@novell.com>
3876 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3877 that a parameter has been captured does not mean that we do not
3878 have to do the rest of the processing. This fixes the second part
3879 of #76592. If there was another anonymous method capturing
3880 values in the past, the Scope would never be set for the second
3881 method that captured the same parameter.
3883 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3884 properly manipulate the stack. Second part of fix for #76592.
3886 * expression.cs (New): Add support for invoking "new" on
3887 interfaces that have been flagged with the ComImport attribute and
3888 the CoClass. Fixes #76637
3890 * statement.cs (Try.DoEmit): When a variable is captured, do not
3891 try to emit the vi.LocalBuilder variable as it has been captured.
3892 Create a temporary variable and store the results on the
3893 FieldBuilder. Fixes #76642
3895 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3897 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3899 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3901 * expression.cs (Binary.DoResolve): Added && optimalization.
3903 * typemanager.cs (AddUserType): Removed useless argument.
3905 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3907 * statement.cs (Block.variables): Uses ListDictionary.
3909 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3912 * class.cs (PartialContainer.EmitType): Customized to emit
3913 security attributes.
3914 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3915 for partial classes.
3917 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3920 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3921 access has to be fixed.
3923 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3925 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3928 * ecore.cs (NullCast.Reduce): Implemented.
3930 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3933 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3935 (Foreach.Resolve): Catch null properly.
3937 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3939 * cs-tokenizer.cs: Warning text fix.
3941 * driver.cs: AllWarningNumbers exposed on public interface.
3943 * report.cs (): Reviewed warning numbers.
3944 (IsValidWarning): Use binary search.
3946 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3948 * driver.cs: Implemeted resource visibility.
3949 (Resources): New class for code sharing between /res: and
3952 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3955 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3958 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3961 * ecore.cs (NullCast): Child is contant only.
3963 * literal.cs (NullLiteral.Reduce): null can be converted to any
3966 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3968 * driver.cs: Use Encoding.Default as default code page instead
3971 2005-10-27 Raja R Harinath <rharinath@novell.com>
3974 * expression.cs (Invocation.Error_InvalidArguments): Handle
3975 __arglist parameters.
3976 (Invocation.VerifyArgumentsCompat): Likewise.
3977 * support.cs (ReflectionParameters.GetSignatureForError): Print
3978 __arglist parameters.
3979 (InternalParamters.GetSignatureForError): Likewise.
3980 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3982 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3984 * attribute.cs (GetPropertyValue): Made public.
3986 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3988 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3990 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3993 * driver.cs: Reflect method name change.
3995 * statement.cs (Try.Resolve): Warn when try has both general
3998 * typemanager.cs: runtime_compatibility_attr_type new predefined
4001 2005-10-26 Raja R Harinath <harinath@gmail.com>
4004 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4005 treat it as an empty parameter list.
4007 2005-10-26 Raja R Harinath <rharinath@novell.com>
4010 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
4011 ResolveAsTypeStep silent.
4012 * statement.cs (Block.AddConstant): Mark block as used.
4013 (Block.ResolveMeta): Avoid piling on error messages
4014 if a constant initializer resolution fails.
4016 2005-10-25 Raja R Harinath <rharinath@novell.com>
4018 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4020 (NamespaceEntry.VerifyAllUsing): New.
4021 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
4022 behaviour. Delegates actual resolution of alias to ...
4023 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
4024 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4026 * driver.cs (Driver.MainDriver): Update.
4028 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4029 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4031 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4033 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4034 RootNamespace.DefineNamespacesForAll.
4036 2005-10-24 Raja R Harinath <harinath@gmail.com>
4038 * typemanager.cs (assemblies, external_aliases, modules)
4039 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4040 (ComputeNamespaces, GetRootNamespace): Remove extra staging
4041 overhead. Move resposibility ...
4042 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
4043 * driver.cs, attribute.cs, codegen.cs: Update to changes.
4045 2005-10-23 Raja R Harinath <harinath@gmail.com>
4047 * namespace.cs (RootNamespace.all_namespaces): Renamed from
4048 cached_namespaces. Improve usage.
4049 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4050 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4051 Move from GlobalRootNamespace and simplify.
4052 (RootNamespace.Global): Make instance variable.
4053 (RootNamespace.RootNamespace): Add "alias name" parameter.
4054 (GlobalRootNamespace): Simplify drastically.
4055 (Namespace.Lookup): Don't use GetNamespace.
4056 * typemanager.cs (GetRootNamespace): Rename from
4057 ComputeNamespaceForAlias.
4058 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4060 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4062 * anonymous.cs (AnonymousContainer): Don't crash when container
4065 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4067 * expression.cs (Binary.DoResolve): Warn when comparing same
4070 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4073 * expression.cs (Binary.DoResolve): It looks like there are no
4074 convetsion rules in enum context.
4076 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4078 Add support for extern alias qualifiers.
4079 * typemanager.cs: Move some LookupTypeReflection code
4080 to namespace.cs, to have cleaner code. Added some methods
4081 to help us keep track of the extern aliased references.
4082 * driver.cs: Add suport for extern alias assemblies on command
4083 line and check for their warnings/errors. Also keep track of the
4084 extern aliased assemblies.
4085 * namespace.cs: Move the global functionality of Namespace
4086 to GlobalRootNamespace/RootNamespace. Now the global namespace
4087 is GlobalRootNamespace.Globa. Also the code moved from
4088 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
4089 Finally added LocalAliasEntry (AliasEntry before) and
4090 ExternAliasEntry, to handle alias statements.
4091 * cs-parser.jay: Add support in the grammar for extern alias
4093 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
4094 Update callings to Namespace (now in GlobalRootNamespace).
4096 2005-10-18 Raja R Harinath <rharinath@novell.com>
4099 * class.cs (TypeContainer.DefineType): Move updating of
4100 topological sort earlier in the code.
4101 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4103 2005-10-18 Marek Safar <marek.safar@seznam.cz>
4106 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4108 * constant.cs (Constant.TryReduce): Moved from Cast class.
4109 (Reduce): Made little bit more OO and fixed missing conversions.
4111 * ecore.cs (Reduce): Implemented.
4112 (Binary.EnumLiftUp): New method to upgrade values to enum values.
4114 * literal.cs (Reduce): Implemented.
4116 * class.cs: Reverted Miguel's wrong commit.
4118 2005-10-14 Miguel de Icaza <miguel@novell.com>
4120 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4122 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
4124 * cs-parser.jay, expression.cs : CS0214 was missing error location
4125 for constants. Fixed bug #76404.
4127 2005-10-11 Marek Safar <marek.safar@seznam.cz>
4130 * convert.cs (ExplicitConversionCore): Fixed object->enum
4133 2005-10-10 Raja R Harinath <rharinath@novell.com>
4135 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4137 (PropertyExpr.EmitCall): Likewise.
4138 * expression.cs (Invocation.EmitArguments): Handle case where
4140 (Invocation.EmitCall): Avoid allocating temporary variable if
4141 there are no arguments.
4143 2005-10-07 Raja R Harinath <rharinath@novell.com>
4146 * convert.cs (ImplicitConversionStandard): Move conversion of
4147 void* to arbitrary pointer types ...
4148 (ExplicitConversionStandard): .. here.
4149 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4150 error to always print typenames.
4152 2005-10-07 Raja R Harinath <rharinath@novell.com>
4154 * convert.cs (GetConversionOperator): Rename from
4155 GetConversionOperators. Move operator selection code from ...
4156 (UserDefinedConversion): ... here.
4158 2005-10-06 Marek Safar <marek.safar@seznam.cz>
4160 * convert.cs (ExplicitConversionCore): Removed duplicate enum
4163 2005-10-05 Marek Safar <marek.safar@seznam.cz>
4165 * assign.cs (Assign.DoResolve): Error method changed.
4167 * cfold.cs (DoConstantNumericPromotions): Error method changed.
4169 * const.cs (ResolveValue): Reset in_transit immediately.
4171 * constant.cs: Error method changed.
4173 * convert.cs: Removed useless location parameter.
4174 (ExplicitNumericConversion): Don't do double enum check.
4175 (ExplicitConversionCore): Renamed from ExplicitConversion.
4176 (ExplicitUnsafe): Extracted from ExplicitConversion.
4177 (ExplicitConversion): Uses for error reporting.
4179 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4181 (ResolveBoolean): Uses common error method.
4182 (CastToDecimal): Get rid of ec.
4183 (CastFromDecimal): Optimized.
4184 (ConvCast): Get rid of ec.
4186 * enum.cs (ResolveValue): Reset in_transit immediately.
4187 (Emit): Return after first error.
4189 * expression.cs: Convert changes.
4191 * literal.cs: Error method changed.
4193 * statement.cs: Error method changed.
4195 2005-10-03 Raja R Harinath <rharinath@novell.com>
4197 * support.cs (SeekableStreamReader.Position): Don't error out when
4198 the requested position is just beyond the end of the current
4201 2005-09-28 Raja R Harinath <rharinath@novell.com>
4203 * support.cs (SeekableStreamReader): Simplify drastically. Don't
4204 try to keep in sync with the byte count of the underlying Stream.
4205 However, this limits us to a window size of 2048 characters: i.e.,
4206 the maximum lookahead of our lexer/parser can be 2048 characters.
4208 2005-09-28 Marek Safar <marek.safar@seznam.cz>
4211 * driver.cs: Fix compilation files with full root path.
4213 2005-09-25 Miguel de Icaza <miguel@novell.com>
4215 * report.cs (SymbolRelatedToPreviousError): Format the output so
4216 it does not use an open parenthesis that is never closed.
4218 * driver.cs: Follow coding guidelines
4220 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4223 * const.cs (Const.ResolveValue): Check for assigning non-null
4224 value to reference type.
4226 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4228 * anonymous.cs: Implemented ExprClassName.
4230 * assign.cs (Assign.DoResolve): Don't chrash when type is not
4233 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4236 * class.cs (StaticClass.DefineContainerMembers): Report protected
4239 * codegen.cs: if(ed) PRODUCTION.
4241 * convert.cs (Error_CannotImplicitConversion): Better error
4244 * cs-parser.jay: More error checks.
4246 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4248 * driver.cs (CSCParseOption): Enabled wrong option check.
4250 * ecore.cs (Expression.ExprClassName): Turned to property.
4251 (MemberExpr.CheckIntermediateModification): For checking boxed
4252 value types modification.
4254 * statement.cs (Fixed.Resolve): Expression type must be
4255 convertible to fixed type.
4256 (CollectionForeach.GetEnumeratorFilter,TryType):
4257 Small refactoring for easier error checking.
4259 2005-09-26 Marek Safar <marek.safar@seznam.cz>
4261 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4264 * class.cs (GeneratedBaseInitializer): New class for customization
4265 compiler generated initializers.
4266 (MemberBase.DoDefine): Check Obsolete attribute here.
4267 (FieldMember.DoDefine): Ditto.
4269 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4272 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4273 (MemberCore.GetObsoleteAttribute): Removed argument.
4274 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4275 (MemberCore.CheckObsoleteType): New helper.
4279 * statement.cs: Updates after MemberCore changes.
4281 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4282 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4284 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4285 obsolete attribute for compiler construct.
4286 (As.DoResolve): Cache result.
4288 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4290 2005-09-26 Raja R Harinath <rharinath@novell.com>
4293 * expression.cs (This.VerifyFixed): In a value type T, the type of
4294 'this' is T&, iow, 'this' is either an out or ref parameter. In a
4295 value type R, 'this' is treated as a value parameter.
4297 2005-09-22 Miguel de Icaza <miguel@novell.com>
4299 * statement.cs (Lock): Use the TemporaryVariable class instead of
4300 manually using local variables as those do not work when variables
4303 * ecore.cs: Moved the TemporaryVariable class from being a nested
4304 class inside Foreach to be a public class that can be employed in
4307 2005-09-19 Marek Safar <marek.safar@seznam.cz>
4309 * cs-parser.jay: interface_accessors replaced by
4310 accessor_declarations.
4312 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4315 * statement.cs (GotoCase.Resolve): Convert null constant to
4317 (SwitchLabel.ResolveAndReduce): Ditto.
4318 (SwitchLabel.NullStringCase): Custom null stamp.
4319 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4321 typemanager.cs (CSharpSignature): Don't skip first argument
4324 2005-09-18 Miguel de Icaza <miguel@novell.com>
4326 * driver.cs: Set InEmacs based on the environment variable EMACS.
4328 * location.cs (InEmacs): in this mode, do not report column
4329 location as it confuses Emacs.
4331 2005-09-16 Marek Safar <marek.safar@seznam.cz>
4333 * cfold.cs, constant.cs, convert.cs, ecore.cs,
4334 expression.cs, iterators.cs, literal.cs: Store constants and
4337 * class.cs (MemberBase.ShortName): Pass location.
4339 * cs-parser.jay: Some location fixes.
4341 * ecore.cs (Expression.Location): Made virtual.
4343 2005-09-05 Miguel de Icaza <miguel@novell.com>
4345 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4346 if the underlying types are the same, otherwise we need to produce
4347 code that will do the proper cast.
4349 This was exposed by Marek's constant rewrite which produced
4350 invalid code for the call site:
4353 void Method (X v) {}
4357 This fixes test-49.cs
4359 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4361 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4362 Type/Object should be allowed as well. Fixed bug #75968.
4364 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4366 * expression.cs : (Binary.DoResolve): when one is enum constant and
4367 another is constant 0, then return enum one *as enum type*.
4370 2005-09-02 Raja R Harinath <rharinath@novell.com>
4372 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4376 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4377 flow-branching for LocalVariableReferences in case we were invoked
4378 from a MemberAccess.
4379 * expression.cs (LocalVariableReference.VerifyAssigned): New.
4381 (LocalVariableReference.DoResolveBase): ... this.
4382 (MemberAccess.Resolve): Do the check that was disabled during
4385 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4388 (PartialContainer.Create): check abstract/sealed/static strictly
4389 but abstract/sealed can exist only at one side. Fixed bug #75883.
4391 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
4394 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4395 specified, don't default to UnmanagedType.I4.
4397 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4399 * expression.cs : conditional operator should check possibly
4400 incorrect assign expression. Fixed bug #75946.
4402 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4404 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4405 Reverting the change. gmcs is much complex than mcs on this matter.
4407 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4409 * cs-tokenizer.cs : To read another token ahead of the actual
4410 consumption, use new SavedToken and cache token instead of moving
4411 back the stream with SeekableStreamReader (it seemed problematic).
4413 driver.cs : Thus use StreamReader directly.
4414 * support.cs : Thus removed SeekableStreamReader.
4416 2005-08-30 Raja R Harinath <rharinath@novell.com>
4419 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4420 (ScopeInfo.EmitScopeType): Use it to construct field names from
4421 names of captured locals.
4424 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4425 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4426 Pass 'target_type' to BoxedCast. Don't default to 'object'.
4427 (ExplicitConversion): Remove enum cases already handled by
4428 implicit conversion. Move implicit conversion check to the beginning.
4429 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4430 * expression.cs (ArrayCreation.EmitDynamicInitializers):
4431 Don't treat System.Enum as a struct.
4433 2005-08-30 Jb Evain <jbevain@gmail.com>
4435 * attribute.cs: handles as expression in parameters.
4437 2005-08-30 Raja R Harinath <rharinath@novell.com>
4440 * class.cs (TypeContainer.VerifyClsName): Don't use a
4441 PartialContainer when verifying CLS compliance.
4442 (AbstractPropertyEventMethod): Set Parent here, ...
4443 (PropertyMethod): ... not here.
4445 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
4447 * attribute.cs : escaped attribute name should not be allowed to be
4448 resolved (e.g. @class as classAttribute). Fixed bug #75930.
4450 2005-08-29 Raja R Harinath <rharinath@novell.com>
4453 * convert.cs (ImplicitStandardConversionExists): Allow zero also
4454 when converting a long constant to unsigned long.
4455 * expression.cs (Invocation.OverloadResolve): Add sanity check to
4456 detect where IsApplicable and VerifyArgumentsCompat disagree.
4458 2005-08-29 Raja R Harinath <rharinath@novell.com>
4459 and Carlos Alberto Cortez <carlos@unixmexico.org>
4462 * class.cs (TypeContainer.CanElideInitializer): New helper.
4463 (TypeContainer.EmitFieldInitializers): Use it to determine if we
4464 can safely emitting the initializer of a field.
4466 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4468 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4469 allowed inside a switch (without loop). Fixed bug #75433.
4471 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4473 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4474 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4476 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4478 * driver.cs : kinda reverting the default encoding changes (not exact
4479 revert since I noticed that "codepage:reset" might not work fine).
4481 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4483 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4484 Location. Now getter and setter store location correctly.
4485 (errors/cs0111-12.cs now reports the expected location.)
4487 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4489 * driver.cs : Use default encoding on the environment.
4490 Removed (now that) extra parameter for SeekableStreamReader.
4491 * support.cs : (SeekableStreamReader) third .ctor() argument for
4492 StreamReader is not required (always true). preamble size could
4493 be acquired in simpler and safe way.
4495 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4497 * cs-parser.jay: report CS0642 at warning level 3
4498 and report CS0642 for an if else statement also
4499 fixes bug #74745. Patch by John Luke (and a bit
4501 Removed extra CS0642 warning check for "while",
4503 * statement.cs: In Block.Resolve(), CS0642 check
4504 is reimplemented to check a sequence of an empty
4505 statement and a block.
4507 Both fix bug #66777.
4509 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4511 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4512 detection until I fix it.
4514 * cs-tokenizer.cs: Changed error message.
4516 * cs-parser.jay: Fixed 2 error locations.
4518 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4519 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4522 * enum.cs (GetSignatureForError): Fixed.
4524 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4528 * typemanager.cs (RegisterProperty): Removed.
4530 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4532 2005-08-24 Raja R Harinath <rharinath@novell.com>
4535 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4536 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4538 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4540 * expression.cs : tiny fix is required for not warning positive ulong.
4543 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4545 * expression.cs : add CS0652 check for constant and integral
4546 expression. Fixed bug #53974.
4548 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4550 * expression.cs : in DoNumericPromotions(), check if there is implicit
4551 conversion overload for string (to check CS0034). Fixed bug #52492.
4553 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4555 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4557 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4559 * ecore.cs : report location when it is *not* Null.
4561 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4567 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4568 correctly. Fixed bug #75721.
4570 2005-08-23 Raja R Harinath <rharinath@novell.com>
4572 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4573 loop that performs 'min (pos, char_count)'.
4576 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4577 converted value in Operator.OnesComplement.
4579 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4581 * anonymous.cs: If the anon method is pulled into a helper class,
4582 it needs to be `internal' not `private'. Fixes runtime behavior on
4585 2005-08-20 Martin Baulig <martin@ximian.com>
4587 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4588 scope if we don't already have it.
4590 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4591 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4594 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4597 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4600 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4602 The big constants rewrite
4603 Fix #75746, #75685 and more
4604 As a side effect saved 1MB for MWF ;-)
4606 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4607 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4608 enum based for corlib compilation.
4610 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4613 * class.cs (FixedField.Define): Use ResolveAsConstant.
4615 * const.cs (IConstant): Interface constants and enums.
4616 (Const.ResolveValue): New method for constant resolvning.
4617 (ExternalConstant): Constants from imported assemblies.
4619 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4620 conversion; like enums.
4621 (Constant.ToType): Converts this constant to different type.
4622 (Constant.Increment): Adds 1.
4624 * convert.cs (ImplicitConversionRequired): Simplified.
4626 * cs-parser.jay: Create EnumMember directly.
4628 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4630 * doc.cs (GenerateEnumDocComment): Removed.
4632 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4633 (ConvertIntLiteral): Removed.
4634 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4636 * enum.cs (EnumMember): Implement IConstant.
4637 (Enum.IsValidEnumConstant): Removed.
4638 (Enum.GetNextDefaultValue): Removed.
4639 (Enum.FindMembers): Updated.
4640 (Enum.GenerateDocComment): Iterate enum members.
4642 * expression.cs (Cast.TryReduce): Handle enums correctly.
4643 (New.Constantify): Made public.
4644 (MemberAccess.DoResolve): Removed contant specific if(s).
4646 * literal.cs (NullLiteral): Implement new abstract methods.
4648 * statement.cs (GotoCase.Resolve): Use new constant methods.
4649 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4651 * typemanager.cs (LookupEnum): Removed.
4652 (IsEnumType): Fixed to work with corlib.
4653 (RegisterConstant): Removed.
4654 (LookupConstant): Removed.
4655 (GetConstant): Changed to work with IConstant.
4657 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4659 * location.cs : Fixed overflown (>255) column number.
4661 2005-08-03 Raja R Harinath <rharinath@novell.com>
4663 First cut of the qualified-alias-member feature.
4664 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4666 * cs-parser.jay (DOUBLE_COLON): New token.
4667 (namespace_or_type_name): Add rule for recognizing
4668 qualified-alias-members.
4669 (primary_expression): Likewise.
4670 (element_access): Allow QualifiedAliasMember as a possible
4671 type-bearing expression.
4672 (local_variable_type, local_variable_pointer_type): Likewise.
4673 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4674 aliases in the current and enclosing namespace declarations.
4675 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4676 * decl.cs (MemberName.is_double_colon): New.
4677 (MemberName.MemberName): Add new constructor for alias-member.
4678 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4679 * expression.cs (QualifiedAliasMember): New expression type.
4681 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4683 * location.cs : it borked when no argument was specified.
4685 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4687 * location.cs : tiny ToString() format fix.
4689 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4691 * statement.cs : oops, it was missing.
4693 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4695 A set of fixes for precise line/column location.
4698 "token" field now holds a file/line "delta", a line number offset
4699 from the segment, and a column number. See also:
4700 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4701 December/009508.html
4702 Removed static IsNull. Use instance IsNull property instead.
4704 For some tokens it stores Location. For Identifier it stores
4705 LocatedToken which is a pair of string name and location.
4706 Column numbers are adjusted only at getChar().
4708 Use Location.ToString() for reporting (it now contains column).
4710 Largely modified to use LocatedToken instead of
4711 string (IDENTIFIER), and to acquire Location from some tokens.
4712 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4713 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4715 Now MemberName holds Location. DeclSpace.ctor() receives Location
4716 as a parameter. Removed extra parameters to all derived classes.
4717 Replaced Location.IsNull() with instance property.
4718 * assign.cs, expression.cs :
4719 Added .ctor() overload that omits Location.
4721 Added "nameEscaped" flag that indicates the identifier was escaped
4722 in the source file. This fixes bug #57047.
4724 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4726 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4727 New method, looking for lo-case imported cls type.
4729 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4732 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4734 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4736 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4738 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4740 Optimized to save 3.5 MB for SWF compilation.
4742 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4744 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4745 (PartialContainer.Create): Moved logic AddToContainer.
4746 (PartialContainer.MarkForDuplicationCheck): Shares name.
4748 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4751 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4753 (Namespace.GetSignatureForError): New method.
4755 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4756 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4758 2005-08-01 Raja R Harinath <rharinath@novell.com>
4761 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4762 member lookup rather than qualifier_type, since qualifier_type can
4765 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4767 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4770 2005-07-31 Miguel de Icaza <miguel@novell.com>
4772 * statement.cs: Copy the local exception into the exception
4773 captured local. Fixes 75674
4775 2005-07-31 Raja R Harinath <harinath@gmail.com>
4778 * expression.cs (Invocation.OverloadResolve): Don't report error
4779 CS1501 if error CS1502 has been reported.
4780 (New.DoResolve): Delegate CS1501 reporting to
4781 Invocation.OverloadResolve.
4784 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4785 invariant-meaning-in-block property in an enclosing block if
4788 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4790 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4791 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4792 (Switch.CheckSwitch): Just save 50kb for SWF.
4794 2005-07-27 Martin Baulig <martin@ximian.com>
4796 * anonymous.cs (CaptureContext.AddField): Added
4797 `AnonymousContainer am' argument; compute its toplevel scope if
4798 it's not already computed. Fixes #75649.
4800 2005-07-26 Raja R Harinath <rharinath@novell.com>
4803 * class.cs (Constructor.Emit): Reset block to null if the block
4806 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4808 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4810 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4812 * class.cs (MethodData.Define): Check whether accessor implementing
4813 interface is public.
4815 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4817 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4820 * namespace.cs (LookupType): Moved same type check to...
4822 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4825 2005-07-21 Raja R Harinath <rharinath@novell.com>
4827 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4828 already found a typebuilder.
4829 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4830 MemberNames, not strings.
4832 * const.cs (Error_ExpressionMustBeConst):
4833 Rename from Error_EpressionMustBeConst.
4834 * const.cs, class.cs, statement.cd: Update.
4836 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4840 * const.cs (Const.LookupConstantValue): Report missing contant expression
4842 (Error_EpressionMustBeConstant): Only one error method.
4844 * class.cs, statement.c: Updated.
4846 2005-07-20 Raja R Harinath <rharinath@novell.com>
4848 * statement.cs (Block.Flags): Add back HasVarargs.
4849 (Block.flags): Make protected.
4850 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4852 * typemanager.cs (types, typecontainers, user_types): Remove.
4853 (UserTypes, TypeContainers): Likewise.
4854 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4855 (CleanUp, Reset): Update.
4856 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4857 (GetNestedType): Use Type.GetNestedType.
4858 (CoreLookupType): Take two arguments, the namespace and the
4859 basename of the type. Update to use the Namespace.Lookup
4861 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4862 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4863 string concatenation and substring matches.
4864 * class.cs, enum.cs, delegate.cs: Update to changes.
4866 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4868 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4869 Expression and made virtual.
4871 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4872 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4874 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4876 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4879 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4882 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4885 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4886 AssemblyCultureAttribute is not used on executable.
4889 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4891 2005-07-16 Raja R Harinath <rharinath@novell.com>
4894 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4895 New. Reports CS0252/CS0253.
4896 Mostly taken from preliminary patch by Duncak Mak.
4897 (Binary.DoResolveOperator): Store results of operator lookup.
4898 Use them to detect if we need to warn about unintended reference
4901 2005-07-15 Raja R Harinath <rharinath@novell.com>
4904 * namespace.cs (Namespace.Lookup): Add back location parameter.
4905 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4906 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4908 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4909 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4910 (Namespace.LookupType): ... this.
4911 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4913 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4914 purported to handle pointers.
4915 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4918 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4920 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4923 2005-07-15 Raja R Harinath <rharinath@novell.com>
4925 * namespace.cs (Namespace.Lookup): Drop location parameter.
4926 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4927 (NamespaceEntry.Lookup): ... this.
4928 (NamespaceEntry.Error_AmbiguousTypeReference):
4929 Move here from DeclSpace.
4930 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4932 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4933 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4934 Move to NamespaceEntry.
4935 * delegate.cs, expression.cs: Update to changes.
4937 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4939 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4940 CheckAttributeType and refactored.
4941 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4942 ResolveAsTypeTerminal error handling.
4943 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4945 (GetSignatureForError): Print errors in same way.
4948 * codegen.cs: Reflect attribute GetSignatureForError change.
4951 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4953 * namespace.cs (UsingEntry): Refactored to make fields private.
4956 statement.cs: Error_UnexpectedKind has extra parameter.
4958 2005-07-14 Raja R Harinath <rharinath@novell.com>
4960 * ecore.cs (IAlias): Remove.
4961 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4962 that implement the interface.
4963 * namespace.cs (Namespace): Likewise.
4964 (Namespace.declspaces): Renamed from 'defined_names'.
4965 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4966 DeclSpace instead of an IAlias.
4967 * tree.cs (Tree.AddDecl): Update.
4969 2005-07-12 Raja R Harinath <rharinath@novell.com>
4971 * statement.cs (Block.Flags); Remove HasVarargs.
4972 (Block.HasVarargs): Move to ToplevelBlock.
4973 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4974 (Block.Variables): Make protected. Initialize variable hashtable
4976 (Block.AddVariable): Update.
4977 (Block.Resolve): Update to changes.
4978 (ToplevelBlock.HasVarargs): New boolean.
4979 (ToplevelBlock.ThisVariable): Move here from Block.
4980 (ToplevelBlock.AddThisVariable): Likewise.
4981 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4982 * expression.cs (This.ResolveBase): Update to changes.
4983 (ArglistAccess.DoResolve): Likewise.
4985 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4988 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4990 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4991 not used and not used & assigned.
4992 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4994 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4997 * expression.cs (Is.DoResolve): null is never provided type.
4999 2005-07-08 Marek Safar <marek.safar@seznam.cz>
5002 * cs-parser.jay: Less strict event error rule to catch more errors.
5004 2005-07-08 Martin Baulig <martin@ximian.com>
5006 Fix test-iter-10.cs - distinguish whether we `yield' in a property
5007 gettter (allowed) or setter (not allowed).
5009 * class.cs (Accessor): Implement IIteratorContainer.
5010 (Accessor.Yields): New public field.
5011 (PropertyBase.PropertyMethod.Define): Handle iterators on a
5015 (get_accessor_declaration, set_accessor_declaration): Set the
5016 `yields' flag on the accessor, not the property.
5017 (property_declaration): Do the iterators check on a per-accessor
5018 basis and not for the whole property.
5020 2005-07-08 Martin Baulig <martin@ximian.com>
5022 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5023 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5025 2005-07-07 Marek Safar <marek.safar@seznam.cz>
5028 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5029 (ExtractSecurityPermissionSet): Cope with self referencing security
5030 attributes properly.
5032 * driver.cs (SetOutputFile): Made public property OutputFile.
5034 2005-07-07 Raja R Harinath <rharinath@novell.com>
5037 * class.cs (TypeContainer.first_nonstatic_field): Rename from
5038 has_nonstatic_fields. Make into a FieldBase pointer.
5039 (TypeContainer.AddField): Add CS0282 check.
5040 (TypeContainer.EmitType): Update.
5042 2005-07-06 Miguel de Icaza <miguel@novell.com>
5044 * cs-tokenizer.cs (consume_identifier): Do not create strings to
5045 compare if they start with __.
5047 2005-07-06 Raja R Harinath <rharinath@novell.com>
5049 * statement.cs (Switch.SwitchGoverningType): Only look at
5050 UserCasts that don't need implicit standard conversions to one of
5051 the allowed switch types (Fixes test-322.cs).
5052 (LocalInfo.Resolve): Re-enable sanity-test.
5054 2005-07-06 Marek Safar <marek.safar@seznam.cz>
5056 * cs-tokenizer.cs (consume_identifier): Detect double undescores
5058 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5060 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5062 2005-07-06 Raja R Harinath <rharinath@novell.com>
5065 * ecore.cs (SimpleName.GetSignatureForError): Add.
5066 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5067 (MemberAccess.GetSignatureForError): Add.
5069 2005-07-05 Marek Safar <marek.safar@seznam.cz>
5071 The big error and warning messages review.
5101 * typemanager.cs: Updated.
5103 * class.cs: (MethodCore.SetYields): Moved here to share.
5104 (PropertyMethod.Define): Moved iterator setup here.
5106 * iterators.cs: Add orig_method to have full access to parent
5109 2005-07-05 Raja R Harinath <rharinath@novell.com>
5111 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5112 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5113 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5114 variable of struct type.
5115 * expression.cs (Unary.ResolveOperator): Update to change.
5116 (Indirection.VerifyFixed): Likewise.
5117 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5118 (ParameterReference.VerifyFixed): Value parameters are fixed.
5119 (This.VerifyFixed): Treat 'this' as a value parameter.
5120 * statement.cs (LocalInfo.IsFixed): Remove.
5122 2005-07-01 Martin Baulig <martin@ximian.com>
5124 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5125 `ec.EmitThis ()' to get the correct scope.
5127 2005-07-01 Martin Baulig <martin@ximian.com>
5129 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5130 instance is a ParameterReference; fixes #75299.
5132 2005-07-01 Martin Baulig <martin@ximian.com>
5134 Reverted Marek's latest patch (r46725):
5135 - it contains structural changes which are neither mentioned in
5136 the ChangeLog nor explained anywhere; for example the additional
5137 argument of EmitContext's and Iterator's .ctor's and the
5138 TypeContainer.DefineMembers() change.
5139 - structural changes like this should go in in seperate patches
5140 and not be hidden in a huge patch which just seems to affect
5141 warnings and errors.
5142 a big and hard to understand patch.
5143 - it breaks iterators and causes regressions, for instance in
5146 2005-06-30 Raja R Harinath <rharinath@novell.com>
5149 * expression.cs (Indexers.map): Remove.
5150 (Indexers.Append): Filter out inaccessible setters and getters.
5151 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5154 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
5156 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5157 (FieldExpr.Emit, PropertyExpr.Emit): Update.
5158 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5159 * expression.cs (Invocation.EmitCall): Add CS0120 check.
5161 2005-06-30 Marek Safar <marek.safar@seznam.cz>
5164 * class.cs (FieldBase.GetInitializerExpression): One more field
5167 2005-06-28 Miguel de Icaza <miguel@novell.com>
5169 * pending.cs: Do not define a proxy if the base method is virtual,
5170 it will be picked up by the runtime (bug 75270).
5172 2005-06-08 Martin Baulig <martin@ximian.com>
5174 The big Iterators rewrite :-)
5176 * iterators.cs: Rewrite this to use the anonymous methods framework.
5178 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5179 before the TypeContainers; see 2test-21.cs.
5182 (TypeContainer.DefineType): Don't create a new EmitContext if we
5183 already have one (this only happens if we're an Iterator).
5184 (TypeContainer.Define): Also call Define() on all our iterators.
5185 (Method.CreateEmitContext): Added support for iterators.
5188 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5189 (AnonymousContainer.CreateMethodHost): Moved here from
5190 AnonymousMethod and made abstract.
5191 (AnonymousContainer.CreateScopeType): New abstract method.
5192 (AnonymousContainer.IsIterator): New public property.
5193 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5194 get the ScopeTypeBuilder rather than manually defining it here.
5195 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5198 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5199 before RootContext.DefineTypes().
5201 * codegen.cs (EmitContext.RemapToProxy): Removed.
5202 (EmitContext.CurrentAnonymousMethod): Changed type from
5203 AnonymousMethod -> AnonymousContainer.
5204 (EmitContext.ResolveTopBlock): Protect from being called twice.
5205 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5206 (EmitContext.EmitThis): Removed the iterators hacks; use the
5207 anonymous methods framework for that.
5210 (ToplevelBlock.Container): Make this a property, not a field.
5211 (ToplevelBlock.ReParent): New public method; move the
5212 ToplevelBlock into a new container.
5213 (Foreach.TemporaryVariable): Simplify.
5215 2005-06-05 Martin Baulig <martin@ximian.com>
5217 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5218 (Block.AddTemporaryVariable): New public method; creates a new
5219 `LocalInfo' for a temporary variable.
5220 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5222 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5223 non-iterator variables.
5225 2005-06-05 Martin Baulig <martin@ximian.com>
5227 * statement.cs (Foreach.TemporaryVariable): Create the
5228 LocalBuilder in the Emit phase and not in Resolve since in some
5229 situations, we don't have an ILGenerator during Resolve; see
5230 2test-19.cs for an example.
5232 2005-06-04 Martin Baulig <martin@ximian.com>
5234 **** Merged r45395 from GCS ****
5236 The big Foreach rewrite - Part II.
5238 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5239 with `PropertyInfo ienumerator_getcurrent'.
5241 * codegen.cs (VariableStorage): Removed.
5244 (Foreach): Derive from Statement, not ExceptionStatement.
5245 (Foreach.CollectionForeach): New nested class. Moved all the code
5246 dealing with collection foreach here.
5247 (Foreach.ForeachHelperMethods): Removed.
5248 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5250 2005-05-23 Martin Baulig <martin@ximian.com>
5252 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5253 don't need to. Fix #75014.
5255 2005-05-20 Martin Baulig <martin@ximian.com>
5257 Merged r44808 from GMCS.
5259 * class.cs (TypeContainer.CircularDepException): Removed.
5260 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5261 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5262 (CS0146) and interface (CS0529) dependencies here.
5264 2005-06-21 Raja R Harinath <rharinath@novell.com>
5266 * expression.cs (Invocation.EmitCall): Fix initialization
5267 'this_call' to reflect current behaviour. Fix indentation.
5269 * convert.cs (FindMostEncompassedType): Add two trivial special
5270 cases (number_of_types == 0 || number_of_types == 1).
5271 (FindMostEncompasingType): Likewise.
5273 2005-06-17 Raja R Harinath <rharinath@novell.com>
5275 Some cleanups preparing for the fix of #75283.
5276 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5278 (EventExpr.InstanceResolve): Likewise.
5279 (EventExpr.DoResolve): Remove redundant checks.
5281 2005-06-10 Duncan Mak <duncan@novell.com>
5283 * cs-tokenizer.cs (process_directives): New flag for controlling
5284 the processing of preprocessor directives.
5285 (x_token): After seeing a '#', return Token.NONE instead of going
5286 to handle_preprocessing_directive() when not processing
5287 directives. This avoids unnecessary processing during the token peek in
5292 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5293 the existing error reporting methods instead of Report.Error.
5295 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5296 after Raja's rewrite.
5298 2005-06-08 Miguel de Icaza <miguel@novell.com>
5300 * class.cs: Small fix.
5302 2005-06-08 Raja R Harinath <rharinath@novell.com>
5305 * class.cs (GetPartialBases): Fix return value check of
5308 2005-06-07 Raja R Harinath <rharinath@novell.com>
5310 Ensure that partial classes are registered in their enclosing
5311 namespace. Initial part of fix of #75160.
5312 * tree.cs (Tree.RecordDecl): Add new namespace argument.
5313 Register declspace with namespace here, not in
5314 DeclSpace.RecordDecl.
5315 * cs-parser.jay: Pass namespace to RecordDecl.
5316 * class.cs (PartialContainer.Create): Likewise.
5317 (ClassPart.DefineType): New sanity-check. Throws an exception if
5319 * decl.cs (Declspace.RecordDecl): Remove.
5320 * namespace.cs (NamespaceEntry.DefineName): Remove.
5322 2005-06-06 Marek Safar <marek.safar@seznam.cz>
5324 * rootcontext.cs: Reset TargetExt as well.
5326 2005-06-03 Raja R Harinath <rharinath@novell.com>
5328 * ecore.cs (Expression.Resolve): Emit CS0654 error when
5331 2005-06-02 Raja R Harinath <rharinath@novell.com>
5333 Fix #75080, cs0119.cs.
5334 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
5336 (Expression.Resolve): ... this. Use it. Remove bogus code
5337 allowing ExprClass.Type and ExprClass.Namespace for
5338 ResolveFlags.VariableOrValue.
5339 (Expression.Resolve) [1-argument variant]: Change default resolve
5340 flags based on language version.
5341 (Expression.Error_UnexpectedKind): Use a simple string array
5342 rather than an ArrayList.
5343 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5345 (TypeOfVoid.DoResolve): Likewise.
5346 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
5347 flags argument -- it always has the same value.
5349 2005-05-31 Raja R Harinath <rharinath@novell.com>
5352 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5353 Use it in the error message.
5354 * assign.cs, expression.cs, statement.cs: Update.
5356 2005-05-30 Raja R Harinath <rharinath@novell.com>
5359 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5360 the "almostMatchedMember" case too.
5361 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5362 that failed the accessibility checks to 'almost_match'.
5364 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
5366 * attribute.cs: Use internal MethodBuilder methods to set
5367 ExactSpelling and SetLastError on PInvoke methods, instead
5368 of passing them via charset. Fixes #75060.
5370 2005-05-27 Raja R Harinath <rharinath@novell.com>
5372 * parameter.cs (Parameter): Remove TODO comment.
5373 (Parameter.DefineParameter): Remove Location parameter.
5374 (Parameters.LabelParameters): Likewise.
5375 * class.cs (Constructor.Emit): Update to change.
5376 (MethodData.Emit): Likewise.
5377 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
5378 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5380 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
5383 Removed Parameters.Location and added Parameter.Location instead.
5384 Removed Location parameter from Emit() and GetSignature().
5391 Modified all related calls.
5393 2005-05-26 Raja R Harinath <rharinath@novell.com>
5395 Improve user-defined conversion handling.
5396 * convert.cs (GetConversionOperators): Rewrite. Return only the
5397 applicable operators.
5398 (AddConversionOperators): New. Helper for GetConversionOperators.
5399 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5400 there is only one most encompassed/encompassing type.
5401 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5402 "applicable operator" handling.
5403 (UserConversion): Move cache here from GetConversionOperators.
5404 Directly cache the chosen operator, rather than the whole
5406 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5407 case. Allow conversion of decimal to sbyte and byte too.
5408 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5409 New static methods. Used to avoid allocating EmptyExpressions in
5412 2005-05-24 Duncan Mak <duncan@novell.com>
5414 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5415 another class, used in Convert.ExplicitNumericConversion.
5416 (CastToDecimal): New class, similar to above, but casts to
5417 System.Decimal, used in Convert.ImplicitNumericConversion and also
5418 in explicit convesion from double/float to decimal.
5420 * convert.cs (ImplicitNumericConversion): Handle implicit
5421 conversions to System.Decimal.
5422 (ExplicitNumericConversion): handle explicit conversions to
5427 2005-05-20 Miguel de Icaza <miguel@novell.com>
5429 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5430 know the type at this stage, just break through. Fixes #75008
5432 2005-05-19 Martin Baulig <martin@ximian.com>
5435 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5436 to disable error reporting.
5438 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5439 here since we don't want to report an error; see the new test-336.cs.
5441 2005-05-19 Raja R Harinath <rharinath@novell.com>
5443 * statement.cs (ToplevelBlock.GetParameterReference)
5444 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5445 Move here from class Block.
5446 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5447 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5449 2005-05-18 Martin Baulig <martin@ximian.com>
5454 (FlowBranching.Reachability): Add non-static public And() and Or()
5456 (FlowBranchingSwitch): New class; do the `break_origins' thing
5457 like in FlowBranchingLoop.
5458 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5459 reachability, not just locals and parameters.
5460 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5461 switch; MergeBreakOrigins() now takes care of that.
5463 2005-05-18 Martin Baulig <martin@ximian.com>
5465 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5466 a loop and may leave it, reset the barrier; fixes #74974.
5468 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5470 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5473 * cs-parser.jay: Catch more lexical errors.
5475 * report.cs: Add one more Error method.
5478 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5480 2005-05-17 Martin Baulig <martin@ximian.com>
5482 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5485 2005-05-16 Raja R Harinath <rharinath@novell.com>
5487 Fix test-382.cs. Emit values of decimal constants.
5488 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5490 (TypeContainer.AddField): ... this.
5491 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5492 with initializers to include 'Const's.
5493 (ClassPart.RegisterFieldForInitialization): Forward to
5495 * const.cs (Const.Const): Pass initializer to base class.
5496 (Const.Define): In case of decimal constants, register them for
5497 initialization in a static constructor.
5499 2005-05-14 Martin Baulig <martin@ximian.com>
5501 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5502 do not call ResolveUnreachable() on unreachable statements in
5503 here, see the comment in the source code.
5505 2005-05-13 Raja R Harinath <rharinath@novell.com>
5508 * expression.cs (BinaryResolveOperator): If one of the operands of
5509 an equality comparison is 'null' and the other is a pointer type,
5510 convert the null to a NullPointer.
5511 * convert.cs (ImplicitReferenceConversion): If the expression is a
5512 NullLiteral and the target type is a pointer type, return a
5513 NullPointer instead.
5514 (ImplicitConversionStandard): Likewise.
5516 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5518 * cs-parser.jay: Set readonly context based on special constructs.
5520 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5521 readonly variable error handling.
5523 * rootcontext.cs (EmitCode): Don't verify members when error
5526 * statement.cs (LocalInfo): Add reaodnly context information.
5527 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5529 2005-05-13 Raja R Harinath <rharinath@novell.com>
5531 * statement.cs (Block.Resolve): Revert change below. Modify fix
5532 for #74041 to initialize 'resolved' to false only for explicit
5533 blocks. Fixes #74873.
5535 2005-05-12 Raja R Harinath <harinath@gmail.com>
5538 * typemanager.cs (unmanaged_enclosing_types): New.
5539 (IsUnmanagedType): Avoid infloops by using
5540 'unmanaged_enclosing_types' to talk with recursive invocations.
5542 2005-05-13 Martin Baulig <martin@ximian.com>
5544 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5545 instance variable, not a local. Fix #74873.
5546 (Block.ResolveUnreachable): Set it to true here.
5548 2005-05-11 Duncan Mak <duncan@novell.com>
5550 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5551 continuing to process for 'arg'.
5552 (handle_preprocessing_directive): Check the argument of the #endif
5553 directive and report error CS1025 if there are any trailing
5556 According to the C# spec, having even whitespace after the #endif
5557 directive is illegal; however, because we call arg.TrimEnd ()
5558 beforehand, we have the same behavior as csc, allowing whitespace
5559 after the directive.
5563 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5567 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5568 (Constructor.GetObsoleteAttribute): Implemented correctly.
5570 2005-05-10 Martin Baulig <martin@ximian.com>
5572 * support.cs (ReflectionParameters.ParameterModifier): Use
5573 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5574 and `ParameterAttributes.In'. Fixes #74884.
5576 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5578 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5580 * expression.cs (Argument.GetParameterModifier): Turned to property.
5581 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5583 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5586 2005-05-09 Raja R Harinath <rharinath@novell.com>
5589 * decl.cs (MemberCache.AddMethods): Register override methods,
5590 rather than non-override methods.
5591 * typemanager.cs (RegisterOverride): New.
5592 (IsOverride): Update.
5594 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5598 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5599 recursive declaration.
5601 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5603 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5605 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5607 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5609 2005-05-05 Raja R Harinath <rharinath@novell.com>
5612 * decl.cs (DeclSpace.FamilyAccessible):
5613 Use TypeManager.IsNestedFamilyAccessible.
5615 Fix reopened #64812.
5616 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5619 2005-05-04 Raja R Harinath <rharinath@novell.com>
5620 Abin Thomas <projectmonokochi@rediffmail.com>
5621 Anoob V E <projectmonokochi@rediffmail.com>
5622 Harilal P R <projectmonokochi@rediffmail.com>
5625 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5626 allow access to all static members.
5628 2005-05-04 Martin Baulig <martin@ximian.com>
5630 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5632 2005-05-04 Martin Baulig <martin@ximian.com>
5636 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5637 section at the end; make things work if `default' is not the last
5640 2005-05-04 Martin Baulig <martin@ximian.com>
5644 * statement.cs (Switch): Replaced the `got_default' field with a
5645 `default_section' one.
5646 (Switch.CheckSwitch): Set `default_section' here.
5647 (Switch.Resolve): If we're a constant switch and the constant is
5648 not found, use the default section.
5650 2005-05-03 Martin Baulig <martin@ximian.com>
5652 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5654 * statement.cs (Foreach.ArrayForeach): New nested class.
5655 (Foreach.TemporaryVariable): New nested class.
5656 (Foreach.EmitArrayForeach): Removed; this is now in the new
5659 2005-05-03 Raja R Harinath <rharinath@novell.com>
5661 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5663 (VerifyPendingMethods): Revert change below.
5665 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5666 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5667 that used to trigger warning -28. Remove warning -28.
5668 * expression.cs (Invocation.OverloadResolve): Use
5669 TypeManager.IsOverride to distinguish override methods.
5672 * pending.cs (VerifyPendingMethods): If a base type implements the
5673 requested interface, don't bother checking individual methods of
5674 the base type. As a side-effect, this prevents the creation of
5675 unnecessary proxies.
5677 2005-05-02 Martin Baulig <martin@ximian.com>
5681 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5682 Also `And' the locals if the old vector is null.
5683 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5684 null; in this case we basically reset all the variables.
5686 2005-05-02 Martin Baulig <martin@ximian.com>
5690 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5691 Added `FlowBranching branching' argument; always `and' the
5692 variables instead of `or'ing them unless we're an infinite loop.
5694 * statement.cs (While.Resolve): Create a new sibling unless we're
5697 2005-05-02 Martin Baulig <martin@ximian.com>
5701 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5702 arguments; use it instead of creating a new TopLevelBlock.
5703 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5704 our ConstructorInitializer.
5707 (TopLevelBlock.TopLevelBranching): New public property.
5708 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5709 and create our `TopLevelBranching'.
5711 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5712 anonymous method host, use `block.TopLevelBranching' rather than
5713 creating a new branching.
5715 2005-04-20 Miguel de Icaza <miguel@novell.com>
5717 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5718 a ScopeInfo, if any of the current children is a child of the new
5719 entry, move those children there.
5721 2005-04-30 Martin Baulig <martin@ximian.com>
5723 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5724 at the beginning of a SwitchSection. Fix #73335.
5726 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5729 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5731 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5732 (FieldExpr.DoResolve): Obsolete members are ignored for field
5735 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5737 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5738 of arrays detection.
5740 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5742 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5744 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5747 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5749 * cs-parser.jay: Use the prefered version of -unsafe in error
5752 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5754 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5757 2005-04-20 John Luke <john.luke@gmail.com>
5759 * driver.cs: fix typo in error message, --outout to --output
5761 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5763 * codegen.cs (InRefOutArgumentResolving): New field.
5765 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5766 fields outside contructor.
5768 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5770 2005-04-19 Miguel de Icaza <miguel@novell.com>
5772 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5773 parameter code was not completed ever, so it was not as up-to-date
5774 as local variables. Must finish it.
5776 The bug fix was to compare the Toplevel of the block, not the
5777 current block. Thanks for Ben for pointing this out.
5779 2005-04-19 Raja R Harinath <rharinath@novell.com>
5781 * decl.cs (AddMethods): Use the declaring type of the problem
5782 method to determine if we want to squash a warning.
5784 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5786 * attribute.cs: Removed debug output.
5788 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5790 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5793 2005-04-18 Raja R Harinath <rharinath@novell.com>
5796 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5797 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5798 all null comparisons against reference types.
5800 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5803 * class.cs (TypeContainer.CircularDepException) New nested
5805 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5806 (TypeContainer.DefineType): Removed error, reset InTransit before
5808 (Class.DefineType): Throw exception when is in Transit.
5809 Catch exception and report error.
5810 (Struct.DefineType): Throw exception when is in Transit.
5811 Catch exception and report error.
5812 (Interface.DefineType): Throw exception when is in Transit.
5813 Catch exception and report error.
5815 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5816 handle nested exception handlers.
5818 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5821 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5822 InFinally and InCatch storage.
5824 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5825 (Catch.Resolve): Set and Restore ec.InCatch.
5826 (Try.Resolve): Set and Restore ec.InFinally.
5827 (Try.HasCatch): True when try has catch.
5829 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5831 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5832 for the same event member, so exclude such cases from warning 419.
5835 2005-04-16 Miguel de Icaza <miguel@novell.com>
5837 * expression.cs (Binary.ResolveOperator): Apply patch from John
5838 Luke to fix bug 59864: operators &, | and ^ on enumerations
5839 require that the same enum type on both sides.
5841 * driver.cs: Add warnings to old flag usage, this is to assist
5842 people who produce Makefiles and hope that the Makefiles will be
5845 * class.cs (TypeContainer.EmitType): Moved the definition of the
5846 special $PRIVATE$ field from the resolve phase to the Emit phase.
5847 During resolve we do not know if we are a struct with
5848 HasExplicitLayout, we know this only after the attributes for the
5851 Set the FieldOffset to zero on the dummy field that we create for
5852 the class. Fixes 74590.
5854 2005-04-16 Raja R Harinath <rharinath@novell.com>
5857 * ecore.cs (PropertyExpr.resolved): New.
5858 (DoResolve): Use it to handle a case of double resolution here.
5859 Handle a case of identical-name-and-type-name.
5860 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5861 resolution by storing the results of expression resolution back
5862 into the "probes" array.
5864 2005-04-15 Raja R Harinath <rharinath@novell.com>
5866 Fix cs0208-7.cs and cs0208-8.cs.
5867 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5868 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5869 error reporting to point out the reason a struct is not unmanaged.
5871 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5873 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5874 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5876 2005-04-13 Raja R Harinath <rharinath@novell.com>
5879 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5880 IdenticalNameAndTypeName here.
5881 (EventExpr.InstanceResolve): Likewise.
5883 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5885 C# 2.0 DefaultCharSetAttribute implementation
5887 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5888 which allows us to set GlobalNamespace for every resolve.
5889 (Attribute.ResolveArguments): Cut from Resolve.
5890 (Attribute.GetCharSetValue): Returns CharSet named argument.
5891 (Attribute.DefinePInvokeMethod): Gets default charset from
5893 (GlobalAttribute.ResolveAsTypeStep): Override.
5894 (GlobalAttribute.ResolveArguments): Override.
5896 * class.cs (TypeAttr): Is protected.
5898 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5899 (ModuleClass.DefaultCharSetType): New memeber.
5900 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5902 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5903 charset from module.
5905 * delegate.cs (TypeAttr): Override.
5906 (Delegate.DefineType): Use this TypeAttr.
5908 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5909 at very early stage (before types are defined) to resolve model
5910 module attributes. It will probably not work with corlib but it
5913 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5914 charset from module.
5916 * typemanager.cs (default_charset_type): New type.
5918 2005-04-13 Raja R Harinath <rharinath@novell.com>
5920 * decl.cs (MemberCache.AddMethods): Don't warn if
5921 System.Object.Finalize has buggy MethodAttributes.
5923 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5926 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5928 * doc.cs : detect ambiguous reference to overloaded members.
5929 Fixed bug #71603. MS 1.1 csc does not detect it.
5931 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5933 * doc.cs : delegates must not be referenced with parameters.
5936 2005-04-12 Miguel de Icaza <miguel@novell.com>
5938 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5940 2005-04-10 Miguel de Icaza <miguel@novell.com>
5942 * driver.cs (MainDriver): Stop processing if the CLS stage found
5945 (CompilerCallableEntryPoint.InvokeCompiler): Always
5946 reset after execution; Take a TextWriter argument for the
5949 * report.cs: Use the error stream instead of hardcoding stderr.
5951 2005-04-09 Miguel de Icaza <miguel@novell.com>
5953 * class.cs: Reduce code paths to test, too small of an
5954 optimization to make it worth the extra testing. Always perform
5957 2005-04-08 Raja R Harinath <rharinath@novell.com>
5960 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5961 operators that had errors reported on them.
5963 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5965 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5967 (Attribute.Resolve): Add named argument type checking.
5969 * class.cs (FixedField.Define): Use IsPrimitiveType
5971 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5973 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5974 unsafe parameter types.
5976 * statement.cs (Using.ResolveExpression): Add better error description.
5978 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5980 2005-04-08 Raja R Harinath <rharinath@novell.com>
5983 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5984 AttributeUsageAttribute in the emitcontext of the attribute class,
5985 not in the emitcontext of the attributable entity it was attached to.
5986 * cs-parser.jay: Use 'current_class', not 'current_container',
5987 when creating a GlobalAttribute.
5989 2005-04-08 Alp Toker <alp@atoker.com>
5991 * pending.cs: The fix to #58413 failed to compile methods implementing
5992 interfaces with/without params modifiers and vice versa, even though
5993 params modifiers aren't part of the signature. Make the modifier check
5994 less strict as in csc.
5996 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5997 Anoob V E <projectmonokochi@rediffmail.com>
5998 Harilal P R <projectmonokochi@rediffmail.com>
6001 * pending.cs (TypeAndMethods.mods): New. Store the parameter
6002 modifiers of pending methods.
6003 (PendingImplementation.PendingImplementation): Initialize it.
6004 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6005 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6006 with ParameterData. Add check for modifiers.
6007 * class.cs (MethodData.Define): Update to changes.
6009 2005-04-07 Raja R Harinath <rharinath@novell.com>
6011 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6013 2005-04-07 Marek Safar <marek.safar@seznam.cz>
6015 * class.cs (PropertyMethod.Define): Check private accessor in abstract
6018 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6021 * typemanager.cs: Registered RequiredAttributeAttribute.
6023 2005-04-06 Marek Safar <marek.safar@seznam.cz>
6025 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6026 Warning CS0169 is back at level 3.
6027 (IMethodData.SetMemberIsUsed): New method.
6029 * decl.cs (IsUsed): New value; moved from FieldBase.Status
6030 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6032 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6034 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6036 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6039 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6042 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6043 to avoid the problems with nested types.
6045 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
6046 Anoob V.E <projectmonokochi@rediffmail.com>
6047 Harilal P.R <projectmonokochi@rediffmail.com>
6048 Raja R Harinath <rharinath@novell.com>
6051 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6053 * typemanager (GetConstructor): Make public.
6055 2005-04-05 John Luke <john.luke@gmail.com>
6056 Raja R Harinath <rharinath@novell.com>
6059 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6060 struct too. Return false quicker in a few cases.
6061 (VerifyUnManaged): Use it.
6063 2005-04-05 Raja R Harinath <rharinath@novell.com>
6066 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6067 not 'unreachable_seen'.
6069 2005-04-04 Marek Safar <marek.safar@seznam.cz>
6071 * attribute.cs (Attribute.GetValue): Removed unused.
6073 * codegen.cs (CodeGen.TrimExt): Removed unused.
6075 * cs-parser.jay (output): Removed unused.
6077 * cs-tokenizer.cs (hex_digits): Removed unused.
6079 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6081 * expression.cs (Indirection.LoadExprValue): Removed unused.
6082 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6084 * iterators.cs (Iterator.param_types): Removed unused.
6086 * statement.cs (Goto.block): Removed unused.
6087 (ToplevelBlock.did): Removed unused.
6088 (Switch.ResolveConstantSwitch): Removed unused.
6090 2005-04-01 Ben Maurer <bmaurer@ximian.com>
6092 * rootcontext.cs: Allow mcs to bootstrap with the compilation
6095 2005-04-01 Raja R Harinath <rharinath@novell.com>
6097 Fix #74232 and cs0208-3.cs.
6098 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6099 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6100 unmanaged type. Don't use FieldBuilders when 't' is a
6101 TypeBuilder. Use ModFlags and MemberType fields.
6102 * class.cs (MemberBase.member_type): Rename from MemberType.
6103 (MemberBase.MemberType): New property. Determines member_type on
6105 (MemberBase.DoDefine): Don't initialize MemberType here.
6106 (FieldMember.Define): Likewise.
6108 2005-04-01 Marek Safar <marek.safar@seznam.cz>
6111 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6112 Attributes are emitted there.
6114 2005-04-01 Raja R Harinath <rharinath@novell.com>
6116 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6117 keyword in 'partial enum' too.
6118 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6120 Report from Kamil Skalski <nazgul@omega.pl>.
6123 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6124 have partial containers too.
6126 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6127 in block' checks to Block.CheckInvariantMeaningInBlock.
6128 * statement.cs (Block.GetKnownVariableInfo): Make private.
6129 (Block.IsVariableUsedInChildBlock): Remove.
6130 (Block.IsVariableUsedInBlock): Likewise.
6131 (Block.CheckInvariantMeaningInBlock): New. Show location of
6132 conflicting declaration.
6133 (Block.AddVariable): Make error messages less long-winded and more
6134 specific. Show location of conflicting declaration.
6135 * parameter.cs (Parameters.Location): New readonly property.
6137 2005-03-31 Raja R Harinath <rharinath@novell.com>
6139 Clean up semantics of invoking ResolveMemberAccess.
6140 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6141 can have an instance, ensure that we pass in a non-TypeExpression
6142 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
6143 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6144 argument. Update to changes and simplify.
6145 (FieldExpr.Emitinstance): Remove CS0120 check.
6146 (PropertyExpr.EmitInstance): Likewise.
6147 * expression.cs (Argument.Resolve): Likewise.
6148 (Invocation.DoResolve): Update to changes in semantics of
6151 2005-03-31 Marek Safar <marek.safar@seznam.cz>
6154 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6157 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6159 2005-03-31 Raja R Harinath <rharinath@novell.com>
6161 Fix difference in behaviour with commandline invocation.
6162 * driver.cs (Driver.Reset): New.
6163 (CompilerCallableEntryPoint): Call it.
6165 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6166 variable" warnings if the boolean expression failed to resolve.
6168 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6170 * attribute.cs: Fix the union of several permissions when some of them
6171 are unrestricted (so the result isn't an unrestricted permission set).
6174 2005-03-30 Raja R Harinath <rharinath@novell.com>
6176 * ecore.cs (MemberExpr): New class. Convert from interface
6178 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6179 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6181 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6182 (MethodGroupExpr.IsExplicitImpl): Remove.
6183 (Expression.GetFieldFromEvent): Remove.
6184 (SimpleName.MemberStaticCheck): Remove.
6185 (SimpleName.DoSimpleNameResolve): Update to changes.
6186 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6187 (MemberAccess.IdenticalNameAndTypeName): Remove.
6188 (MemberAccess.error176): Move to MemberExpr.
6189 (MemberAccess.DoResolve): Update to changes.
6190 (BaseAccess.DoResolve): Likewise.
6192 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6194 C# 2.0 Conditional attribute class implementation
6196 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6197 Analyzes class whether it has attribute which has ConditionalAttribute
6198 and its condition is not defined.
6200 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6201 (Class.IsExcluded): New method. Search for at least one defined
6202 condition in ConditionalAttribute of attribute class.
6204 2005-03-30 Raja R Harinath <rharinath@novell.com>
6206 * ecore.cs (PropertyExpr): Derive from Expression, not
6207 ExpressionStatement.
6208 (PropertyExpr.EmitStatement): Remove.
6210 2005-03-29 Raja R Harinath <rharinath@novell.com>
6213 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6214 internal field "value__" of an enum be private. The examples for
6215 "value__" that I found on MSDN all used FieldAttributes.Private.
6217 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6218 Don't mention IL method attribute names.
6220 Fix #47991. Remove a TODO.
6221 * statement.cs (Block.Toplevel): Make into a field.
6222 (Block.Parameters): Move into ToplevelBlock.
6223 (Block.known_variables): Rename from child_variable_names.
6224 (Block.Block): Remove variants that take Parameters. Initialize
6225 'Toplevel' with the immediately surrounding toplevel block.
6226 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6227 LocalInfo parameter.
6228 (Block.GetKnownVariableInfo): New.
6229 (Block.IsVariableNameUsedInChildBlock): Update.
6230 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6231 the block, even though it may not be in scope.
6232 (Block.AddVariable): Remove Parameters parameter. Use
6233 Toplevel.Parameters instead.
6234 (Block.AddConstant): Remove Parameters parameter.
6235 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6236 (Block.IsParamaterReference): Likewise.
6237 (Block.IsLocalParameter): Likewise. Simplify a lot.
6238 (ToplevelBlock.Parameters): New. Moved from Block.
6239 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6240 initialize Parameters to a non-null value.
6241 * cs-parser.jay: Update to changes.
6242 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6243 simple names that mean different things in the same block. Use
6244 Block.IsVariableNameUsedInBlock.
6246 2005-03-28 Raja R Harinath <rharinath@novell.com>
6248 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6249 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6250 GetTypeHandle. It is possible for a reflected type to derive from
6251 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6252 System.Array during mscorlib compilation).
6253 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6254 contain a method_hash, don't create one either. Don't create a
6255 deep copy of the base cache's method_hash.
6256 (MemberCache.SetupCache): Rename back from DeepCopy.
6257 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6258 already initialized. If we see an override function, add its
6259 underlying base virtual function to the member_hash too.
6261 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6263 2005-03-26 Raja R Harinath <harinath@acm.org>
6266 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6267 fails to resolve, ensure that the LHS is still resolved as an
6270 2005-03-25 Raja R Harinath <harinath@acm.org>
6272 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6274 (Enum.current_ec): Remove.
6275 (Enum.LookupEnumValue): Remove EmitContext argument.
6276 Just uses the one created during DefineType.
6277 (Enum.FindMembers): Update.
6278 * expression.cs (MemberAccess.DoResolve): Update.
6280 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6282 * assign.cs (Assign.DoResolve): Check for CS1717 when
6283 source and target are same (uses Equals).
6285 * expression.cs (LocalVariableReference, ParameterReference,
6286 This): Implemented Equals, GetHashCode.
6288 * statement.cs (Block.GetParameterReference): Removed useless
6291 2005-03-22 Raja R Harinath <rharinath@novell.com>
6294 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6295 blocks before deciding whether the error is cs0136 or cs0128.
6297 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6298 (using_alias_directive, using_namespace_directive): Pass
6299 MemberName, not an expression to Namespace.UsingAlias and
6301 (MakeName): Use the MemberName of the namespace.
6302 * namespace.cs (Namespace.MemberName): New.
6303 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6304 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6306 * decl.cs (MemberName.Name): Make readonly.
6307 (MemberName.FromDotted): New "constructor".
6308 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6309 (MemberCore.Name): Compute from MemberName on demand.
6310 (MemberCore.SetMemberName): Provide a way to change the
6312 (MemberCore.AddToContainer): Don't take a fullname parameter.
6313 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6314 fully qualified name of the container to the member name.
6315 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6316 only if the type is a member of the root container.
6317 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6318 MemberName.Left rather than searching for an embedded ".".
6319 (PartialContainer.CreatePart): Update to changes in RootContext.
6320 (MemberBase.ShortName): Turn into a property. Use
6321 MemberCore.SetMemberName.
6322 (MemberBase.ExplicitInterfaceName): Remove.
6323 (MemberBase.UpdateMemberName): Remove.
6324 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6325 (PropertyBase.SetMemberName): New override.
6326 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6327 (Tree.GetDecl): New.
6328 (Tree.AllDecls): Rename from Decls.
6329 * attribute.cs, enum.cs, report.cs: Update to changes.
6330 * driver.cs (MainDriver): Use MemberName.FromDotted on
6331 RootContext.MainClass.
6333 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6335 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6338 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6340 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6342 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6343 property accessor modifiers.
6345 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6346 fixed buffer attribute (CS1716).
6347 (PropertyMethod.HasCustomAccessModifier): When property accessor
6348 has custom modifier.
6350 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6352 (PropertyExpr.DoResolveLValue): Add CS0272.
6354 2005-03-17 Miguel de Icaza <miguel@novell.com>
6356 * convert.cs: When converting to a pointer, use the proper Conv.U
6357 or Conv.I depending on the source data type.
6359 * cs-tokenizer.cs: Make the size for large decimal constants,
6362 2005-03-17 Martin Baulig <martin@ximian.com>
6364 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6365 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6367 2005-03-17 Martin Baulig <martin@ximian.com>
6369 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6370 to bool so we can return an error condition.
6371 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6374 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6376 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6379 2005-03-16 Raja R Harinath <rharinath@novell.com>
6381 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6382 Refactor to avoid traversing the list of assemblies, and to avoid
6383 string concatenation.
6384 * typemanager.cs (guid_attr_type): Remove.
6385 (negative_hits, pointers, references): Remove hashes.
6387 (GetConstructedType): New. Uses type_hash to handle constructed
6388 types (arrays, references, pointers).
6389 (GetReferenceType, GetPointerType): Use it.
6390 (GetNestedType): New. Uses type_hash to handle nested types of
6392 (LookupType, LookupTypeDirect): Remove.
6393 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6394 'types' hash and LookupTypeReflection directly.
6395 (params_string, params_object): Use GetConstructedType.
6396 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6398 (Namespace.Lookup): Use cached_types.
6399 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6400 provided by old TypeManager.LookupType.
6401 * rootcontext.cs (MakeFQN): Remove.
6402 * decl.cs (DeclSpace.MakeFQN): Likewise.
6403 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6404 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6405 TypeManager.GetConstructedType.
6406 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6408 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6410 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6413 * cs-parser.jay: Reports CS1527 for any namespace element.
6415 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6418 * expression.cs (ParameterReference.IsAssigned): Changed error to
6420 (Error_WrongNumArguments): Moved CS0245 detection here.
6422 * statement.cs (Return.Resolve): Add CS1622 report.
6424 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6426 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6428 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6430 * attribute.cs expression.cs: Get rid of some allocations.
6432 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6434 * doc.cs : just eliminate the latest change.
6436 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6438 * doc.cs : commented out the latest change. It breaks xml-030.cs
6440 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6442 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6443 fail. So invoke CreateType() in FindDocumentedType().
6445 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6447 * cs-tokenizer.cs : added IsKeyword().
6448 * doc.cs : Detect keyword incorrectly used as identifier.
6449 Allow identifiers prefixed by @.
6451 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6453 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6454 It caused exception in namespace resolving (again!).
6456 * class.cs (Class.ctor): Removed exit.
6457 (PropertyMethod.ctor): ditto.
6459 * codegen.cs (Codegen.Reset): Reset static data.
6460 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6462 * cs-tokenizer.cs (Cleanup): Removed.
6464 * driver.cs (GetSystemDir): Rewrote to one line command.
6465 It caused problem with unloaded dynamic modules.
6466 (UnixParseOption): Removed Exit.
6467 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6468 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6469 Now can be mcs used as library.
6471 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6474 * location.cs (Reset): Reset static data.
6476 * namespace.cs (Reset): Reset static data.
6478 * report.cs (Report.Reset): Reset static data.
6480 * rootcontext.cs (RootContext.Reset): Reset static data.
6482 * tree.cs (RootTypes.ctor): Use Location.Null
6484 * typemanager.cs (TypeManager.Reset): Reset static data.
6485 (CoreLookupType): Removed Exit.
6486 (TypeHandle.Reset): Reset static data.
6488 2005-03-10 Raja R Harinath <rharinath@novell.com>
6491 * typemanager.cs (ComputeNamespaces): Import namespaces from
6492 referenced modules too.
6494 2005-03-09 Raja R Harinath <rharinath@novell.com>
6496 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6499 2005-03-09 Raja R Harinath <rharinath@novell.com>
6501 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6502 enclosing DeclSpace. This ensures that a name-lookup populates
6503 more caches and there are fewer 'TypeExpression's. Carve out
6504 nested type lookup into ...
6505 (LookupNestedTypeInHierarchy): ... this.
6507 2005-03-09 Raja R Harinath <rharinath@novell.com>
6509 Clean up a few partial-class semantics.
6510 Fixes test-357.cs and cs1618-2.cs.
6511 * cs-parser.jay (struct_declaration): Use 'current_class' as
6512 parent of newly-created struct. Remove call to Register ().
6513 Use 'pop_current_class' to complete handing the current struct.
6514 (interface_declaration): Likewise.
6515 (class_declaration): Likewise.
6516 (enum_declaration): Use 'current_class' as parent of newly created
6518 (delegate_declaration): Likewise.
6519 (pop_current_class): New function. This is used to handle closing
6520 up the 'current_class' and 'current_container', and pointing them
6521 to the enclosing class/container.
6522 (CSharpParser): Initialize 'current_class' too.
6523 * decl.cs (MemberCore): Add check for invariant: a partial
6524 container is not a parsed entity, and thus does not enclose any
6526 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6527 (DeclSpace.BaseTypeExpr): Use it.
6528 (DeclSpace.LookupType): Add check for invariant.
6529 * class.cs (TypeContainer): Add check for invariant: a nested
6530 class should have the same NamespaceEntry as its enclosing class.
6531 (TypeContainer.EmitFieldInitializers): Make virtual.
6532 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6534 (TypeContainer.Register): Remove.
6535 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6536 null. Use TypeResolveEmitContext for resolving base types and
6537 interfaces. Move initialization of Parts.TypeBuilder here from
6539 (TypeContainer.DefineNestedTypes): ... here.
6540 (PartialContainer): Take a Namespace not a NamespaceEntry.
6541 (PartialContainer.Create): Don't use Register. Call the
6542 appropriate Add... function directly.
6543 (ClassPart): Take both the PartialContainer and the enclosing
6544 class as constructor arguments.
6545 (ClassPart.EmitFieldInitializers): Override.
6546 (ClassPart.PartFindNestedTypes): Remove.
6547 (FieldBase.GetInitializerExpression): Resolve the initializer
6548 expression in the emit context of the enclosing class.
6549 * tree.cs (RootTypes): Remove Register ().
6551 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6553 * cs-parser.jay: Removed CS0134.
6555 * driver.cs: Removed CS1901.
6557 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6558 for predefined types.
6560 2005-03-07 Duncan Mak <duncan@novell.com>
6562 * codegen.cs (Save): Catch UnauthorizedAccessException as
6563 well. Fixes bug #73454.
6565 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6567 * cs-tokenizer.cs (xtoken): Add CS1035.
6569 * class.cs (MethodData.Define): Add CS0683.
6570 (FieldMember.ctor): Add CS0681.
6572 2005-03-07 Raja R Harinath <rharinath@novell.com>
6574 * ecore.cs (SimpleName.DoResolve): Rename from
6575 SimpleName.DoResolveAllowStatic.
6576 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6577 Pass 'intermediate' flag to MemberStaticCheck.
6578 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6579 of "intermediate" lookups via MemberAccess.
6580 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6581 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6583 2005-03-07 Raja R Harinath <rharinath@novell.com>
6586 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6587 slipped in because of variable names that are identical to a
6588 builtin type's BCL equivalent ('string String;', 'int Int32;').
6589 (PropertyExpr.EmitInstance): Likewise.
6591 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6593 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6595 * report.cs (warning_ignore_table): Made public.
6597 2005-03-04 Raja R Harinath <rharinath@novell.com>
6600 * class.cs (MethodData.Emit): Pass 'container' to
6601 container.GetObsoleteAttribute instead of 'container.Parent'.
6603 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6605 * cs-parser.jay: Add 1534 error test.
6607 * iterators.cs (Yield.CheckContext): Add error 1629.
6608 (Iterator.ctor): Save unsafe modifier.
6609 (MoveNextMethod.DoEmit): Restore unsafe context.
6611 * namespace.cs (UsingAlias): Better error message.
6613 2005-03-03 Dan Winship <danw@novell.com>
6615 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6616 the warning message [#73219]
6618 2005-03-03 Raja R Harinath <rharinath@novell.com>
6620 Fix compile with MCS 1.0.0.0.
6621 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6622 w_restore to not depend on string constant folding.
6624 2005-03-03 Raja R Harinath <rharinath@novell.com>
6626 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6627 CS0246 check to users who passed 'silent = false'.
6628 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6630 (SimpleName.SimpleNameResolve): Update.
6631 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6632 (MemberAccess.IdenticalNameAndTypeName): Update.
6633 * doc.cs (FindDocumentedTypeNonArray): Update.
6635 2005-03-03 Raja R Harinath <rharinath@novell.com>
6637 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6638 * parameters.cs (ComputeAndDefineParameters): Remove.
6639 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6640 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6641 Use GetParameterInfo.
6643 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6645 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6647 2005-03-02 Raja R Harinath <rharinath@novell.com>
6649 Unify DeclSpace.LookupType and DeclSpace.FindType.
6650 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6651 is in charge of defining nested types on demand.
6652 (DeclSpace.LookupType): Use it when the current_type is a
6653 TypeBuilder. Use LookupTypeDirect for reflected types.
6654 (DeclSpace.FindType): Remove.
6655 (DeclSpace.LookupInterfaceOrClass): Likewise.
6656 (DeclSpace.DefineTypeAndParents): Likewise.
6657 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6658 DeclSpace.LookupType.
6659 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6660 * typemanager.cs (LookupType): Simplify.
6661 (AddUserType): Remove type from negative_hits.
6662 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6663 * class.cs (TypeContainer.FindMembers): Move handling of nested
6665 (TypeContainer.FindMembers_NestedTypes): ... here.
6666 (TypeContainer.FindNestedType): Implement override.
6667 (ClassPart.FindNestedType): Delegate to PartialContainer.
6668 (ClassPart.PartFindNestedType): Looks up the nested types of the
6671 2005-03-02 Martin Baulig <martin@ximian.com>
6673 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6674 static constructor in static classes.
6676 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6678 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6679 sizeParamIndex is not specified.
6681 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6684 * report.cs (WarningMessage.IsEnabled): Missing null check.
6686 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6688 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6689 in the fields and not in the properties.
6691 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6693 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6696 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6698 * attribute.cs: Small refactoring (improved robustness).
6699 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6700 (ValidateGuid): Removed.
6701 (Resolve): Removed referenced to above mentioned.
6702 (GetAttributeUsage): Made private and changed to work without
6704 (GetIndexerAttributeValue): Don't crash.
6705 (GetConditionalAttributeValue): Ditto.
6706 (GetClsCompliantAttributeValue): Ditto.
6707 (ExtractSecurityPermissionSet): All attributes exceptions are
6709 (GetPropertyValue): New helper.
6710 (GetMethodImplOptions): New method.
6711 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6712 some missing properties.
6714 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6715 (Method.ApplyAttributeBuilder): Updated.
6717 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6720 2005-02-28 Raja R Harinath <rharinath@novell.com>
6723 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6724 non-simple types (array, pointer, reference).
6726 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6728 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6730 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6732 (Method.CheckBase): Catch wrong destructor here.
6733 (MethodData.Define): Add errors 550, 668.
6735 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6737 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6739 * pending.cs (VerifyPendingMethods): Add error 551.
6741 * typemanager.cs (CSharpName): Next error report helper.
6743 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6745 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6746 attributes. Removed useless attribute double check.
6747 It saves almost 2MBs for corlib.
6749 2005-02-25 Raja R Harinath <rharinath@novell.com>
6752 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6753 called twice in case of error.
6755 2005-02-23 Chris Toshok <toshok@ximian.com>
6757 Fix compiler portions of #72827.
6758 * statement.cs (Block.Emit): call Begin/EndScope on the
6759 EmitContext instead of the ILGenerator.
6761 * codegen.cs (EmitContext.BeginScope): new method, call
6762 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6764 (EmitContext.BeginScope): same, but EndScope and CloseScope
6766 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6767 offset and call the superclass's OpenScope(int) with it.
6768 (SymbolWriter.CloseScope): get the current il
6769 offset and call superclass's CloseScope(int) with it.
6771 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6773 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6774 CS1677 for out and ref as well.
6776 * class.cs (Method.Define): Add error CS1599 detection.
6778 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6780 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6782 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6784 * support.cs.cs (ModifierDesc): New helper method.
6786 2005-02-23 Raja R Harinath <rharinath@novell.com>
6787 Abin Thomas <projectmonokochi@rediffmail.com>
6788 Anoob V E <projectmonokochi@rediffmail.com>
6789 Harilal P R <projectmonokochi@rediffmail.com>
6792 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6793 MemberLookup (used for error reporting) actually returns a result.
6794 Fix error report number (122, not 112).
6796 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6797 Anoob V E <projectmonokochi@rediffmail.com>
6798 Harilal P R <projectmonokochi@rediffmail.com>
6801 * pending.cs (PendingImplementation.GetAbstractMethods):
6802 Find NonPublic members too.
6804 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6806 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6809 * class.cs (MethodCore.CheckMethodAgainstBase):
6810 Add error 239 report.
6812 2005-02-21 Raja R Harinath <rharinath@novell.com>
6815 * expression.cs (Invocation.IsApplicable): Make public.
6816 (Invocation.IsParamsMethodApplicable): Likewise.
6817 * delegate.cs (Delegate.VerifyApplicability): Don't use
6818 Invocation.VerifyArgumentCompat for parameter applicability
6819 testing. Use Invocation.IsApplicable and
6820 Invocation.IsParamsMethodApplicable.
6822 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6824 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6826 * class.cs (Operator.Define): Add error 217 report.
6828 2005-02-21 Raja R Harinath <rharinath@novell.com>
6830 * namespace.cs (UsingEntry.Resolve): Undo change below.
6832 2005-02-21 Raja R Harinath <rharinath@novell.com>
6835 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6836 disable the error message when the extended MemberLookup also
6838 (Expression.MemberLookupFinal): Update.
6839 (SimpleName.DoSimpleNameResolve): Update.
6840 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6841 Don't use MemberLookupFinal.
6842 (New.DoResolve): Update.
6843 (BaseAccess.CommonResolve): Update.
6845 2005-02-21 Raja R Harinath <rharinath@novell.com>
6848 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6849 occured previously, don't resolve again.
6851 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6854 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6855 argument. Call ResolveAttributeUsage for unresolved.
6856 when types doesn't match ctor arguments.
6858 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6859 for nested attribute classes.
6860 (Class.attribute_usage): Removed.
6861 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6862 for attribute class.
6864 * ecore.cs (IsAttribute): Removed.
6866 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6868 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6870 (attribute_types): Removed.
6871 (EmitCode): Global attributes are emited as the latest.
6873 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6875 * class.cs (EmitFieldInitializers): Don't emit field initializer
6876 for default values when optimilization is on.
6878 * constant.cs (Constant.IsDefaultValue): New property.
6880 * driver.cs: Add /optimize handling.
6884 * literal.cs: Implement new IsDefaultValue property.
6886 * rootcontext.cs (Optimize): New field, holds /optimize option.
6888 2005-02-18 Raja R Harinath <rharinath@novell.com>
6890 Fix crasher in re-opened #72347.
6891 * namespace.cs (Namespace.Lookup): Return null if
6892 DeclSpace.DefineType returns null.
6895 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6897 2005-02-18 Raja R Harinath <rharinath@novell.com>
6899 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6900 now returns null if it cannot resolve to an lvalue.
6901 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6902 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6903 returned null. Remove check for SimpleName.
6904 (EventExpr.DoResolveLValue): New.
6905 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6906 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6908 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6910 (Unary.ResolveOperator): Move CS0211 check ...
6911 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6913 (Unary.DoResolveLValue): Simplify.
6914 (AddressOf.DoResolveLValue): New.
6915 (ArrayAccess.DoResolveLValue): New.
6917 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6919 * attribute.cs (Attribute.Resolve): Add arguments casting for
6920 when types doesn't match ctor arguments.
6922 2005-02-16 Raja R Harinath <rharinath@novell.com>
6924 Fix parts of #63202.
6925 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6926 lookup of operator in base type. Ensure that all checks happen
6927 when the operator resolves to an "op_..." method.
6929 2005-02-15 Raja R Harinath <rharinath@novell.com>
6932 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6933 'ignore_cs0104' parameter. Pass it to ...
6934 (NamespaceEntry.Lookup): ... this.
6935 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6936 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6937 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6938 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6939 Update. Request that cs0104 errors be ignored.
6940 (ComposedCast.ResolveAsTypeStep): Update.
6942 2005-02-14 Raja R Harinath <rharinath@novell.com>
6945 * expression.cs (Invocation.BetterFunction): Remove support for
6946 comparing virtual functions and their overrides.
6947 (Invocation.IsOverride): New.
6948 (Invocation.OverloadResolve): Don't consider 'override' functions
6949 during candidate selection. Store them in a lookaside list.
6950 If the selected method is a 'virtual' function, use the list to
6951 find any overrides that are closer to the LHS type.
6953 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6955 * expression.cs (New.DoResolve): Add complex core type reduction.
6956 (New.Constantify): Converts complex core type syntax like 'new int ()'
6959 2005-02-14 Raja R Harinath <rharinath@novell.com>
6961 * decl.cs (EntryType.EntryType): New constructor to create an
6962 updated copy of a cache entry.
6963 (MemberCache.AddMethods): Use it.
6964 (MemberCache.ClearDeclaredOnly): Remove.
6965 (MemberCache.MemberCache): Update.
6967 2005-02-11 Miguel de Icaza <miguel@novell.com>
6969 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6970 variable. This one is represents the actual low-level declaration
6971 of the method, as opposed to the semantic level `IsStatic'.
6973 An anonymous method which is hosted into a static method might be
6974 actually an instance method. IsStatic would reflect the
6975 container, while MethodIsStatic represents the actual code
6978 * expression.cs (ParameterReference): Use the new MethodIsStatic
6979 instead of IsStatic.
6981 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6982 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6983 set on the current EmitContext.
6985 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6986 resolve our casted expression as an LValue. This triggers the
6987 proper LValue processing that is later required by Assign.
6991 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6993 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6995 C# 2.0 Fixed buffer implementation
6997 * anonymous.cs: Update after RegisterHelperClass renaming.
6999 * attribute.cs (AttributeTester.fixed_buffer_cache):
7000 Cache of external fixed buffers.
7001 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7002 implementation if field is fixed buffer else null.
7005 (TypeContainer.AddField): Accept FieldMember instead of Field.
7006 (FieldBase.IsFieldClsCompliant): Extracted code from
7007 VerifyClsCompliance descendant customization.
7008 (FixedField): New class handles fixed buffer fields.
7009 (FixedFieldExternal): Keeps information about imported fixed
7011 (IFixedField): Make access to internal or external fixed buffer
7014 * cs-parser.jay: Add fixed buffer parsing.
7016 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7019 * expression.cs (Indirection): Extended implementation to accept
7021 (PointerArithmetic.Emit): Get element from fixed buffer as well.
7022 (ElementAccess.MakePointerAccess): Get type as parameter.
7023 (DoResolve): Add fixed buffer field expression conversion.
7024 (DoResolveLValue): Ditto.
7025 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7026 (ArrayPtr): Derives from FixedBufferPtr.
7027 (ArrayPtr.Emit): Add extra emit for array elements.
7029 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7031 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7032 for compiler generated types.
7033 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7035 * statement.cs (Fixed): Refactored to be easier add fixed buffer
7036 and consume less memory.
7037 (Fixed.Resolve): Add fixed buffer case.
7039 * typemanager.cs (compiler_generated_attr_ctor,
7040 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7041 (HasElementType): Add our own implementation to work on every
7044 2005-02-11 Miguel de Icaza <miguel@novell.com>
7046 * anonymous.cs (CaptureContext): Track whether `this' has been
7049 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
7050 only captured `this' if it was implicitly done (instance
7051 methods/variables were used).
7053 * codegen.cs (EmitContext.CaptureThis): New method to flag that
7054 `this' must be captured.
7056 2005-01-30 Miguel de Icaza <miguel@novell.com>
7058 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7059 is null it means that there has been no need to capture anything,
7060 so we just create a sibling.
7062 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7064 Just a partial fix. The other half is fairly elusive.
7066 2005-02-10 Raja R Harinath <rharinath@novell.com>
7068 Fix #52586, cs0121-4.cs.
7069 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
7070 and return a hashtable.
7071 (MemberCache.ClearDeclaredOnly): New.
7072 (MemberCache.MemberCache): Update to change. Make a deep copy of
7073 the method_hash of a base type too.
7074 (MemberCache.AddMethods): Adapt to having a deep copy of the base
7075 type methods. Overwrite entries with the same MethodHandle so
7076 that the ReflectedType is correct. The process leaves in base
7077 virtual functions and their overrides as distinct entries.
7078 (CacheEntry): Now a class instead of a struct. It shouldn't alter
7079 matters since it was boxed in a ArrayList before.
7080 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7082 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
7083 case of a virtual function and its override (choose the overload
7085 (Invocation.OverloadResolve): Avoid 'override' members during
7086 'applicable_type' calculation.
7088 2005-02-09 Raja R Harinath <rharinath@novell.com>
7090 Combine two near-redundant caches.
7091 * typemanager.cs (method_params): Rename from method_internal_params.
7092 (TypeManager.GetParameterData): New. Replace
7093 Invocation.GetParameterData.
7094 (TypeManager.LookupParametersByBuilder): Remove.
7095 * expression.cs (Invocation.method_parameter_cache): Remove.
7096 (Invocation.GetParameterData): Remove.
7098 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7101 2005-02-08 Raja R Harinath <rharinath@novell.com>
7104 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7105 TypeManager.multicast_delegate_type is null, resolve it by looking
7106 up "System.MulticastDelegate".
7107 * rootcontext.cs (RootContext.ResolveCore): Simplify.
7109 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
7110 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
7111 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
7114 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7115 (LabeledStatement.AddReference): New. Set 'referenced'.
7116 (Goto.Resolve): Use it.
7118 2005-02-05 John Luke <john.luke@gmail.com>
7120 * driver.cs: remove duplicate -doc line in Usage ()
7122 2005-02-04 Raja R Harinath <rharinath@novell.com>
7124 * location.cs (Location.AddFile): Fix CS2002 error report.
7126 2005-02-02 Martin Baulig <martin@ximian.com>
7128 * delegate.cs (Delegate.DefineType): Report an internal error if
7129 TypeManager.multicast_delegate_type is null. See bug #72015 for
7132 2005-02-02 Raja R Harinath <rharinath@novell.com>
7134 Fix a crasher in a variant of #31984.
7135 * const.cs (Constant.CheckBase): New override that defers the
7136 new-or-override check in case the base type hasn't been populated
7138 (Constant.Define): Ensure the new-or-override check is performed.
7140 2005-02-01 Duncan Mak <duncan@ximian.com>
7142 * const.cs (LookupConstantValue): Check that `ce' is not null
7143 before calling GetValue ().
7145 2005-02-01 Raja R Harinath <rharinath@novell.com>
7147 Fix test-334.cs (#69519).
7148 * cs-parser.jay (using_alias_directive): Pass in an expression to
7149 NamespaceEntry.UsingAlias.
7150 (using_namespace_directive): Pass in an expression to
7151 NamespaceEntry.Using.
7152 (namespace_name): Don't flatten to a string.
7153 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7154 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7156 (NamespaceEntry.UsingEntry): Likewise.
7157 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7159 (NamespaceEntry.LookupForUsing): Remove.
7160 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7162 (NamespaceEntry.Lookup): Remove support for dotted names.
7164 2005-02-01 Raja R Harinath <rharinath@novell.com>
7166 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7168 (NamespaceEntry.ImplicitParent): Compute on demand.
7169 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7170 parallels the current.
7171 (NamespaceEntry.LookupForUsing): Use it.
7172 (NamespaceEntry.Lookup): If the current namespace-entry is
7173 implicit, don't search aliases and using tables.
7175 2005-02-01 Raja R Harinath <rharinath@novell.com>
7178 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7180 (TypeContainer.BaseCache): Compute on demand.
7181 (TypeContainer.FindMembers): Define constants and types if they're
7182 not already created.
7183 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7185 * const.cs (Constant.Define): Make idempotent.
7187 2005-01-29 Miguel de Icaza <miguel@novell.com>
7189 * pending.cs: Produce better code (no nops produced by using Ldarg
7192 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7193 i - 1' it should be arg + 1.
7197 2005-01-28 Raja R Harinath <rharinath@novell.com>
7199 * attribute.cs (Attribute.CheckAttributeType): Make private
7201 (Attribute.ResolveType): Make virtual.
7202 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7203 handling of RootContext.Tree.Types.
7205 2005-01-27 Raja R Harinath <rharinath@novell.com>
7207 Update attribute-handling to use the SimpleName/MemberAccess
7209 * cs-parser.jay (attribute): Pass in an expression to the
7210 constructors of Attribute and GlobalAttribute.
7211 * attribute.cs (Attribute): Take an expression for the name.
7212 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7213 passed in attribute name expression.
7214 (Attribute.CheckAttributeType): Use it.
7215 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7216 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7217 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7218 argument to prevent error messages if the lookup fails.
7220 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7222 * expression.cs (Indirection): Implemented IVariable interface
7223 to support indirection in AddressOf operator.
7224 (PointerArithmetic.Emit): Add optimalization for case where
7225 result can be precomputed.
7227 2005-01-26 Martin Baulig <martin@ximian.com>
7229 * class.cs (TypeContainer.AttributeTargets): Return the correct
7230 AttributeTargets depending on our `Kind' instead of throwing an
7231 exception; fixes #71632.
7233 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7236 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7239 2005-01-25 Raja R Harinath <rharinath@novell.com>
7242 * expression.cs (MemberAccess.DoResolve): Don't complain with
7243 cs0572 when the LHS of a member access has identical name and type
7246 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7249 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7251 Create custom PermissionSet only for PermissionSetAttribute.
7253 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7256 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7257 delegates in static class.
7259 2005-01-24 Martin Baulig <martin@ximian.com>
7261 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7262 merging an implicit block, just use its reachability.
7264 * statement.cs (Block.Resolve): Make the unreachable code check
7265 work wrt. implicit blocks; see test-337 from #63842.
7267 2005-01-21 Alp Toker <alp@atoker.com>
7269 * cs-parser.jay: destructor_declaration's container is PartialContainer
7270 not Class when partial types are used, so use Kind prop instead of
7273 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7275 * cs-parser.jay: Improve error reporting when an interface
7278 2005-01-20 Dick Porter <dick@ximian.com>
7280 * support.cs: SeekableStreamReader fix from Sandor Dobos
7281 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7282 chars are read. Fixes bug 70369.
7284 2005-01-20 Raja R Harinath <rharinath@novell.com>
7286 * cs-parser.jay (catch_clause): Simplify current_block handling
7289 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7291 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7292 code with ImplicitStandardConversion to handle the implicit
7293 conversion of method groups into valid delegate invocations.
7295 The problem is that in parameter handling we were using this code
7296 path. Fixes bug #64698
7298 2005-01-19 Raja R Harinath <rharinath@novell.com>
7300 * cs-parser.jay: Fix several infelicities.
7301 - Avoid assigning to the parser value stack. Code like
7302 '$3 = null' is unclean. Synthesize a value for the code block
7304 - Avoid using oob_stack for storing location information. Use ...
7305 (_mark_): ... this. New (empty) rule. Saves the current location
7307 (foreach_statement): Avoid using oob_stack for current_block
7308 handling. Use technique used in for_statement and
7309 using_statement. Synthesize a value for the code block to store
7310 additional intermediate information.
7312 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7314 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7315 of a different type is only allowed to private fields of a
7316 containing type, not on fields of a base class.
7318 See test-174.cs and error cs0122-9.cs
7320 2005-01-13 Raja R Harinath <rharinath@novell.com>
7322 Fix test-335.cs (bug #58126).
7323 * cs-parser.jay (argument): Split out non-expression parts of the
7324 rule into 'non_simple_argument'.
7325 (invocation_expression): Support parenthesized invocations with
7326 multiple arguments, and with single non-simple arguments.
7328 2005-01-13 Raja R Harinath <rharinath@novell.com>
7330 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7333 2005-01-12 Raja R Harinath <rharinath@novell.com>
7335 Fix cs0038-1.cs, cs1640-6.cs.
7336 * ecore.cs (Expression.Resolve): Remove special-case for
7337 SimpleName in error-handling.
7338 (Expression.almostMatchedMembers): Relax access permission to
7340 (Expression.MemberLookupFailed): Handle duplicates in
7341 almostMatchedMembers list.
7342 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7343 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7344 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7345 overload if the passed in MemberInfo is a MethodBase.
7347 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7350 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7351 for non-CAS & merge permission sets properly.
7353 2005-01-11 Raja R Harinath <rharinath@novell.com>
7355 Improve standard-compliance of simple name and member access
7356 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7357 * ecore.cs (FullNamedExpression): New abstract base class
7358 for Namespaces and TypeExpressions.
7359 (ResolveFlags.SimpleName): Remove.
7360 (SimpleName): Remove support for dotted names.
7361 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7362 DeclSpace.FindType and DeclSpace.LookupType.
7363 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7364 (Expression.ExprClassName): Make member function.
7365 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7366 a namespace. Remove creation of dotted "SimpleName"s.
7367 (MemberAccess.DoResolve): Likewise.
7368 * decl.cs (DeclSpace.Cache): Make private.
7369 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7370 (DeclSpace.FindType): Update.
7371 (DeclSpace.LookupType): Move here from RootContext. Return a
7372 FullNamedExpression.
7373 * namespace.cs (Namespace): Derive from FullNamedExpression
7374 so that it can be part of expression resolution.
7375 (Namespace.Lookup): Return an FullNamedExpression.
7376 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7378 * rootcontext.cs (NamespaceLookup): Remove.
7379 (LookupType): Move to DeclSpace.
7380 * attribute.cs (CheckAttributeType): Update.
7381 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7382 (FindDocumentedTypeNonArray): Likewise.
7384 2005-01-11 Raja R Harinath <rharinath@novell.com>
7386 Fix cs0509.cs, cs1632.cs.
7387 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7388 is the same as IsInterface.
7389 (TypeContainer.GetClassBases): Likewise.
7390 * statement.cs (LabeledStatement.ig): New field.
7391 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7393 (LabeledStatement.DoEmit): Check that the label was created with
7394 the same ILGenerator.
7396 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7399 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7400 accessors to its properties.
7402 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7403 from accessors to property.
7405 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7408 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7411 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7413 * attribute.cs: Check for null and empty strings.
7415 I have lost another battle to Paolo.
7417 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7420 * class.cs (PropertyMethod): Set Parent field in ctors.
7421 (SetMethod.InternalParameters): Add unsafe switch hack.
7422 Override MarkForDuplicationCheck where it is appropriate.
7424 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7425 It says whether container allows members with the same name.
7427 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7428 Removed is_method parameter.
7430 2005-01-06 Duncan Mak <duncan@ximian.com>
7432 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7433 because the previous change led to incorrect reporting of CS1032
7434 ("Cannot define/undefine preprocessor symbols after first token in
7435 file"). Instead of using `tokens_seen' as the only flag that
7436 triggers CS1040, introduce `comments_seen'. This new flag is used
7437 to signify having seen comments on the current line, so it is
7438 unset after a newline.
7440 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7442 * doc.cs : When searching for a type, find nested type too.
7443 This fixes bug #71040.
7445 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7448 - Warn missing member comment on those classes which also does not
7449 have doc comments. Fixed bug #71041.
7450 - Don't warn missing doc comment on default constructor.
7453 2005-01-06 Duncan Mak <duncan@ximian.com>
7455 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7456 comments, set `tokens_seen' to true. This allows us to detect
7457 misplaced preprocessor directives (i.e. not at the beginning of
7458 the a line, nor after whitespaces). In that case, report error
7459 CS1040. This fixes bug #56460.
7461 * cs-parser.jay (interface_member_declaration): Add checks for
7462 IsExplicitImpl, and report CS0541 error if an interface member is
7463 defined as an explicit interface declaration.
7465 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7468 * class.cs (PropertyMethod): Set Parent field in ctors.
7469 (SetMethod.InternalParameters): Add unsafe switch hack.
7471 * decl.cs (MemberCore.Parent): Cannot be readonly.
7473 2005-01-06 Raja R Harinath <rharinath@novell.com>
7475 * decl.cs (DeclSpace.ResolveType): Remove.
7476 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7477 Merge in code from ...
7478 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7479 * class.cs, enum.cs: Update to changes.
7481 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7483 * anonymous.cs: Ensure that we init the scope of our parent if it
7484 has not been initialized yet.
7486 2004-12-30 Duncan Mak <duncan@ximian.com>
7488 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7489 if field.FieldBuilder is null. Fixes #70758.
7491 * convert.cs: Fixed some typos and updated some of the comments.
7492 (ImplicitStandardConversionExists):
7493 (TryImplicitIntConversion): If `target_type' is an interface and
7494 the type of `ic' implements this interface, return true or a new
7495 BoxedCast instead of null. This fixes #70468.
7497 2004-12-29 Duncan Mak <duncan@ximian.com>
7499 * expression.cs (Argument.Emit): Check that Expr is
7500 IMemoryLocation before casting to it, and report CS1510 otherwise.
7504 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7506 * statement.cs (Block.ThisVariable): remove the recursion here, to
7507 make the --profile more sane.
7509 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7511 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7512 assembly, by JB Evain.
7514 2004-12-17 Raja R Harinath <rharinath@novell.com>
7516 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7517 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7518 "parent" refers to enclosing type/class. "base" refers to superclass.
7520 2004-12-17 Raja R Harinath <rharinath@novell.com>
7522 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7523 Ensure that we only have GlobalAttributes.
7524 * attribute.cs (Attribute.Emit): Make non-virtual.
7525 (GlobalAttribute.Emit): Remove.
7526 (Attribute.Resolve): Make virtual.
7527 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7528 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7529 the argument. Don't create one.
7530 (Attribute.GetObsoleteAttribute): Likewise.
7531 (Attribute.GetClsCompliantAttributeValue): Likewise.
7532 * class.cs, decl.cs: Update to changes.
7534 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7536 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7538 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7540 * statement.cs (Foreach.Resolve): Add error 186 report.
7542 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7544 * expression.cs (Conditional.DoResolve): Add warning 429.
7546 * statement.cs (If.Resolve): Add warning 665.
7548 2004-12-16 Raja R Harinath <rharinath@novell.com>
7550 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7551 except when in the parser, and in GlobalAttribute.
7552 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7553 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7554 RootContext.Tree.Types.NamespaceEntry once work is done.
7555 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7556 and resets RootContext.Tree.Types.NamespaceEntry.
7558 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7560 * cs-parser.jay: Don't create a block for every variable.
7562 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7564 * location.cs: Provide extra information.
7566 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7567 variables from the captured environment, it is the ldarg_0.
7569 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7571 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7574 * class.cs: Changed warning level for 169 to avoid developer
7575 displeasure from warning flooding. It will be changed back when they
7576 fix most of current BCL warnings.
7578 * RootContext.cs: Pushed default WarningLevel to 3.
7580 * statement.cs: Removed unused variable.
7582 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7584 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7585 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7586 Add error 502 report.
7587 (StaticClass.DefineType): Add error 441 report.
7588 (Class.AllowedModifiersProp): New virtual property as temporary
7589 extension to AllowedModifiers.
7590 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7591 to share implementation with StaticClass and don't call virtual
7594 * driver.cs (MainDriver): Add error 1558 test.
7596 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7597 report. Moved error 36 test here.
7599 * statement.cs (Throw.Resolve): Add error 724 report.
7601 * typemanager.cs: Add out_attribute_type core type.
7603 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7605 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7607 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7609 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7612 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7614 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7615 Add error 3023 report.
7616 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7618 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7621 2004-12-12 John Luke <john.luke@gmail.com>
7623 * driver.cs (AddArgs): take -- into account when
7624 adding arguments, fixes bug 65710
7626 2004-12-12 Martin Baulig <martin@ximian.com>
7628 * expression.cs (Unary.TryReduceNegative): Added support for
7629 SByteConstant and ByteConstant.
7630 (Unary.Reduce): Check error values from TryReduceNegative().
7632 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7634 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7635 and report exception as error 182.
7637 2004-12-10 Raja R Harinath <rharinath@novell.com>
7639 * driver.cs (Main): Fix message when there are warnings.
7641 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7643 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7645 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7647 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7648 Reduced number of warnings.
7650 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7652 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7654 * driver.cs: Removed message.
7656 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7658 2004-12-08 <vargaz@freemail.hu>
7660 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7662 2004-12-08 Martin Baulig <martin@ximian.com>
7664 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7665 instead of a CS3002 for properties and indexer.
7667 2004-12-08 Martin Baulig <martin@ximian.com>
7669 * decl.cs (MemberName.ToString): Make this work again.
7671 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7673 * attribute.cs (Resolve): Add error 591 detection.
7675 * class.cs (FieldMember.Define): Add error 1547 detection.
7676 (Indexer.Define): Add error 620 detection.
7677 (Operator.Define): Add error 590 detection.
7679 * ecore.cs: Missing argument for error 79.
7681 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7684 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7687 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7690 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7692 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7693 Some operator comments were suppressed.
7694 * doc.cs : Implicit/explicit operator name in doc comments are like
7695 "op_Explicit(type)~returnType", so added suffix handling.
7697 2004-12-07 Martin Baulig <martin@ximian.com>
7700 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7701 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7702 (DeclSpace.ec): New protected field; store the EmitContext here.
7703 (DeclSpace.EmitContext): New public property; moved here from
7705 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7708 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7709 (Enum.Emit): Don't create a new EmitContext.
7711 * delegate.cs (Delegate.DefineType): Always create the
7714 * iterators.cs (Iterators.DefineIterator): Create a new
7715 EmitContext and store it in `ec'.
7717 2004-08-24 Martin Baulig <martin@ximian.com>
7720 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7721 this for accessibility checks.
7722 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7723 IsNestedFamilyAccessible.
7724 (TypeManager.IsSubclassOf): New method, do what the name actually
7727 2004-12-06 Raja R Harinath <rharinath@novell.com>
7729 Fix crash on cs0657-17.cs.
7730 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7731 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7732 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7733 the case where the NamespaceEntry gets overwritten.
7735 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7737 Fixed #69195, #56821
7738 * ecore.cs (ResolveBoolean): Tiny refactoring.
7740 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7741 of right expression resolving when left is false constant and
7742 operator is LogicalAnd OR true constant and operator is LogicalOr.
7744 * statement.cs (ResolveUnreachable): Always reports warning.
7746 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7748 * class.cs: Distinguish between 1721 and 1722 (just a little help
7749 for the programmer).
7751 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7753 * delegate.cs: Only allow this on new versions of the language.
7755 2004-12-02 Duncan Mak <duncan@ximian.com>
7757 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7759 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7760 here as a static method. Take an additional bool out parameter
7761 `must_do_cs1540_check' for signaling to InstanceResolve.
7762 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7763 member field from PropertyExpr class and made it an argument of
7765 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7766 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7767 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7768 and `remove_accessor' as well as InstanceResolve: report CS0122
7773 2004-12-03 Raja R Harinath <rharinath@novell.com>
7775 Fix test-327.cs, test-328.cs, and put in early infrastructure
7776 for eventually fixing #52697.
7777 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7778 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7780 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7781 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7782 (VerifyUsing, error246): Update.
7783 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7784 'NamespaceEntry.LookupNamespaceOrType'.
7786 2004-12-03 Martin Baulig <martin@ximian.com>
7788 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7789 method as our child, call AnonymousMethod.Compatible() on it.
7791 2004-12-03 Raja R Harinath <rharinath@novell.com>
7793 Disable XML documentation support in 'basic' profile.
7794 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7795 Redirect XmlElement to System.Object.
7796 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7797 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7798 * mcs.exe.sources: Add doc-bootstrap.cs.
7799 * doc-bootstrap.cs: New file. Contains empty stub implementation
7802 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7804 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7805 comments are allowed.
7807 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7809 * delegate.cs: Add checks for subtypes in paramaters and return values
7810 in VerifyMethod () to add support for Covariance/Contravariance
7813 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7815 * report.cs: Remove extra closing parenthesis.
7817 * convert.cs (Error_CannotImplicitConversion): If the name of the
7818 types are the same, provide some extra information.
7820 * class.cs (FieldBase): Use an unused bit field from the field to
7821 encode the `has_offset' property from the FieldMember. This saves
7822 a couple of Ks on bootstrap compilation.
7824 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7825 method as our child, return the AnonymousMethod resolved
7828 * expression.cs (New.DoResolve): Allow return values from
7829 NewDelegate to also include AnonymousMethods.
7833 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7836 * attribute.cs (Resolve): Improved implementation of params
7837 attribute arguments.
7839 * support.cs (ParameterData): Add HasParams to be faster.
7841 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7843 all things are for /doc support:
7845 * doc.cs: new file that supports XML documentation generation.
7846 * mcs.exe.sources: added doc.cs.
7848 Handle /doc command line option.
7849 Report error 2006 instead of 5 for missing file name for /doc.
7850 Generate XML documentation when required, after type resolution.
7852 Added support for picking up documentation (/// and /** ... */),
7853 including a new XmlCommentState enumeration.
7855 Added lines to fill Documentation element for field, constant,
7856 property, indexer, method, constructor, destructor, operator, event
7857 and class, struct, interface, delegate, enum.
7858 Added lines to warn incorrect comment.
7860 Added Documentation field (passed only when /doc was specified).
7862 Added DocComment, DocCommentHeader, GenerateDocComment() and
7863 OnGenerateDocComment() and some supporting private members for
7864 /doc feature to MemberCore.
7866 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7868 Added overriden DocCommentHeader.
7870 Added overriden DocCommentHeader and GenerateDocComment().
7872 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7874 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7875 unwrapping the enumeration values, chain to
7876 DoConstantNumericPromotions again, so we can promote things to the
7877 fundamental types (takes care of enums that are bytes, sbytes).
7881 2004-12-01 Raja R Harinath <rharinath@novell.com>
7883 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7884 Fix long-standing bug in type-lookup. Use FindType instead of
7885 LookupType when ec.ResolvingTypeTree.
7886 (Attribute.ResolveType, Attribute.Resolve)
7887 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7889 (Attributes.Search): Remove internal version. Update.
7890 (Attributes.SearchMulti): Update.
7891 (Attributes.GetClsCompliantAttribute): Remove.
7892 (Attributes.GetIndexerNameAttribute): Remove.
7893 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7894 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7895 * class.cs (Indexer.Define): Likewise.
7897 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7900 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7901 MarshallByReference members access.
7903 * expression.cs: Use CheckMarshallByRefAccess;
7904 Better error CS0197 message.
7906 * report.cs: Print whole related error message.
7908 2004-11-30 Raja R Harinath <rharinath@novell.com>
7910 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7911 the current directory to help debugging.
7913 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7915 * class (GetClassBases): Better error 60 report.
7916 (EventProperty): Disabled warning 67 detection.
7918 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7921 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7923 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7926 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7929 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7931 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7933 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7935 * attribute.cs (Attribute.Resolve): Refine error reporting and
7936 report a cs0117 if the identifier does not exist, to distinguish
7937 from 0617 which is a miss-use of the actual identifier.
7939 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7940 between cs0070 and cs0079.
7942 * class.cs (MemberBase.DoDefine): When reporting a wrong
7943 accessibility level, we use MethodCore to compare instead of
7944 Method (this was a regression in some refactoring effort).
7946 So now we correctly report cs0056 again.
7948 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7949 testing the target_type (which was known to be object_type) and
7950 not the source type (which is anonymous_method).
7952 Fixed reporting of error cs1660.
7954 * expression.cs (UserCast.Source): Expose the underlying cast.
7956 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7957 allowed types to find a match to int32 first (most common).
7959 In addition, it ignores any ImplicitUserConversions that did an
7960 internal implicit conversion (as the switch statement allows only
7961 one integral conversion to exist).
7963 * class.cs (PartialContainer.Create): rename `name' to
7964 `member_name' for clarity. Then replace the string calls with a
7965 call to MemberName.GetPartialName, as now using
7966 MemberName.ToString is an error (this is due to the side effects
7967 it had, that were fixed in the past).
7969 This will restore the error reporting on a number of partial class
7970 errors that were missusing this (and getting an exception as a
7971 results, which is now just a plain textual warning, because
7972 yyparse debug output would crash otherwise).
7974 2004-11-26 Raja R Harinath <rharinath@novell.com>
7976 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7978 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7980 * rootcontext.cs (LookupType): Make sure to cache lookups that
7981 don't give us a negative result. This saves about 5% of corlib
7984 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7986 * report.cs (AbstractMessage.Print): messages are sent to stderr
7988 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7989 non-interface in the list of interfaces (at this point, either
7990 parent was properly set, or a base class is being listed in the
7991 interfaces section).
7993 This flags error 1722, and resolves the crash from bug 69259.
7995 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7997 * statement.cs (Using.EmitExpressionFinally): make this work right
7998 for valuetypes. Fixes 69926.
8000 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8002 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8003 converted to an enum" here, before we try to change the underlying
8004 type. This code exists, but it is a different code path than the
8005 one used while encoding constants.
8007 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8008 old bug: when converting from the null literal to a pointer,
8009 return an EmptyCast, not the NullLiteral.
8011 This fixes #69921, the recent null_type changes probably made this
8014 (ImplicitReferenceConversionExists): In addition, resynchronized
8015 the code here, so it matches the same code in
8016 ImplicitReferenceConversionExists for the `from any class-type S
8017 to any interface-type T'.
8020 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8022 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8024 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8026 * cs-parser.jay: Use verbosity accordingly.
8028 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8030 * expression.cs (Unary.ResolveOperator): Do not report warning;
8031 AddressOf reads from variable.
8033 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8035 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8039 * attribute.cs (Attributable): Removed CheckTargets.
8040 (Attributes.Emit): Explicit attribute targets are tested here.
8042 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8043 not enabled for interfaces.
8045 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8046 (GetAssemblyName): Ouch next bug there.
8048 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8050 * expression.cs: Error 275 added.
8052 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8054 Fix bug #69177 (Implemented decimal constant support)
8056 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8057 (BinaryFold): Add DecimalConstant.
8059 * const.cs (Define): Decimal constant
8061 (ChangeType): Add decimal type handling.
8062 (LookupConstantValue): Don't set value for decimal type but
8063 emit DecimalConstantAttribute. Needed for constant optimization.
8065 * constant.cs (ToDecimal): New method.
8066 (ConvertToDecimal): New method.
8067 (IntConstant): Implemented ConvertToDecimal.
8068 (DecimalConstant.Emit): Emit optimized version for decimals in
8071 * expression.cs (ResolveOperator): Changed order of constant
8072 reduction to work correctly with native types which have
8073 overloaded operators.
8074 (ResolveMemberAccess): Extract constant value from attribute
8077 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8079 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8080 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8081 (ChangeType): Decimal is special.
8082 (TypeToCoreType): Add decimal type.
8084 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8086 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8089 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8091 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8094 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8096 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8098 * pending.cs (PendingImplementation): Grab only interfaces.
8100 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8102 * statement.cs (ForeachHelperMethods): Add location member and
8103 error 202 detection.
8105 2004-11-19 Raja R Harinath <rharinath@novell.com>
8107 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
8108 automatically handled by executable.make.
8109 (PROGRAM): Make profile-specific.
8111 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8113 * expression.cs (DoResolveBase): Fixed wrong warning for out
8116 2004-11-18 Martin Baulig <martin@ximian.com>
8118 Merged latest changes into gmcs. Please keep this comment in
8119 here, it makes it easier for me to see what changed in MCS since
8120 the last time I merged.
8122 2004-11-17 Raja R Harinath <rharinath@novell.com>
8124 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8125 (TypeHandle.GetMemberCache): New.
8126 (TypeHandle.TypeHandle): Update.
8127 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8128 (TypeManager.LookupParentInterfacesCache):
8129 Rename from LookupInterfaceCache. Optimize slightly.
8130 (TypeManager.MemberLookup_FindMembers): Update.
8131 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8133 (AddCacheContents): Rename from AddHashtable.
8134 * class.cs (TypeContainer.parent_container): Remove.
8135 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8136 (TypeContainer.DoDefineMembers): Don't initialize it.
8137 Update to name changes.
8139 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8141 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8142 that factors the code to check access modifiers on override.
8144 (PropertyBase): Use the code here.
8146 Patch from Lluis S'anchez, fixes bug #69361.
8148 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8150 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8151 routine that is used to report the use of a captured variable
8152 whose address has been taken.
8154 There are two checks: one when variables are being captured and
8155 the other check is when the address of a variable is taken.
8157 (because an anonymous methods might be resolved before *or* after
8158 the address has been taken) and
8160 * expression.cs (Conditional.DoResolve): Remove the special
8161 casing that Martin added to trueExpr and falseExpr being both
8162 NullLiteral. We get the right behavior now just by introducing
8163 the null_type into the compiler.
8165 * convert.cs (ExplicitConversion): Change the code to use
8166 null_type instead of testing `expr is NullLiteral'.
8167 (ImplicitConversionStandard): use null_type too.
8168 (ImplicitReferenceConversionExists): use null_type too.
8169 (ImplicitReferenceConversion): use null_type too.
8171 * literal.cs: The type of `NullLiteral' is now null_type instead
8173 (Resolve): Set the type here.
8175 * typemanager.cs: Introduce null_type.
8177 2004-11-17 Martin Baulig <martin@ximian.com>
8179 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8180 direction, like FindMembers() does. Fixes #69546, testcase is in
8183 2004-11-16 Martin Baulig <martin@ximian.com>
8185 This is based on a patch from Marek Safar, see bug #69082.
8186 Fixes bugs #63705 and #67130.
8188 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8189 method; create a MemberCache for an interface type and cache the
8192 * decl.cs (IMemberContainer.ParentContainer): Removed.
8193 (IMemberContainer.ParentCache): New property.
8194 (MemberCache.SetupCacheForInterface): Removed.
8195 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8196 to create a cache for an interface's "parent".
8198 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8201 2004-11-16 Martin Baulig <martin@ximian.com>
8203 Merged back from gmcs; these changes already went into gmcs a
8204 couple of weeks ago.
8207 (TypeManager.AddUserType): Removed the `ifaces' argument.
8208 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8210 (TypeManager.AddUserInterface): Removed.
8211 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8213 (TypeManager.GetInterfaces): Likewise.
8214 (TypeManager.GetExplicitInterfaces): Likewise.
8216 * ecore.cs (TypeExpr.GetInterfaces): Removed.
8218 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8219 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8221 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8223 * statement.cs: Avoid adding bools to a hashtable.
8225 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8227 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8228 calling an unsafe method from a safe location.
8230 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8233 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8235 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8237 * namespace.cs (VerifyUsing): use GetPartialName instead of
8240 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8242 * statement.cs (Return.Resolve): Fix regression in typo: if
8243 `in_exc', we have to request a NeedReturnLabel, this was a typo
8244 introduced in the anonymous method check-in. Fixes #69131.
8246 * Indexers were using the ShortName when defining themselves,
8247 causing a regression in the compiler bootstrap when applying the
8248 patch from 2004-11-02 (first part), now they use their full name
8249 and the bug is gone.
8251 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8253 * driver.cs: Strip the path from the names of embedded resources. Fixes
8256 2004-11-04 Raja R Harinath <rharinath@novell.com>
8258 Fix error message regression: cs0104-2.cs.
8259 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8260 (AliasEntry.Resolve): Update.
8261 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8263 (RootContext.LookupType): Update.
8265 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8267 * cs-parser.jay: Add support for handling accessor modifiers
8268 * class: Add support port accessor modifiers and error checking,
8269 define PropertyMethod.Define as virtual (not abstract anymore)
8270 * ecore.cs: Add checking for proeprties access with access modifiers
8271 * iterators.cs: Modify Accessor constructor call based in the modified
8273 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8275 * expression.cs (StringConcat): Handle being called twice,
8276 as when we have a concat in a field init with more than two
8279 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8281 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8282 special case explicit implementations, we should always produce
8283 the .property or .event declaration.
8285 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8286 since it will not return correct data if people use this
8287 unresolved in the presence of using statements (see test-313).
8289 * class.cs (MethodData.Define): If we are an explicit interface
8290 implementation, set the method name to the full name of the
8291 interface plus the name of the method.
8293 Notice that using the method.MethodName.GetFullName() does not
8294 work, as it will only contain the name as declared on the source
8295 file (it can be a shorthand in the presence of using statements)
8296 and not the fully qualifed type name, for example:
8300 class D : ICloneable {
8301 object ICloneable.Clone () {
8305 Would produce a method called `ICloneable.Clone' instead of
8306 `System.ICloneable.Clone'.
8308 * namespace.cs (Alias.Resolve): Use GetPartialName.
8310 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8312 * cs-parser.jay: Add error 1055 report.
8314 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8316 * assign.cs (Assign.DoResolve): Only do the transform of
8317 assignment into a New if the types are compatible, if not, fall
8318 through and let the implicit code deal with the errors and with
8319 the necessary conversions.
8321 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8323 * cs-parser.jay: Add error 1031 report.
8325 * cs-tokenizer.cs: Add location for error 1038.
8327 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8329 * cs-parser.jay: Add error 1016 report.
8331 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8333 * cs-parser.jay: Add errors 1575,1611 report.
8335 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8337 * cs-parser.jay: Add error 1001 report.
8339 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8342 * attribute.cs (GetMarshal): Add method argument for
8343 caller identification.
8345 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8346 agument for GetMarshal and RuntimeMissingSupport.
8348 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8350 * attribute.cs (ExtractSecurityPermissionSet): Removed
8351 TypeManager.code_access_permission_type.
8353 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8355 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8357 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8358 for obsolete use of a variable here. Fixes regression on errors
8359 cs0619-25 and cs0619-26.
8361 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8363 Fix #62358, implemented security attribute encoding.
8365 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8366 Tests permitted SecurityAction for assembly or other types.
8367 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8368 data from SecurityPermissionAttribute to PermisionSet class.
8370 * class.cs (ApplyAttributeBuilder): Added special handling
8371 for System.Security.Permissions.SecurityAttribute based types.
8373 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8374 special handling for System.Security.Permissions.SecurityAttribute
8377 * enum.cs (ApplyAttributeBuilder): Added special handling
8378 for System.Security.Permissions.SecurityAttribute based types.
8380 * parameter.cs (ApplyAttributeBuilder): Added special handling
8381 for System.Security.Permissions.SecurityAttribute based types.
8383 * rootcontext.cs: Next 2 core types.
8385 * typemanager.cs (TypeManager.security_permission_attr_type):
8386 Built in type for the SecurityPermission Attribute.
8387 (code_access_permission_type): Build in type.
8389 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8391 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8392 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8393 all of this information into
8394 EmitContext.EmitCapturedVariableInstance.
8396 * codegen.cs (EmitCapturedVariableInstance): move here the
8397 funcionality of emitting an ldarg.0 in the presence of a
8398 remapping. This centralizes the instance emit code.
8400 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8401 then emit a load of this: it means that we have reached the
8402 topmost ScopeInfo: the one that contains the pointer to the
8403 instance of the class hosting the anonymous method.
8405 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8406 captures to the topmost CaptureContext.
8408 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8410 * expression.cs (LocalVariableReference): Move the knowledge about
8411 the iterators into codegen's EmitCapturedVariableInstance.
8413 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8415 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8416 all code paths return a value from an anonymous method (it is the
8417 same as the 161 error, but for anonymous methods).
8419 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8421 The introduction of anonymous methods in the compiler changed
8422 various ways of doing things in the compiler. The most
8423 significant one is the hard split between the resolution phase
8424 and the emission phases of the compiler.
8426 For instance, routines that referenced local variables no
8427 longer can safely create temporary variables during the
8428 resolution phase: they must do so from the emission phase,
8429 since the variable might have been "captured", hence access to
8430 it can not be done with the local-variable operations from the runtime.
8434 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8435 is a toplevel block.
8437 (ToplevelBlock): A new kind of Block, these are the blocks that
8438 are created by the parser for all toplevel method bodies. These
8439 include methods, accessors and anonymous methods.
8441 These contain some extra information not found in regular blocks:
8442 A pointer to an optional CaptureContext (for tracking captured
8443 local variables and parameters). A pointer to the parent
8446 (Return.Resolve): Catch missmatches when returning a value from an
8447 anonymous method (error 1662).
8448 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8451 (Break.Resolve): ditto.
8453 (SwitchLabel): instead of defining the labels during the
8454 resolution phase, we now turned the public ILLabel and ILLabelCode
8455 labels into methods called GetILLabelCode() and GetILLabel() that
8456 only define the label during the Emit phase.
8458 (GotoCase): Track the SwitchLabel instead of the computed label
8459 (its contained therein). Emit the code by using
8460 SwitchLabel.GetILLabelCode ().
8462 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8463 whether the Local has been captured or not.
8465 (LocalInfo.IsCaptured): New property, used to tell whether the
8466 local has been captured.
8468 * anonymous.cs: Vastly updated to contain the anonymous method
8471 The main classes here are: CaptureContext which tracks any
8472 captured information for a toplevel block and ScopeInfo used to
8473 track the activation frames for various local variables.
8475 Each toplevel block has an optional capture context associated
8476 with it. When a method contains an anonymous method both the
8477 toplevel method and the anonymous method will create a capture
8478 context. When variables or parameters are captured, they are
8479 recorded on the CaptureContext that owns them, for example:
8483 MyDelegate d = delegate {
8488 Here `a' will be recorded as captured on the toplevel
8489 CapturedContext, the inner captured context will not have anything
8490 (it will only have data if local variables or parameters from it
8491 are captured in a nested anonymous method.
8493 The ScopeInfo is used to track the activation frames for local
8494 variables, for example:
8496 for (int i = 0; i < 10; i++)
8497 for (int j = 0; j < 10; j++){
8498 MyDelegate d = delegate {
8503 At runtime this captures a single captured variable `i', but it
8504 captures 10 different versions of the variable `j'. The variable
8505 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8506 recorded on a child.
8508 The toplevel ScopeInfo will also track information like the `this'
8509 pointer if instance variables were referenced (this is necessary
8510 as the anonymous method lives inside a nested class in the host
8511 type of the method).
8513 (AnonymousMethod): Expanded to track the Toplevel, implement
8514 `AnonymousMethod.Compatible' to tell whether an anonymous method
8515 can be converted to a target delegate type.
8517 The routine now also produces the anonymous method content
8519 (AnonymousDelegate): A helper class that derives from
8520 DelegateCreation, this is used to generate the code necessary to
8521 produce the delegate for the anonymous method that was created.
8523 * assign.cs: API adjustments for new changes in
8524 Convert.ImplicitStandardConversionExists.
8526 * class.cs: Adjustments to cope with the fact that now toplevel
8527 blocks are of type `ToplevelBlock'.
8529 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8530 insteda of standard blocks.
8532 Flag errors if params arguments are passed to anonymous methods.
8534 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8535 `CurrentAnonymousMethod' which points to the current Anonymous
8536 Method. The variable points to the AnonymousMethod class that
8537 holds the code being compiled. It is set in the new EmitContext
8538 created for the anonymous method.
8540 (EmitContext.Phase): Introduce a variable and an enumeration to
8541 assist in enforcing some rules about when and where we are allowed
8542 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8543 only one that enfonces this right now).
8545 (EmitContext.HaveCaptureInfo): new helper method that returns
8546 whether we have a CapturedContext initialized.
8548 (EmitContext.CaptureVariable): New method used to register that a
8549 LocalInfo must be flagged for capturing.
8551 (EmitContext.CapturedParameter): New method used to register that a
8552 parameters must be flagged for capturing.
8554 (EmitContext.CapturedField): New method used to register that a
8555 field must be flagged for capturing.
8557 (EmitContext.HaveCapturedVariables,
8558 EmitContext.HaveCapturedFields): Return whether there are captured
8559 variables or fields.
8561 (EmitContext.EmitMethodHostInstance): This is used to emit the
8562 instance for the anonymous method. The instance might be null
8563 (static methods), this (for anonymous methods that capture nothing
8564 and happen to live side-by-side with the current method body) or a
8565 more complicated expression if the method has a CaptureContext.
8567 (EmitContext.EmitTopBlock): Routine that drives the emission of
8568 code: it will first resolve the top block, then emit any metadata
8569 and then emit the code. The split is done so that we can extract
8570 any anonymous methods and flag any captured variables/parameters.
8572 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8573 during this phase, the ILGenerator should not be used as labels
8574 and local variables declared here might not be accessible to any
8575 code that is part of an anonymous method.
8577 Exceptions to this include the temporary variables that are
8578 created by some statements internally for holding temporary
8581 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8584 (EmitContext.TemporaryReturn): This method is typically called
8585 from the Emit phase, and its the only place where we allow the
8586 ReturnLabel to be defined other than the EmitMeta. The reason is
8587 that otherwise we would have to duplicate a lot of logic in the
8588 Resolve phases of various methods that today is on the Emit
8591 (EmitContext.NeedReturnLabel): This no longer creates the label,
8592 as the ILGenerator is not valid during the resolve phase.
8594 (EmitContext.EmitThis): Extended the knowledge in this class to
8595 work in anonymous methods in addition to iterators.
8597 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8598 code is necessary on the stack to access the instance to a local
8599 variable (the variable will be accessed as a field).
8601 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8602 EmitContext.EmitAddressOfParameter): Routines to support
8603 parameters (not completed at this point).
8605 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8606 will also remove the parameters.
8608 * convert.cs (Convert): Define a `ConstantEC' which points to a
8609 null. This is just to prefity some code that uses
8610 ImplicitStandardConversion code and do not have an EmitContext
8613 The idea is to flag explicitly that at that point in time, it is
8614 known that the conversion will not trigger the delegate checking
8615 code in implicit conversions (which requires a valid
8618 Everywhere: pass new EmitContext parameter since
8619 ImplicitStandardConversionExists now requires it to check for
8620 anonymous method conversions.
8622 (Convert.ImplicitStandardConversionExists): If the type of an
8623 expression is the anonymous_method_type, and the type is a
8624 delegate, we invoke the AnonymousMethod.Compatible method to check
8625 whether an implicit conversion is possible.
8627 (Convert.ImplicitConversionStandard): Only do implicit method
8628 group conversions if the language level is not ISO_1.
8630 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8631 MethodInfo for the Invoke method. used by Delegate and
8634 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8635 method conversions if the target type is a delegate.
8637 Removed extra debugging nops.
8639 (LocalVariableReference): Turn the `local_info' into a public
8642 Add `prepared' field, the same hack used for FieldExprs to cope
8643 with composed assignments, as Local variables do not necessarily
8644 operate purely on the stack as they used to: they can be captured
8647 Add `temp' for a temporary result, like fields.
8649 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8651 It now copes with Local variables that are captured and emits the
8652 proper instance variable to load it from a field in the captured
8655 (ParameterReference.DoResolveBase): During the resolve phase,
8656 capture parameters if we are in an anonymous method.
8658 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8659 anonymous method, use the EmitContext helper routines to emit the
8660 parameter reference.
8662 * iterators.cs: Set RemapToProxy to true/false during the
8665 * parameters.cs (GetParameterByName): New helper method.
8667 * typemanager.cs (anonymous_method_type) a new type that
8668 represents an anonyous method. This is always an internal type,
8669 used as a fencepost to test against the anonymous-methodness of an
8672 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8674 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8676 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8678 2004-10-18 Martin Baulig <martin@ximian.com>
8680 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8681 `Type' directly, but call ResolveType() on it.
8682 (Catch.Resolve): Likewise.
8683 (Foreach.Resolve): Likewise.
8685 2004-10-18 Martin Baulig <martin@ximian.com>
8687 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8688 `Type' directly, but call ResolveType() on it.
8689 (Probe.DoResolve): Likewise.
8690 (ArrayCreation.LookupType): Likewise.
8691 (TypeOf.DoResolve): Likewise.
8692 (SizeOf.DoResolve): Likewise.
8694 2004-10-18 Martin Baulig <martin@ximian.com>
8696 * expression.cs (Invocation.BetterFunction): Put back
8697 TypeManager.TypeToCoreType().
8699 2004-10-18 Raja R Harinath <rharinath@novell.com>
8701 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8704 2004-10-18 Martin Baulig <martin@ximian.com>
8706 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
8707 `Type' directly, but call ResolveType() on it.
8709 2004-10-18 Martin Baulig <martin@ximian.com>
8711 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8712 `Type' directly, but call ResolveType() on it.
8713 (MemberBase.DoDefine): Likewise.
8715 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8716 `Type' directly, but call ResolveType() on it.
8717 (ComposedCast.DoResolveAsTypeStep): Likewise.
8719 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8720 `Type' directly, but call ResolveType() on it.
8722 2004-10-17 John Luke <john.luke@gmail.com>
8724 * class.cs (Operator.GetSignatureForError): use CSharpName
8726 * parameter.cs (Parameter.GetSignatureForError): Returns
8727 correct name even if was not defined.
8729 2004-10-13 Raja R Harinath <rharinath@novell.com>
8732 * class.cs (TypeContainer.EmitContext): New property.
8733 (DefineNestedTypes): Create an emitcontext for each part.
8734 (MethodCore.DoDefineParameters): Use container's emitcontext.
8735 Pass type array to InternalParameters.
8736 (MemberBase.DoDefine): Use container's emitcontext.
8737 (FieldMember.Define): Likewise.
8738 (Event.Define): Likewise.
8739 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8740 Pass type array to InternalParameters.
8741 (SetIndexerMethod.GetParameterInfo): Likewise.
8742 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8743 * delegate.cs (Define): Pass emitcontext to
8744 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8745 array to InternalParameters.
8746 * expression.cs (ParameterReference.DoResolveBase): Pass
8747 emitcontext to GetParameterInfo.
8748 (ComposedCast.DoResolveAsTypeStep): Remove check on
8749 ec.ResolvingTypeTree.
8750 * parameter.cs (Parameter.Resolve): Change argument to
8751 EmitContext. Use ResolveAsTypeTerminal.
8752 (Parameter.GetSignature): Change argument to EmitContext.
8753 (Parameters.ComputeSignature): Likewise.
8754 (Parameters.ComputeParameterTypes): Likewise.
8755 (Parameters.GetParameterInfo): Likewise.
8756 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8757 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8758 * support.cs (InternalParameters..ctor): Remove variant that takes
8760 * typemanager.cs (system_intptr_expr): New.
8761 (InitExpressionTypes): Initialize it.
8763 2004-10-12 Chris Toshok <toshok@ximian.com>
8765 * cs-parser.jay: fix location for try_statement and catch_clause.
8767 2004-10-11 Martin Baulig <martin@ximian.com>
8769 * report.cs: Don't make --fatal abort on warnings, we have
8770 -warnaserror for that.
8772 2004-10-07 Raja R Harinath <rharinath@novell.com>
8774 More DeclSpace.ResolveType avoidance.
8775 * decl.cs (MemberCore.InUnsafe): New property.
8776 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8777 with newly created EmitContext.
8778 (FieldMember.Define): Likewise.
8779 * delegate.cs (Delegate.Define): Likewise.
8780 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8781 only if normal name-lookup fails.
8782 (TypeExpr.DoResolve): Enable error-checking.
8783 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8784 (SizeOf.DoResolve): Likewise.
8785 (ComposedCast.DoResolveAsTypeStep): Likewise.
8786 (StackAlloc.DoResolve): Likewise.
8787 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8788 (Block.Unsafe): New property.
8789 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8790 (Unsafe): Set 'unsafe' flag of contained block.
8791 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8792 (Fixed.Resolve): Likewise.
8793 (Catch.Resolve): Likewise.
8794 (Using.ResolveLocalVariableDecls): Likewise.
8795 (Foreach.Resolve): Likewise.
8797 2004-10-05 John Luke <john.luke@gmail.com>
8799 * cs-parser.jay: add location to error CS0175
8801 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8803 * ecore.cs (Expression.Constantity): Add support for turning null
8806 * const.cs (Const.Define): Allow constants to be reference types
8807 as long as the value is Null.
8809 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8811 * namespace.cs (NamespaceEntry.Using): No matter which warning
8812 level is set, check if this namespace name has already been added.
8814 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8816 * expression.cs: reftype [!=]= null should always use br[true,false].
8819 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8822 * attribute.cs: Enum conversion moved to
8823 GetAttributeArgumentExpression to be applied to the all
8826 2004-10-01 Raja R Harinath <rharinath@novell.com>
8828 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8829 * class.c (TypeContainer.DefineType): Flag error if
8830 base types aren't accessible due to access permissions.
8831 * decl.cs (DeclSpace.ResolveType): Move logic to
8832 Expression.ResolveAsTypeTerminal.
8833 (DeclSpace.ResolveTypeExpr): Thin layer over
8834 Expression.ResolveAsTypeTerminal.
8835 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8836 Refactor code into NestedAccess. Use it.
8837 (DeclSpace.NestedAccess): New.
8838 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8839 argument to silence errors. Check access permissions.
8840 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8841 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8842 (Cast.DoResolve): Likewise.
8843 (New.DoResolve): Likewise.
8844 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8845 (TypeOf.DoResolve): Likewise.
8847 * expression.cs (Invocation.BetterConversion): Return the Type of
8848 the better conversion. Implement section 14.4.2.3 more faithfully.
8849 (Invocation.BetterFunction): Make boolean. Make correspondence to
8850 section 14.4.2.2 explicit.
8851 (Invocation.OverloadResolve): Update.
8852 (Invocation): Remove is_base field.
8853 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8854 (Invocation.Emit): Likewise.
8856 2004-09-27 Raja R Harinath <rharinath@novell.com>
8858 * README: Update to changes.
8860 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8862 * cs-parser.jay: Reverted 642 warning fix.
8864 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8867 * decl.cs (FindMemberWithSameName): Indexer can have more than
8870 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8872 * expression.cs (LocalVariableReference.DoResolveLValue):
8873 Do not report warning 219 for out values.
8874 (EmptyExpression.Null): New member to avoid extra allocations.
8876 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8878 * cs-parser.jay: Fix wrong warning 642 report.
8880 * cs-tokenizer.cs (CheckNextToken): New helper;
8881 Inspect next character if is same as expected.
8883 2004-09-23 Martin Baulig <martin@ximian.com>
8885 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8886 (Convert.ImplicitReferenceConversionExists): Likewise.
8888 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8890 * class.cs (Operator.Define): Add error 448 and 559 report.
8892 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8894 * class.cs (MemberBase.IsTypePermitted): New protected
8895 method for checking error CS0610.
8897 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8899 * class.cs (TypeContainer.HasExplicitLayout): New property
8900 Returns whether container has StructLayout attribute set Explicit.
8901 (FieldMember): New abstract class for consts and fields.
8902 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8903 (Field): Reuse FieldMember.
8905 * const.cs (Const): Reuse FieldMember.
8907 * rootcontext.cs: EmitConstants call moved to class.
8909 2004-09-22 Martin Baulig <martin@ximian.com>
8911 Thanks to Peter Sestoft for this bug report.
8913 * expression.cs (Conditional): If both the `trueExpr' and the
8914 `falseExpr' is a NullLiteral, return a NullLiteral.
8916 2004-09-22 Martin Baulig <martin@ximian.com>
8918 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8919 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8920 for the "get_Current" call.
8922 2004-09-22 Martin Baulig <martin@ximian.com>
8924 Marek and me just fixed one of our oldest bugs: #28562 :-)
8926 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8928 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8929 we're an EnumConstant, just return that.
8930 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8931 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8932 to get the value which'll actually be written into the attribute.
8933 However, we have to use GetValue() to access the attribute's value
8936 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8938 * constant.cs (Constant.IsNegative): New abstract property
8941 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8942 (StackAlloc.DoResolve): Reused IsNegative.
8944 2004-09-21 Martin Baulig <martin@ximian.com>
8946 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8947 if we're used in an iterator, we may be called from different
8950 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8951 we actually have an exception block.
8953 2004-09-20 John Luke <jluke@cfl.rr.com>
8955 * class.cs, cs-parser.jay: Improve the error report for 1520:
8956 report the actual line where the error happens, not where the
8959 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8960 Pass location information that was available elsewhere.
8962 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8964 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8965 runtime to delay sign assemblies.
8967 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8969 * cs-parser.jay: Do not report the stack trace, this is barely
8972 2004-08-22 John Luke <john.luke@gmail.com>
8974 * driver.cs : check that a resource id is not already used
8975 before adding it, report CS1508 if it is, bug #63637
8977 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8979 * ecore.cs: Removed dead code.
8981 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8983 * class.cs: Do not report warning CS0067 on the interfaces.
8985 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8987 * cs-parser.jay: Add error 504 report.
8989 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8991 * rootcontext.cs: WarningLevel is 4 by default now.
8993 * statement.cs (Fixed.Resolve): Do not null
8996 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8999 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9000 deep search when property is not virtual.
9001 (PropertyExpr.ResolveAccessors): Make one call for both
9004 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9007 * statement.cs: Error 152 report constains also location.
9009 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9012 * const.cs: Explicitly set constant as static.
9014 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9017 * cs-parser.jay: Add error 1017 report.
9019 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9021 Fixed bug #59980, #64224
9022 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9024 * typemanager.cs (IsSpecialMethod): Simplified
9026 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9028 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9029 condition with better params.
9031 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9034 * attribute.cs (Resolve): Property has to have both
9037 2004-09-14 Martin Baulig <martin@ximian.com>
9039 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9041 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9044 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9045 called and is obsolete then this member suppress message
9046 when call is inside next [Obsolete] method or type.
9048 * expression.cs: Use TestObsoleteMethodUsage member.
9050 2004-09-14 Martin Baulig <martin@ximian.com>
9052 * cs-parser.jay: Sync a bit with the GMCS version.
9054 2004-09-14 Martin Baulig <martin@ximian.com>
9056 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9057 (CSharpParser.yacc_verbose_flag): New public field.
9059 * genericparser.cs: Removed.
9061 2004-09-14 Raja R Harinath <rharinath@novell.com>
9063 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9065 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9067 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9069 2004-09-10 Martin Baulig <martin@ximian.com>
9071 Backported my MemberName changes from GMCS into MCS.
9073 - we are now using a special `MemberName' class instead of using
9074 strings; in GMCS, the `MemberName' also contains the type
9077 - changed the grammar rules a bit:
9078 * the old `member_name' is now a `namespace_or_type_name':
9079 The rule is that we use `namespace_or_type_name' everywhere
9080 where we expect either a "member name" (GetEnumerator) or a
9081 "member name" with an explicit interface name
9082 (IEnumerable.GetEnumerator).
9083 In GMCS, the explicit interface name may include type arguments
9084 (IEnumerable<T>.GetEnumerator).
9085 * we use `member_name' instead of just `IDENTIFIER' for
9087 The rule is that we use `member_name' wherever a member may
9088 have type parameters in GMCS.
9090 * decl.cs (MemberName): New public class.
9091 (MemberCore.MemberName): New public readonly field.
9092 (MemberCore.ctor): Take a `MemberName' argument, not a string.
9093 (DeclSpace): Likewise.
9095 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9096 * enum.cs (Enum.ctor): Likewise.
9098 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9100 (AliasEntry.ctor): Take a MemberName, not an Expression.
9101 (AliasEntry.UsingAlias): Likewise.
9103 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9104 (IMethodData.MemberName): Changed type from string to MemberName.
9105 (MemberBase.ExplicitInterfaceName): Likewise.
9106 (AbstractPropertyEventMethod.SetupName): Make this private.
9107 (AbstractPropertyEventMethod.ctor): Added `string prefix'
9108 argument; compute the member name here.
9109 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9110 on the `member.MemberName' and the `prefix'.
9112 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9114 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9115 thus, we get a `MemberName' instead of a `string'. These
9116 declarations may have type parameters in GMCS.
9117 (interface_method_declaration, delegate_declaration): Likewise.
9118 (class_declaration, interface_declaration): Likewise.
9119 (method_header): Use `namespace_or_type_name' instead of
9120 `member_name'. We may be an explicit interface implementation.
9121 (property_declaration, event_declaration): Likewise.
9122 (member_name): This is now just an `IDENTIFIER', not a
9123 `namespace_or_type_name'.
9124 (type_name, interface_type): Removed.
9125 (namespace_or_type_name): Return a MemberName, not an Expression.
9126 (primary_expression): Use `member_name' instead of `IDENTIFIER';
9127 call GetTypeExpression() on the MemberName to get an expression.
9128 (IndexerDeclaration.interface_type): Changed type from string to
9130 (MakeName): Operate on MemberName's instead of string's.
9132 2004-09-13 Raja R Harinath <rharinath@novell.com>
9135 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9136 (NamespaceEntry.Lookup): Add new argument to flag if we want the
9137 lookup to avoid symbols introduced by 'using'.
9138 * rootcontext.cs (NamespaceLookup): Update.
9140 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9142 * class.cs (TypeContainer.DoDefineMembers): Do not call
9143 DefineDefaultConstructor for static classes.
9145 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9147 * attribute.cs (Attribute.Resolve): Add error 653 report.
9149 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9151 (Method.ApplyAttributeBuilder): Add error 685 report.
9152 (Operator.Define): Add error 564 report.
9154 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9156 * expression.cs (Invocation.DoResolve): Add error
9159 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9162 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9164 * class.cs (ConstructorInitializer.Resolve):
9165 Wrong error number (515->516).
9167 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9169 * class.cs (Indexer.Define): Add error 631 report.
9171 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9173 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9175 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9177 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9179 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9181 * cs-parser.jay: Added error CS0241 report.
9183 2004-09-10 Raja R Harinath <rharinath@novell.com>
9185 * cs-parser.jay (fixed_statement): Introduce a scope for the
9186 declaration in the 'fixed' statement.
9188 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9190 * cs-parser.jay: Added CS0230 error report.
9192 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9194 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9196 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9198 * expression.cs (Argument.Resolve): Added error CS0192 and
9201 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9203 C# 2.0 #pragma warning feature
9205 * cs-tokenizer.cs (PreProcessPragma): New method;
9206 Handles #pragma directive.
9208 * report.cs (WarningRegions): New class; Support
9209 class for #pragma warning directive. It tests whether
9210 warning is enabled for a given line.
9212 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9214 * const.cs: Add more descriptive error report, tahnks to
9217 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9219 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9221 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9223 * expression.cs: Apply patch from Ben: Remove dead code from
9224 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9225 as that code just threw an exception anwyays.
9227 * const.cs: Remove the call to the turnintoconstant, for details
9230 * literal.cs: The type of the null-literal is the null type; So
9231 we use a placeholder type (literal.cs:System.Null, defined here)
9234 * expression.cs (Conditional.DoResolve): Remove some old code that
9235 is no longer needed, conversions have been fixed.
9237 (ArrayCreationExpression.DoResolve): Return false if we fail to
9238 resolve the inner expression.
9240 2004-09-07 Raja R Harinath <rharinath@novell.com>
9243 * cs-parser.jay (delegate_declaration): Record a delegate
9244 declaration as a type declaration.
9245 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9247 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9249 * parameter.cs: Do not crash if the type can not be resolved.
9251 * expression.cs: Report errors with unsafe pointers, fixes #64896
9253 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9255 * expression.cs: Pointer arith always needs to do a conv.i
9256 if the operand is a long. fix 65320
9258 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9260 Fixed cs0619-37.cs, cs0619-38.cs
9262 * enum.cs (GetObsoleteAttribute): Removed.
9264 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9265 on Enum member is double staged. The first is tested member
9268 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9270 Fixed #56986, #63631, #65231
9272 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9273 adds member to name container.
9274 (TypeContainer.AddToTypeContainer): New method, adds type to
9276 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9277 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9278 AddOperator): Simplified by reusing AddToMemberContainer.
9279 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9281 (Method.CheckForDuplications): Fixed implementation to test all
9283 (MemberBase): Detection whether member is explicit interface
9284 implementation is now in constructor.
9285 (MemberBase.UpdateMemberName): Handles IndexerName.
9286 (Accessor): Changed to keep also location information.
9287 (AbstractPropertyEventMethod): Is derived from MemberCore.
9288 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9289 will be emited or not.
9290 (PropertyBase.AreAccessorsDuplicateImplementation):
9291 Tests whether accessors are not in collision with some method.
9292 (Operator): Is derived from MethodCore to simplify common
9295 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9297 (DeclSpace.AddToContainer): Adds the member to defined_names
9298 table. It tests for duplications and enclosing name conflicts.
9300 * enum.cs (EnumMember): Clean up to reuse the base structures
9302 2004-09-03 Martin Baulig <martin@ximian.com>
9304 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9305 into TypeContainer, to make partial classes work again.
9307 2004-09-03 Martin Baulig <martin@ximian.com>
9309 * rootcontext.cs (RootContext.V2): Removed.
9311 2004-03-23 Martin Baulig <martin@ximian.com>
9313 * expression.cs (Invocation.OverloadResolve): Added `bool
9314 may_fail' argument and use it instead of the Location.IsNull() hack.
9316 2004-09-03 Martin Baulig <martin@ximian.com>
9318 Merged latest changes into gmcs. Please keep this comment in
9319 here, it makes it easier for me to see what changed in MCS since
9320 the last time I merged.
9322 2004-09-03 Raja R Harinath <rharinath@novell.com>
9325 * expression.cs (BetterConversion): Don't allow either conversion
9326 to be null. Remove redundant implicit conversion test when 'q ==
9327 null' -- when this function is invoked, we already know that the
9328 implicit conversion exists.
9329 (BetterFunction): Assume that 'best' is non-null. Remove
9330 redundant reimplementation of IsApplicable when 'best' is null.
9331 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9332 number of arguments.
9333 (IsAncestralType): Extract from OverloadResolve.
9334 (OverloadResolve): Make robust to the MethodGroupExpr being
9335 unsorted. Implement all the logic of Section 14.5.5.1, and
9336 support overloading of methods from multiple applicable types.
9337 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9339 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9340 (RealError, Warning): Append type of report to related symbol.
9342 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9344 * enum.cs: Fixed CLS-Compliance checks for enum members.
9345 Error tests cs3008-8.cs, cs3014-8.cs
9347 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9349 Fixed bug #62342, #63102
9350 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9351 like ImplementMethod.
9353 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9355 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9358 2004-09-02 Martin Baulig <martin@ximian.com>
9360 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9361 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9364 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9366 C# 2.0 Static classes implemented
9368 * class.cs (TypeContainer): instance_constructors,
9369 initialized_fields, initialized_static_fields,
9370 default_constructor, base_inteface_types are protected to be
9371 accessible from StaticClass.
9372 (TypeContainer.DefineDefaultConstructor): New virtual method
9373 for custom default constructor generating
9374 (StaticClass): New class to handle "Static classes" feature.
9376 * cs-parser.jay: Handle static keyword on class like instance
9379 * driver.cs: Added "/langversion" command line switch with two
9380 options (iso-1, default).
9382 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9384 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9386 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9388 * delegate.cs: Style.
9390 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9392 * delegate.cs: Add seperate instance expr field for miguel.
9394 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9396 * PointerArithmetic (Resolve): make sure we are not doing
9397 pointer arith on void*. Also, make sure we are resolved
9398 by not setting eclass until resolve.
9400 All callers: Make sure that PointerArithmetic gets resolved.
9402 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9404 * ArrayCreation (LookupType): If the type does not resolve
9405 to an array, give an error.
9407 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9409 * statement.cs (Try.Resolve): Fixed bug #64222
9411 2004-08-27 Martin Baulig <martin@ximian.com>
9414 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9417 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9419 * ecore.cs (Constantify): Get underlying type via
9420 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9421 Windows in special cases.
9423 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9425 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9426 for obtaining also private methods.
9427 (GetRemoveMethod): Used GetRemoveMethod (true)
9428 for obtaining also private methods.
9430 2004-08-24 Martin Baulig <martin@ximian.com>
9432 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9433 MethodAttributes.HideBySig for operators.
9435 2004-08-23 Martin Baulig <martin@ximian.com>
9437 Back to the old error reporting system :-)
9439 * report.cs (Message): Removed.
9440 (Report.MessageData, ErrorData, WarningData): Removed.
9441 (Report.Error, Warning): Back to the old system.
9443 2004-08-23 Martin Baulig <martin@ximian.com>
9445 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9447 * class.cs (TypeContainer.ParentContainer): New public virtual
9448 method; replaces the explicit interface implementation.
9449 (ClassPart.ParentContainer): Override.
9451 2004-08-23 Martin Baulig <martin@ximian.com>
9453 * statement.cs (Switch): Added support for constant switches; see
9454 #59428 or test-285.cs.
9456 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9459 * statement.cs (GetEnumeratorFilter): Removed useless
9460 logic because C# specs is strict. GetEnumerator must be
9463 2004-08-22 Martin Baulig <martin@ximian.com>
9465 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9466 a switch and may break, reset the barrier. Fixes #59867.
9468 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9470 CLS-Compliance speed up (~5% for corlib)
9472 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9473 New method. Tests container for CLS-Compliant names
9475 * class.cs (TypeContainer.VerifyClsName): New method.
9476 Checks whether container name is CLS Compliant.
9477 (Constructor): Implements IMethodData.
9479 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9480 low-case table for CLS Compliance test.
9481 (MemberCache.VerifyClsParameterConflict): New method.
9482 Checks method parameters for CS3006 error.
9484 * enum.cs (EnumMember): Is derived from MemberCore.
9485 (Enum.VerifyClsName): Optimized for better performance.
9487 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9489 * report.cs: Renamed Error_T to Error and changed all
9492 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9494 * class.cs (TypeContainer.IndexerArrayList): New inner class
9495 container for indexers.
9496 (TypeContainer.DefaultIndexerName): New constant for default
9497 indexer name. Replaced all "Item" with this constant.
9498 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9500 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9501 DefaultMemberAttribute constructor.
9503 2004-08-05 Martin Baulig <martin@ximian.com>
9505 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9508 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9510 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9511 multi platforms problem.
9513 * compiler.csproj: Included shared files.
9515 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9517 Fix bug 60333, 55971 in the more general way
9518 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9519 Added arg_type argument for constant conversion.
9520 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9522 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9525 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9526 OperatorArrayList, MethodCoreArrayList for typecontainer
9527 containers. Changed class member types to these new types.
9528 (MethodArrayList.DefineMembers): Added test for CS0659.
9530 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9532 * cfold.cs: Synchronize the folding with the code in expression.cs
9533 Binary.DoNumericPromotions for uint operands.
9535 * attribute.cs: Revert patch from Raja, it introduced a regression
9536 while building Blam-1.2.1 (hard to isolate a test case).
9538 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9542 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9544 (MethodCore.parent_method): New member. The method we're overriding
9545 if this is an override method.
9546 (MethodCore.CheckBase): Moved from Method class and made common.
9547 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9549 (MethodCore.CheckForDuplications): New abstract method. For custom
9550 member duplication search in a container
9551 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9552 method and its return type.
9553 (Event.conflict_symbol): New member. Symbol with same name in the
9557 (MemberCache.FindMemberWithSameName): New method. The method
9558 is looking for conflict with inherited symbols.
9560 2004-08-04 Martin Baulig <martin@ximian.com>
9562 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9564 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9566 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9568 * report.cs (Message): New enum for better error, warning reference in
9570 (MessageData): New inner abstract class. It generally handles printing of
9571 error and warning messages.
9572 Removed unused Error, Warning, Message methods.
9574 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9576 Fix for cs0592-8.cs test
9578 (Attributable.ValidAttributeTargets): Made public.
9579 (Attribute.ExplicitTarget): New member for explicit target value.
9580 (Attribute.CheckTargets): Now we translate explicit attribute
9581 target to Target here.
9583 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9585 * ecore.cs (MethodGroupExpr): new IsBase property.
9587 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9589 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9590 rather than an instance expr.
9592 (DelegateCreation.Emit): Use the method group rather than
9593 the instance expression. Also, if you have base.Foo as the
9594 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9596 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9598 (NewDelegate.DoResolve): Only check for the existance of Invoke
9599 if the method is going to be needed. Use MethodGroupExpr.
9601 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9603 * expression.cs: For pointer arith., make sure to use
9604 the size of the type, not the size of the pointer to
9607 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9610 * class.cs (Class): Added error CS0502 test.
9612 2004-08-03 John Luke <jluke@cfl.rr.com>
9613 Raja R Harinath <rharinath@novell.com>
9616 * attribute.cs (Attribute.complained_before): New flag.
9617 (Attribute.ResolveType, Attribute.Resolve),
9618 (Attribute.DefinePInvokeMethod): Set it.
9619 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9621 2004-08-03 Martin Baulig <martin@ximian.com>
9623 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9624 use a user-defined operator; we still need to do numeric
9625 promotions in case one argument is a builtin type and the other
9626 one has an implicit conversion to that type. Fixes #62322.
9628 2004-08-02 Martin Baulig <martin@ximian.com>
9630 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9631 (LocalInfo.IsThis): New public property.
9632 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9634 2004-08-01 Martin Baulig <martin@ximian.com>
9636 * class.cs (TypeContainer.GetClassBases): Don't set the default
9637 here since we may get called from GetPartialBases().
9638 (TypeContainer.DefineType): If GetClassBases() didn't return a
9639 parent, use the default one.
9641 2004-07-30 Duncan Mak <duncan@ximian.com>
9643 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9645 2004-07-30 Martin Baulig <martin@ximian.com>
9647 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9649 * class.cs (SourceMethod): New public class, derive from the
9650 symbol writer's ISourceMethod.
9651 (Method): Use the new symbol writer API.
9653 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9654 as argument and use the new symbol writer.
9657 (SourceFile): Implement the symbol writer's ISourceFile.
9658 (Location.SymbolDocument): Removed.
9659 (Location.SourceFile): New public property.
9661 * symbolwriter.cs: Use the new symbol writer API.
9663 2004-07-30 Raja R Harinath <rharinath@novell.com>
9665 * Makefile (install-local): Remove. Functionality moved to
9668 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9670 * Makefile: Install mcs.exe.config file together with mcs.exe.
9671 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9672 correct runtime version.
9674 2004-07-25 Martin Baulig <martin@ximian.com>
9677 (TypeContainer.RegisterOrder): Removed, this was unused.
9678 (TypeContainer, interface_order): Removed.
9679 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9680 TypeContainer as argument since we can also be called with a
9681 `PartialContainer' for a partial class/struct/interface.
9682 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9683 of checking whether we're an `Interface' - we could be a
9685 (PartialContainer.Register): Override; call
9686 AddClass()/AddStruct()/AddInterface() on our parent.
9688 * cs-parser.jay (interface_member_declaration): Add things to the
9689 `current_container', not the `current_class'.
9691 * rootcontext.cs (RegisterOrder): The overloaded version which
9692 takes an `Interface' was unused, removed.
9694 * typemanager.cs (TypeManager.LookupInterface): Return a
9695 `TypeContainer', not an `Interface'.
9696 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9697 contain a `PartialContainer' for an interface, so check it's
9698 `Kind' to figure out what it is.
9700 2004-07-25 Martin Baulig <martin@ximian.com>
9702 * class.cs (Class.DefaultTypeAttributes): New public constant.
9703 (Struct.DefaultTypeAttributes): Likewise.
9704 (Interface.DefaultTypeAttributes): Likewise.
9705 (PartialContainer.TypeAttr): Override this and add the
9706 DefaultTypeAttributes.
9708 2004-07-25 Martin Baulig <martin@ximian.com>
9710 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9711 we can just use the `Parent' field instead.
9713 2004-07-25 Martin Baulig <martin@ximian.com>
9715 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9717 2004-07-25 Martin Baulig <martin@ximian.com>
9719 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9720 our parts before defining any methods.
9721 (TypeContainer.VerifyImplements): Make this virtual.
9722 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9723 on our PartialContainer.
9725 2004-07-25 Martin Baulig <martin@ximian.com>
9727 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9729 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9730 argument, we can just use the `Parent' field instead.
9733 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9734 (MemberBase.DoDefine): Likewise.
9736 2004-07-24 Martin Baulig <martin@ximian.com>
9738 * decl.cs (MemberCore.Parent): New public field.
9739 (DeclSpace.Parent): Moved to MemberCore.
9741 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9742 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9744 (FieldBase, Field, Operator): Likewise.
9745 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9746 (EventField, Event): Likewise.
9748 2004-07-23 Martin Baulig <martin@ximian.com>
9750 * class.cs (PartialContainer): New public class.
9751 (ClassPart): New public class.
9752 (TypeContainer): Added support for partial classes.
9753 (TypeContainer.GetClassBases): Splitted some of the functionality
9754 out into GetNormalBases() and GetPartialBases().
9756 * cs-tokenizer.cs (Token.PARTIAL): New token.
9757 (Tokenizer.consume_identifier): Added some hacks to recognize
9758 `partial', but only if it's immediately followed by `class',
9759 `struct' or `interface'.
9761 * cs-parser.jay: Added support for partial clases.
9763 2004-07-23 Martin Baulig <martin@ximian.com>
9765 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9766 a `DeclSpace' and also made it readonly.
9767 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9768 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9769 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9771 * cs-parser.jay: Pass the `current_class', not the
9772 `current_container' (at the moment, this is still the same thing)
9773 to a new Method, Property, Event, Indexer or Constructor.
9775 2004-07-23 Martin Baulig <martin@ximian.com>
9777 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9778 and removed the `current_interface' one.
9779 (struct_declaration, class_declaration, interface_declaration):
9780 Set `current_class' to the newly created class/struct/interface;
9781 set their `Bases' and call Register() before parsing their body.
9783 2004-07-23 Martin Baulig <martin@ximian.com>
9785 * class.cs (Kind): New public enum.
9786 (TypeContainer): Made this class abstract.
9787 (TypeContainer.Kind): New public readonly field.
9788 (TypeContainer.CheckDef): New public method; moved here from
9790 (TypeContainer.Register): New public abstract method.
9791 (TypeContainer.GetPendingImplementations): New public abstract
9793 (TypeContainer.GetClassBases): Removed the `is_class' and
9794 `is_iface' parameters.
9795 (TypeContainer.DefineNestedTypes): Formerly known as
9797 (ClassOrStruct): Made this class abstract.
9799 * tree.cs (RootTypes): New public type.
9801 2004-07-20 Martin Baulig <martin@ximian.com>
9803 * tree.cs (Tree.RecordNamespace): Removed.
9804 (Tree.Namespaces): Removed.
9806 * rootcontext.cs (RootContext.IsNamespace): Removed.
9808 * cs-parser.jay (namespace_declaration): Just create a new
9809 NamespaceEntry here.
9811 2004-07-20 Martin Baulig <martin@ximian.com>
9813 * statement.cs (ExceptionStatement): New abstract class. This is
9814 now used as a base class for everyone who's using `finally'.
9815 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9816 our local variables before using them.
9818 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9819 virtual method. This is used by Yield.Resolve() to "steal" an
9820 outer block's `finally' clauses.
9821 (FlowBranchingException): The .ctor now takes an ExceptionStatement
9824 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9825 version which takes an ExceptionStatement. This version must be
9826 used to create exception branchings.
9829 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9830 (Iterator.EmitMoveNext): Added exception support; protect the
9831 block with a `fault' clause, properly handle 'finally' clauses.
9832 (Iterator.EmitDispose): Run all the `finally' clauses here.
9834 2004-07-20 Martin Baulig <martin@ximian.com>
9836 * iterator.cs: This is the first of a set of changes in the
9837 iterator code. Match the spec more closely: if we're an
9838 IEnumerable, then GetEnumerator() must be called. The first time
9839 GetEnumerator() is called, it returns the current instance; all
9840 subsequent invocations (if any) must create a copy.
9842 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9844 * expression.cs: Resolve the constant expression before returning
9847 2004-07-19 Martin Baulig <martin@ximian.com>
9849 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9850 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9851 the return type of the new EmitContext.
9853 2004-07-18 Martin Baulig <martin@ximian.com>
9855 * class.cs (Property.Define): Fix iterators.
9857 * iterators.cs (Iterator.Define): Moved the
9858 `container.AddInterator (this)' call here from the .ctor; only do
9859 it if we resolved successfully.
9861 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9863 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9864 `true' for preprocessing directives that we parse. The return
9865 value indicates whether we should return to regular tokenizing or
9866 not, not whether it was parsed successfully.
9868 In the past if we were in: #if false ... #line #endif, we would
9869 resume parsing after `#line'. See bug 61604.
9871 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9872 building: IsEnumType should return true only for enums, not for
9873 enums or System.Enum itself. This fixes #61593.
9875 Likely what happened is that corlib was wrong: mcs depended on
9876 this bug in some places. The bug got fixed, we had to add the
9877 hack, which caused bug 61593.
9879 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9880 that was a workaround for the older conditions.
9882 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9884 * assign.cs: IAssignMethod has a new interface, as documented
9885 inline. All assignment code now uses this new api.
9887 * ecore.cs, expression.cs: All classes which implement
9888 IAssignMethod now use the new interface.
9890 * expression.cs (Invocation): add a hack to EmitCall so that
9891 IndexerAccess can be the target of a compound assignment without
9892 evaluating its arguments twice.
9894 * statement.cs: Handle changes in Invocation api.
9896 2004-07-16 Martin Baulig <martin@ximian.com>
9898 * iterators.cs: Rewrote this. We're now using one single Proxy
9899 class for both the IEnumerable and the IEnumerator interface and
9900 `Iterator' derives from Class so we can use the high-level API.
9902 * class.cs (TypeContainer.AddIterator): New method.
9903 (TypeContainer.DoDefineType): New protected virtual method, which
9904 is called from DefineType().
9905 (TypeContainer.DoDefineMembers): Call DefineType() and
9906 DefineMembers() on all our iterators.
9907 (TypeContainer.Emit): Call Emit() on all our iterators.
9908 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9910 * codegen.cs (EmitContext.CurrentIterator): New public field.
9912 2004-07-15 Martin Baulig <martin@ximian.com>
9915 (TypeManager.not_supported_exception_type): New type.
9917 2004-07-14 Martin Baulig <martin@ximian.com>
9919 * iterators.cs: Use real error numbers.
9921 2004-07-14 Martin Baulig <martin@ximian.com>
9923 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9924 requires this to be a System.Collection.IEnumerable and not a
9925 class implementing that interface.
9926 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9928 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9930 * class.cs: Fixed previous fix, it broke some error tests.
9932 2004-07-12 Martin Baulig <martin@ximian.com>
9934 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9937 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9939 * assign.cs (LocalTemporary): Add new argument: is_address,If
9940 `is_address' is true, then the value that we store is the address
9941 to the real value, and not the value itself.
9943 * ecore.cs (PropertyExpr): use the new local temporary
9944 stuff to allow us to handle X.Y += z (where X is a struct)
9946 2004-07-08 Martin Baulig <martin@ximian.com>
9948 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9949 not always return, just like we're doing in Using.Resolve().
9951 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9953 * cs-parser.jay (fixed_statement): flag this as Pinned.
9955 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9957 * typemanager.cs (TypeManager): Removed MakePinned method, this
9958 mechanism is replaced with the .NET 2.x compatible mechanism of
9959 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9961 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9962 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9963 `IsFixed' property which has a different meaning.
9965 2004-07-02 Raja R Harinath <rharinath@novell.com>
9967 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9968 visible from inside a nested class, not just the names of the
9969 immediately enclosing class.
9972 2004-06-24 Raja R Harinath <rharinath@novell.com>
9974 * expression.cs (BetterConversion): Remove buggy special-case
9975 handling of "implicit constant expression conversions". At this
9976 point, we already know that the conversion is possible -- we're
9977 only checking to see which is better.
9979 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9981 * cs-parser.jay: Added error CS0210 test.
9983 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9985 * cs-parser.jay: Added error CS0134 test.
9987 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9990 * cs-parser.jay: Added error CS0145 test.
9992 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9994 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9996 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9998 * expression.cs (StackAlloc.Resolve): The argument may not
9999 be a constant; deal with this case.
10001 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10003 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10004 GetIndexerAttributeValue.
10005 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10007 * class.cs (Indexer.Define): Added error tests for CS0415,
10010 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10012 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10015 2004-06-23 Martin Baulig <martin@ximian.com>
10017 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10018 neither return nor throw, reset the barrier as well. Fixes #60457.
10020 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10022 * class.cs : EventAttributes is now set to None by default.
10023 This fixes bug #60459.
10025 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10028 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10029 Don't throw exception but return null (it's sufficient now).
10031 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10033 * typemanager.cs (GetArgumentTypes): Faster implementation.
10035 2004-06-18 Martin Baulig <martin@ximian.com>
10037 * attribute.cs (Attribute.Resolve): Check whether we're an
10038 EmptyCast which a Constant child. Fixes #60333.
10040 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10042 * statement.cs (EmitCollectionForeach): Account for the fact that
10043 not all valuetypes are in areas which we can take the address of.
10044 For these variables, we store to a temporary variable. Also, make
10045 sure that we dont emit a `callvirt' on a valuetype method.
10047 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10049 * expression.cs (StackAlloc.DoReSolve): Added test for
10050 negative parameter (CS0247).
10052 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10055 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10057 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10060 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10063 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10065 Fix bug #58254 & cs1555.cs, cs1556.cs
10066 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10068 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10070 * cs-parser.jay: Added error CS1669 test for indexers.
10072 2004-06-11 Martin Baulig <martin@ximian.com>
10074 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10075 call this twice: for params and varargs methods.
10077 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10080 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10082 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10084 * attribute.cs (Attribute.GetValidTargets): Made public.
10087 (AbstractPropertyEventMethod): New class for better code sharing.
10088 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10090 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10092 2004-06-11 Raja R Harinath <rharinath@novell.com>
10095 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10096 that the call to Resolve is part of a MemberAccess.
10097 (Expression.Resolve): Use it for SimpleName resolution.
10098 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10099 Add 'intermediate' boolean argument.
10100 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
10101 error message when the SimpleName can be resolved ambiguously
10102 between an expression and a type.
10103 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10105 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10106 call on the left-side.
10108 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10111 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10113 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10115 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10117 2004-06-11 Martin Baulig <martin@ximian.com>
10119 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10120 varargs methods if applicable.
10122 2004-06-11 Martin Baulig <martin@ximian.com>
10124 * expression.cs (Invocation.EmitCall): Don't use
10125 `method.CallingConvention == CallingConventions.VarArgs' since the
10126 method could also have `CallingConventions.HasThis'.
10128 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10130 * class.cs (Event.GetSignatureForError): Implemented.
10131 Fixed crash in error test cs3010.cs
10133 2004-06-10 Miguel de Icaza <miguel@ximian.com>
10135 * cs-tokenizer.cs: Change the way we track __arglist to be
10136 consistent with the other keywords.
10138 2004-06-09 Miguel de Icaza <miguel@ximian.com>
10140 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10143 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
10145 * codegen.cs: Check that all referenced assemblies have a strongname
10146 before strongnaming the compiled assembly. If not report error CS1577.
10147 Fix bug #56563. Patch by Jackson Harper.
10148 * typemanager.cs: Added a method to return all referenced assemblies.
10149 Fix bug #56563. Patch by Jackson Harper.
10151 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10154 (Method.ApplyAttributeBuilder): Moved and added conditional
10155 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10158 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10160 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10163 * class.cs: (EventField.attribute_targets): Changed default target.
10165 2004-06-08 Martin Baulig <martin@ximian.com>
10167 * expression.cs (Invocation.EmitCall): Enable varargs methods.
10169 2004-06-08 Martin Baulig <martin@ximian.com>
10171 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10173 2004-06-07 Martin Baulig <martin@ximian.com>
10175 Added support for varargs methods.
10177 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10180 * cs-parser.jay: Added support for `__arglist'.
10182 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10184 * expression.cs (Argument.AType): Added `ArgList'.
10185 (Invocation): Added support for varargs methods.
10186 (ArglistAccess): New public class.
10187 (Arglist): New public class.
10189 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10191 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
10192 a method's top-level block if the method has varargs.
10194 * support.cs (ReflectionParameters, InternalParameters): Added
10195 support for varargs methods.
10197 2004-06-07 Miguel de Icaza <miguel@ximian.com>
10199 * class.cs: Provide location in indexer error report.
10201 * driver.cs: Use standard names.
10203 * namespace.cs: Catch the use of using after a namespace has been
10204 declared also on using aliases.
10206 2004-06-03 Raja R Harinath <rharinath@novell.com>
10209 * typemanager.cs (closure_private_ok, closure_invocation_type)
10210 (closure_qualifier_type, closure_invocation_assembly)
10211 (FilterWithClosure): Move to ...
10212 (Closure): New internal nested class.
10213 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10214 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10215 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10216 (MemberLookup, MemberLookupFailed): Use it.
10217 * expression.cs (New.DoResolve): Treat the lookup for the
10218 constructor as being qualified by the 'new'ed type.
10219 (Indexers.GetIndexersForTypeOrInterface): Update.
10221 2004-06-03 Marek Safar <marek.safar@seznam.cz>
10224 (GetConditionalAttributeValue): New method. Returns
10225 condition of ConditionalAttribute.
10226 (SearchMulti): New method. Returns all attributes of type 't'.
10227 Use it when attribute is AllowMultiple = true.
10228 (IsConditionalMethodExcluded): New method.
10231 (Method.IsExcluded): Implemented. Returns true if method has conditional
10232 attribute and the conditions is not defined (method is excluded).
10233 (IMethodData): Extended interface for ConditionalAttribute support.
10234 (PropertyMethod.IsExcluded): Implemented.
10237 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10240 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10243 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
10245 * expression.cs (ArrayCreationExpression): Make this just an
10246 `expression'. It can't be a statement, so the code here was
10249 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10252 * typemanager.cs (GetFullNameSignature): New method for
10255 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10258 * class.cs (MemberBase.GetSignatureForError): New virtual method.
10259 Use this method when MethodBuilder is null.
10260 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10261 Added test for error CS0626 (MONO reports error for this situation).
10262 (IMethodData.GetSignatureForError): Extended interface.
10264 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10267 (AttributeTester.GetObsoleteAttribute): Returns instance of
10268 ObsoleteAttribute when type is obsolete.
10271 (TypeContainer.VerifyObsoleteAttribute): Override.
10272 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10273 (MethodCode.VerifyObsoleteAttribute): Override.
10274 (MemberBase.VerifyObsoleteAttribute): Override.
10277 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10278 and report proper error.
10281 Delegate.VerifyObsoleteAttribute): Override.
10284 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10285 and report proper error.
10286 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10289 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10293 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10294 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10295 Added test for ObsoleteAttribute.
10298 (Catch): Derived from Statement.
10300 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10302 Fixed bug #59071 & cs0160.cs
10304 * statement.cs (Try.Resolve): Check here whether order of catch
10305 clauses matches their dependencies.
10307 2004-05-31 Miguel de Icaza <miguel@ximian.com>
10309 * Reverted patch to namespace.cs (Use lookuptypedirect). This
10310 caused a regression: #59343. Referencing nested classes from an
10311 assembly stopped working.
10313 2004-05-31 Martin Baulig <martin@ximian.com>
10315 MCS is now frozen for beta 2.
10317 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10319 * convert.cs: add a trivial cache for overload operator resolution.
10321 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10323 * decl.cs: If possible, use lookuptypedirect here. We can only do
10324 this if there is no `.' after the namespace. Avoids using
10325 LookupType, which does lots of slow processing.
10326 (FindNestedType) New method, does what it says :-).
10327 * namespace.cs: use LookupTypeDirect.
10328 * rootcontext.cs: use membercache, if possible.
10329 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10331 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10334 According to the spec,
10336 In a member access of the form E.I, if E is a single identifier,
10337 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10338 field, property, localvariable, or parameter with the same type as
10339 the meaning of E as a type-name (§3.8), then both possible
10340 meanings of E are permitted.
10342 We did not check that E as a simple-name had the same type as E as
10345 This trivial check gives us 5-7% on bootstrap time.
10347 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10349 * expression.cs (Invocation.OverloadResolve): Avoid the
10350 use of hashtables and boxing here by allocating on demand.
10352 2004-05-30 Martin Baulig <martin@ximian.com>
10354 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10355 we're doing a silent lookup. Don't try to lookup nested types in
10356 TypeManager.object_type (thanks to Ben Maurer).
10358 2004-05-30 Martin Baulig <martin@ximian.com>
10360 Committing a patch from Ben Maurer.
10362 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10364 2004-05-29 Martin Baulig <martin@ximian.com>
10366 * class.cs (IMethodData.ShouldIgnore): New method.
10368 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10369 `Location' argument, we don't need it anywhere. Use
10370 `IMethodData.ShouldIgnore ()' instead of
10371 `MethodData.GetMethodFlags ()'.
10372 (TypeManager.AddMethod): Removed.
10373 (TypeManager.AddMethod2): Renamed to AddMethod.
10375 2004-05-29 Martin Baulig <martin@ximian.com>
10377 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10379 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10380 converting from a class type S to an interface type and we already
10381 have an object on the stack, don't box it again. Fixes #52578.
10383 2004-05-29 Martin Baulig <martin@ximian.com>
10385 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10386 Added support for `params' parameters. Fixes #59267.
10388 2004-05-29 Martin Baulig <martin@ximian.com>
10390 * literal.cs (NullPointer): Provide a private .ctor which sets
10391 `type' to TypeManager.object_type. Fixes #59048.
10393 2004-05-29 Martin Baulig <martin@ximian.com>
10395 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10396 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10398 * ecore.cs (EventExpr.instance_expr): Make the field private.
10400 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10402 Fixed bug #50080 & cs0214-2.cs
10403 * expression.cs (Cast.DoResolve): Check unsafe context here.
10405 * statement.cs (Resolve.DoResolve): Likewise.
10407 2004-05-26 Martin Baulig <martin@ximian.com>
10409 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10411 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10412 (RootContext.LookupType): Pass down the `silent' flag.
10414 2004-05-25 Martin Baulig <martin@ximian.com>
10417 (MethodGroupExpr.IdenticalTypeName): New public property.
10418 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10419 expression actually refers to a type.
10421 2004-05-25 Martin Baulig <martin@ximian.com>
10423 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10424 for #56176 and made it actually work.
10426 2004-05-25 Martin Baulig <martin@ximian.com>
10428 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10429 (FieldExpr, PropertyExpr): Override and implement
10430 CacheTemporaries. Fixes #52279.
10432 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10434 * location.cs: In the new compiler listing a file twice is a
10435 warning, not an error.
10437 2004-05-24 Martin Baulig <martin@ximian.com>
10439 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10440 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10442 2004-05-24 Martin Baulig <martin@ximian.com>
10444 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10445 walking the `using' list. Fixes #53921.
10447 2004-05-24 Martin Baulig <martin@ximian.com>
10449 * const.cs (Const.LookupConstantValue): Added support for
10450 EmptyCast's; fixes #55251.
10452 2004-05-24 Martin Baulig <martin@ximian.com>
10454 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10455 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10456 which does the CS0135 check. The reason is that we first need to
10457 check whether the variable actually exists.
10459 2004-05-24 Martin Baulig <martin@ximian.com>
10461 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10462 than RootContext.LookupType() to find the explicit interface
10463 type. Fixes #58584.
10465 2004-05-24 Raja R Harinath <rharinath@novell.com>
10467 * Makefile: Simplify. Use executable.make.
10468 * mcs.exe.sources: New file. List of sources of mcs.exe.
10470 2004-05-24 Anders Carlsson <andersca@gnome.org>
10474 Use the invariant culture when doing String.Compare for CLS case
10477 2004-05-23 Martin Baulig <martin@ximian.com>
10479 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10480 don't have any dots. Fixes #52622, added cs0246-8.cs.
10482 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10484 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10486 * class.cs (MemberBase.Define): Reuse MemberType member for
10487 resolved type. Other methods can use it too.
10489 2004-05-23 Martin Baulig <martin@ximian.com>
10491 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10492 the variable also exists in the current block (otherwise, we need
10493 to report a CS0103). Fixes #58670.
10495 2004-05-23 Martin Baulig <martin@ximian.com>
10497 * flowanalysis.cs (Reachability.Reachable): Compute this
10498 on-the-fly rather than storing it as a field.
10500 2004-05-23 Martin Baulig <martin@ximian.com>
10502 * flowanalysis.cs (Reachability.And): Manually compute the
10503 resulting `barrier' from the reachability.
10505 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10508 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10509 instance of ObsoleteAttribute when symbol is obsolete.
10512 (IMethodData): Extended interface for ObsoleteAttribute support.
10514 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10516 * attribute.cs: Fix bug #55970
10518 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10522 (GetObsoleteAttribute): New method. Creates the instance of
10524 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10525 ObsoleteAttribute when member is obsolete.
10526 (AttributeTester.Report_ObsoleteMessage): Common method for
10527 Obsolete error/warning reporting.
10530 (TypeContainer.base_classs_type): New member for storing parent type.
10533 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10534 for this MemberCore.
10536 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10538 * attribute.cs, const.cs: Fix bug #58590
10540 2004-05-21 Martin Baulig <martin@ximian.com>
10542 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10543 out parameters if the end of the method is unreachable. Fixes
10546 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10548 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10549 Hari was right, why extra method.
10551 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10553 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10555 2004-05-20 Martin Baulig <martin@ximian.com>
10557 Merged this back from gmcs to keep the differences to a minumum.
10559 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10560 instead of a Declspace.
10561 (Attribute.ResolveType): Likewise.
10562 (Attributes.Search): Likewise.
10563 (Attributes.Contains): Likewise.
10564 (Attributes.GetClsCompliantAttribute): Likewise.
10566 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10568 (MethodData.ApplyAttributes): Take an EmitContext instead of a
10571 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10573 Fix bug #58688 (MCS does not report error when the same attribute
10576 * attribute.cs (Attribute.Emit): Distinction between null and default.
10578 2004-05-19 Raja R Harinath <rharinath@novell.com>
10580 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10581 of a top-level attribute without an attribute target.
10582 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10584 (Attribute.Conditional_GetConditionName),
10585 (Attribute.Obsolete_GetObsoleteMessage): Update.
10586 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10587 part of ScanForIndexerName.
10588 (Attribute.CanIgnoreInvalidAttribute): New function.
10589 (Attribute.ScanForIndexerName): Move to ...
10590 (Attributes.ScanForIndexerName): ... here.
10591 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10592 (Attributes.Search): New internal variant that can choose not to
10593 complain if types aren't resolved. The original signature now
10595 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10596 complaints suppressed.
10597 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10598 only if it not useful.
10599 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10600 top-level for attributes that are shared between the assembly
10601 and a top-level class.
10602 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10603 * class.cs: Update to reflect changes.
10604 (DefineIndexers): Fuse loops.
10605 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10606 a couple more variants of attribute names.
10608 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10610 Fix bug #52585 (Implemented explicit attribute declaration)
10613 (Attributable.ValidAttributeTargets): New abstract method. It gets
10614 list of valid attribute targets for explicit target declaration.
10615 (Attribute.Target): It holds target itself.
10616 (AttributeSection): Removed.
10617 (Attribute.CheckTargets): New method. It checks whether attribute
10618 target is valid for the current element.
10621 (EventProperty): New class. For events that are declared like
10622 property (with add and remove accessors).
10623 (EventField): New class. For events that are declared like field.
10626 * cs-parser.jay: Implemented explicit attribute target declaration.
10628 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10629 Override ValidAttributeTargets.
10632 (ReturnParameter): Class for applying custom attributes on
10634 (ParameterAtribute): New class. Class for applying custom
10635 attributes on the parameter type.
10637 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10639 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10642 (Method): Allow UNSAFE here.
10644 * modifiers.cs: Support unsafe reporting.
10646 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10648 * decl.cs: Fix bug #58478.
10650 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10652 * statement.cs: When checking for unreachable code on an EmptyStatement,
10653 set the location. Fixes bug #58488.
10655 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10657 * driver.cs: Add -pkg handling.
10659 From Gonzalo: UseShelLExecute=false
10661 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10664 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10666 (Attribute.IsClsCompliaceRequired): Moved to base for better
10668 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10669 when attribute is AttributeUsageAttribute.
10670 (Attribute.GetValidTargets): Simplified.
10671 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10672 attribute for this type.
10673 (Attribute.ApplyAttributes): Method renamed to Emit and make
10675 (GlobalAttributeSection): New class for special handling of global
10676 attributes (assembly, module).
10677 (AttributeSection.Emit): New method.
10679 * class.cs: Implemented Attributable abstract methods.
10680 (MethodCore.LabelParameters): Moved to Parameter class.
10681 (Accessor): Is back simple class.
10682 (PropertyMethod): Implemented Attributable abstract class.
10683 (DelegateMethod): Implemented Attributable abstract class.
10684 (Event): New constructor for disctintion between normal Event
10685 and Event with accessors.
10687 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10689 * codegen.cs, const.cs, decl.cs, delegate.cs:
10690 (CommonAssemblyModulClass): Implemented Attributable abstract class
10693 * enum.cs: Implement IAttributeSupport interface.
10694 (EnumMember): New class for emum members. Implemented Attributable
10698 (ParameterBase): Is abstract.
10699 (ReturnParameter): New class for easier [return:] attribute handling.
10701 * typemanager.cs: Removed builder_to_attr.
10703 2004-05-11 Raja R Harinath <rharinath@novell.com>
10706 * attribute.cs (Attribute.GetPositionalValue): New function.
10707 * class.cs (TypeContainer.VerifyMembers): New function.
10708 (TypeContainer.Emit): Use it.
10709 (ClassOrStruct): New base class for Class and Struct.
10710 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10711 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10713 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10714 then each non-static field should have a FieldOffset attribute.
10715 Otherwise, none of the fields should have a FieldOffset attribute.
10716 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10717 and FieldOffset attributes.
10718 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10719 (TypeManager.field_offset_attribute_type): New core types.
10720 (TypeManager.InitCoreTypes): Initialize them.
10722 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10724 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10725 Return correct type.
10728 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10730 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10731 be implicitly converted to ulong.
10733 * expression.cs: The logic for allowing operator &, | and ^ worked
10734 was wrong, it worked before because we did not report an error in
10735 an else branch. Fixes 57895.
10737 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10738 allow volatile fields to be reference types.
10740 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10742 * driver.cs: Add support for /debug-
10744 2004-05-07 Raja R Harinath <rharinath@novell.com>
10746 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10747 Add a 'complain' parameter to silence errors.
10748 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10749 silently overlooked type-resolutions.
10750 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10751 to reflect changes.
10752 (Attributes.Search): New function.
10753 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10754 (Attributes.GetAttributeFullName): Remove hack.
10755 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10756 Update to reflect changes.
10757 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10758 Use Attributes.Search instead of nested loops.
10760 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10763 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10764 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10765 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10767 * report.cs: (Report.Warning): Renamed to Warning_T because of
10768 parameter collision.
10770 2004-05-05 Raja R Harinath <rharinath@novell.com>
10772 * expression.cs (MemberAccess.ResolveMemberAccess):
10773 Exit with non-zero status after Report.Error.
10774 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10776 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10778 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10780 * support.cs: Don't hang when the file is empty.
10782 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10784 * support.cs: In SeekableStreamReader, compute the preamble size of the
10785 underlying stream. Position changes should take into account that initial
10788 2004-05-03 Todd Berman <tberman@sevenl.net>
10790 * driver.cs: remove unused GetSysVersion function.
10792 2004-05-03 Todd Berman <tberman@sevenl.net>
10794 * driver.cs: Remove the hack from saturday, as well as the hack
10795 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10796 link_paths to get that bit proper.
10798 2004-05-01 Todd Berman <tberman@sevenl.net>
10800 * driver.cs: Try a LoadFrom before a Load, this checks the current
10801 path. This is currently a bug in mono that is be fixed, however, this
10802 provides a workaround for now. This will be removed when the bug
10805 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10807 * CryptoConvert.cs: Updated to latest version. Fix issue with
10808 incomplete key pairs (#57941).
10810 2004-05-01 Todd Berman <tberman@sevenl.net>
10812 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10815 2004-04-30 Jackson Harper <jackson@ximian.com>
10817 * codegen.cs: Open keys readonly.
10819 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10821 * typemanager.cs: don't report cyclic struct layout when a struct
10822 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10823 which has 2 Pango.Rectangle fields.
10825 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10827 * expression.cs: Handle IntPtr comparisons with IL code
10828 rather than a method call.
10830 2004-04-29 Martin Baulig <martin@ximian.com>
10832 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10833 the list of PropertyInfo's in class hierarchy and find the
10834 accessor. Fixes #56013.
10836 2004-04-29 Martin Baulig <martin@ximian.com>
10838 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10840 2004-04-29 Martin Baulig <martin@ximian.com>
10842 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10844 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10846 2004-04-29 Martin Baulig <martin@ximian.com>
10848 * class.cs (ConstructorInitializer.Resolve): Check whether the
10849 parent .ctor is accessible. Fixes #52146.
10851 2004-04-29 Martin Baulig <martin@ximian.com>
10853 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10855 * statement.cs (Using.EmitLocalVariableDecls): Use
10856 TypeManager.idisposable_type, not typeof (IDisposable).
10857 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10859 2004-04-29 Martin Baulig <martin@ximian.com>
10861 * class.cs (Event.Define): Don't emit the field and don't set
10862 RTSpecialName and SpecialName for events on interfaces. Fixes
10865 2004-04-29 Raja R Harinath <rharinath@novell.com>
10867 Refactor Attribute.ApplyAttributes.
10868 * attribute.cs (Attributable): New base class for objects that can
10869 have Attributes applied on them.
10870 (Attribute): Make AttributeUsage fields public.
10871 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10872 (Attribute.IsInternalCall): New property.
10873 (Attribute.UsageAttr): Convert to a public read-only property.
10874 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10875 (Attribute.ResolveType, Attribute.Resolve)
10876 (Attribute.ScanForIndexerName): Update to reflect changes.
10877 (Attribute.CheckAttributeTarget): Re-format.
10878 (Attribute.ApplyAttributes): Refactor, to various
10879 Attributable.ApplyAttributeBuilder methods.
10880 * decl.cs (MemberCore): Make Attributable.
10881 * class.cs (Accessor): Make Attributable.
10882 (MethodData.ApplyAttributes): Use proper attribute types, not
10884 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10885 (TypeContainer.ApplyAttributeBuilder)
10886 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10887 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10888 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10889 (Operator.ApplyAttributeBuilder): New factored-out methods.
10890 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10891 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10892 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10893 * parameter.cs (ParameterBase): New Attributable base class
10894 that can also represent Return types.
10895 (Parameter): Update to the changes.
10897 2004-04-29 Jackson Harper <jackson@ximian.com>
10899 * driver.cs: Prefer the corlib system version when looking for
10900 assemblies in the GAC. This is still a hack, but its a better hack
10903 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10905 * decl.cs, enum.cs: Improved error 3005 reporting.
10907 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10908 (related_symbols): New private member for list of symbols
10909 related to reported error/warning.
10911 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10913 2004-04-29 Martin Baulig <martin@ximian.com>
10915 * ecore.cs (Expression.Constantify): If we're an enum and
10916 TypeManager.TypeToCoreType() doesn't give us another type, use
10917 t.UnderlyingSystemType. Fixes #56178.
10919 2004-04-29 Martin Baulig <martin@ximian.com>
10921 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10922 interfaces and for each interface, only add members directly
10923 declared in that interface. Fixes #53255.
10925 2004-04-28 Martin Baulig <martin@ximian.com>
10927 * expression.cs (ConditionalLogicalOperator): Use a temporary
10928 variable for `left' to avoid that we evaluate it more than once;
10931 2004-04-28 Martin Baulig <martin@ximian.com>
10933 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10936 2004-04-28 Martin Baulig <martin@ximian.com>
10938 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10941 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10942 whether the type is not void (CS1547).
10944 2004-04-28 Martin Baulig <martin@ximian.com>
10946 * expression.cs (Unary.DoResolveLValue): Override this and report
10947 CS0131 for anything but Operator.Indirection.
10949 2004-04-28 Martin Baulig <martin@ximian.com>
10951 Committing a patch from Ben Maurer; see bug #50820.
10953 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10956 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10959 2004-04-28 Martin Baulig <martin@ximian.com>
10961 Committing a patch from Ben Maurer; see bug #50820.
10963 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10966 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10969 2004-04-28 Martin Baulig <martin@ximian.com>
10971 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10972 (Block.AddLabel): Call DoLookupLabel() to only search in the
10975 2004-04-28 Martin Baulig <martin@ximian.com>
10977 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10978 comparing StringConstants and NullLiterals in Equality and Inequality.
10980 2004-04-28 Jackson Harper <jackson@ximian.com>
10982 * driver.cs: Attempt to load referenced assemblies from the
10983 GAC. This is the quick and dirty version of this method that
10984 doesnt take into account versions and just takes the first
10985 canidate found. Will be good enough for now as we will not have more
10986 then one version installed into the GAC until I update this method.
10988 2004-04-28 Martin Baulig <martin@ximian.com>
10990 * typemanager.cs (TypeManager.CheckStructCycles): New public
10991 static method to check for cycles in the struct layout.
10993 * rootcontext.cs (RootContext.PopulateTypes): Call
10994 TypeManager.CheckStructCycles() for each TypeContainer.
10995 [Note: We only need to visit each type once.]
10997 2004-04-28 Martin Baulig <martin@ximian.com>
10999 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11001 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11002 success and added `out object value'. Use a `bool resolved' field
11003 to check whether we've already been called rather than
11004 `ConstantValue != null' since this breaks for NullLiterals.
11006 2004-04-28 Raja R Harinath <rharinath@novell.com>
11008 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11009 setting of this flag, since the 'set' method may be non-public.
11011 2004-04-28 Raja R Harinath <rharinath@novell.com>
11013 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11014 check on current_vector.Block.
11016 2004-04-27 Martin Baulig <martin@ximian.com>
11018 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11019 a field initializer. Fixes #56459.
11021 2004-04-27 Martin Baulig <martin@ximian.com>
11023 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11024 we're not attempting to use an indexer. Fixes #52154.
11026 2004-04-27 Martin Baulig <martin@ximian.com>
11028 * statement.cs (Return): Don't create a return label if we don't
11029 need it; reverts my change from January 20th. Thanks to Ben
11032 2004-04-27 Martin Baulig <martin@ximian.com>
11034 According to the spec, `goto' can only leave a nested scope, but
11037 * statement.cs (Block.LookupLabel): Only lookup in the current
11038 block, don't recurse into parent or child blocks.
11039 (Block.AddLabel): Check in parent and child blocks, report
11040 CS0140/CS0158 if we find a duplicate.
11041 (Block): Removed this indexer for label lookups.
11042 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11043 this already does the error reporting for us.
11046 (FlowBranching.UsageVector.Block): New public variable; may be null.
11047 (FlowBranching.CreateSibling): Added `Block' argument.
11048 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11049 label for the target of a `goto' and check whether we're not
11050 leaving a `finally'.
11052 2004-04-27 Martin Baulig <martin@ximian.com>
11054 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11055 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11058 2004-04-27 Martin Baulig <martin@ximian.com>
11060 * statement.cs (Block.AddLabel): Also check for implicit blocks
11061 and added a CS0158 check.
11063 2004-04-27 Martin Baulig <martin@ximian.com>
11065 * flowanalysis.cs (FlowBranchingLoop): New class.
11066 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11067 UsageVector's instead of an ArrayList.
11068 (FlowBranching.Label): Likewise.
11069 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11070 (FlowBranching.AddBreakVector): New method.
11072 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11074 * attribute.cs: Small regression fix: only convert the type if we
11075 the type is different, fixes System.Drawing build.
11077 2004-04-27 Martin Baulig <martin@ximian.com>
11079 * attribute.cs (Attribute.Resolve): If we have a constant value
11080 for a named field or property, implicity convert it to the correct
11083 2004-04-27 Raja R Harinath <rharinath@novell.com>
11085 * statement.cs (Block.Block): Implicit blocks share
11086 'child_variable_names' fields with parent blocks.
11087 (Block.AddChildVariableNames): Remove.
11088 (Block.AddVariable): Mark variable as "used by a child block" in
11089 every surrounding block.
11090 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11091 been used in a child block, complain about violation of "Invariant
11092 meaning in blocks" rule.
11093 * cs-parser.jay (declare_local_variables): Don't use
11094 AddChildVariableNames.
11095 (foreach_statement): Don't create an implicit block: 'foreach'
11096 introduces a scope.
11098 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11100 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11101 converting from 0L to ulong. Fixes 57522.
11103 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11105 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11106 derived class hides via 'new' keyword field from base class (test-242.cs).
11107 TODO: Handle this in the more general way.
11109 * class.cs (CheckBase): Ditto.
11111 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11113 * decl.cs (caching_flags): New member for storing cached values
11115 (MemberCore.Flags): New enum where bit flags for caching_flags
11117 (MemberCore.cls_compliance): Moved to caching_flags.
11118 (DeclSpace.Created): Moved to caching_flags.
11120 * class.cs: Use caching_flags instead of DeclSpace.Created
11122 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11124 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11125 if we are only a derived class, not a nested class.
11127 * typemanager.cs: Same as above, but do this at the MemberLookup
11128 level (used by field and methods, properties are handled in
11129 PropertyExpr). Allow for the qualified access if we are a nested
11132 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11134 * class.cs: Refactoring.
11135 (IMethodData): New inteface; Holds links to parent members
11136 to avoid member duplication (reduced memory allocation).
11137 (Method): Implemented IMethodData interface.
11138 (PropertyBase): New inner classes for get/set methods.
11139 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11140 (Event): New inner classes for add/remove methods.
11141 (Event.DelegateMethod): Implemented IMethodData interface.
11143 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11144 EmitContext (related to class.cs refactoring).
11146 2004-04-21 Raja R Harinath <rharinath@novell.com>
11148 * delegate.cs (Delegate.VerifyApplicability): If the number of
11149 arguments are the same as the number of parameters, first try to
11150 verify applicability ignoring any 'params' modifier on the last
11154 2004-04-16 Raja R Harinath <rharinath@novell.com>
11156 * class.cs (TypeContainer.AddIndexer): Use
11157 'ExplicitInterfaceName' to determine if interface name was
11158 explicitly specified. 'InterfaceType' is not initialized at this time.
11159 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11160 Indexers array is already in the required order. Initialize
11161 'IndexerName' only if there are normal indexers.
11162 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11163 (TypeContainer.Emit): Emit DefaultMember attribute only if
11164 IndexerName is initialized.
11167 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11169 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11172 2004-04-15 Raja R Harinath <rharinath@novell.com>
11174 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11178 * attribute.cs (Attribute.Resolve): Check for duplicate named
11182 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11184 * iterators.cs (MarkYield): track whether we are in an exception,
11185 and generate code accordingly. Use a temporary value to store the
11186 result for our state.
11188 I had ignored a bit the interaction of try/catch with iterators
11189 since their behavior was not entirely obvious, but now it is
11190 possible to verify that our behavior is the same as MS .NET 2.0
11194 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11196 * iterators.cs: Avoid creating temporaries if there is no work to
11199 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11200 Enumerations, use TypeManager.EnumToUnderlying and call
11203 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11206 (This.Emit): Use EmitContext.EmitThis to emit our
11209 (This.EmitAssign): Ditto.
11211 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11212 codepaths, we will move all the functionality into
11215 (FieldExpr.EmitAssign): Ditto.
11217 This fixes several hidden bugs that I uncovered while doing a code
11218 review of this today.
11220 * codegen.cs (EmitThis): reworked so the semantics are more clear
11221 and also support value types "this" instances.
11223 * iterators.cs: Changed so that for iterators in value types, we
11224 do not pass the value type as a parameter.
11226 Initialization of the enumerator helpers is now done in the caller
11227 instead of passing the parameters to the constructors and having
11228 the constructor set the fields.
11230 The fields have now `assembly' visibility instead of private.
11232 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11234 * expression.cs (Argument.Resolve): Check if fields passed as ref
11235 or out are contained in a MarshalByRefObject.
11237 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11238 another compiler type.
11240 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11242 * class.cs (Indexer.Define): use the new name checking method.
11243 Also, return false on an error.
11244 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11245 (is_identifier_[start/part]_character): make static.
11247 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11249 * expression.cs (Binary.ResolveOperator): Do no append strings
11250 twice: since we can be invoked more than once (array evaluation)
11251 on the same concatenation, take care of this here. Based on a fix
11252 from Ben (bug #56454)
11254 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11256 * codegen.cs: Fix another case where CS1548 must be reported (when
11257 delay-sign isn't specified and no private is available #56564). Fix
11258 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11259 error when MCS is used on the MS runtime and we need to delay-sign
11260 (which seems unsupported by AssemblyBuilder - see #56621).
11262 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11264 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11265 (TypeManager.ComputeNamespaces): Faster implementation for
11268 * compiler.csproj: Updated AssemblyName to mcs.
11270 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11272 * rootcontext.cs: Add new types to the boot resolution.
11274 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11275 MulticastDelegate is not allowed.
11277 * typemanager.cs: Add new types to lookup: System.TypedReference
11280 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11281 check for TypedReference or ArgIterator, they are not allowed.
11283 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11284 makes us properly catch 1510 in some conditions (see bug 56016 for
11287 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11289 * CryptoConvert.cs: update from corlib version
11292 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11294 * class.cs (Indexer.Define): Check indexername declaration
11296 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11298 * attribute.cs (IsClsCompliant): Fixed problem with handling
11299 all three states (compliant, not-compliant, undetected).
11301 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11303 * attribute.cs (Attribute): Location is now public.
11304 (Resolve): Store resolved arguments (pos_values) in attribute class.
11305 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11306 (GetClsCompliantAttributeValue): New method that gets
11307 CLSCompliantAttribute value.
11308 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11309 if exists else null.
11310 (AttributeTester): New class for CLS-Compliant verification routines.
11312 * class.cs (Emit): Add CLS-Compliant verification.
11313 (Method.GetSignatureForError): Implemented.
11314 (Constructor.GetSignatureForError): Implemented
11315 (Constructor.HasCompliantArgs): Returns if constructor has
11316 CLS-Compliant arguments.
11317 (Constructor.Emit): Override.
11318 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11319 is needed to test only parameters.
11320 (FieldBase.GetSignatureForError): Implemented.
11321 (TypeContainer): New member for storing base interfaces.
11322 (TypeContainer.FindMembers): Search in base interfaces too.
11324 * codegen.cs (GetClsComplianceAttribute): New method that gets
11325 assembly or module CLSCompliantAttribute value.
11326 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11328 (ModuleClass.Emit): Add error 3012 test.
11330 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11332 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11333 state for all decl types.
11334 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11335 if CLS-Compliant tests are required.
11336 (IsClsCompliaceRequired): New method. Analyze whether code
11337 must be CLS-Compliant.
11338 (IsExposedFromAssembly): New method. Returns true when MemberCore
11339 is exposed from assembly.
11340 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11341 value or gets cached value.
11342 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11343 is explicitly marked with CLSCompliantAttribute.
11344 (IsIdentifierClsCompliant): New abstract method. This method is
11345 used to testing error 3005.
11346 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11347 for identifier and parameters CLS-Compliant testing.
11348 (VerifyClsCompliance): New method. The main virtual method for
11349 CLS-Compliant verifications.
11350 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11351 null. I don't know why is null (too many public members !).
11352 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11353 and get value of first CLSCompliantAttribute that found.
11355 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11356 (VerifyClsCompliance): Override and add extra tests.
11358 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11359 clscheck- disable CLS-Compliant verification event if assembly is has
11360 CLSCompliantAttribute(true).
11362 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11363 ApllyAttribute is now called in emit section as in the other cases.
11364 Possible future Emit integration.
11365 (IsIdentifierClsCompliant): New override.
11366 (VerifyClsCompliance): New override.
11367 (GetEnumeratorName): Returns full enum name.
11369 * parameter.cs (GetSignatureForError): Implemented.
11371 * report.cs (WarningData): New struct for Warning message information.
11372 (LocationOfPreviousError): New method.
11373 (Warning): New method. Reports warning based on the warning table.
11374 (Error_T): New method. Reports error based on the error table.
11376 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11377 verifications are done here.
11379 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11381 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11382 CLSCompliantAttribute.
11383 (all_imported_types): New member holds all imported types from other
11385 (LoadAllImportedTypes): New method fills static table with exported types
11386 from all referenced assemblies.
11387 (Modules): New property returns all assembly modules.
11389 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11391 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11392 throwing a parser error.
11394 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11395 which removes the hardcoded get_/set_ prefixes for properties, as
11396 IL allows for the properties to be named something else.
11400 * expression.cs: Do not override operand before we know if it is
11401 non-null. Fix 56207
11403 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11405 * typemanager.cs: support for pinned variables.
11407 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11409 * decl.cs, typemanager.cs: Avoid using an arraylist
11410 as a buffer if there is only one result set.
11412 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11414 * expression.cs: Make sure you cant call a static method
11415 with an instance expression, bug #56174.
11417 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11419 * class.cs (IsDuplicateImplementation): Improve error reporting to
11420 flag 663 (method only differs in parameter modifier).
11422 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11423 in preprocessor directives.
11425 * location.cs (LookupFile): Allow for the empty path.
11427 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11428 better approach for some of that patch, but its failing with the
11429 CharSet enumeration. For now try/catch will do.
11431 * typemanager.cs: Do not crash if a struct does not have fields.
11434 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11436 * expression.cs: cs0213, cant fix a fixed expression.
11439 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11441 * cs-parser.jay: detect invalid embeded statements gracefully.
11444 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11446 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11449 the invocation type may not be a subclass of the tye of the item/
11450 The type of the item must be a subclass of the invocation item.
11455 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11457 * attribute.cs: Added methods to get a string and a bool from an
11458 attribute. Required to information from AssemblyKeyFileAttribute,
11459 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11460 * codegen.cs: Modified AssemblyName creation to include support for
11461 strongnames. Catch additional exceptions to report them as CS1548.
11462 * compiler.csproj: Updated include CryptoConvert.cs.
11463 * compiler.csproj.user: Removed file - user specific configuration.
11464 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11465 Mono.Security assembly. The original class is maintained and tested in
11466 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11467 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11468 like CSC 8.0 (C# v2) supports.
11469 * Makefile: Added CryptoConvert.cs to mcs sources.
11470 * rootcontext.cs: Added new options for strongnames.
11472 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11474 * driver.cs: For --expect-error, report error code `2'
11475 if the program compiled with no errors, error code `1' if
11476 it compiled with an error other than the one expected.
11478 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11480 * compiler.csproj: Updated for Visual Studio .NET 2003.
11481 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11482 * compiler.sln: Updated for Visual Studio .NET 2003.
11484 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11486 * expression.cs: Fix bug #47234. We basically need to apply the
11487 rule that we prefer the conversion of null to a reference type
11488 when faced with a conversion to 'object' (csc behaviour).
11490 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11492 * statement.cs: Shorter form for foreach, eliminates
11493 a local variable. r=Martin.
11495 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11497 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11498 checks if we can use brtrue/brfalse to test for 0.
11499 * expression.cs: use the above in the test for using brtrue/brfalse.
11500 cleanup code a bit.
11502 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11504 * expression.cs: Rewrite string concat stuff. Benefits:
11506 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11507 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11508 rather than a concat chain.
11510 * typemanager.cs: Add lookups for more concat overloads.
11512 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11514 * expression.cs: Emit shorter il code for array init.
11531 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11533 * statement.cs: Before, two switch blocks would be merged if the
11534 total size of the blocks (end_item - begin_item + 1) was less than
11535 two times the combined sizes of the blocks.
11537 Now, it will only merge if after the merge at least half of the
11542 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11544 * class.cs : csc build fix for GetMethods(). See bug #52503.
11546 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11548 * expression.cs: Make sure fp comparisons work with NaN.
11549 This fixes bug #54303. Mig approved this patch a long
11550 time ago, but we were not able to test b/c the runtime
11553 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11555 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11557 2004-03-19 Martin Baulig <martin@ximian.com>
11559 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11560 error here and not in our caller.
11562 2004-03-19 Martin Baulig <martin@ximian.com>
11564 * interface.cs: Completely killed this file.
11565 (Interface): We're now a TypeContainer and live in class.cs.
11567 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11568 argument; we're now also called for interfaces.
11569 (TypeContainer.DefineMembers): Allow this method being called
11571 (TypeContainer.GetMethods): New public method; formerly known as
11572 Interface.GetMethod(). This is used by PendingImplementation.
11573 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11574 it's now private and non-static.
11575 (Interface): Moved this here; it's now implemented similar to
11577 (Method, Property, Event, Indexer): Added `bool is_interface'
11578 argument to their .ctor's.
11579 (MemberBase.IsInterface): New public field.
11581 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11582 instances instead of InterfaceMethod, InterfaceProperty, etc.
11583 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11584 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11586 2004-03-19 Martin Baulig <martin@ximian.com>
11588 * class.cs (MethodCore.IsDuplicateImplementation): New private
11589 method which does the CS0111 checking.
11590 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11591 Use IsDuplicateImplementation().
11593 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11595 * decl.cs (FindMemberToOverride): New method to find the correct
11596 method or property to override in the base class.
11598 - Make Method/Property use the above method to find the
11599 version in the base class.
11600 - Remove the InheritableMemberSignatureCompare as it is now
11603 This patch makes large code bases much faster to compile, as it is
11604 O(n) rather than O(n^2) to do this validation.
11606 Also, it fixes bug 52458 which is that nested classes are not
11607 taken into account when finding the base class member.
11609 Reviewed/Approved by Martin.
11611 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11613 * interface.cs: In all interface classes removed redundant
11614 member initialization.
11616 2004-03-16 Martin Baulig <martin@ximian.com>
11618 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11620 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11622 * decl.cs (DefineTypeAndParents): New helper method to define a
11623 type's containers before the type itself is defined; This is a
11624 bug exposed by the recent changes to Windows.Forms when an
11625 implemented interface was defined inside a class that had not been
11628 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11630 (Check): Loop correctly to report errors modifiers
11631 (UNSAFE was not in the loop, since it was the same as TOP).
11633 * interface.cs: Every interface member now takes a ModFlags,
11634 instead of a "is_new" bool, which we set on the base MemberCore.
11636 Every place where we called "UnsafeOk" in the interface, now we
11637 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11638 the unsafe settings from the member declaration instead of the
11639 container interface.
11641 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11643 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11644 `set_indexer_name' to the pending bits (one per type).
11646 We fixed a bug today that was picking the wrong method to
11647 override, since for properties the existing InterfaceMethod code
11648 basically ignored the method name. Now we make sure that the
11649 method name is one of the valid indexer names.
11651 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11653 * support.cs (SeekableStreamReader): Keep track of stream byte
11654 positions and don't mix them with character offsets to the buffer.
11656 Patch from Gustavo Giráldez
11658 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11660 * interface.cs (InterfaceSetGetBase): Removed double member
11661 initialization, base class does it as well.
11663 2004-03-13 Martin Baulig <martin@ximian.com>
11665 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11666 when compiling corlib.
11668 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11670 * convert.cs (ExplicitConversion): We were reporting an error on
11671 certain conversions (object_type source to a value type, when the
11672 expression was `null') before we had a chance to pass it through
11673 the user defined conversions.
11675 * driver.cs: Replace / and \ in resource specifications to dots.
11678 * class.cs: Add check for duplicate operators. Fixes 52477
11680 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11682 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11683 that are in the middle of the statements, not only at the end.
11686 * class.cs (TypeContainer.AddField): No longer set the
11687 `HaveStaticConstructor' flag, now we call it
11688 `UserDefineStaticConstructor' to diferentiate the slightly
11689 semantic difference.
11691 The situation is that we were not adding BeforeFieldInit (from
11692 Modifiers.TypeAttr) to classes that could have it.
11693 BeforeFieldInit should be set to classes that have no static
11698 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11700 And most importantly Zoltan's comment:
11702 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11704 "I think beforefieldinit means 'it's ok to initialize the type sometime
11705 before its static fields are used', i.e. initialization does not need
11706 to be triggered by the first access to the type. Setting this flag
11707 helps the JIT to compile better code, since it can run the static
11708 constructor at JIT time, and does not need to generate code to call it
11709 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11710 this flag for lots of classes like String.
11712 csc sets this flag if the type does not have an explicit static
11713 constructor. The reasoning seems to be that if there are only static
11714 initalizers for a type, and no static constructor, then the programmer
11715 does not care when this initialization happens, so beforefieldinit
11718 This bug prevents the AOT compiler from being usable, since it
11719 generates so many calls to mono_runtime_class_init that the AOT code
11720 is much slower than the JITted code. The JITted code is faster,
11721 because it does not generate these calls if the vtable is type is
11722 already initialized, which is true in the majority of cases. But the
11723 AOT compiler can't do this."
11725 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11727 * class.cs (MethodData.Emit): Refactor the code so symbolic
11728 information is generated for destructors; For some reasons we
11729 were taking a code path that did not generate symbolic information
11732 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11734 * class.cs: Create a Constructor.CheckBase method that
11735 takes care of all validation type code. The method
11736 contains some code that was moved from Define.
11738 It also includes new code that checks for duplicate ctors.
11739 This fixes bug #55148.
11741 2004-03-09 Joshua Tauberer <tauberer@for.net>
11743 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11744 a { ... }-style array creation invokes EmitStaticInitializers
11745 which is not good for reference-type arrays. String, decimal
11746 and now null constants (NullCast) are not counted toward
11747 static initializers.
11749 2004-03-05 Martin Baulig <martin@ximian.com>
11751 * location.cs (SourceFile.HasLineDirective): New public field;
11752 specifies whether the file contains or is referenced by a "#line"
11754 (Location.DefineSymbolDocuments): Ignore source files which
11755 either contain or are referenced by a "#line" directive.
11757 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11759 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11760 direct access to our parent, so check the method inline there.
11762 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11764 * expression.cs (Invocation.EmitCall): Miguel's last commit
11765 caused a regression. If you had:
11770 In Foo the implict this would be null.
11772 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11774 * expression.cs (Invocation.EmitCall): If the method is not
11775 virtual, do not emit a CallVirt to it, use Call.
11777 * typemanager.cs (GetFullNameSignature): Improve the method to
11778 cope with ".ctor" and replace it with the type name.
11780 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11781 as an argument the ConstructorBuilder where it is being defined,
11782 to catch the recursive constructor invocations.
11784 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11786 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11787 routines to check if a type is an enumerable/enumerator allow
11788 classes that implement the IEnumerable or IEnumerator interfaces.
11790 * class.cs (Property, Operator): Implement IIteratorContainer, and
11791 implement SetYields.
11793 (Property.Define): Do the block swapping for get_methods in the
11794 context of iterators. We need to check if Properties also
11795 include indexers or not.
11797 (Operator): Assign the Block before invoking the
11798 OperatorMethod.Define, so we can trigger the Iterator code
11801 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11802 Property and Operator classes are not created when we parse the
11803 declarator but until we have the block completed, so we use a
11804 singleton SimpleIteratorContainer.Simple to flag whether the
11805 SetYields has been invoked.
11807 We propagate this setting then to the Property or the Operator to
11808 allow the `yield' to function.
11810 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11812 * codegen.cs: Implemented attribute support for modules.
11813 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11814 Assembly/Module functionality.
11816 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11817 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11818 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11820 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11822 * interface.cs (FindMembers): The operation is performed on all base
11823 interfaces and not only on the first. It is required for future CLS Compliance patch.
11825 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11827 * statement.cs, codegen.cs:
11828 This patch deals with patterns such as:
11830 public class List : IEnumerable {
11832 public MyEnumerator GetEnumerator () {
11833 return new MyEnumerator(this);
11836 IEnumerator IEnumerable.GetEnumerator () {
11840 public struct MyEnumerator : IEnumerator {
11845 Before, there were a few things we did wrong:
11846 1) we would emit callvirt on a struct, which is illegal
11847 2) we emited ldarg when we needed to emit ldarga
11848 3) we would mistakenly call the interface methods on an enumerator
11849 type that derived from IEnumerator and was in another assembly. For example:
11851 public class MyEnumerator : IEnumerator
11853 Would have the interface methods called, even if there were public impls of the
11854 method. In a struct, this lead to invalid IL code.
11856 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11858 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11861 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11863 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11865 * cs-parser.jay: Fix small regression: we were not testing V2
11866 compiler features correctly.
11868 * interface.cs: If the emit context is null, then create one
11870 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11872 * decl.cs (GetSignatureForError): New virtual method to get full name
11873 for error messages.
11875 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11876 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11878 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11879 Duplicated members and code in these classes has been removed.
11880 Better encapsulation in these classes.
11882 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11884 * assign.cs (Assign.DoResolve): When dealing with compound
11885 assignments, there is a new rule in ECMA C# 2.4 (might have been
11886 there before, but it is documented here) that states that in:
11890 If b is of type int, and the `op' is a shift-operator, then the
11891 above is evaluated as:
11895 * expression.cs (Binary.ResolveOperator): Instead of testing for
11896 int/uint/long/ulong, try to implicitly convert to any of those
11897 types and use that in pointer arithmetic.
11899 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11900 method to print information for from the type, not from the
11901 null-method we were given.
11903 2004-02-01 Duncan Mak <duncan@ximian.com>
11905 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11906 parsing for cmd, fixes bug #53694.
11908 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11910 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11911 in the member name duplication tests. Property and operator name duplication
11912 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11914 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11916 * interface.cs (PopulateMethod): Fixed crash when interface method
11917 returns not existing type (error test cs0246-3.cs).
11919 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11921 * cs-parser.jay (interface_accessors): Re-write actions to also
11922 store attributes attached to get and set methods. Fix spelling
11925 (inteface_property_declaration): Modify accordingly.
11927 (InterfaceAccessorInfo): New helper class to store information to pass
11928 around between rules that use interface_accessors.
11930 * interface.cs (Emit): Apply attributes on the get and set
11931 accessors of properties and indexers too.
11933 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11934 right MethodBuilder when applying attributes to the get and set accessors.
11936 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11938 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11940 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11942 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11944 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11946 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11947 changes that treat `yield' specially when present before `break'
11948 or `return' tokens.
11950 * cs-tokenizer.cs: yield is no longer a keyword.
11952 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11954 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11955 setting for default constructors.
11956 For default constructors are almost every time set wrong Modifier. The
11957 generated IL code has been alright. But inside mcs this values was
11958 wrong and this was reason why several of my CLS Compliance tests
11961 2004-01-22 Martin Baulig <martin@ximian.com>
11963 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11964 not a QualifiedIdentifier. This is what `type_name_expression'
11965 was previously doing.
11966 (type_name_expression): Removed; the code is now in
11967 `namespace_or_type_name'.
11968 (qualified_identifier): Removed, use `namespace_or_type_name'
11970 (QualifiedIdentifier): Removed this class.
11972 2004-01-22 Martin Baulig <martin@ximian.com>
11974 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11975 not a string as alias name.
11977 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11979 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11980 #52730 bug, and instead compute correctly the need to use a
11981 temporary variable when requesting an address based on the
11982 static/instace modified of the field and the constructor.
11984 2004-01-21 Martin Baulig <martin@ximian.com>
11986 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11987 class and namespace before looking up aliases. Fixes #52517.
11989 2004-01-21 Martin Baulig <martin@ximian.com>
11991 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11992 assinged in a 'try'; fixes exception4.cs.
11994 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11995 * class.cs : Implemented parameter-less constructor for TypeContainer
11997 * decl.cs: Attributes are now stored here. New property OptAttributes
11999 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12001 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12003 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12005 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12006 (CSharpSignature): New method for indexer and property signature.
12008 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12010 * pending.cs (IsVirtualFilter): Faster implementation.
12012 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12014 * typemanager.cs: Avoid inclusion of same assembly more than once.
12016 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12018 * cs-parser.jay: Fixed problem where the last assembly attribute
12019 has been applied also to following declaration (class, struct, etc.)
12021 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12023 * class.cs: Added error CS0538, CS0539 reporting.
12024 Fixed crash on Microsoft runtime when field type is void.
12026 * cs-parser.jay: Added error CS0537 reporting.
12028 * pending.cs: Added error CS0535 reporting.
12029 Improved error report for errors CS0536, CS0534.
12031 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12033 Merge a few bits from the Anonymous Method MCS tree.
12035 * statement.cs (ToplevelBlock): New class for toplevel methods,
12036 will hold anonymous methods, lifted variables.
12038 * cs-parser.jay: Create toplevel blocks for delegates and for
12039 regular blocks of code.
12041 2004-01-20 Martin Baulig <martin@ximian.com>
12043 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12044 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12045 and `NeedExplicitReturn'; added `IsLastStatement'.
12046 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12047 have a `ReturnLabel' or we're not unreachable.
12049 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12050 child's reachability; don't just override ours with it. Fixes
12051 #58058 (lluis's example).
12052 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12053 InFinally(), InLoop(), InSwitch() and
12054 BreakCrossesTryCatchBoundary() methods.
12056 * statement.cs (Return): Do all error checking in Resolve().
12057 Unless we are the last statement in a top-level block, always
12058 create a return label and jump to it.
12059 (Break, Continue): Do all error checking in Resolve(); also make
12060 sure we aren't leaving a `finally'.
12061 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12062 statement in a top-level block.
12063 (Block.Flags): Added `IsDestructor'.
12064 (Block.IsDestructor): New public property.
12066 2004-01-20 Martin Baulig <martin@ximian.com>
12068 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12070 2004-01-20 Martin Baulig <martin@ximian.com>
12072 * statement.cs (Statement.ResolveUnreachable): New public method.
12073 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12074 (Block.Resolve): Resolve unreachable statements.
12076 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12078 * expression.cs: We need to fix the case where we do
12079 not have a temp variable here.
12081 * assign.cs: Only expression compound assignments need
12082 temporary variables.
12084 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12086 * flowanalysis.cs: Reduce memory allocation in a few ways:
12087 - A block with no variables should not allocate a bit
12089 - A method with no out parameters does not need any tracking
12090 for assignment of the parameters, so we need not allocate
12093 public readonly Type[] VariableTypes;
12094 public readonly string[] VariableNames;
12095 Are redundant. The data is already stored in the variable
12096 map, so we need not allocate another array for it.
12097 - We need to add alot of checks for if (params | locals) == null
12098 due to the first two changes.
12100 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12102 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12103 implement IMemoryLocation, we store a copy on a local variable and
12104 take the address of it. Patch from Benjamin Jemlich
12106 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12107 to use a special "type_name_expression" rule which reduces the
12108 number of "QualifiedIdentifier" classes created, and instead
12109 directly creates MemberAccess expressions.
12111 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12113 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12114 that fixes #52853. Null literal assignment to ValueType
12116 * class.cs (MethodData.Emit): Instead of checking the name of the
12117 method to determine if its a destructor, create a new derived
12118 class from Method called Destructor, and test for that.
12120 * cs-parser.jay: Create a Destructor object instead of a Method.
12122 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12126 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12128 * expression.cs (Binary.ResolveOperator): Perform an implicit
12129 conversion from MethodGroups to their delegate types on the
12130 Addition operation.
12132 * delegate.cs: Introduce a new class DelegateCreation that is the
12133 base class for `NewDelegate' and `ImplicitDelegateCreation',
12134 factor some code in here.
12136 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12137 conversion from MethodGroups to compatible delegate types.
12139 * ecore.cs (Expression.Resolve): Do not flag error 654
12140 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12141 we allow conversions from MethodGroups to delegate types now.
12143 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12144 assignments in v2 either.
12146 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12148 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12149 static read-only fields in ctors.
12151 Applied patch from Benjamin Jemlich
12153 * expression.cs (UnaryMutator): Avoid leaking local variables.
12155 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12157 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12158 here to return true, as they can be used like this:
12160 (XXX) int.MEMBER ()
12162 Fixed 49836 and all the other dups
12164 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12166 * driver.cs: Implement /win32res and /win32icon.
12168 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12170 * cs-parser.jay: Add a rule to improve error handling for the
12171 common mistake of placing modifiers after the type.
12173 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12175 * cs-parser.jay (interface_event_declaration): Catch
12176 initialization of events on interfaces, and report cs0068
12178 * cs-parser.jay (interface_event_declaration): Catch
12179 initialization of events.
12181 * ecore.cs: Better report missing constructors.
12183 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12184 the error reporting done in the wrong place. Fix.
12186 * expression.cs (Binary.ResolveOperator): Catch the
12187 operator + (E x, E y) error earlier, and later allow for implicit
12188 conversions in operator +/- (E e, U x) from U to the underlying
12191 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12192 52596, if the container class is abstract, the default constructor
12193 is protected otherwise its public (before, we were always public).
12195 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12198 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12199 Jemlich that fixes bug #52597, MCS was generating invalid code for
12200 idisposable structs. Thanks to Ben for following up with this
12203 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12205 * driver.cs: Allow assemblies without code to be generated, fixes
12208 2004-01-07 Nick Drochak <ndrochak@gol.com>
12210 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12212 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12214 * cs-parser.jay: Add rules to improve error reporting if fields or
12215 methods are declared at the namespace level (error 116)
12217 * Add rules to catch event add/remove
12219 2004-01-04 David Sheldon <dave-mono@earth.li>
12221 * expression.cs: Added matching ")" to error message for
12224 2004-01-03 Todd Berman <tberman@gentoo.org>
12226 * ecore.cs, attribute.cs:
12227 Applying fix from #52429.
12229 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12231 * ecore.cs, expression.cs, statement.cs:
12232 Total rewrite of how we handle branching. We
12233 now handle complex boolean expressions with fewer
12234 jumps. As well if (x == 0) no longer emits a ceq.
12236 if (x is Foo) is much faster now, because we generate
12239 Overall, we get a pretty big improvement on our benchmark
12240 tests. The code we generate is smaller and more readable.
12242 I did a full two-stage bootstrap. The patch was reviewed
12243 by Martin and Miguel.
12245 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12247 * cs-parser.jay: Make primary_expression not take a QI.
12248 we dont need this because the member_access rule covers
12249 us here. So we replace the rule with just IDENTIFIER.
12251 This has two good effects. First, we remove a s/r conflict.
12252 Second, we allocate many fewer QualifiedIdentifier objects.
12254 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12256 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12257 set the correct information via SRE. This prevents
12258 hanging on the MS runtime. Fixes #29374.
12260 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12262 * convert.cs: correctly handle conversions to value types
12263 from Enum and ValueType as unboxing conversions.
12265 Fixes bug #52569. Patch by Benjamin Jemlich.
12267 2004-01-02 Ravi Pratap <ravi@ximian.com>
12269 * expression.cs (BetterConversion): Prefer int -> uint
12270 over int -> ulong (csc's behaviour). This fixed bug #52046.
12272 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12274 * decl.cs (MemberCache.FindMembers): now returns a
12277 * typemanager.cs: In general, go with with ^^.
12278 (CopyNewMethods): take an IList.
12279 (RealMemberLookup): Only allocate an arraylist
12280 if we copy from two sets of methods.
12282 This change basically does two things:
12283 1) Fewer array lists allocated due to CopyNewMethods.
12284 2) the explicit cast in MemberList costed ALOT.
12286 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12288 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12289 a hashtable to avoid needless string allocations when an identifier is
12290 used more than once (the common case).
12292 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12294 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12295 is broken, it will not return anything. So, we
12296 have to use the information we have in mcs to
12299 * typemanager.cs: Add a cache for GetInterfaces,
12300 since this will now be used more often (due to ^^)
12302 (GetExplicitInterfaces) New method that gets the
12303 declared, not effective, interfaces on a type
12304 builder (eg, if you have interface IFoo, interface
12305 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12308 This patch makes MCS able to bootstrap itself on
12311 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12313 * expression.cs: Remove the Nop's that Miguel put
12316 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12318 * report.cs, codegen.cs: Give the real stack trace to
12319 the error when an exception is thrown.
12321 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12323 * decl.cs: only allocate hashtables for ifaces if
12326 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12328 * expression.cs: fix the error from cs0121-2.cs
12329 (a parent interface has two child interfaces that
12330 have a function with the same name and 0 params
12331 and the function is called through the parent).
12333 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12335 * class.cs, rootcontext.cs, typmanager.cs: do not
12338 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12340 * codegen.cs: remove stack for the ec flow branching.
12341 It is already a linked list, so no need.
12343 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12345 * Makefile: Allow custom profiler here.
12347 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12349 * typemanager.cs (LookupType):
12350 - Use a static char [], because split takes
12351 a param array for args, so it was allocating
12353 - Do not store true in a hashtable, it boxes.
12355 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12357 * flowanalysis.cs: bytify common enums.
12359 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12361 * modifiers.cs: Add a new set of flags for the
12362 flags allowed on explicit interface impls.
12363 * cs-parser.jay: catch the use of modifiers in
12364 interfaces correctly.
12365 * class.cs: catch private void IFoo.Blah ().
12367 All related to bug #50572.
12369 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12371 * decl.cs: Rewrite the consistant accessability checking.
12372 Accessability is not linear, it must be implemented in
12373 a tableish way. Fixes #49704.
12375 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12377 * expression.cs: Handle negation in a checked context.
12378 We must use subtraction from zero. Fixes #38674.
12380 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12382 * class.cs: Ignore static void main in DLLs.
12383 * rootcontext.cs: Handle the target type here,
12384 since we are have to access it from class.cs
12385 * driver.cs: account for the above.
12387 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12389 * report.cs: Give line numbers and files if available.
12391 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12393 * driver.cs: Implement /addmodule.
12395 * typemanager.cs: Change 'modules' field so it now contains Modules not
12398 2003-12-20 Martin Baulig <martin@ximian.com>
12400 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12401 (FieldBase.IsAssigned): Removed this field.
12402 (FieldBase.SetAssigned): New public method.
12403 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12405 2003-12-20 Martin Baulig <martin@ximian.com>
12407 * expression.cs (LocalVariableReference.DoResolve): Don't set
12408 `vi.Used' if we're called from DoResolveLValue().
12410 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12411 returns the usage vector it just merged into the current one -
12412 pass this one to UsageWarning().
12413 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12414 of the `EmitContext', don't call this recursively on our children.
12416 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12418 * driver.cs: Implement /target:module.
12420 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12422 * support.cs (CharArrayHashtable): New helper class.
12424 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12425 char arrays, not strings, so we can avoid creating a string in
12426 consume_identifier if the identifier is a keyword.
12428 2003-12-16 Martin Baulig <martin@ximian.com>
12430 * statement.cs (LocalInfo.Assigned): Removed this property.
12431 (LocalInfo.Flags): Removed `Assigned'.
12432 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12433 and uses flow analysis.
12434 (Block.UsageWarning): Made this method private.
12435 (Block.Resolve): Call UsageWarning() if appropriate.
12437 * expression.cs (LocalVariableReference.DoResolve): Always set
12438 LocalInfo.Used here.
12440 2003-12-13 Martin Baulig <martin@ximian.com>
12442 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12443 any value here; we're now using flow analysis to figure out
12444 whether a statement/block returns a value.
12446 2003-12-13 Martin Baulig <martin@ximian.com>
12448 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12450 (FlowBranching.MergeFinally): Don't call
12451 `branching.CheckOutParameters()' here, this is called in
12453 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12454 when adding the `finally' vector.
12456 2003-12-13 Martin Baulig <martin@ximian.com>
12459 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12460 actually work and also fix #48962.
12462 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12464 * decl.cs: Do not check System.Object for nested types,
12465 since we know it does not have any. Big bang for buck:
12468 Run 1: 8.35 seconds
12469 Run 2: 8.32 seconds
12470 corlib: 17.99 seconds
12472 Run 1: 8.17 seconds
12473 Run 2: 8.17 seconds
12474 corlib: 17.39 seconds
12476 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12478 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12479 time we are returning 0 members, so we save alot here.
12481 2003-12-11 Martin Baulig <martin@ximian.com>
12483 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12484 `MergeChild()', also just take the `FlowBranching' as argument;
12485 call Merge() on it and return the result.
12486 (FlowBranching.Merge): We don't need to do anything if we just
12489 2003-12-11 Martin Baulig <martin@ximian.com>
12491 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12492 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12493 Maurer for this idea.
12495 2003-12-11 Martin Baulig <martin@ximian.com>
12497 * flowanalysis.cs (MergeResult): This class is now gone; we now
12498 use the `UsageVector' for this. The reason for this is that if a
12499 branching just has one sibling, we don't need to "merge" them at
12500 all - that's the next step to do.
12501 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12504 2003-12-11 Martin Baulig <martin@ximian.com>
12506 Reworked flow analyis and made it more precise and bug-free. The
12507 most important change is that we're now using a special `Reachability'
12508 class instead of having "magic" meanings of `FlowReturns'. I'll
12509 do some more cleanups and optimizations and also add some more
12510 documentation this week.
12512 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12513 largely reworked this class.
12514 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12515 the new `Reachability' class instead of having "magic" values here.
12516 (FlowBranching): We're now using an instance of `Reachability'
12517 instead of having separate `Returns', `Breaks' etc. fields.
12519 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12520 based on flow analysis; ignore the return value of block.Emit ().
12522 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12524 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12525 if they are private.
12527 2003-12-09 Martin Baulig <martin@ximian.com>
12529 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12530 call them directly on the UsageVector.
12532 2003-12-09 Martin Baulig <martin@ximian.com>
12534 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12535 Changed return type from `FlowReturns' to `Reachability'.
12537 2003-12-09 Martin Baulig <martin@ximian.com>
12539 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12540 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12541 `Reachable' fields with a single `Reachability' one.
12543 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12545 * class.cs (FindMembers): Remove foreach's.
12550 Run 1: 8.74 seconds
12551 Run 2: 8.71 seconds
12554 Run 1: 8.64 seconds
12555 Run 2: 8.58 seconds
12558 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12563 This patch does a few things:
12564 1. EmptyStatement is now a singleton, so it is never reallocated.
12565 2. All blah is EmptyStatement constructs have been changed to
12566 blah == EmptyStatement.Value, which is much faster and valid
12567 now that EmptyStatement is a singleton.
12568 3. When resolving a block, rather than allocating a new array for
12569 the non-empty statements, empty statements are replaced with
12570 EmptyStatement.Value
12571 4. Some recursive functions have been made non-recursive.
12572 Mainly the performance impact is from (3), however (1) and (2) are needed for
12573 this to work. (4) does not make a big difference in normal situations, however
12574 it makes the profile look saner.
12579 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12580 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12581 Total memory allocated: 56397 KB
12584 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12585 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12586 Total memory allocated: 55666 KB
12588 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12590 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12591 than the hashtable in a hashtable version
12593 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12594 we always end up concating a string. This results in a huge perf
12595 loss, because many strings have to be tracked by the GC. In this
12596 patch, we first use a hashtable that works with two keys, so that
12597 the strings do not need to be concat'ed.
12601 Run 1: 8.74 seconds
12602 Run 2: 8.71 seconds
12605 Run 1: 8.65 seconds
12606 Run 2: 8.56 seconds
12608 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12610 * Makefile: Add a new target `do-time' that does a quick and simple
12611 profile, leaving easy to parse output.
12613 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12615 * codegen.cs (Init): Create the dynamic assembly with
12616 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12618 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12620 * support.cs: Make the PtrHashtable use only one
12621 instance of its comparer.
12623 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12625 * typemanager.cs: Fix lookup of GetNamespaces.
12627 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12629 * expression.cs: Removed redundant line.
12631 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12632 ArrayLists, use for loops with bounds.
12634 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12637 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12638 arraylists, use for loop with bounds.
12640 The above three changes give us a 0.071 second performance
12641 improvement out of 3.294 seconds down to 3.223. On my machine
12642 the above changes reduced the memory usage by 1,387 KB during
12643 compiler bootstrap.
12645 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12646 QualifiedIdentifiers. Before we created a new string through
12647 concatenation, and mostly later on, the result would be
12648 manipulated by DecomposeQI through string manipulation.
12650 This reduced the compiler memory usage for bootstrapping from
12651 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12652 compile times in 0.05 seconds.
12654 2003-11-28 Dick Porter <dick@ximian.com>
12656 * support.cs: Do string compares with the Invariant culture.
12664 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12665 the comparison is done with the Invariant culture.
12667 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12669 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12670 GetEnumerator method.
12672 (ProbeCollectionType): Iterate starting at the most specific type
12673 upwards looking for a GetEnumerator
12675 * expression.cs: Shift count can be up to 31 for int/uint and 63
12678 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12680 * statement.cs (Block.LookupLabel): Also look for the label on the
12681 children blocks. Use a hash table to keep track of visited
12684 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12685 we actually did transform the other operand, otherwise fall back
12686 to the common codepath that casts to long.
12688 * cs-tokenizer.cs: Use the same code pattern as the int case.
12689 Maybe I should do the parsing myself, and avoid depending on the
12690 Parse routines to get this done.
12692 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12694 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12695 which fixes bug 51347. This time test it.
12697 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12698 attributes for example can not tell the difference between these.
12699 The difference was only a syntax feature of the language.
12701 * attribute.cs: Apply attributes to delegates.
12703 * delegate.cs: Call the apply attributes method.
12705 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12707 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12708 comparing 0 vs Byte.MinValue, not the value
12710 (ImplicitConversionRequired): When reporting a conversion error,
12711 use error 31 to print out the constant error instead of the
12714 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12715 which fixes bug 51347.
12717 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12719 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12720 which fixes the -warnaserror command line option.
12722 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12724 * cfold.cs (DoNumericPromotions): During constant folding of
12725 additions on UIntConstant, special case intconstants with
12726 IntConstants like we do on the expression binary operator.
12728 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12730 * convert.cs (ImplicitReferenceConversion): We were missing a case
12731 (System.Enum are not value types or class types, so we need to
12732 classify them separatedly).
12734 * driver.cs: We do not support error 2007.
12736 2003-11-12 Jackson Harper <jackson@ximian.com>
12738 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12739 system directory. Also use the full file name so users can
12740 libraries names mscorlib-o-tron.dll in a non system dir.
12742 2003-11-10 Martin Baulig <martin@ximian.com>
12744 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12745 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12746 calling `ResolveType()' on them, directly assign their `Type'.
12748 2003-11-08 Martin Baulig <martin@ximian.com>
12750 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12751 return value and the `out parent' parameter.
12752 (TypeContainer.DefineType): Moved the CS0644 check into
12753 GetClassBases(). Don't pass the interface types to the
12754 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12755 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12757 * ecore.cs (TypeExpr.IsAttribute): New property.
12758 (TypeExpr.GetInterfaces): New method.
12760 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12761 TypeExpr instead of a Type.
12762 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12763 (Interface.DefineType): Don't pass the interface types to the
12764 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12765 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12767 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12768 instead of a `Type[]'.
12769 (TypeManager.RegisterBuilder): Likewise.
12770 (TypeManager.AddUserInterface): Likewise.
12771 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12772 `Type[]' and also return a `TypeExpr[]'.
12773 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12775 2003-11-08 Martin Baulig <martin@ximian.com>
12777 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12780 2003-11-08 Martin Baulig <martin@ximian.com>
12782 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12783 TypeManager.ResolveExpressionTypes().
12785 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12786 instead of an Expression.
12787 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12788 (TypeExpression): New public class; formerly known as `TypeExpr'.
12790 * expression.cs (ComposedCast): Derive from TypeExpr.
12792 * typemanager.cs (TypeManager.system_*_expr): These are now
12793 TypExpr's instead of Expression's.
12794 (TypeManager.ResolveExpressionTypes): New public static function;
12795 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12798 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12800 * expression.cs (New.DoResolve): Do not dereference value that
12801 might be a null return.
12803 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12804 sure that the constant value has the right type. Fixes an
12805 unreported bug, similar to 50425.
12807 * const.cs (Const.LookupConstantValue): Call
12808 ImplicitStandardConversionExists before doing a conversion to
12809 avoid havng the TypeManager.ChangeType do conversions.
12811 Reduced the number of casts used
12813 (Const.ChangeType): New routine to enable reuse of the constant
12814 type changing code from statement.
12816 * typemanager.cs (ChangeType): Move common initialization to
12817 static global variables.
12821 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12822 every value type to go through, even if it was void. Fix that.
12824 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12825 character of the define, and the is_identifier_part_character for
12826 the rest of the string.
12828 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12830 * expression.cs (UnaryMutator.EmitCode): When I updated
12831 LocalVariableReference.DoResolve, I overdid it, and dropped an
12832 optimization done on local variable references.
12834 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12836 * ecore.cs: Convert the return from Ldlen into an int.
12838 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12840 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12841 the accessibility, this is a special case for toplevel non-public
12842 classes (internal for instance).
12844 2003-10-20 Nick Drochak <ndrochak@gol.com>
12846 * ecore.cs: Fix typo and build. Needed another right paren.
12848 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12850 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12851 `internal' case regular and protected, but not allowing protected
12852 to be evaluated later. Bug 49840
12854 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12856 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12857 to kb.Nlast, and not the kb.nFirst to isolate the switch
12860 Extract the underlying type, so enumerations of long/ulong are
12861 treated like long/ulong.
12863 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12865 * expression.cs (New): Overload the meaning of RequestedType to
12866 track the possible creation of the NewDelegate type, since
12867 DoResolve is invoked more than once for new constructors on field
12870 See bugs: #48800 and #37014
12872 * cs-parser.jay (declare_local_constants): Take an arraylist
12873 instead of a single constant.
12875 (local_constant_declaration): It should take a
12876 constant_declarators, not a constant_declarator. Fixes 49487
12878 * convert.cs: Fix error report.
12880 2003-10-13 Jackson Harper <jackson@ximian.com>
12882 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12885 2003-10-09 Martin Baulig <martin@ximian.com>
12887 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12889 (MethodCore.DoDefineParameters): Removed the TypeContainer
12890 argument; use the DeclSpace which was passed to the .ctor instead.
12891 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12892 TypeContainer; we only need a DeclSpace here.
12894 2003-10-09 Martin Baulig <martin@ximian.com>
12896 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12898 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12899 EmitContext's .ctor.
12901 2003-10-09 Martin Baulig <martin@ximian.com>
12903 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12904 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12905 AsAccessible(), moved them as well.
12907 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12909 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12911 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12913 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12915 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12916 generation for >=, as spotted by Paolo, bug 48679.
12917 Patch from David Waite.
12919 * cs-tokenizer.cs: Add handling for #pragma.
12921 * cs-parser.jay: Allow for both yield and yield return in the
12922 syntax. The anti-cobolization of C# fight will go on!
12924 * class.cs (TypeBuilder.DefineType): Catch error condition here
12925 (Parent.DefineType erroring out and returning null).
12927 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12928 coping with enumerations variables, we were mistakenly processing
12929 them as a regular value type instead of built-in types. Fixes the
12932 * typemanager.cs (IsBuiltinOrEnum): New method.
12934 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12936 * cs-parser.jay: Upgrade: yield now needs the return clause.
12938 2003-09-19 Martin Baulig <martin@ximian.com>
12940 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12941 `MemberCache parent' argument. Normally, an interface doesn't
12942 have a parent type except System.Object, but we use this in gmcs
12943 for generic type parameters.
12945 2003-09-18 Martin Baulig <martin@ximian.com>
12947 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12948 on `type.IsInterface'; don't check whether the type has a parent
12949 to determine whether it's an interface.
12951 2003-09-15 Martin Baulig <martin@ximian.com>
12953 * class.cs (TypeContainer.DefineType): Added an error flag to
12954 avoid reporting duplicate CS0146's ("class definition is
12957 * driver.cs (Driver.MainDriver): Abort if
12958 RootContext.ResolveTree() reported any errors.
12960 2003-09-07 Martin Baulig <martin@ximian.com>
12962 * report.cs (Error, Warning): Added overloaded versions which take
12963 a `params object[] args' and call String.Format().
12965 2003-09-07 Martin Baulig <martin@ximian.com>
12967 * decl.cs (DeclSpace..ctor): Don't call
12968 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12969 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12970 (DeclSpace.RecordDecl): New method.
12972 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12974 2003-09-02 Ravi Pratap <ravi@ximian.com>
12976 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12977 value attributes to be applied to ParameterBuilders.
12979 * class.cs (MethodCore.LabelParameters): Make static and more
12980 generic so that it can be used from other places - like interface
12981 methods, for instance.
12983 * interface.cs (Interface.Emit): Call LabelParameters before
12984 emitting attributes on the InterfaceMethod.
12986 2003-08-26 Martin Baulig <martin@ximian.com>
12988 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12989 resolving aliases; fixes #47927.
12991 2003-08-26 Martin Baulig <martin@ximian.com>
12993 * statement.cs (Using.DoResolve): This is internally emitting a
12994 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12995 do not always return. Fixes #47681.
12997 2003-08-26 Martin Baulig <martin@ximian.com>
12999 * decl.cs (MemberCore): Moved WarningNotHiding(),
13000 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13002 (AdditionResult): Make this nested in DeclSpace.
13003 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13004 argument; call NamespaceEntry.Define() unless we're nested in a
13007 * namespace.cs (Namespace.DefineName): New public function. This
13008 is called from DeclSpace's .ctor to add
13009 (Namespace.Lookup): Include DeclSpaces in the lookup.
13011 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13013 * const.cs (Const): Derive from MemberBase, not MemberCore.
13015 2003-08-25 Martin Baulig <martin@ximian.com>
13017 * convert.cs (Convert.ExplicitReferenceConversion): When
13018 converting from an interface type to a class, unbox if the target
13019 type is a struct type. Fixes #47822.
13021 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13023 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13026 2003-08-22 Martin Baulig <martin@ximian.com>
13028 * class.cs (TypeManager.DefineType): When defining a nested type,
13029 call DefineType() on our parent; fixes #47801.
13031 2003-08-22 Martin Baulig <martin@ximian.com>
13033 * class.cs (MethodData.Define): While checking if a method is an
13034 interface implementation, improve the test a bit more to fix #47654.
13036 2003-08-22 Martin Baulig <martin@ximian.com>
13038 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13039 correctly; fixes #47722.
13041 2003-08-22 Martin Baulig <martin@ximian.com>
13043 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13044 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13046 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13048 2003-08-22 Martin Baulig <martin@ximian.com>
13050 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13051 can only be assigned in static constructors. Fixes #47161.
13053 2003-08-22 Martin Baulig <martin@ximian.com>
13055 Rewrote and improved the flow analysis code.
13057 * flowbranching.cs (FlowBranching): Make this class abstract.
13058 (FlowBranching.CreateBranching): New static function to create a
13059 new flow branching.
13060 (FlowBranchingBlock, FlowBranchingException): New classes.
13061 (FlowBranching.UsageVector.Type): New public readonly field.
13062 (FlowBranching.UsageVector.Breaks): Removed the setter.
13063 (FlowBranching.UsageVector.Returns): Removed the setter.
13064 (FlowBranching.UsageVector): Added Break(), Return(),
13065 NeverReachable() and Throw() methods to modify the reachability.
13066 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13067 done by FlowBranching.Merge().
13068 (FlowBranching.UsageVector.MergeChild): New method; merges the
13069 merge result into the current vector.
13070 (FlowBranching.Merge): New abstract method to merge a branching.
13072 2003-08-12 Martin Baulig <martin@ximian.com>
13074 * expression.cs (Indirection.CacheTemporaries): Create the
13075 LocalTemporary with the pointer type, not its element type.
13077 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13079 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13080 token was a keyword or not.
13082 Add `error' options where an IDENTIFIER was expected; Provide
13083 CheckToken and CheckIdentifierToken convenience error reporting
13086 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13088 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13089 NameSpaceEntry NameSpaceEntry.
13091 (LookupInterfaceOrClass): Avoid creating a full qualified name
13092 from namespace and name: avoid doing lookups when we know the
13093 namespace is non-existant. Use new Tree.LookupByNamespace which
13094 looks up DeclSpaces based on their namespace, name pair.
13096 * driver.cs: Provide a new `parser verbose' to display the
13097 exception thrown during parsing. This is turned off by default
13098 now, so the output of a failure from mcs is more graceful.
13100 * namespace.cs: Track all the namespaces defined in a hashtable
13103 (IsNamespace): New method
13105 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13107 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13108 we know that we need to concatenate (full typename can never be
13113 * statement.cs: Use a bitfield; Do not initialize to null things
13114 which are done by the constructor by default.
13116 * cs-parser.jay: bug fix, parameter was 4, not 3.
13118 * expression.cs: Just use the property;
13120 * statement.cs: No need for GetVariableInfo method.
13122 2003-08-08 Martin Baulig <martin@ximian.com>
13124 * flowanalysis.cs (FlowReturns): This is now nested in the
13125 `FlowBranching' class.
13126 (MyBitVector): Moved this here from statement.cs.
13127 (FlowBranching.SiblingType): New enum type.
13128 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13130 2003-08-07 Martin Baulig <martin@ximian.com>
13132 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13133 `FlowBranching' class and called `BranchingType'.
13135 2003-08-07 Martin Baulig <martin@ximian.com>
13137 * flowanalysis.cs: Moved all the control flow analysis code into
13140 2003-08-07 Martin Baulig <martin@ximian.com>
13142 * assign.cs (Assign.DoResolve): `target' must either be an
13143 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13146 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13148 * expression.cs (BinaryMethod): This kind of expression is created by the
13149 Binary class if it determines that the operator has to be handled
13152 (BinaryDelegate): This kind of expression is created if we are
13153 dealing with a + or - operator on delegates.
13155 (Binary): remove method, argumetns, and DelegateOperator: when
13156 dealing with methods,
13158 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13160 * statement.cs (Block): use bitfields for the three extra booleans
13161 we had in use. Remove unused topblock parameter.
13163 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13165 * assign.cs: Drop extra unneeded tests.
13167 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13169 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13171 * statement.cs (Foreach): Use VariableStorage instead of
13174 * codegen.cs (VariableStorage): New class used by clients that
13175 require a variable stored: locals or fields for variables that
13176 need to live across yield.
13178 Maybe provide a convenience api for EmitThis+EmitLoad?
13180 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13183 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13185 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13186 RemapParameterLValue): New methods that are used to turn a
13187 precomputed FieldInfo into an expression like this:
13191 The idea is to use this instead of making LocalVariableReference
13192 have more than one meaning.
13194 * cs-parser.jay: Add error production to BASE.
13196 * ecore.cs: Deal with TypeManager.GetField returning null, which
13197 is now a valid return value.
13199 (FieldExprNoAddress): New expression for Fields whose address can
13202 * expression.cs (LocalVariableReference): During the resolve
13203 phases, create new expressions if we are in a remapping context.
13204 Remove code that dealt with remapping here.
13206 (ParameterReference): same.
13208 (ProxyInstance): New expression, like the `This' expression, but
13209 it is born fully resolved. We know what we are doing, so remove
13210 the errors that are targeted to user-provided uses of `this'.
13212 * statement.cs (Foreach): our variable is now stored as an
13213 Expression; During resolution, follow the protocol, dont just
13214 assume it will return this.
13216 2003-08-06 Martin Baulig <martin@ximian.com>
13218 * support.cs (SeekableStreamReader.cs): New public class.
13220 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13221 SeekableStreamReader instead of the normal StreamReader.
13223 2003-08-04 Martin Baulig <martin@ximian.com>
13225 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13226 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13227 deambiguate casts and delegate invocations.
13228 (parenthesized_expression): Use the new tokens to ensure this is
13229 not a cast of method invocation.
13231 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13232 when reading a `)' and Deambiguate_CloseParens () was previously
13235 * expression.cs (ParenthesizedExpression): New class. This is
13236 just used for the CS0075 test.
13237 (Binary.DoResolve): Check for CS0075.
13239 2003-07-29 Ravi Pratap <ravi@ximian.com>
13241 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13242 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13243 reference comparison.
13245 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13246 examine the ReturnType for equality - this is necessary in the
13247 cases of implicit and explicit operators whose signature also
13248 includes the return type.
13250 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13252 * namespace.cs: Cache the result of the namespace computation,
13253 instead of computing it every time.
13255 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13257 * decl.cs: Use a global arraylist that we reuse over invocations
13258 to avoid excesive memory consumption. Reduces memory usage on an
13259 mcs compile by one meg (45 average).
13261 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13262 private, work around that.
13264 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13266 * literal.cs (IntLiteral): Define Zero and One static literals.
13268 * cs-parser.jay (integer_literal): use static literals to reduce
13269 memory usage for the most used literals (0, 1 and -1). 211kb
13270 reduced in memory usage.
13272 Replace all calls to `new ArrayList' with `new
13273 ArrayList(4)' which is a good average number for most allocations,
13274 and also requires only 16 bytes of memory for its buffer by
13277 This reduced MCS memory usage in seven megabytes for the RSS after
13280 2003-07-28 Ravi Pratap <ravi@ximian.com>
13282 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13283 handle params methods the correct way by forming only one
13284 applicable set with params and normal methods in them. Earlier we
13285 were looking at params methods only if we found no normal methods
13286 which was not the correct thing to do.
13288 (Invocation.BetterFunction): Take separate arguments indicating
13289 when candidate and the best method are params methods in their
13292 This fixes bugs #43367 and #46199.
13294 * attribute.cs: Documentation updates.
13296 (CheckAttribute): Rename to CheckAttributeTarget.
13297 (GetValidPlaces): Rename to GetValidTargets.
13299 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13300 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13304 2003-07-28 Martin Baulig <martin@ximian.com>
13306 * class.cs (TypeContainer.DefineMembers): Use the base type's full
13307 name when looking up the base class of a nested class. Fixes #46977.
13309 2003-07-26 Martin Baulig <martin@ximian.com>
13311 * expression.cs (Indexers.Indexer): New nested struct; contains
13312 getter, setter and the indexer's type.
13313 (Indexers.Properties): This is now an ArrayList of
13314 Indexers.Indexer's.
13315 (IndexerAccess.DoResolveLValue): Correctly set the type if the
13316 indexer doesn't have any getters.
13318 * assign.cs (Assign.DoResolve): Also do the implicit conversions
13319 for embedded property and indexer assignments.
13321 2003-07-26 Martin Baulig <martin@ximian.com>
13323 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13324 preprocessor directive is not the first non-whitespace character
13327 2003-07-26 Martin Baulig <martin@ximian.com>
13329 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13330 namespace parsing, follow the spec more closely.
13332 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13333 NamespaceEntry.Lookup().
13335 2003-07-25 Martin Baulig <martin@ximian.com>
13337 * MethodCore.cs (OverridesSomething): New public field; it's set
13338 from TypeContainer.DefineMembers if this method overrides
13339 something (which doesn't need to be a method). Fix #39462.
13341 2003-07-25 Ravi Pratap <ravi@ximian.com>
13343 * typemanager.cs (GetMembers): Ensure that the list of members is
13344 reversed. This keeps things in sync.
13346 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13347 find an AttributeUsage attribute.
13349 * expression.cs (Invocation.OverloadResolve): Perform the check
13350 which disallows Invoke to be directly called on a Delegate.
13352 (Error_InvokeOnDelegate): Report error cs1533.
13354 2003-07-25 Martin Baulig <martin@ximian.com>
13356 * expression.cs (Indexers.GetIndexersForType): Only look in the
13357 interface hierarchy if the requested type is already an
13358 interface. Fixes #46788 while keeping #46502 fixed.
13360 2003-07-25 Martin Baulig <martin@ximian.com>
13362 * class.cs (TypeContainer.DefineMembers): Check whether all
13363 readonly fields have been assigned and report warning CS0649 if
13366 * statement.cs (LocalInfo.IsFixed): Always return true if this is
13369 2003-07-24 Ravi Pratap <ravi@ximian.com>
13371 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13372 returned from GetMethods to make things consistent with the
13373 assumptions MCS makes about ordering of methods.
13375 This should comprehensively fix bug #45127 and it does :-)
13377 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13378 ordering is actually reverse.
13380 * Clean up some debug messages I left lying around.
13382 * interface.cs (Populate*): Get rid of code which emits attributes
13383 since the stage in which we emit attributes is the 'Emit' stage,
13384 not the define stage.
13386 (Emit): Move attribute emission for interface members here.
13388 2003-07-22 Ravi Pratap <ravi@ximian.com>
13390 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13391 closely: we eliminate methods in base types when we have an
13392 applicable method in a top-level type.
13394 Please see section 14.5.5.1 for an exact description of what goes
13397 This fixes bug #45127 and a host of other related to corlib compilation.
13399 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13400 array is the method corresponding to the top-level type (this is
13401 because of the changes made to icall.c) so we change this
13404 (MethodGroupExpr.Name): This too.
13406 * typemanager.cs (GetElementType): New method which does the right
13407 thing when compiling corlib.
13409 * everywhere: Make use of the above in the relevant places.
13411 2003-07-22 Martin Baulig <martin@ximian.com>
13413 * cs-parser.jay (invocation_expression): Moved
13414 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13415 `cast_expression', but create a InvocationOrCast which later
13416 resolves to either an Invocation or a Cast.
13418 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13419 method; call this before EmitStatement() to make sure that this
13420 expression can be used as a statement.
13422 * expression.cs (InvocationOrCast): New class; resolves to either
13423 an Invocation or a Cast.
13425 * statement.cs (StatementExpression): Call ResolveStatement() on
13426 the ExpressionStatement before emitting it.
13428 2003-07-21 Martin Baulig <martin@ximian.com>
13430 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13431 `ref' and `out' attributes match; fixes #46220.
13432 (MemberAccess.ResolveMemberAccess): You can't reference a type
13433 through an expression; fixes #33180.
13434 (Indexers.GetIndexersForType): Don't return the indexers from
13435 interfaces the class implements; fixes #46502.
13437 2003-07-21 Martin Baulig <martin@ximian.com>
13439 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13440 CS0661 checks; fixes bug #30442.
13442 2003-07-21 Martin Baulig <martin@ximian.com>
13444 * decl.cs (AdditionResult): Added `Error'.
13446 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13448 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13449 makes cs0031.cs actually work.
13451 2003-07-20 Martin Baulig <martin@ximian.com>
13453 * namespace.cs: Fixed that bug which caused a crash when compiling
13454 the debugger's GUI.
13456 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13458 * typemanager.cs (LookupTypeReflection): Never expose types which
13459 are NotPublic, NestedPrivate, NestedAssembly, or
13460 NestedFamANDAssem. We used to return these, and later do a check
13461 that would report a meaningful error, but the problem is that we
13462 would not get the real match, if there was a name override.
13464 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13466 * namespace.cs (Namespace, Name): Do not compute the namespace
13467 name dynamically, compute it in the constructor. This reduced
13468 memory usage by 1697 KB.
13470 * driver.cs: Use --pause to pause at the end.
13472 2003-07-17 Peter Williams <peter@newton.cx>
13474 * Makefile: Change the name of the test target so that it doesn't
13475 conflict with the recursive test target.
13477 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13479 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13480 AddressOf): Do not use EmitThis, that was wrong, use the actual
13483 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13485 * class.cs (MethodData.Define): While checking if a method is an
13486 interface implementation, improve the test: If we are not public
13487 (use new test here: use the computed MethodAttributes directly,
13488 instead of the parsed modifier flags) check if the `implementing'
13489 method comes from an interface or not.
13491 * pending.cs (VerifyPendingMethods): Slightly better error
13494 * makefile: add test target that does the mcs bootstrap.
13496 2003-07-16 Ravi Pratap <ravi@ximian.com>
13498 * interface.cs (Define): Do nothing here since there are no
13499 members to populate etc. Move the attribute emission out of here
13500 since this was just totally the wrong place to put it. Attribute
13501 application happens during the 'Emit' phase, not in the 'Define'
13504 (Emit): Add this method and move the attribute emission here
13506 * rootcontext.cs (EmitCode): Call the Emit method on interface
13509 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13511 * expression.cs (OverloadResolve): Report error only if Location
13512 is not 'Null' which means that there was a probe going on.
13514 2003-07-14 Martin Baulig <martin@ximian.com>
13516 * expression.cs (ConditionalLogicalOperator): New public class to
13517 implement user defined conditional logical operators.
13518 This is section 14.11.2 in the spec and bug #40505.
13520 2003-07-14 Martin Baulig <martin@ximian.com>
13522 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13524 2003-07-14 Martin Baulig <martin@ximian.com>
13526 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13528 * ecore.cs (IVariable.VerifyFixed): New interface method.
13530 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13531 operator, check whether the variable is actually fixed. Fixes bug
13532 #36055. Set a variable definitely assigned when taking its
13533 address as required by the spec.
13535 * statement.cs (LocalInfo.IsFixed): New field.
13536 (LocalInfo.MakePinned): Set `IsFixed' to true.
13538 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13540 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13541 for .ctors, ensure that we only ask for members declared in the
13542 attribute type (BindingFlags.DeclaredOnly).
13546 * expression.cs (Error_WrongNumArguments): Report error 1501
13547 correctly the way CSC does.
13549 2003-07-13 Martin Baulig <martin@ximian.com>
13551 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13552 lookup on the fully qualified name, to make things like "X.X" work
13553 where "X.X" is a fully qualified type name, but we also have a
13554 namespace "X" in the using list. Fixes #41975.
13556 2003-07-13 Martin Baulig <martin@ximian.com>
13558 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13559 function. If we're a CompoundAssign, we need to create an embedded
13560 CompoundAssign, not an embedded Assign.
13561 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13564 2003-07-13 Martin Baulig <martin@ximian.com>
13566 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13567 work to fix bug #46088.
13569 2003-07-13 Ravi Pratap <ravi@ximian.com>
13571 * class.cs (Operator.Emit): Do not emit attributes here - it is
13572 taken care of by the Method class that we delegate too. This takes
13573 care of bug #45876.
13575 2003-07-10 Martin Baulig <martin@ximian.com>
13577 * expression.cs (TypeOfVoid): New class.
13578 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13580 2003-07-10 Martin Baulig <martin@ximian.com>
13582 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13585 2003-07-10 Martin Baulig <martin@ximian.com>
13587 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13588 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13590 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13592 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13594 2003-07-10 Martin Baulig <martin@ximian.com>
13596 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13597 of decimal. Fixes #42850.
13599 NOTE: I also fixed the created byte blob, but this doesn't work on
13600 the MS runtime and csc never produces any byte blobs for decimal
13603 2003-07-10 Martin Baulig <martin@ximian.com>
13605 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13606 structs; fixes #32068.
13607 (Block.AddChildVariableNames): Fixed #44302.
13609 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13611 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13613 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13615 * attribute.cs: And this test is onger needed.
13617 2003-07-08 Martin Baulig <martin@ximian.com>
13619 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13620 inaccessible types. Fixes #36313.
13622 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13624 * namespace.cs (NamespaceEntry): Create implicit entries for all
13625 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13626 implicit entries for N1.N2 and N1.
13628 2003-07-08 Martin Baulig <martin@ximian.com>
13630 Rewrote the handling of namespaces to fix a lot of the issues
13631 wrt. `using' aliases etc.
13633 * namespace.cs (Namespace): Splitted this class into a
13634 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13636 * typemanager.cs (TypeManager.IsNamespace): Removed.
13637 (TypeManager.ComputeNamespaces): Only compute namespaces from
13638 loaded assemblies here, not the namespaces from the assembly we're
13639 currently compiling.
13641 2003-07-08 Martin Baulig <martin@ximian.com>
13643 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13645 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13647 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13650 I thought about the memory savings here, but LookupTypeReflection
13651 is used under already very constrained scenarios. Compiling
13652 corlib or mcs only exposes one hit, so it would not really reduce
13653 any memory consumption.
13655 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13657 * typemanager.cs: fixes bug #45889 by only adding public types from
13658 other assemblies to the list of known types.
13660 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13662 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13663 on the type we resolved.
13665 2003-07-05 Martin Baulig <martin@ximian.com>
13667 * pending.cs (PendingImplementation.ParentImplements): Don't
13668 create the proxy if the parent is abstract.
13670 * class.cs (TypeContainer.DefineIndexers): Process explicit
13671 interface implementations first. Fixes #37714.
13673 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13675 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13676 defined recursively; but since we modify the input parameters
13677 (left is set to `this' temporarily), we reset this value if the
13678 left_is_explicit is false, which gives the original semantics to
13681 * literal.cs (NullPointer): new class used to represent a null
13682 literal in a pointer context.
13684 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13685 type is a pointer, use a NullPointer object instead of a
13686 NullLiteral. Closes 43687
13688 (ExplicitConversion): Convert pointer values using
13689 the conv opcode to the proper type.
13691 * ecore.cs (New): change ValueTypeVariable property into a method,
13692 that returns whether the valuetype is suitable for being used.
13694 * expression.cs (Binary.DoNumericPromotions): Only return if we
13695 the int constant was a valid uint, and we can return both left and
13696 right as uints. If not, we continue processing, to trigger the
13697 type conversion. This fixes 39018.
13699 * statement.cs (Block.EmitMeta): During constant resolution, set
13700 the CurrentBlock property on the emitcontext, so that we resolve
13701 constants propertly.
13703 2003-07-02 Martin Baulig <martin@ximian.com>
13705 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13706 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13708 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13709 than emitting it here.
13711 * statement.cs: Fixed some more flow analysis bugs.
13713 2003-07-02 Martin Baulig <martin@ximian.com>
13715 * class.cs (MethodData.Define): When implementing interface
13716 methods, set Final unless we're Virtual.
13718 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13719 check work for interface methods.
13721 2003-07-01 Martin Baulig <martin@ximian.com>
13723 * ecore.cs (EmitContext.This): Replaced this property with a
13724 GetThis() method which takes a Location argument. This ensures
13725 that we get the correct error location for a CS0188.
13727 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13729 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13730 ImplicitStandardConversion.
13732 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13734 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13736 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13739 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13741 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13744 (MethodData.Define): Turn off initlocals for unsafe methods.
13746 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13748 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13749 complete; Fixes #37521.
13751 * delegate.cs: Use Modifiers.TypeAttr to compute the
13752 TypeAttributes, instead of rolling our own. This makes the flags
13753 correct for the delegates.
13755 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13757 * class.cs (Constructor.Define): Set the private flag for static
13758 constructors as well.
13760 * cs-parser.jay (statement_expression): Set the return value to
13761 null, to avoid a crash when we catch an error.
13763 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13765 * cs-parser.jay: Applied patch from Jackson that adds support for
13766 extern and unsafe modifiers to destructor declarations.
13768 * expression.cs: Report error 21 if the user is trying to index a
13771 * driver.cs: Add an error message, suggested by the bug report.
13773 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13774 if we do not have a ": this ()" constructor initializer. Fixes 45149
13776 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13778 * namespace.cs: Add some information to reduce FAQs.
13780 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13782 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13783 underlying enumeration types. Fixes #43915.
13785 * expression.cs: Treat ushort/short as legal values to be used in
13786 bitwise operations.
13788 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13790 * delegate.cs: transfer custom attributes for paramenters from
13791 the delegate declaration to Invoke and BeginInvoke.
13793 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13795 * attribute.cs: handle custom marshalers and emit marshal info
13798 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13800 * makefile.gnu: Added anonymous.cs to the compiler sources.
13802 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13804 * iterators.cs: Change the name of the proxy class to include two
13807 * cs-parser.jay: Update grammar to include anonymous methods.
13809 * anonymous.cs: new file.
13811 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13813 * class.cs (Field.Define): Add missing test for pointers and
13816 2003-05-27 Ravi Pratap <ravi@ximian.com>
13818 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13819 we use the stobj opcode.
13821 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13822 since it wasn't the correct fix.
13824 It still is puzzling that we are required to use stobj for IntPtr
13825 which seems to be a ValueType.
13827 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13829 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13830 during regular simple name resolution. Now, the trick is that
13831 instead of returning for processing the simplename, we do a
13832 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13833 contextual lookup type). If a match is found, return that, if
13834 not, return for further composition.
13836 This fixes long-standing 30485.
13838 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13839 using the address to initialize an object, do an Stobj instead of
13840 using the regular Stelem.
13842 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13843 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13844 Because if we are a BaseIndexerAccess that value will be true.
13847 * statement.cs (GotoCase.Resolve): Return after reporting an
13848 error, do not attempt to continue.
13850 * expression.cs (PointerArithmetic.Emit): If our operand is a
13851 long, convert our constants to match the operand before
13852 multiplying. Convert to I type before adding. Fixes 43670.
13854 2003-05-14 Ravi Pratap <ravi@ximian.com>
13856 * enum.cs (ImplicitConversionExists) : Rename to
13857 ImplicitEnumConversionExists to remove ambiguity.
13859 * ecore.cs (NullCast): New type of cast expression class which
13860 basically is very similar to EmptyCast with the difference being
13861 it still is a constant since it is used only to cast a null to
13863 (eg. (string) null)
13865 * convert.cs (ImplicitReferenceConversion): When casting a null
13866 literal, we return a NullCast.
13868 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13869 should be around anymore.
13871 The renaming (reported was slightly wrong). Corrections:
13873 ConvertImplicitStandard -> ImplicitConversionStandard
13874 ConvertExplicitStandard -> ExplicitConversionStandard
13876 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13877 before passing them in !
13879 * convert.cs (ImplicitConversionStandard): When comparing for
13880 equal expr and target types, ensure that expr is not a
13883 In general, we must not be checking (expr_type ==
13884 target_type) in the top level conversion methods
13885 (ImplicitConversion, ExplicitConversion etc). This checking is
13886 done in the methods that they delegate to.
13888 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13890 * convert.cs: Move Error_CannotConvertType,
13891 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13892 ImplicitNumericConversion, ImplicitConversionExists,
13893 ImplicitUserConversionExists, StandardConversionExists,
13894 FindMostEncompassedType, FindMostSpecificSource,
13895 FindMostSpecificTarget, ImplicitUserConversion,
13896 ExplicitUserConversion, GetConversionOperators,
13897 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13898 TryImplicitIntConversion, Error_CannotConvertImplicit,
13899 ConvertImplicitRequired, ConvertNumericExplicit,
13900 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13901 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13904 Perform the following renames:
13906 StandardConversionExists -> ImplicitStandardConversionExists
13907 ConvertImplicit -> ImplicitConversion
13908 ConvertImplicitStandard -> ImplicitStandardConversion
13909 TryImplicitIntConversion -> ImplicitIntConversion
13910 ConvertImplicitRequired -> ImplicitConversionRequired
13911 ConvertNumericExplicit -> ExplicitNumericConversion
13912 ConvertReferenceExplicit -> ExplicitReferenceConversion
13913 ConvertExplicit -> ExplicitConversion
13914 ConvertExplicitStandard -> ExplicitStandardConversion
13916 2003-05-19 Martin Baulig <martin@ximian.com>
13918 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13919 (TypeInfo): Added support for structs having structs as fields.
13921 * ecore.cs (FieldExpr): Implement IVariable.
13922 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13923 VariableInfo for the field.
13925 2003-05-18 Martin Baulig <martin@ximian.com>
13927 * expression.cs (This.DoResolve): Report a CS0027 if we're
13928 emitting a field initializer.
13930 2003-05-18 Martin Baulig <martin@ximian.com>
13932 * expression.cs (This.ResolveBase): New public function.
13933 (This.DoResolve): Check for CS0188.
13935 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13938 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13939 `instance_expression' to null if we don't have any non-static
13942 2003-05-18 Martin Baulig <martin@ximian.com>
13944 Reworked the way how local variables and parameters are handled by
13945 the flow analysis code.
13947 * statement.cs (TypeInfo, VariableMap): New public classes.
13948 (VariableInfo): New public class. This is now responsible for
13949 checking whether a variable has been assigned. It is used for
13950 parameters and local variables.
13951 (Block.EmitMeta): Take the InternalParameters as argument; compute
13952 the layout of the flow vectors here.
13953 (Block.LocalMap, Block.ParameterMap): New public properties.
13954 (FlowBranching): The .ctor doesn't get the InternalParameters
13955 anymore since Block.EmitMeta() now computes the layout of the flow
13957 (MyStructInfo): This class is now known as `StructInfo' and nested
13958 in `TypeInfo'; we don't access this directly anymore.
13960 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13961 property and removed IsAssigned(), IsFieldAssigned(),
13962 SetAssigned() and SetFieldAssigned(); we now call them on the
13963 VariableInfo so we don't need to duplicate this code everywhere.
13965 * expression.cs (ParameterReference): Added `Block block' argument
13967 (LocalVariableReference, ParameterReference, This): The new
13968 VariableInfo class is now responsible for all the definite
13971 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13972 IsParameterAssigned, SetParameterAssigned): Removed.
13974 2003-05-18 Martin Baulig <martin@ximian.com>
13976 * typemanager.cs (InitCoreTypes): Try calling
13977 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13978 the 3-args-version. Corlib now also needs our `void_type'.
13979 (GetMethod): Added overloaded version which takes an optional
13980 `bool report_errors' to allow lookups of optional methods.
13982 2003-05-12 Martin Baulig <martin@ximian.com>
13984 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13985 only used for locals and not for parameters.
13987 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13989 * support.cs (InternalParameters.ParameterType): Return the
13990 ExternalType of the parameter.
13992 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13995 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13997 * class.cs (MethodData.Define): Do not set the `newslot' on
13998 interface members, if they are also flagged as "override".
14000 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14001 better code for ++i and i++. This only works for static fields
14002 and local variables.
14004 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14005 want to pull the DeclSpace out of the builder_to_declspace instead
14006 of the TypeBuilder (like in TypeContainer.FindMembers).
14008 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14009 instead of LookupTypeContainer. Fixes the crash on .NET for
14010 looking up interface members.
14012 * const.cs: Create our own emit context during the Definition
14013 stage, so that constants are evaluated in the proper context, when
14014 a recursive definition happens.
14016 2003-05-11 Martin Baulig <martin@ximian.com>
14018 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14019 new block for a switch section.
14020 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14021 the adding/lookup in the switch block. Fixes #39828.
14023 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14025 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14026 functionality: I needed to convert the data after I had performed
14027 the add/sub operation into the operands type size.
14029 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14030 pass the type for the box operation, otherwise the resulting
14031 object would have been of type object.
14033 (BoxedCast): Add constructor to specify the type to box as.
14035 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14037 * iterators.cs: I was reusing the `count' variable inadvertently,
14038 take steps to not allow this to happen.
14040 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14042 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14043 by creating an array at the point where the params starts and
14044 putting all those arguments there, then adjusting the size of the
14047 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14049 * expression.cs (New.AddressOf): Implement interface
14050 IMemoryLocation. This is used when the `new' operator is used in
14051 the context of an invocation to a method on a value type.
14053 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14056 * namespace.cs: Also check the using aliases here.
14058 * driver.cs: Move the test for using validity after the types have
14059 been entered, so we do a single pass that also includes the using
14062 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14063 in the regular case. CreateSiblingForFinally is doing extra
14066 * attribute.cs (GetAttributeArgumentExpression): Store the result
14067 on an out value, and use the return value to indicate failure
14068 instead of using null (which is a valid return for Constant.GetValue).
14070 * statement.cs: Perform the analysis flow for the increment
14071 portion after the statement, because this will be the real flow of
14072 execution. Fixes #42385
14074 * codegen.cs (EmitContext.EmitArgument,
14075 EmitContext.EmitStoreArgument): New helper functions when the
14076 RemapToProxy flag is set.
14078 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14081 Add support for remapping parameters.
14083 * iterators.cs: Propagate parameter values; Store parameter
14084 values in the proxy classes.
14086 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14088 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14089 need a proxy reference; I do not know what I was thinking
14091 * cs-parser.jay (constructor_initializer): catch another error,
14092 and display nice message.
14094 (field_declaration): catch void field declaration
14095 to flag a better error.
14097 * class.cs (MemberBase.CheckBase): Report an error instead of a
14098 warning if a new protected member is declared in a struct.
14099 (Field.Define): catch the error of readonly/volatile.
14101 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14103 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14104 volatile variable is taken
14106 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14108 * statement.cs (Fixed.Resolve): Report an error if we are not in
14111 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14113 * typemanager.cs: reuse the code that handles type clashes for
14114 delegates and enumerations.
14116 * class.cs (Report28): Always report.
14118 * expression.cs (EncodeAsAttribute): Allow nulls here.
14120 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14122 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14123 the functionality for testing whether an expression is valid for
14124 an attribute here. Also handle the case of arrays of elements
14127 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14128 encoding a linear array into an array of objects that are suitable
14129 to be passed to an CustomAttributeBuilder.
14131 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14133 * ecore.cs: (FieldExpr): Handle field remapping here.
14135 * iteratators.cs: Pass the instance variable (if the method is an
14136 instance method) to the constructors, so we can access the field
14137 variables on the class.
14139 TODO: Test this with structs. I think the THIS variable on
14140 structs might have to be a pointer, and not a refenrece
14142 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14144 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14145 local variables to fields in a proxy class.
14147 * iterators.cs (PopulateProxy): Rename our internal fields to
14149 Create a <THIS> field if we are an instance method, so we can
14150 reference our parent container variables.
14151 (MapVariable): Called back from the EmitContext code to enter a
14152 new variable to field mapping into the proxy class (we just create
14156 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14157 for using the remapped locals to fields.
14159 I placed the code here, because that gives the same semantics to
14160 local variables, and only changes the Emit code.
14162 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14163 statements inside iterators.
14164 (VariableInfo): Add a FieldBuilder for the cases when we are
14165 remapping local variables to fields in a proxy class
14167 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14168 current_block != null.
14170 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14171 not cope with strings, as it has been moved to the
14172 TableSwitchEmit. Fixed bug in switch generation.
14174 * expression.cs (New.DoResolve): Provide more context for the user
14175 when reporting an error.
14177 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14180 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14181 check the permissions for it. Note than in a type-resolution
14182 context the check was already present in DeclSpace.ResolveType,
14183 but was missing from the MemberAccess.
14185 (ArrayCreation.CheckIndices): warn if the user has
14186 more nested levels of expressions, but there are no more
14187 dimensions specified. Avoids crash on bug 41906.
14189 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14191 * statement.cs (Block): replace Implicit bool, for a generic
14193 New flag: `Unchecked'. This is used during the EmitMeta phase
14194 (which is out-of-line with the regular Resolve/Emit process for a
14195 statement, as this is done ahead of time, but still gets a chance
14196 to call constant resolve).
14198 (Block.Flags): new enum for adding a new flag.
14200 (Block.EmitMeta): track the state of unchecked.
14202 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14203 to enable constant resolution to work there as well.
14205 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14207 * typemanager.cs (ienumerable_type): Also look up
14208 System.Collections.IEnumerable.
14210 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14212 TODO: Test more than one conditional per method.
14214 * class.cs (Indexer.Define): Report the location where the user is
14215 referencing the unsupported feature.
14217 (MethodData): Overload the use of `conditionals' to
14218 minimize the creation of needless ArrayLists. This saves roughly
14219 212kb on my machine.
14221 (Method): Implement the new IIteratorContainer interface.
14222 (Method.SetYields): Implement the method by setting the ModFlags
14223 to contain METHOD_YIELDS.
14225 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14226 which just got set to null.
14228 * iterators.cs: New file.
14230 (Yield, YieldBreak): New statements.
14232 * statement.cs (Return.Resolve): Flag an error if we are used in
14233 an iterator method.
14235 * codegen.cs (InIterator): New flag set if the code is being
14236 compiled in an iterator method.
14238 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14239 internal modifier, and we just use it to avoid adding extra
14240 fields, as this is seldom used.
14242 * cs-parser.jay: Add yield_statement (yield and yield break).
14244 * driver.cs: New flag -v2 to turn on version 2 features.
14246 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14247 hashtable when v2 is enabled.
14249 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14251 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14252 there is already a namespace defined with this name.
14254 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14255 people upgraded their corlibs.
14257 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14258 always use fully qualified types, no need to use the compiler
14261 (TypeManager.IsNamespace): Use binarysearch.
14263 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14264 AddDelegate): I did not quite use the new IsValid API properly: I
14265 have to pass the short-name and the fullname. I was passing only
14266 the basename instead of the fullname sometimes.
14268 (TypeContainer.DefineType): call NamespaceClash.
14270 * interface.cs (Interface.DefineType): use NamespaceClash before
14273 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14276 * enum.cs: (Enum.DefineType): use NamespaceClash before
14279 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14280 speed increase. First, use the negative_hits cache when we get a
14281 negative. Second, add the type with its full original name
14282 instead of the new . and + encoded name (reflection uses + to
14283 separate type from a nested type). Use LookupTypeReflection
14284 directly which bypasses the type->name hashtable (that we already
14285 know does not contain the type.
14287 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14288 location/container type.
14290 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14292 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14294 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14296 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14297 method is being referenced in the method group from a static
14298 context, and report error 120 if so.
14300 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14303 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14304 is created, we create the A namespace).
14306 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14309 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14311 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14312 invocation to ModuleBuilder.GetType with the same values will
14313 return a new type instance, so we need to cache its return
14316 * expression.cs (Binary.ResolveOperator): Only allow the compare
14317 operators on enums if they are of the same type.
14319 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14320 types of ValueType on their own case. Before we were giving them
14321 the same treatment as objects.
14323 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14324 fullname. Short name is used to compare against container name.
14325 Fullname is used to check against defined namespace names.
14327 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14328 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14330 (Method.CheckBase): Call parent.
14331 (MemberBase.CheckBase): Check for protected members on sealed
14333 (PropertyBase.CheckBase): Call parent.
14334 (Field.Define): Call parent.
14336 * report.cs: Negative error codes are now mapped to 8000 - code,
14337 so that the display is render more nicely.
14339 * typemanager.cs: Do not use try/catch, instead report a regular
14342 (GetPointerType, GetReferenceType): These methods provide
14343 mechanisms to obtain the T* and T& from a T. We had the code
14344 previously scattered around the code base, and it also used
14345 TypeManager.LookupType that would go through plenty of caches.
14346 This one goes directly to the type source.
14348 In some places we did the Type.GetType followed by
14349 ModuleBuilder.GetType, but not in others, so this unifies the
14350 processing as well.
14352 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14353 statements now that we have namespace information.
14355 * typemanager.cs (IsNamespace): New method, returns whether the
14356 string presented is a namespace or not.
14358 (ComputeNamespaces): New public entry point, computes the list of
14359 available namespaces, using the GetNamespaces API call in Mono, or
14360 the slower version in MS.NET.
14362 Now before we start the semantic analysis phase, we have a
14363 complete list of namespaces including everything that the user has
14366 Deleted old code to cache namespaces in .nsc files.
14368 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14370 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14371 class/struct location definition Location for the implicit
14372 constructor location.
14374 (Operator.Define): Use the location of the operator for the
14375 implicit Method definition.
14377 (Constructor.Emit): use the constructor location for the implicit
14378 base initializer constructor.
14380 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14381 and the Expression class now contains two new methods:
14383 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14384 isolate type lookup from the rest of the resolution process.
14386 Since we use Expressions to hold type definitions due to the way
14387 we parse the input we have historically overloaded Resolve to
14388 perform the Type lookups if a special flag is passed. Now this is
14389 eliminated and two methods take their place.
14391 The differences in the two methods between xStep and xTerminal is
14392 that xStep is involved in our current lookup system that uses
14393 SimpleNames to compose a name, while xTerminal is used just to
14394 catch the case where the simplename lookup failed.
14396 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14398 * expression.cs (ResolveMemberAccess): Remove redundant code.
14399 TypeExpr expressions are always born fully resolved.
14401 * interface.cs (PopulateMethod): Do not lookup the types twice.
14402 We were doing it once during SemanticAnalysis and once during
14405 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14406 in local variable type definitions, were being returned as a
14407 SimpleName (we decomposed everything into a string), that is
14408 because primary_expression was being used instead of a type in the
14409 grammar (reduce/reduce conflicts).
14411 The part that was wrong is that we converted the expression into a
14412 string (an oversimplification in one hand, compounded with primary
14413 expressions doing string concatenation).
14419 Would return "A.B.C[]" as a SimpleName. This stopped things like
14420 using clauses from working on this particular context. And a type
14421 was being matched directly against "A.B.C[]".
14423 We now use the correct approach, and allow for ComposedCast to be
14424 part of the unary expression. So the "A.B.C []" become a composed
14425 cast of "A.B.C" (as a nested group of MemberAccess with a
14426 SimpleName at the end) plus the rank composition "[]".
14430 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14432 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14433 for the access level checking.
14435 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14436 `TypeContainer container', because I kept getting confused when I
14437 was debugging this code.
14439 * expression.cs (Indexers): Instead of tracking getters/setters,
14440 we now track them in parallel. We create one arraylist less, but
14441 most importantly it is possible now for the LValue code to find a
14442 matching get for a set.
14444 (IndexerAccess.DoResolveLValue): Update the code.
14445 GetIndexersForType has been modified already to extract all the
14446 indexers from a type. The code assumed it did not.
14448 Also make the code set the correct return type for the indexer.
14449 This was fixed a long time ago for properties, but was missing for
14450 indexers. It used to be void_type.
14452 (Binary.Emit): Test first for doubles instead of
14453 floats, as they are more common.
14455 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14456 when dealing with floats and the <=, >= operators. This fixes bug
14459 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14460 to load the array value by emitting a load on the foreach variable
14461 type. This was incorrect.
14463 We now emit the code to load an element using the the array
14464 variable type, and then we emit the conversion operator.
14468 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14470 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14472 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14474 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14475 test for protection before we test for signatures.
14477 (MethodSignature.ToString): implement.
14479 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14480 to the case where we reduced into a LongConstant.
14482 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14483 depend on whether the information is acurrate, because the
14484 Microsoft runtime will always claim that the array type is public,
14485 regardless of the real state.
14487 If the type is a pointer, another problem happens: the type is
14488 reported as non-public in Microsoft.
14490 In both cases we have to call CheckAccessLevel recursively with
14491 the underlying type as the argument to be tested.
14493 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14495 * assign.cs (Assign.Emit): If we are dealing with a compound
14496 assignment expression, we should use the code path that stores the
14497 intermediate result in a temporary value. This fixes #40903.
14499 *expression.cs (Indirection.ToString): Provide ToString method for
14502 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14504 * class.cs: Null out fields holding references to Block objects so
14505 they can be garbage collected.
14507 * expression.cs (OverloadResolve): Remove unused local.
14509 2003-04-07 Martin Baulig <martin@ximian.com>
14511 * codegen.cs (EmitContext.CurrentFile): New public field.
14512 (EmitContext.Mark): Use the CurrentFile to check whether the
14513 location is in the correct file.
14514 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14516 2003-04-07 Martin Baulig <martin@ximian.com>
14518 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14520 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14521 location. [FIXME: The location argument which gets passed to this
14522 method is sometimes wrong!]
14524 2003-04-07 Nick Drochak <ndrochak@gol.com>
14526 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14528 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14530 * expression.cs (Indirection.EmitAssign): We were using the
14531 temporary, but returning immediately instead of continuing the
14534 2003-04-06 Martin Baulig <martin@ximian.com>
14536 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14537 if it's a nested child, but also deriving from the outer class.
14540 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14541 nested child, but also deriving from the outer class. See
14543 (FilterWithClosure): We may access private members of the outer
14544 class if we're a nested child and deriving from the outer class.
14545 (RealMemberLookup): Only set `closure_private_ok' if the
14546 `original_bf' contained BindingFlags.NonPublic.
14548 2003-04-05 Martin Baulig <martin@ximian.com>
14550 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14552 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14554 * class.cs (Event.Define): Do not allow abstract events to have
14557 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14559 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14560 block in event declarations.
14562 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14563 value type, get its address.
14565 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14566 leaving a class on the stack instead of a boolean value (int
14567 0/1). Change the code so we compare against null, and then the
14568 result against zero.
14570 * class.cs (TypeContainer.GetClassBases): We were checking for the
14571 parent class being sealed too late.
14573 * expression.cs (Binary.Emit): For <= and >= when dealing with
14574 floating point values, use cgt.un and clt.un instead of cgt and
14577 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14579 * statement.cs: Apply the same optimization as MS: skip the
14580 GetEnumerator returning an IEnumerator, and use the one returning a
14581 CharEnumerator instead. This allows us to avoid the try-finally block
14584 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14586 * cs-parser.jay: Attributes cannot be applied to
14587 namespaces. Fixes #40473
14589 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14592 (Add*): check if the name is valid using the full name for constants,
14593 fields, properties and events.
14595 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14597 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14598 char constants to be part of the enumeration.
14600 * expression.cs (Conditional.DoResolve): Add support for operator
14601 true. Implements the missing functionality from 14.12
14603 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14604 operator true/false as required by the spec.
14606 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14607 implicit conversion to boolean.
14609 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14610 also one where the type implements `operator true'.
14612 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14613 get an expression that will invoke operator true based on an
14616 (GetConversionOperators): Removed the hack that called op_True
14619 (Expression.ResolveBoolean): Move this from Statement.
14621 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14623 * ecore.cs (FieldExpr): do not allow initialization of initonly
14624 fields on derived classes
14626 2003-03-13 Martin Baulig <martin@ximian.com>
14628 * statement.cs (Block.Emit): Call ig.BeginScope() and
14629 ig.EndScope() when compiling with debugging info; call
14630 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14632 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14634 * expression.cs (Indexers): Do not construct immediately, allow
14635 for new members to be appended as we go. Fixes 38143
14637 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14639 * expression.cs: save/restore context when resolving an unchecked
14642 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14644 * cfold.cs: Catch division by zero in modulus operator during
14647 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14649 * interface.cs (Interface.DefineMembers): Avoid defining members
14652 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14654 * driver.cs: handle the +/- options for -noconfig
14656 * statement.cs (Unckeched.Resolve): Also track the state of
14657 unchecked in the Resolve phase.
14659 2003-02-27 Martin Baulig <martin@ximian.com>
14661 * ecore.cs (Expression.MemberLookup): Don't create a
14662 MethodGroupExpr for something which is not a method. Fixes #38291.
14664 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14666 * class.cs (MemberBase.CheckParameters): Also check that the type
14667 is unmanaged if it is a pointer.
14669 * expression.cs (SizeOf.Resolve): Add location information.
14671 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14672 a managed type is declared.
14674 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14675 parameter modifiers as well. Fixes bug 38606
14677 * class.cs: Very sad. Am backing out the speed up changes
14678 introduced by the ArrayList -> Array in the TypeContainer, as they
14679 were not actually that much faster, and introduced a bug (no error
14680 reports on duplicated methods).
14682 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14683 source first, this will guarantee that we have a valid expression
14684 before calling in lower levels functions that will require a
14685 resolved object. Then use this original_source in the
14686 target.ResolveLValue instead of the original source that was
14689 Another change. Use target.Resolve instead of LValueResolve.
14690 Although we are resolving for LValues, we will let the Assign code
14691 take care of that (it will be called again from Resolve). This
14692 basically allows code like this:
14694 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14695 class Y { void A (X x) { x [0] += o; }
14697 The problem was that the indexer was trying to resolve for
14698 set_Item (idx, object o) and never finding one. The real set_Item
14699 was set_Item (idx, X). By delaying the process we get the right
14704 2003-02-23 Martin Baulig <martin@ximian.com>
14706 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14707 while calling DoEmit ().
14709 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14710 source files; if you use the #line directive inside a method, the
14711 compiler stops emitting line numbers for the debugger until it
14712 reaches the end of the method or another #line directive which
14713 restores the original file.
14715 2003-02-23 Martin Baulig <martin@ximian.com>
14717 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14719 2003-02-23 Martin Baulig <martin@ximian.com>
14721 * statement.cs (Block.AddChildVariableNames): We need to call this
14722 recursively, not just for our immediate children.
14724 2003-02-23 Martin Baulig <martin@ximian.com>
14726 * class.cs (Event.Define): Always make the field private, like csc does.
14728 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14729 actually work, fixes bug #37521.
14731 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14733 * delegate.cs: When creating the various temporary "Parameters"
14734 classes, make sure that we call the ComputeAndDefineParameterTypes
14735 on those new parameters (just like we do with the formal ones), to
14736 allow them to be resolved in the context of the DeclSpace.
14738 This fixes the bug that Dick observed in Bugzilla #38530.
14740 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14742 * expression.cs (ResolveMemberAccess): When resolving a constant,
14743 do not attempt to pull a constant if the value was not able to
14744 generate a valid constant.
14746 * const.cs (LookupConstantValue): Do not report more errors than required.
14748 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14750 * expression.cs: fixes bug #38328.
14752 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14754 * class.cs: Changed all the various members that can be part of a
14755 class from being an ArrayList to be an Array of the right type.
14756 During the DefineType type_list, interface_list, delegate_list and
14757 enum_list are turned into types, interfaces, delegates and enums
14760 And during the member population, indexer_list, event_list,
14761 constant_list, field_list, instance_constructor_list, method_list,
14762 operator_list and property_list are turned into their real arrays.
14764 Although we could probably perform this operation earlier, for
14765 good error reporting we need to keep the lists and remove the
14766 lists for longer than required.
14768 This optimization was triggered by Paolo profiling the compiler
14769 speed on the output of `gen-sample-program.pl' perl script.
14771 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14772 not crash in methods like MemberLookupFailed that use this field.
14774 This problem arises when the compiler fails to resolve a type
14775 during interface type definition for example.
14777 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14779 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14780 inherit from System.Object, so we have to stop at null, not only
14781 when reaching System.Object.
14783 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14785 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14786 DeclaredOnly because the parent indexer might have had a different
14787 name, but did not loop until the top of the hierarchy was reached.
14789 The problem this one fixes is 35492: when a class implemented an
14790 indexer from an interface, we were getting the interface method
14791 (which was abstract) and we were flagging an error (can not invoke
14794 This also keeps bug 33089 functioning, and test-148 functioning.
14796 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14797 out if a method is special is to see if it is declared in a
14798 property or event, or whether it is one of the predefined operator
14799 names. This should fix correctly #36804.
14801 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14803 The goal here is to remove the dependency on EmptyCast.Peel ().
14804 Killing it completely.
14806 The problem is that currently in a number of places where
14807 constants are expected, we have to "probe" for an EmptyCast, and
14808 Peel, which is not the correct thing to do, as this will be
14809 repetitive and will likely lead to errors.
14811 The idea is to remove any EmptyCasts that are used in casts that
14812 can be reduced to constants, so we only have to cope with
14815 This bug hunt was triggered by Bug 37363 and the desire to remove
14816 the duplicate pattern where we were "peeling" emptycasts to check
14817 whether they were constants. Now constants will always be
14820 * ecore.cs: Use an enumconstant here instead of wrapping with
14823 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14824 throwing me off. By handling this we can get rid of a few hacks.
14826 * statement.cs (Switch): Removed Peel() code.
14828 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14830 * class.cs: Location information for error 508
14832 * expression.cs (New.DoResolve): Add a guard against double
14833 resolution of an expression.
14835 The New DoResolve might be called twice when initializing field
14836 expressions (see EmitFieldInitializers, the call to
14837 GetInitializerExpression will perform a resolve on the expression,
14838 and later the assign will trigger another resolution
14840 This leads to bugs (#37014)
14842 * delegate.cs: The signature for EndInvoke should contain any ref
14843 or out parameters as well. We were not doing this in the past.
14845 * class.cs (Field.Define): Do not overwrite the type definition
14846 inside the `volatile' group. Turns out that volatile enumerations
14847 were changing the type here to perform a validity test, which
14850 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14852 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14853 and structs, we do not want to load the instance variable
14855 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14856 enum_type has to be handled like an object reference (implicit
14857 conversions exists from this to object), but the regular IsClass
14858 and IsValueType tests will never return true for this one.
14860 Also we use TypeManager.IsValueType instead of type.IsValueType,
14861 just for consistency with the rest of the code (this is only
14862 needed if we ever use the construct exposed by test-180.cs inside
14863 corlib, which we dont today).
14865 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14867 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14870 2003-02-09 Martin Baulig <martin@ximian.com>
14872 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14873 (Namespace.DefineNamespaces): New static public method; this is
14874 called when we're compiling with debugging to add all namespaces
14875 to the symbol file.
14877 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14878 pass it to the Namespace's .ctor.
14880 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14881 and MethodBase arguments; pass the namespace ID to the symwriter;
14882 pass the MethodBase instead of the token to the symwriter.
14883 (SymbolWriter.DefineNamespace): New method to add a namespace to
14886 2003-02-09 Martin Baulig <martin@ximian.com>
14888 * symbolwriter.cs: New file. This is a wrapper around
14889 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14890 methods here in near future.
14892 2003-02-09 Martin Baulig <martin@ximian.com>
14894 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14895 ILGenerator.MarkSequencePoint() which are actually used by the
14898 2003-02-09 Martin Baulig <martin@ximian.com>
14900 * location.cs (SourceFile): New public sealed class. This
14901 contains the name and an index which is used in the location's token.
14902 (Location): Reserve an appropriate number of bits in the token for
14903 the source file instead of walking over that list, this gives us a
14904 really huge performance improvement when compiling with debugging.
14906 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14907 `SourceFile' argument instead of a string.
14908 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14909 but don't parse/tokenize here, we need to generate the list of all
14910 source files before we do that.
14911 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14914 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14915 instead of a string.
14917 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14920 2003-02-09 Martin Baulig <martin@ximian.com>
14922 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14923 filename on `#line default'.
14925 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14927 * statement.cs: don't clear the pinned var when the fixed statement
14928 returns from the method (fixes bug#37752).
14930 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14932 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14935 2003-02-07 Martin Baulig <martin@ximian.com>
14937 * driver.cs: Removed the `--debug-args' command line argument.
14939 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14940 automatically by the AsssemblyBuilder.
14941 (CodeGen.InitializeSymbolWriter): We don't need to call any
14942 initialization function on the symbol writer anymore. This method
14943 doesn't take any arguments.
14945 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14947 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14948 from referenced assemblies as well.
14950 2003-02-02 Martin Baulig <martin@ximian.com>
14952 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14954 2003-02-02 Martin Baulig <martin@ximian.com>
14956 * class.cs (Constructor.Emit): Open the symbol writer before
14957 emitting the constructor initializer.
14958 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14959 single-stepping through constructor initializers.
14961 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14963 * class.cs: Handle error 549: do not allow virtual methods in
14966 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14968 * decl.cs: Check access levels when resolving types
14970 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14972 * statement.cs: Add parameters and locals set in catch blocks that might
14973 return to set vector
14975 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14977 * class.cs (Operator): Set the SpecialName flags for operators.
14979 * expression.cs (Invocation.DoResolve): Only block calls to
14980 accessors and operators on SpecialName methods.
14982 (Cast.TryReduce): Handle conversions from char constants.
14985 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14987 * statement.cs: small memory and time optimization in FlowBranching.
14989 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14991 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14992 problem that the last fix but in the other sid (Set).
14994 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14995 access when there is no indexer in the hierarchy.
14997 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14999 * class.cs: Combine some if statements.
15001 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15003 * driver.cs: fixed bug #37187.
15005 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15007 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15008 any indexer, it's needed to build a list with all the indexers in the
15009 hierarchy (AllGetters), else we have problems. Fixes #35653.
15011 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15013 * class.cs (MethodData.Define): It is wrong for an interface
15014 implementation to be static in both cases: explicit and implicit.
15015 We were only handling this in one case.
15017 Improve the if situation there to not have negations.
15019 * class.cs (Field.Define): Turns out that we do not need to check
15020 the unsafe bit on field definition, only on usage. Remove the test.
15022 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15024 * driver.cs: use assembly.Location instead of Codebase (the latest
15025 patch made mcs fail when using MS assemblies).
15027 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15029 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15030 get the path to *corlib.dll.
15032 2003-01-21 Nick Drochak <ndrochak@gol.com>
15036 * typemanager.cs: Remove compiler warnings
15038 2003-01-20 Duncan Mak <duncan@ximian.com>
15040 * AssemblyInfo.cs: Bump the version number to 0.19.
15042 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15044 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15046 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15048 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15050 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15052 * cs-parser.jay: Small fix: we were not comparing the constructor
15053 name correctly. Thanks to Zoltan for the initial pointer.
15055 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15057 * cs-tokenizer.cs: Set file name when specified with #line
15059 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15061 * cs-parser.jay: Only perform the constructor checks here if we
15062 are named like the class; This will help provider a better
15063 error. The constructor path is taken when a type definition is
15064 not found, but most likely the user forgot to add the type, so
15065 report that rather than the constructor error.
15067 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15069 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15072 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15074 * cs-parser.jay: Add cleanup call.
15076 2003-01-13 Duncan Mak <duncan@ximian.com>
15078 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15079 consistent with other methods.
15081 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15083 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15085 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15087 * attribute.cs: only set GuidAttr to true when we have a
15090 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15094 * typemanager.cs: fixes to allow mcs compile corlib with the new
15095 Type.IsSubclassOf fix.
15097 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15099 * expression.cs (LocalVariableReference.DoResolve): Classify a
15100 constant as a value, not as a variable. Also, set the type for
15103 * cs-parser.jay (fixed_statement): take a type instead of a
15104 pointer_type, so we can produce a better error message later.
15106 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15109 (For.DoEmit): Make inifinite loops have a
15110 non-conditional branch back.
15112 (Fixed.DoEmit): First populate the pinned variables, then emit the
15113 statement, then clear the variables. Before I was emitting the
15114 code once for each fixed piece.
15117 2003-01-08 Martin Baulig <martin@ximian.com>
15119 * statement.cs (FlowBranching.MergeChild): A break in a
15120 SWITCH_SECTION does not leave a loop. Fixes #36155.
15122 2003-01-08 Martin Baulig <martin@ximian.com>
15124 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15125 lives in the same number space than `param_map'. Fixes #36154.
15127 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15129 * cs-parser.jay (constructor_declaration): Set the
15130 Constructor.ModFlags before probing for it. This makes the
15131 compiler report 514, 515 and 132 (the code was there, but got
15134 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15135 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15136 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15138 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15140 * enum.cs: create the enum static fields using the enum type.
15142 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15144 * class.cs: don't try to create the ParamBuilder for the return
15145 type if it's not needed (and handle it breaking for the ms runtime
15148 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15150 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15152 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15154 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15155 the command. This showed up while compiling the JANET source
15156 code, which used \r as its only newline separator.
15158 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15160 * class.cs (Method.Define): If we are an operator (because it
15161 reuses our code), then set the SpecialName and HideBySig. #36128
15163 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15165 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15166 exception, report error 120 `object reference required'.
15168 * driver.cs: Add --pause option, used during to measure the size
15169 of the process as it goes with --timestamp.
15171 * expression.cs (Invocation.DoResolve): Do not allow methods with
15172 SpecialName to be invoked.
15174 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15176 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15177 number before adding it.
15179 2002-12-21 Ravi Pratap <ravi@ximian.com>
15181 * ecore.cs (StandardImplicitConversion): When in an unsafe
15182 context, we allow conversion between void * to any other pointer
15183 type. This fixes bug #35973.
15185 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15187 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15188 is not thrown when extensionless outputs are used
15190 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15192 * rootcontext.cs: fixed compilation of corlib.
15194 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15196 * attribute.cs (Attributes.Contains): Add new method.
15198 * class.cs (MethodCore.LabelParameters): if the parameter is an
15199 `out' parameter, check that no attribute `[In]' has been passed.
15201 * enum.cs: Handle the `value__' name in an enumeration.
15203 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15205 * decl.cs: Added special case to allow overrides on "protected
15208 2002-12-18 Ravi Pratap <ravi@ximian.com>
15210 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15211 since it makes much more sense.
15213 (Attributes.ctor): Don't require a Location parameter.
15215 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15217 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15218 since we already have that information per attribute.
15220 * everywhere : make appropriate changes.
15222 * class.cs (LabelParameters): Write the code which actually
15223 applies attributes to the return type. We can't do this on the MS
15224 .NET runtime so we flag a warning in the case an exception is
15227 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15229 * const.cs: Handle implicit null conversions here too.
15231 2002-12-17 Ravi Pratap <ravi@ximian.com>
15233 * class.cs (MethodCore.LabelParameters): Remove the extra
15234 Type [] parameter since it is completely unnecessary. Instead
15235 pass in the method's attributes so that we can extract
15236 the "return" attribute.
15238 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15240 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15241 of ignoring it and letting the compile continue.
15243 * typemanager.cs (ChangeType): use an extra argument to return an
15244 error condition instead of throwing an exception.
15246 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15248 * expression.cs (Unary.TryReduce): mimic the code for the regular
15249 code path. Perform an implicit cast in the cases where we can
15250 implicitly convert to one of the integral types, and then reduce
15251 based on that constant. This fixes bug #35483.
15253 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15255 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15257 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15259 * namespace.cs: fixed bug #35489.
15261 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15263 * class.cs: Remove some dead code.
15265 * cs-parser.jay: Estimate the number of methods needed
15266 (RootContext.MethodCount);
15268 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15269 numbers instead of StringBuilders.
15271 * support.cs (PtrHashtable): Add constructor with initial size;
15272 We can now reduce reallocations of the method table.
15274 2002-12-10 Ravi Pratap <ravi@ximian.com>
15276 * attribute.cs (ApplyAttributes): Keep track of the emitted
15277 attributes on a per-target basis. This fixes bug #35413.
15279 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15281 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15282 default to the Windows 1252 encoding.
15284 (UnixParseOption): Support version, thanks to Alp for the missing
15287 * AssemblyInfo.cs: Add nice assembly information.
15289 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15292 * cs-parser.jay: Allow a trailing comma before the close bracked
15293 in the attribute_section production.
15295 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15296 address of the instance was being taken, I will take this out,
15297 because we take the address of the object immediately here.
15299 2002-12-09 Ravi Pratap <ravi@ximian.com>
15301 * typemanager.cs (AreMultipleAllowed): Take care of the most
15302 obvious case where attribute type is not in the current assembly -
15305 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15307 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15308 definitions, instead of doing that afterwards.
15310 Also we use a nice little hack, depending on the constructor, we
15311 know if we are a "composed" name or a simple name. Hence, we
15312 avoid the IndexOf test, and we avoid
15314 * codegen.cs: Add code to assist in a bug reporter to track down
15315 the source of a compiler crash.
15317 2002-12-07 Ravi Pratap <ravi@ximian.com>
15319 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15320 types have been emitted for a given element and flag an error
15321 if something which does not have AllowMultiple set is used more
15324 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15325 attribute types and their corresponding AllowMultiple properties
15327 (AreMultipleAllowed): Check the property for a given type.
15329 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15330 property in the case we have a TypeContainer.
15332 (Attributes.AddAttribute): Detect duplicates and just skip on
15333 adding them. This trivial fix catches a pretty gross error in our
15334 attribute emission - global attributes were being emitted twice!
15336 Bugzilla bug #33187 is now fixed.
15338 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15340 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15341 instead of pp_and).
15343 * expression.cs (Binary.ResolveOperator): I can only use the
15344 Concat (string, string, string) and Concat (string, string,
15345 string, string) if the child is actually a concatenation of
15348 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15350 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15351 context where we need a 2-character lookahead.
15353 * pending.cs (PendingImplementation): Rework so we can keep track
15354 of interface types all the time, and flag those which were
15355 implemented by parents as optional.
15357 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15359 * expression.cs (Binary.ResolveOperator): Use
15360 String.Concat(string,string,string) or
15361 String.Concat(string,string,string,string) when possible.
15363 * typemanager: More helper methods.
15366 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15368 * pending.cs: remove the bogus return from GetMissingInterfaces()
15369 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15371 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15373 * namespace.cs: avoid duplicated 'using xxx' being added to
15374 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15375 when we get more than one 'using' statement for the same namespace.
15376 Report a CS0105 warning for it.
15378 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15380 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15381 of calling getChar/putback, uses internal knowledge of it.
15383 (xtoken): Reorder tokenizer so most common patterns are checked
15384 first. This reduces the compilation time in another 5% (from 8.11s
15385 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15387 The parsing time is 22% of the compilation in mcs, and from that
15388 64% is spent on the tokenization process.
15390 I tried using a binary search for keywords, but this is slower
15391 than the hashtable. Another option would be to do a couple of
15394 * Not use a StringBuilder, instead use an array of chars,
15395 with a set value. Notice that this way we could catch
15396 the 645 error without having to do it *afterwards*.
15398 * We could write a hand-parser to avoid the hashtable
15399 compares altogether.
15401 The identifier consumption process takes 37% of the tokenization
15402 time. Another 15% is spent on is_number. 56% of the time spent
15403 on is_number is spent on Int64.Parse:
15405 * We could probably choose based on the string length to
15406 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15409 Another 3% is spend on wrapping `xtoken' in the `token' function.
15411 Handle 0xa0 as whitespace (#34752)
15413 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15415 * typemanager.cs (IsCLRType): New routine to tell whether a type
15416 is one of the builtin types.
15418 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15419 typecode in more places instead of doing pointer comparissions.
15420 We could leverage some knowledge about the way the typecodes are
15423 New code to cache namespaces in assemblies, it is currently not
15424 invoked, to be used soon.
15426 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15428 * expression.cs (Binary.ResolveOperator): specially handle
15429 strings, and do not perform user-defined operator overloading for
15432 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15434 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15435 internalcall as it is a pretty simple operation; Avoid whenever
15436 possible to call Char.IsLetter.
15438 (consume_identifier): Cut by half the number of
15439 hashtable calls by merging the is_keyword and GetKeyword behavior.
15441 Do not short-circuit, because if we do, we
15442 report errors (ie, #if false && true would produce an invalid
15446 2002-11-24 Martin Baulig <martin@ximian.com>
15448 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15449 check constant ranges and report a CS0221. Fixes #33186.
15451 2002-11-24 Martin Baulig <martin@ximian.com>
15453 * cs-parser.jay: Make this work for uninitialized variable
15454 declarations in the `for' initializer. Fixes #32416.
15456 2002-11-24 Martin Baulig <martin@ximian.com>
15458 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15459 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15461 2002-11-24 Martin Baulig <martin@ximian.com>
15463 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15464 argument; if true, we also check for user-defined conversions.
15465 This is only needed if both arguments are of a user-defined type.
15466 Fixes #30443, added test-175.cs.
15467 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15469 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15471 2002-11-24 Martin Baulig <martin@ximian.com>
15473 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15474 function to get the store opcode.
15475 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15476 only emit the Ldelema if the store opcode is Stobj. You must run
15477 both test-34 and test-167 to test this. Fixes #34529.
15479 2002-11-23 Martin Baulig <martin@ximian.com>
15481 * ecore.cs (Expression.MemberLookup): Added additional
15482 `qualifier_type' argument which is used when we're being called
15483 from MemberAccess.DoResolve() and null if we're called from a
15485 (Expression.MemberLookupFailed): New method to report errors; this
15486 does the CS1540 check and reports the correct error message.
15488 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15489 argument for the CS1540 check and redone the way how we're dealing
15490 with private members. See the comment in the source code for details.
15491 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15492 `closure_start_type' to `closure_qualifier_type' and check whether
15493 it's not null. It was not this filter being broken, it was just
15494 being called with the wrong arguments.
15496 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15497 and pass it the correct `qualifier_type'; this also does the error
15500 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15502 * expression.cs (Invocation.EmitParams): If the we are dealing
15503 with a non-built-in value type, load its address as well.
15505 (ArrayCreation): Use a a pretty constant instead
15506 of the hardcoded value 2. Use 6 instead of 2 for the number of
15507 static initializers.
15509 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15510 because they are not really value types, just glorified integers.
15512 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15514 * ecore.cs: Remove redundant code for enumerations, make them use
15515 the same code path as everything else, fixes the casting issue
15516 with enumerations in Windows.Forms.
15518 * attribute.cs: Do only cast to string if it is a string, the
15519 validation happens later.
15521 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15522 people upgrade their corlibs.
15524 * ecore.cs: Oops, enumerations were not following the entire code path
15526 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15528 * typemanager.cs (FilterWithClosure): Commented out the test for
15529 1540 in typemanager.cs, as it has problems when accessing
15530 protected methods from a parent class (see test-174.cs).
15532 * attribute.cs (Attribute.ValidateGuid): new method.
15533 (Attribute.Resolve): Use above.
15535 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15537 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15539 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15540 handling for enumerations, as we only needed the TypeContainer
15541 functionality to begin with (this is required for the fix below to
15542 work for enums that reference constants in a container class for
15545 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15547 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15548 a valid TypeBuilder to perform lookups on.o
15550 * class.cs (InheritableMemberSignatureCompare): Use true in the
15551 call to GetGetMethod and GetSetMethod, because we are comparing
15552 the signature, and we need to get the methods *even* if they are
15555 (PropertyBase.CheckBase): ditto.
15557 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15558 GotoCase.Resolve): Use Peel on EmpytCasts.
15560 * ecore.cs (EmptyCast): drop child, add Peel method.
15562 2002-11-17 Martin Baulig <martin@ximian.com>
15564 * ecore.cs (EmptyCast.Child): New public property.
15566 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15567 label resolved to an EmptyCast. Fixes #34162.
15568 (GotoCase.Resolve): Likewise.
15569 (Block.EmitMeta): Likewise.
15571 2002-11-17 Martin Baulig <martin@ximian.com>
15573 * expression.cs (Invocation.BetterConversion): Prefer int over
15574 uint; short over ushort; long over ulong for integer literals.
15575 Use ImplicitConversionExists instead of StandardConversionExists
15576 since we also need to check for user-defined implicit conversions.
15577 Fixes #34165. Added test-173.cs.
15579 2002-11-16 Martin Baulig <martin@ximian.com>
15581 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15582 with the `true' and `false' literals. Fixes #33151.
15584 2002-11-16 Martin Baulig <martin@ximian.com>
15586 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15587 October 22nd; don't do the cs1540 check for static members.
15589 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15590 now using our own filter here and doing the cs1540 check again.
15592 2002-11-16 Martin Baulig <martin@ximian.com>
15594 * support.cs (InternalParameters): Don't crash if we don't have
15595 any fixed parameters. Fixes #33532.
15597 2002-11-16 Martin Baulig <martin@ximian.com>
15599 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15600 when looking up static methods to make this work on Windows.
15603 2002-11-16 Martin Baulig <martin@ximian.com>
15605 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15606 a setter rather than using PropertyInfo.CanWrite.
15608 2002-11-15 Nick Drochak <ndrochak@gol.com>
15610 * class.cs: Allow acces to block member by subclasses. Fixes build
15613 2002-11-14 Martin Baulig <martin@ximian.com>
15615 * class.cs (Constructor.Emit): Added the extern/block check.
15618 2002-11-14 Martin Baulig <martin@ximian.com>
15620 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15621 iteration while looking for indexers, this is needed because the
15622 indexer may have a different name in our base classes. Fixed the
15623 error reporting (no indexers at all, not get accessor, no
15624 overloaded match). Fixes bug #33089.
15625 (IndexerAccess.DoResolveLValue): Likewise.
15627 2002-11-14 Martin Baulig <martin@ximian.com>
15629 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15630 indexers. Fixes the first part of bug #33089.
15631 (MethodSignature.InheritableMemberSignatureCompare): Added support
15634 2002-11-13 Ravi Pratap <ravi@ximian.com>
15636 * attribute.cs (Attribute.Resolve): Catch the
15637 NullReferenceException and report it since it isn't supposed to
15640 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15642 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15643 LogicalOr and LogicalAnd that can benefit from recursively
15644 handling EmitBranchable. The code now should be nice for Paolo.
15646 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15648 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15649 the Type lookups, as we perform quite a number of lookups on
15650 non-Types. This can be removed once we can deterministically tell
15651 whether we have a type or a namespace in advance.
15653 But this might require special hacks from our corlib.
15657 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15658 and double which avoids a conversion from an integer to a double.
15660 * expression.cs: tiny optimization, avoid calling IsConstant,
15661 because it effectively performs the lookup twice.
15663 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15665 But a bogus return here to keep the semantics of the old code
15666 until the Mono runtime is fixed.
15668 * pending.cs (GetMissingInterfaces): New method used to remove all
15669 the interfaces that are already implemented by our parent
15670 classes from the list of pending methods.
15672 * interface.cs: Add checks for calls after ResolveTypeExpr.
15674 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15676 * class.cs (Class.Emit): Report warning 67: event not used if the
15677 warning level is beyond 3.
15679 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15680 being a NullLiteral.
15682 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15685 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15686 path that might fail if a type can not be resolved.
15688 * expression.cs (Binary.Emit): Emit unsigned versions of the
15691 * driver.cs: use error 5.
15693 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15695 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15697 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15699 * cs-parser.jay (switch_section): A beautiful patch from Martin
15700 Baulig that fixed 33094.
15702 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15704 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15705 Check whether the base is abstract and report an error if so.
15707 * expression.cs (IndexerAccess.DoResolveLValue,
15708 IndexerAccess.DoResolve): ditto.
15710 (Invocation.DoResolve): ditto.
15712 (Invocation.FullMethodDesc): Improve the report string.
15714 * statement.cs (Block): Eliminate IsVariableDefined as it is
15715 basically just a wrapper for GetVariableInfo.
15717 * ecore.cs (SimpleName): Use new
15719 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15720 type, as we return the actual parameter ref/unref state on a
15723 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15725 * support.cs: Return proper flags REF/OUT fixing the previous
15728 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15729 not used to mean `ref' but `ref or out' in ParameterReference
15731 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15732 full type signature instead of calling TypeManger.CSharpName
15735 * support.cs (InternalParameters.ParameterDesc): Do not compare
15736 directly to the modflags, because REF/OUT will actually be bitsets
15739 * delegate.cs (VerifyMethod): Check also the modifiers.
15741 * cs-tokenizer.cs: Fix bug where floating point values with an
15742 exponent where a sign was missing was ignored.
15744 * driver.cs: Allow multiple assemblies to be specified in a single
15747 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15749 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15750 because identifiers after a parenthesis would end up in this kind
15751 of production, and we needed to desamiguate it for having casts
15754 (UserDefinedType *) xxx
15756 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15758 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15759 we should set on the Bindingflags.NonPublic, but not turn on
15760 private_ok. private_ok controls whether a Private member is
15761 returned (this is chekced on the filter routine), while the
15762 BindingFlags.NonPublic just controls whether private/protected
15763 will be allowed. This fixes the problem part of the problem of
15764 private properties being allowed to be used in derived classes.
15766 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15767 so we can call the children DoResolveLValue method (this will
15768 properly signal errors on lvalue assignments to base properties)
15770 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15771 getter are null, and we have a property info, we know that this
15772 happened because the lookup failed, so we report an error 122 for
15773 protection level violation.
15775 We also silently return if setter and getter are null in the
15776 resolve functions, this condition only happens if we have flagged
15777 the error before. This is the other half of the problem.
15779 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15780 not have accessibility information, that is why we were returning
15781 true in the filter function in typemanager.cs.
15783 To properly report 122 (property is inaccessible because of its
15784 protection level) correctly, we report this error in ResolveAccess
15785 by failing if both the setter and the getter are lacking (ie, the
15788 DoResolve and DoLResolve have been modified to check for both
15789 setter/getter being null and returning silently, the reason being
15790 that I did not want to put the knowledge about this error in upper
15793 int old = Report.Errors;
15794 x = new PropertyExpr (...);
15795 if (old != Report.Errors)
15800 So the property expr is returned, but it is invalid, so the error
15801 will be flagged during the resolve process.
15803 * class.cs: Remove InheritablePropertySignatureCompare from the
15804 class, as we no longer depend on the property signature to compute
15805 whether it is possible to implement a method or not.
15807 The reason is that calling PropertyInfo.GetGetMethod will return
15808 null (in .NET, in Mono it works, and we should change this), in
15809 cases where the Get Method does not exist in that particular
15814 class X { public virtual int A { get { return 1; } } }
15816 class Z : Y { public override int A { get { return 2; } } }
15818 Would fail in Z because the parent (Y) would not have the property
15819 defined. So we avoid this completely now (because the alternative
15820 fix was ugly and slow), and we now depend exclusively on the
15823 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15824 reference method, instead of using the property.
15826 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15827 routines are gone now.
15829 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15830 names, they were incorrectly named.
15832 * cs-tokenizer.cs: Return are more gentle token on failure.
15834 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15835 had an out-of-sync index variable, which caused it to remove from
15836 the list of pending methods the wrong method sometimes.
15838 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15840 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15841 CanWrite, because those refer to this particular instance of the
15842 property, and do not take into account the fact that we can
15843 override single members of a property.
15845 Constructor requires an EmitContext. The resolution process does
15846 not happen here, but we need to compute the accessors before,
15847 because the resolution does not always happen for properties.
15849 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15850 subclass, before we did not update this flag, but we did update
15853 (GetAccessors): Drop this routine, as it did not work in the
15854 presence of partially overwritten set/get methods.
15856 Notice that this broke the cs1540 detection, but that will require
15859 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15863 * driver.cs: issue a warning instead of an error if we don't support
15864 debugging for the platform. Also ignore a couple of errors that may
15865 arise when trying to write the symbols. Undo my previous patch.
15867 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15869 * driver.cs: ignore /debug switch except for Unix platforms.
15871 2002-10-23 Nick Drochak <ndrochak@gol.com>
15873 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15875 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15877 * driver.cs: Do not make mcs-debug conditional, so we do not break
15878 builds that use it.
15880 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15881 review this patch. But basically after all the children variables
15882 have been merged, the value of "Breaks" was not being set to
15883 new_breaks for Switch blocks. I think that it should be set after
15884 it has executed. Currently I set this to the value of new_breaks,
15885 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15886 conservative, but I do not understand this code very well.
15888 I did not break anything in the build, so that is good ;-)
15890 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15892 2002-10-20 Mark Crichton <crichton@gimp.org>
15894 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15896 2002-10-20 Nick Drochak <ndrochak@gol.com>
15898 * cfold.cs: Fixed compile blocker.
15900 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15902 * driver.cs: I was chekcing the key, not the file.
15904 2002-10-19 Ravi Pratap <ravi@ximian.com>
15906 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15907 message that we were generating - we just need to silently return
15910 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15912 * class.cs (Event.Define): Change my previous commit, as this
15913 breaks the debugger. This is a temporary hack, as it seems like
15914 the compiler is generating events incorrectly to begin with.
15916 * expression.cs (Binary.ResolveOperator): Added support for
15917 "U operator - (E x, E y)"
15919 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15922 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15923 init-only variables, but this path did not take into account that
15924 there might be also instance readonly variables. Correct this
15927 This fixes bug 32253
15929 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15932 * driver.cs: Change the extension for modules to `netmodule'
15934 * cs-parser.jay: Improved slightly the location tracking for
15935 the debugger symbols.
15937 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15938 modifiers that were specified instead of the hardcoded value
15939 (FamAndAssem). This was basically ignoring the static modifier,
15940 and others. Fixes 32429.
15942 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15943 fixed a bug in the process (32476)
15945 * expression.cs (ArrayAccess.EmitAssign): Patch from
15946 hwang_rob@yahoo.ca that fixes bug 31834.3
15948 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15950 * driver.cs: Make the module extension .netmodule.
15952 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15954 * driver.cs: Report an error if the resource file is not found
15955 instead of crashing.
15957 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15958 false, like Emit does.
15960 2002-10-16 Nick Drochak <ndrochak@gol.com>
15962 * typemanager.cs: Remove unused private member. Also reported mcs
15963 bug to report this as a warning like csc.
15965 2002-10-15 Martin Baulig <martin@gnome.org>
15967 * statement.cs (Statement.Emit): Made this a virtual method; emits
15968 the line number info and calls DoEmit().
15969 (Statement.DoEmit): New protected abstract method, formerly knows
15970 as Statement.Emit().
15972 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15974 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15976 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15977 have fixed a remaining problem: not every AddXXXX was adding a
15978 fully qualified name.
15980 Now everyone registers a fully qualified name in the DeclSpace as
15981 being defined instead of the partial name.
15983 Downsides: we are slower than we need to be due to the excess
15984 copies and the names being registered this way.
15986 The reason for this is that we currently depend (on the corlib
15987 bootstrap for instance) that types are fully qualified, because
15988 we dump all the types in the namespace, and we should really have
15989 types inserted into the proper namespace, so we can only store the
15990 basenames in the defined_names array.
15992 2002-10-10 Martin Baulig <martin@gnome.org>
15994 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15995 from bug #31834, see the bug report for a testcase which is
15998 2002-10-10 Martin Baulig <martin@gnome.org>
16000 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16001 flow analysis code for this.
16003 * statement.cs (Do, While, For): Tell the flow analysis code about
16005 (FlowBranching.UsageVector): Added support for infinite loops.
16006 (Block.Resolve): Moved the dead code elimination here and use flow
16009 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16011 * class.cs (Field.Define): Catch cycles on struct type
16014 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16015 fields if the fields are static. We only need to check instance
16018 * expression.cs (As.DoResolve): Test for reference type.
16020 * statement.cs (Using.ResolveExpression): Use
16021 ConvertImplicitRequired, not ConvertImplicit which reports an
16023 (Using.ResolveLocalVariableDecls): ditto.
16025 * expression.cs (Binary.ResolveOperator): Report errors in a few
16026 places where we had to.
16028 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16030 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16032 * expression.cs: Use StoreFromPtr instead of extracting the type
16033 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16035 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16036 an enumeration value to a System.Enum, but System.Enum is not a
16037 value type, but an class type, so we need to box.
16039 (Expression.ConvertExplicit): One codepath could return
16040 errors but not flag them. Fix this. Fixes #31853
16042 * parameter.cs (Resolve): Do not allow void as a parameter type.
16044 2002-10-06 Martin Baulig <martin@gnome.org>
16046 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16047 if it's a class type and not a struct. Fixes #31815.
16049 2002-10-06 Martin Baulig <martin@gnome.org>
16051 * statement.cs: Reworked the flow analysis code a bit to make it
16052 usable for dead code elimination.
16054 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16056 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16058 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16060 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16061 to fix the test 165, will investigate deeper.
16063 2002-10-04 Martin Baulig <martin@gnome.org>
16065 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16066 finally blocks actually work.
16067 (Try.Resolve): We don't need to create a sibling for `finally' if
16068 there is no finally block.
16070 2002-10-04 Martin Baulig <martin@gnome.org>
16072 * class.cs (Constructor.Define): The default accessibility for a
16073 non-default constructor is private, not public.
16075 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16077 * class.cs (Constructor): Make AllowedModifiers public, add
16080 * cs-parser.jay: Perform the modifiers test here, as the
16081 constructor for the Constructor class usually receives a zero
16082 because of the way we create it (first we create, later we
16083 customize, and we were never checking the modifiers).
16085 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16086 is a version of LookupTypeReflection that includes the type-name
16087 cache. This can be used as a fast path for functions that know
16088 the fully qualified name and are only calling into *.GetType() to
16089 obtain a composed type.
16091 This is also used by TypeManager.LookupType during its type
16094 (LookupType): We now also track the real type name, as sometimes
16095 we can get a quey for the real type name from things like
16096 ComposedCast. This fixes bug 31422.
16098 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16099 complete type fullname, it does not have to go through the type
16100 resolution system to obtain the composed version of the type (for
16101 obtaining arrays or pointers).
16103 (Conditional.Emit): Use the EmitBoolExpression to
16104 generate nicer code, as requested by Paolo.
16106 (ArrayCreation.CheckIndices): Use the patch from
16107 hwang_rob@yahoo.ca to validate the array initializers.
16109 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16111 * class.cs (ConstructorInitializer.Emit): simplify code by using
16112 Invocation.EmitCall, and at the same time, fix the bugs in calling
16113 parent constructors that took variable arguments.
16115 * ecore.cs (Expression.ConvertNumericExplicit,
16116 Expression.ImplicitNumericConversion): Remove the code that
16117 manually wrapped decimal (InternalTypeConstructor call is now gone
16120 * expression.cs (Cast.TryReduce): Also handle decimal types when
16121 trying to perform a constant fold on the type.
16123 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16125 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16126 that only turned off an error report, and did nothing else.
16128 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16130 * driver.cs: Handle and ignore /fullpaths
16132 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16134 * expression.cs (Binary.ResolveOperator): Catch the case where
16135 DoNumericPromotions returns true,
16137 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16139 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16141 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16144 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16146 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16147 conversion exists, but it is also required that the conversion be
16148 performed. This manifested in "(Type64Enum) 2".
16150 * class.cs (TypeManager.AddMethod): The fix is not to change
16151 AddEnum, because that one was using a fully qualified name (every
16152 DeclSpace derivative does), but to change the AddMethod routine
16153 that was using an un-namespaced name. This now correctly reports
16154 the duplicated name.
16156 Revert patch until I can properly fix it. The issue
16157 is that we have a shared Type space across all namespaces
16158 currently, which is wrong.
16160 Options include making the Namespace a DeclSpace, and merge
16161 current_namespace/current_container in the parser.
16163 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16165 * cs-parser.jay: Improve error reporting when we get a different
16166 kind of expression in local_variable_type and
16167 local_variable_pointer_type.
16169 Propagate this to avoid missleading errors being reported.
16171 * ecore.cs (ImplicitReferenceConversion): treat
16172 TypeManager.value_type as a target just like object_type. As
16177 Is valid, and needs to result in the int 1 being boxed before it
16178 is assigned to the value type v.
16180 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16181 to validate the enumeration name.
16183 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16184 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16185 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16187 * ecore.cs (TryImplicitIntConversion): When doing an
16188 implicit-enumeration-conversion, check if the type is 64-bits and
16189 perform a conversion before passing to EnumConstant.
16191 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16193 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16194 report ambiguous type references. Unlike the MS version, we
16195 report what the ambiguity is. Innovation at work ;-)
16197 (DeclSpace.FindType): Require a location argument to
16198 display when we display an ambiguous error.
16200 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16202 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16204 * expression.cs (EmitDynamicInitializers): Apply patch from
16205 hwang_rob@yahoo.ca that fixes the order in which we emit our
16208 2002-09-21 Martin Baulig <martin@gnome.org>
16210 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16211 delegate takes no arguments.
16213 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16215 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16218 * expression.cs: Extract the underlying type.
16220 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16222 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16224 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16226 * class.cs (TypeContainer.DefineType): We can not use the nice
16227 PackingSize with the size set to 1 DefineType method, because it
16228 will not allow us to define the interfaces that the struct
16231 This completes the fixing of bug 27287
16233 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16234 means also structs. This fixes part of the problem.
16235 (Expresion.ImplicitReferenceConversionExists): ditto.
16237 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16238 error if there were no errors reported during the type lookup
16239 process, to avoid duplicates or redundant errors. Without this
16240 you would get an ambiguous errors plus a type not found. We have
16241 beaten the user enough with the first error.
16243 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16246 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16247 during the resolution process, stop the lookup, this avoids
16248 repeated error reports (same error twice).
16250 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16252 * typemanager.cs (LookupType): Redo the type lookup code to match
16253 the needs of System.Reflection.
16255 The issue is that System.Reflection requires references to nested
16256 types to begin with a "+" sign instead of a dot. So toplevel
16257 types look like: "NameSpace.TopLevelClass", and nested ones look
16258 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16261 2002-09-19 Martin Baulig <martin@gnome.org>
16263 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16264 says that a method always returns or always throws an exception,
16265 don't report the CS0161.
16267 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16268 set `Returns = new_returns'.
16270 2002-09-19 Martin Baulig <martin@gnome.org>
16272 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16273 to an enum constant, check for a CS0176.
16275 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16277 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16278 for operators that must be in pairs and report errors.
16280 * ecore.cs (SimpleName.DoResolveType): During the initial type
16281 resolution process, when we define types recursively, we must
16282 check first for types in our current scope before we perform
16283 lookups in the enclosing scopes.
16285 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16287 (Invocation.VerifyArgumentsCompat): Call
16288 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16289 I thought we were supposed to always call this, but there are a
16290 few places in the code where we dont do it.
16292 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16294 * driver.cs: Add support in -linkres and -resource to specify the
16295 name of the identifier.
16297 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16299 * ecore.cs (StandardConversionExists): Sync with the conversion
16300 code: allow anything-* to void* conversions.
16302 (FindMostSpecificSource): Use an Expression argument
16303 instead of a Type, because we might be handed over a Literal which
16304 gets a few more implicit conversions that plain types do not. So
16305 this information was being lost.
16307 Also, we drop the temporary type-holder expression when not
16310 2002-09-17 Martin Baulig <martin@gnome.org>
16312 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16313 this is an explicit interface implementation.
16315 2002-09-17 Martin Baulig <martin@gnome.org>
16317 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16318 different `IndexerName' attributes.
16320 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16321 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16322 virtual CommonResolve().
16324 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16326 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16327 and convert that to the UnderlyingType.
16329 * statement.cs (Foreach.Resolve): Indexers are just like variables
16330 or PropertyAccesses.
16332 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16333 inside quoted strings, we were not doing this before.
16335 2002-09-16 Martin Baulig <martin@gnome.org>
16337 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16338 resolve it. This is needed for the definite assignment check of the
16339 instance expression, fixes bug #29846.
16340 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16342 2002-09-16 Nick Drochak <ndrochak@gol.com>
16344 * parameter.cs: Fix compile error. Cannot reference static member
16345 from an instance object. Is this an mcs bug?
16347 2002-09-14 Martin Baulig <martin@gnome.org>
16349 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16350 multiple times. Fixes bug #30295, added test-166.cs.
16352 2002-09-14 Martin Baulig <martin@gnome.org>
16354 * statement.cs (Block.Emit): Don't emit unreachable code.
16355 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16356 `break' statements.
16357 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16359 2002-09-14 Martin Baulig <martin@gnome.org>
16361 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16364 2002-09-14 Martin Baulig <martin@gnome.org>
16366 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16367 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16368 be false on the ms runtime.
16370 2002-09-13 Martin Baulig <martin@gnome.org>
16372 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16373 the CS0038 error message.
16375 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16377 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16378 constant inside, return it.
16380 2002-09-12 Martin Baulig <martin@gnome.org>
16382 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16383 implicit conversion can be done between enum types.
16385 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16386 check whether an implicit conversion to the current enum's UnderlyingType
16387 exists and report an error if not.
16389 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16390 without debugging support.
16392 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16393 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16395 2002-09-12 Martin Baulig <martin@gnome.org>
16397 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16399 * ecore.cs (IMemberExpr.DeclaringType): New property.
16400 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16401 nonstatic member of an outer type (CS0038).
16403 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16405 * driver.cs: Activate the using-error detector at warning level
16406 4 (at least for MS-compatible APIs).
16408 * namespace.cs (VerifyUsing): Small buglett fix.
16410 * pending.cs (PendingImplementation): pass the container pointer.
16412 * interface.cs (GetMethods): Allow for recursive definition. Long
16413 term, I would like to move every type to support recursive
16414 definitions, not the current ordering mechanism that we have right
16417 The situation is this: Attributes are handled before interfaces,
16418 so we can apply attributes to interfaces. But some attributes
16419 implement interfaces, we will now handle the simple cases
16420 (recursive definitions will just get an error).
16422 * parameter.cs: Only invalidate types at the end if we fail to
16425 2002-09-09 Martin Baulig <martin@gnome.org>
16427 * ecore.cs (PropertyExpr.Emit): Also check for
16428 TypeManager.system_int_array_get_length so this'll also work when
16429 compiling corlib. Fixes #30003.
16431 2002-09-09 Martin Baulig <martin@gnome.org>
16433 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16434 and throw an exception if we can't get the type's size. Fixed #30040,
16437 2002-09-09 Martin Baulig <martin@gnome.org>
16439 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16441 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16442 context. Fixes bug #30027.
16444 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16445 virtual functions. Fixes bug #30043, added test-164.cs.
16447 2002-09-08 Ravi Pratap <ravi@ximian.com>
16449 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16451 2002-09-08 Nick Drochak <ndrochak@gol.com>
16453 * driver.cs: Use an object to get the windows codepage since it's not a
16456 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16458 * statement.cs (For.Emit): for infinite loops (test == null)
16459 return whether there is a break inside, not always "true".
16461 * namespace.cs (UsingEntry): New struct to hold the name of the
16462 using definition, the location where it is defined, and whether it
16463 has been used in a successful type lookup.
16465 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16470 2002-09-06 Ravi Pratap <ravi@ximian.com>
16472 * attribute.cs : Fix incorrect code which relied on catching
16473 a NullReferenceException to detect a null being passed in
16474 where an object was expected.
16476 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16478 * statement.cs (Try): flag the catch variable as assigned
16480 * expression.cs (Cast): Simplified by using ResolveType instead of
16481 manually resolving.
16483 * statement.cs (Catch): Fix bug by using ResolveType.
16485 2002-09-06 Ravi Pratap <ravi@ximian.com>
16487 * expression.cs (BetterConversion): Special case for when we have
16488 a NullLiteral as the argument and we have to choose between string
16489 and object types - we choose string the way csc does.
16491 * attribute.cs (Attribute.Resolve): Catch the
16492 NullReferenceException and report error #182 since the Mono
16493 runtime no more has the bug and having this exception raised means
16494 we tried to select a constructor which takes an object and is
16497 2002-09-05 Ravi Pratap <ravi@ximian.com>
16499 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16500 message (1502, 1503) when we can't locate a method after overload
16501 resolution. This is much more informative and closes the bug
16504 * interface.cs (PopulateMethod): Return if there are no argument
16505 types. Fixes a NullReferenceException bug.
16507 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16508 expressions too. Previously we were checking only in one place for
16509 positional arguments leaving out named arguments.
16511 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16512 type to the enum type is not allowed. Remove code corresponding to
16515 (ConvertNumericExplicit): Allow explicit conversions from
16516 the underlying type to enum type. This precisely follows the spec
16517 and closes a bug filed by Gonzalo.
16519 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16522 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16524 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16526 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16527 it was important that we stored the right value after the
16528 reduction in `converted'.
16530 2002-09-04 Martin Baulig <martin@gnome.org>
16532 * location.cs (Location.SymbolDocument): Use full pathnames for the
16535 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16537 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16538 of the expression resolve mechanism, because that will catch the
16539 SimpleName error failures.
16541 (Conditional): If we can not resolve the
16542 expression, return, do not crash.
16544 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16547 (location): display token name instead of its number.
16549 2002-08-28 Martin Baulig <martin@gnome.org>
16551 * expression.cs (Binary.ResolveOperator): Don't silently return
16552 but return an error if an operator cannot be applied between two
16555 2002-08-28 Martin Baulig <martin@gnome.org>
16557 * class.cs (Constructor.Define): Set the permission attributes
16558 correctly instead of making all constructors public.
16560 2002-08-28 Martin Baulig <martin@gnome.org>
16562 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16563 for private members before reporting a CS0103; if we find anything,
16566 2002-08-28 Martin Baulig <martin@gnome.org>
16568 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16569 to check whether `closure_start_type == closure_invocation_type',
16570 we also need to check whether `m.DeclaringType == closure_invocation_type'
16571 before bypassing the permission checks. We might be accessing
16572 protected/private members from the base class.
16573 (TypeManager.RealMemberLookup): Only set private_ok if private
16574 members were requested via BindingFlags.NonPublic.
16576 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16578 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16579 MethodGroupExpr.IsExplicitImpl if appropriate.
16580 (Invocation.DoResolve): Don't report the CS0120 for explicit
16581 interface implementations.
16583 2002-08-27 Martin Baulig <martin@gnome.org>
16585 * expression.cs (Invocation.DoResolve): If this is a static
16586 method and we don't have an InstanceExpression, we must report
16589 2002-08-25 Martin Baulig <martin@gnome.org>
16591 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16592 `==' between a valuetype and an object.
16594 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16596 * ecore.cs (TypeExpr): Provide a ToString method.
16598 2002-08-24 Martin Baulig <martin@gnome.org>
16600 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16601 now called proggie.dbg and it's a binary file.
16603 2002-08-23 Martin Baulig <martin@gnome.org>
16605 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16607 2002-08-23 Martin Baulig <martin@gnome.org>
16609 * struct.cs (MyStructInfo.ctor): Make this work with empty
16610 structs; it's not allowed to use foreach() on null.
16612 2002-08-23 Martin Baulig <martin@gnome.org>
16614 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16615 writer the full pathname of the generated assembly.
16617 2002-08-23 Martin Baulig <martin@gnome.org>
16619 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16620 A `finally' block never returns or breaks; improved handling of
16623 2002-08-23 Martin Baulig <martin@gnome.org>
16625 * statement.cs (Throw.Resolve): Allow `throw null'.
16627 2002-08-23 Martin Baulig <martin@gnome.org>
16629 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16630 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16631 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16632 MemberLookup would return a wrong event if this is an explicit
16633 interface implementation and the class has an event with the same
16636 2002-08-23 Martin Baulig <martin@gnome.org>
16638 * statement.cs (Block.AddChildVariableNames): New public method.
16639 (Block.AddChildVariableName): Likewise.
16640 (Block.IsVariableNameUsedInChildBlock): Likewise.
16641 (Block.AddVariable): Check whether a variable name has already
16642 been used in a child block.
16644 * cs-parser.jay (declare_local_variables): Mark all variable names
16645 from the current block as being used in a child block in the
16648 2002-08-23 Martin Baulig <martin@gnome.org>
16650 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16651 find the symbol writer.
16653 * driver.cs: csc also allows the arguments to /define being
16654 separated by commas, not only by semicolons.
16656 2002-08-23 Martin Baulig <martin@gnome.org>
16658 * interface.cs (Interface.GetMembers): Added static check for events.
16660 2002-08-15 Martin Baulig <martin@gnome.org>
16662 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16663 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16665 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16666 why the MethodData.EmitDestructor() change was necessary.
16668 2002-08-20 Martin Baulig <martin@gnome.org>
16670 * class.cs (TypeContainer.FindMembers): Added static check for events.
16672 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16674 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16675 use Type.GetEvents(), not Type.FindMembers().
16677 2002-08-20 Martin Baulig <martin@gnome.org>
16679 * decl.cs (MemberCache): Added a special method cache which will
16680 be used for method-only searched. This ensures that a method
16681 search will return a MethodInfo with the correct ReflectedType for
16684 2002-08-20 Martin Baulig <martin@gnome.org>
16686 * decl.cs (DeclSpace.FindMembers): Made this public.
16688 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16690 * delegate.cs: fixed build on windows.
16691 [FIXME: Filed as bug #29150: MCS must report these errors.]
16693 2002-08-19 Ravi Pratap <ravi@ximian.com>
16695 * ecore.cs (StandardConversionExists): Return a false
16696 if we are trying to convert the void type to anything else
16697 since that is not allowed.
16699 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16700 we flag error 70 in the event an event is trying to be accessed
16701 directly from outside the declaring type.
16703 2002-08-20 Martin Baulig <martin@gnome.org>
16705 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16706 MemberCache from typemanager.cs to decl.cs.
16708 2002-08-19 Martin Baulig <martin@gnome.org>
16710 * class.cs (TypeContainer): Implement IMemberContainer.
16711 (TypeContainer.DefineMembers): Create the MemberCache.
16712 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16713 return public members if BindingFlags.Public was given, check
16714 whether members are static.
16716 2002-08-16 Martin Baulig <martin@gnome.org>
16718 * decl.cs (DeclSpace.Define): Splitted this in Define and
16719 DefineMembers. DefineMembers is called first and initializes the
16722 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16723 DefineMembers() on all our DeclSpaces.
16725 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16726 but call DefineMembers() on all nested interfaces. We call their
16727 Define() in our new Define() function.
16729 * interface.cs (Interface): Implement IMemberContainer.
16730 (Interface.Define): Moved all code except the attribute stuf to
16732 (Interface.DefineMembers): Initialize the member cache.
16734 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16735 need this anymore since we can use MemberCache.FindMembers directly.
16737 2002-08-19 Martin Baulig <martin@gnome.org>
16739 * typemanager.cs (MemberCache): When creating the cache for an
16740 interface type, add all inherited members.
16741 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16742 to `out bool used_cache' and documented it.
16743 (TypeManager.MemberLookup): If we already used the cache in the first
16744 iteration, we don't need to do the interfaces check.
16746 2002-08-19 Martin Baulig <martin@gnome.org>
16748 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16749 here from IMemberFinder and don't implement this interface anymore.
16750 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16752 * typemanager.cs (IMemberFinder): This interface is now only used by
16753 classes which actually support the member cache.
16754 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16755 since we only put DeclSpaces into this Hashtable.
16756 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16757 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16759 2002-08-16 Martin Baulig <martin@gnome.org>
16761 * typemanager.cs (ICachingMemberFinder): Removed.
16762 (IMemberFinder.MemberCache): New property.
16763 (TypeManager.FindMembers): Merged this with RealFindMembers().
16764 This function will never be called from TypeManager.MemberLookup()
16765 so we can't use the cache here, just the IMemberFinder.
16766 (TypeManager.MemberLookup_FindMembers): Check whether the
16767 IMemberFinder has a MemberCache and call the cache's FindMembers
16769 (MemberCache): Rewrote larger parts of this yet another time and
16770 cleaned it up a bit.
16772 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16774 * driver.cs (LoadArgs): Support quoting.
16776 (Usage): Show the CSC-like command line arguments.
16778 Improved a few error messages.
16780 2002-08-15 Martin Baulig <martin@gnome.org>
16782 * typemanager.cs (IMemberContainer.Type): New property.
16783 (IMemberContainer.IsInterface): New property.
16785 The following changes are conditional to BROKEN_RUNTIME, which is
16786 defined at the top of the file.
16788 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16789 class'es members, but add all members from TypeHandle.ObjectType
16790 if we're an interface.
16791 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16792 is the current type.
16793 (MemberCache.CacheEntry.Container): Removed this field.
16794 (TypeHandle.GetMembers): Include inherited members.
16796 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16798 * typemanager.cs: fixed compilation and added a comment on a field that
16801 2002-08-15 Martin Baulig <martin@gnome.org>
16803 * class.cs (ConstructorInitializer.Resolve): In the
16804 Expression.MemberLookup call, use the queried_type as
16807 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16808 declared' attribute, it's always true.
16809 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16810 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16811 temporary wrapper for FindMembers which tells MemberLookup whether
16812 members from the base classes are included in the return value.
16813 This will go away soon.
16814 (TypeManager.MemberLookup): Use this temporary hack here; once the
16815 new MemberCache is completed, we don't need to do the DeclaredOnly
16816 looping here anymore since the MemberCache will take care of this.
16817 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16818 (MemberCache): When creating the MemberCache for a class, get
16819 members from the current class and all its base classes.
16820 (MemberCache.CacheEntry.Container): New field. This is a
16821 temporary hack until the Mono runtime is fixed to distinguish
16822 between ReflectedType and DeclaringType. It allows us to use MCS
16823 with both the MS runtime and the unfixed Mono runtime without
16824 problems and without accecting performance.
16825 (MemberCache.SearchMembers): The DeclaredOnly looping from
16826 TypeManager.MemberLookup is now done here.
16828 2002-08-14 Martin Baulig <martin@gnome.org>
16830 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16831 Type.GetFields on dynamic types but get the fields from the
16832 corresponding TypeContainer.
16833 (MyStructInfo.GetStructInfo): Added check for enum types.
16835 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16836 (MemberList.SyncRoot): Implemented.
16837 (TypeManager.FilterWithClosure): No need to check permissions if
16838 closure_start_type == closure_invocation_type, don't crash if
16839 closure_invocation_type is null.
16841 2002-08-13 Martin Baulig <martin@gnome.org>
16843 Rewrote TypeContainer.FindMembers to use a member cache. This
16844 gives us a speed increase of about 35% for the self-hosting MCS
16845 build and of about 15-20% for the class libs (both on GNU/Linux).
16847 * report.cs (Timer): New class to get enhanced profiling. This
16848 whole class is "TIMER" conditional since it remarkably slows down
16851 * class.cs (MemberList): New class. This is an IList wrapper
16852 which we're now using instead of passing MemberInfo[]'s around to
16853 avoid copying this array unnecessarily.
16854 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16855 (ICachingMemberFinder, IMemberContainer): New interface.
16856 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16857 has already been checked, otherwise use it for the name comparision.
16858 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16859 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16860 if possible. Returns a MemberList, not a MemberInfo [].
16861 (TypeHandle): New class, implements IMemberContainer. We create
16862 one instance of this class per type, it contains a MemberCache
16863 which is used to do the member lookups.
16864 (MemberCache): New class. Each instance of this class contains
16865 all members of a type and a name-based hash table.
16866 (MemberCache.FindMembers): This is our new member lookup
16867 function. First, it looks up all members of the requested name in
16868 the hash table. Then, it walks this list and sorts out all
16869 applicable members and returns them.
16871 2002-08-13 Martin Baulig <martin@gnome.org>
16873 In addition to a nice code cleanup, this gives us a performance
16874 increase of about 1.4% on GNU/Linux - not much, but it's already
16875 half a second for the self-hosting MCS compilation.
16877 * typemanager.cs (IMemberFinder): New interface. It is used by
16878 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16879 Enum, Delegate or Interface.
16880 (TypeManager.finder_to_member_finder): New PtrHashtable.
16881 (TypeManager.finder_to_container): Removed.
16882 (TypeManager.finder_to_delegate): Removed.
16883 (TypeManager.finder_to_interface): Removed.
16884 (TypeManager.finder_to_enum): Removed.
16886 * interface.cs (Interface): Implement IMemberFinder.
16888 * delegate.cs (Delegate): Implement IMemberFinder.
16890 * enum.cs (Enum): Implement IMemberFinder.
16892 * class.cs (TypeContainer): Implement IMemberFinder.
16894 2002-08-12 Martin Baulig <martin@gnome.org>
16896 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16898 2002-08-12 Martin Baulig <martin@gnome.org>
16900 * ecore.cs (ITypeExpression): New interface for expressions which
16902 (TypeExpression): Renamed to TypeLookupExpression.
16903 (Expression.DoResolve): If we're doing a types-only lookup, the
16904 expression must implement the ITypeExpression interface and we
16905 call DoResolveType() on it.
16906 (SimpleName): Implement the new ITypeExpression interface.
16907 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16908 hack, the situation that we're only looking up types can't happen
16909 anymore when this method is called. Moved the type lookup code to
16910 DoResolveType() and call it.
16911 (SimpleName.DoResolveType): This ITypeExpression interface method
16912 is now doing the types-only lookup.
16913 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16914 (ResolveFlags): Added MaskExprClass.
16916 * expression.cs (MemberAccess): Implement the ITypeExpression
16918 (MemberAccess.DoResolve): Added support for a types-only lookup
16919 when we're called via ITypeExpression.DoResolveType().
16920 (ComposedCast): Implement the ITypeExpression interface.
16922 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16923 Expression.Resolve() with ResolveFlags.Type instead.
16925 2002-08-12 Martin Baulig <martin@gnome.org>
16927 * interface.cs (Interface.Define): Apply attributes.
16929 * attribute.cs (Attribute.ApplyAttributes): Added support for
16930 interface attributes.
16932 2002-08-11 Martin Baulig <martin@gnome.org>
16934 * statement.cs (Block.Emit): Only check the "this" variable if we
16935 do not always throw an exception.
16937 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16938 whether the property has a set accessor.
16940 2002-08-11 Martin Baulig <martin@gnome.org>
16942 Added control flow analysis support for structs.
16944 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16945 with control flow analysis turned off.
16946 (IVariable): New interface.
16947 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16948 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16949 (FieldExpr.DoResolve): Resolve the instance expression with flow
16950 analysis turned off and do the definite assignment check after the
16951 resolving when we know what the expression will resolve to.
16953 * expression.cs (LocalVariableReference, ParameterReference):
16954 Implement the new IVariable interface, only call the flow analysis
16955 code if ec.DoFlowAnalysis is true.
16956 (This): Added constructor which takes a Block argument. Implement
16957 the new IVariable interface.
16958 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16959 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16960 This does the definite assignment checks for struct members.
16962 * class.cs (Constructor.Emit): If this is a non-static `struct'
16963 constructor which doesn't have any initializer, call
16964 Block.AddThisVariable() to tell the flow analysis code that all
16965 struct elements must be initialized before control returns from
16968 * statement.cs (MyStructInfo): New public class.
16969 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16970 argument to this indexer. If non-zero, check an individual struct
16971 member, not the whole struct.
16972 (FlowBranching.CheckOutParameters): Check struct members.
16973 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16974 overloaded versions of these methods which take an additional
16975 `int field_idx' argument to check struct members.
16976 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16977 overloaded versions of these methods which take an additional
16978 `string field_name' argument to check struct member.s
16979 (VariableInfo): Implement the IVariable interface.
16980 (VariableInfo.StructInfo): New public property. Returns the
16981 MyStructInfo instance of the variable if it's a struct or null.
16982 (Block.AddThisVariable): New public method. This is called from
16983 Constructor.Emit() for non-static `struct' constructor which do
16984 not have any initializer. It creates a special variable for the
16985 "this" instance variable which will be checked by the flow
16986 analysis code to ensure that all of the struct's fields are
16987 initialized before control returns from the constructor.
16988 (UsageVector): Added support for struct members. If a
16989 variable/parameter is a struct with N members, we reserve a slot
16990 in the usage vector for each member. A struct is considered fully
16991 initialized if either the struct itself (slot 0) or all its
16992 members are initialized.
16994 2002-08-08 Martin Baulig <martin@gnome.org>
16996 * driver.cs (Driver.MainDriver): Only report an error CS5001
16997 if there were no compilation errors.
16999 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17000 `UnsafeContext' property to determine whether the parent is in
17001 unsafe context rather than checking the parent's ModFlags:
17002 classes nested in an unsafe class are unsafe as well.
17004 2002-08-08 Martin Baulig <martin@gnome.org>
17006 * statement.cs (UsageVector.MergeChildren): Distinguish between
17007 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17008 we return. Added test17() and test18() to test-154.cs.
17010 2002-08-08 Martin Baulig <martin@gnome.org>
17012 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17013 Family access, make sure the invoking type isn't a subclass of the
17014 queried type (that'd be a CS1540).
17016 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17017 this method which takes an additional `Type invocation_type'.
17019 * expression.cs (BaseAccess.DoResolve): Use the base type as
17020 invocation and query type.
17021 (MemberAccess.DoResolve): If the lookup failed and we're about to
17022 report a CS0122, try a lookup with the ec.ContainerType - if this
17023 succeeds, we must report a CS1540.
17025 2002-08-08 Martin Baulig <martin@gnome.org>
17027 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17028 (MethodGroupExpr): Implement the IMemberExpr interface.
17030 * expression (MemberAccess.ResolveMemberAccess): No need to have
17031 any special code for MethodGroupExprs anymore, they're now
17034 2002-08-08 Martin Baulig <martin@gnome.org>
17036 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17037 Family, FamANDAssem and FamORAssem permissions.
17038 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17040 2002-08-08 Martin Baulig <martin@gnome.org>
17042 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17043 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17046 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17048 * driver.cs: implemented /resource option to embed managed resources.
17050 2002-08-07 Martin Baulig <martin@gnome.org>
17052 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17053 (FieldBase.HasFieldInitializer): New public property.
17054 (FieldBase.GetInitializerExpression): New public method. Resolves and
17055 returns the field initializer and makes sure it is only resolved once.
17056 (TypeContainer.EmitFieldInitializers): Call
17057 FieldBase.GetInitializerExpression to get the initializer, this ensures
17058 that it isn't resolved multiple times.
17060 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17061 the resolving process (SimpleName/MemberLookup) that we're currently
17062 emitting a field initializer (which must not access any instance members,
17063 this is an error CS0236).
17065 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17066 argument, if the `IsFieldInitializer' flag is set, we must report and
17067 error CS0236 and not an error CS0120.
17069 2002-08-07 Martin Baulig <martin@gnome.org>
17071 * ecore.cs (IMemberExpr): New public interface.
17072 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17073 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17074 if the expression is an IMemberExpr.
17076 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17077 to be null, implicitly default to `this' if we're non-static in
17078 this case. Simplified the code a lot by using the new IMemberExpr
17079 interface. Also fixed bug #28176 here.
17081 2002-08-06 Martin Baulig <martin@gnome.org>
17083 * cs-parser.jay (SimpleLookup): Removed. We need to create
17084 ParameterReferences during semantic analysis so that we can do a
17085 type-only search when resolving Cast, TypeOf and SizeOf.
17086 (block): Pass the `current_local_parameters' to the Block's
17089 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17090 argument to the constructor.
17091 (ConstructorInitializer.Resolve): Create a temporary implicit
17092 block with the parameters.
17094 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17095 references here if we aren't doing a type-only search.
17097 * statement.cs (Block): Added constructor which takes a
17098 `Parameters parameters' argument.
17099 (Block.Parameters): New public property.
17101 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17102 to `Parameters' and made it public readonly.
17104 2002-08-06 Martin Baulig <martin@gnome.org>
17106 * ecore.cs (Expression.Warning): Made this public as well.
17108 * report.cs (Report.Debug): Print the contents of collections.
17110 2002-08-06 Martin Baulig <martin@gnome.org>
17112 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17113 used to tell Resolve() which kinds of expressions it may return.
17114 (Expression.Resolve): Added overloaded version of this method which
17115 takes a `ResolveFlags flags' argument. This can be used to tell
17116 Resolve() which kinds of expressions it may return. Reports a
17118 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17119 ResolveFlags.SimpleName.
17120 (Expression.Error118): Added overloaded version of this method which
17121 takes a `ResolveFlags flags' argument. It uses the flags to determine
17122 which kinds of expressions are allowed.
17124 * expression.cs (Argument.ResolveMethodGroup): New public method.
17125 Resolves an argument, but allows a MethodGroup to be returned.
17126 This is used when invoking a delegate.
17128 * TODO: Updated a bit.
17130 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17132 Fixed compilation with csc.
17134 * ecore.cs: Expression.Error made public. Is this correct? Should
17135 Warning be made public too?
17137 * expression.cs: use ea.Location instead of ea.loc.
17138 [FIXME: Filed as bug #28607: MCS must report these errors.]
17140 2002-08-06 Martin Baulig <martin@gnome.org>
17142 * ecore.cs (Expression.loc): Moved the location here instead of
17143 duplicating it in all derived classes.
17144 (Expression.Location): New public property.
17145 (Expression.Error, Expression.Warning): Made them non-static and
17146 removed the location argument.
17147 (Expression.Warning): Added overloaded version which takes an
17148 `int level' argument.
17149 (Expression.Error118): Make this non-static and removed the
17150 expression and location arguments.
17151 (TypeExpr): Added location argument to the constructor.
17153 * expression.cs (StaticCallExpr): Added location argument to
17155 (Indirection, PointerArithmetic): Likewise.
17156 (CheckedExpr, UnCheckedExpr): Likewise.
17157 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17158 (StringPtr): Likewise.
17161 2002-08-05 Martin Baulig <martin@gnome.org>
17163 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17165 * assign.cs (Assign.DoResolve): Check whether the source
17166 expression is a value or variable.
17168 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17169 while resolving the corresponding blocks.
17171 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17172 an error, don't silently return null.
17174 * statement.cs (Block.AddVariable): Do the error reporting here
17175 and distinguish between CS0128 and CS0136.
17176 (Block.DoResolve): Report all unused labels (warning CS0164).
17177 (LabeledStatement): Pass the location to the constructor.
17178 (LabeledStatement.HasBeenReferenced): New property.
17179 (LabeledStatement.Resolve): Set it to true here.
17181 * statement.cs (Return.Emit): Return success even after reporting
17182 a type mismatch error (CS0126 or CS0127), this is what csc does and
17183 it avoids confusing the users with any consecutive errors.
17185 2002-08-05 Martin Baulig <martin@gnome.org>
17187 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17189 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17191 * expression.cs (MemberAccess.DoResolve): Silently return if an
17192 error has already been reported.
17194 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17195 error has already been reported.
17197 2002-08-05 Martin Baulig <martin@gnome.org>
17199 * statement.cs (UsageVector): Only initialize the `parameters'
17200 vector if we actually have any "out" parameters.
17202 2002-08-05 Martin Baulig <martin@gnome.org>
17204 * expression.cs (Binary.ResolveOperator): When combining delegates,
17205 they must have the same type.
17207 2002-08-05 Martin Baulig <martin@gnome.org>
17209 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17210 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17211 work with the ms runtime and we also don't need it: if we're a
17212 PropertyBuilder and not in the `indexer_arguments' hash, then we
17213 are a property and not an indexer.
17215 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17216 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17217 since the latter one doesn't work with the ms runtime.
17219 2002-08-03 Martin Baulig <martin@gnome.org>
17221 Fixed bugs #27998 and #22735.
17223 * class.cs (Method.IsOperator): New public field.
17224 (Method.CheckBase): Report CS0111 if there's already a method
17225 with the same parameters in the current class. Report CS0508 when
17226 attempting to change the return type of an inherited method.
17227 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17228 and it's not marked abstract or extern.
17229 (PropertyBase): New abstract base class for Property and Indexer.
17230 (PropertyBase.CheckBase): Moved here from Property and made it work
17232 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17233 the same so we can reuse it there.
17234 (Property, Indexer): Derive from PropertyBase.
17235 (MethodSignature.inheritable_property_signature_filter): New delegate
17236 to find properties and indexers.
17238 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17239 argument and improved error reporting.
17241 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17242 EmptyReadOnlyParameters and made it a property.
17244 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17245 version of this method which takes a `PropertyInfo indexer'.
17246 (TypeManager.RegisterIndexer): New method.
17248 * class.cs: Added myself as author of this file :-)
17250 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17252 * class.cs: fixed compilation on windoze.
17254 2002-08-03 Martin Baulig <martin@gnome.org>
17256 * interface.cs (Interface.GetInterfaceBases): Check whether all
17257 base interfaces are at least as accessible than the current one.
17259 * class.cs (TypeContainer.GetClassBases): Check whether base types
17260 are at least as accessible than the current type.
17261 (TypeContainer.AsAccessible): Implemented and made non-static.
17262 (MemberBase.CheckParameters): Report errors if the accessibility
17265 * delegate.cs (Delegate.Delegate): The default visibility is
17266 internal for top-level types and private for nested types.
17267 (Delegate.Define): Report errors if the accessibility checks fail.
17269 * enum.cs (Enum.Enum): The default visibility is internal for
17270 top-level types and private for nested types.
17271 (Enum.DefineType): Compute the correct visibility.
17273 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17274 function which takes a `bool is_toplevel' instead of a TypeContainer.
17276 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17279 2002-08-02 Martin Baulig <martin@gnome.org>
17281 * expression.cs (LocalVariableReferenc): Added constructor which
17282 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17283 (LocalVariableReference.IsReadOnly): New property.
17284 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17285 variable is readonly, use our own readonly flag to do this; you can
17286 use the new constructor to get a writable reference to a read-only
17289 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17290 reference to the local variable.
17292 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17294 * rootcontext.cs (ResolveCore): Also include System.Exception
17296 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17297 we reach an EmptyStatement.
17299 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17302 * expression.cs (Binary.ResolveOperator): Check error result in
17305 use brtrue/brfalse directly and avoid compares to null.
17307 2002-08-02 Martin Baulig <martin@gnome.org>
17309 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17310 Fixes bug #28407, added test-155.cs.
17312 2002-08-01 Martin Baulig <martin@gnome.org>
17314 * class.cs (Event.EmitDefaultMethod): Make this work with static
17315 events. Fixes #28311, added verify-3.cs.
17317 2002-08-01 Martin Baulig <martin@gnome.org>
17319 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17320 `is_disposable' fields.
17321 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17322 `hm.is_disposable' if we're using the collection pattern.
17323 (Foreach.EmitCollectionForeach): Use the correct type for the
17324 enumerator's local variable, only emit the try/finally block if
17325 necessary (fixes #27713).
17327 2002-08-01 Martin Baulig <martin@gnome.org>
17329 * ecore.cs (Expression.report118): Renamed to Error118 and made
17332 * statement.cs (Throw.Resolve): Check whether the expression is of
17333 the correct type (CS0118) and whether the type derives from
17334 System.Exception (CS0155).
17335 (Catch.Resolve): New method. Do the type lookup here and check
17336 whether it derives from System.Exception (CS0155).
17337 (Catch.CatchType, Catch.IsGeneral): New public properties.
17339 * typemanager.cs (TypeManager.exception_type): Added.
17341 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17343 * driver.cs: Updated About function.
17345 2002-07-31 Martin Baulig <martin@gnome.org>
17347 Implemented Control Flow Analysis.
17349 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17350 (EmitContext.CurrentBranching): Added.
17351 (EmitContext.StartFlowBranching): Added.
17352 (EmitContext.EndFlowBranching): Added.
17353 (EmitContext.KillFlowBranching): Added.
17354 (EmitContext.IsVariableAssigned): Added.
17355 (EmitContext.SetVariableAssigned): Added.
17356 (EmitContext.IsParameterAssigned): Added.
17357 (EmitContext.SetParameterAssigned): Added.
17358 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17359 Added control flow analysis stuff here.
17361 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17362 resolve the expression as lvalue.
17363 (LocalVariableReference.DoResolve): Check whether the variable has
17364 already been assigned.
17365 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17366 the parameter as assigned here.
17367 (ParameterReference.DoResolve): Check whether the parameter has already
17369 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17370 expression as lvalue.
17372 * statement.cs (FlowBranching): New class for the flow analysis code.
17373 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17374 (LabeledStatement.IsDefined): New public property.
17375 (LabeledStatement.AddUsageVector): New public method to tell flow
17376 analyis that the label may be reached via a forward jump.
17377 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17379 (VariableInfo.Number): New public field. This is used by flow analysis
17380 to number all locals of a block.
17381 (Block.CountVariables): New public property. This is the number of
17382 local variables in this block (including the locals from all parent
17384 (Block.EmitMeta): Number all the variables.
17386 * statement.cs: Added flow analysis support to all classes.
17388 2002-07-31 Martin Baulig <martin@gnome.org>
17390 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17391 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17392 then use this argument.
17394 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17396 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17397 use this to specify /define options.
17399 2002-07-29 Martin Baulig <martin@gnome.org>
17401 * statement.cs (Fixed): Moved all code that does variable lookups
17402 and resolvings from Emit to Resolve.
17404 * statement.cs (For): Moved all code that does variable lookups
17405 and resolvings from Emit to Resolve.
17407 * statement.cs (Using): Moved all code that does variable lookups
17408 and resolvings from Emit to Resolve.
17410 2002-07-29 Martin Baulig <martin@gnome.org>
17412 * attribute.cs (Attribute.Resolve): Explicitly catch a
17413 System.NullReferenceException when creating the
17414 CustromAttributeBuilder and report a different warning message.
17416 2002-07-29 Martin Baulig <martin@gnome.org>
17418 * support.cs (ParameterData.ParameterName): Added method to
17419 get the name of a parameter.
17421 * typemanager.cs (TypeManager.IsValueType): New public method.
17423 2002-07-29 Martin Baulig <martin@gnome.org>
17425 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17426 is a flag which specifies that it's either ref or out.
17427 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17428 the out parameter to `out Parameter.Modifier mod', also set the
17429 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17431 * support.cs (InternalParameters.ParameterModifier): Distinguish
17432 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17433 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17435 * expression.cs (Argument.GetParameterModifier): Distinguish
17436 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17437 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17439 2002-07-29 Martin Baulig <martin@gnome.org>
17441 * expression.cs (ParameterReference.ParameterReference): Added
17442 `Location loc' argument to the constructor.
17444 * cs-parser.jay: Pass location to ParameterReference.
17446 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17448 * statement.cs (Try): Initialize the location.
17450 * cs-parser.jay: pass location to Try.
17452 * expression.cs (Unary.Reduce): Change the prototype to return
17453 whether a constant fold could be performed or not. The result is
17454 returned in an out parameters. In the case of Indirection and
17455 AddressOf, we want to perform the full tests.
17457 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17459 * statement.cs (Statement.Emit): Flag dead code.
17461 2002-07-27 Andrew Birkett <andy@nobugs.org>
17463 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17465 2002-07-27 Martin Baulig <martin@gnome.org>
17467 * class.cs (MethodData.Define): Put back call to
17468 TypeManager.AddMethod(), accidentally commented this out.
17470 * report.cs (Debug): New public method to print debugging information,
17471 this is `[Conditional ("DEBUG")]'.
17473 2002-07-26 Martin Baulig <martin@gnome.org>
17475 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17476 (switch_statement): Push the current_block to the switch_stack and
17477 pop it again when we're done with the switch.
17478 (switch_section): The new block is a child of the current_block.
17479 Fixes bug #24007, added test-152.cs.
17481 2002-07-27 Martin Baulig <martin@gnome.org>
17483 * expression.cs (Invocation.EmitArguments): When calling a varargs
17484 function with only its fixed arguments, we need to pass an empty
17487 2002-07-27 Martin Baulig <martin@gnome.org>
17489 Mono 0.13 has been released.
17491 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17493 * driver.cs: Rename --resource to --linkres, because that is what
17494 we do currently, we dont support --resource yet.
17496 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17498 2002-07-25 Martin Baulig <martin@gnome.org>
17500 * class.cs (MethodData): New public class. This is a `method builder'
17501 class for a method or one accessor of a Property/Indexer/Event.
17502 (MethodData.GetMethodFlags): Moved here from MemberBase.
17503 (MethodData.ApplyAttributes): Likewise.
17504 (MethodData.ApplyObsoleteAttribute): Likewise.
17505 (MethodData.ApplyConditionalAttribute): Likewise.
17506 (MethodData.ApplyDllImportAttribute): Likewise.
17507 (MethodData.CheckAbstractAndExternal): Likewise.
17508 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17509 (MethodData.Emit): Formerly known as Method.Emit().
17510 (MemberBase): Moved everything which was specific to a single
17511 accessor/method to MethodData.
17512 (Method): Create a new MethodData and call Define() and Emit() on it.
17513 (Property, Indexer, Event): Create a new MethodData objects for each
17514 accessor and call Define() and Emit() on them.
17516 2002-07-25 Martin Baulig <martin@gnome.org>
17518 Made MethodCore derive from MemberBase to reuse the code from there.
17519 MemberBase now also checks for attributes.
17521 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17522 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17524 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17525 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17526 (MemberBase.ApplyAttributes): New virtual method; applies the
17527 attributes to a method or accessor.
17528 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17529 (MemberBase.ApplyConditionalAttribute): Likewise.
17530 (MemberBase.ApplyDllImportAttribute): Likewise.
17531 (MemberBase.CheckAbstractAndExternal): Likewise.
17532 (MethodCore.ParameterTypes): This is now a property instead of a
17533 method, it's initialized from DoDefineParameters().
17534 (MethodCore.ParameterInfo): Removed the set accessor.
17535 (MethodCore.DoDefineParameters): New protected virtual method to
17536 initialize ParameterTypes and ParameterInfo.
17537 (Method.GetReturnType): We can now simply return the MemberType.
17538 (Method.GetMethodFlags): Override the MemberBase version and add
17539 the conditional flags.
17540 (Method.CheckBase): Moved some code from Define() here, call
17541 DoDefineParameters() here.
17542 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17543 here to avoid some larger code duplication.
17544 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17545 ensure that abstract and external accessors don't declare a body.
17547 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17548 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17549 lookup in the attribute's parent classes, so we need to abort as soon
17550 as we found the first match.
17551 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17552 the attribute has no arguments.
17554 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17557 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17559 * cs-parser.jay: reverted previous patch.
17561 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17563 * cs-parser.jay: fixed bug #22119.
17565 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17567 * attribute.cs: fixed compilation. The error was:
17568 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17569 be assigned to before control leaves the current method."
17570 [FIXME: Filed as bug #28186: MCS must report this error.]
17572 2002-07-25 Martin Baulig <martin@gnome.org>
17574 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17575 method to pull the condition name ouf of a Conditional attribute.
17576 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17577 the obsolete message and error flag out of an Obsolete attribute.
17579 * class.cs (Method.GetMethodFlags): New public method to get the
17580 TypeManager.MethodFlags for this method.
17581 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17583 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17584 if we're overriding a virtual function, set the new private variable
17585 `parent_method'; call the new TypeManager.AddMethod().
17587 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17588 the MethodBuilder and the Method in a PtrHashtable.
17589 (TypeManager.builder_to_method): Added for this purpose.
17590 (TypeManager.MethodFlags): Added IsObsoleteError.
17591 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17592 Obsolete and Conditional arguments in MethodBuilders. If we discover
17593 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17594 the message from the attribute.
17596 2002-07-24 Martin Baulig <martin@gnome.org>
17598 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17599 preprocessor directives, ensure that the argument to #define/#undef is
17600 exactly one identifier and that it's actually an identifier.
17602 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17605 2002-07-24 Martin Baulig <martin@gnome.org>
17607 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17608 initialize it to TypeManager.object_type in the constructor.
17609 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17610 of the `hm.get_current' method if we're using the collection pattern.
17611 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17612 for the explicit conversion to make it work when we're using the collection
17613 pattern and the `Current' property has a different return type than `object'.
17616 2002-07-24 Martin Baulig <martin@gnome.org>
17618 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17619 does not match, but don't report any errors. This method is called in
17620 order for all methods in a MethodGroupExpr until a matching method is
17621 found, so we don't want to bail out if the first method doesn't match.
17622 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17623 matches, report the 123. Fixes #28070.
17625 2002-07-24 Martin Baulig <martin@gnome.org>
17627 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17628 TypeManager.TypeToCoreType() to the top of the method so the
17629 following equality checks will work. Fixes #28107.
17631 2002-07-24 Martin Baulig <martin@gnome.org>
17633 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17634 operand is of type uint, and the other operand is of type sbyte,
17635 short or int, the operands are converted to type long." -
17636 Actually do what this comment already told us. Fixes bug #28106,
17639 2002-07-24 Martin Baulig <martin@gnome.org>
17641 * class.cs (MethodBase): New abstract class. This is now a base
17642 class for Property, Indexer and Event to avoid some code duplication
17643 in their Define() and DefineMethods() methods.
17644 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17645 generic methods for Define() and DefineMethods().
17646 (FieldBase): Derive from MemberBase, not MemberCore.
17647 (Property): Derive from MemberBase, not MemberCore.
17648 (Property.DefineMethod): Moved all the code from this method to the
17649 new MethodBase.DefineAccessor(), just call it with appropriate
17651 (Property.Define): Call the new Property.DoDefine(), this does some
17652 sanity checks and we don't need to duplicate the code everywhere.
17653 (Event): Derive from MemberBase, not MemberCore.
17654 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17655 accessors, this will also make them work with interface events.
17656 (Indexer): Derive from MemberBase, not MemberCore.
17657 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17658 (Indexer.Define): Use the new MethodBase functions.
17660 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17661 argument to the constructor.
17662 (Interface.FindMembers): Added support for interface events.
17663 (Interface.PopluateEvent): Implemented.
17665 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17667 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17669 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17670 but this is required to check for a method name being the same as
17671 the containing class.
17675 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17677 * interface.cs: initialize variable.
17679 2002-07-23 Martin Baulig <martin@gnome.org>
17681 Implemented the IndexerName attribute in interfaces.
17683 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17684 name if this is an explicit interface implementation.
17685 (Indexer.InterfaceIndexerName): New public variable. If we're
17686 implementing an interface indexer, this is the IndexerName in that
17687 interface. Otherwise, it's the IndexerName.
17688 (Indexer.DefineMethod): If we're implementing interface indexer,
17689 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17690 and Pending.ImplementIndexer methods.
17691 (Indexer.Define): Also define the PropertyBuilder if we're
17692 implementing an interface indexer and this is neither an explicit
17693 interface implementation nor do the IndexerName match the one in
17696 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17697 If a method is defined here, then we always need to create a proxy
17698 for it. This is used when implementing interface indexers.
17699 (Pending.IsInterfaceIndexer): New public method.
17700 (Pending.ImplementIndexer): New public method.
17701 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17702 This is used when implementing interface indexers to define a proxy
17704 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17705 define a proxy if necessary.
17707 * interface.cs (Interface.IndexerName): New public variable.
17708 (Interface.PopulateIndexer): Set the IndexerName.
17709 (Interface.DefineIndexers): New private method. Populate all the
17710 indexers and make sure their IndexerNames match.
17712 * typemanager.cs (IndexerPropertyName): Added support for interface
17715 2002-07-22 Martin Baulig <martin@gnome.org>
17717 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17718 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17719 ret if HasReturnLabel.
17720 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17723 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17724 and set the ec.LoopBeginTryCatchLevel.
17725 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17726 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17727 the current ec.TryCatchLevel, the branch goes out of an exception
17728 block. In this case, we need to use Leave and not Br.
17730 2002-07-22 Martin Baulig <martin@gnome.org>
17732 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17733 block unless the block does not always return or it is contained in
17734 another try { ... } catch { ... } block. Fixes bug #26506.
17735 Added verify-1.cs to the test suite.
17737 2002-07-22 Martin Baulig <martin@gnome.org>
17739 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17740 then we do not always return. Fixes bug #24985.
17742 2002-07-22 Martin Baulig <martin@gnome.org>
17744 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17745 lookup on a per-class level; ie. walk up the class hierarchy until we
17746 found at least one applicable method, then choose the best among them.
17747 Fixes bug #24463 and test-29.cs.
17749 2002-07-22 Martin Baulig <martin@gnome.org>
17751 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17752 return types of the methods. The return type is not part of the
17753 signature and we must not check it to make the `new' modifier work.
17754 Fixes bug #27999, also added test-147.cs.
17755 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17757 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17758 on the method's return type.
17760 2002-07-21 Martin Baulig <martin@gnome.org>
17762 * assign.cs: Make this work if the rightmost source is a constant and
17763 we need to do an implicit type conversion. Also adding a few more tests
17764 to test-38.cs which should have caught this.
17766 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17767 target in the makefile for this. The makefile.gnu is primarily intended
17768 for end-users who don't want to debug the compiler.
17770 2002-07-21 Martin Baulig <martin@gnome.org>
17772 * assign.cs: Improved the Assign class so it can now handle embedded
17773 assignments (X = Y = Z = something). As a side-effect this'll now also
17774 consume less local variables. test-38.cs now passes with MCS, added
17775 a few new test cases to that test.
17777 2002-07-20 Martin Baulig <martin@gnome.org>
17779 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17780 instructions. Fixes bug #27977, also added test-146.cs.
17782 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17784 * cs-tokenizer.cs: fixed getHex ().
17786 2002-07-19 Martin Baulig <martin@gnome.org>
17788 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17789 not Type.GetType() to lookup the array type. This is needed when
17790 we're constructing an array of a user-defined type.
17791 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17792 single-dimensional arrays, but also for single-dimensial arrays of
17795 2002-07-19 Martin Baulig <martin@gnome.org>
17797 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17798 this function is called, it's not allowed to share LocalBuilders
17799 among ILGenerators.
17801 2002-07-19 Martin Baulig <martin@gnome.org>
17803 * expression.cs (Argument.Resolve): Report an error 118 when trying
17804 to pass a type as argument.
17806 2002-07-18 Martin Baulig <martin@gnome.org>
17808 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17809 Conv_R_Un for the signed `long' type.
17811 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17813 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17814 `expr' for the temporary result, as that will fail if we do
17815 multiple resolves on the same expression.
17817 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17819 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17820 ec.TypeContainer for looking up aliases.
17822 * class.cs (TypeContainer): Remove LookupAlias from here.
17824 * decl.cs (DeclSpace); Move here.
17826 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17828 * class.cs (FindMembers): Only call filter if the constructor
17829 bulider is not null.
17831 Also handle delegates in `NestedTypes' now. Now we will perform
17832 type lookups using the standard resolution process. This also
17835 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17836 This uses Expressions (the limited kind that can be parsed by the
17837 tree) instead of strings.
17839 * expression.cs (ComposedCast.ToString): Implement, used to flag
17840 errors since now we have to render expressions.
17842 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17845 * ecore.cs (SimpleName.ToString): ditto.
17847 * cs-parser.jay: Instead of using strings to assemble types, use
17848 Expressions to assemble the type (using SimpleName, ComposedCast,
17849 MemberAccess). This should fix the type lookups in declarations,
17850 because we were using a different code path for this.
17852 * statement.cs (Block.Resolve): Continue processing statements
17853 even when there is an error.
17855 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17857 * class.cs (Event.Define): Also remove the `remove' method from
17858 the list of pending items.
17860 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17861 generate more compact code.
17863 2002-07-17 Martin Baulig <martin@gnome.org>
17865 * const.cs (Const.LookupConstantValue): Add support for constant
17866 `unchecked' and `checked' expressions.
17867 Also adding test case test-140.cs for this.
17869 2002-07-17 Martin Baulig <martin@gnome.org>
17871 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17872 check whether mi.ReturnType implements the IEnumerator interface; the
17873 `==' and the IsAssignableFrom() will fail in this situation.
17875 2002-07-16 Ravi Pratap <ravi@ximian.com>
17877 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17880 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17882 * expression.cs: fixed bug #27811.
17884 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17886 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17887 Molaro: when we are a ref, the value already contains a pointer
17888 value, do not take the address of it.
17890 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17891 * removed mb-parser.jay and mb-tokenizer.cs
17893 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17895 * expression.cs: check against the building corlib void type.
17897 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17899 * ecore.cs: fix for valuetype static readonly fields: when
17900 initializing them, we need their address, not the address of a copy.
17902 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17904 * typemanager.cs: register also enum_type in corlib.
17906 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17908 * class.cs: allow calling this (but not base) initializers in structs.
17910 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17912 * ecore.cs: make sure we compare against the building base types
17915 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17917 * typemanager.cs: fix TypeToCoreType() to handle void and object
17918 (corlib gets no more typerefs after this change).
17920 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17922 * expression.cs (ArrayCreation.EmitArrayArguments): use
17923 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17925 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17926 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17927 array indexes, the runtime actually forbids them.
17929 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17930 for array arguments here.
17932 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17933 instead of the default for ValueTypes.
17935 (New.DoEmit): Use IsValueType instead of
17936 IsSubclassOf (value_type)
17937 (New.DoResolve): ditto.
17938 (Invocation.EmitCall): ditto.
17940 * assign.cs (Assign): ditto.
17942 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17943 Statements *are* currently doing part of their resolution during
17946 Expressions do always resolve during resolve, but statements are
17947 only required to propagate resolution to their children.
17949 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17951 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17953 (LoadAssembly): Do not add the dll if it is already specified
17955 (MainDriver): Add the System directory to the link path at the end,
17956 after all the other -L arguments.
17958 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17959 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17960 ldelem.u1) and using the opposite for sbytes.
17962 This fixes Digger, and we can finally run it.
17964 * driver.cs (UnixParseOption): Move the option parsing here.
17965 (CSCParseOption): Implement CSC-like parsing of options.
17967 We now support both modes of operation, the old Unix way, and the
17968 new CSC-like way. This should help those who wanted to make cross
17969 platform makefiles.
17971 The only thing broken is that /r:, /reference: and /lib: are not
17972 implemented, because I want to make those have the same semantics
17973 as the CSC compiler has, and kill once and for all the confussion
17974 around this. Will be doing this tomorrow.
17976 * statement.cs (Unsafe.Resolve): The state is checked during
17977 resolve, not emit, so we have to set the flags for IsUnsfe here.
17979 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17981 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17982 not catch the Error_ObjectRefRequired in SimpleName (as it is
17983 possible to have a class/instance variable name that later gets
17984 deambiguated), we have to check this here.
17986 2002-07-10 Ravi Pratap <ravi@ximian.com>
17988 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17989 make static and put into Expression.
17991 (Event.Define): Register the private field of the event with the
17992 TypeManager so that GetFieldFromEvent can get at it.
17994 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17995 keep track of the private field associated with an event which
17998 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18001 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18003 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18005 * expression.cs (Binary.EmitBranchable): this routine emits the
18006 Binary expression in a branchable context. This basically means:
18007 we need to branch somewhere, not just get the value on the stack.
18009 This works together with Statement.EmitBoolExpression.
18011 * statement.cs (Statement.EmitBoolExpression): Use
18014 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18016 * statement.cs (For): Reduce the number of jumps in loops.
18018 (For): Implement loop inversion for the For statement.
18020 (Break): We can be breaking out of a Try/Catch controlled section
18021 (foreach might have an implicit try/catch clause), so we need to
18022 use Leave instead of Br.
18024 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18025 now). If the instace expression supports IMemoryLocation, we use
18026 the AddressOf method from the IMemoryLocation to extract the
18027 address instead of emitting the instance.
18029 This showed up with `This', as we were emitting the instance
18030 always (Emit) instead of the Address of This. Particularly
18031 interesting when This is a value type, as we dont want the Emit
18032 effect (which was to load the object).
18034 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18036 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18038 * statement.cs (Checked): Set the CheckedState during the resolve
18039 process too, as the ConvCast operations track the checked state on
18040 the resolve process, and not emit.
18042 * cs-parser.jay (namespace_member_declaration): Flag that we have
18043 found a declaration when we do. This is used to flag error 1529
18045 * driver.cs: Report ok when we display the help only.
18047 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18049 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18051 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18053 * cs-tokenizer.cs (define): We also have to track locally the
18054 defines. AllDefines is just used for the Conditional Attribute,
18055 but we also need the local defines for the current source code.
18057 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18059 * statement.cs (While, For, Do): These loops can exit through a
18060 Break statement, use this information to tell whether the
18061 statement is the last piece of code.
18063 (Break): Flag that we break.
18065 * codegen.cs (EmitContexts): New `Breaks' state variable.
18067 2002-07-03 Martin Baulig <martin@gnome.org>
18069 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18070 modifiers in method declarations in structs. Otherwise, you won't
18071 be able to override things like Object.Equals().
18073 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18075 * class.cs (Method, Property, Indexer): Do not allow the public
18076 modifier to be used in explicit interface implementations.
18078 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18079 override modifiers in method declarations in structs
18081 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18083 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18084 integer or real overflow, report an error
18086 2002-07-02 Martin Baulig <martin@gnome.org>
18088 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18089 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18090 to tell the runtime about our newly created System.Object and
18091 System.ValueType types.
18093 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18095 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18096 struct instead of Ldarg/Starg.
18098 2002-07-02 Martin Baulig <martin@gnome.org>
18100 * expression.cs (Indirection.Indirection): Call
18101 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18103 2002-07-02 Martin Baulig <martin@gnome.org>
18105 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18106 ValueType, call TypeManager.TypeToCoreType() on it.
18107 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18108 the OpCodes.Newarr argument.
18110 2002-07-02 Martin Baulig <martin@gnome.org>
18112 * expression.cs (Invocation.EmitCall): When compiling corlib,
18113 replace all calls to the system's System.Array type to calls to
18114 the newly created one.
18116 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18117 System.Array methods.
18118 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18119 from the system's System.Array type which must be replaced.
18121 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18123 * typemanager.cs: load unverifiable_code_ctor so we can build
18124 corlib using the correct type. Avoid using GetTypeCode() with
18126 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18127 TypeManager.object_type to allow building corlib.
18129 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18131 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18133 2002-07-01 Martin Baulig <martin@gnome.org>
18135 * class.cs: Make the last change actually work, we need to check
18136 whether `ifaces != null' to avoid a crash.
18138 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18140 * class.cs: when we build structs without fields that implement
18141 interfaces, we need to add the interfaces separately, since there is
18142 no API to both set the size and add the interfaces at type creation
18145 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18147 * expression.cs: the dimension arguments to the array constructors
18148 need to be converted if they are a long.
18150 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18152 * class.cs: don't emit ldarg.0 if there is no parent constructor
18153 (fixes showstopper for corlib).
18155 2002-06-29 Martin Baulig <martin@gnome.org>
18157 MCS now compiles corlib on GNU/Linux :-)
18159 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18160 ie. check for MethodImplOptions.InternalCall.
18162 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18163 and TypeManager.attribute_type are null, so we must explicitly check
18164 whether parent is not null to find out whether it's an attribute type.
18165 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18166 and SetBuilder, not only if the property is neither abstract nor external.
18167 This is necessary to set the MethodImplOptions on the accessor methods.
18168 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18169 SetBuilder, see Property.Emit().
18171 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18172 populate "System.Object", "System.ValueType" and "System.Attribute" since
18173 they've already been populated from BootCorlib_PopulateCoreTypes().
18175 2002-06-29 Martin Baulig <martin@gnome.org>
18177 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18178 is the NullLiteral, we also need to make sure that target_type is not
18181 2002-06-29 Martin Baulig <martin@gnome.org>
18183 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18184 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18185 before calling BootstrapCorlib_ResolveDelegate ().
18187 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18189 * statement.cs: fixed build-breaker. All tests passed ok.
18191 2002-06-27 Martin Baulig <martin@gnome.org>
18193 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18194 for System.Decimal when compiling corlib.
18196 2002-06-27 Martin Baulig <martin@gnome.org>
18198 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18199 switch blocks which contain nothing but a default clause.
18201 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18203 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18205 2002-06-27 Martin Baulig <martin@gnome.org>
18207 * ecore.cs (PropertyExpr.PropertyExpr): Call
18208 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18210 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18211 is already a TypeBuilder.
18213 2002-06-27 Martin Baulig <martin@gnome.org>
18215 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18216 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18217 the "from an array-type to System.Array" case. This makes it work
18218 when compiling corlib.
18220 2002-06-27 Martin Baulig <martin@gnome.org>
18222 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18223 non-static PropertyExpr, set its InstanceExpression. This makes
18224 the `ICollection.Count' property work in System/Array.cs.
18226 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18228 * driver.cs: Made error handling more consistent. Errors now
18229 tracked by Report class, so many methods which used to return int
18230 now return void. Main() now prints success/failure and
18231 errors/warnings message.
18233 Renamed '--probe' compiler argument to '--expect-error'. Removed
18234 the magic number return values (123 and 124). Now, if the
18235 expected error occurs, the compiler exits with success (exit value
18236 0). If the compilation completes without seeing that particular
18237 error, the compiler exits with failure (exit value 1). The
18238 makefile in mcs/errors has been changed to handle the new behaviour.
18240 * report.cs: Made 'expected error' number a property and renamed
18241 it from 'Probe' to 'ExpectedError'.
18243 * genericparser.cs: Removed error handling support, since it is
18244 now all done by Report class.
18246 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18247 class, so parse() no longer returns an int.
18249 * namespace.cs: Use Report.Error instead of GenericParser.error
18251 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18253 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18254 TypeContainer.AddOperator): At the front of the list put the
18255 explicit implementations, so they get resolved/defined first.
18257 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18259 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18260 interface type is implemented by this TypeContainer. Used during
18261 explicit interface implementation.
18263 (Property.Define, Indexer.Define, Method.Define): Validate that
18264 the given interface in the explicit implementation is one of the
18265 base classes for the containing type.
18267 Also if we are explicitly implementing an interface, but there is
18268 no match in the pending implementation table, report an error.
18270 (Property.Define): Only define the property if we are
18271 not explicitly implementing a property from an interface. Use the
18272 correct name also for those properties (the same CSC uses,
18273 although that is really not needed).
18275 (Property.Emit): Do not emit attributes for explicitly implemented
18276 properties, as there is no TypeBuilder.
18278 (Indexer.Emit): ditto.
18280 Hiding then means that we do not really *implement* a pending
18281 implementation, which makes code fail.
18283 2002-06-22 Martin Baulig <martin@gnome.org>
18285 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18286 the return value of Object.GetType(). [FIXME: we need to do this whenever
18287 we get a type back from the reflection library].
18289 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18291 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18293 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18295 * attribute.cs: Return null if we can not look up the type.
18297 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18298 the interface types found.
18300 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18301 interface types found.
18303 * typemanager.cs (GetInterfaces): Make this routine returns alll
18304 the interfaces and work around the lame differences between
18305 System.Type and System.Reflection.Emit.TypeBuilder in the results
18306 result for GetInterfaces.
18308 (ExpandInterfaces): Given an array of interface types, expand and
18309 eliminate repeated ocurrences of an interface. This expands in
18310 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18313 2002-06-21 Martin Baulig <martin@gnome.org>
18315 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18318 2002-06-21 Martin Baulig <martin@gnome.org>
18320 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18321 and called with one of the core types, return the corresponding typebuilder for
18324 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18327 2002-06-21 Martin Baulig <martin@gnome.org>
18329 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18330 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18331 (Expression.ConvertReferenceExplicit): Likewise.
18333 * expression.cs (ElementAccess.DoResolve): Likewise.
18334 (ElementAccess.DoResolveLValue): Likewise.
18336 2002-06-10 Martin Baulig <martin@gnome.org>
18338 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18339 add the "value" parameter to the parameter list.
18341 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18344 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18346 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18347 the argument to an int, uint, long or ulong, per the spec. Also
18348 catch negative constants in array creation.
18350 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18352 * class.cs: do not allow the same interface to appear twice in
18353 the definition list.
18355 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18357 * ecore.cs: don't use ldlen with System.Array.
18359 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18361 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18363 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18365 * modifiers.cs: produce correct field attributes for protected
18366 internal. Easy fix so miguel can work on ther harder stuff:-)
18368 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18370 * pending.cs: New file. Move the code from class.cs here.
18371 Support clearning the pending flag for all methods (when not doing
18372 explicit interface implementation).
18374 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18376 * rootcontext.cs: added a couple more types needed to bootstrap.
18378 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18380 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18381 constructor in the type, instead of any constructor in the type
18382 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18383 a bug in the Mono runtime when applying the params attribute).
18385 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18386 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18388 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18390 * expression.cs (Unary.ResolveOperator): Use TypeManager
18391 to resolve the type.
18393 2002-06-13 Ravi Pratap <ravi@ximian.com>
18395 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18398 * enum.cs (AddEnumMember): Add support to store the attributes associated
18399 with each member too.
18401 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18402 field builders too - this takes care of the enum member case.
18404 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18406 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18407 address-of operator on both value types and pointers.
18409 2002-06-10 Martin Baulig <martin@gnome.org>
18411 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18412 PropertyBuilder to the `property_builders' list.
18414 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18415 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18416 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18417 find any indexers which are inherited from an interface.
18419 2002-06-09 Martin Baulig <martin@gnome.org>
18421 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18422 the same type as the constant if necessary. There's also a test-130.cs
18425 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18427 * typemanager.cs (TypeManager.ChangeType): Previously known as
18428 Enum.ChangeEnumType().
18430 2002-06-09 Martin Baulig <martin@gnome.org>
18432 * expression.cs (Cast.TryReduce): Added support for consts.
18434 2002-06-08 Ravi Pratap <ravi@ximian.com>
18436 * class.cs (Accessor): Hold attributes information so we can pass
18439 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18440 Modify to pass in attributes attached to the methods.
18442 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18444 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18445 to handle the Accessor kind :-)
18447 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18449 2002-06-08 Martin Baulig <martin@gnome.org>
18451 * expression.cs (Unary.TryReduceNegative): Added support for
18454 2002-06-08 Martin Baulig <martin@gnome.org>
18456 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18457 name can't be found in the `defined_names' - the caller will do a
18458 MemberLookup in this case and thus find methods in System.Enum
18459 such as Enum.IsDefined().
18461 2002-06-08 Martin Baulig <martin@gnome.org>
18463 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18464 Convert.ChangeType() which works with TypeBuilder created types.
18465 (Enum.LookupEnumValue, Enum.Define): Use it here.
18467 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18468 `TypeBuilder.BaseType != null' check.
18469 (TypeContainer.FindMembers): Only lookup parent members if we
18470 actually have a parent.
18471 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18472 (ConstructorInitializer.Resolve): Likewise.
18474 * interface.cs (Interface.FindMembers): Added
18475 `TypeBuilder.BaseType != null' check.
18477 * rootcontext.cs (RootContext.ResolveCore): Added
18478 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18479 classes_second_stage.
18481 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18482 debug_type and trace_type when compiling with --nostdlib.
18484 2002-06-07 Martin Baulig <martin@gnome.org>
18486 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18487 (AddField): Set it to true when adding a non-static field.
18488 (DefineType): Use `have_nonstatic_fields' to find out whether we
18489 have non-static fields, not `Fields != null'.
18491 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18493 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18494 dereferencing a null on the static-field code path)
18496 2002-05-30 Martin Baulig <martin@gnome.org>
18498 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18499 to take command line arguments. Use reflection to call the new
18500 custom `Initialize' function on the symbol writer and pass it the
18501 command line arguments.
18503 * driver.cs (--debug-args): New command line argument to pass command
18504 line arguments to the symbol writer.
18506 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18508 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18509 the target type for indexers and properties. Thanks to Joe for
18512 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18514 * typemanager.cs (MethodFlags): returns the method flags
18515 (Obsolete/ShouldIgnore) that control warning emission and whether
18516 the invocation should be made, or ignored.
18518 * expression.cs (Invocation.Emit): Remove previous hack, we should
18519 not do this on matching a base type, we should do this based on an attribute
18521 Only emit calls to System.Diagnostics.Debug and
18522 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18523 on the command line.
18525 * rootcontext.cs: Global settings for tracing and debugging.
18527 * cs-tokenizer.cs (define): New utility function to track
18528 defines. Set the global settings for TRACE and DEBUG if found.
18530 2002-05-25 Ravi Pratap <ravi@ximian.com>
18532 * interface.cs (Populate*): Pass in the TypeContainer as well as
18533 the DeclSpace as parameters so that we can create EmitContexts and
18534 then use that to apply attributes etc.
18536 (PopulateMethod, PopulateEvent, PopulateProperty)
18537 (PopulateIndexer): Apply attributes everywhere.
18539 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18542 (ApplyAttributes): Update accordingly.
18544 We now apply interface attributes for all members too.
18546 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18548 * class.cs (Indexer.Define); Correctly check if we are explicit
18549 implementation (instead of checking the Name for a ".", we
18550 directly look up if the InterfaceType was specified).
18552 Delay the creation of the PropertyBuilder.
18554 Only create the PropertyBuilder if we are not an explicit
18555 interface implementation. This means that explicit interface
18556 implementation members do not participate in regular function
18557 lookups, and hence fixes another major ambiguity problem in
18558 overload resolution (that was the visible effect).
18560 (DefineMethod): Return whether we are doing an interface
18563 * typemanager.cs: Temporary hack until we get attributes in
18564 interfaces (Ravi is working on that) and we get IndexerName
18565 support in interfaces.
18567 * interface.cs: Register the indexers as properties.
18569 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18570 warning, I have verified that this is a bug in the .NET runtime
18571 (JavaScript suffers of the same problem).
18573 * typemanager.cs (MemberLookup): When looking up members for
18574 interfaces, the parent of an interface is the implicit
18575 System.Object (so we succeed in searches of Object methods in an
18576 interface method invocation. Example: IEnumerable x; x.ToString
18579 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18581 * class.cs (Event): Events should also register if they do
18582 implement the methods that an interface requires.
18584 * typemanager.cs (MemberLookup); use the new GetInterfaces
18587 (GetInterfaces): The code used to lookup interfaces for a type is
18588 used in more than one place, factor it here.
18590 * driver.cs: Track the errors at the bottom of the file, we kept
18593 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18594 instance if the method we are calling is static!
18596 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18598 * attribute.cs (ApplyAttributes): Make this function filter out
18599 the IndexerName attribute (as that attribute in reality is never
18600 applied) and return the string constant for the IndexerName
18603 * class.cs (TypeContainer.Emit): Validate that all the indexers
18604 have the same IndexerName attribute, and if so, set the
18605 DefaultName attribute on the class.
18607 * typemanager.cs: The return value might contain other stuff (not
18608 only methods). For instance, consider a method with an "Item"
18609 property and an Item method.
18611 * class.cs: If there is a problem with the parameter types,
18614 2002-05-24 Ravi Pratap <ravi@ximian.com>
18616 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18617 looks at user defined conversion after making a call to
18618 StandardConversionExists - we need this for overload resolution.
18620 * expression.cs : Update accordingly the various method calls.
18622 This fixes 2 bugs filed against implicit user defined conversions
18624 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18626 * statement.cs: Track the result of the assignment.
18628 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18630 * expression.cs (MemberAccess): Improved error reporting for
18631 inaccessible members.
18633 2002-05-22 Martin Baulig <martin@gnome.org>
18635 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18636 itself with debugging support.
18638 2002-05-22 Martin Baulig <martin@gnome.org>
18640 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18641 Removed, this isn't needed anymore.
18643 2002-05-20 Martin Baulig <martin@gnome.org>
18645 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18646 be underlying type for an enum.
18648 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18650 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18651 that splits out the loading of just the core types.
18653 * rootcontext.cs (ResolveCore): Split the struct resolution in
18654 two, so we can load the enumeration underlying types before any
18657 * expression.cs (Is): Bandaid until we fix properly Switch (see
18658 bug #24985 for details).
18660 * typemanager.cs (ImplementsInterface): The hashtable will contain
18661 a null if there are no interfaces implemented.
18663 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18665 * cs-parser.jay (indexer_declarator): It is fine to have array
18668 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18670 * typemanager.cs: (RegisterBuilder): New function used to register
18671 TypeBuilders that implement interfaces. Since
18672 TypeBuilder.GetInterfaces (as usual) does not work with lame
18674 (AddUserType): register interfaces.
18676 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18677 dealing with TypeBuilder. Also, arrays are showing up as
18678 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18679 methods can not be invoked on them!
18681 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18682 (ImplicitReferenceConversionExists): Split out from
18683 StandardConversionExists.
18685 * expression.cs (As): We were only implementing one of the three
18686 cases for the as operator. We now implement them all.
18687 (Is): Implement the various other cases for Is as well.
18689 * typemanager.cs (CACHE): New define used to control if we want or
18690 not the FindMembers cache. Seems to have a negative impact on
18691 performance currently
18693 (MemberLookup): Nested types have full acess to
18694 enclosing type members
18696 Remove code that coped with instance/static returns for events, we
18697 now catch this in RealFindMembers.
18699 (RealFindMembers): only perform static lookup if the instance
18700 lookup did not return a type or an event.
18702 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18704 * assign.cs (CompoundAssign): We pass more semantic information
18705 now to Compound Assignments than we did before: now we have all
18706 the information at hand, and now we resolve the target *before* we
18707 do the expression expansion, which allows the "CacheValue" method
18708 to have the effect we intended (before, a [x] += 1 would generate
18709 two differen ArrayAccess expressions from the ElementAccess,
18710 during the resolution process).
18712 (CompoundAssign.DoResolve): Resolve target and original_source here.
18714 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18716 * expression.cs (ArrayAccess): dropped debugging information.
18718 * typemanager.cs: Small bug fix: I was always returning i_members,
18719 instead of one of i_members or s_members (depending on which had
18722 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18723 method is invoked before any code generation takes place, and it
18724 is a mechanism to inform that the expression will be invoked more
18725 than once, and that the method should use temporary values to
18726 avoid having side effects
18728 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18730 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18733 * expression.cs (Indirection, ArrayAccess): Add support for
18734 CacheTemporaries in these two bad boys.
18736 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18737 ldobj or ldind_ref.
18738 (StoreFromPtr): Handle stobj as well.
18740 * expression.cs (UnaryMutator): Share more code.
18742 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18743 down: I was not tracking the Filter function as well, which
18744 was affecting the results of the cache.
18746 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18748 * attribute.cs: Remove the hack to handle the CharSet property on
18751 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18753 * attribute.cs (DoResolve): More uglyness, we now only try to
18754 resolve the attribute partially, to extract the CharSet
18755 information (only if we are a StructLayout attribute). Otherwise
18757 (GetExtraTypeInfo): Add some code to conditionally kill in the
18758 future this. I am more and more convinced that the .NET
18759 framework has special code to handle the attribute setting on
18762 * expression.cs (IsParamsMethodApplicable): Revert my previous
18763 foreach change here, it was wrong.
18765 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18767 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18768 (pp_expr): do not abort on unknown input, just return.
18769 (eval): abort if there are pending chars.
18771 * attribute.cs (Attribute.Resolve): Positional parameters are
18772 optional. Deal with that case.
18774 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18775 the Ansi/Unicode/Auto information for the type.
18777 (TypeContainer.DefineType): instantiate the EmitContext here, as
18778 we will be using it during the type definition (to resolve
18779 attributes) and during the emit phase.
18781 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18782 to pull type information out of the attributes
18784 (Attribute.Resolve): track the constructor builder, and allow for
18785 multiple invocations (structs and classes will use this).
18787 * ecore.cs (MemberLookupFinal): new version with all the
18788 parameters customizable.
18790 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18791 constructors. Return if the result value is null (as the error
18792 would have been flagged already by MemberLookupFinal)
18794 Do not allow instances of abstract classes or interfaces to be
18797 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18798 We have to compare the assembly property here when dealing with
18799 FamANDAssem and Assembly access modifiers, because we might be
18800 creating an assembly from *modules* (that means that we are not
18801 getting TypeBuilders for types defined in other modules that are
18802 part of this assembly).
18804 (Method.Emit): If the method is marked abstract and has a body,
18807 (TypeContainer.DefineMembers): If both the defined member and the
18808 parent name match are methods, then do not emit any warnings: let
18809 the Method.Define routine take care of flagging warnings. But if
18810 there is a mismatch (method overrides something else, or method is
18811 overriwritten by something, then emit warning).
18813 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18814 set to null, this means `do not check for the return type on the
18817 (Method.Define): set the return type for the method signature to
18818 null, so that we get methods with the same name and parameters and
18819 different return types. This is used to flag warning 114 (you are
18820 hiding a method, and you probably want to use the new/override
18823 * typemanager.cs (MemberLookup): Implemented proper access
18824 control, closing a long standing set of bug reports. The problem
18825 was that the Framework only has two bits: Public and NonPublic,
18826 and NonPublic includes private and protected methods, but we need
18827 to enforce the FamANDAssem, FamOrAssem and Family.
18829 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18831 * statement.cs (GotoCase): Return true: Ammounts to giving up
18832 knowledge on whether we return or not, and letting the other case
18833 be responsible for it.
18835 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18837 * driver.cs: Do not load directories for each file processed, only
18838 do it if there is a pattern.
18840 * ecore.cs: Report readonly assigns here as well, as we might have
18841 been resolved only by MemberAccess.
18843 (SimpleName.SimpleNameResolve): Also be useful for LValue
18844 resolution. We need this to propagate assign to local readonly variables
18846 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18847 do not want to reuse potential criteria memory.
18849 * class.cs (MyEventBuilder): Set reflected_type;
18851 * ecore.cs (Constantify): Added support for constifying bools.
18853 (RootContext.LookupType): Added a cache for values looked up in
18854 the declaration space.
18856 * typemanager.cs (FindMembers): Now is a front-end to
18857 RealFindMembers, and provides a two-level hashtable-based cache to
18860 15% performance improvement: from 22.5 to 19.2 seconds.
18862 * expression.cs (IsParamsMethodApplicable): use foreach.
18863 (Invocation.DoResolve): ditto.
18864 (New.DoResolve): ditto.
18865 (ArrayCreation.DoResolve): ditto.
18867 * ecore.cs (FindMostEncompassingType): use foreach.
18869 * delegate.cs (NewDelegate.DoResolve): Use foreach
18871 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18872 (RemoveMethods): use foreach.
18874 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18875 nested foreach statements instead of for, and also break out of
18876 the inner loop once a match is found.
18878 (Invocation.OverloadResolve): Use foreach, simplify the code.
18880 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18882 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18883 we actually unwrap the expression to allow for extra information
18886 * expression.cs: Use Shr_Un on unsigned operations.
18888 2002-05-08 Ravi Pratap <ravi@ximian.com>
18890 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18891 applicable operators was not being considered correctly. This closes
18892 the bug Miguel reported.
18894 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18896 * attribute.cs: check that the type derives from System.Attribute
18897 and report the correct error in that case (moved the duplicate code to
18898 its own method, too).
18900 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18902 * attribute.cs: lookup attribute type name as the spec says: first the
18903 bare attribute name and then name + "Attribute" (nant compiles with
18904 mcs after this fix).
18906 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18908 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18909 Because of the way we parse things, we should try to see if a
18910 UIntConstant can fit in an integer.
18912 2002-05-07 Ravi Pratap <ravi@ximian.com>
18914 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18915 when we are in an explicit context.
18917 (ConvertReferenceExplicit): When converting from Iface type S to Class
18918 T make sure the rules are implemented as an OR.
18920 * parameter.cs (ParameterType): Make it a property for now although the
18921 purpose really isn't anything immediate.
18923 * expression.cs (Is*Applicable): Do better checking on the parameter type
18924 of a ref/out parameter. The ones from the system assemblies are already
18925 marked with the correct type so we don't need to do any correction.
18927 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18928 the object type is standard too so include that.
18930 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18932 * ecore.cs (StandardConversionExists): Augment with missing code:
18933 deal with IntConstant, LongConstants and Enumerations.
18935 * assign.cs: Report the error, instead of failing silently
18937 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18938 typecontainer that they are declared, because the
18939 typecontainer/namespace will have the list of using clauses that
18940 need to be applied.
18942 Assembly Attributes were escaping the normal registration
18945 (EmitCode): Apply attributes within an EmitContext that represents
18946 the container they were declared on.
18948 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18950 2002-05-06 Ravi Pratap <ravi@ximian.com>
18952 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18953 Revamp completely - make much cleaner as we now operate only
18956 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18957 to implement the logic detailed in the spec more correctly.
18959 (UserDefinedConversion): Update accordingly.
18961 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18963 * statement.cs: Return flow analysis information up.
18965 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18968 (token): Do not consume an extra character before calling
18971 2002-05-06 Piers Haken <piersh@friskit.com>
18973 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18975 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18977 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18978 EmitContext during the instance constructor initializer
18979 resolution, to stop access to instance variables.
18981 This is mandated by the spec, last paragraph of the `constructor
18982 initializers' section.
18984 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18986 * cs-parser.jay, class.cs (Accessor): new class used to represent
18987 an accessor (get or set). In the past we used `null' to represent
18988 a missing accessor. But this is ambiguous because there was no
18989 way to tell in abstract indexers/properties if one of them was
18992 Now there is a way of addressing that.
18994 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18995 instead of FindMembers.
18997 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18998 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19000 * attribute.cs: Treat indexers and properties as the same in terms
19001 of applying attributes
19003 * ecore.cs (FindMostEncompassedType): Use statically initialized
19004 EmptyExpressions()s like we do elsewhere to avoid creating useless
19005 objects (and we take this out of the tight loop).
19007 (GetConversionOperators): Move the code to extract the actual
19008 operators to a separate routine to clean things up.
19010 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19012 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19013 events are always registered FieldBuilders.
19015 * class.cs (FieldBase): New class shared by Fields
19017 * delegate.cs: If we are a toplevel delegate, use our full name.
19018 If we are a nested delegate, then only use our tail name.
19020 2002-05-02 Ravi Pratap <ravi@ximian.com>
19022 * expression.cs (IsApplicable): Ensure that we add the "&" to
19023 ref/out types before comparing it with the type of the argument.
19025 (IsParamsMethodApplicable): Ditto.
19027 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19030 * delegate.cs : Handle the case when we have more than one applicable
19031 method. Flag an error only when we finish checking all.
19033 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19035 * expression.cs: Add support for boolean static initializers.
19037 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19039 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19041 * parameter.cs (ComputeParameterTypes,
19042 ComputeAndDefineParameterTypes): Better error handling: now we
19043 clear the `types' cache if we fail during any of the type lookups.
19044 We also return the status code correctly to our caller
19046 * delegate.cs: If we fail to define a delegate, abort the extra
19049 * expression.cs (Binary.ResolveOperator): for
19050 operator==(object,object) and operator !=(object, object) we also
19051 have to verify that there is an implicit conversion from one to
19054 (ArrayAccess.DoResolve): Array Access can operate on
19057 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19059 * assign.cs (CompoundAssign): A new class used as a "flag" that
19060 the assignment actually is happening as part of a compound
19061 assignment operator.
19063 During compound assignment, a few new rules exist to enable things
19070 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19071 to the type of x) if y is implicitly convertible to the type of x,
19072 and the operator is a builtin operator and the return type of the
19073 operator is explicitly convertible to the type of x.
19075 * rootcontext.cs: Reset warning level to 2. 4 catches various
19076 "interesting" features in mcs, we must clean this up at some
19077 point, but currently am trying to kill other bugs ;-)
19079 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19080 in container classes as well.
19082 * expression.cs (Binary.ResolveOperator): Handle string case
19083 before anything else (as operator overloading does emit an error
19084 before doing anything else).
19086 This code could go away when we move to a table driven model, but
19087 i could not come up with a good plan last night.
19089 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19091 * typemanager.cs (CSharpName): reimplementation using regex.
19092 * class.cs: added null check for fields in Emit
19093 * rootcontext.cs: set warninglevel to 4
19095 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19097 * typemanager.cs (CSharpName): reimplemented with Lupus
19100 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19102 * statement.cs (If): correclty implement Resolve, because we were
19103 not catching sem errors in there. The same process is needed
19105 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19108 (Statement.Warning_DeadCodeFound): Factorize code.
19109 (While): Report dead code here too.
19111 (Statement): Added Resolve virtual method to allow
19112 for resolution split from the emit code.
19114 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19116 * statement.cs (EmitBoolExpression): No longer try to resolve the
19118 (MakeBoolean): New utility function that resolve, implicitly
19119 converts to boolean and tags the expression.
19122 (If, Do): Implement dead code elimination.
19123 (While): Implement loop inversion
19125 (Do, While, For, If): Resolve the expression prior to calling our
19128 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19131 - added method Report28 (warning: program has more than one entry point)
19132 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19133 - modified method Method.Define, the part at the end of the method
19135 * rootcontext.cs: added static public Location EntryPointLocation;
19137 * ../errors/cs0028.cs : Add test case for the above warning.
19140 - modified method CSharpName to allow arrays of primitive type to
19141 be printed nicely (e.g. instead of System.Int32[][] it now prints
19143 - added method CSharpSignature: returns the signature of a method
19144 in string format to be used in reporting errors, warnings, etc.
19146 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19149 2002-04-26 Ravi Pratap <ravi@ximian.com>
19151 * delegate.cs (Define): Fix extremely silly bug where I was
19152 setting the type of the 'object' parameter of the BeginInvoke
19153 method to System.IAsyncResult instead of System.Object ;-)
19155 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19157 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19160 (Constructor.Emit): return if we fail to initialize the
19161 constructor. Another door closed!
19163 * expression.cs (New.DoResolve): Improve error message (from -6 to
19164 1501). Use DeclaredOnly lookup to find the exact constructor.
19166 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19167 loop. This is useful.
19169 * cs-parser.jay: Adjust the default parameters so that destructors
19170 have the proper signature.
19172 2002-04-26 Martin Baulig <martin@gnome.org>
19174 * driver.cs (LoadAssembly): If `assembly' contains any characters
19175 which are only valid in path names and not in assembly names
19176 (currently slash, backslash and point), use Assembly.LoadFrom ()
19177 instead of Assembly.Load () on the `assembly' (before iteration
19178 over the link_paths).
19180 2002-04-26 Martin Baulig <martin@gnome.org>
19182 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19184 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19186 * class.cs (Property): use the new typemanager.MemberLookup
19188 (TypeContainer.MemberLookup): Implement using the
19189 TypeManager.MemberLookup now.
19191 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19192 and return MemberInfos, so that these can be used without an
19193 EmitContext (what we had before).
19195 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19197 * expression.cs: Fix the case where the argument to params if the
19198 type of the params. I omitted handling this before. Fixed
19200 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19202 * driver.cs: Call BootCorlib_PopulateCoreType
19204 * class.cs (Property.CheckBase): Check for properties only, not
19207 * interface.cs: Temporary hack: try/catch around the
19208 CustomAttributeBuilder, because I am getting an exception that I
19211 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19212 types whose definitions are required to be there (attributes are
19213 defined before standard types).
19215 Compute definitions as we boot the various types, as they are used
19216 immediately (value_type class will need object_type, but if we do
19217 not initialize object_type, we will pass a null, which will let
19218 the runtime pick the System.Object from the existing corlib, which
19219 is not what we want).
19221 2002-04-22 Patrik Torstensson <totte@labs2.com>
19223 * cs-tokenizer.cs: fixed a number of trim() issues.
19225 2002-04-22 Ravi Pratap <ravi@ximian.com>
19227 * expression.cs (Argument.Type): Ensure that we return the correct
19228 type when we have out or ref parameters [in which case we
19231 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19233 * class.cs (Property, Indexer): Allow extern modifier in there.
19235 * typemanager.cs (InitBaseTypes): Initializes object_type and
19236 value_type, since those will be used early on during the bootstrap
19237 process to compile corlib.
19239 (InitCoreTypes): Move code from here to InitBaseTypes.
19241 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19243 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19244 single-dimension arrays as using the ldlen opcode.
19246 Daniel Lewis discovered this optimization.
19248 * typemanager.cs: Add signature for System.Array::get_Length
19250 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19252 * statement.cs: report the error when the foreach does not apply to an
19253 array nor a collection.
19255 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19257 * expression.cs: Add implicit conversions to the operator ~.
19259 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19261 * typemanager.cs: Locate the decimal constructor.
19263 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19265 * attribute.cs: use the new property of TypeOf.
19266 * expression.cs: added 'get' property around typearg.
19268 These changes fix a build breaker reported by NickD. Is this the
19269 correct way to fix? If not, please, revert my changes and make it
19272 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19274 * attribute.cs: Add support for typeof in attribute invocations.
19275 I am not sure that this is right though.
19277 2002-04-14 Duncan Mak <duncan@ximian.com>
19279 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19280 Binary.Operator.Division case.
19282 2002-04-13 Ravi Pratap <ravi@ximian.com>
19284 * class.cs (DefineType): Ensure that we do a proper check on
19285 attribute types and also register it with the TypeManager.
19287 (TypeContainer.Targets): The default for attribute types is
19288 AttributeTargets.All.
19290 * attribute.cs (ApplyAttributes): Registering the attribute type
19291 is done elsewhere, not when we discover we have a Usage attribute.
19293 2002-04-12 Ravi Pratap <ravi@ximian.com>
19295 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19296 and get rid of is_delegate parameter.
19298 * everywhere : update.
19300 2002-04-12 Ravi Pratap <ravi@ximian.com>
19302 * cs-parser.jay (compilation_unit): Revamp completely to use
19303 some new ideas that I got from Rhys' grammar to solve the problems
19304 with assembly level attributes.
19306 (outer_declaration): New grammar production.
19308 (attribute_sections): Add.
19310 (opt_attributes): Base on attribute_sections
19312 (namespace_declaration): Allow opt_attributes to tackle the case
19313 when we have assembly level attributes - we are clever in this
19316 * attribute.cs (ApplyAttributes): Do not worry about assembly
19317 attributes in the non-global context.
19319 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19320 instead of SetGlobalAttributes.
19322 * class.cs, rootcontext.cs : Ensure we define and generate
19323 attribute types before anything else.
19325 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19326 and flag the new error -20 for the case when the attribute type
19327 does not have valid targets specified. csc does not catch this.
19329 * ../errors/errors.txt : update for error # -20
19331 2002-04-11 Ravi Pratap <ravi@ximian.com>
19333 * support.cs (InternalParameters.ParameterModifier): Do some null
19334 checking and return sane values.
19336 * class.cs (Method.Define): If we are a PInvoke method, ensure
19337 that we are static and extern. Report error # 601
19339 * ../errors/cs0601.cs : Add test case for the above error.
19341 2002-04-07 Ravi Pratap <ravi@ximian.com>
19343 * rootcontext.cs (attribute_types): We need to keep type of
19344 all attribute types separately and emit code for them first.
19346 (RegisterAttribute) : Implement.
19348 * class.cs (DefineType): Check if the current Type is a custom
19349 attribute type and register it accordingly.
19351 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19352 adding the first attribute twice and rename to
19354 (SetGlobalAttributes): this.
19356 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19359 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19360 if we are processing global arguments. Hmm, I am unsure of this.
19362 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19364 * expression.cs: added static array of strings to avoid calling
19365 Enum.ToString () for Operator in Binary. Significant recover of
19368 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19370 * class.cs (FindMembers): Allow the Builders of the various
19371 members to be null. If they are skip them. This only happens
19372 during the PInvoke declaration.
19374 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19376 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19377 failure, so we do not keep going afterwards.
19379 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19380 wanted to pass `false' as the `is_delegate' argument. If this is
19381 the case, why not use delegate_type == null to mean `is_delegate =
19382 false' and anything else as is_delegate = true.
19384 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19386 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19387 code for the section, not the beginning of the tests.
19389 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19391 * cfold.cs: Handle operator + (Enum x, Underlying x)
19393 * expression.cs (Binary): same. Warn about errors where we have
19394 Enum/Enum in operator + as well.
19396 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19399 - added support for switch(bool)
19400 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19401 - add TableSwitchEmit() to handle table-based switch statements
19403 2002-04-05 Ravi Pratap <ravi@ximian.com>
19405 * expression.cs (Invocation.OverloadResolve): Factor out code which
19406 does parameter compatibility checking with arguments so that we can
19407 re-use the code even from Delegate.VerifyApplicability
19409 (VerifyArgumentsCompat): Move above code here.
19411 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19412 and instead make a call to the above method.
19414 2002-03-31 Ravi Pratap <ravi@ximian.com>
19416 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19417 We use it to keep track of classes which are attribute types.
19419 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19421 * delegate.cs (Delegate.Define): Correctly define the types in the
19422 presence of fixed and array parameters.
19424 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19427 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19428 include NonPublic after the first iteration.
19430 * class.cs (Indexer.CheckBase): Only check if both parents are
19433 * cs-parser.jay (accessor_body): If empty, set to null.
19435 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19436 same code path here to resolve constants names that we did have in
19437 MemberAccess.DoResolve. There is too much code duplicated here.
19439 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19441 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19443 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19446 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19447 tokens, numbers and strings.
19449 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19452 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19453 asyncronous parameters and the regular parameters.
19455 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19456 specify the target directory.
19458 * expression.cs: (This.DoResolve): Simplify
19459 (As.Emit): Optimize, do not generate IsInst if the expression is
19460 always of the given type.
19462 (Is.DoResolve): Bug fix, we were reporting both always/never for
19465 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19466 creating too many unnecessary arrays.
19468 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19470 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19471 fields instead of rolling our own initializer. Takes care of all
19472 implicit conversions, and drops unnecessary static checks/argument.
19474 2002-03-31 Dick Porter <dick@ximian.com>
19476 * driver.cs: use the GetDirectories() return values properly, and
19477 use "/" as path separator.
19479 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19481 * expression.cs (Unary): Optimize - - expr into expr.
19482 (Binary): Optimize a + (-b) into a -b.
19484 * codegen.cs (CodeGen): Made all methods static.
19486 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19490 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19491 TypeBuilder property.
19493 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19496 * tree.cs: Removed the various RecordXXXX, and replaced with a
19497 single RecordDecl. Removed all the accessor methods, and just
19498 left a single access point Type
19500 * enum.cs: Rename DefineEnum to DefineType.
19502 * decl.cs: New abstract method `DefineType' used to unify the
19503 Defines for Enumerations, Interfaces, TypeContainers and
19506 (FindType): Moved LookupInterfaceOrClass here. Moved the
19507 LookupBaseClasses method that used to live in class.cs and
19508 interface.cs here, and renamed to FindType.
19510 * delegate.cs: Implement DefineType. Take advantage of the
19511 refactored pattern for locating the parent builder without taking
19512 the parent_builder argument (which we know does not work if we are
19513 nested, and triggering a toplevel definition).
19515 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19517 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19518 accessibility of a member has changed during override and report
19521 * class.cs (Method.Define, Property.Define): Only complain on
19522 overrides if the method is private, any other accessibility is
19523 fine (and since we just checked the permission is the same, we are
19526 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19527 and elif are processed always. The other pre-processing
19528 directives are only processed if we are "taking" the path
19530 2002-03-29 Martin Baulig <martin@gnome.org>
19532 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19533 current location is not Null.
19535 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19536 a separate method so we can profile it.
19538 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19539 `span.Seconds' are just seconds, but no minutes or hours.
19540 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19542 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19544 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19545 Remove the gratuitous set of Final:
19547 // If an interface implementation, then we can set Final.
19548 if (((flags & MethodAttributes.Abstract) == 0) &&
19549 implementing.DeclaringType.IsInterface)
19550 flags |= MethodAttributes.Final;
19552 I do not know what I was smoking when I used that.
19555 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19556 step into fixing the name resolution issues for delegates and
19557 unifying the toplevel name resolution.
19559 2002-03-28 Martin Baulig <martin@gnome.org>
19561 * class.cs (Method.Emit): If we have a symbol writer, call its
19562 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19563 tell it about the current method.
19565 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19566 writer that we're going to emit the first byte of IL code for a new
19567 statement (a new source line).
19568 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19569 EmitContext.Mark() before emitting any code.
19571 * location.cs (SymbolDocument): Return null when we're Null.
19573 * statement.cs (Statement): Moved the `Location loc' variable here.
19574 (Statement.EmitBoolExpression): If we have a symbol writer, call
19575 ec.Mark() before emitting any code to tell it that we're at the
19576 beginning of a new statement.
19577 (StatementExpression): Added `Location' argument to the constructor.
19578 (Block): Added public readonly variable `StartLocation' and public
19579 variable `EndLocation'. The latter is to be set using SetEndLocation().
19580 (Block): Added constructor which takes a start and end location.
19581 (Block.SetEndLocation): New method. This sets the end location.
19582 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19583 local variables we create.
19584 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19585 each statement and do also mark the begin and end of the block.
19587 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19588 tell it the current lexer.Location, use Location.Null for the end of the
19590 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19591 current block, set its end location using SetEndLocation().
19592 (statement_expression): StatementExpression constructor now takes the
19593 lexer.Location as additional argument.
19594 (for_statement, declare_local_variables): Likewise.
19595 (declare_local_variables): When creating a new implicit block, use the
19596 new Block constructor and pass it the lexer.Location.
19598 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19600 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19601 members also on the parent interfaces recursively.
19603 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19605 * report.cs: Use new formats, since Gonzalo finished the missing
19608 * expression.cs (Binary.ResolveOperator): added missing operator|
19609 operator& and operator^ for bool/bool.
19611 * cs-parser.jay: CheckDef now takes a Location argument that is
19612 used to report errors more precisly (instead of reporting the end
19613 of a definition, we try to track something which is a lot closer
19614 to the source of the problem).
19616 * cs-tokenizer.cs: Track global token use, so we can properly flag
19617 the use of #define/#undef after the first token has been seen.
19619 Also, rename the reportXXXX to Error_DescriptiveName
19621 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19622 TypeContainer, so that Enum and Interface can use this too.
19624 * class.cs (TypeContainer.LookupInterfaceOrClass,
19625 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19626 `builder' argument. Typically this was used to pass the parent
19627 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19630 The problem is that a nested class could trigger the definition of
19631 a toplevel class, and the builder would be obviously wrong in that
19634 So we drop this argument, and we compute dynamically the
19635 TypeBuilder/ModuleBuilder (the correct information was available
19636 to us anyways from DeclSpace.Parent)
19638 * interface.cs (Interface.DefineInterface): Drop builder
19639 parameter cleanup like class.cs
19641 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19644 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19647 (Try.Emit): Propagate the returns value from the statement.
19649 (Return.Emit): Even if we are leavning
19651 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19653 * modifiers.cs: Fix the computation of MethodAttributes flags.
19655 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19657 * driver.cs: allow compilation of files that start with '/'.
19658 Add a default case when checking the argument of --target.
19660 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19662 * interface.cs: Implement the same search algorithm for types in
19663 the interface code.
19665 * delegate.cs: Do not allow multiple definition.
19667 * Recovered ChangeLog that got accidentally amputated
19669 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19671 * rootcontext.cs: Load manually enum to allow core classes to
19672 contain enumerations.
19674 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19675 Update to new static methods in TypeManager.
19677 * typemanager.cs (GetMethod, GetConstructor): Use our
19678 implementation of FindMembers to find the members, since during
19679 corlib compilation, the types are TypeBuilders and GetMethod and
19680 GetConstructor do not work.
19682 Make all methods in TypeManager static.
19684 (InitCodeHelpers): Split the functionality from
19685 the InitCodeTypes function.
19687 * driver.cs: Call InitCodeHelpers after we have populated the
19690 * cs-parser.jay (delegate_declaration): we did not used to compute
19691 the delegate name correctly for void delegates.
19693 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19695 * rootcontext.cs (RootContext): Init the interface_resolve_order
19696 and type_container_resolve_order always.
19698 (ResolveCore, BootstrapCorlib_ResolveClass,
19699 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19700 compiler when compiling with --nostdlib
19702 * class.cs (TypeContainer.DefineType): Check that our parent is
19703 not null. This test is most important when we are bootstraping
19706 * codegen.cs: Split out the symbol writing code.
19708 2002-03-25 Martin Baulig <martin@gnome.org>
19710 * driver.cs (-g): Made -g an alias for --debug.
19712 2002-03-24 Martin Baulig <martin@gnome.org>
19714 * codegen.cs (SymbolWriter): New public variable. Returns the
19715 current symbol writer.
19716 (CodeGen): Added `bool want_debugging_support' argument to the
19717 constructor. If true, tell the ModuleBuild that we want debugging
19718 support and ask it for the ISymbolWriter.
19719 (Save): If we have a symbol writer, call it's Close() method after
19720 saving the assembly.
19722 * driver.c (--debug): New command line argument to create a
19723 debugger information file.
19725 * location.cs (SymbolDocument): New public property. Returns an
19726 ISymbolDocumentWriter object for the current source file or null
19727 if we don't have a symbol writer.
19729 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19731 * driver.cs (LoadAssembly): Correctly return when all the paths
19732 have been tried and not before.
19734 * statement.cs (Switch.Emit): return the actual coverage for this
19735 statement (returns/not-returns)
19737 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19738 switch of the statement if we are the last switch section. That
19739 kills two problems: try/catch problems (we used to emit an empty
19740 nop at the end) and switch statements where all branches would
19743 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19745 * driver.cs: Add default assemblies (the equivalent to the
19746 Microsoft CSC.RSP file)
19748 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19749 also update tokens_seen and set it to false.
19751 * driver.cs: Implement --recurse for Mike.
19753 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19754 correctly splitting out the paths.
19756 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19758 * interface.cs (Interface.PopulateProperty): Instead of using
19759 `parent' as the declaration space for the set parameters, use
19762 * support.cs (InternalParameters): InternalParameters constructor
19763 takes a DeclSpace instead of a TypeContainer.
19765 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19766 types are being initialized, load the address of it before calling
19769 (New): Provide a mechanism to disable the generation of local
19770 value type temporaries when the caller will be providing us with
19771 an address to store it.
19773 (ArrayCreation.EmitDynamicInitializers): Use it.
19775 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19777 * expression.cs (Invocation.EmitArguments): Only probe for array
19778 property if there is more than one argument. Sorry about that.
19780 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19781 empty param arrays.
19783 * class.cs (Method.LabelParameters): Fix incorrect code path that
19784 prevented the `ParamArrayAttribute' from being applied to the
19787 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19789 * support.cs (ReflectionParameters): Correctly compute whether the
19790 last argument is a params array. Fixes the problem with
19793 * typemanager.cs: Make the assemblies array always be non-null
19794 (empty, but non-null)
19796 * tree.cs (RecordDecl): New function that abstracts the recording
19797 of names. This reports error 101, and provides a pointer to the
19798 previous declaration. Fixes a crash in the compiler.
19800 * cs-parser.jay (constructor_declaration): Update to new grammar,
19801 and provide a constructor_body that can be empty.
19803 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19805 * driver.cs: Add support for --resources.
19807 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19808 Make all types for the various array helper methods be integer.
19810 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19811 CheckState to ConvCast.
19813 (ConvCast): Now it takes a `checked' state argument, to avoid
19814 depending on the emit context for the conversion, and just using
19815 the resolve time setting.
19817 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19818 instead of Invocation.EmitArguments. We do not emit the original
19819 arguments, instead we emit those which have been converted to
19820 unsigned int expressions.
19822 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19824 * codegen.cs: ditto.
19826 * expression.cs (LocalVariableReference): Drop the use of the
19827 Store function that depended on the variable index.
19829 * statement.cs (VariableInfo): Drop the `Idx' property from this
19830 class, as this is not taking into account the indexes for
19831 temporaries tat we generate during the execution, getting the
19834 * class.cs: First emit class initializers, then call the parent
19837 * expression.cs (Binary): Fix opcode emision.
19838 (UnaryMutator.EmitCode): Support checked code generation
19840 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19841 matches for events for both the Static and Instance scans,
19842 pointing to the same element. Fix that.
19844 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19846 * rootcontext.cs (ResolveTree): Always set the
19847 interface_resolve_order, because nested interfaces will be calling
19850 * class.cs (GetInterfaceOrClass): Track the same resolution
19851 process used by TypeManager.LookupType. This fixes the nested
19852 type lookups in class declarations (separate path from
19855 (TypeContainer.DefineType): Also define nested interfaces.
19856 (TypeContainer.RegisterOrder): New public function used to
19857 register the order in which child interfaces need to be closed.
19859 Nested interfaces need to be closed after their parents have been
19862 * interface.cs (InterfaceAttr): Put all the logic for computing
19863 the interface attribute here.
19865 (DefineInterface): Register our interface order with the
19866 RootContext or with the TypeContainer depending on the case.
19868 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19870 * cs-parser.jay: rework foreach statement to work with the new
19871 changes to the policy on SimpleNames.
19873 * report.cs: support Stacktrace on warnings as well.
19875 * makefile: drop --unsafe and /unsafe from the compile.
19877 2002-03-13 Ravi Pratap <ravi@ximian.com>
19879 * ecore.cs (StandardConversionExists): Modify to take an Expression
19880 as the first parameter. Ensure we do null -> reference type conversion
19883 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19884 temporary Expression objects.
19886 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19888 * interface.cs: workaround bug in method overloading resolution
19889 (there is already a bugzilla bug for it).
19891 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19893 We could also solve this problem by having a separate path for
19894 performing type lookups, instead of DoResolve, we could have a
19895 ResolveType entry point, and only participating pieces of the
19896 production (simplename, deref, array) would implement this.
19898 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19899 signal SimpleName to only resolve type names and not attempt to
19900 resolve anything else.
19902 * expression.cs (Cast): Set the flag.
19904 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19906 * class.cs: Only report 108 if there is no `new' modifier.
19908 * cs-parser.jay: rework foreach statement to work with the new
19909 changes to the policy on SimpleNames.
19911 * report.cs: support Stacktrace on warnings as well.
19913 * makefile: drop --unsafe and /unsafe from the compile.
19915 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19917 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19918 lookups here, instead of doing that at parse time. This means
19919 that our grammar will not introduce `LocalVariableReferences' as
19920 expressions at this point. That solves the problem of code like
19924 static void Main ()
19928 This is only half the fix. The full fix requires parameters to
19929 also be handled in this way.
19931 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19932 makes the use more obvious of the DeclSpace. The
19933 ec.TypeContainer.TypeBuilder is now only used to pull the
19934 TypeBuilder for it.
19936 My theory is that I can get rid of the TypeBuilder completely from
19937 the EmitContext, and have typecasts where it is used (from
19938 DeclSpace to where it matters).
19940 The only pending problem is that the code that implements Aliases
19941 is on TypeContainer, and probably should go in DeclSpace.
19943 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19944 lookups here, instead of doing that at parse time. This means
19945 that our grammar will not introduce `LocalVariableReferences' as
19946 expressions at this point. That solves the problem of code like
19950 static void Main ()
19954 This is only half the fix. The full fix requires parameters to
19955 also be handled in this way.
19957 * class.cs (Property.DefineMethod): When implementing an interface
19958 method, set newslot, when implementing an abstract method, do not
19959 set the flag (before we tried never setting it, or always setting
19960 it, which is the difference).
19961 (Indexer.DefineMethod): same.
19962 (Method.DefineMethod): same.
19964 * ecore.cs: Only set the status used flag if we get back a Field.
19966 * attribute.cs: Temporary hack, so Paolo can keep working.
19968 2002-03-08 Ravi Pratap <ravi@ximian.com>
19970 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19971 the unmanaged type in the case we have a MarshalAs attribute.
19973 (Resolve): Handle the case when we are parsing the special MarshalAs
19974 attribute [we need to store the unmanaged type to use later]
19976 * typemanager.cs (marshal_as_attr_type): Built in type for the
19977 MarshalAs Attribute.
19979 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19980 on parameters and accordingly set the marshalling info.
19982 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19984 * class.cs: Optimizing slightly by removing redundant code after
19985 we switched to the `NoTypes' return value.
19986 (Property.DefineMethod): use NoTypes here too.
19988 This fixes the bug I introduced in my last batch of changes.
19990 2002-03-05 Ravi Pratap <ravi@ximian.com>
19992 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19994 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19995 Enums since those are types too.
19997 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19999 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20000 thanks to a call during the lookup process.
20002 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20004 * statement.cs (Foreach): Lots of work to accomodate a particular
20005 kind of foreach statement that I had not kept in mind. It is
20006 possible to have foreachs on classes that provide a GetEnumerator
20007 method that return objects that implement the "pattern" for using
20008 a foreach, there is no need to support GetEnumerator
20011 This is needed to compile nant.
20013 * decl.cs: Only report 114 if the member is not `Finalize' and if
20014 the warning level is at least 2.
20016 * class.cs: Moved the compare function from Method to
20019 (MethodSignature.InheritableMemberSignatureCompare): Add new
20020 filter function that is used to extract inheritable methods from a
20023 (Method.Define): Use the new `inheritable_method_signature_filter'
20026 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20029 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20031 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20033 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20035 * expression.cs: Pass location information to
20036 ConvertImplicitStandard.
20038 * class.cs: Added debugging code to track return values from
20041 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20043 * expression.cs (Is.DoResolve): If either side of the `is' is an
20044 interface, do not flag the warning.
20046 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20049 * report.cs: Allow for --fatal to be used with --probe.
20051 * typemanager.cs (NoTypes): Move the definition for the empty Type
20054 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20056 (TypeContainer.DefineProxy): New function used to proxy to parent
20057 implementations when implementing interfaces.
20058 (TypeContainer.ParentImplements): used to lookup if our parent
20059 implements a public function that is required by an interface.
20060 (TypeContainer.VerifyPendingMethods): Hook this up.
20062 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20063 `modules' and `assemblies' arraylists into arrays. We only grow
20064 these are the very early start up of the program, so this improves
20065 the speedof LookupType (nicely measured).
20067 * expression.cs (MakeByteBlob): Replaced unsafe code with
20068 BitConverter, as suggested by Paolo.
20070 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20071 folding of string concatenation, but if either side is a string,
20072 and the other is not, then return null, and let the runtime use
20073 the concatenation on the string plus the object (using
20074 `Object.ToString').
20076 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20078 Constant Folding has been implemented now.
20080 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20081 the error instead on types that are not supported in one's
20084 * constant.cs (Constant and all children): New set of functions to
20085 perform implict and explicit conversions.
20087 * ecore.cs (EnumConstant): Implement the new functions to perform
20088 conversion by proxying to the child expression.
20090 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20091 own separate setting that can not be turned off from the command
20092 line using --unchecked or --checked and is only controlled using
20093 the checked/unchecked statements and expressions. This setting is
20094 used by the constant folder to flag errors.
20096 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20097 ConstantCheckState as well.
20099 During Resolve, they also have to flag the state, because the
20100 constant folder runs completely in the Resolve phase.
20102 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20105 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20107 * cfold.cs: New file, this file contains the constant folder.
20109 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20110 argument to track whether we are using the resulting address to
20111 load or store a value and provide better error messages.
20113 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20114 new AddressOf arguments.
20116 * statement.cs (Foreach.EmitCollectionForeach): Update
20118 * expression.cs (Argument.Emit): Call AddressOf with proper
20119 arguments to track usage.
20121 (New.DoEmit): Call AddressOf with new arguments.
20123 (Unary.Emit): Adjust AddressOf call.
20125 2002-03-01 Ravi Pratap <ravi@ximian.com>
20127 * cs-parser.jay (member_access): Change the case for pre-defined types
20128 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20131 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20134 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20135 essentially like methods and apply attributes like MethodImplOptions to them too.
20137 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20140 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20141 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20144 * Update code everywhere accordingly.
20146 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20148 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20150 2002-02-28 Ravi Pratap <ravi@ximian.com>
20152 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20153 try performing lookups against those instead of jumping straight into using
20154 the 'using' clauses.
20156 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20158 (LookupType): Perform lookups in implicit parents too.
20160 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20161 sequence as RootContext.LookupType.
20163 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20164 the various cases of namespace lookups into this method.
20166 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20168 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20169 in positional arguments)
20171 * class.cs (Operator): Update the AllowedModifiers to contain
20174 * cs-parser.jay: Update operator declaration to allow for the
20175 operator body to be empty.
20177 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20180 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20182 * class.cs (Method.Emit): Label parameters.
20184 * driver.cs: Return 1 or 0 as the program exit code.
20186 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20188 * expression.cs: Special case the `null' object when trying to
20189 auto-compute the type, as anything can be explicitly converted to
20192 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20193 spotting this Paolo.
20195 (Expression.ImplicitNumericConversion): Perform comparissions of
20196 the type using the underlying type in the case of an enumeration
20197 rather than using the enumeration type for the compare.
20199 Cope with the underlying == type case, which is not possible to
20202 (Expression.ConvertNumericExplicit): Perform comparissions of
20203 the type using the underlying type in the case of an enumeration
20204 rather than using the enumeration type for the compare.
20206 * driver.cs: If the user does not supply an extension, assume .exe
20208 * cs-parser.jay (if_statement): Rewrote so that we can track the
20209 location for the if statement.
20211 * expression.cs (Binary.ConstantFold): Only concat strings when
20212 the operation is "+", not everything ;-)
20214 * statement.cs (Statement.EmitBoolExpression): Take a location
20216 (If, While, Do): Track location.
20218 * expression.cs (Binary.ResolveOperator): In the object + string
20219 case, I was missing a call to ConvertImplicit
20221 2002-02-25 Ravi Pratap <ravi@ximian.com>
20223 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20224 Location arguments. Ensure we use RootContext.LookupType to do our work
20225 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20227 * interface.cs (PopulateMethod): Handle the type of the parameter being
20230 * expression.cs (Invocation.BetterFunction): Handle the case when we
20231 have a params method with no fixed arguments and a call is made with no
20234 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20236 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20237 the verbatim-string-literal
20239 * support.cs (InternalParameters.ParameterModifier): handle null
20241 (InternalParameters.ParameterType): ditto.
20243 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20244 duplicating the name of the variable parameter.
20245 (GetParameterByName): Fix bug where we were not looking up array
20246 paramters if they were the only present (thanks Paolo!).
20247 (GetParameterInfo): We only have an empty set of types if both
20248 fixed and array are set to null.
20249 (GetParameterInfo-idx): Handle FixedParameter == null
20251 * cs-parser.jay: Handle the case where there is no catch
20252 statements (missing null test).
20254 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20256 * driver.cs (MainDriver): Be conservative on our command line
20259 Catch DirectoryNotFoundException when calling GetFiles.
20261 (SplitPathAndPattern): Used to split the input specification into
20262 a path and a pattern that we can feed to Directory.GetFiles.
20264 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20266 * statement.cs (Fixed): Implement the last case of the Fixed
20267 statement (string handling).
20269 * expression.cs (StringPtr): New class used to return a char * to
20270 a string; Used by the Fixed statement.
20272 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20274 * expression.cs (Binary.ResolveOperator): Remove redundant
20275 MemberLookup pn parent type.
20276 Optimize union call, we do not need a union if the types are the same.
20277 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20280 Specialize the use of MemberLookup everywhere, instead of using
20281 the default settings.
20283 (StackAlloc): Implement stackalloc keyword.
20285 * cs-parser.jay: Add rule to parse stackalloc.
20287 * driver.cs: Handle /h, /help, /?
20289 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20290 before we supported unsafe code.
20292 * makefile: add --unsafe to the self compilation of mcs.
20294 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20296 * expression.cs (PointerArithmetic): New class that is used to
20297 perform pointer arithmetic.
20298 (Binary.Resolve): Handle pointer arithmetic
20299 Handle pointer comparission.
20300 (ArrayPtr): Utility expression class that is used to take the
20301 address of an array.
20303 (ElementAccess): Implement array access for pointers
20305 * statement.cs (Fixed): Implement fixed statement for arrays, we
20306 are missing one more case before we are done.
20308 * expression.cs (Indirection): Implement EmitAssign and set the
20309 ExprClass to Variable. This allows pointer dereferences to be
20310 treated as variables, and to have values assigned to them.
20312 * ecore.cs (Expression.StoreFromPtr): New utility function to
20313 store values dereferencing.
20315 2002-02-20 Ravi Pratap <ravi@ximian.com>
20317 * expression.cs (Binary.ResolveOperator): Ensure that we are
20318 not trying to operate on a void type - this fixes the reported
20321 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20322 the parent implementation is sealed.
20324 * ../errors/cs0239.cs : Add.
20326 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20328 * typemanager.cs (unverifiable_code_type): Corresponds to
20329 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20330 which have unsafe code in them.
20332 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20335 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20337 * cs-tokenizer.cs: Add support for @"litreal strings"
20339 Make tokenizer accept pre-processor directives
20340 on any column (remove the old C-like limitation).
20342 * rootcontext.cs (EmitCode): Emit any global attributes.
20343 (AddGlobalAttributes): Used to keep track of assembly attributes.
20345 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20347 * cs-parser.jay: Add support for global attributes.
20349 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20351 * expression.cs (Indirection): New helper class. Unary will
20352 create Indirection classes to be able to implement the
20353 IMemoryLocation interface on it.
20355 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20357 * cs-parser.jay (fixed_statement): reference the right statement.
20359 * statement.cs (Fixed.Emit): Finish implementing the fixed
20360 statement for the &x case.
20362 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20364 * class.cs (Property.Define, Method.Define): Remove newslot when
20367 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20368 wrong. NewSlot should only be used if the `new' keyword is present.
20370 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20371 locating our system dir. Sorry about this.
20373 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20375 * driver.cs (GetSystemDir): Compute correctly the location of our
20376 system assemblies. I was using the compiler directory instead of
20377 the library directory.
20379 2002-02-13 Ravi Pratap <ravi@ximian.com>
20381 * expression.cs (BetterFunction): Put back in what Miguel commented out
20382 since it is the correct fix. The problem is elsewhere ;-)
20384 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20385 parameters of the parms method are themselves compatible or not !
20387 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20388 to check that a class implements an interface before saying that an implicit
20389 conversion was allowed. Use ImplementsInterface to do the checking.
20391 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20393 * class.cs (Method.Define): Track whether we are an explicit
20394 implementation or not. And only call DefineMethodOverride if we
20395 are an explicit implementation.
20397 (Property.DefineMethod): Ditto.
20399 2002-02-11 Ravi Pratap <ravi@ximian.com>
20401 * expression.cs (BetterFunction): Catch hideous bug which was
20402 preventing us from detecting ambiguous calls due to implicit casts i.e
20405 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20407 * support.cs (Pair): Remove un-needed method. I figured why I was
20408 getting the error in cs-parser.jay, the variable in a foreach loop
20409 is readonly, and the compiler does not really treat this as a variable.
20411 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20412 instead of EQUALS in grammar.
20414 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20416 * expression.cs (Unary.DoResolve): Check whether the argument is
20419 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20421 * support.cs: Api for Pair to set a value. Despite the fact that
20422 the variables are public the MS C# compiler refuses to compile
20423 code that accesses the field if the variable is part of a foreach
20426 * statement.cs (Fixed): Begin implementation of the fixed
20429 (Block.AddVariable): Return the VariableInfo on success and null
20430 on failure instead of true/false.
20432 * cs-parser.jay (foreach): Catch errors on variables already
20433 defined (we were ignoring this value before) and properly unwind
20434 the block hierarchy
20436 (fixed_statement): grammar for the fixed statement.
20438 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20440 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20441 pointer types to be incretemented.
20443 (SizeOf): Implement.
20445 * cs-parser.jay (pointer_member_access): Implement
20446 expr->IDENTIFIER production.
20448 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20449 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20452 (Unary): Implement indirection.
20454 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20455 use in non-unsafe context).
20457 (SimpleName.DoResolve): Check for pointers in field access on safe
20460 (Expression.LoadFromPtr): Factor the load-indirect code in this
20461 function. This was duplicated in UnboxCast and ParameterReference
20463 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20465 * expression.cs (ComposedCast): report an error if a pointer cast
20466 is used in a safe region.
20468 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20469 pointer type casts in unsafe context.
20471 * codegen.cs (EmitContext): Set up IsUnsafe.
20473 * cs-parser.jay (non_expression_type): Add productions for pointer
20476 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20477 code. We should not use force into static mode if the method is
20478 not virtual. Fixes bug in MIS
20480 * statement.cs (Do.Emit, While.Emit, For.Emit,
20481 Statement.EmitBoolExpression): Add support to Do and While to
20482 propagate infinite loop as `I do return' semantics.
20484 Improve the For case to also test for boolean constants.
20486 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20487 to the list of attributes we can add.
20489 Remove `EmitContext' argument.
20491 * class.cs (Method.Define): Apply parameter attributes.
20492 (Constructor.Define): Apply parameter attributes.
20493 (MethodCore.LabelParameters): Move here the core of labeling
20496 * support.cs (ReflectionParameters.ParameterModifier,
20497 InternalParameters.ParameterModifier): Use IsByRef on the type and
20498 only return the OUT bit for these parameters instead of in/out/ref
20501 This is because I miss-understood things. The ParameterInfo.IsIn
20502 and IsOut represent whether the parameter has the [In] and [Out]
20505 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20507 * ecore.cs (FieldExpr.Emit): Release temporaries.
20509 * assign.cs (LocalTemporary.Release): new function.
20511 * codegen.cs (EmitContext.GetTemporaryStorage,
20512 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20513 temporary storage. Now we can "put back" localbuilders when we
20516 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20518 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20519 need to make a copy of the variable to generate verifiable code.
20521 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20523 * driver.cs: Compute dynamically the system directory.
20525 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20526 Slower, but more generally useful. Used by the abstract
20527 registering implementation.
20529 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20530 the rules for the special rule on Type/instances. First check if
20531 we have the same name, and if so, try that special static path
20532 rather than the instance path.
20534 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20536 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20539 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20540 Enum, ValueType, Delegate or Array for non-corlib compiles.
20542 * cs-tokenizer.cs: Catch long identifiers (645)
20544 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20547 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20548 fix, we were returning too early, so we were not registering
20549 pending methods from abstract classes.
20551 Do not register pending methods if the class is abstract.
20553 * expression.cs (Conditional.DoResolve): Report circular implicit
20554 conversions when we neecd to compute it for conditional
20557 (Is.DoResolve): If the expression is always of the provided type,
20558 flag warning 183. If the expression can not ever be of the
20559 provided type flag warning 184.
20561 * class.cs: Catch 169 as well.
20563 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20566 2002-01-18 Nick Drochak <ndrochak@gol.com>
20568 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20570 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20572 * interface.cs: (PopulateMethod): Check for pointers being defined
20573 only if the unsafe context is active.
20574 (PopulateProperty): ditto.
20575 (PopulateIndexer): ditto.
20577 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20578 specified. If pointers are present, make sure that they are
20579 present in an unsafe context.
20580 (Constructor, Constructor.Define): ditto.
20581 (Field, Field.Define): ditto.
20582 (Property, Property.Define): ditto.
20583 (Event, Event.Define): ditto.
20585 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20586 hashtable if there are classes or structs defined.
20588 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20589 code, as the constant resolution moved.
20591 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20592 the metadata, so we can flag error 133.
20594 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20595 pointer is being declared in an unsafe context.
20597 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20599 * modifiers.cs (Modifiers.Check): Require a Location argument.
20600 Report error 227 for Unsafe use.
20602 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20604 * statement.cs (For.Emit): If the test is null, then report that
20605 we do `return', as we wont reach anything afterwards.
20607 (Switch.SwitchGoverningType): Track the expression that matched
20610 * driver.cs: Allow negative numbers as an error code to flag.
20612 * cs-parser.jay: Handle 1551.
20614 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20616 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20618 * cs-parser.jay: Report 1518 (type declaration can only contain
20619 class, struct, interface, enum or delegate)
20621 (switch_label): Report 1523 (keywords `case' or `default' must
20624 (opt_switch_sections): Report 1522 (empty switch)
20626 * driver.cs: Report 1515 (response file specified multiple times)
20627 Report 1516 (Source file specified multiple times).
20629 * expression.cs (Argument.Resolve): Signal 1510
20631 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20632 access not allowed in static code)
20634 2002-01-11 Ravi Pratap <ravi@ximian.com>
20636 * typemanager.cs (IsPointerType): Utility method which we are going
20639 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20640 the object type, so we take care of that.
20642 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20644 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20645 added to non-params parameters :-)
20647 * typemanager.cs (CSharpName): Include 'void' type too.
20649 (void_ptr_type): Include in the set of core types.
20651 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20654 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20657 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20658 completely forgotten about it.
20660 2002-01-10 Ravi Pratap <ravi@ximian.com>
20662 * cs-parser.jay (pointer_type): Add. This begins our implementation
20663 of parsing rules for unsafe code.
20665 (unsafe_statement): Implement.
20667 (embedded_statement): Modify to include the above.
20669 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20671 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20672 if the current context is an unsafe one.
20674 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20675 are handled differently, we need separate rules for them.
20677 (local_variable_declaration): Update to use local_variable_pointer_type
20678 to allow variable declarations of unmanaged pointer types.
20680 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20681 in unsafe contexts.
20683 * ../errors/cs0214.cs : Add.
20685 2002-01-16 Nick Drochak <ndrochak@gol.com>
20687 * makefile: remove 'response' file when cleaning.
20689 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20691 * cs-parser.jay: Report 1524.
20693 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20695 * typemanager.cs (RegisterMethod): drop checking if we have
20696 registered this from here
20698 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20700 * class.cs (Method.EmitDestructor): Implement calling our base
20703 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20704 value of InFinally.
20706 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20707 this routine and will wrap the call in a try/catch block. Deal
20710 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20712 * ecore.cs (Expression.MemberLookup): instead of taking a
20713 parameter `same_type' that was used to tell whether we could
20714 access private members we compute our containing type from the
20717 (FieldExpr): Added partial support for volatile fields. This does
20718 not work for volatile fields exposed from assemblies, as I can not
20719 figure out how to extract the modreq from it.
20721 Updated all the source files to use this.
20723 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20724 because it is referenced by MemberLookup very often.
20726 2002-01-09 Ravi Pratap <ravi@ximian.com>
20728 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20729 TypeBuilder.GetCustomAttributes to retrieve what we need.
20731 Get rid of redundant default_member_attr_type as this is the same as
20732 default_member_type which already exists.
20734 * interface.cs, attribute.cs : Update accordingly.
20736 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20738 * typemanager.cs: Enable IndexerPropertyName again. It does not
20739 work for TYpeBuilders though. Ravi, can you please fix this?
20741 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20743 * expression.cs (Argument.Emit): Handle the case of ref objects
20744 being passed to ref functions;
20746 (ParameterReference.EmitLoad): Loads the content of the pointer
20747 without dereferencing.
20749 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20751 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20753 2002-01-08 Ravi Pratap <ravi@ximian.com>
20755 * class.cs (Indexer.DefineMethod): Incorporate the interface
20756 type in the name of the method if we are doing explicit interface
20759 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20761 (BetterConversion): Fix extremely trivial bug where we were referring to
20762 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20765 * ../errors/bug16.cs : Add although we have fixed it.
20767 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20769 * expression.cs (BaseIndexer): Begin implementation.
20771 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20773 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20774 production directly to remove a shift/reduce, and implement
20775 explicit interface implementation.
20777 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20778 after a floating point suffix.
20780 * expression.cs (DoNumericPromotions): Improved the conversion for
20781 uint/uint. If we have a constant, we avoid doing a typecast to a
20784 * class.cs (Indexer): Implement explicit interface implementation
20787 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20789 * class.cs: make the default instance constructor public and hidebysig.
20791 2001-01-03 Ravi Pratap <ravi@ximian.com>
20793 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20794 so we can call it from elsewhere.
20796 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20797 we emit it internally if the class has a defined indexer; otherwise the user
20798 emits it by decorating the class definition with the DefaultMemberAttribute.
20800 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20801 attribute is not used on a type which defines an indexer.
20803 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20804 character when we skip whitespace.
20806 * ../errors/cs0646.cs : Add.
20808 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20810 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20813 * makefile: Add practical target `mcs3.exe' which builds the third
20814 generation compiler.
20816 * expression.cs (New): Fix structures constructor calling.
20818 * class.cs (Property, Method, Indexer): Emit Final flag on the
20819 method if we are an interface implementation and we are not
20822 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20823 whether this property is referencing a `base' method.
20825 * expression.cs (Invocation.EmitCall): take an extra argument:
20826 is_base, this is used to determine whether the `call' or
20827 `callvirt' opcode should be used.
20830 * delegate.cs: update EmitCall.
20832 * class.cs (Method.Define): Set NewSlot for the cases where we are
20833 not implementing an interface method.
20835 (Property.Define): ditto.
20837 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20839 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20840 'r'. Allows mcs to parse itself fully.
20842 2002-01-02 Ravi Pratap <ravi@ximian.com>
20844 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20845 of the number of initializers that require the InitializeArray method.
20847 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20848 update the above field where necessary.
20850 (MakeByteBlob): Update accordingly.
20852 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20855 (EmitDynamicInitializers): Update in accordance with the new optimization.
20857 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20858 same OpCode applies.
20860 * cs-parser.jay : Fix some glaring errors I introduced.
20862 2002-01-01 Ravi Pratap <ravi@ximian.com>
20864 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20865 so that we can check for name clashes there too.
20867 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20868 for interface indexers.
20870 * interfaces.cs (Define): Emit the default member attribute.
20872 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20873 variable was being referred to while setting the value ;-)
20875 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20877 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20878 byte-by-byte information when we know the data is zero.
20880 Make the block always a multiple of 4, because
20881 DefineInitializedData has a bug.
20883 * assign.cs: Fix, we should assign from the temporary, not from
20886 * expression.cs (MakeByteBlob): Fix my incorrect code.
20888 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20890 * typemanager.cs (EnumToUnderlying): This function is used to get
20891 the underlying type from an enumeration, because it does not
20894 * constant.cs: Use the I4_S form for values between -128 and 127.
20896 * statement.cs (Block.LookupLabel): Looks up a label.
20897 (Block): Drop support for labeled blocks.
20899 (LabeledStatement): New kind of statement that represents a label
20902 (Goto): Finally implement this bad boy.
20904 * cs-parser.jay: Update to reflect new mechanism to implement
20907 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20909 * codegen.cs (EmitContext.This): a codegen property that keeps the
20910 a single instance of this instead of creating many different this
20913 * delegate.cs (Delegate.DoResolve): Update to use the property;
20915 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20917 * expression.cs (BaseAccess.DoResolve): Ditto.
20919 2001-12-29 Ravi Pratap <ravi@ximian.com>
20921 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20922 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20924 (InitCoreTypes): Update accordingly.
20926 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20927 so we can quickly store the state.
20929 (ApplyAttributes): Set the correct implementation flags
20930 for InternalCall methods.
20932 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20934 * expression.cs (EmitCall): if a method is not virtual, then do
20935 not use callvirt on it.
20937 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20938 user defined stuff) requires the use of stobj, which takes an
20939 address on the stack instead of an array and an index. So emit
20940 the Ldelema operation for it.
20942 (EmitStoreOpcode): Use stobj for valuetypes.
20944 (UnaryMutator.EmitCode): Use the right 1 value depending on
20945 whether we are dealing with int64/uint64, float or doubles.
20947 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20948 constructors that I implemented last night.
20950 (Constructor.IsDefault): Fix to work properly for static
20953 * cs-parser.jay (CheckDef): report method signature errors.
20954 Update error number 103 to be 132.
20956 * decl.cs: New AdditionResult enumeration value: MethodExists.
20957 Although we do this check for methods later on in the semantic
20958 analysis, catching repeated default constructors is so easy that
20959 we catch these here.
20961 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20964 (ParameterReference.EmitAssign, Emit): handle
20967 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20968 (ArrayAccess.EmitStoreOpcode): ditto.
20970 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20972 * expression.cs (MakeByteBlob): Complete all the missing types
20973 (uint, short, ushort, byte, sbyte)
20975 * class.cs: Only init instance field initializers on instance
20978 Rename `constructors' to instance_constructors.
20980 (TypeContainer.AddConstructor): Only add constructors to the list
20981 if it is not static.
20983 Make sure that we handle default_static_constructor independently
20984 everywhere where we handle instance_constructors
20986 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20988 * class.cs: Do not lookup or create a base initializer for a
20989 static constructor.
20991 (ConstructorInitializer.Resolve): use the proper type to lookup
20994 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20996 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20999 * decl.cs: CloseType is now an virtual method, the default
21000 implementation just closes this type.
21002 2001-12-28 Ravi Pratap <ravi@ximian.com>
21004 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21005 to PreserveSig by default. Also emit HideBySig on such methods.
21007 Basically, set the defaults to standard values.
21009 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21010 argument, if candidate is better, it can't be worse than the best !
21012 (Invocation): Re-write bits to differentiate between methods being
21013 applicable in their expanded form and their normal form - for params
21016 Get rid of use_standard everywhere as only standard conversions are allowed
21017 in overload resolution.
21019 More spec conformance.
21021 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21023 * driver.cs: Add --timestamp, to see where the compiler spends
21026 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21027 `this' in static code.
21029 (SimpleName.DoResolve): Implement in terms of a helper function
21030 that allows static-references to be passed upstream to
21033 (Expression.ResolveWithSimpleName): Resolve specially simple
21034 names when called by MemberAccess to implement the special
21037 (Expression.ImplicitReferenceConversion): Handle conversions from
21038 Null to reference types before others, as Null's type is
21041 * expression.cs (Invocation.EmitCall): Handle the special case of
21042 calling methods declared on a reference type from a ValueType
21043 (Base classes System.Object and System.Enum)
21045 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21046 the left hand side is a TypeExpr, not on every enumeration.
21048 (Binary.Resolve): If types are reference types, then do a cast to
21049 object on operators != and == of both arguments.
21051 * typemanager.cs (FindMembers): Extract instance and static
21052 members if requested.
21054 * interface.cs (PopulateProperty): Use void_type instead of null
21055 as the return type for the setter method.
21057 (PopulateIndexer): ditto.
21059 2001-12-27 Ravi Pratap <ravi@ximian.com>
21061 * support.cs (ReflectionParameters): Fix minor bug where we
21062 were examining the wrong parameter for the ParamArray attribute.
21064 Cope with requests for the type of the parameter at position
21065 greater than the params parameter's. We now return the element
21066 type of the params array as that makes more sense.
21068 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21069 accordingly as we no longer have to extract the element type
21072 (Invocation.OverloadResolve): Update.
21074 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21076 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21077 against IEnumerator, test whether the return value is a descendant
21078 of the IEnumerator interface.
21080 * class.cs (Indexer.Define): Use an auxiliary method to implement
21081 the other bits of the method definition. Begin support for
21082 explicit interface implementation.
21084 (Property.DefineMethod): Use TypeManager.void_type instead of null
21085 for an empty return value.
21087 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21089 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21090 dealing with a FieldExpr which is composed of a FieldBuilder, in
21091 the code path we did extract the constant, but we should have
21092 obtained the underlying value to be able to cast it (otherwise we
21093 end up in an infinite loop, this is what Ravi was running into).
21095 (ArrayCreation.UpdateIndices): Arrays might be empty.
21097 (MemberAccess.ResolveMemberAccess): Add support for section
21098 14.5.4.1 that deals with the special case of E.I when E is a type
21099 and something else, that I can be a reference to a static member.
21101 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21102 handle a particular array type to create byte blobs, it is just
21103 something we dont generate byteblobs for.
21105 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21108 * location.cs (Push): remove the key from the hashtable that we
21109 are about to add. This happens for empty files.
21111 * driver.cs: Dispose files after we have parsed them.
21113 (tokenize): new function that only runs the tokenizer on its
21114 input, for speed testing.
21116 2001-12-26 Ravi Pratap <ravi@ximian.com>
21118 * class.cs (Event.Define): Define the private field only if there
21119 are no accessors defined.
21121 * expression.cs (ResolveMemberAccess): If there is no associated
21122 field with the event, that means we have an event defined with its
21123 own accessors and we should flag error cs0070 since transforming
21124 ourselves into a field is not valid in that case.
21126 * ecore.cs (SimpleName.DoResolve): Same as above.
21128 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21129 and charset to sane values.
21131 2001-12-25 Ravi Pratap <ravi@ximian.com>
21133 * assign.cs (DoResolve): Perform check on events only if they
21134 are being accessed outside the declaring type.
21136 * cs-parser.jay (event_declarations): Update rules to correctly
21137 set the type of the implicit parameter etc.
21139 (add_accessor, remove_accessor): Set current local parameters.
21141 * expression.cs (Binary): For delegate addition and subtraction,
21142 cast the return value from the method into the appropriate delegate
21145 2001-12-24 Ravi Pratap <ravi@ximian.com>
21147 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21148 of these as the workaround is unnecessary.
21150 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21151 delegate data - none of that is needed at all.
21153 Re-write bits to extract the instance expression and the delegate method
21156 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21159 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21160 of attaching attributes instead of duplicating code everywhere.
21162 * everywhere : Update code to do attribute emission using the above method.
21164 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21166 * expression.cs (IsParamsMethodApplicable): if there are not
21167 parameters, return immediately.
21169 * ecore.cs: The 0 literal can be implicity converted to an enum
21172 (SimpleName.DoResolve): First lookup the type, then lookup the
21175 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21176 want to get its address. If the InstanceExpression is not
21177 addressable, store the result in a temporary variable, then get
21180 * codegen.cs: Only display 219 errors on warning level or above.
21182 * expression.cs (ArrayAccess): Make it implement the
21183 IMemoryLocation interface.
21185 (Binary.DoResolve): handle the operator == (object a, object b)
21186 and operator != (object a, object b) without incurring into a
21187 BoxedCast (because 5 != o should never be performed).
21189 Handle binary enumerator operators.
21191 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21192 value type, otherwise use Ldelem_ref.
21194 Use precomputed names;
21196 (AddressOf): Implement address of
21198 * cs-parser.jay (labeled_statement): Fix recursive block
21199 addition by reworking the production.
21201 * expression.cs (New.DoEmit): New has a special case:
21203 If we are dealing with a ValueType, we have a few
21204 situations to deal with:
21206 * The target of New is a ValueType variable, that is
21207 easy, we just pass this as the variable reference
21209 * The target of New is being passed as an argument,
21210 to a boxing operation or a function that takes a
21213 In this case, we need to create a temporary variable
21214 that is the argument of New.
21217 2001-12-23 Ravi Pratap <ravi@ximian.com>
21219 * rootcontext.cs (LookupType): Check that current_type is not null before
21220 going about looking at nested types.
21222 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21223 not implement the IAssignMethod interface any more.
21225 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21226 where we tranform them into FieldExprs if they are being resolved from within
21227 the declaring type.
21229 * ecore.cs (SimpleName.DoResolve): Do the same here.
21231 * assign.cs (DoResolve, Emit): Clean up code considerably.
21233 * ../errors/bug10.cs : Add.
21235 * ../errors/cs0070.cs : Add.
21237 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21239 * assign.cs : Get rid of EventIsLocal everywhere.
21241 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21243 * ecore.cs (ConvertIntLiteral): finished the implementation.
21245 * statement.cs (SwitchLabel): Convert the value we are using as a
21246 key before looking up the table.
21248 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21250 * codegen.cs (EmitTopBlock): Require a Location argument now.
21252 * cs-parser.jay (constructor_declarator): We need to setup
21253 current_local_parameters before we parse the
21254 opt_constructor_initializer, to allow the variables to be bound
21255 to the constructor arguments.
21257 * rootcontext.cs (LookupType): First lookup nested classes in our
21258 class and our parents before we go looking outside our class.
21260 * expression.cs (ConstantFold): Extract/debox the values at the
21263 * rootcontext.cs (EmitCode): Resolve the constants first before we
21264 resolve the types. This is not really needed, but it helps debugging.
21266 * statement.cs: report location.
21268 * cs-parser.jay: pass location to throw statement.
21270 * driver.cs: Small bug fix.
21272 * report.cs: Updated format to be 4-zero filled digits.
21274 2001-12-22 Ravi Pratap <ravi@ximian.com>
21276 * expression.cs (CheckIndices): Fix minor bug where the wrong
21277 variable was being referred to ;-)
21279 (DoEmit): Do not call EmitStaticInitializers when the
21280 underlying type is System.Object.
21282 2001-12-21 Ravi Pratap <ravi@ximian.com>
21284 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21285 and do the usual workaround for SRE.
21287 * class.cs (MyEventBuilder.EventType): New member to get at the type
21288 of the event, quickly.
21290 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21292 * assign.cs (Assign.DoResolve): Handle the case when the target
21293 is an EventExpr and perform the necessary checks.
21295 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21298 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21300 (EventExpr): Set the type in the constructor itself since we
21301 are meant to be born fully resolved.
21303 (EventExpr.Define): Revert code I wrote earlier.
21305 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21306 instance expression is null. The instance expression is a This in that case
21307 or a null, depending on whether it is a static method or not.
21309 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21310 refers to more than one method.
21312 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21313 and accordingly flag errors.
21315 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21317 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21319 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21321 * location.cs (ToString): Provide useful rutine.
21323 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21325 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21326 objects, return the actual integral boxed.
21328 * statement.cs (SwitchLabel): define an ILLabel for each
21331 (Switch.CheckSwitch): If the value is a Literal, extract
21332 the underlying literal.
21334 Also in the unused hashtable we had, add the SwitchLabel so we can
21335 quickly look this value up.
21337 * constant.cs: Implement a bunch of new constants. Rewrite
21338 Literal based on this. Made changes everywhere to adapt to this.
21340 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21341 dereferencing array only once, and also copes with enumrations.
21343 bytes are two bytes wide, not one.
21345 (Cast): Perform constant conversions.
21347 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21348 wrappers to the literals here.
21350 * expression.cs (DoNumericPromotions): long literals can converted
21351 to ulong implicity (this is taken care of elsewhere, but I was
21352 missing this spot).
21354 * ecore.cs (Expression.Literalize): Make the return type Literal,
21355 to improve type checking.
21357 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21359 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21361 * literal.cs: Revert code from ravi that checked the bounds. The
21362 bounds are sane by the definition of the type itself.
21364 * typemanager.cs: Fix implementation of ImplementsInterface. We
21365 need to actually look up in our parent hierarchy for interfaces
21368 * const.cs: Use the underlying type for enumerations
21370 * delegate.cs: Compute the basename for the delegate creation,
21371 that should fix the delegate test case, and restore the correct
21372 Type Lookup semantics in rootcontext
21374 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21375 referencing a nested type with the Reflection API is using the "+"
21378 * cs-parser.jay: Do not require EOF token at the end.
21380 2001-12-20 Ravi Pratap <ravi@ximian.com>
21382 * rootcontext.cs (LookupType): Concatenate type names with
21383 a '.' instead of a '+' The test suite passes again.
21385 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21386 field of the enumeration.
21388 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21389 the case when the member is an EventExpr.
21391 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21392 static has an associated instance expression.
21394 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21396 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21398 * class.cs (Event.Define): Register event and perform appropriate checks
21401 We define the Add and Remove methods even if the use provides none because
21402 in that case, we provide default implementations ourselves.
21404 Define a private field of the type of the event. This is done by the CSC compiler
21405 and we should be doing it too ;-)
21407 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21408 More methods we use in code we generate.
21410 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21413 (InitCoreTypes): Update accordingly for the above.
21415 * class.cs (Event.Emit): Generate code for default accessors that we provide
21417 (EmitDefaultMethod): Do the job in the above.
21419 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21422 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21424 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21425 builders even if we were missing one.
21427 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21428 pass the Basename as our class name instead of the Name. The
21429 basename will be correctly composed for us.
21431 * parameter.cs (Paramters): Now takes a Location argument.
21433 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21434 make all the code call directly LookupType in RootContext and take
21435 this chance to pass the Location information everywhere.
21437 * Everywhere: pass Location information.
21439 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21441 * class.cs (Constructor.Define): Updated way of detecting the
21442 length of the parameters.
21444 (TypeContainer.DefineType): Use basename as the type name for
21447 (TypeContainer.Define): Do not recursively define types here, as
21448 definition is taken care in order by the RootContext.
21450 * tree.cs: Keep track of namespaces in a per-file basis.
21452 * parameter.cs (Parameter.ComputeSignature): Update to use
21455 (Parameters.GetSignature): ditto.
21457 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21458 instead of a TypeContainer.
21460 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21461 resolve names. Because we need to be resolve in our context, not
21464 * driver.cs: Implement response files.
21466 * class.cs (TypeContainer.DefineType): If we are defined, do not
21467 redefine ourselves.
21469 (Event.Emit): Emit the code for add/remove handlers.
21470 (Event.Define): Save the MethodBuilders for add/remove.
21472 * typemanager.cs: Use pair here too.
21474 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21475 DictionaryEntry requires the first argument to be non-null.
21477 (enum_declaration): Compute full name for registering the
21480 (delegate_declaration): Instead of using
21481 formal_parameter_list, use opt_formal_parameter_list as the list
21484 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21485 (EventParsing): New property that controls whether `add' and
21486 `remove' are returned as tokens or identifiers (for events);
21488 2001-12-19 Ravi Pratap <ravi@ximian.com>
21490 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21491 use MyEventBuilder only and let it wrap the real builder for us.
21493 (MyEventBuilder): Revamp constructor etc.
21495 Implement all operations that we perform on EventBuilder in precisely the same
21498 (FindMembers): Update to use the EventBuilder member.
21500 (Event.Emit): Update accordingly.
21502 2001-12-18 Ravi Pratap <ravi@ximian.com>
21504 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21505 by calling the appropriate methods.
21507 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21510 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21512 2001-12-17 Ravi Pratap <ravi@ximian.com>
21514 * delegate.cs (Delegate.Populate): Check that the return type
21515 and various parameters types are indeed accessible.
21517 * class.cs (Constructor.Define): Same here.
21519 (Field.Define): Ditto.
21521 (Event.Define): Ditto.
21523 (Operator.Define): Check that the underlying Method defined itself
21524 correctly - so it's MethodBuilder should not be null.
21526 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21527 expression happens to be null.
21529 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21530 members but as of now we don't seem to be able to do anything really useful with it.
21532 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21533 not the EventBuilder.
21535 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21537 * cs-tokenizer.cs: Add support for defines.
21538 Add support for #if, #elif, #else, #endif
21540 (eval_var): evaluates a variable.
21541 (eval): stubbed for evaluating functions.
21543 * cs-parser.jay: Pass the defines information
21545 * driver.cs: Add --define command line option.
21547 * decl.cs: Move MemberCore here.
21549 Make it the base class for DeclSpace. This allows us to catch and
21550 report 108 and 109 for everything now.
21552 * class.cs (TypeContainer.Define): Extract all the members
21553 before populating and emit the warning 108 (new keyword required
21554 to override) instead of having each member implement this.
21556 (MemberCore.Define): New abstract method, we will be using this in
21557 the warning reporting engine in Populate.
21559 (Operator.Define): Adjust to new MemberCore protocol.
21561 * const.cs (Const): This does not derive from Expression, it is a
21562 temporary object we use to create fields, it is a MemberCore.
21564 * class.cs (Method.Define): Allow the entry point to be in a
21567 * driver.cs: Rewrite the argument handler to clean it up a bit.
21569 * rootcontext.cs: Made it just an auxiliary namespace feature by
21570 making everything static.
21572 * driver.cs: Adapt code to use RootContext type name instead of
21575 * delegate.cs: Remove RootContext argument.
21577 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21580 * class.cs (Event.Define): The lookup can fail.
21582 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21584 * expression.cs: Resolve the this instance before invoking the code.
21586 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21588 * cs-parser.jay: Add a production in element_access that allows
21589 the thing to become a "type" reference. This way we can parse
21590 things like "(string [])" as a type.
21592 Note that this still does not handle the more complex rules of
21596 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21598 * ecore.cs: (CopyNewMethods): new utility function used to
21599 assemble the list of methods from running FindMembers.
21601 (MemberLookup): Rework FindMembers so that
21603 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21605 * class.cs (TypeContainer): Remove Delegates who fail to be
21608 * delegate.cs (Populate): Verify that we dont get null return
21609 values. TODO: Check for AsAccessible.
21611 * cs-parser.jay: Use basename to emit error 574 (destructor should
21612 have the same name as container class), not the full name.
21614 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21615 possible representation.
21617 Also implements integer type suffixes U and L.
21619 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21621 * expression.cs (ArrayCreation.DoResolve): We need to do the
21622 argument resolution *always*.
21624 * decl.cs: Make this hold the namespace. Hold the root context as
21626 (LookupType): Move here.
21628 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21630 * location.cs (Row, Name): Fixed the code, it was always returning
21631 references to the first file.
21633 * interface.cs: Register properties defined through interfaces.
21635 * driver.cs: Add support for globbing on the command line
21637 * class.cs (Field): Make it derive from MemberCore as well.
21640 2001-12-15 Ravi Pratap <ravi@ximian.com>
21642 * class.cs (Event::Define): Check that the type of the event is a delegate
21643 type else flag error #66.
21645 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21648 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21649 values of EntryPoint, CharSet etc etc.
21651 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21653 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21654 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21655 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21656 which needs this to do its work.
21658 * ../errors/cs0066.cs : Add.
21660 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21662 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21665 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21666 clears out the parameters field.
21667 (MemberSignatureCompare): Cleanup
21669 (MemberCore): New base class used to share code between MethodCore
21672 (RegisterRequiredImplementations) BindingFlags.Public requires
21673 either BindingFlags.Instace or Static. Use instance here.
21675 (Property): Refactored code to cope better with the full spec.
21677 * parameter.cs (GetParameterInfo): Return an empty array instead
21680 * class.cs (Property): Abstract or extern properties have no bodies.
21682 * parameter.cs (GetParameterInfo): return a zero-sized array.
21684 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21685 method modifier validation to the typecontainer so we can reuse
21686 this on properties.
21688 (MethodCore.ParameterTypes): return an empty sized array of types.
21690 (Property.Define): Test property modifier validity.
21692 Add tests for sealed/override too.
21694 (Method.Emit): abstract or extern methods have no bodies.
21696 2001-12-14 Ravi Pratap <ravi@ximian.com>
21698 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21701 (Method::Define, ::Emit): Modify accordingly.
21703 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21705 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21707 * makefile: Pass in /unsafe.
21709 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21711 * class.cs (MakeKey): Kill routine.
21713 * class.cs (TypeContainer.Define): Correctly define explicit
21714 method implementations (they require the full interface name plus
21717 * typemanager.cs: Deply the PtrHashtable here and stop using the
21718 lame keys. Things work so much better.
21720 This of course broke everyone who depended on `RegisterMethod' to
21721 do the `test for existance' test. This has to be done elsewhere.
21723 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21724 the object stupid Equals method (because, that like fails all over
21725 the place). We still do not use it.
21727 * class.cs (TypeContainer.SetRequiredInterface,
21728 TypeContainer.RequireMethods): Killed these two routines and moved
21729 all the functionality to RegisterRequiredImplementations.
21731 (TypeContainer.RegisterRequiredImplementations): This routine now
21732 registers all the implementations required in an array for the
21733 interfaces and abstract methods. We use an array of structures
21734 which can be computed ahead of time to reduce memory usage and we
21735 also assume that lookups are cheap as most classes will not
21736 implement too many interfaces.
21738 We also avoid creating too many MethodSignatures.
21740 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21741 clear the "pending" bit if we find that there are problems with
21744 (TypeContainer.VerifyPendingMethods): Update to report errors of
21745 methods that look like implementations but are not.
21747 (TypeContainer.Define): Add support for explicit interface method
21750 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21752 * typemanager.cs: Keep track of the parameters here instead of
21753 being a feature of the TypeContainer.
21755 * class.cs: Drop the registration of parameters here, as
21756 InterfaceMethods are also interface declarations.
21758 * delegate.cs: Register methods with the TypeManager not only with
21759 the TypeContainer. This code was buggy.
21761 * interface.cs: Full registation here.
21763 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21765 * expression.cs: Remove reducer for binary expressions, it can not
21768 * const.cs: Put here the code that used to go into constant.cs
21770 * constant.cs: Put here the code for constants, this is a new base
21771 class for Literals.
21773 * literal.cs: Make Literal derive from Constant.
21775 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21777 * statement.cs (Return.Emit): Report error 157 if the user
21778 attempts to return from a finally block.
21780 (Return.Emit): Instead of emitting a return, jump to the end of
21783 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21784 LocalBuilder to store the result of the function. ReturnLabel is
21785 the target where we jump.
21788 2001-12-09 Radek Doulik <rodo@ximian.com>
21790 * cs-parser.jay: remember alias in current namespace
21792 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21795 * class.cs (LookupAlias): lookup alias in my_namespace
21797 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21799 (LookupAlias): lookup alias in this and if needed in parent
21802 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21806 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21807 making things static. I need this to avoid passing the
21808 TypeContainer when calling ParameterType.
21810 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21811 that did string manipulation to compute the type and then call
21812 GetType. Use Parameter.ParameterType instead.
21814 * cs-tokenizer.cs: Consume the suffix for floating values.
21816 * expression.cs (ParameterReference): figure out whether this is a
21817 reference parameter or not. Kill an extra variable by computing
21818 the arg_idx during emission.
21820 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21821 function that returns whether a parameter is an out/ref value or not.
21823 (Parameter.ParameterType): The type of the parameter (base,
21824 without ref/out applied).
21826 (Parameter.Resolve): Perform resolution here.
21827 (Parameter.ExternalType): The full type (with ref/out applied).
21829 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21830 support for expressions on the using statement.
21832 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21834 * statement.cs (Using.EmitLocalVariableDecls): Split the
21835 localvariable handling of the using statement.
21837 (Block.EmitMeta): Keep track of variable count across blocks. We
21838 were reusing slots on separate branches of blocks.
21840 (Try.Emit): Emit the general code block, we were not emitting it.
21842 Check the type of the declaration to be an IDisposable or
21843 something that can be implicity converted to it.
21845 Emit conversions if required.
21847 * ecore.cs (EmptyExpression): New utility class.
21848 (Expression.ImplicitConversionExists): New utility function.
21850 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21852 * statement.cs (Using): Implement.
21854 * expression.cs (LocalVariableReference): Support read only variables.
21856 * statement.cs: Remove the explicit emit for the Leave opcode.
21857 (VariableInfo): Add a readonly field.
21859 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21861 * ecore.cs (ConvCast): new class used to encapsulate the various
21862 explicit integer conversions that works in both checked and
21863 unchecked contexts.
21865 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21866 properly generate the overflow opcodes.
21868 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21870 * statement.cs: The correct type for the EmptyExpression is the
21871 element_type, not the variable type. Ravi pointed this out.
21873 2001-12-04 Ravi Pratap <ravi@ximian.com>
21875 * class.cs (Method::Define): Handle PInvoke methods specially
21876 by using DefinePInvokeMethod instead of the usual one.
21878 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21879 above to do the task of extracting information and defining the method.
21881 2001-12-04 Ravi Pratap <ravi@ximian.com>
21883 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21884 of the condition for string type.
21886 (Emit): Move that here.
21888 (ArrayCreation::CheckIndices): Keep string literals in their expression
21891 (EmitDynamicInitializers): Handle strings appropriately.
21893 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21895 * codegen.cs (EmitContext): Replace multiple variables with a
21896 single pointer to the current Switch statement.
21898 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21901 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21905 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21908 (Foreach.Emit): Foreach on arrays was not setting
21909 up the loop variables (for break/continue).
21911 (GotoCase): Semi-implented.
21913 2001-12-03 Ravi Pratap <ravi@ximian.com>
21915 * attribute.cs (CheckAttribute): Handle system attributes by using
21916 Attribute.GetAttributes to examine information we need.
21918 (GetValidPlaces): Same here.
21920 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21922 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21924 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21926 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21928 (Method::Emit): Handle the case when we are a PInvoke method.
21930 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21932 * expression.cs: Use ResolveWithSimpleName on compound names.
21934 2001-12-02 Ravi Pratap <ravi@ximian.com>
21936 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21937 before trying to reduce it.
21939 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21941 * constant.cs (LookupConstantValue): Implement.
21943 (EmitConstant): Use the above in emitting the constant.
21945 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21946 that are user-defined by doing a LookupConstantValue on them.
21948 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21951 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21953 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21955 (BaseAccess.DoResolve): Implement.
21957 (MemberAccess.DoResolve): Split this routine into a
21958 ResolveMemberAccess routine that can be used independently
21960 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21962 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21963 As that share bits of the implementation. Is returns a boolean,
21964 while As returns the Type that is being probed.
21966 2001-12-01 Ravi Pratap <ravi@ximian.com>
21968 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21969 instead of a Literal - much easier.
21971 (EnumInTransit): Remove - utterly useless :-)
21973 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21975 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21977 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21978 chain when we have no associated expression.
21980 2001-11-30 Ravi Pratap <ravi@ximian.com>
21982 * constant.cs (Define): Use Location while reporting the errror.
21984 Also emit a warning when 'new' is used and there is no inherited
21987 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21990 (LookupEnumValue): Implement to lookup an enum member's value and define it
21993 (Populate): Re-write accordingly to use the above routine.
21995 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21997 * expression.cs (This): Fix prototype for DoResolveLValue to
21998 override the base class DoResolveLValue.
22000 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22003 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22004 (we need to load the address of the field here). This fixes
22007 (FieldExpr.DoResolveLValue): Call the DoResolve
22008 function to initialize the Instance expression.
22010 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22011 correctly the GetEnumerator operation on a value type.
22013 * cs-parser.jay: Add more simple parsing error catches.
22015 * statement.cs (Switch): Add support for string switches.
22016 Handle null specially.
22018 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22020 2001-11-28 Ravi Pratap <ravi@ximian.com>
22022 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22024 (declare_local_constant): New helper function.
22026 * statement.cs (AddConstant): Keep a separate record of constants
22028 (IsConstant): Implement to determine if a variable is a constant.
22030 (GetConstantExpression): Implement.
22032 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22034 * statement.cs (IsVariableDefined): Re-write.
22036 2001-11-27 Ravi Pratap <ravi@ximian.com>
22038 * class.cs (TypeContainer::FindMembers): Look for constants
22039 in the case when we are looking for MemberTypes.Field
22041 * expression.cs (MemberAccess::DoResolve): Check that in the
22042 case we are a FieldExpr and a Literal, we are not being accessed
22043 by an instance reference.
22045 * cs-parser.jay (local_constant_declaration): Implement.
22047 (declaration_statement): Implement for constant declarations.
22049 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22051 * statement.cs (Switch): Catch double defaults.
22053 (Switch): More work on the switch() statement
22054 implementation. It works for integral values now, need to finish
22058 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22060 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22061 integer literals into other integer literals. To be used by
22064 2001-11-24 Ravi Pratap <ravi@ximian.com>
22066 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22069 (EmitDynamicInitializers): Cope with the above since we extract data
22070 directly from ArrayData now.
22072 (ExpectInitializers): Keep track of whether initializers are mandatory
22075 (Bounds): Make it a hashtable to prevent the same dimension being
22076 recorded for every element in that dimension.
22078 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22081 Also fix bug which was causing the indices to be emitted in the reverse
22084 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22086 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22087 unfinished. They do not work, because the underlying code is
22090 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22092 * cs-parser.jay: Remove bogus fixme.
22094 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22095 on Switch statement.
22097 2001-11-23 Ravi Pratap <ravi@ximian.com>
22099 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22102 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22103 parameter. Apparently, any expression is allowed.
22105 (ValidateInitializers): Update accordingly.
22107 (CheckIndices): Fix some tricky bugs thanks to recursion.
22109 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22110 I was being completely brain-dead.
22112 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22113 and re-write acordingly.
22115 (DelegateInvocation): Re-write accordingly.
22117 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22119 (MakeByteBlob): Handle types more correctly.
22121 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22122 initialization from expressions but it is incomplete because I am a complete
22125 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22127 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22128 on If. Basically, we have to return `true' (ie, we do return to
22129 our caller) only if both branches of the if return.
22131 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22132 short-circuit operators, handle them as short circuit operators.
22134 (Cast.DoResolve): Resolve type.
22135 (Cast.Cast): Take an expression as the target type.
22137 * cs-parser.jay (cast_expression): Remove old hack that only
22138 allowed a limited set of types to be handled. Now we take a
22139 unary_expression and we resolve to a type during semantic
22142 Use the grammar productions from Rhys to handle casts (this is
22143 not complete like Rhys syntax yet, we fail to handle that corner
22144 case that C# has regarding (-x), but we will get there.
22146 2001-11-22 Ravi Pratap <ravi@ximian.com>
22148 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22149 field which is an array type.
22151 * cs-parser.jay (declare_local_variables): Support array initialization too.
22153 * typemanager.cs (MakeKey): Implement.
22155 (everywhere): Use the above appropriately.
22157 * cs-parser.jay (for_statement): Update for array initialization while
22158 declaring variables.
22160 * ecore.cs : The error message was correct, it's the variable's names that
22161 were misleading ;-) Make the code more readable.
22163 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22164 the correct type etc.
22166 (ConvertExplicit): Handle Enum types by examining the underlying type.
22168 2001-11-21 Ravi Pratap <ravi@ximian.com>
22170 * parameter.cs (GetCallingConvention): Always return
22171 CallingConventions.Standard for now.
22173 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22175 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22176 and `r' after calling DoNumericPromotions.
22178 * ecore.cs: Fix error message (the types were in the wrong order).
22180 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22181 BindingFlags.Instance as well
22183 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22184 implicit int literal conversion in an empty cast so that we
22185 propagate the right type upstream.
22187 (UnboxCast): new class used to unbox value types.
22188 (Expression.ConvertExplicit): Add explicit type conversions done
22191 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22192 the target type before applying the implicit LongLiterals to ULong
22195 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22197 * cs-parser.jay (for_statement): Reworked the way For works: now
22198 we declare manually any variables that are introduced in
22199 for_initializer to solve the problem of having out-of-band code
22200 emition (that is what got for broken).
22202 (declaration_statement): Perform the actual variable declaration
22203 that used to be done in local_variable_declaration here.
22205 (local_variable_declaration): Do not declare anything, just pass
22206 the information on a DictionaryEntry
22208 2001-11-20 Ravi Pratap <ravi@ximian.com>
22210 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22211 re-write of the logic to now make it recursive.
22213 (UpdateIndices): Re-write accordingly.
22215 Store element data in a separate ArrayData list in the above methods.
22217 (MakeByteBlob): Implement to dump the array data into a byte array.
22219 2001-11-19 Ravi Pratap <ravi@ximian.com>
22221 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22224 * constant.cs (Define): Implement.
22226 (EmitConstant): Re-write fully.
22228 Pass in location info.
22230 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22233 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22234 DictionaryEntry since we need location info too.
22236 (constant_declaration): Update accordingly.
22238 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22239 code into another method : UpdateIndices.
22241 2001-11-18 Ravi Pratap <ravi@ximian.com>
22243 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22244 some type checking etc.
22246 2001-11-17 Ravi Pratap <ravi@ximian.com>
22248 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22249 bits to provide dimension info if the user skips doing that.
22251 Update second constructor to store the rank correctly.
22253 2001-11-16 Ravi Pratap <ravi@ximian.com>
22255 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22256 and try to implement.
22258 * ../errors/cs0150.cs : Add.
22260 * ../errors/cs0178.cs : Add.
22262 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22264 * statement.cs: Implement foreach on multi-dimensional arrays.
22266 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22267 name of the params argument.
22269 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22270 initializing the array.
22272 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22273 we can use this elsewhere.
22275 * statement.cs: Finish implementation of foreach for single
22278 * cs-parser.jay: Use an out-of-band stack to pass information
22279 around, I wonder why I need this.
22281 foreach_block: Make the new foreach_block the current_block.
22283 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22284 function used to return a static Parameters structure. Used for
22285 empty parameters, as those are created very frequently.
22287 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22289 2001-11-15 Ravi Pratap <ravi@ximian.com>
22291 * interface.cs : Default modifier is private, not public. The
22292 make verify test passes again.
22294 2001-11-15 Ravi Pratap <ravi@ximian.com>
22296 * support.cs (ReflectionParameters): Fix logic to determine
22297 whether the last parameter is a params one. Test 9 passes again.
22299 * delegate.cs (Populate): Register the builders we define with
22300 RegisterParameterForBuilder. Test 19 passes again.
22302 * cs-parser.jay (property_declaration): Reference $6 instead
22303 of $$ to get at the location.
22305 (indexer_declaration): Similar stuff.
22307 (attribute): Ditto.
22309 * class.cs (Property): Register parameters for the Get and Set methods
22310 if they exist. Test 23 passes again.
22312 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22313 call to EmitArguments as we are sure there aren't any params arguments.
22314 Test 32 passes again.
22316 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22317 IndexOutOfRangeException.
22319 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22320 Test 33 now passes again.
22322 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22324 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22325 broke a bunch of things. Will have to come up with a better way
22326 of tracking locations.
22328 * statement.cs: Implemented foreach for single dimension arrays.
22330 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22332 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22333 an error. This removes the lookup from the critical path.
22335 * cs-parser.jay: Removed use of temporary_loc, which is completely
22338 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22340 * support.cs (ReflectionParameters.ParameterModifier): Report
22341 whether the argument is a PARAMS argument or not.
22343 * class.cs: Set the attribute `ParamArrayAttribute' on the
22344 parameter argument.
22346 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22347 and cons_param_array_attribute (ConstructorInfo for
22348 ParamArrayAttribute).,
22350 * codegen.cs: Emit the return using the `Return' statement, that
22351 way we can report the error correctly for missing return values.
22353 * class.cs (Method.Emit): Clean up.
22355 * expression.cs (Argument.Resolve): Take another argument: the
22356 location where this argument is used. Notice that this is not
22357 part of the "Argument" class as to reduce the size of the
22358 structure (we know the approximate location anyways).
22360 Test if the argument is a variable-reference, if not, then
22361 complain with a 206.
22363 (Argument.Emit): Emit addresses of variables.
22365 (Argument.FullDesc): Simplify.
22367 (Invocation.DoResolve): Update for Argument.Resolve.
22369 (ElementAccess.DoResolve): ditto.
22371 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22372 method should be virtual, as this method is always virtual.
22374 (NewDelegate.DoResolve): Update for Argument.Resolve.
22376 * class.cs (ConstructorInitializer.DoResolve): ditto.
22378 * attribute.cs (Attribute.Resolve): ditto.
22380 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22382 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22384 * expression.cs (ParameterReference): Drop IStackStorage and implement
22385 IAssignMethod instead.
22387 (LocalVariableReference): ditto.
22389 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22390 IAssignMethod instead.
22392 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22394 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22395 enumerations that are used in heavily used structures derive from
22396 byte in a laughable and pathetic attempt to reduce memory usage.
22397 This is the kind of pre-optimzations that you should not do at
22398 home without adult supervision.
22400 * expression.cs (UnaryMutator): New class, used to handle ++ and
22401 -- separatedly from the other unary operators. Cleans up the
22402 code, and kills the ExpressionStatement dependency in Unary.
22404 (Unary): Removed `method' and `Arguments' from this class, making
22405 it smaller, and moving it all to SimpleCall, so I can reuse this
22406 code in other locations and avoid creating a lot of transient data
22407 strucutres when not required.
22409 * cs-parser.jay: Adjust for new changes.
22411 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22413 * enum.cs (Enum.Populate): If there is a failure during
22416 * cs-parser.jay (opt_enum_base): we used to catch type errors
22417 here, but this is really incorrect. The type error should be
22418 catched during semantic analysis.
22420 2001-12-11 Ravi Pratap <ravi@ximian.com>
22422 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22423 current_local_parameters as expected since I, in my stupidity, had forgotten
22426 * attribute.cs (GetValidPlaces): Fix stupid bug.
22428 * class.cs (Method::Emit): Perform check on applicability of attributes.
22430 (Constructor::Emit): Ditto.
22432 (Field::Emit): Ditto.
22434 (Field.Location): Store location information.
22436 (Property, Event, Indexer, Operator): Ditto.
22438 * cs-parser.jay (field_declaration): Pass in location for each field.
22440 * ../errors/cs0592.cs : Add.
22442 2001-11-12 Ravi Pratap <ravi@ximian.com>
22444 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22446 (InitCoreTypes): Update accordingly.
22448 (RegisterAttrType, LookupAttr): Implement.
22450 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22451 info about the same.
22453 (Resolve): Update to populate the above as necessary.
22455 (Error592): Helper.
22457 (GetValidPlaces): Helper to the above.
22459 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22461 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22463 2001-11-12 Ravi Pratap <ravi@ximian.com>
22465 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22467 * ../errors/cs0617.cs : Add.
22469 2001-11-11 Ravi Pratap <ravi@ximian.com>
22471 * enum.cs (Emit): Rename to Populate to be more consistent with what
22472 we expect it to do and when exactly it is called.
22474 * class.cs, rootcontext.cs : Update accordingly.
22476 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22477 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22479 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22481 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22482 of a fieldinfo using the above, when dealing with a FieldBuilder.
22484 2001-11-10 Ravi Pratap <ravi@ximian.com>
22486 * ../errors/cs0031.cs : Add.
22488 * ../errors/cs1008.cs : Add.
22490 * ../errrors/cs0543.cs : Add.
22492 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22495 (FindMembers): Implement.
22497 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22498 enums and delegates too.
22500 (enum_types): Rename to builder_to_enum.
22502 (delegate_types): Rename to builder_to_delegate.
22504 * delegate.cs (FindMembers): Implement.
22506 2001-11-09 Ravi Pratap <ravi@ximian.com>
22508 * typemanager.cs (IsEnumType): Implement.
22510 * enum.cs (Emit): Re-write parts to account for the underlying type
22511 better and perform checking etc.
22513 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22514 of the underlying type.
22516 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22519 * enum.cs (error31): Helper to report error #31.
22521 * cs-parser.jay (enum_declaration): Store location of each member too.
22523 * enum.cs (member_to_location): New hashtable.
22525 (AddEnumMember): Update location hashtable.
22527 (Emit): Use the location of each member while reporting errors.
22529 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22531 * cs-parser.jay: A for_initializer if is a
22532 local_variable_declaration really ammount to have an implicit
22533 block with the variable declaration and no initializer for for.
22535 * statement.cs (For.Emit): Cope with null initializers.
22537 This fixes the infinite loop on for initializers.
22539 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22541 * enum.cs: More cleanup.
22543 * ecore.cs: Remove dead code.
22545 * class.cs (Property.Emit): More simplification.
22546 (Event.Emit): ditto.
22548 Reworked to have less levels of indentation.
22550 2001-11-08 Ravi Pratap <ravi@ximian.com>
22552 * class.cs (Property): Emit attributes.
22562 * enum.cs (Emit): Ditto.
22564 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22567 * class.cs (Field, Event, etc.): Move attribute generation into the
22568 Emit method everywhere.
22570 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22571 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22572 as we had no way of defining nested enums !
22574 * rootcontext.cs : Adjust code accordingly.
22576 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22578 2001-11-07 Ravi Pratap <ravi@ximian.com>
22580 * expression.cs (EvalConstantExpression): Move into ecore.cs
22582 * enum.cs (Enum): Rename some members and make them public and readonly
22583 according to our convention.
22585 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22588 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22590 (Enum::Emit): Write a simple version for now which doesn't try to compute
22591 expressions. I shall modify this to be more robust in just a while.
22593 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22595 (TypeContainer::CloseType): Create the Enum types too.
22597 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22599 * expression.cs (EvalConstantExpression): Get rid of completely.
22601 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22602 user-defined values and other cases.
22604 (IsValidEnumLiteral): Helper function.
22606 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22607 out there in the case we had a literal FieldExpr.
22609 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22611 (Literalize): Revamp a bit to take two arguments.
22613 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22615 2001-11-06 Ravi Pratap <ravi@ximian.com>
22617 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22619 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22621 (Resolve): Use the above to ensure we have proper initializers.
22623 2001-11-05 Ravi Pratap <ravi@ximian.com>
22625 * expression.cs (Expression::EvalConstantExpression): New method to
22626 evaluate constant expressions.
22628 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22630 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22632 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22635 (Binary.ResolveOperator): Handle operator != (object a, object b)
22636 and operator == (object a, object b);
22638 (Binary.DoNumericPromotions): Indicate whether the numeric
22639 promotion was possible.
22641 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22644 Made the ArrayAccess implement interface IAssignMethod instead of
22645 IStackStore as the order in which arguments are passed reflects
22648 * assign.cs: Instead of using expr.ExprClass to select the way of
22649 assinging, probe for the IStackStore/IAssignMethod interfaces.
22651 * typemanager.cs: Load InitializeArray definition.
22653 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22654 static data that can be used to initialize arrays.
22656 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22658 * expression.cs: Handle operator== and operator!= for booleans.
22660 (Conditioal.Reduce): Implement reducer for the ?: operator.
22662 (Conditional.Resolve): Implement dead code elimination.
22664 (Binary.Resolve): Catch string literals and return a new
22665 concatenated string.
22667 (Unary.Reduce): Implement reduction of unary expressions.
22669 * ecore.cs: Split out the expression core handling here.
22671 (Expression.Reduce): New method used to perform constant folding
22672 and CSE. This is needed to support constant-expressions.
22674 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22675 targets, and optimize for !x.
22677 2001-11-04 Ravi Pratap <ravi@ximian.com>
22679 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22680 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22681 set custom atttributes.
22683 * literal.cs (Literal::GetValue): New abstract method to return the actual
22684 value of the literal, cast as an object.
22686 (*Literal): Implement GetValue method.
22688 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22689 expressions to the arraylist but objects of type Argument.
22691 * class.cs (TypeContainer::Emit): Emit our attributes too.
22693 (Method::Emit, Constructor::Emit): Ditto.
22695 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22696 to be ignoring earlier.
22698 2001-11-03 Ravi Pratap <ravi@ximian.com>
22700 * attribute.cs (AttributeSection::Define): Implement to do the business
22701 of constructing a CustomAttributeBuilder.
22703 (Attribute): New trivial class. Increases readability of code.
22705 * cs-parser.jay : Update accordingly.
22707 (positional_argument_list, named_argument_list, named_argument): New rules
22709 (attribute_arguments): Use the above so that we are more correct.
22711 2001-11-02 Ravi Pratap <ravi@ximian.com>
22713 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22714 to perform all checks for a method with a params parameter.
22716 (Invocation::OverloadResolve): Update to use the above method and therefore
22717 cope correctly with params method invocations.
22719 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22722 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22723 constructors in our parent too because we can't afford to miss out on
22726 * attribute.cs (AttributeSection): New name for the class Attribute
22728 Other trivial changes to improve readability.
22730 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22731 use the new class names.
22733 2001-11-01 Ravi Pratap <ravi@ximian.com>
22735 * class.cs (Method::Define): Complete definition for params types too
22737 (Indexer::Define): Ditto.
22739 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22740 Cope everywhere with a request for info about the array parameter.
22742 2001-11-01 Ravi Pratap <ravi@ximian.com>
22744 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22746 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22747 local_variable_type to extract the string corresponding to the type.
22749 (local_variable_type): Fixup the action to use the new helper method.
22751 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22754 * expression.cs : Clean out code which uses the above.
22756 2001-10-31 Ravi Pratap <ravi@ximian.com>
22758 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22759 and bale out if necessary by returning a false.
22761 (RegisterProperty): Ditto.
22763 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22764 and print out appropriate error messages.
22766 * interface.cs (everywhere): Ditto.
22768 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22769 location to constructor.
22771 * class.cs (Property, Event, Indexer): Update accordingly.
22773 * ../errors/cs111.cs : Added.
22775 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22776 of a method, as laid down by the spec.
22778 (Invocation::OverloadResolve): Use the above method.
22780 2001-10-31 Ravi Pratap <ravi@ximian.com>
22782 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22783 now take a TypeContainer and a Parameters object.
22785 (ParameterData): Modify return type of ParameterModifier method to be
22786 Parameter.Modifier and not a string.
22788 (ReflectionParameters, InternalParameters): Update accordingly.
22790 * expression.cs (Argument::GetParameterModifier): Same here.
22792 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22793 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22794 symbol in it at all so maybe this is only for now.
22796 2001-10-30 Ravi Pratap <ravi@ximian.com>
22798 * support.cs (InternalParameters): Constructor now takes an extra argument
22799 which is the actual Parameters class.
22801 (ParameterDesc): Update to provide info on ref/out modifiers.
22803 * class.cs (everywhere): Update call to InternalParameters to pass in
22804 the second argument too.
22806 * support.cs (ParameterData): Add ParameterModifier, which is a method
22807 to return the modifier info [ref/out etc]
22809 (InternalParameters, ReflectionParameters): Implement the above.
22811 * expression.cs (Argument::ParameterModifier): Similar function to return
22812 info about the argument's modifiers.
22814 (Invocation::OverloadResolve): Update to take into account matching modifiers
22817 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22818 a new SetFormalParameters object which we pass to InternalParameters.
22820 2001-10-30 Ravi Pratap <ravi@ximian.com>
22822 * expression.cs (NewArray): Merge into the ArrayCreation class.
22824 2001-10-29 Ravi Pratap <ravi@ximian.com>
22826 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22827 NewUserdefinedArray into one as there wasn't much of a use in having
22830 * expression.cs (Argument): Change field's name to ArgType from Type.
22832 (Type): New readonly property which returns the proper type, taking into
22833 account ref/out modifiers.
22835 (everywhere): Adjust code accordingly for the above.
22837 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22838 whether we are emitting for a ref or out parameter.
22840 * expression.cs (Argument::Emit): Use the above field to set the state.
22842 (LocalVariableReference::Emit): Update to honour the flag and emit the
22845 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22847 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22849 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22851 (ReflectionParameters, InternalParameters): Implement the above method.
22853 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22856 (Invocation::FullMethodDesc): Ditto.
22858 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22860 * cs-parser.jay: Add extra production for the second form of array
22863 * expression.cs (ArrayCreation): Update to reflect the above
22866 * Small changes to prepare for Array initialization.
22868 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22870 * typemanager.cs (ImplementsInterface): interface might be null;
22871 Deal with this problem;
22873 Also, we do store negative hits on the cache (null values), so use
22874 this instead of calling t.GetInterfaces on the type everytime.
22876 2001-10-28 Ravi Pratap <ravi@ximian.com>
22878 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22880 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22881 split functionality out into different classes.
22883 (New::FormArrayType): Move into NewBuiltinArray.
22885 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22888 (NewBuiltinArray): New class to handle creation of built-in arrays.
22890 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22891 account creation of one-dimensional arrays.
22893 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22895 (NewUserdefinedArray::DoResolve): Implement.
22897 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22899 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22900 we maintain inside the TypeManager. This is necessary to perform lookups on the
22903 (LookupType): Update to perform GetType on the module builders too.
22905 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22907 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22909 2001-10-23 Ravi Pratap <ravi@ximian.com>
22911 * expression.cs (New::DoResolve): Implement guts of array creation.
22913 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22915 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22917 * expression.cs: Fix bug I introduced lsat night that broke
22920 (Expression.Resolve): Report a 246 error (can not resolve name)
22921 if we find a SimpleName in the stream.
22923 (Expression.ResolveLValue): Ditto.
22925 (Expression.ResolveWithSimpleName): This function is a variant of
22926 ResolveName, this one allows SimpleNames to be returned without a
22927 warning. The only consumer of SimpleNames is MemberAccess
22929 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22931 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22932 might arrive here. I have my doubts that this is correct.
22934 * statement.cs (Lock): Implement lock statement.
22936 * cs-parser.jay: Small fixes to support `lock' and `using'
22938 * cs-tokenizer.cs: Remove extra space
22940 * driver.cs: New flag --checked, allows to turn on integer math
22943 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22944 Threading.Monitor.Exit
22946 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22948 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22949 Expression Class to be IndexerAccess.
22951 Notice that Indexer::DoResolve sets the eclass to Value.
22953 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22955 * class.cs (TypeContainer::Emit): Emit code for indexers.
22957 * assign.cs (IAssignMethod): New interface implemented by Indexers
22958 and Properties for handling assignment.
22960 (Assign::Emit): Simplify and reuse code.
22962 * expression.cs (IndexerAccess, PropertyExpr): Implement
22963 IAssignMethod, clean up old code.
22965 2001-10-22 Ravi Pratap <ravi@ximian.com>
22967 * typemanager.cs (ImplementsInterface): New method to determine if a type
22968 implements a given interface. Provides a nice cache too.
22970 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22973 (ConvertReferenceExplicit): Ditto.
22975 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22976 various methods, with correct names etc.
22978 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22979 Operator.UnaryNegation.
22981 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22982 we have a unary plus or minus operator.
22984 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22987 * everywhere : update accordingly.
22989 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22992 * class.cs (Method::Define): For the case where we are implementing a method
22993 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22994 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22996 2001-10-21 Ravi Pratap <ravi@ximian.com>
22998 * interface.cs (FindMembers): Implement to work around S.R.E
23001 * typemanager.cs (IsInterfaceType): Implement.
23003 (FindMembers): Update to handle interface types too.
23005 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23006 use IsAssignableFrom as that is not correct - it doesn't work.
23008 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23009 and accordingly override EmitStatement.
23011 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23012 using the correct logic :-)
23014 2001-10-19 Ravi Pratap <ravi@ximian.com>
23016 * ../errors/cs-11.cs : Add to demonstrate error -11
23018 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23020 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23021 then pass this as a hint to ResolveLValue.
23023 * expression.cs (FieldExpr): Add Location information
23025 (FieldExpr::LValueResolve): Report assignment to readonly
23028 (Expression::ExprClassFromMemberInfo): Pass location information.
23030 (Expression::ResolveLValue): Add new method that resolves an
23033 (Expression::DoResolveLValue): Default invocation calls
23036 (Indexers): New class used to keep track of indexers in a given
23039 (IStackStore): Renamed from LValue, as it did not really describe
23040 what this did. Also ResolveLValue is gone from this interface and
23041 now is part of Expression.
23043 (ElementAccess): Depending on the element access type
23045 * typemanager.cs: Add `indexer_name_type' as a Core type
23046 (System.Runtime.CompilerServices.IndexerNameAttribute)
23048 * statement.cs (Goto): Take a location.
23050 2001-10-18 Ravi Pratap <ravi@ximian.com>
23052 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23053 if two delegates are compatible.
23055 (NewDelegate::DoResolve): Update to take care of the case when
23056 we instantiate a delegate from another delegate.
23058 * typemanager.cs (FindMembers): Don't even try to look up members
23059 of Delegate types for now.
23061 2001-10-18 Ravi Pratap <ravi@ximian.com>
23063 * delegate.cs (NewDelegate): New class to take care of delegate
23066 * expression.cs (New): Split the delegate related code out into
23067 the NewDelegate class.
23069 * delegate.cs (DelegateInvocation): New class to handle delegate
23072 * expression.cs (Invocation): Split out delegate related code into
23073 the DelegateInvocation class.
23075 2001-10-17 Ravi Pratap <ravi@ximian.com>
23077 * expression.cs (New::DoResolve): Implement delegate creation fully
23078 and according to the spec.
23080 (New::DoEmit): Update to handle delegates differently.
23082 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23083 because of which we were printing out arguments in reverse order !
23085 * delegate.cs (VerifyMethod): Implement to check if the given method
23086 matches the delegate.
23088 (FullDelegateDesc): Implement.
23090 (VerifyApplicability): Implement.
23092 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23093 delegate invocations too.
23095 (Invocation::Emit): Ditto.
23097 * ../errors/cs1593.cs : Added.
23099 * ../errors/cs1594.cs : Added.
23101 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23103 2001-10-16 Ravi Pratap <ravi@ximian.com>
23105 * typemanager.cs (intptr_type): Core type for System.IntPtr
23107 (InitCoreTypes): Update for the same.
23109 (iasyncresult_type, asynccallback_type): Ditto.
23111 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23114 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23117 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23118 the builders for the 4 members of a delegate type :-)
23120 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23123 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23125 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23127 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23129 * statement.cs (Break::Emit): Implement.
23130 (Continue::Emit): Implement.
23132 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23133 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23134 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23135 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23138 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23139 properties that track the label for the current loop (begin of the
23140 loop and end of the loop).
23142 2001-10-15 Ravi Pratap <ravi@ximian.com>
23144 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23145 use of emitting anything at all.
23147 * class.cs, rootcontext.cs : Get rid of calls to the same.
23149 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23151 (Populate): Define the constructor correctly and set the implementation
23154 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23157 (AddDelegateType): Implement.
23159 (IsDelegateType): Implement helper method.
23161 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23163 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23164 and accordingly handle it.
23166 * delegate.cs (Populate): Take TypeContainer argument.
23167 Implement bits to define the Invoke method. However, I still haven't figured out
23168 how to take care of the native int bit :-(
23170 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23171 Qualify the name of the delegate, not its return type !
23173 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23176 (StandardConversionExists): Checking for array types turns out to be recursive.
23178 (ConvertReferenceExplicit): Implement array conversion.
23180 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23182 2001-10-12 Ravi Pratap <ravi@ximian.com>
23184 * cs-parser.jay (delegate_declaration): Store the fully qualified
23185 name as it is a type declaration.
23187 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23190 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23191 as TypeContainer::DefineType.
23193 (Populate): Method in which all the definition of the various methods (Invoke)
23196 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23199 (CloseDelegate): Finally creates the delegate.
23201 * class.cs (TypeContainer::DefineType): Update to define delegates.
23202 (Populate, Emit and CloseType): Do the same thing here too.
23204 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23205 delegates in all these operations.
23207 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23209 * expression.cs: LocalTemporary: a new expression used to
23210 reference a temporary that has been created.
23212 * assign.cs: Handle PropertyAccess back here, so that we can
23213 provide the proper semantic access to properties.
23215 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23216 a few more explicit conversions.
23218 * modifiers.cs: `NEW' modifier maps to HideBySig.
23220 * expression.cs (PropertyExpr): Make this into an
23221 ExpressionStatement, and support the EmitStatement code path.
23223 Perform get/set error checking, clean up the interface.
23225 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23226 them into toplevel access objects.
23228 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23230 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23233 * typemanager.cs: Keep track here of our PropertyBuilders again to
23234 work around lameness in SRE.
23236 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23238 * expression.cs (LValue::LValueResolve): New method in the
23239 interface, used to perform a second resolution pass for LValues.
23241 (This::DoResolve): Catch the use of this in static methods.
23243 (This::LValueResolve): Implement.
23245 (This::Store): Remove warning, assigning to `this' in structures
23248 (Invocation::Emit): Deal with invocation of
23249 methods on value types. We need to pass the address to structure
23250 methods rather than the object itself. (The equivalent code to
23251 emit "this" for structures leaves the entire structure on the
23252 stack instead of a pointer to it).
23254 (ParameterReference::DoResolve): Compute the real index for the
23255 argument based on whether the method takes or not a `this' pointer
23256 (ie, the method is static).
23258 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23259 value types returned from functions when we need to invoke a
23260 method on the sturcture.
23263 2001-10-11 Ravi Pratap <ravi@ximian.com>
23265 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23266 defining the type in the Modulebuilder or Typebuilder. This is to take
23267 care of nested types which need to be defined on the TypeBuilder using
23268 DefineNestedMethod.
23270 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23271 methods in RootContext, only ported to be part of TypeContainer.
23273 (TypeContainer::GetInterfaceOrClass): Ditto.
23275 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23277 * interface.cs (Interface::DefineInterface): New method. Does exactly
23278 what RootContext.CreateInterface did earlier, only it takes care of nested types
23281 (Interface::GetInterfaces): Move from RootContext here and port.
23283 (Interface::GetInterfaceByName): Same here.
23285 * rootcontext.cs (ResolveTree): Re-write.
23287 (PopulateTypes): Re-write.
23289 * class.cs (TypeContainer::Populate): Populate nested types too.
23290 (TypeContainer::Emit): Emit nested members too.
23292 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23293 instead just use the name argument passed in as it is already fully
23296 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23297 to TypeContainer mapping to see if a type is user-defined.
23299 * class.cs (TypeContainer::CloseType): Implement.
23301 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23302 the default constructor.
23304 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23307 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23309 * interface.cs (CloseType): Create the type here.
23311 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23314 Remove all the methods which are now in TypeContainer.
23316 2001-10-10 Ravi Pratap <ravi@ximian.com>
23318 * delegate.cs (Define): Re-write bits to define the delegate
23321 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23323 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23325 * expression.cs (ImplicitReferenceConversion): handle null as well
23326 as a source to convert to any reference type.
23328 * statement.cs (Return): Perform any implicit conversions to
23329 expected return type.
23331 Validate use of return statement.
23333 * codegen.cs (EmitContext): Pass the expected return type here.
23335 * class.cs (Method, Constructor, Property): Pass expected return
23336 type to EmitContext.
23338 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23340 * expression.cs: Make DoResolve take an EmitContext instead of a
23343 Replaced `l' and `location' for `loc', for consistency.
23345 (Error, Warning): Remove unneeded Tc argument.
23347 * assign.cs, literal.cs, constant.cs: Update to new calling
23350 * codegen.cs: EmitContext now contains a flag indicating whether
23351 code is being generated in a static method or not.
23353 * cs-parser.jay: DecomposeQI, new function that replaces the old
23354 QualifiedIdentifier. Now we always decompose the assembled
23355 strings from qualified_identifier productions into a group of
23358 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23360 * rootcontext.cs: Deal with field-less struct types correctly now
23361 by passing the size option to Define Type.
23363 * class.cs: Removed hack that created one static field.
23365 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23367 * statement.cs: Moved most of the code generation here.
23369 2001-10-09 Ravi Pratap <ravi@ximian.com>
23371 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23374 (ElementAccess): Remove useless bits for now - keep checks as the spec
23377 2001-10-08 Ravi Pratap <ravi@ximian.com>
23379 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23380 and start performing checks according to the spec.
23382 2001-10-07 Ravi Pratap <ravi@ximian.com>
23384 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23385 rank_specifiers instead.
23387 (rank_specifiers): Change the order in which the rank specifiers are stored
23389 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23391 * expression.cs (ElementAccess): Implement the LValue interface too.
23393 2001-10-06 Ravi Pratap <ravi@ximian.com>
23395 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23396 except that user defined conversions are not included.
23398 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23399 perform the conversion of the return type, if necessary.
23401 (New::DoResolve): Check whether we are creating an array or an object
23402 and accordingly do the needful.
23404 (New::Emit): Same here.
23406 (New::DoResolve): Implement guts of array creation.
23408 (New::FormLookupType): Helper function.
23410 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23412 * codegen.cs: Removed most of the code generation here, and move the
23413 corresponding code generation bits to the statement classes.
23415 Added support for try/catch/finalize and throw.
23417 * cs-parser.jay: Added support for try/catch/finalize.
23419 * class.cs: Catch static methods having the flags override,
23420 virtual or abstract.
23422 * expression.cs (UserCast): This user cast was not really doing
23423 what it was supposed to do. Which is to be born in fully resolved
23424 state. Parts of the resolution were being performed at Emit time!
23428 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23430 * expression.cs: Implicity convert the result from UserCast.
23432 2001-10-05 Ravi Pratap <ravi@ximian.com>
23434 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23435 prevented it from working correctly.
23437 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23438 merely ConvertImplicit.
23440 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23442 * typemanager.cs: Make the LookupTypeContainer function static,
23443 and not per-instance.
23445 * class.cs: Make static FindMembers (the one that takes a Type
23448 * codegen.cs: Add EmitForeach here.
23450 * cs-parser.jay: Make foreach a toplevel object instead of the
23451 inline expansion, as we need to perform semantic analysis on it.
23453 2001-10-05 Ravi Pratap <ravi@ximian.com>
23455 * expression.cs (Expression::ImplicitUserConversion): Rename to
23456 UserDefinedConversion.
23458 (Expression::UserDefinedConversion): Take an extra argument specifying
23459 whether we look for explicit user conversions too.
23461 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23463 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23465 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23466 with the appropriate arguments.
23468 * cs-parser.jay (cast_expression): Record location too.
23470 * expression.cs (Cast): Record location info.
23472 (Expression::ConvertExplicit): Take location argument.
23474 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23475 to determine if we are doing explicit conversions.
23477 (UserCast::Emit): Update accordingly.
23479 (Expression::ConvertExplicit): Report an error if everything fails.
23481 * ../errors/cs0030.cs : Add.
23483 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23485 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23486 virtual and newslot bits.
23488 * class.cs (TypeContainer::RegisterRequiredImplementations):
23489 Record methods we need.
23491 (TypeContainer::MakeKey): Helper function to make keys for
23492 MethodBases, since the Methodbase key is useless.
23494 (TypeContainer::Populate): Call RegisterRequiredImplementations
23495 before defining the methods.
23497 Create a mapping for method_builders_to_methods ahead of time
23498 instead of inside a tight loop.
23500 (::RequireMethods): Accept an object as the data to set into the
23501 hashtable so we can report interface vs abstract method mismatch.
23503 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23505 * report.cs: Make all of it static.
23507 * rootcontext.cs: Drop object_type and value_type computations, as
23508 we have those in the TypeManager anyways.
23510 Drop report instance variable too, now it is a global.
23512 * driver.cs: Use try/catch on command line handling.
23514 Add --probe option to debug the error reporting system with a test
23517 * report.cs: Add support for exiting program when a probe
23518 condition is reached.
23520 2001-10-03 Ravi Pratap <ravi@ximian.com>
23522 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23523 we do a forcible conversion regardless of type, to check if
23524 ForceConversion returns a null.
23526 (Binary::error19): Use location to report error.
23528 (Unary::error23): Use location here too.
23530 * ../errors/cs0019.cs : Check in.
23532 * ../errors/cs0023.cs : Check in.
23534 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23535 case of a non-null MethodInfo object with a length of 0 !
23537 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23538 an applicable member - according to the spec :-)
23539 Also fix logic to find members in base types.
23541 (Unary::ResolveOperator): Same here.
23543 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23544 as I was getting thoroughly confused between this and error19 :-)
23546 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23547 (::FindMostEncompassedType): Implement.
23548 (::FindMostEncompassingType): Implement.
23549 (::StandardConversionExists): Implement.
23551 (UserImplicitCast): Re-vamp. We now need info about most specific
23552 source and target types so that we can do the necessary conversions.
23554 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23555 mathematical union with no duplicates.
23557 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23559 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23560 in order from base classes to child classes, so that we can in
23561 child classes look up in our parent for method names and
23562 attributes (required for handling abstract, virtual, new, override
23563 constructs: we need to instrospect our base class, and if we dont
23564 populate the classes in order, the introspection might be
23565 incorrect. For example, a method could query its parent before
23566 the parent has any methods and would determine that the parent has
23567 no abstract methods (while it could have had them)).
23569 (RootContext::CreateType): Record the order in which we define the
23572 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23574 * class.cs (TypeContainer::Populate): Also method definitions can
23575 fail now, keep track of this.
23577 (TypeContainer::FindMembers): Implement support for
23578 DeclaredOnly/noDeclaredOnly flag.
23580 (Constructor::Emit) Return the ConstructorBuilder.
23582 (Method::Emit) Return the MethodBuilder.
23583 Check for abstract or virtual methods to be public.
23585 * rootcontext.cs (RootContext::CreateType): Register all the
23586 abstract methods required for the class to be complete and the
23587 interface methods that must be implemented.
23589 * cs-parser.jay: Report error 501 (method requires body if it is
23590 not marked abstract or extern).
23592 * expression.cs (TypeOf::Emit): Implement.
23594 * typemanager.cs: runtime_handle_type, new global type.
23596 * class.cs (Property::Emit): Generate code for properties.
23598 2001-10-02 Ravi Pratap <ravi@ximian.com>
23600 * expression.cs (Unary::ResolveOperator): Find operators on base type
23601 too - we now conform exactly to the spec.
23603 (Binary::ResolveOperator): Same here.
23605 * class.cs (Operator::Define): Fix minor quirk in the tests.
23607 * ../errors/cs0215.cs : Added.
23609 * ../errors/cs0556.cs : Added.
23611 * ../errors/cs0555.cs : Added.
23613 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23615 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23616 single integer which is really efficient
23618 2001-10-01 Ravi Pratap <ravi@ximian.com>
23620 * expression.cs (Expression::ImplicitUserConversion): Use location
23621 even in the case when we are examining True operators.
23623 * class.cs (Operator::Define): Perform extensive checks to conform
23624 with the rules for operator overloading in the spec.
23626 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23627 some of the other conversions mentioned in the spec.
23629 * typemanager.cs (array_type): New static member for the System.Array built-in
23632 (cloneable_interface): For System.ICloneable interface.
23634 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23635 we start resolving the tree and populating types.
23637 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23639 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23641 * expression.cs (Expression::ExprClassFromMemberInfo,
23642 Expression::Literalize): Create literal expressions from
23643 FieldInfos which are literals.
23645 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23646 type casts, because they were wrong. The test suite in tests
23649 (ImplicitNumericConversion): ushort to ulong requires a widening
23652 Int32 constant to long requires widening cast as well.
23654 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23655 for integers because the type on the stack is not i4.
23657 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23659 * expression.cs (report118): require location argument.
23661 * parameter.cs: Do not dereference potential null value.
23663 * class.cs: Catch methods that lack the `new' keyword when
23664 overriding a name. Report warnings when `new' is used without
23665 anything being there to override.
23667 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23669 * class.cs: Only add constructor to hashtable if it is non-null
23670 (as now constructors can fail on define).
23672 (TypeManager, Class, Struct): Take location arguments.
23674 Catch field instance initialization in structs as errors.
23676 accepting_filter: a new filter for FindMembers that is static so
23677 that we dont create an instance per invocation.
23679 (Constructor::Define): Catch errors where a struct constructor is
23682 * cs-parser.jay: Pass location information for various new
23685 * delegate.cs (Delegate): take a location argument.
23687 * driver.cs: Do not call EmitCode if there were problesm in the
23688 Definition of the types, as many Builders wont be there.
23690 * decl.cs (Decl::Decl): Require a location argument.
23692 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23693 into integers, and find the most appropiate integer for it.
23695 * literal.cs: Implement ULongLiteral.
23697 * rootcontext.cs: Provide better information about the location of
23698 failure when CreateType fails.
23700 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23702 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23705 * expression.cs (Binary::CheckShiftArguments): Add missing type
23707 (Binary::ResolveOperator): Add type to the logical and and logical
23708 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23711 (Binary::DoNumericPromotions): In the case where either argument
23712 is ulong (and most signed types combined with ulong cause an
23713 error) perform implicit integer constant conversions as well.
23715 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23717 * expression.cs (UserImplicitCast): Method should always be
23719 (Invocation::BetterConversion): Simplified test for IntLiteral.
23721 (Expression::ImplicitNumericConversion): Split this routine out.
23722 Put the code that performs implicit constant integer conversions
23725 (Expression::Resolve): Become a wrapper around DoResolve so we can
23726 check eclass and type being set after resolve.
23728 (Invocation::Badness): Remove this dead function
23730 (Binary::ResolveOperator): Do not compute the expensive argumnets
23731 unless we have a union for it.
23733 (Probe::Emit): Is needs to do an isinst and then
23734 compare against null.
23736 (::CanConvert): Added Location argument. If the Location argument
23737 is null (Location.Null), then we do not report errors. This is
23738 used by the `probe' mechanism of the Explicit conversion. We do
23739 not want to generate an error for something that the user
23740 explicitly requested to be casted. But the pipeline for an
23741 explicit cast first tests for potential implicit casts.
23743 So for now, if the Location is null, it means `Probe only' to
23744 avoid adding another argument. Might have to revise this
23747 (ClassCast): New class used to type cast objects into arbitrary
23748 classes (used in Explicit Reference Conversions).
23750 Implement `as' as well.
23752 Reverted all the patches from Ravi below: they were broken:
23754 * The use of `level' as a mechanism to stop recursive
23755 invocations is wrong. That was there just to catch the
23756 bug with a strack trace but not as a way of addressing
23759 To fix the problem we have to *understand* what is going
23760 on and the interactions and come up with a plan, not
23761 just get things going.
23763 * The use of the type conversion cache that I proposed
23764 last night had an open topic: How does this work across
23765 protection domains. A user defined conversion might not
23766 be public in the location where we are applying the
23767 conversion, a different conversion might be selected
23768 (ie, private A->B (better) but public B->A (worse),
23769 inside A, A->B applies, but outside it, B->A will
23772 * On top of that (ie, even if the above is solved),
23773 conversions in a cache need to be abstract. Ie, `To
23774 convert from an Int to a Short use an OpcodeCast', not
23775 `To convert from an Int to a Short use the OpcodeCast on
23776 the variable 5' (which is what this patch was doing).
23778 2001-09-28 Ravi Pratap <ravi@ximian.com>
23780 * expression.cs (Invocation::ConversionExists): Re-write to use
23781 the conversion cache
23783 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23784 cache all conversions done, not just user-defined ones.
23786 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23787 to determine if a conversion exists instead of acutually trying to
23788 perform the conversion. It's faster too.
23790 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23791 and only then attempt the implicit conversion.
23793 2001-09-28 Ravi Pratap <ravi@ximian.com>
23795 * expression.cs (ConvertImplicit): Use a cache for conversions
23796 already found. Check level of recursion and bail out if necessary.
23798 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23800 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23801 Export standard methods that we expect for string operations.
23803 * statement.cs (Block::UsageWarning): Track usage of variables and
23804 report the errors for not used variables.
23806 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23809 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23811 * codegen.cs: remove unnneded code
23813 * expression.cs: Removed BuiltinTypeAccess class
23815 Fix the order in which implicit conversions are
23818 The previous fixed dropped support for boxed conversions (adding a
23819 test to the test suite now)
23821 (UserImplicitCast::CanConvert): Remove test for source being null,
23822 that code is broken. We should not feed a null to begin with, if
23823 we do, then we should track the bug where the problem originates
23824 and not try to cover it up here.
23826 Return a resolved expression of type UserImplicitCast on success
23827 rather than true/false. Ravi: this is what I was talking about,
23828 the pattern is to use a static method as a "constructor" for
23831 Also, do not create arguments until the very last minute,
23832 otherwise we always create the arguments even for lookups that
23833 will never be performed.
23835 (UserImplicitCast::Resolve): Eliminate, objects of type
23836 UserImplicitCast are born in a fully resolved state.
23838 * typemanager.cs (InitCoreTypes): Init also value_type
23839 (System.ValueType).
23841 * expression.cs (Cast::Resolve): First resolve the child expression.
23843 (LValue): Add new method AddressOf to be used by
23846 Change the argument of Store to take an EmitContext instead of an
23847 ILGenerator, because things like FieldExpr need to be able to call
23848 their children expression to generate the instance code.
23850 (Expression::Error, Expression::Warning): Sugar functions for
23853 (Expression::MemberLookup): Accept a TypeContainer instead of a
23854 Report as the first argument.
23856 (Expression::ResolvePrimary): Killed. I still want to improve
23857 this as currently the code is just not right.
23859 (Expression::ResolveMemberAccess): Simplify, but it is still
23862 (Unary::Resolve): Catch errors in AddressOf operators.
23864 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23865 index to a byte for the short-version, or the compiler will choose
23866 the wrong Emit call, which generates the wrong data.
23868 (ParameterReference::Emit, ::Store): same.
23870 (FieldExpr::AddressOf): Implement.
23872 * typemanager.cs: TypeManager: made public variable instead of
23875 * driver.cs: document --fatal.
23877 * report.cs (ErrorMessage, WarningMessage): new names for the old
23878 Error and Warning classes.
23880 * cs-parser.jay (member_access): Turn built-in access to types
23881 into a normal simplename
23883 2001-09-27 Ravi Pratap <ravi@ximian.com>
23885 * expression.cs (Invocation::BetterConversion): Fix to cope
23886 with q being null, since this was introducing a bug.
23888 * expression.cs (ConvertImplicit): Do built-in conversions first.
23890 2001-09-27 Ravi Pratap <ravi@ximian.com>
23892 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23894 2001-09-27 Ravi Pratap <ravi@ximian.com>
23896 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23897 I had introduced long ago (what's new ?).
23899 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23900 the work of all the checking.
23901 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23902 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23904 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23905 that is the right way.
23907 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23908 overloading resolution. Use everywhere instead of cutting and pasting code.
23910 (Binary::ResolveOperator): Use MakeUnionSet.
23912 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23913 we have to convert to bool types. Not complete yet.
23915 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23917 * typemanager.cs (TypeManager::CSharpName): support ushort.
23919 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23920 to provide an expression that performsn an implicit constant int
23921 conversion (section 6.1.6).
23922 (Expression::ConvertImplicitRequired): Reworked to include
23923 implicit constant expression conversions.
23925 (Expression::ConvertNumericExplicit): Finished.
23927 (Invocation::Emit): If InstanceExpression is null, then it means
23928 that we perform a call on this.
23930 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23932 * expression.cs (Unary::Emit): Remove some dead code.
23933 (Probe): Implement Resolve and Emit for `is'.
23934 (Expression::ConvertImplicitRequired): Attempt to do constant
23935 expression conversions here. Maybe should be moved to
23936 ConvertImplicit, but I am not sure.
23937 (Expression::ImplicitLongConstantConversionPossible,
23938 Expression::ImplicitIntConstantConversionPossible): New functions
23939 that tell whether is it possible to apply an implicit constant
23940 expression conversion.
23942 (ConvertNumericExplicit): Started work on explicit numeric
23945 * cs-parser.jay: Update operator constants.
23947 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23948 (Parameters::GetSignature): Hook up VerifyArgs here.
23949 (Parameters::VerifyArgs): Verifies that no two arguments have the
23952 * class.cs (Operator): Update the operator names to reflect the
23953 ones that the spec expects (as we are just stringizing the
23956 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23957 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23958 previous usage did only work for our methods.
23959 (Expression::ConvertImplicit): Handle decimal implicit numeric
23960 conversions as well.
23961 (Expression::InternalTypeConstructor): Used to invoke constructors
23962 on internal types for default promotions.
23964 (Unary::Emit): Implement special handling for the pre/post
23965 increment/decrement for overloaded operators, as they need to have
23966 the same semantics as the other operators.
23968 (Binary::ResolveOperator): ditto.
23969 (Invocation::ConversionExists): ditto.
23970 (UserImplicitCast::Resolve): ditto.
23972 2001-09-26 Ravi Pratap <ravi@ximian.com>
23974 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23975 operator, return after emitting body. Regression tests pass again !
23977 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23978 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23979 (Invocation::OverloadResolve): Ditto.
23980 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23982 * everywhere : update calls to the above methods accordingly.
23984 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23986 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23988 * expression.cs (ExpressionStatement): New base class used for
23989 expressions that can appear in statements, so that we can provide
23990 an alternate path to generate expression that do not leave a value
23993 (Expression::Emit, and all the derivatives): We no longer return
23994 whether a value is left on the stack or not. Every expression
23995 after being emitted leaves a single value on the stack.
23997 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23998 facilties of ExpressionStatement if possible.
24000 * cs-parser.jay: Update statement_expression.
24002 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24004 * driver.cs: Change the wording of message
24006 2001-09-25 Ravi Pratap <ravi@ximian.com>
24008 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24009 the type of the expression to the return type of the method if
24010 we have an overloaded operator match ! The regression tests pass again !
24011 (Unary::ResolveOperator): Ditto.
24013 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24014 to find "op_Implicit", not "implicit" ;-)
24015 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24016 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24018 * everywhere : Correct calls to the above accordingly.
24020 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24021 (ConvertImplicit): Do user-defined conversion if it exists.
24023 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24025 * assign.cs: track location.
24026 (Resolve): Use implicit conversions on assignment.
24028 * literal.cs: Oops. Not good, Emit of short access values should
24029 pass (Bytes) or the wrong argument will be selected.
24031 * expression.cs (Unary::Emit): Emit code for -expr.
24033 (Unary::ResolveOperator): Handle `Substract' for non-constants
24034 (substract from zero from the non-constants).
24035 Deal with Doubles as well.
24037 (Expression::ConvertImplicitRequired): New routine that reports an
24038 error if no implicit conversion exists.
24040 (Invocation::OverloadResolve): Store the converted implicit
24041 expressions if we make them
24043 2001-09-24 Ravi Pratap <ravi@ximian.com>
24045 * class.cs (ConstructorInitializer): Take a Location argument.
24046 (ConstructorBaseInitializer): Same here.
24047 (ConstructorThisInitializer): Same here.
24049 * cs-parser.jay : Update all calls accordingly.
24051 * expression.cs (Unary, Binary, New): Take location argument.
24052 Update accordingly everywhere.
24054 * cs-parser.jay : Update all calls to the above to take a location
24057 * class.cs : Ditto.
24059 2001-09-24 Ravi Pratap <ravi@ximian.com>
24061 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24062 (Invocation::BetterConversion): Same here
24063 (Invocation::ConversionExists): Ditto.
24065 (Invocation::ConversionExists): Implement.
24067 2001-09-22 Ravi Pratap <ravi@ximian.com>
24069 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24070 Also take an additional TypeContainer argument.
24072 * All over : Pass in TypeContainer as argument to OverloadResolve.
24074 * typemanager.cs (CSharpName): Update to check for the string type and return
24077 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24080 2001-09-21 Ravi Pratap <ravi@ximian.com>
24082 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24083 (Invocation::BetterFunction): Implement.
24084 (Invocation::BetterConversion): Implement.
24085 (Invocation::ConversionExists): Skeleton, no implementation yet.
24087 Okay, things work fine !
24089 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24091 * typemanager.cs: declare and load enum_type, delegate_type and
24094 * expression.cs (Expression::Emit): Now emit returns a value that
24095 tells whether a value is left on the stack or not. This strategy
24096 might be reveted tomorrow with a mechanism that would address
24097 multiple assignments.
24098 (Expression::report118): Utility routine to report mismatches on
24101 (Unary::Report23): Report impossible type/operator combination
24104 (Unary::IsIncrementableNumber): Whether the type can be
24105 incremented or decremented with add.
24106 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24108 (Unary::ResolveOperator): Implement ++, !, ~,
24110 (Invocation::Emit): Deal with new Emit convetion.
24112 * All Expression derivatives: Updated their Emit method to return
24113 whether they leave values on the stack or not.
24115 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24116 stack for expressions that are statements.
24118 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24120 * expression.cs (LValue): New interface. Must be implemented by
24122 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24125 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24126 interface for generating code, simplifies the code.
24128 2001-09-20 Ravi Pratap <ravi@ximian.com>
24130 * expression.cs (everywhere): Comment out return statements in ::Resolve
24131 methods to avoid the warnings.
24133 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24135 * driver.cs (parse): Report error 2001 if we can not open the
24138 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24141 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24144 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24145 otherwise nested blocks end up with the same index.
24147 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24149 * expression.cs: Instead of having FIXMEs in the Resolve
24150 functions, throw exceptions so it is obvious that we are facing a
24153 * cs-parser.jay (invocation_expression): Pass Location information.
24155 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24156 Use a basename for those routines because .NET does not like paths
24159 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24162 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24164 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24165 are loading the correct data types (throws an exception if not).
24166 (TypeManager::InitCoreTypes): Use CoreLookupType
24168 * expression.cs (Unary::ResolveOperator): return the child
24169 expression for expressions which are just +expr.
24170 (Unary::ResolveOperator): Return negative literals for -LITERAL
24171 expressions (otherwise they are Unary {Literal}).
24172 (Invocation::Badness): Take into account `Implicit constant
24173 expression conversions'.
24175 * literal.cs (LongLiteral): Implement long literal class.
24176 (IntLiteral): export the `Value' of the intliteral.
24178 2001-09-19 Ravi Pratap <ravi@ximian.com>
24180 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24182 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24183 instead of 'Operator'
24185 * expression.cs (Binary::ResolveOperator): Update accordingly.
24186 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24189 * cs-parser.jay (unary_expression): Update to use the new names.
24191 * gen-treedump.cs (GetUnary): Same here.
24193 * expression.cs (Unary::Resolve): Implement.
24194 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24195 operators are found instead of making noise ;-)
24196 (Unary::ResolveOperator): New method to do precisely the same thing which
24197 Binary::ResolveOperator does for Binary expressions.
24198 (Unary.method, .Arguments): Add.
24199 (Unary::OperName): Implement.
24200 (Unary::ForceConversion): Copy and Paste !
24202 * class.cs (Operator::Define): Fix a small bug for the case when we have
24205 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24206 for the inbuilt operators. Only overloading works for now ;-)
24208 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24210 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24211 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24213 * expression.cs (This::Emit): Implement.
24214 (This::Resolve): Implement.
24215 (TypeOf:Resolve): Implement.
24216 (Expression::ResolveSimpleName): Add an implicit this to instance
24218 (MemberAccess::Resolve): Deal with Parameters and Fields.
24219 Bind instance variable to Field expressions.
24220 (FieldExpr::Instance): New field used to track the expression that
24221 represents the object instance.
24222 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24224 (FieldExpr::Emit): Implement.
24226 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24227 the last instruction contains a return opcode to avoid generating
24228 the last `ret' instruction (this generates correct code, and it is
24229 nice to pass the peverify output).
24231 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24232 initializer for static and instance variables.
24233 (Constructor::Emit): Allow initializer to be null in the case of
24234 static constructors. Only emit initializer for instance
24237 (TypeContainer::FindMembers): Return a null array if there are no
24240 Also fix the code for the MemberTypes.Method branch, as it was not
24241 scanning that for operators (or tried to access null variables before).
24243 * assign.cs (Assign::Emit): Handle instance and static fields.
24247 * driver.cs: Stop compilation if there are parse errors.
24249 * cs-parser.jay (constructor_declaration): Provide default base
24250 initializer for non-static constructors.
24251 (constructor_declarator): Do not provide a default base
24252 initializers if none was specified.
24253 Catch the fact that constructors should not have parameters.
24255 * class.cs: Do not emit parent class initializers for static
24256 constructors, that should be flagged as an error.
24258 2001-09-18 Ravi Pratap <ravi@ximian.com>
24260 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24261 Move back code into TypeContainer::Populate.
24263 2001-09-18 Ravi Pratap <ravi@ximian.com>
24265 * class.cs (TypeContainer::AddConstructor): Fix the check to
24266 compare against Name, not Basename.
24267 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24269 * cs-parser.jay : Update accordingly.
24271 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24272 for methods, don't forget to look into the operators too.
24273 (RegisterMethodBuilder): Helper method to take care of this for
24274 methods, constructors and operators.
24275 (Operator::Define): Completely revamp.
24276 (Operator.OperatorMethod, MethodName): New fields.
24277 (TypeContainer::Populate): Move the registering of builders into
24278 RegisterMethodBuilder.
24279 (Operator::Emit): Re-write.
24281 * expression.cs (Binary::Emit): Comment out code path to emit method
24282 invocation stuff for the case when we have a user defined operator. I am
24283 just not able to get it right !
24285 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24287 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24290 (Expression::MemberLookup): Provide a version that allows to
24291 specify the MemberTypes and BindingFlags.
24293 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24294 so it was not fetching variable information from outer blocks.
24296 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24297 Beforefieldinit as it was buggy.
24299 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24300 that Ravi put here.
24302 * class.cs (Constructor::Emit): Only emit if block is not null.
24303 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24304 deal with this by semantically definining it as if the user had
24307 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24308 constructors as we now "emit" them at a higher level.
24310 (TypeContainer::DefineDefaultConstructor): Used to define the
24311 default constructors if none was provided.
24313 (ConstructorInitializer): Add methods Resolve and Emit.
24315 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24317 2001-09-17 Ravi Pratap <ravi@ximian.com>
24319 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24320 the default constructor builder with our hashtable for methodbuilders
24323 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24324 and argument_count is 0 in which case we have a match.
24325 (Binary::ResolveOperator): More null checking and miscellaneous coding
24328 2001-09-17 Ravi Pratap <ravi@ximian.com>
24330 * rootcontext.cs (IsNameSpace): Compare against null.
24332 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24334 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24335 and Unary::Operator.
24337 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24340 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24341 we have overloaded operators.
24342 (Binary::ResolveOperator): Implement the part which does the operator overload
24345 * class.cs (Operator::Emit): Implement.
24346 (TypeContainer::Emit): Emit the operators we have too.
24348 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24349 the case when we have a user-defined operator.
24351 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24353 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24355 2001-09-16 Ravi Pratap <ravi@ximian.com>
24357 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24358 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24359 (Constructor::Emit): Implement.
24360 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24361 if we have no work to do.
24362 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24365 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24366 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24368 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24371 2001-09-15 Ravi Pratap <ravi@ximian.com>
24373 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24375 (Tree::RecordNamespace): Method to do what the name says ;-)
24376 (Tree::Namespaces): Property to get at the namespaces hashtable.
24378 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24381 * rootcontext.cs (IsNamespace): Fixed it :-)
24383 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24385 * class.cs (TypeContainer::FindMembers): Add support for
24387 (MethodCore): New class that encapsulates both the shared aspects
24388 of a Constructor and a Method.
24389 (Method, Constructor): Factored pieces into MethodCore.
24391 * driver.cs: Added --fatal which makes errors throw exceptions.
24392 Load System assembly as well as part of the standard library.
24394 * report.cs: Allow throwing exceptions on errors for debugging.
24396 * modifiers.cs: Do not use `parent', instead use the real type
24397 container to evaluate permission settings.
24399 * class.cs: Put Ravi's patch back in. He is right, and we will
24400 have to cope with the
24402 2001-09-14 Ravi Pratap <ravi@ximian.com>
24404 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24405 FamORAssem, not FamANDAssem.
24407 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24409 * driver.cs: Added --parse option that only parses its input files
24412 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24413 incorrect. IsTopLevel is not used to tell whether an object is
24414 root_types or not (that can be achieved by testing this ==
24415 root_types). But to see if this is a top-level *class* (not
24416 necessarly our "toplevel" container).
24418 2001-09-14 Ravi Pratap <ravi@ximian.com>
24420 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24421 parent instead of a direct call to GetType.
24423 2001-09-14 Ravi Pratap <ravi@ximian.com>
24425 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24426 Modifiers.TypeAttr. This should just be a call to that method.
24428 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24429 object so that we can determine if we are top-level or not.
24431 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24434 * enum.cs (Enum::Define): Ditto.
24436 * modifiers.cs (FieldAttr): Re-write.
24438 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24439 (TypeContainer::HaveStaticConstructor): New property to provide access
24440 to precisely that info.
24442 * modifiers.cs (MethodAttr): Re-write.
24443 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24445 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24446 of top-level types as claimed.
24448 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24450 * expression.cs (MemberLookup): Fruitless attempt to lookup
24451 constructors. Maybe I need to emit default constructors? That
24452 might be it (currently .NET emits this for me automatically).
24453 (Invocation::OverloadResolve): Cope with Arguments == null.
24454 (Invocation::EmitArguments): new function, shared by the new
24455 constructor and us.
24456 (Invocation::Emit): Handle static and instance methods. Emit
24457 proper call instruction for virtual or non-virtual invocations.
24458 (New::Emit): Implement.
24459 (New::Resolve): Implement.
24460 (MemberAccess:Resolve): Implement.
24461 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24462 to track instances.
24463 (FieldExpr::Resolve): Set type.
24465 * support.cs: Handle empty arguments.
24467 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24468 SimpleLookup): Auxiliary routines to help parse a qualifier
24471 Update qualifier_identifier rule.
24473 * codegen.cs: Removed debugging messages.
24475 * class.cs: Make this a global thing, this acts just as a "key" to
24476 objects that we might have around.
24478 (Populate): Only initialize method_builders_to_methods once.
24480 * expression.cs (PropertyExpr): Initialize type from the
24483 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24484 Resolve pattern. Attempt to implicitly convert value to boolean.
24487 * expression.cs: Set the type for the int32/int32 argument case.
24488 (Binary::ResolveOperator): Set the return type to boolean for
24489 comparission operators
24491 * typemanager.cs: Remove debugging print code.
24493 (Invocation::Resolve): resolve type.
24495 * class.cs: Allocate a MemberInfo of the correct size, as the code
24496 elsewhere depends on the test to reflect the correct contents.
24498 (Method::) Keep track of parameters, due to System.Reflection holes
24500 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24503 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24504 of the exact size and return that.
24506 (Class::LookupMethodByBuilder): New function that maps
24507 MethodBuilders to its methods. Required to locate the information
24508 on methods because System.Reflection bit us again.
24510 * support.cs: New file, contains an interface ParameterData and
24511 two implementations: ReflectionParameters and InternalParameters
24512 used to access Parameter information. We will need to grow this
24515 * expression.cs (Invocation::GetParameterData): implement a cache
24516 and a wrapper around the ParameterData creation for methods.
24517 (Invocation::OverloadResolve): Use new code.
24519 2001-09-13 Ravi Pratap <ravi@ximian.com>
24521 * class.cs (TypeContainer::EmitField): Remove and move into
24522 (Field::Define): here and modify accordingly.
24523 (Field.FieldBuilder): New member.
24524 (TypeContainer::Populate): Update accordingly.
24525 (TypeContainer::FindMembers): Implement.
24527 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24529 * statement.cs: (VariableInfo::VariableType): New field to be
24530 initialized with the full type once it is resolved.
24532 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24534 * parameter.cs (GetParameterInfo): Use a type cache to compute
24535 things only once, and to reuse this information
24537 * expression.cs (LocalVariableReference::Emit): Implement.
24538 (OpcodeCast::Emit): fix.
24540 (ParameterReference::Resolve): Implement.
24541 (ParameterReference::Emit): Implement.
24543 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24544 that are expressions need to stay as Expressions.
24546 * typemanager.cs (CSharpName): Returns the C# name of a type if
24549 * expression.cs (Expression::ConvertImplicit): New function that
24550 implements implicit type conversions.
24552 (Expression::ImplicitReferenceConversion): Implements implicit
24553 reference conversions.
24555 (EmptyCast): New type for transparent casts.
24557 (OpcodeCast): New type for casts of types that are performed with
24558 a sequence of bytecodes.
24560 (BoxedCast): New type used for casting value types into reference
24561 types. Emits a box opcode.
24563 (Binary::DoNumericPromotions): Implements numeric promotions of
24564 and computation of the Binary::Type.
24566 (Binary::EmitBranchable): Optimization.
24568 (Binary::Emit): Implement code emission for expressions.
24570 * typemanager.cs (TypeManager): Added two new core types: sbyte
24573 2001-09-12 Ravi Pratap <ravi@ximian.com>
24575 * class.cs (TypeContainer::FindMembers): Method which does exactly
24576 what Type.FindMembers does, only we don't have to use reflection. No
24577 implementation yet.
24579 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24580 typecontainer objects as we need to get at them.
24581 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24583 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24584 typecontainer object.
24586 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24587 of just a Report object.
24589 2001-09-11 Ravi Pratap <ravi@ximian.com>
24591 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24593 (TypeContainer::Populate): Now define the delegates of the type too.
24594 (TypeContainer.Delegates): Property to access the list of delegates defined
24597 * delegates.cs (Delegate::Define): Implement partially.
24599 * modifiers.cs (TypeAttr): Handle more flags.
24601 2001-09-11 Ravi Pratap <ravi@ximian.com>
24603 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24605 (Operator::Define): Re-write logic to get types by using the LookupType method
24606 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24607 (Indexer::Define): Ditto.
24608 (Event::Define): Ditto.
24609 (Property::Define): Ditto.
24611 2001-09-10 Ravi Pratap <ravi@ximian.com>
24613 * class.cs (TypeContainer::Populate): Now define operators too.
24614 (TypeContainer.Operators): New property to access the list of operators
24616 (Operator.OperatorMethodBuilder): New member to hold the method builder
24617 for the operator we are defining.
24618 (Operator::Define): Implement.
24620 2001-09-10 Ravi Pratap <ravi@ximian.com>
24622 * class.cs (Event::Define): Make the prefixes of the accessor methods
24623 addOn_ and removeOn_
24625 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24626 of the location being passed in too. Ideally, this should go later since all
24627 error reporting should be done through the Report object.
24629 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24630 (Populate): Iterate thru the indexers we have and define them too.
24631 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24632 for the get and set accessors.
24633 (Indexer::Define): Implement.
24635 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24637 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24638 my previous implementation, did not work.
24640 * typemanager.cs: Add a couple of missing types (the longs).
24642 * literal.cs: Use TypeManager.bool_type instead of getting it.
24644 * expression.cs (EventExpr): New kind of expressions.
24645 (Expressio::ExprClassFromMemberInfo): finish
24647 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24649 * assign.cs: Emit stores to static fields differently.
24651 2001-09-08 Ravi Pratap <ravi@ximian.com>
24653 * Merge in changes and adjust code to tackle conflicts. Backed out my
24654 code in Assign::Resolve ;-)
24656 2001-09-08 Ravi Pratap <ravi@ximian.com>
24658 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24659 instead Report.Error and also pass in the location.
24660 (CSharpParser::Lexer): New readonly property to return the reference
24661 to the Tokenizer object.
24662 (declare_local_variables): Use Report.Error with location instead of plain
24666 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24667 (Operator.CheckBinaryOperator): Ditto.
24669 * cs-parser.jay (operator_declarator): Update accordingly.
24671 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24672 (CheckBinaryOperator): Same here.
24674 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24675 on the name without any prefixes of namespace names etc. This is because we
24676 already might have something already fully qualified like
24677 'System.Console.WriteLine'
24679 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24681 2001-09-07 Ravi Pratap <ravi@ximian.com>
24683 * cs-tokenizer.cs (location): Return a string which also contains
24686 * expression.cs (ElementAccess): New class for expressions of the
24687 type 'element access.'
24688 (BaseAccess): New class for expressions of the type 'base access.'
24689 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24692 * cs-parser.jay (element_access): Implement action.
24693 (base_access): Implement actions.
24694 (checked_expression, unchecked_expression): Implement.
24696 * cs-parser.jay (local_variable_type): Correct and implement.
24697 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24699 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24701 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24702 name and the specifiers.
24704 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24706 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24707 making them all public ;-)
24709 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24712 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24714 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24716 (FieldExpr, PropertyExprs): New resolved expressions.
24717 (SimpleName::MemberStaticCheck): Perform static checks for access
24718 to non-static fields on static methods. Maybe this should be
24719 generalized for MemberAccesses.
24720 (SimpleName::ResolveSimpleName): More work on simple name
24723 * cs-parser.jay (primary_expression/qualified_identifier): track
24724 the parameter index.
24726 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24727 (EmitContext::EmitBoolExpression): Chain to expression generation
24728 instead of temporary hack.
24729 (::EmitStatementExpression): Put generic expression code generation.
24731 * assign.cs (Assign::Emit): Implement variable assignments to
24732 local variables, parameters and fields.
24734 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24736 * statement.cs (Block::GetVariableInfo): New method, returns the
24737 VariableInfo for a variable name in a block.
24738 (Block::GetVariableType): Implement in terms of GetVariableInfo
24740 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24741 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24743 2001-09-06 Ravi Pratap <ravi@ximian.com>
24745 * cs-parser.jay (operator_declaration): Continue on my quest : update
24746 to take attributes argument.
24747 (event_declaration): Ditto.
24748 (enum_declaration): Ditto.
24749 (indexer_declaration): Ditto.
24751 * class.cs (Operator::Operator): Update constructor accordingly.
24752 (Event::Event): Ditto.
24754 * delegate.cs (Delegate::Delegate): Same here.
24756 * enum.cs (Enum::Enum): Same here.
24758 2001-09-05 Ravi Pratap <ravi@ximian.com>
24760 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24762 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24764 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24765 being passed around as an arraylist.
24766 (Attributes::AddAttribute): Method to add attribute sections.
24768 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24769 (struct_declaration): Update accordingly.
24770 (constant_declaration): Update.
24771 (field_declaration): Update.
24772 (method_header): Update.
24773 (fixed_parameter): Update.
24774 (parameter_array): Ditto.
24775 (property_declaration): Ditto.
24776 (destructor_declaration): Ditto.
24778 * class.cs (Struct::Struct): Update constructors accordingly.
24779 (Class::Class): Ditto.
24780 (Field::Field): Ditto.
24781 (Method::Method): Ditto.
24782 (Property::Property): Ditto.
24783 (TypeContainer::OptAttribute): update property's return type.
24785 * interface.cs (Interface.opt_attributes): New member.
24786 (Interface::Interface): Update to take the extra Attributes argument.
24788 * parameter.cs (Parameter::Parameter): Ditto.
24790 * constant.cs (Constant::Constant): Ditto.
24792 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24793 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24794 the attributes as a parameter.
24795 (InterfaceProperty): Update constructor call.
24796 (InterfaceEvent): Ditto.
24797 (InterfaceMethod): Ditto.
24798 (InterfaceIndexer): Ditto.
24800 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24801 pass the attributes too.
24802 (interface_event_declaration): Ditto.
24803 (interface_property_declaration): Ditto.
24804 (interface_method_declaration): Ditto.
24805 (interface_declaration): Ditto.
24807 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24809 * class.cs (Method::Define): Track the "static Main" definition to
24810 create an entry point.
24812 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24813 EntryPoint if we find it.
24815 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24816 (EmitContext::ig): Make this variable public.
24818 * driver.cs: Make the default output file be the first file name
24819 with the .exe extension.
24821 Detect empty compilations
24823 Handle various kinds of output targets. Handle --target and
24824 rename -t to --dumper.
24826 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24827 methods inherited from Expression return now an Expression. This
24828 will is used during the tree rewriting as we resolve them during
24831 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24832 the spec. Missing entirely is the information about
24833 accessability of elements of it.
24835 (Expression::ExprClassFromMemberInfo): New constructor for
24836 Expressions that creates a fully initialized Expression based on
24837 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24840 (Invocation::Resolve): Begin implementing resolution of invocations.
24842 * literal.cs (StringLiteral): Implement Emit.
24844 2001-09-05 Ravi Pratap <ravi@ximian.com>
24846 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24849 2001-09-04 Ravi Pratap <ravi@ximian.com>
24851 * cs-parser.jay (attribute_arguments): Implement actions.
24852 (attribute): Fix bug in production. Implement action.
24853 (attribute_list): Implement.
24854 (attribute_target): Implement.
24855 (attribute_target_specifier, opt_target_specifier): Implement
24856 (CheckAttributeTarget): New method to check if the attribute target
24858 (attribute_section): Implement.
24859 (opt_attributes): Implement.
24861 * attribute.cs : New file to handle attributes.
24862 (Attribute): Class to hold attribute info.
24864 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24865 (attribute_section): Modify production to use 2 different rules to
24866 achieve the same thing. 1 s/r conflict down !
24867 Clean out commented, useless, non-reducing dimension_separator rules.
24869 * class.cs (TypeContainer.attributes): New member to hold list
24870 of attributes for a type.
24871 (Struct::Struct): Modify to take one more argument, the attribute list.
24872 (Class::Class): Ditto.
24873 (Field::Field): Ditto.
24874 (Method::Method): Ditto.
24875 (Property::Property): Ditto.
24877 * cs-parser.jay (struct_declaration): Update constructor call to
24878 pass in the attributes too.
24879 (class_declaration): Ditto.
24880 (constant_declaration): Ditto.
24881 (field_declaration): Ditto.
24882 (method_header): Ditto.
24883 (fixed_parameter): Ditto.
24884 (parameter_array): Ditto.
24885 (property_declaration): Ditto.
24887 * constant.cs (Constant::Constant): Update constructor similarly.
24888 Use System.Collections.
24890 * parameter.cs (Parameter::Parameter): Update as above.
24892 2001-09-02 Ravi Pratap <ravi@ximian.com>
24894 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24895 (TypeContainer.delegates): New member to hold list of delegates.
24897 * cs-parser.jay (delegate_declaration): Implement the action correctly
24898 this time as I seem to be on crack ;-)
24900 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24902 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24903 tell whether an identifier represents a namespace.
24905 * expression.cs (NamespaceExpr): A namespace expression, used only
24906 temporarly during expression resolution.
24907 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24908 utility functions to resolve names on expressions.
24910 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24912 * codegen.cs: Add hook for StatementExpressions.
24914 * class.cs: Fix inverted test for static flag in methods.
24916 2001-09-02 Ravi Pratap <ravi@ximian.com>
24918 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24919 to make it coincide with MS' number.
24920 (Operator::CheckBinaryOperator): Ditto.
24922 * ../errors/errors.txt : Remove error numbers added earlier.
24924 * ../errors/cs1019.cs : Test case for error # 1019
24926 * ../errros/cs1020.cs : Test case for error # 1020
24928 * cs-parser.jay : Clean out commented cruft.
24929 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24930 used anywhere - non-reducing rule.
24931 (namespace_declarations): Non-reducing rule - comment out.
24933 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24934 with TypeContainer::AddEnum.
24936 * delegate.cs : New file for delegate handling classes.
24937 (Delegate): Class for declaring delegates.
24939 * makefile : Update.
24941 * cs-parser.jay (delegate_declaration): Implement.
24943 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24945 * class.cs (Event::Define): Implement.
24946 (Event.EventBuilder): New member.
24948 * class.cs (TypeContainer::Populate): Update to define all enums and events
24950 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24951 readonly fields for all these cases ?
24953 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24955 * class.cs (Property): Revamp to use the convention of making fields readonly.
24956 Accordingly modify code elsewhere.
24958 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24959 the Define method of the Property class.
24961 * class.cs : Clean up applied patch and update references to variables etc. Fix
24963 (TypeContainer::Populate): Update to define all the properties we have. Also
24964 define all enumerations.
24966 * enum.cs (Define): Implement.
24968 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24970 * cs-parser.jay (overloadable_operator): The semantic value is an
24971 enum of the Operator class.
24972 (operator_declarator): Implement actions.
24973 (operator_declaration): Implement.
24975 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24976 validity of definitions.
24977 (Operator::CheckBinaryOperator): Static method to check for binary operators
24978 (TypeContainer::AddOperator): New method to add an operator to a type.
24980 * cs-parser.jay (indexer_declaration): Added line to actually call the
24981 AddIndexer method so it gets added ;-)
24983 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24984 already taken care of by the MS compiler ?
24986 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24988 * class.cs (Operator): New class for operator declarations.
24989 (Operator::OpType): Enum for the various operators.
24991 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24993 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24994 ostensibly handle this in semantic analysis.
24996 * cs-parser.jay (general_catch_clause): Comment out
24997 (specific_catch_clauses, specific_catch_clause): Ditto.
24998 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24999 (catch_args, opt_catch_args): New productions.
25000 (catch_clause): Rewrite to use the new productions above
25001 (catch_clauses): Modify accordingly.
25002 (opt_catch_clauses): New production to use in try_statement
25003 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25004 and re-write the code in the actions to extract the specific and
25005 general catch clauses by being a little smart ;-)
25007 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25008 Hooray, try and catch statements parse fine !
25010 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25012 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25013 string from the hashtable of variables.
25015 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25016 I end up making that mistake ;-)
25017 (catch_clauses): Fixed gross error which made Key and Value of the
25018 DictionaryEntry the same : $1 !!
25020 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25022 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25024 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25025 when the add and remove accessors are specified.
25027 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25029 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25030 information about indexer_declarator.
25031 (indexer_declarator): Implement actions.
25032 (parsing_indexer): New local boolean used to keep track of whether
25033 we are parsing indexers or properties. This is necessary because
25034 implicit_parameters come into picture even for the get accessor in the
25035 case of an indexer.
25036 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25038 * class.cs (Indexer): New class for indexer declarations.
25039 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25040 (TypeContainer::indexers): New member to hold list of indexers for the
25043 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25045 * cs-parser.jay (add_accessor_declaration): Implement action.
25046 (remove_accessor_declaration): Implement action.
25047 (event_accessors_declaration): Implement
25048 (variable_declarators): swap statements for first rule - trivial.
25050 * class.cs (Event): New class to hold information about event
25052 (TypeContainer::AddEvent): New method to add an event to a type
25053 (TypeContainer::events): New member to hold list of events.
25055 * cs-parser.jay (event_declaration): Implement actions.
25057 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25059 * cs-parser.jay (dim_separators): Implement. Make it a string
25060 concatenating all the commas together, just as they appear.
25061 (opt_dim_separators): Modify accordingly
25062 (rank_specifiers): Update accordingly. Basically do the same
25063 thing - instead, collect the brackets here.
25064 (opt_rank_sepcifiers): Modify accordingly.
25065 (array_type): Modify to actually return the complete type string
25066 instead of ignoring the rank_specifiers.
25067 (expression_list): Implement to collect the expressions
25068 (variable_initializer): Implement. We make it a list of expressions
25069 essentially so that we can handle the array_initializer case neatly too.
25070 (variable_initializer_list): Implement.
25071 (array_initializer): Make it a list of variable_initializers
25072 (opt_array_initializer): Modify accordingly.
25074 * expression.cs (New::NType): Add enumeration to help us
25075 keep track of whether we have an object/delegate creation
25076 or an array creation.
25077 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25078 members to hold data about array creation.
25079 (New:New): Modify to update NewType
25080 (New:New): New Overloaded contructor for the array creation
25083 * cs-parser.jay (array_creation_expression): Implement to call
25084 the overloaded New constructor.
25086 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25088 * class.cs (TypeContainer::Constructors): Return member
25089 constructors instead of returning null.
25091 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25093 * typemanager.cs (InitCoreTypes): Initialize the various core
25094 types after we have populated the type manager with the user
25095 defined types (this distinction will be important later while
25096 compiling corlib.dll)
25098 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25099 on Expression Classification. Now all expressions have a method
25100 `Resolve' and a method `Emit'.
25102 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25103 generation from working. Also add some temporary debugging
25106 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25108 * codegen.cs: Lots of code generation pieces. This is only the
25109 beginning, will continue tomorrow with more touches of polish. We
25110 handle the fundamentals of if, while, do, for, return. Others are
25111 trickier and I need to start working on invocations soon.
25113 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25116 * codegen.cs (EmitContext): New struct, used during code
25117 emission to keep a context. Most of the code generation will be
25120 * cs-parser.jay: Add embedded blocks to the list of statements of
25121 this block. So code generation proceeds in a top down fashion.
25123 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25125 * statement.cs: Add support for multiple child blocks.
25127 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25129 * codegen.cs (EmitCode): New function, will emit the code for a
25130 Block of code given a TypeContainer and its ILGenerator.
25132 * statement.cs (Block): Standard public readonly optimization.
25133 (Block::Block constructors): Link children.
25134 (Block::Child): Child Linker.
25135 (Block::EmitVariables): Emits IL variable declarations.
25137 * class.cs: Drop support for MethodGroups here, delay until
25139 (Method::): Applied the same simplification that I did before, and
25140 move from Properties to public readonly fields.
25141 (Method::ParameterTypes): Returns the parameter types for the
25142 function, and implements a cache that will be useful later when I
25143 do error checking and the semantic analysis on the methods is
25145 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25146 and made a method, optional argument tells whether this is a class
25147 or a structure to apply the `has-this' bit.
25148 (Method::GetCallingConvention): Implement, returns the calling
25150 (Method::Define): Defines the type, a second pass is performed
25151 later to populate the methods.
25153 (Constructor::ParameterTypes): implement a cache similar to the
25154 one on Method::ParameterTypes, useful later when we do semantic
25157 (TypeContainer::EmitMethod): New method. Emits methods.
25159 * expression.cs: Removed MethodGroup class from here.
25161 * parameter.cs (Parameters::GetCallingConvention): new method.
25163 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25165 * class.cs (TypeContainer::Populate): Drop RootContext from the
25168 (Constructor::CallingConvention): Returns the calling convention.
25169 (Constructor::ParameterTypes): Returns the constructor parameter
25172 (TypeContainer::AddConstructor): Keep track of default constructor
25173 and the default static constructor.
25175 (Constructor::) Another class that starts using `public readonly'
25176 instead of properties.
25178 (Constructor::IsDefault): Whether this is a default constructor.
25180 (Field::) use readonly public fields instead of properties also.
25182 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25183 track of static constructors; If none is used, turn on
25184 BeforeFieldInit in the TypeAttributes.
25186 * cs-parser.jay (opt_argument_list): now the return can be null
25187 for the cases where there are no arguments.
25189 (constructor_declarator): If there is no implicit `base' or
25190 `this', then invoke the default parent constructor.
25192 * modifiers.cs (MethodAttr): New static function maps a set of
25193 modifiers flags into a MethodAttributes enum
25194 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25195 MethodAttr, TypeAttr to represent the various mappings where the
25196 modifiers are used.
25197 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25199 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25201 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25204 * interface.cs (PopulateIndexer): Implemented the code generator
25205 for interface indexers.
25207 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25209 * interface.cs (InterfaceMemberBase): Now we track the new status
25212 (PopulateProperty): Implement property population. Woohoo! Got
25213 Methods and Properties going today.
25215 Removed all the properties for interfaces, and replaced them with
25216 `public readonly' fields.
25218 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25220 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25221 initialize their hashtables/arraylists only when they are needed
25222 instead of doing this always.
25224 * parameter.cs: Handle refs and out parameters.
25226 * cs-parser.jay: Use an ArrayList to construct the arguments
25227 instead of the ParameterCollection, and then cast that to a
25230 * parameter.cs: Drop the use of ParameterCollection and use
25231 instead arrays of Parameters.
25233 (GetParameterInfo): Use the Type, not the Name when resolving
25236 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25238 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25239 and instead use public readonly fields.
25241 * class.cs: Put back walking code for type containers.
25243 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25245 * class.cs (MakeConstant): Code to define constants.
25247 * rootcontext.cs (LookupType): New function. Used to locate types
25250 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25252 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25253 this System.Reflection code is. Kudos to Microsoft
25255 * typemanager.cs: Implement a type cache and avoid loading all
25256 types at boot time. Wrap in LookupType the internals. This made
25257 the compiler so much faster. Wow. I rule!
25259 * driver.cs: Make sure we always load mscorlib first (for
25260 debugging purposes, nothing really important).
25262 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25263 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25265 * rootcontext.cs: Lookup types on their namespace; Lookup types
25266 on namespaces that have been imported using the `using' keyword.
25268 * class.cs (TypeContainer::TypeAttr): Virtualize.
25269 (Class::TypeAttr): Return attributes suitable for this bad boy.
25270 (Struct::TypeAttr): ditto.
25271 Handle nested classes.
25272 (TypeContainer::) Remove all the type visiting code, it is now
25273 replaced with the rootcontext.cs code
25275 * rootcontext.cs (GetClassBases): Added support for structs.
25277 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25279 * interface.cs, statement.cs, class.cs, parameter.cs,
25280 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25281 Drop use of TypeRefs, and use strings instead.
25283 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25287 * class.cs (Struct::Struct): set the SEALED flags after
25288 checking the modifiers.
25289 (TypeContainer::TypeAttr): new property, returns the
25290 TypeAttributes for a class.
25292 * cs-parser.jay (type_list): Oops, list production was creating a
25293 new list of base types.
25295 * rootcontext.cs (StdLib): New property.
25296 (GetInterfaceTypeByName): returns an interface by type name, and
25297 encapsulates error handling here.
25298 (GetInterfaces): simplified.
25299 (ResolveTree): Encapsulated all the tree resolution here.
25300 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25303 * driver.cs: Add support for --nostdlib, to avoid loading the
25304 default assemblies.
25305 (Main): Do not put tree resolution here.
25307 * rootcontext.cs: Beginning of the class resolution.
25309 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25311 * rootcontext.cs: Provide better error reporting.
25313 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25315 * rootcontext.cs (CreateInterface): Handle the case where there
25316 are no parent interfaces.
25318 (CloseTypes): Routine to flush types at the end.
25319 (CreateInterface): Track types.
25320 (GetInterfaces): Returns an array of Types from the list of
25321 defined interfaces.
25323 * typemanager.c (AddUserType): Mechanism to track user types (puts
25324 the type on the global type hash, and allows us to close it at the
25327 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25329 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25330 RecordInterface instead.
25332 * cs-parser.jay: Updated to reflect changes above.
25334 * decl.cs (Definition): Keep track of the TypeBuilder type that
25335 represents this type here. Not sure we will use it in the long
25336 run, but wont hurt for now.
25338 * driver.cs: Smaller changes to accomodate the new code.
25340 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25343 * rootcontext.cs (CreateInterface): New method, used to create
25344 the System.TypeBuilder type for interfaces.
25345 (ResolveInterfaces): new entry point to resolve the interface
25347 (CodeGen): Property, used to keep track of the code generator.
25349 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25351 * cs-parser.jay: Add a second production for delegate_declaration
25354 (enum_body): Put an opt_comma here instead of putting it on
25355 enum_body or enum_member_declarations so we can handle trailing
25356 commas on enumeration members. Gets rid of a shift/reduce.
25358 (type_list): Need a COMMA in the middle.
25360 (indexer_declaration): Tell tokenizer to recognize get/set
25362 * Remove old targets.
25364 * Re-add the parser target.
25366 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25368 * cs-parser.jay: Add precendence rules for a number of operators
25369 ot reduce the number of shift/reduce conflicts in the grammar.
25371 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25373 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25376 Get rid of old crufty code.
25378 * rootcontext.cs: Use this to keep track of the parsed
25379 representation and the defined types available to the program.
25381 * gen-treedump.cs: adjust for new convention.
25383 * type.cs: Split out the type manager, and the assembly builder
25386 * typemanager.cs: the type manager will live here now.
25388 * cil-codegen.cs: And the code generator here.
25390 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25392 * makefile: Fixed up for easy making.
25394 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25396 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25399 (unary_expression): Expand pre_increment_expression and
25400 post_decrement_expression to reduce a shift/reduce.
25402 2001-07-11 Simon Cozens
25404 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25406 Improve allow_keyword_as_indent name.
25408 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25410 * Adjustments for Beta2.
25412 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25414 * decl.cs: Added `Define' abstract method.
25415 (InTransit): new property, used to catch recursive definitions.
25417 * interface.cs: Implement `Define'.
25419 * modifiers.cs: Map Modifiers.constants to
25420 System.Reflection.TypeAttribute flags.
25422 * class.cs: Keep track of types and user-defined types.
25423 (BuilderInit): New method for creating an assembly
25424 (ResolveType): New function to launch the resolution process, only
25425 used by interfaces for now.
25427 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25428 that are inserted into the name space.
25430 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25432 * ARGH. I have screwed up my tree so many times due to the use of
25433 rsync rather than using CVS. Going to fix this at once.
25435 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25438 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25440 * Experiment successful: Use System.Type rather that our own
25443 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25445 * cs-parser.jay: Removed nsAliases from here.
25447 Use new namespaces, handle `using XXX;'
25449 * namespace.cs: Reimplemented namespace handling, use a recursive
25450 definition of the class. Now we can keep track of using clauses
25451 and catch invalid using clauses.
25453 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25455 * gen-treedump.cs: Adapted for all the renaming.
25457 * expression.cs (Expression): this class now has a Type property
25458 which returns an expression Type.
25460 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25461 `Type', as this has a different meaning now in the base
25463 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25465 * interface.cs, class.cs: Removed from all the sources the
25466 references to signature computation, as we can not do method
25467 signature computation during the parsing time, as we are not
25468 trying to solve at that point distinguishing:
25472 void a (NS.Blah x) {}
25475 Which depending on the context might be valid or not, as we do not
25476 know if Blah is the same thing as NS.Blah at that point.
25478 * Redid everything so the code uses TypeRefs now instead of
25479 Types. TypeRefs are just temporary type placeholders, that need
25480 to be resolved. They initially have a pointer to a string and the
25481 current scope in which they are used. This is used later by the
25482 compiler to resolve the reference to an actual Type.
25484 * DeclSpace is no longer a CIR.Type, and neither are
25485 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25486 are all DeclSpaces, but no Types.
25488 * type.cs (TypeRefManager): This implements the TypeRef manager,
25489 which keeps track of all the types that need to be resolved after
25490 the parsing has finished.
25492 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25494 * ARGH. We are going to have to store `foreach' as a class rather
25495 than resolving it, as we need to verify error 1579 after name
25496 resolution. *OR* we could keep a flag that says `This request to
25497 IEnumerator comes from a foreach statement' which we can then use
25498 to generate the error.
25500 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25502 * class.cs (TypeContainer.AddMethod): we now add methods to the
25503 MethodGroup instead of the method hashtable.
25505 * expression.cs: Add MethodGroup abstraction, which gets us one
25506 step closer to the specification in the way we handle method
25509 * cs-parser.jay (primary_expression): qualified_identifier now
25510 tried to match up an identifier to a local variable reference or
25511 to a parameter reference.
25513 current_local_parameters is now a parser global variable that
25514 points to the current parameters for the block, used during name
25517 (property_declaration): Now creates an implicit `value' argument to
25520 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25522 * parameter.cs: Do not use `param' arguments as part of the
25523 signature, per the spec.
25525 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25527 * decl.cs: Base class for classes, structs and interfaces. This
25528 is the "Declaration Space"
25530 * cs-parser.jay: Use CheckDef for checking declaration errors
25531 instead of having one on each function.
25533 * class.cs: Factor out some code for handling error handling in
25534 accordance to the "Declarations" section in the "Basic Concepts"
25535 chapter in the ECMA C# spec.
25537 * interface.cs: Make all interface member classes derive from
25538 InterfaceMemberBase.
25540 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25542 * Many things: all interfaces are parsed and generated in
25543 gen-treedump. Support for member variables, constructors,
25544 destructors, properties, constants is there.
25546 Beginning of the IL backend, but very little done, just there for
25549 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25551 * cs-parser.jay: Fix labeled statement.
25553 * cs-tokenizer.cs (escape): Escape " and ' always.
25554 ref_line, ref_name: keep track of the line/filename as instructed
25555 by #line by the compiler.
25558 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25560 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25561 to match the values in System.CodeDOM.
25563 Divid renamed to Divide.
25565 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25567 (Statements.set): remove.
25569 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25572 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25573 falseStatements always have valid values.
25575 * cs-parser.jay: Use System.CodeDOM now.