1 2007-04-23 Marek Safar <marek.safar@gmail.com>
4 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6 2007-04-22 Miguel de Icaza <miguel@novell.com>
8 * cs-tokenizer.cs: Change various identifiers here from the
9 camelCasing to the recommended Linux-like style for instance
10 variables from the Coding Guidelines.
12 2007-04-19 Martin Baulig <martin@ximian.com>
15 (Convert.ImplicitReferenceConversionCore): Allow conversions from
16 System.Enum to System.ValueType.
18 2007-04-13 Martin Baulig <martin@ximian.com>
20 Rewrote implicit reference conversions. We need to distinguish
21 between implicit reference conversions (13.1.4) and implicit
22 boxing conversions (13.1.5).
24 According to the spec, there's an an implicit conversion
25 "From a one-dimensional array-type S[] to IList<T> and base
26 interfaces of this interface, provided there is an implicit
27 reference conversion from S to T." Note that this does not
28 include boxing conversions.
31 (Convert.ImplicitTypeParameterBoxingConversion): New method.
32 (Convert.ImplicitReferenceConversion): Split into
33 ImplicitReferenceConversionCore() and
34 ImplicitBoxingConversionExist().
35 (Convert.ImplicitReferenceConversionExists): Use the new
36 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
38 2007-04-12 Martin Baulig <martin@ximian.com>
40 * convert.cs (Convert.ImplicitReferenceConversion): Move the
41 `TypeManager.null_type' checks up to the top of the method.
43 2007-04-11 Marek Safar <marek.safar@gmail.com>
46 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
49 2007-04-11 Martin Baulig <martin@ximian.com>
51 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
52 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
53 to make this work for generic classes; fixes #79561.
55 2007-04-11 Martin Baulig <martin@ximian.com>
57 * expression.cs (As): Add support for nullable types; fixes #79371.
59 2007-04-11 Martin Baulig <martin@ximian.com>
61 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
62 `type.FullName' is null; fixes #80243.
64 2007-04-11 Martin Baulig <martin@ximian.com>
66 * expression.cs (Invocation.IsApplicable): Don't modify the method
67 if type inference succeeded, but the method was not applicable.
70 2007-04-10 Marek Safar <marek.safar@gmail.com>
73 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
74 internal and external namespaces containers.
76 2007-04-10 Martin Baulig <martin@ximian.com>
78 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
79 TypeManager.DropGenericMethodArguments() so we also call
80 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
82 2007-04-10 Martin Baulig <martin@ximian.com>
84 * iterators.cs (Iterator.CreateIterator): Don't crash if
85 `method.ReturnType' is null. This happens if something went wrong
86 while resolving that typ (we already reported an error in this case).
88 2007-04-10 Martin Baulig <martin@ximian.com>
90 * expression.cs (New.DoResolve): Don't call CheckComImport() on
91 generic interfaces; report the CS0144 directly.
93 2007-04-10 Martin Baulig <martin@ximian.com>
95 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
96 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
98 2007-04-10 Martin Baulig <martin@ximian.com>
100 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
102 2007-04-09 Raja R Harinath <rharinath@novell.com>
105 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
106 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
109 * statement.cs (For.Resolve): If resolution fails, use
112 2007-04-08 Marek Safar <marek.safar@gmail.com>
114 * anonymous.cs (MakeName): Make faster and zero-based.
115 (VerifyExplicitParameterCompatibility): Back to mode where generic
116 parameter is ignored.
117 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
119 * class.cs (EmitType): Method can emit another new method.
121 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
123 * driver.cs: Updated.
125 * lambda.cs: Reuse predefined empty parameters.
127 * parameter.cs: Updated
129 * support.cs: Implemented InflateTypes.
131 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
132 (InitSystemCore): Introduced to isolate 3.0 dependencies.
134 2007-04-03 Martin Baulig <martin@ximian.com>
138 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
139 version of TypeManager.IsOverride() which also works with generic
142 2007-04-03 Martin Baulig <martin@ximian.com>
147 (Convert.ExplicitReferenceConversion): We need to cast when
148 converting from IList<T> to S[].
150 2007-04-01 Marek Safar <marek.safar@gmail.com>
152 * decl.cs (FindExtensionMethods): Consider all candidates with same name
155 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
157 2007-03-31 Marek Safar <marek.safar@gmail.com>
159 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
160 argument and return type inferring.
162 * codegen.cs (InferReturnType): Flag whether return can be inferred.
163 (ReturnType): Turned to property.
165 * statement.cs (Return): Implemented return type inferring.
167 * support.cs (ReflectionParameters): Use local types if possible.
169 2007-03-30 Raja R Harinath <rharinath@novell.com>
171 * flowanalysis.cs (FlowBranching.Reachability): Remove.
172 (FlowBranching.UsageVector): Update to changes.
174 Prepare to kill 'Reachability'
175 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
176 argument of constructor.
178 2007-03-29 Raja R Harinath <rharinath@novell.com>
180 Prepare to kill 'Reachability'
181 * flowanalysis.cs (UsageVector.is_unreachable): New.
182 (UsageVector): Update to maintain 'is_unreachable' in parallel to
183 'reachability', and verify they're consistent.
186 * expression.cs (New.EmitStatement): Handle type parameters here too.
188 2007-03-29 Martin Baulig <martin@ximian.com>
193 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
194 CompilerGeneratedClass.
195 (ScopeInfo.EmitScopeInstance): Make this protected.
196 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
197 `ec.CurrentAnonymousMethod.Scope == Scope'.
199 * statement.cs (Block.ScopeInfo): Make this a property.
201 2007-03-27 Raja R Harinath <harinath@gmail.com>
203 Prepare to kill 'Reachability'
204 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
205 (FlowBranching.UsageVector.Reachability): Remove property.
206 (FlowBranching.UsageVector.IsUnreachable): New property.
207 (FlowBranching.UsageVector.ResetBarrier): New.
208 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
209 * codegen.cs, statement.cs: Update to changes.
211 2007-03-27 Martin Baulig <martin@ximian.com>
216 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
219 2007-03-26 Raja R Harinath <rharinath@novell.com>
221 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
222 instead of TriState. Remove all mention of TriState.
224 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
225 replaced by a boolean. Add boolean 'is_unreachable' field, check
226 and maintain invariants.
228 2007-03-25 Marek Safar <marek.safar@gmail.com>
230 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
232 2007-03-25 Marek Safar <marek.safar@gmail.com>
234 * expression.cs: Stop using obsolete 2.0 opcodes.
236 2007-03-25 Marek Safar <marek.safar@gmail.com>
238 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
239 one of the latests Martin's fixes.
241 2007-03-23 Miguel de Icaza <miguel@novell.com>
243 * expression.cs: On BigEndian systems, swap the bytes, temporary
244 solution until we get a new bitconverter class.
246 2007-03-23 Martin Baulig <martin@ximian.com>
250 * decl.cs (MemberCache.AddMembers): Add generic methods both as
251 "Method" and "Method`1". Normally, a cache lookup is done on the
252 "Method" form (ie. without the generic arity), but this one makes
253 lookups on the full form work as well.
255 2007-03-22 Raja R Harinath <rharinath@novell.com>
257 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
260 2007-03-20 Bill Holmes <billholmes54@gmail.com>
262 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
263 ordered_member_list, to TypeBuilder to store members to be defined
264 in the order they were parsed in.
265 - ordered_explicit_member_list contains all properties indexers
266 and methods that are defined as explicit implementation of an
267 interface or base class.
268 - ordered_member_list contains all properties indexers and methods
269 that are not defined as explicit implementation of an interface
272 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
273 functionality in these removed classes has been replaced with
274 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
275 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
277 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
278 to CheckForDuplications inside GetMethod and SetMethod Define Method
279 to handle method property and indexer name conflicts.
283 All code is contributed under the MIT/X11 license.
285 2007-03-20 Martin Baulig <martin@ximian.com>
287 * class.cs (TypeContainer.Interfaces): Removed; they're now
288 included in `TypeContainer.Types'.
290 2007-03-20 Martin Baulig <martin@ximian.com>
292 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
294 * class.cs (TypeContainer.CreateType): New public method. This is
295 now called before DefineType() to create the TypeBuilders.
296 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
297 has already been created by CreateType().
298 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
299 don't resolve our base classes here; this has been moved into
300 DefineBaseTypes(). We're now called from CreateType().
301 (TypeContainer.DefineBaseTypes): New private method; resolve our
302 base classes here. We're now called from DefineType().
305 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
306 our types first to create all the TypeBuilders. After that, call
307 TypeContainer.DefineType() on all the types which'll resolve their
308 base classes and setup the resolve order.
310 2007-03-20 Martin Baulig <martin@ximian.com>
312 * class.cs (TypeContainer.Enums): Removed; they're now included in
313 `TypeContainer.Types'.
315 2007-03-20 Martin Baulig <martin@ximian.com>
318 (TypeContainer.DefineType): Don't call ResolveMembers() here.
319 (TypeContainer.DoResolveMembers): Call DefineType() on our
320 `compiler_generated' classes; moved here from DefineNestedTypes().
323 (RootContext.ResolveTree): Call ResolveMembers() on all
324 TypeContainer's in the `type_container_resolve_order'.
326 2007-03-19 Marek Safar <marek.safar@gmail.com>
328 * class.cs: Use corlib to handle InternalMethodImplAttribute.
330 2007-03-17 Marek Safar <marek.safar@gmail.com>
332 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
333 implementation flags.
335 2007-03-17 Marek Safar <marek.safar@gmail.com>
337 * class.cs: More optimizations for type parameters.
339 2007-03-15 Marek Safar <marek.safar@gmail.com>
341 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
343 * ecore.cs, parameter.cs: More common code for both corlibs.
345 * typemanager.cs (IsGenericMethod): Simplified.
347 2007-03-15 Raja R Harinath <rharinath@novell.com>
349 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
351 * statement.cs, iterators.cs, lambda.cs: Update to changes.
353 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
354 unconditionally. Simplify explanation.
355 (Try.Resolve, Using.Resolve): Likewise.
357 2007-03-15 Martin Baulig <martin@ximian.com>
361 * decl.cs (DeclSpace): If we're a partial class, use our
362 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
364 2007-03-15 Raja R Harinath <rharinath@novell.com>
366 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
368 (FlowBranching.UsageVector): Update to changes.
369 (FlowBranching.MergeSiblings): Likewise.
370 * statement.cs: Likewise.
372 2007-03-15 Martin Baulig <martin@ximian.com>
377 (MemberCache): Added a special .ctor for type parameters.
380 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
383 2007-03-09 Martin Baulig <martin@ximian.com>
385 * enum.cs (Enum): Make this a TypeContainer.
386 (EnumMember): Derive from `Const'.
389 (Const.DoResolveValue): New protected virtual method; move most of
390 the functionality of ResolveValue() here so we can override it in
392 (Const.CreateConstantReference): Make this virtual.
394 * class.cs (Kind): Add `Kind.Enum'.
395 (TypeContainer.Emit): Don't emit the enums here; they're already
396 in the `RootContext.typecontainer_resolve_order'.
398 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
399 here; they're already in the `typecontainer_resolve_order'.
401 * ecore.cs (EnumConstant.ConvertImplicitly): Add
402 TypeManager.DropGenericTypeArguments().
405 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
406 (TypeManager.IsEnumType): Likewise.
407 (TypeManager.EnumToUnderlying): Likewise.
408 (TypeManager.IsEqual): Add support for enums.
410 2007-03-12 Raja R Harinath <rharinath@novell.com>
412 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
413 DefaultParameterValueAttribute to be undefined, say if System.dll
416 2007-03-11 Marek Safar <marek.safar@gmail.com>
418 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
421 2007-03-10 Marek Safar <marek.safar@gmail.com>
423 * class.cs, parameter.cs: Unified parameters verification.
425 2007-03-08 Martin Baulig <martin@ximian.com>
427 * cs-parser.jay (constructor_header): Pass the location to the
428 newly created TopLevelBlock.
430 2007-03-07 Martin Baulig <martin@ximian.com>
432 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
434 2007-03-06 Miguel de Icaza <miguel@novell.com>
436 * convert.cs (ExplicitReferenceConversionExists): Sync this method
437 with the changes from David, fixes the build.
439 2007-03-05 David Mitchell <dmitchell@logos.com>
441 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
442 and its base interfaces to a one-dimensional array type S[],
443 provided there is an implicit or explicit reference conversion
446 2007-03-03 Marek Safar <marek.safar@gmail.com>
448 * cs-tokenizer.cs: Implemented basic linq grammar.
450 * driver.cs: Set linq lang version on demand.
452 2007-02-26 Marek Safar <marek.safar@gmail.com>
454 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
456 2007-02-25 Marek Safar <marek.safar@gmail.com>
458 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
461 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
463 Check property and event extern attributes.
465 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
468 2007-02-24 Marek Safar <marek.safar@gmail.com>
471 * ecore.cs: Don't report ambiguity error when methods have same parent.
473 2007-02-23 Marek Safar <marek.safar@gmail.com>
476 * class.cs, cs-parser.jay: Event property can host anonymous methods.
478 2007-02-22 Marek Safar <marek.safar@gmail.com>
480 * attribute.cs: Enable ExtensionAttribute presence test.
482 2007-02-22 Marek Safar <marek.safar@gmail.com>
484 * class.cs: Warn about missing GetHashCode only when Equals is override.
486 * decl.cs: Check accessibility of type arguments.
488 * typemanager.cs: Correctly report nullable array.
490 2007-02-20 Marek Safar <marek.safar@gmail.com>
492 * class.cs, report.cs: Capture more details when things go wrong.
494 2007-02-20 Marek Safar <marek.safar@gmail.com>
497 * cs-parser.jay: Anonymous container starts at constructor declaration
498 and not at block beginning because it has to be usable in constructor
501 * statement.cs: Use context location and not block one for error reporting.
503 2007-02-18 Marek Safar <marek.safar@gmail.com>
506 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
509 2007-02-18 Marek Safar <marek.safar@gmail.com>
511 A fix for bug #80493 by Atsushi Enomoto
512 * cs-parser.jay: Ignore invalid attribute target.
514 2007-02-18 Marek Safar <marek.safar@gmail.com>
516 * cs-tokenizer.cs: Ignore '\0' as white space character.
518 2007-02-17 Miguel de Icaza <miguel@novell.com>
520 * cs-parser.jay: Add support for lambda expressions to the mcs
523 * lambda.cs: Only clone when we are probing, not on the final call
524 (Compatible is the final call).
526 * statement.cs (CloneContext): Introduce class to provide block
527 remapping during clone.
529 All statements Clone themselves now.
531 (Clone): special handling for blocks, when we clone a block, we
532 register the block inside this routine, as children of the block
533 might trigger a lookup.
535 * expression.cs: Add support for CloneContext in all expressions.
537 2007-02-17 Marek Safar <marek.safar@gmail.com>
540 * statement.cs: Report ambiguous warning when interfaces are not related.
542 2007-02-15 Marek Safar <marek.safar@gmail.com>
544 C# 3.0 extension methods.
546 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
547 cannot be used directly.
549 * class.cs (Class.Emit): Emit extension attribute if any class method
551 (Method.Define): Add basic extension method validation conditions.
552 (Method.Emit): Emit extension attribute for method.
554 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
555 extension method exists. Currently we follow same approach as Microsoft
556 does, emit even if a method or a class are private but this can change
559 * cs-parser.jay: Add handling of `this' keyword in method parameters
562 * decl.cs (DeclSpace.IsStaticClass): New property.
563 (MemberCache.FindExtensionMethods): Looks for extension methods with
564 defined name and extension type.
566 * doc.cs: Updated after OverloadResolve changes.
568 * driver.cs: Add new soft reference to System.Core.dll.
570 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
571 (ExtensionMethodGroupExpr): Represents group of extension methods.
573 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
574 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
575 to MethodGroupExpr and made non-static for easier customization.
576 (Invocation.DoResolve): Add extension method lookup when no standard
578 (MemberAccess.DoResolve): Try extension methods if no member exists.
580 * modifiers.cs: Add METHOD_EXTENSION modifier.
582 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
583 as well as candidate extension type.
584 (ComputeNamespaces): When assembly constains extension methods registers
586 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
587 extension method lookup.
588 (Namespace.LookupExtensionMethod): Looks for extension method in this
590 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
591 find a method which matches name and extensionType.
593 * parameter.cs (Parameter): Add This modifer.
594 (HasExtensionMethodModifier): New property.
595 (Resolve): Add extension parameter check.
596 (ModFlags): turned to property to exclude this modifier as it is not real
598 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
600 * support.cs (ParameterData): Add ExtensionMethodType.
601 (ReflectionParameters): Implemented ExtensionMethodType interface property.
603 * typemanager.cs: Add type and ctor extension attribute type.
605 2007-02-15 Miguel de Icaza <miguel@novell.com>
607 * report.cs (DisableErrors, EnableErrors): used to prevent error
608 output when we are "trying" to compile various methods with
611 * ecore.cs (Expression): Add Clone method that calls the virtual
612 CloneTo method. The current CloneTo method in Expression throws
613 an exception so we can track down all the places where this must
614 be implemented (not using abstract, because that would be a lot of
615 up-front-work before we can start testing the implementation
618 Important: we only need Clone capabilities for expressions created
619 by the parser, as the expressions we will be cloning are
620 expressions in the pre-resolved state. This vastly simplifies
623 (SimpleName): Add CloneTo that does nothing.
624 (EmptyCast): Add CloneTo.
626 * expression.cs (Binary): Implement CloneTo.
627 (Invocation.IsApplicable): Store the current ec in
628 EmitContext.TempEc and restore it on return. This is used so we
629 do not have to sprinkle hundres of methods with an extra
630 EmitContext, we know that the only user is the lambda expression
631 ImplicitConversionExists code.
633 (Argument): Add Cloning capabilities.
634 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
635 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
636 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
637 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
638 IndexerAccess): Add Clone capability.
640 (LocalVariableReference, This): TODO: needs cloned Block mapping.
642 (Argument): Add cloning capability.
644 * assign.cs (Assign): Implement CloneTo.
646 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
648 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
649 version by calling Convert with the EmitContext (that we are
650 currently storing in ec, this is not great, but will do for now,
651 to avoid passing EmitContext parameters to hundreds of functions
652 that do not need them now).
654 (SetExpression): Remove, it is not needed.
656 (ContextualReturn): Implement CloneTo.
658 * statement.cs (Statement): Implement cloning infrastructure,
659 similar to expressions.
661 (Block): Partial implementation of Clone for statements.
663 (Return): Implement clone.
665 * constant.cs (Constant.CloneTo): New method, does nothing.
667 * codegen.cs (TempEc): Add a static EmitContext as a temporary
668 solution, until we decide how to exactly do this.
670 2007-02-14 Marek Safar <marek.safar@gmail.com>
673 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
674 a property is override we need to use second accessor.
676 2007-02-13 Marek Safar <marek.safar@gmail.com>
679 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
682 2007-02-13 Marek Safar <marek.safar@gmail.com>
684 Another fix for bug #80749
685 * pending.cs: Abstract class has priority over interfaces.
687 2007-02-13 Marek Safar <marek.safar@gmail.com>
689 Another fix for bug #80749
690 * pending.cs: Abstract class has priority over interfaces.
692 2007-02-13 Marek Safar <marek.safar@gmail.com>
694 Another fix for bug #80749
695 * pending.cs: Abstract class has priority over interfaces.
697 2007-02-13 Marek Safar <marek.safar@gmail.com>
699 Another fix for bug #80749
700 * pending.cs: Abstract class has priority over interfaces.
702 2007-02-13 Marek Safar <marek.safar@gmail.com>
704 * class.cs Better error message.
706 * driver.cs: Add shorter versions of -optimize option.
708 2007-02-13 Martin Baulig <martin@ximian.com>
710 * class.cs (Constructor.Emit): Check the return value of
711 ec.ResolveTopBlock() and return on error.
713 2007-02-13 Raja R Harinath <rharinath@novell.com>
715 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
716 message to fix error message regression.
718 2007-02-12 Marek Safar <marek.safar@gmail.com>
720 * delegate.cs: Delegate creation expression cannot be of Nullable type.
722 2007-02-12 Marek Safar <marek.safar@gmail.com>
725 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
726 its parent container.
728 * class.cs (DefineFieldInitializers): Each initializer can has different
733 2007-02-11 Miguel de Icaza <miguel@novell.com>
735 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
736 now all the heavy lifting to check that embedded statements or
737 expressions have the right form is done in the ContextualReturn.
739 (ContextualReturn): New class.
741 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
742 method that can be invoked to report 201, so we do not replicate
745 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
747 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
748 treating tabs as spaces.
750 2007-02-09 Marek Safar <marek.safar@gmail.com>
752 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
753 * assign.cs: Use full implicit conversion for right side check.
755 2007-02-09 Marek Safar <marek.safar@gmail.com>
757 * statement.cs (Switch): Switch over boolean type is not standardized.
759 2007-02-08 Marek Safar <marek.safar@gmail.com>
762 * decl.cs (FindBaseEvent): Don't use method cache for events.
764 2007-02-07 Marek Safar <marek.safar@gmail.com>
766 * cs-parser.jay: Better syntax error handling.
768 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
769 instead of underlying type value.
771 2007-02-06 Marek Safar <marek.safar@gmail.com>
773 * driver.cs: Check define identifier before is registered.
775 * namespace.cs: Use existing error message.
777 * report.cs: New warning.
779 2007-02-06 Marek Safar <marek.safar@gmail.com>
782 * expression.cs: Delegate Invoke method can be called directly.
784 2007-02-06 Marek Safar <marek.safar@gmail.com>
787 * class.cs (IsEntryPoint): The Main method can have params modifier.
789 2007-02-04 Miguel de Icaza <miguel@novell.com>
791 * parameter.cs (Parameter, Parameters): Add Clone method.
793 * anonymous.cs (Compatible): Turn method into virtual method, so
794 LambdaExpression can implement a different behavior.
796 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
797 out the basic checking here, so it can be used by
800 * lambda.cs: Introduce "Compatible" function that will do the
803 2007-02-02 Marek Safar <marek.safar@gmail.com>
805 * attribute.cs: Unified one error message.
807 * class.cs (Class): Use type attributes and not properties to test static
809 (IsEntryPoint): Don's pass local variable.
811 * convert.cs: Removed duplicate check.
813 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
815 * driver.cs: Don't crash when soft reference does not exist.
817 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
818 (UsingEntry): Removed redundant allocation.
820 * parameter.cs: Add fast path for type parameters.
822 * support.cs: Don't allocate attribute when it's not used.
824 2007-01-30 Miguel de Icaza <miguel@novell.com>
827 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
828 this into a virtual method, so we can override it in LambdaExpression.
830 * driver.cs: Improve diagnostics in case of failure.
832 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
833 write a function that is slightly more complex and that parses:
835 type identifier [, type identifier]* )
837 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
840 (canEmpty ? i >= 0 : i > 0)
842 2007-01-30 Raja R Harinath <rharinath@novell.com>
844 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
845 exception on possibly valid code.
847 2007-01-29 Raja R Harinath <rharinath@novell.com>
849 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
851 (parse_opt_type_arguments): Remove. It's almost the same as
853 (parse_namespace_or_typename): Use parse_less_than.
855 2007-01-28 Miguel de Icaza <miguel@novell.com>
857 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
858 this bug took a few hours to find, because the state saved and
859 restored by PushPosition and PopPosition was ignoring the state of
860 parse_generic_less_than.
862 I can also now remove the handling of OP_LT and OP_GT, this solves
865 * cs-tokenizer.cs: store the location for the ARROW token, we use
868 (PushPosition, PopPosition): save/restore also `current_token',
869 restore `parse_generic_less_than' (was missing).
871 (parse_opt_type_arguments): use parse_type, not
872 parse_namespace_or_typename to parse types.
874 * lambda.cs: Empty new file, will eventually have the lambda
875 expression implementation.
877 * lambda.test: used to test the internal tokenizer.
879 * report.cs (FeatureIsNotISO1): Rename from
880 FeatureIsNotStandardized, because it was about the language level
881 (1 vs 2) it was not about standarization.
883 (FeatureRequiresLINQ): New.
885 * support.cs (SeekableStreamReader): Only require that the reader
886 is a TextReader, not a StreamReader, so we can plug StringReader.
888 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
889 given position in the input stream the following tokens can be
890 parsed as a type followed by an identifier.
892 (is_punct): after a '(' if parse_type_and_parameter returns true,
893 then return a special token OPEN_PARENS_LAMBDA which is used to
894 avoid reduce/reduce errors in the grammar for the
895 lambda_expression rules.
897 (parse_type): implement a type parser inside the
898 tokenizer, the parser only returns true or false depending on
899 whether the input at a given position can be parsed as a type.
901 (peek_token): new method used during type parsing.
903 2007-01-28 Raja R Harinath <rharinath@novell.com>
906 * anonymous.cs (ScopeInfo.InflateParameters): New.
907 (AnonymousContainer.Resolve): Use it to redirect types of
910 2007-01-27 Raja R Harinath <rharinath@novell.com>
913 * expression.cs (Error_InvalidArguments): Don't use two different
914 messages for CS1503. Use ExtraInformation and
915 SymbolRelatedToPreviousError instead.
918 * decl.cs (DeclSpace.initialize_type_params): Don't access
919 'type_params' of a partial class directly.
921 2007-01-26 Miguel de Icaza <miguel@novell.com>
923 * constant.cs: Removed a handful of out-of-range checks that were
926 2007-01-25 Marek Safar <marek.safar@gmail.com>
928 * expression.cs (CheckUselessComparison): Add additional check for char
931 * namespace.cs: Fixed typo.
933 2007-01-23 Miguel de Icaza <miguel@novell.com>
935 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
936 gone, instead we inline the test, preventing the needless casts to
937 longs, ulongs and doubles for the parameters, avoiding calls to
938 methods that overchecked stuff, and instead inlined things
941 2007-01-20 Marek Safar <marek.safar@gmail.com>
943 * cs-parser.jay: Better parameter error handling.
945 2007-01-17 Marek Safar <marek.safar@gmail.com>
947 A fix for bug #80368, #80522
948 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
949 whether array initializer contains constants only.
950 (ArrayCreation.Emit): Use better formula to decide when
951 are array initializers for static initialization.
952 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
953 have to emit even constants otherwise they are pre-initialized.
955 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
956 Raja R Harinath <rharinath@novell.com>
958 Fix emit order of 'get' vs. 'set'.
959 * support.cs (Accessors): New.
960 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
961 Note the order in which accessors are declared in the source.
962 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
963 Refactored from Property.Define and Indexer.Define.
964 (PropertyBase.DefineAccessors): New helper that calls the above in
965 appropriate order as noted by the parser.
966 (Property.Define, Indexer.Define): Update to changes.
967 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
969 2007-01-17 Raja R Harinath <rharinath@novell.com>
971 Fix cs0029-6.cs and gcs0029-2.cs (regression)
972 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
973 there's an implicit conversion from the current type to the target
974 type before converting the underlying constant.
976 2007-01-16 Marek Safar <marek.safar@gmail.com>
978 * const.cs (ResolveValue): Updated after constant conversion was made more
981 * constant.cs (GetAttributableValue): constant to object conversion is
982 used for attributes only.
983 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
984 constant conversions.
985 (LongConstant.ConvertImplicitly): Ditto.
987 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
988 (ImplicitConversionStandard): Handle constant conversion as extra step.
989 It solves the issue when constant conversion was called indirectly like
990 inside array initializer and constant folding was skipped.
992 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
995 * statement.cs(ImplicitConversionStandard): Updated after constant
996 conversion was made more generic.
998 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
1000 * expression.cs (As.DoResolve): Use GenericConstraints instead of
1001 Constraints, solves the problem where the compiler incorrectly
1002 reported that a type parameter was not constrained to a class (Bug
1005 2007-01-14 Marek Habersack <grendello@gmail.com>
1007 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1009 2007-01-14 Marek Safar <marek.safar@gmail.com>
1011 A fix for bug #80368
1012 * assign.cs (FieldInitializer): New class implements field
1013 initializer statement.
1015 * attribute.cs: Update after FieldMember rename.
1017 * class.cs (PropertyBasedMember): New common class for property based
1019 (InterfaceMemberBase): New base class for all members which can be used as
1020 an interface members.
1021 (MethodCore): Moved really common code to InterfaceMemberBase.
1022 (Method.Define): Equal and GetHasCode detection is relevant for methods
1024 (MethodData.Define): Don't assume that public event implements an
1025 interface automatically.
1026 (MethodData.DefineMethodBuilder): Issue an error even if only extern
1028 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1029 (FieldMember): Merged with FieldBase.
1030 (EventProperty.AEventPropertyAccessor): New specialization to check whether
1031 event extern modifier can be used.
1032 (EventField.EventFieldAccessor): Moved event field specific code here.
1033 (Event.AllowedModifiers): Even event can be extern.
1034 (Event.FindOutBaseMethod): New override specific to events.
1035 (Indexer.parameters): Reintroduce parameters because base class holds
1036 only properties common data.
1037 (Indexer.CheckForDuplications): Indexers are threated as methods so we
1038 need do extra parameters check.
1040 * const.cs: Update after FieldMember rename.
1042 * decl.cs (MemberCache.FindBaseEvent): New method.
1044 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1045 to reflect that indexer is now derived from PropertyBased.
1047 * ecore.cs (GetMemberType): Made public.
1048 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1051 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1053 * typemanager.cs (CSharpSignature): Correctly print event accessors.
1054 (RegisterEvent): Removed.
1055 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1056 (GetPrivateFieldOfEvent): Renamed to GetEventField.
1058 2007-01-11 Raja R Harinath <rharinath@novell.com>
1061 * statement.cs (CollectionForeach.TryType): Prefer generic
1062 GetEnumerator over non-generic variant. Fix code to follow comments.
1064 2007-01-09 Raja R Harinath <rharinath@novell.com>
1067 * support.cs (ReflectionParameter): Don't use an invalid index on
1068 the generic parameter data.
1070 2007-01-08 Miguel de Icaza <miguel@novell.com>
1072 * driver.cs: Just add a tiny bit of infrastructure.
1074 2007-01-02 Marek Safar <marek.safar@gmail.com>
1076 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1077 where field type is struct from current assembly.
1079 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1082 2007-01-02 Marek Safar <marek.safar@gmail.com>
1084 A fix for bug #80381
1085 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1088 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1090 (Namespace.LookupType): Always use core types from corlib when speficied.
1092 * report.cs: A new warning.
1094 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1095 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1096 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1098 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1099 (InitCoreTypes): Set expression type of object_type and value_type
1100 immediately after lookup.
1102 2007-01-01 Miguel de Icaza <miguel@novell.com>
1104 * cs-tokenizer.cs: Accept Pc class characters (Connector
1105 Punctuation) as valid identifiers. Fixes #78259
1107 * expression.cs (Invocation.DoResolve): Moved the check for the
1108 use of `this' for doing method calls to the Invocation resolution
1109 step, after overload resolution has taken place instead of doing
1110 the check at the low-level `This.DoResolve' level.
1112 The `This.DoResolve'Â happens before overload resolution, so it has
1113 no way of knowing if the method that will be called will be
1114 instace or static, triggering an erroneous report for cs0188 (Bug
1117 We now do the check for instance method invocations after we know
1118 what method will be called.
1120 (This.CheckThisUsage): Move the actual use of this structure
1121 checking into its own method and expose it.
1123 * Everywhere that called Error_ValueCannotBeConverted: pass a new
1126 Exceptions: Null.ConvertImplicitly,
1127 Constant.ImplicitConversionRequired as there are too many call
1128 sites for passing the ec.
1130 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1131 EmitContext, if the value is null, then we do not try to provide
1132 the extra information from the error (If a userdefined conversion
1133 exists, as UserDefinedConversion requires a non null-EmitContext).
1137 2006-12-30 Raja R Harinath <rharinath@novell.com>
1139 * flowanalysis.cs (MyBitVector): Document some invariants.
1140 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1141 introduced below, and add a couple of others,
1143 2006-12-30 Marek Safar <marek.safar@gmail.com>
1145 * attribute.cs (GetMethodObsoleteAttribute): Uses new
1146 GetPropertyFromAccessor and GetEventFromAccessor.
1148 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1149 overrides non-obsolete one.
1150 (Indexer.Define): Error message has been moved to the parser.
1152 * cs-parser.jay: Better syntax errors handling.
1154 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1155 when an invocation has no arguments.
1157 * ecore.cs: Removed not used caching.
1159 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1162 * report.cs: Add a new warning.
1164 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1166 * typemanager.cs (enumeration_type): Removed.
1167 (CSharpSignature): Reuses IsSpecialMethod.
1168 (IsEqual): Hack for MS BCL.
1169 (GetPropertyFromAccessor): New method.
1170 (GetEventFromAccessor): New method.
1171 (IsSpecialMethod): Fixed to handle more cases.
1173 2006-12-30 Marek Safar <marek.safar@gmail.com>
1175 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1176 Made white spaces array static.
1178 * ecore.cs (RemoveGenericArity): Optimized.
1180 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1182 (MyBitVector.initialize_vector): Simplified.
1184 2006-12-22 Miguel de Icaza <miguel@novell.com>
1186 * ecore.cs: Am not entirely happy with this hack, but it seems to
1187 address the issue in 80257 (a small test case for
1190 I set the MethodGroupExpr.Type to an internal compiler type
1191 (itself in this case) to force the resolution to take place. Why
1192 it does not take place with a null is beyond me.
1194 2006-12-20 Marek Safar <marek.safar@gmail.com>
1196 A fix for bug #80288
1197 * expression.cs (ResolveOperator): Consider user defined conversion for
1198 logical and operator too.
1199 (EmitBranchable): Optimization for logical and when full constant folding
1200 could not be applied but one operand is constant.
1202 2006-12-19 Marek Safar <marek.safar@gmail.com>
1204 * class.cs (GetClassBases): Write 5 times every day, will never use
1205 FullName for error reporting.
1207 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1209 2006-12-19 Martin Baulig <martin@ximian.com>
1211 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1212 the symbol file info here.
1214 2006-12-18 Marek Safar <marek.safar@gmail.com>
1216 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1217 of `elseif' is taking then following sections are not taking.
1218 Fixes an issue reported on mono mailing list.
1220 2006-12-18 Marek Safar <marek.safar@gmail.com>
1222 A fix for bug #80300
1223 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1224 a caller is not taking.
1226 2006-12-18 Raja R Harinath <rharinath@novell.com>
1228 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1229 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1230 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1231 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1232 * class.cs: Update to changes.
1234 2006-12-17 Marek Safar <marek.safar@gmail.com>
1236 A fix for bug #79934
1237 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1240 * class.cs (ResolveMembers): Register an iterator in current container and
1243 2006-12-16 Raja R Harinath <rharinath@novell.com>
1246 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1247 satisfy a params annotated parameter.
1249 2006-12-16 Marek Safar <marek.safar@gmail.com>
1251 A fix for bug #77014
1252 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1253 paramters correctly and not rely on hacks in Parameters class.
1254 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1256 (Invocation.VerifyArgumentsCompat): Ditto.
1257 (Invocation.EmitArguments): Changed to correctly emit params arguments at
1260 * parameter.cs (HasParams): Don't assume that params is the last one.
1262 * support.cs (ReflectionParameters.ctor): Look for params attribute
1264 (ReflectionParameters.ParameterType): Removed hack when we returned last
1265 parameter for out of range parameters.
1266 (ParameterName, ParameterModifier): Ditto.
1268 2006-12-14 Marek Safar <marek.safar@gmail.com>
1270 A fix for bug #79987
1271 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1272 when assembly is not CLS compliant but type is. I have no idea why is this
1275 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1277 2006-12-13 Miguel de Icaza <miguel@novell.com>
1279 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1280 in struct constructors, they are basically no-ops.
1282 2006-12-12 Marek Safar <marek.safar@gmail.com>
1284 * cs-tokenizer.cs (Position): Save preprocessor status too.
1286 2006-12-12 Marek Safar <marek.safar@gmail.com>
1288 A fix for bug #77794
1289 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1291 2006-12-12 Marek Safar <marek.safar@gmail.com>
1293 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1295 (pp_expr): Report error for an invalid expression.
1296 (handle_preprocessing_directive): Simplified; add more error checking.
1298 2006-12-11 Marek Safar <marek.safar@gmail.com>
1300 A fix for bug #74939
1301 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1302 directives handling.
1304 2006-12-10 Marek Safar <marek.safar@gmail.com>
1306 A fix for bugs #80093, and #75984
1307 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1308 logic, it seems to me as it worked before "by coincidence".
1309 (xtoken): Simplified to use reworked handle_preprocessing_directive.
1310 (cleanup): Enabled endif check.
1312 2006-12-09 Marek Safar <marek.safar@gmail.com>
1314 A fix for bug #80162
1315 * statement.cs (CollectionForeach.TryType): Generics and non-generics
1316 enumerators are never ambiguous.
1318 2006-12-08 Raja R Harinath <rharinath@novell.com>
1321 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1323 2006-12-06 Marek Safar <marek.safar@gmail.com>
1325 A fix for bug #80144
1326 * class.cs (EventProperty.Define): Explicit implementation means
1327 that an even is used.
1329 2006-12-06 Marek Safar <marek.safar@gmail.com>
1331 Fixes the operators implementation (part II)
1333 * cfold.cs (DoConstantNumericPromotions): Renamed to
1334 DoBinaryNumericPromotions and simplified.
1335 (BinaryFold): Couple of conversion fixes; simplified.
1337 * constant.cs, ecore.cs, literal.cs
1338 (ToType): Renamed to ConvertImplicitly.
1339 (Reduce): Renamed to ConvertExplicitly.
1341 * class.cs, convert.cs: Updated.
1343 * expression.cs: TryReduce doesn't throw an exception.
1345 2006-12-01 Marek Safar <marek.safar@gmail.com>
1347 A fix for bug #80108
1348 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1351 2006-11-30 Marek Safar <marek.safar@gmail.com>
1353 Fixes unary operators implementation (part I)
1356 * cfold.cs (Error_CompileTimeOverflow): Made internal
1358 * const.cs (IConstant): Changed to use reference to constant and
1359 not constant itself.
1360 Updated IConstant implementations.
1362 * constant.cs (CreateConstant): New factory method.
1363 Updated IConstant implementation.
1365 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1367 * ecore.cs: Updated to use CreateConstantReference.
1369 * enum.cs: Reflects IConstant changes.
1371 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1373 * literal.cs (NullConstant): Change to be independently usable.
1375 2006-11-29 Martin Baulig <martin@ximian.com>
1377 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1378 we need to emit the scope initializer before calling the base .ctor.
1380 * anonymous.cs: Merged back from the new anonymous methods branch.
1381 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1383 * expression.cs (ParameterReference.DoResolveBase): Create a
1384 "normal" ScopeInfo when capturing parameters rather than using the
1385 root scope; this makes things work with anonymous methods having
1389 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1391 2006-11-22 Marek Safar <marek.safar@gmail.com>
1393 A fix for bug #79987
1394 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1395 check to a base class.
1396 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1397 only when assembly has missing attribute.
1398 * report.cs: Update.
1400 2006-11-21 Marek Safar <marek.safar@gmail.com>
1402 * cs-tokenizer.cs: Merged with gmcs version.
1404 2006-11-20 Marek Safar <marek.safar@gmail.com>
1407 * cs-parser.jay: Better error message when partial keyword is misplaced.
1409 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
1411 A fix for bug #79810
1412 report.cs: CS1058 only applies to 2.0 profile (gmcs).
1413 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1414 a RuntimeWrappedException by default.
1416 2006-11-18 Marek Safar <marek.safar@gmail.com>
1418 A fix for bug #79843
1419 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1421 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1423 2006-11-18 Marek Safar <marek.safar@gmail.com>
1425 * driver.cs, namespace.cs: Uses faster IndexOf version.
1427 2006-11-17 Marek Safar <marek.safar@gmail.com>
1429 A fix for bug #79941
1430 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1432 (Operator.Define): Implicit/Explicit operator of same type is duplicate
1433 even if internal name is different.
1434 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1435 (UserDefinedConversion): Simplified as the operators cannot be internal.
1436 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1438 (MethodLookup): Replaced EmitContext with parentType.
1439 * expression.cs: Updated.
1441 2006-11-09 Raja R Harinath <rharinath@novell.com>
1443 * driver.cs (BadAssembly): Handle all the ugliness of
1444 DefineDynamicAssembly.
1446 2006-11-08 Raja R Harinath <rharinath@novell.com>
1448 Address parts of #58244 -- most of what's left is in the runtime
1449 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
1450 CS1509 error checks, and handle them for all assembly loads, not
1451 just the first invocation.
1452 (LoadModule): Likewise. Move handling of 'adder_method' ...
1453 * codegen.cs (AssemblyClass.AddModule): ... here.
1455 2006-11-02 Marek Safar <marek.safar@gmail.com>
1457 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1458 IEnumerable<T> is ambiguous.
1460 2006-10-31 Marek Safar <marek.safar@gmail.com>
1462 A fix for bug #67689
1463 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1464 GetEnumerator is ambiguous.
1466 * report.cs: Add new warning.
1468 2006-10-29 Marek Safar <marek.safar@gmail.com>
1470 A fix for bug #78602
1471 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1472 to protected member can be nested type.
1474 2006-10-28 Marek Safar <marek.safar@gmail.com>
1476 A fix for bug #78965
1477 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1478 to protected member must derive from current type.
1480 2006-10-27 Marek Safar <marek.safar@gmail.com>
1482 assign.cs: Reuses error method.
1484 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1485 instead of type for constants.
1486 (Expression.Error_ValueAssignment): Common error method.
1488 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1491 2006-10-27 Marek Safar <marek.safar@gmail.com>
1493 A fix for bug #79081
1494 * expression.cs (MemberAccess.DoResolve): Check nested type
1497 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
1499 * doc.cs : nested delegates were not handled. Fixed bug #79754.
1501 2006-10-26 Marek Safar <marek.safar@gmail.com>
1503 A fix for bug #76591
1504 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1506 2006-10-26 Marek Safar <marek.safar@gmail.com>
1508 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1509 type forwarder of the same type multiple times.
1511 2006-10-26 Raja R Harinath <rharinath@novell.com>
1514 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1515 instance as an rvalue, even when we later resolve as an lvalue.
1517 2006-10-25 Martin Baulig <martin@ximian.com>
1519 * anonymous.cs: Fix #79673.
1521 2006-10-24 Marek Safar <marek.safar@seznam.cz>
1523 A fix for bug #79666
1524 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1525 ignored when is optimized (= default value) as its value is already set.
1527 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1529 A fix for bug #79724
1530 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1531 TypeContainer for type lookup.
1533 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1535 A fix for bug #79231
1536 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1537 * expression.cs (OverloadResolve): Always convert type name for
1539 (ResolveNamespaceOrType): Don't confuse a nested type with any
1542 2006-10-18 Martin Baulig <martin@ximian.com>
1544 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1546 2006-10-17 Miguel de Icaza <miguel@novell.com>
1548 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1549 an int32, but requesting an int64 from the conversion
1551 2006-10-12 Martin Baulig <martin@ximian.com>
1554 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
1556 2006-10-12 Martin Baulig <martin@ximian.com>
1559 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1561 2006-10-11 Miguel de Icaza <miguel@novell.com>
1563 * convert.cs: Remove broken code: I was doing the "Existance"
1564 tests for Implicit conversions.
1566 2006-10-10 Miguel de Icaza <miguel@novell.com>
1568 * convert.cs: Added one missing case in
1569 ImplicitStandardConversionExists uint64 to intptr.
1573 * typemanager.cs (uintptr_type): another core known type.
1575 * ecore.cs (OperatorCast): routine used to do cast operations that
1576 depend on op_Explicit. We could change some of the Decimal
1577 conversions to use this.
1579 This one has a probe mechanism that checks both types for an op_
1580 which it coudl be used to eliminate two classes: CastToDecimal
1581 and CastFromDecimal.
1583 * convert.cs: Implement the conversions documented in #59800
1585 2006-10-10 Martin Baulig <martin@ximian.com>
1587 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1588 before RootScope.ResolveMembers().
1590 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1591 `CurrentType' if appropriate.
1593 2006-10-09 Marek Safar <marek.safar@seznam.cz>
1595 A fix for bug #78568
1596 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1597 when contains binary operators.
1598 * cs-parser.jay: Updated.
1600 2006-10-09 Martin Baulig <martin@ximian.com>
1603 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1604 moved that into Define() and also do the other type parameter
1605 checks there. Fixes #79094. Added gtest-292.cs.
1608 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1609 since that doesn't include type parameters; don't use `Ldelema'
1610 for type parameters. Fixes #78980. Added gtest-293.cs.
1612 2006-10-08 Marek Safar <marek.safar@seznam.cz>
1615 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1616 conversion is allowed.
1618 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1620 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1621 error reporting when no error occurs.
1623 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1625 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1628 2006-10-06 Raja R Harinath <rharinath@novell.com>
1631 * class.cs (DefineTypeBuilder): Check circular dependencies before
1632 setting the parent of the TypeBuilder.
1633 (CheckRecursiveDefinition): Don't use 'BaseType', since
1634 it may not be valid until after DefineTypeBuilder. Use
1635 'base_type' instead.
1637 2006-10-04 Martin Baulig <martin@ximian.com>
1639 Merged the Anonymous Methods patch.
1641 * anonymous.cs, iterators.cs: The new anonymous methods code.
1643 * statement.cs (Variable): New public abstract class.
1644 (LocalInfo.Variable): New public property.
1645 (LocalInfo.ResolveVariable): New public method.
1646 (Block.Flags): Add `IsIterator'.
1647 (Block.AddVariable): Improved the CS0136 check.
1648 (Block.AnonymousChildren): New public property.
1649 (Block.AddAnonymousChild): New public method.
1650 (ToplevelBlock): Update to use the new anonymous method framework.
1651 (ToplevelBlock.ctor): `container' is now a `Block' and not a
1652 `ToplevelBlock'; this is required to correctly implement the
1654 (Fixed, Using): Use `TemporaryVariable' instead of directly
1655 creating the `LocalBuilder'.
1657 * parameter.cs (Parameter.ResolveVariable): New public method.
1658 (Parameters.ResolveVariable): Likewise.
1660 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1662 * class.cs (TypeContainer): Replaced the `iterators' list and
1663 corresponding methods with a list of `CompilerGeneratedClass'es.
1664 (TypeContainer.ResolveMembers): New public method.
1665 (Method): `IIteratorContainer' has been replaced by
1668 * expression.cs (VariableReference): New public abstract base
1669 class for `LocalVariableReference', `ParameterReference' and
1672 * codegen.cs (EmitContext): Removed `capture_context',
1673 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1674 (EmitContext.EmitThis): Removed.
1676 * cs-parser.jay: Replace `iterator_container' with
1679 2006-10-04 Martin Baulig <martin@ximian.com>
1681 * generic.cs (GenericMethod): Don't make this abstract.
1682 (Constraints.Clone): Added dummy implementation.
1684 2006-10-04 Raja R Harinath <harinath@gmail.com>
1687 * namespace.cs (LookForAnyGenericType): Avoid nullref on
1688 'declspaces'. Avoid allocating arrays willy-nilly.
1691 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1692 cases out of the switch.
1694 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1696 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1697 message when non-generic type is used with the type arguments.
1698 * expression.cs: Updated.
1700 2006-09-28 Raja R Harinath <rharinath@novell.com>
1703 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1704 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1705 Change semantics slightly. Don't insist on having only one
1706 temporary EmptyExpression -- just throttle the creation of new ones.
1709 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1710 non-interfaces too. If no methods are found, don't try to create
1713 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1715 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1718 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1719 us produce better error message.
1721 2006-09-27 Marek Safar <marek.safar@seznam.cz>
1723 * expression.cs (Binary.ResolveOperator): Warn about a side effect
1724 of the `|' operator.
1726 * report.cs: A new warning added.
1728 2006-09-27 Martin Baulig <martin@ximian.com>
1730 * generic.cs (GenericMethod): Don't make this abstract.
1732 2006-09-27 Martin Baulig <martin@ximian.com>
1735 (InternalErrorException): Added overloaded ctor taking a params array.
1737 2006-09-26 Marek Safar <marek.safar@seznam.cz>
1739 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1740 Fixed the cases when same error was reported twice.
1742 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1743 now report symbol information.
1745 2006-09-25 Martin Baulig <martin@ximian.com>
1747 * class.cs: Completely unified with the gmcs version.
1749 2006-09-25 Martin Baulig <martin@ximian.com>
1751 * typemanager.cs (TypeManager.IsNullableType): New public function.
1752 (TypeManager.IsNullableTypeOf): Likewise.
1753 (TypeManager.IsNullableValueType): Likewise.
1755 * class.cs (MethodCore): Added the `GenericMethod' argument from
1756 gmcs and also unified all classes derived from `MethodCore' with gmcs.
1758 2006-09-24 Raja R Harinath <harinath@gmail.com>
1760 * convert.cs: Unify with gmcs version.
1762 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1764 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1765 verify them as well.
1767 * report.cs: New warning.
1769 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1771 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1772 for anonymous block with out argument.
1774 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1776 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1777 not used private events only.
1779 2006-09-23 Marek Safar <marek.safar@seznam.cz>
1781 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1783 * const.cs (Const.Define): Check for constant type.
1784 (Const.IsConstantTypeValid): Looks for valid constant types.
1786 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1788 * ecore.cs (EmptyConstantCast): New common class for all constant based
1791 * expression.cs (Is.DoResolve): Handle null constant especially.
1792 (New.DoResolve): Check for new void().
1793 (MemberAccess.DoResolve): Cope with all kind of nulls.
1795 * literal.cs (NullConstant): Uses EmptyConstantCast.
1796 (NullDefault): Based on EmptyConstantCast.
1797 (NullLiteral): Uses EmptyConstantCast.
1799 * statement.cs (Block.ResolveMeta): Check for constant type.
1801 2006-09-22 Martin Baulig <martin@ximian.com>
1803 * delegate.cs, attribute.cs: Merged with the gmcs versions.
1805 2006-09-22 Raja R Harinath <rharinath@novell.com>
1807 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1811 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1812 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
1815 2006-09-22 Martin Baulig <martin@ximian.com>
1817 * ecore.cs: Merged with the gmcs version.
1819 * generic.cs (ConstructedType): New dummy class.
1820 (TypeArguments): Don't make this abstract.
1823 (TypeManager.IsGenericTypeDefinition): New method.
1824 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1826 2006-09-22 Raja R Harinath <rharinath@novell.com>
1828 * expression.cs (ComposedCast): Check for arrays of TypedReference
1829 before creating the type, not after.
1831 2006-09-21 Marek Safar <marek.safar@seznam.cz>
1833 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1834 after ToType change.
1836 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1837 when constant must be implicitly convertible.
1839 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1841 * ecore.cs (NullCast): Derives from NullConstant.
1843 * expression.cs (Is.DoResolve): Removed useless variables.
1844 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1845 (New.Constantify): Add enum support.
1846 (MemberAccess.DoResolve): Add warning when accessing null constant or
1849 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1852 * literal.cs (NullConstant): New abstract class with common
1853 functionality for all null specializations.
1854 (NullDefault): Represents default(X) when result can be
1856 (NullLiteral): Updated.
1858 * report.cs: Add new warning.
1860 2006-09-21 Martin Baulig <martin@ximian.com>
1862 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1864 2006-09-21 Martin Baulig <martin@ximian.com>
1866 * generic.cs (GenericConstraints): New dummy class.
1867 (Constraints): Likewise.
1868 (TypeParameter): Likewise.
1869 (TypeParameterName): Likewise.
1870 (GenericMethod): Likewise.
1872 * typemanager.cs (TypeManager.GetGenericArguments): New method.
1874 * decl.cs: Merged with the gmcs version.
1876 2006-09-21 Raja R Harinath <rharinath@novell.com>
1878 * generic.cs (TypeParameter): Implement IMemberContainer.
1879 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
1881 * rootcontext.cs: Unify with gmcs version.
1883 * report.cs: Unify with gmcs version.
1884 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1885 from gmcs/generics.cs.
1886 * generics.cs (TypeParameter): New dummy class.
1888 * support.cs: Unify with gmcs version.
1890 2006-09-20 Raja R Harinath <rharinath@novell.com>
1892 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1893 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1895 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1896 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1897 * mcs.exe.sources: Add generic.cs.
1899 * codegen.cs: Unify with gmcs version.
1901 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1902 (EmitContext): Add GenericDeclContainer implementation.
1903 * decl.cs (MemberCore, DeclSpace): Likewise.
1904 * namespace.cs: Remove #ifdef GMCS_SOURCE.
1906 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1907 MCS TypeManager has a corresponding dummy method.
1909 2006-09-19 Martin Baulig <martin@ximian.com>
1911 * expression.cs: Completely merged with the gmcs version.
1913 2006-09-19 Martin Baulig <martin@ximian.com>
1915 * expression.cs (Invocation): Merged with the gmcs version.
1916 (ArrayAccess.GetStoreOpcode): Likewise.
1918 2006-09-19 Martin Baulig <martin@ximian.com>
1921 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1922 (TypeManager.IsGenericMethodDefinition): Likewise.
1924 2006-09-19 Martin Baulig <martin@ximian.com>
1927 (TypeManager.IsEqual): Moved the gmcs implementation here.
1928 (TypeManager.DropGenericTypeArguments): Likewise.
1929 (TypeManager.DropGenericMethodArguments): Likewise.
1930 (TypeManager.GetTypeArguments): Moved here from gmcs.
1931 (TypeManager.HasGenericArguments): Likewise.
1933 2006-09-19 Martin Baulig <martin@ximian.com>
1935 * expression.cs (Binary): Merged with the gmcs version.
1937 2006-09-19 Martin Baulig <martin@ximian.com>
1939 * expression.cs (Probe, As, Is): Merged with the gmcs version.
1941 2006-09-19 Martin Baulig <martin@ximian.com>
1943 * typemanager.cs: Merged with the gmcs version.
1945 2006-09-16 Raja R Harinath <rharinath@novell.com>
1947 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1948 * driver.cs: Likewise.
1950 2006-09-16 Marek Safar <marek.safar@seznam.cz>
1953 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1954 only if parent type is class.
1955 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1958 2006-09-15 Marek Safar <marek.safar@seznam.cz>
1961 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1963 * typemanager.cs(CSharpName): Converts NullType to null.
1965 2006-09-15 Martin Baulig <martin@ximian.com>
1968 (TypeManager.GetMethodName): Added mcs implementation.
1969 (TypeManager.IsEqual): Likewise.
1972 (SimpleName.RemoveGenericArity): Added dummy implementation.
1974 * pending.cs: Merged with the gmcs version.
1976 2006-09-15 Martin Baulig <martin@ximian.com>
1978 * statement.cs: Merge with the gmcs version.
1980 2006-09-15 Martin Baulig <martin@ximian.com>
1982 * statement.cs (Switch): Merge with the gmcs implementation
1983 (without nullables), which is newer.
1985 2006-09-15 Martin Baulig <martin@ximian.com>
1987 * statement.cs (Block.Variables): Make this public.
1988 (ToplevelBlock.Parameters): Make this a property.
1989 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1991 2006-09-15 Martin Baulig <martin@ximian.com>
1993 * namespace.cs: Merge with the gmcs version.
1995 2006-09-15 Martin Baulig <martin@ximian.com>
1997 * decl.cs (MemberName): Minor code cleanups.
1999 2006-09-15 Martin Baulig <martin@ximian.com>
2001 * parameter.cs: Merge with the gmcs version.
2003 2006-09-15 Martin Baulig <martin@ximian.com>
2005 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2006 and an error in mcs.
2008 2006-09-15 Martin Baulig <martin@ximian.com>
2010 * flowanalysis.cs: Merged from GMCS; added the generics code into
2011 a `GMCS_SOURCE' conditional so we can share this file.
2013 2006-09-08 Martin Baulig <martin@ximian.com>
2015 * typemanager.cs (TypeManager.interlocked_type): New public field.
2016 (TypeManager.int_interlocked_compare-exchange): New public field.
2017 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2018 enumerator types here and call InitGenericCoreTypes().
2019 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2020 after calling InitEnumUnderlyingTypes().
2023 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2024 `classes_second_stage'.
2026 2006-09-14 Marek Safar <marek.safar@seznam.cz>
2028 * assign.cs, ecore.cs, expression.cs: Share error message text.
2029 * class.cs (FieldMember.Define): Check for varible of static type.
2030 * driver.cs (LoadAssembly): Uses error output for errors.
2031 * statement.cs: Updated.
2033 2006-09-08 Marek Safar <marek.safar@seznam.cz>
2035 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2038 2006-09-07 Martin Baulig <martin@ximian.com>
2041 (MainDriver): Revert r62663 from Marek; see #70506 for details.
2043 2006-08-29 Miguel de Icaza <miguel@novell.com>
2045 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2047 2006-08-17 Miguel de Icaza <miguel@novell.com>
2049 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2050 #52019 and #79064, the use of the \uXXXX sequence in source code
2051 to represent unicode characters.
2053 2006-08-15 Marek Safar <marek.safar@seznam.cz>
2055 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2057 * class.cs, ecore.cs, statement.cs: Merged to one error message.
2059 2006-08-13 Miguel de Icaza <miguel@novell.com>
2061 * assign.cs: Catch attempts to assign to a method groups in += and
2064 2006-08-13 Marek Safar <marek.safar@seznam.cz>
2067 * cs-parser.jay: Don't destroy current array type by typeof of array's.
2069 2006-08-12 Marek Safar <marek.safar@seznam.cz>
2071 * class.cs (Method.Define): Issue a warning when generic method looks like
2073 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2076 2006-08-09 Marek Safar <marek.safar@seznam.cz>
2078 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2080 * decl.cs (MemberCache.FindMembers): When container is interface we need to
2081 search all base interfaces as a member can be ambiguous.
2082 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2083 Constructor member type filter.
2084 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2085 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2086 reporting for returned memberinfos.
2087 * report.cs: Updated.
2088 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2089 version to work on all runtimes.
2090 (TypeManager.RealMemberLookup): Removed members filtering.
2092 2006-08-08 Raja R Harinath <rharinath@novell.com>
2094 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2095 (PropertyExpr.EmitAssign): Likewise.
2096 * expression.cs (Indirection.EmitAssign): Likewise.
2097 (LocalVariableReference.EmitAssign): Likewise.
2098 (ParameterReference.EmitAssign): Likewise.
2099 (Invocation.EmitArguments): Likewise.
2100 (ArrayAccess.EmitAssign): Likewise.
2101 (IndexerAccess.EmitAssign): Likewise.
2102 (This.EmitAssign): Likewise.
2103 (ConditionalLogicalOperator.Emit): Likewise.
2106 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
2107 instead of ArrayList. If the hashtable has a LocalBuilder, don't
2108 leave it in after returning it.
2109 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
2111 2006-08-06 Marek Safar <marek.safar@seznam.cz>
2113 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2116 2006-08-03 Raja R Harinath <rharinath@novell.com>
2118 Fix cs0146-3.cs and cs0146-4.cs.
2119 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2120 enclosing types don't depend on the current type.
2122 2006-08-02 Raja R Harinath <rharinath@novell.com>
2125 * class.cs (TypeContainer.DoDefineMembers): Use
2126 FindBaseMemberWithSameName on Parent, since we're interested in
2127 whether we hide inherited members or not.
2128 (FindBaseMemberWithSameName): Make slightly more robust.
2130 Fix the non-generic testcase from #77396
2131 * decl.cs (DeclSpace.DeclContainer): Remove override.
2133 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2134 declspaces for doppelgangers too.
2135 (UsingEntry): Implement IResolveContext.
2136 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
2137 'this' as the resolve context.
2138 (LocalAliasEntry): Likewise.
2140 Implement parts of #77403
2141 * roottypes.cs (RootDeclSpace): New. Used to represent the
2142 toplevel declaration space. Each namespace declaration introduces
2143 a "partial" root declaretion space.
2144 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2145 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2146 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2147 from 'current_namespace.SlaveDeclSpace'.
2148 (namespace_declaration): Likewise.
2149 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2150 check. It can't happen now.
2151 * decl.cs (DeclSpace.LookupType): Likewise.
2152 * driver.cs (MainDriver): Sanity check.
2154 2006-08-01 Raja R Harinath <rharinath@novell.com>
2156 * decl.cs (DeclSpace.FindNestedType): Remove.
2157 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2158 LookupTypeContainer to get the container of the nested type.
2159 * class.cs (TypeContainer.FindNestedType): Make non-override.
2161 2006-07-31 Raja R Harinath <rharinath@novell.com>
2163 * decl.cs (DeclSpace.PartialContainer): Move field from ...
2164 * class.cs (TypeContainer.PartialContainer): ... here.
2165 (TypeContainer.AddBasesForPart): New helper.
2166 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
2168 * cs-parser.jay (current_class): Convert to DeclSpace.
2169 (struct_declaration, interface_declaration, class_declaration):
2170 Use AddBasesForPart instead of .Bases directly.
2171 * const.cs, iterators.cs: Update to changes.
2173 2006-07-28 Raja R Harinath <rharinath@novell.com>
2175 * class.cs (TypeContainer.AddMemberType): Rename from
2177 (TypeContainer.AddMember): Rename from AddToMemberContainer.
2178 (AddTypeContainer): New. Combine AddClassOrStruct and
2180 (AddPartial): Update. Add 'is_partial' argument.
2181 * roottypes.cs: Update to changes.
2182 * cs-parser.jay (push_current_class): New helper for handling
2183 current_container and current_class.
2184 (struct_declaration, interface_declaration, class_declaration):
2187 2006-07-26 Raja R Harinath <rharinath@novell.com>
2189 * roottypes.cs: Rename from tree.cs.
2191 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2192 * tree.cs (Tree, ITreeDump): Remove types.
2193 * rootcontext.cs (tree, Tree): Remove fields.
2194 (root, ToplevelTypes): New.
2195 * *.cs: Update to rename.
2197 * tree.cs (Tree.RecordDecl): Remove.
2198 (RootTypes.AddToTypeContainer): Record the toplevel type in its
2200 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2202 2006-07-23 Raja R Harinath <harinath@gmail.com>
2204 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2205 DoFlowAnalysis and OmitStructFlowAnalysis here.
2206 (ec.With): Rename from WithUnsafe and generalize.
2207 (ec.WithCheckState): Remove. All users can be handled by 'With'.
2208 (ec.WithFlowAnalyis): New.
2209 * ecore.cs, expression.cs, statement.cs: Update.
2211 2006-07-22 Raja R Harinath <harinath@gmail.com>
2213 * statement.cs (Block.ResolveMeta): Simplify slightly.
2215 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
2216 multiple boolean fields. Convert InUnsafe, constant_check_state,
2217 check_state to flags.
2218 (CheckState, ConstantCheckState): Update.
2219 (InUnsafe): New read-only property.
2220 (FlagsHandle): Rename from CheckStateHandle and convert to handle
2222 (WithUnsafe): New helper similar to WithCheckState.
2223 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2224 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2226 2006-07-21 Raja R Harinath <rharinath@novell.com>
2228 Make comparisons use the same IL irrespective of whether they're
2229 in a 'checked' or 'unchecked' context: one of the issues in #78899
2230 * codegen.cs (EmitContext.CheckState): Make read-only property.
2231 (EmitContext.ConstantCheckState): Likewise.
2232 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2233 helper that implement a save/restore stack for CheckState
2234 values. This is the only way to change check-state.
2235 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2236 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2237 (CheckedExpr.EmitBranchable): New forwarding method.
2238 (UnCheckedExpr): Likewise.
2239 * statement.cs (Block.ResolveMeta): Use WithCheckState.
2240 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2241 (Checked.Resolve, checked.DoEmit): Likewise.
2243 2006-07-20 Miguel de Icaza <miguel@novell.com>
2245 * anonymous.cs: Cache the resolved anonymous delegate, and return
2246 this so that the ResolveTopBlock is only triggered once, not
2249 Currently we trigger ResolvetopBlock twice due to a first pass of
2250 argument check compatibility, and a second pass that does the
2253 2006-07-15 Marek Safar <marek.safar@seznam.cz>
2255 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2257 * rootcontext.cs (Reset): Add helper_classes.
2259 2006-07-15 Marek Safar <marek.safar@seznam.cz>
2262 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2265 2006-07-13 Miguel de Icaza <miguel@novell.com>
2267 * statement.cs (Lock): Handle expressions of type
2268 TypeManager.null_type specially. Fixes #78770
2270 2006-07-08 Marek Safar <marek.safar@seznam.cz>
2272 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2275 2006-07-08 Marek Safar <marek.safar@seznam.cz>
2277 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2278 for accessors as well.
2279 * ecore.cs (EventExpr): Add AccessorTable.
2281 2006-07-01 Marek Safar <marek.safar@seznam.cz>
2284 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2285 for CS0122 where appropriate.
2286 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2288 (Filter): Assembly can be null in the case of top level attributes.
2290 2006-06-25 Marek Safar <marek.safar@seznam.cz>
2294 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2295 is done at global level.
2297 2006-06-24 Marek Safar <marek.safar@seznam.cz>
2299 A fix for #77002, Implemented TypeForwarder support.
2301 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2302 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2303 * typemanager.cs (): Add type_forwarder_attr_type.
2305 2006-06-24 Marek Safar <marek.safar@seznam.cz>
2307 * report.cs: Add CS0469 warning.
2309 2006-06-21 Martin Baulig <martin@ximian.com>
2311 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2312 the `try'-block, so we also report CS0016 etc. there.
2314 2006-06-21 Martin Baulig <martin@ximian.com>
2317 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2319 2006-06-21 Martin Baulig <martin@ximian.com>
2321 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2322 also report CS1686 for parameters.
2324 2006-06-21 Martin Baulig <martin@ximian.com>
2326 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2327 instead of an error if the value is not implicitly convertible to
2328 the switch types; fixes #77964.
2330 2006-06-21 Raja R Harinath <rharinath@novell.com>
2333 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2334 FieldBuilder is null.
2337 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2338 'left' and 'right' before error-checking.
2340 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
2342 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2344 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2345 (FieldExpr.DoResolve): likewise.
2346 (PropertyExpr.InstanceResolve): likewise.
2347 (EventExpr.InstanceResolve): likewise.
2349 2006-06-04 Marek Safar <marek.safar@seznam.cz>
2351 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2352 attribute applicable tests for attribute argument.
2354 2006-06-02 Raja R Harinath <rharinath@novell.com>
2357 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2358 (Binary.OverloadResolve_PredefinedIntegral): New.
2359 (Binary.OverloadResolve_PredefinedFloating): New.
2360 (Binary.OverloadResolve_PredefinedString): New.
2361 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2362 Follow the standard more closely, and treat numeric promotions in
2363 terms of overload resolution.
2364 (Binary.CheckShiftArguments): Simplify.
2366 2006-06-01 Raja R Harinath <rharinath@novell.com>
2368 * flowanalysis.cs (MyBitVector): Simplify representation.
2369 (MyBitVector.Clone): Avoid allocating BitArray.
2370 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2371 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2372 (*): Update. Change all references to MyBitVector.And and
2373 MyBitVector.Or to &= and |=.
2375 2006-05-29 Raja R Harinath <rharinath@novell.com>
2378 * cs-parser.jay (formal_parameter_list): Extend the pattern below
2379 to param arguments too.
2381 2006-05-26 Miguel de Icaza <miguel@novell.com>
2383 * cs-parser.jay: Catch another parsing form for arglist being
2384 followed by other arguments. Fixes #78313.
2386 2006-05-24 Raja R Harinath <rharinath@novell.com>
2388 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2389 checking of out parameters to ...
2390 (FlowBranchingToplevel.Merge): ... here.
2391 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2392 set, propagate the origin upward, and only complain if there was
2394 (FlowBranchingException.AddContinueOrigin): Likewise.
2395 (FlowBranchingException.AddReturnOrigin): Likewise.
2396 (FlowBranchingException.AddGotoOrigin): Likewise.
2398 2006-05-23 Raja R Harinath <rharinath@novell.com>
2400 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2401 unreachable, skip it.
2402 (FlowBranchingException.Merge): Always propagate jumps, even if
2403 the finally block renders subsequent code unreachable.
2405 2006-05-18 Raja R Harinath <rharinath@novell.com>
2408 * statement.cs (Goto.Resolve): Move responsibility for resolving
2409 'goto' to FlowBranching.AddGotoOrigin.
2410 (Goto.SetResolvedTarget): New. Callback to set the
2411 LabeledStatement that's the target of the goto.
2412 (Goto.DoEmit): Use Leave instead of Br when crossing an
2413 unwind-protect boundary.
2414 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2415 LookupLabel and adjust to new semantics.
2416 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2417 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2418 Goto.SetResolvedTarget to update target.
2419 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2420 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2421 AddBreakOrigin & co. Delay propagation until ...
2422 (FlowBranchingException.Merge): ... this.
2424 * statement.cs (Block.Resolve): Always depend on flow-branching to
2425 determine unreachability. Kill workaround that originally emitted
2426 only one statement after an "unreachable" label (see infloop in
2429 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2430 This is still "wrong", but anything better would probably need a
2431 multi-pass algorithm.
2432 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2433 usage vector. Force current usage vector to be reachable, to
2434 optimistically signify backward jumps.
2435 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2437 (FlowBranchingLabeled.Merge): New. If no backward jump was
2438 detected, return the original salted-away usage vector instead,
2439 updated with appropriate changes. Print unreachable warning if
2441 * statement.cs (Block.Resolve): Don't print unreachable warning on
2442 a labeled statement.
2444 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
2446 * driver.cs: Pass filename without path to AssemblyBuilder's
2447 AddResourceFile. Fixes bug #78407.
2449 2006-05-17 Raja R Harinath <rharinath@novell.com>
2451 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2452 * flowanalysis.cs (FlowBranchingLabeled): ... here.
2453 (FlowBranching.MergeChild): Overwrite
2454 reachability information from Labeled branchings too.
2456 2006-05-16 Raja R Harinath <rharinath@novell.com>
2458 * statement.cs (Goto.Resolve): Merge jump origins here ...
2459 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2461 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2462 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
2463 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
2464 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2466 * statement.cs (Goto.Resolve): ... not here.
2467 (Goto.Emit): Remove CS1632 check.
2469 2006-05-14 Marek Safar <marek.safar@seznam.cz>
2471 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2474 2006-05-11 Raja R Harinath <rharinath@novell.com>
2476 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2477 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2478 (FlowBranchingException.Label): Likewise.
2480 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
2482 (MyBitVector.Or): Use it to avoid losing information (Count).
2483 (FlowBranching.MergeOrigins): Likewise.
2485 * flowanalysis.cs (UsageVector.IsDirty): Remove.
2486 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2487 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2488 (UsageVector.ToString): Simplify.
2489 (UsageVector.MergeSiblings): Move here from ...
2490 (FlowBranching.Merge): ... here.
2491 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2494 2006-05-10 Raja R Harinath <rharinath@novell.com>
2496 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2497 null bitvector is treated as all-true.
2499 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2500 (MyBitVector): Rationalize invariants. 'vector != null' implies
2501 that we have our own copy of the bitvector. Otherwise,
2502 'InheritsFrom == null' implies all inherited bits are true.
2504 2006-05-09 Marek Safar <marek.safar@seznam.cz>
2506 * statement.cs (LocalInfo): Add IsConstant.
2507 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2508 local variable for constants.
2510 2006-05-09 Raja R Harinath <rharinath@novell.com>
2512 * flowanalysis.cs (MyBitVector.Empty): New.
2513 (MyBitVector): Don't allow InheritedFrom to be null.
2514 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2515 (UsageVector, FlowBranching): Update to changes.
2517 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2518 recursion. The 'Parent == null' condition isn't sufficient for
2520 (FlowBranching.AddBreakOrigin): Likewise.
2521 (FlowBranching.AddContinueOrigin): Likewise.
2522 (FlowBranching.AddReturnOrigin): Likewise.
2523 (FlowBranching.StealFinallyClauses): Likewise.
2524 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2525 (FlowBranching.CheckOutParameters): Likewise.
2526 (FlowBranchingToplevel): Terminate all the above recursions here.
2527 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2528 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2530 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
2532 (FlowBranchingToplevel): New. Empty for now.
2533 (FlowBranching.MergeTopBlock): Update.
2534 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2535 branching for the anonymous delegate.
2536 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2538 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2539 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2540 information at the start of the merge. Reorganize.
2542 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2544 * class.cs (MethodData.Define): Method cannot implement interface accessor.
2546 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2548 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2549 to newly introduced ctor.
2551 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2552 message to one place.
2553 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2556 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2558 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2560 * ecore.cs (Expression.ResolveAsConstant): Updated.
2562 * statement.cs (ResolveMeta): Updated.
2564 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2566 * cs-parser.jay: __arglist cannot be used in initializer.
2568 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2571 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2574 2006-05-05 Raja R Harinath <rharinath@novell.com>
2576 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2577 (LabeledStatement): Add 'name' parameter.
2578 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2579 (Block.AddLabel): Update to changes.
2580 * cs-parser.jay (labeled_statement): Likewise.
2582 * flowanalysis.cs (BranchingType.Labeled): New.
2583 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2584 (FlowBranchingLabeled): New. Does nothing for now, but will
2585 eventually handle 'goto' flows.
2586 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2587 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2588 that's terminated ...
2589 (Block.Resolve): ... here.
2591 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2592 (UsageVector.MergeFinallyOrigins): Likewise.
2593 (FlowBranching.InTryOrCatch): Likewise.
2594 (FlowBranching.AddFinallyVector): Likewise.
2595 (FlowBranchingException): Update to changes.
2598 * statement.cs (Return.Resolve): Move error checking to ...
2599 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2600 (FlowBranchingException): Handle return origins like break and
2602 (FlowBranching.UsageVector.CheckOutParameters): Remove.
2604 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2607 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2610 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2613 * class.cs (MethodData.Define): Do public accessor check only when method
2614 implements an interface.
2616 2006-05-04 Raja R Harinath <rharinath@novell.com>
2618 Remove special handling of 'break'
2619 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2620 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
2621 (UsageVector.Break): Remove.
2622 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2624 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2626 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2627 UsageVector.Breaks (). Don't set NeedsReturnLabel.
2629 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2632 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2633 be the interface member.
2635 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2638 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2639 for emitting small (int) values.
2641 2006-05-03 Raja R Harinath <rharinath@novell.com>
2644 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2645 control-flow passes through the 'finally' after merging-in all the
2646 control-flows from 'try' and the 'catch' clauses.
2648 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2649 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
2650 always true at the only non-recursive entry point.
2651 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2652 FlowBranchingBreakable.
2653 (FlowBranchingLoop): Remove.
2654 * statement.cs (Return.DoResolve): Update to changes.
2657 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2658 (FlowBranching.CreateBranching): Handle it: create a
2659 FlowBranchingContinuable.
2660 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2661 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2662 except that it handles the 'continue' command.
2663 (FlowBranching.UsageVector.MergeOrigins): Rename from
2665 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2666 except that it overrides AddContinueOrigin.
2667 (FlowBranchingException): Override AddContinueOrigin, similar to
2669 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2670 Create a new branching around the embedded statement.
2671 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
2672 control flow after the embedded statement.
2673 (Continue.Resolve): Move all error checking to AddContinueOrigin.
2675 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2676 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2677 FlowBranchingBreakable.
2678 (FlowBranchingSwitch): Remove.
2681 * statement.cs (Break.Resolve): Simplify. Move responsibility for
2682 error reporting to ...
2683 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2684 Rename from 'AddBreakVector'. Add new location argument. Return
2685 a bool indicating whether the 'break' crosses an unwind-protect.
2686 (FlowBranchingException.AddBreakOrigin): Add.
2687 (FlowBranchingException.Merge): Propagate 'break's to surrounding
2688 flowbranching after updating with the effects of the 'finally'
2690 (FlowBranchingBreakable): New common base class for
2691 FlowBranchingLoop and FlowBranchingSwitch.
2693 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2695 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2697 2006-05-02 Raja R Harinath <rharinath@novell.com>
2699 * statement.cs (Do.Resolve): If the loop is infinite, set the
2701 (While.Resolve, For.Resolve): Set a barrier after the embedded
2702 statement. There's no direct control flow that goes from the end
2703 of the embedded statement to the end of the loop.
2704 * flowanalysis.cs (FlowBranching.Infinite): Remove.
2705 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
2706 above ensure that the reachability is correctly computed.
2708 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2709 (UsageVector.MergeBreakOrigins): If the current path is
2710 unreachable, treat it as if all parameters/locals are initialized.
2711 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
2712 infinite loops before merging-in break origins.
2714 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2715 (Reachability.Reachable): Split part into ...
2716 (Reachability.Unreachable): ... this. Simplify.
2717 (Reachability.IsUnreachable): Use 'Unreachable' instead.
2719 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2720 (Reachability.SetThrowsSometimes): Likewise.
2721 (FlowBranchingBlock.MergeTopBlock): Don't compare against
2722 TriState.Always, use corresponding property.
2723 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2724 (Block.Resolve): Likewise. Remove some redundant checks.
2726 2006-05-02 Raja R Harinath <harinath@gmail.com>
2728 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2729 (Reachability.Meet): Don't bother checking AlwaysThrows --
2730 barrier is always set.
2731 (FlowBranchingBlock.Merge): Likewise.
2733 2006-05-01 Raja R Harinath <harinath@gmail.com>
2735 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2736 checks for unreachable.
2738 2006-05-01 Marek Safar <marek.safar@seznam.cz>
2741 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2743 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2744 whether field is really assigned.
2746 2006-04-30 Raja R Harinath <harinath@gmail.com>
2748 * flowanalysis.cs (Reachability): Make 4-argument constructor
2750 (Reachability.Meet): Rename from 'And'. Remove static variant.
2751 (Reachability.Always): Rename from the highly misleading
2752 'Reachability.Never'.
2753 (FlowBranching.Merge): Update to changes. Mark an impossible
2754 situation with a 'throw'.
2755 (*): Update to changes.
2757 2006-04-29 Raja R Harinath <harinath@gmail.com>
2759 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2761 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2762 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2763 (*): Update to changes.
2764 * statement.cs: Update to changes.
2766 2006-04-28 Marek Safar <marek.safar@seznam.cz>
2769 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2771 2006-04-28 Raja R Harinath <harinath@gmail.com>
2773 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2776 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2777 argument to two arguments: an usage-vector and a bool. Move call
2778 to FlowBranching.Merge () ...
2779 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2781 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2782 handling of loop and switch reachability to ...
2783 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2785 2006-04-27 Raja R Harinath <harinath@gmail.com>
2787 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2788 handling to FlowBranchingLoop.InLoop.
2789 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2791 2006-04-26 Marek Safar <marek.safar@seznam.cz>
2794 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2795 anonymous method is allowed from AnonymousContainer here.
2797 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2799 2006-04-24 Raja R Harinath <rharinath@novell.com>
2802 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2804 2006-04-23 Marek Safar <marek.safar@seznam.cz>
2807 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2808 (DoubleConstant.Reduce): Ditto.
2810 2006-04-23 Raja R Harinath <rharinath@novell.com>
2812 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2813 Remove 'lvalue_right_side' argument. Move parts to ...
2814 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2815 (LocalVariable.DoResolveLValue): ... these.
2817 2006-04-21 Raja R Harinath <rharinath@novell.com>
2820 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2821 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2822 (LocalVariableReference.DoResolveBase): Use it to implement new
2824 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2825 (Argument.Resolve): Simplify. Move CS1510 check ...
2826 * ecore.cs (Expression.ResolveLValue): ... here.
2827 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2828 (PropertyExpr.DoResolveLValue): Likewise.
2829 (FieldExpr.Report_AssignToReadonly): Likewise.
2830 (FieldExpr.DoResolve): Add 'out_access' argument. Use
2831 LValueMemberAccess or LValueMemberOutAccess on instance depending
2833 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2834 DoResolve as appropriate.
2836 2006-04-20 Raja R Harinath <rharinath@novell.com>
2839 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2840 implicit conversions on 'out' and 'ref' arguments.
2842 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2843 improve clarity. Remove dead code.
2846 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2847 (Catch.Resolve): Resolve VarBlock if it exists.
2849 2006-04-19 Miguel de Icaza <miguel@novell.com>
2851 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2852 twice, this was some residual code, the enumerator was emitted
2853 properly in the two branche of if later.
2855 2006-04-19 Raja R Harinath <rharinath@novell.com>
2857 * expression.cs (Cast.ResolveLValue): Remove. The result of a
2858 cast is never an lvalue.
2859 (Cast.DoResolve, Cast.ResolveRest): Combine.
2860 (Argument.Emit): Simplify slightly. Move 'Expr is
2861 IMemoryLocation' check ...
2862 (Argument.Resolve): ... here.
2863 (Argument.Error_LValueRequired): Remove. Inline into only user.
2865 Simplifications. Fix cs0191-2.cs
2866 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2867 CS1649 and CS1651 to ...
2868 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
2869 the actual selection of the error code and message to a lookup
2870 table. Add a dummy return value to simplify callsites.
2871 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2872 readonly fields of other instances of the same type. Move CS0197
2874 * expression.cs (Argument.Resolve): ... here. Simplify code.
2875 Ensure that ec.InRefOutArgumentResolving is only set during LValue
2876 resolution of an out or ref argument. The code simplification
2877 above uses this invariant.
2879 2006-04-18 Raja R Harinath <rharinath@novell.com>
2881 Possibly fix #77752. Fix cs1690-[4-7].cs.
2882 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2883 CheckMarshallByRefAccess. Drop parameter.
2884 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
2886 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2888 * report.cs (AllWarnings): Add CS1690.
2889 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2891 (LocalVariableReference.DoResolveBase): Update.
2893 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2895 * class.cs (MethodOrOperator): Moved common parts from method class.
2896 detect obsolete attributes.
2897 (Method.Define): Simplified as it reuses code from base.
2898 (Constructor.ValidAttributeTargets): Fixed issue found during
2900 (Destructor.ValidAttributeTargets): Fixed issue found during
2902 (Operator): Finished refactoring set off by #78020. Operator class is now
2903 ordinary method class.
2905 * anonymous.cs: Updated.
2907 * decl.cs (DeclSpace): Add IsGeneric
2909 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2911 * class.cs (Constructor.Emit): Don't emit the attributes twice.
2913 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2915 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2916 detect obsolete attributes.
2917 (Method.CreateEmitContext): Moved to MethodOrOperator.
2919 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2922 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2923 customized exception to make crash detection easier.
2924 (MethodOrOperator): Started to work on new base class for methods and
2926 (Method): Derives from MethodOrOperator.
2927 (Constructor.Emit): Emits its own attributes.
2928 (AbstractPropertyEventMethod.Emit): Ditto.
2929 (Operator): Derives from MethodOrOperator, will refactor fully in extra
2931 (Operator.Emit): It's temporary more tricky than should be.
2933 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2935 * report.cs (InternalErrorException): Add ctor with inner exception.
2937 2006-04-08 Marek Safar <marek.safar@seznam.cz>
2940 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2943 2006-04-07 Marek Safar <marek.safar@seznam.cz>
2946 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2949 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2951 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2952 attribute is present and Guid not.
2953 (Interface.ApplyAttributeBuilder): Ditto.
2955 * attribute.cs: Add error message.
2957 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2961 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2962 sources (it's composite) so hold them in extra array as they are used in
2963 Emit phase only. It worked in the previous versions by mistake.
2964 (Attribute.Emit): Emit attribute for more owners when exist.
2966 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2967 it has now different behaviour.
2969 2006-04-04 Marek Safar <marek.safar@seznam.cz>
2971 * constant.cs (Constant.IsDefaultInitializer): New method.
2973 * class.cs: Updated.
2975 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2976 re-initialize default values. It saves KBs almost for every assembly.
2977 Thanks Zoltan for the idea.
2978 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2979 (ArrayCreation.DoResolve): Resolve only once.
2980 (ArrayCreation.Emit): Emit static initializer only when it is faster.
2981 (ArrayCreation.GetAttributableValue): Cope with optimized values.
2983 2006-04-03 Zoltan Varga <vargaz@gmail.com>
2985 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2988 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2990 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2991 in an embedded statement too.
2993 2006-04-01 Raja R Harinath <rharinath@novell.com>
2996 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2998 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3002 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3005 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3007 2006-03-31 Marek Safar <marek.safar@seznam.cz>
3009 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3012 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3013 LocalTemporary change.
3015 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3017 (ClassOrStruct.DefineFieldInitializers): Implemented static field
3018 initializers optimization.
3019 (ClassOrStruct.TypeAttr): Moved from modifiers.
3020 (Constructor.CheckBase): Don't crash when static ctor has parameters.
3021 (FieldBase.ResolveInitializer): Resolves initializer.
3022 (FieldBase.HasDefaultInitializer): New property.
3024 * cs-parser.jay: Removed message.
3026 * expression.cs (CompilerGeneratedThis): New specialization.
3028 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3030 2006-03-28 Marek Safar <marek.safar@seznam.cz>
3032 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3034 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3036 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3037 be now EnumConstants only.
3039 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3041 * attribute.cs, driver.cs: Reset more caches.
3043 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3045 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3047 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3049 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3050 for easier reuse. Updated all overrides.
3051 (IntegralConstant): New base class for all integral constants.
3052 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3053 of the constant range, report custom error.
3054 (UIntConstant.Reduce): Fixed uint conversion.
3056 * ecore.cs, literal.cs: Reduce updates.
3058 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3062 * class.cs (Constructor.Define): Removed extra if for default ctors.
3063 A patch from Atsushi Enomoto.
3065 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3067 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3068 GetAttributableValue.
3070 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3073 * convert.cs (ImplicitConversionRequired): Error message moved to
3076 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3077 automatic implicit conversion of an output value.
3078 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3080 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3082 (TypeOf.GetAttributableValue): Add extra handling for object type.
3084 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3085 special error message.
3087 2006-03-25 Marek Safar <marek.safar@seznam.cz>
3089 * class.cs (Constructor.Emit): Don't crash when struct ctor is
3091 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3092 compatible with MS runtime.
3094 2006-03-23 Marek Safar <marek.safar@seznam.cz>
3096 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3097 attribute arguments here.
3099 * class.cs (Indexer.Define): The check was moved to attribute class.
3101 2006-03-22 Marek Safar <marek.safar@seznam.cz>
3103 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3104 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3107 2006-03-22 Raja R Harinath <rharinath@novell.com>
3109 Support ParameterDefaultValueAttribute in gmcs. Also applied to
3110 mcs to keep code differences small.
3111 * attribute.cs (Attribute.GetParameterDefaultValue): New.
3112 * typemanager.cs (parameter_default_value_attribute_type): New.
3113 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
3116 2006-03-21 Marek Safar <marek.safar@seznam.cz>
3118 * expression.cs (StringConcat.Append): Reverted back to no warning state.
3120 2006-03-21 Marek Safar <marek.safar@seznam.cz>
3122 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3124 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3127 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
3129 * doc-bootstrap.cs : fix build.
3131 2006-03-20 Marek Safar <marek.safar@seznam.cz>
3133 * expression.cs (StringConcat.Append): Issue a warning when empty string
3136 2006-03-20 Marek Safar <marek.safar@seznam.cz>
3138 * assign.cs (CompoundAssign.ResolveSource): Removed.
3140 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3143 * class.cs (TypeContainer.FindMethods): Removed.
3144 (TypeContainer.CheckMemberUsage): Made static.
3146 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3148 * constant.cs (CheckRange): Removed unused type argument.
3149 (CheckUnsigned): Removed unused type argument.
3151 * cs-parser.jay: Updated after MemberAccess clean up.
3152 Uses Length for empty string test.
3154 * cs-tokenizer.cs: Uses Length for empty string test.
3155 (IsCastToken): Made static.
3156 (is_hex): Made static.
3157 (real_type_suffix): Made static.
3159 * decl.cs (SetupCache): Made static.
3160 (OnGenerateDocComment): Removed unused ds argument.
3162 * delegate.cs (VerifyDelegate): Removed unused argument.
3164 * doc.cs: Uses Length for empty string test.
3166 * driver.cs: Uses Length for empty string test.
3168 * enum.cs (IsValidEnumType): Made static
3170 * expression.cs (EnumLiftUp): Removed unused argument.
3171 (ResolveMethodGroup): Ditto.
3172 (BetterConversion): Ditto.
3173 (GetVarargsTypes): Ditto.
3174 (UpdateIndices): Ditto.
3175 (ValidateInitializers): Ditto.
3176 (MemberAccess.ctor): Ditto.
3177 (GetIndexersForType): Ditto.
3179 * flowanalysis.cs: (MergeFinally): Removed unused argument.
3181 * iterators.cs: Updated after MemberAccess clean up.
3183 * location.cs: Uses Length for empty string test.
3185 * namespace.cs: Uses Length for empty string test.
3187 * report.cs (CheckWarningCode): Made static.
3189 * statement.cs (LabeledStatement): Removed unused argument.
3191 * typemanager.cs (FilterNone): Removed.
3193 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3195 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3198 * class.cs: Updated.
3200 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3202 * cs-parser.jay.cs: __arglist is not allowed for delegates.
3204 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3208 * expression.cs (VerifyArgumentsCompat): Reverted to double error
3209 reporting, it's more tricky than I thought.
3211 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3215 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
3217 (AnonymousMethod.ImplicitStandardConversionExists): New method.
3218 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3219 Add more error reporting; Fixed issue with params.
3221 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3223 * cs-parser.jay: AnonymousMethod requires host container.
3225 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3227 2006-03-18 Raja R Harinath <harinath@gmail.com>
3229 * class.cs: Change 'TypeContainer ds' constructor argument to
3230 'DeclSpace parent'. Some classes were missed below due to
3231 different naming convention.
3233 * class.cs (MemberCore.Parent): Delete. This makes the
3234 ParentContainer changes below enforceable by the compiler.
3236 Treat pointers to enclosing declaration space as 'DeclSpace', not
3238 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3239 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3241 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3243 (Block.AddThisVariable): Likewise.
3244 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3245 (AbstractPropertyEventMethod.Emit): Likewise.
3246 (AbstractPropertyEventMethod.EmitMethod): Likewise.
3247 (GetMethod.Define, SetMethod.Define): Likewise.
3248 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3249 (DelegateMethod.EmitMethod): Likewise.
3251 Fix regression test-partial-13.cs.
3252 Rationalize use of PartialContainer. Ensure that the partial
3253 class semantics can be tied to type-correctness, i.e., any
3254 violation will cause a compile error.
3255 * class.cs, const.cs: Access all fields that belong to class
3256 TypeContainer via ParentContainer. Arguments of EmitContexts and
3257 Resolve()-like functions still use 'Parent'.
3259 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3260 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3261 (PropertyMethod.CheckModifiers): Remove unused argument.
3262 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3265 2006-03-17 Raja R Harinath <harinath@gmail.com>
3267 Make semantics of PartialContainer simpler.
3268 * decl.cs (DeclSpace.IsPartial): Remove.
3269 * class.cs (TypeContainer.IsPartial): Likewise.
3270 (TypeContainer..ctor): Set PartialContainer to point to self.
3271 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3272 (TypeContainer.FindNestedType): Likewise.
3273 (MemberCore.ParentContainer): Simplify. Remove deprecation.
3275 2006-03-17 Marek Safar <marek.safar@seznam.cz>
3277 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3279 2006-03-15 Marek Safar <marek.safar@seznam.cz>
3281 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3284 2006-03-15 Marek Safar <marek.safar@seznam.cz>
3286 * class.cs (Operator.Define): An error for base conversion was not
3289 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
3291 * iterator.cs : yield break is allowed in try statement which has
3292 catch clauses. Fixed bug #77767.
3294 2006-03-13 Marek Safar <marek.safar@seznam.cz>
3296 A fix for #77593, #77574.
3298 * class.cs (MethodCore.CheckBase): Another if for operator.
3300 2006-03-09 Marek Safar <marek.safar@seznam.cz>
3302 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3305 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3306 (DelegateCreation.ImplicitStandardConversionExists): New method for just
3309 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3312 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3313 Updated after another emitcontext usage was clean up. It should help us to
3314 synchronize with gmcs easier.
3316 2006-03-04 Marek Safar <marek.safar@seznam.cz>
3320 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3321 (Event.Define): ditto
3322 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3324 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3325 Removed redundant code and set NewSlot for Invoke method too.
3327 * parameter.cs (Parameters.ctor): Add custom, type ctor.
3328 (Parameters.MergeGenerated): New method. Use this method when you merge
3329 compiler generated argument with user arguments.
3331 2006-03-03 Marek Safar <marek.safar@seznam.cz>
3333 * attribute.cs (ResolveAsTypeTerminal): Removed.
3335 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3336 specialization for predefined types; 30% speed up.
3337 Finally placed obsolete check to right place.
3338 (Expression.ResolveType): Removed.
3340 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3341 Updated after ResolveType was removed.
3343 * expression.cs (Cast.ctor): Check void cast.
3344 (Binary.ResolveAsTypeTerminal): Is never type.
3345 (Conditional.ResolveAsTypeTerminal): Is never type.
3347 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3349 2006-03-01 Raja R Harinath <rharinath@novell.com>
3352 * expression.cs (ParameterReference.DoResolveBase): Change return
3354 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3358 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3361 * typemanager.cs (GetFullNameSignature): Don't nullref on
3362 protected accessors.
3364 2006-02-27 Marek Safar <marek.safar@seznam.cz>
3366 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3367 these two separated members to simplify the code.
3368 (Attribute.Resolve): Refactored to use new fields and methods.
3369 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3370 implemented obsolete attribute checking.
3371 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3372 implemented obsolete checking again. It look line never ending quest ;-)
3373 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3375 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3377 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3379 *class.cs (Property.Define): Add RegisterProperty call.
3381 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3382 argument groups (only 2).
3384 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3385 encoding expression to arguments.
3386 (Expression.ExprClassToResolveFlags): Just turned to property.
3388 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3389 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3390 optimized as well as implemented support for zero-length attributes.
3392 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3393 Add caching of PropertyInfo's.
3395 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3397 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3398 error multiple times.
3400 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3402 New partial class implementation.
3403 A fix for #77027, #77029, #77403
3405 * attribute.cs (Attributable): Made attributes protected.
3407 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3408 the replacements of ClassPart and PartialContainer.
3409 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3410 (TypeContainer.AddInterface): Ditto.
3411 (TypeContainer.AddPartial): The main method for partial classes. It checks
3412 for errors and merges ModFlags and attributes. At the end class is added to
3414 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3416 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3417 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3418 from the rest of partial classes.
3419 (TypeContainer.GetClassBases): Simplified.
3420 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3422 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3423 (TypeContainer.HasExplicitLayout): Uses Flags now.
3424 (PartialContainer): Removed.
3425 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3426 (StaticClass): Was merged with Class.
3427 (Class.GetClassBases): class and static class bases are verified here.
3428 (Class.TypeAttr): Added static attributes when class is static.
3429 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3430 (MemberBase): In some cases we need to call parent container for partial
3431 class. It should be eliminated but it's not easy now.
3433 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3435 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3436 partial classed to accumulate class comments.
3437 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3439 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3441 * driver.cs (MainDriver): Tree.GetDecl was removed.
3443 * modifiers.cs (Modifiers): Add partial modifier.
3445 * tree.cs (Tree.decl): Removed.
3446 (RootTypes): Started to use this class more often for root types
3449 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3453 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3454 external interface does not have an attribute.
3456 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3458 Another prerequisites for new partial classs implementation.
3460 * attribute.cs (Attribute.Equal): Implemented.
3461 (Attribute.Emit): Changed as attributes can be applied more than twice.
3462 (Attributes.Emit): Check for duplicate attributes here.
3464 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3465 as a parameter, clean-up.
3467 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3471 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3472 contains obsolete attribute check which can in some cases look for base
3473 type of current class which is not initialized yet.
3474 (TypeContainer.BaseType): Replacement of ptype.
3476 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3478 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3480 First of prerequisites for new partial classs implemention.
3482 * attribute.cs (Attributable): Extended by ResolveContext;
3483 Attributes finally have correct context for resolving in all cases.
3484 (AttachTo): Attribute owner is assigned here.
3486 * codegen.cs (IResolveContext): Introduce new interface to hold
3487 all information needed in resolving phase.
3488 (EmitContext): Implements IResolveContext; more clean-up needed here.
3490 * decl.cs (MemberCore): Implemented IResolveContext.
3492 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3493 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3494 parameter.cs, statement.cs, tree.cs, typemanager.cs:
3495 Refactored to use new IResolveContext instead of EmitContext; cleanup
3497 2006-02-06 Miguel de Icaza <miguel@novell.com>
3499 * codegen.cs (EmitScopeInitFromBlock): check here the
3500 capture_context, there is no need to make two calls to the
3503 * anonymous.cs: Add some debugging messages that might help me
3504 track other instances of this problem in the future (the
3505 regression of test 467).
3507 * cs-parser.jay: track the variable block, as we need to initalize
3508 any captured variables declared in this block for the "catch"
3509 portion of the "Try" statement.
3511 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3512 scope initialization for captured variables.
3514 Also, move the emit for the variables after the block location has
3517 2006-02-06 Marek Safar <marek.safar@seznam.cz>
3519 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3521 2006-02-02 Miguel de Icaza <miguel@novell.com>
3523 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3524 commit yesterday, the initialization for the roots is necessary.
3525 What is not necessary is the scope activation.
3527 2006-02-02 Raja R Harinath <rharinath@novell.com>
3529 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3530 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3532 (Argument.Resolve): Remove CS0206 checks.
3534 2006-02-01 Miguel de Icaza <miguel@novell.com>
3536 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3537 scopes for all the roots, the scopes will now be emitted when the
3538 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
3540 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3541 code. This reduces a lot of existing cruft.
3543 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3544 that the ScopeInfo is generated as we enter the scope, not at the
3545 time of use, which is what we used to do before.
3547 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3548 every time a Block is about to be emitted if we have a
3551 2006-02-01 Raja R Harinath <rharinath@novell.com>
3553 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3555 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3557 * typemanager.cs (cons_param_array_attribute): Make private.
3558 (Reset): Set it to null.
3559 (InitCoreHelpers): Don't initialize it.
3560 (ConsParamArrayAttribute): New. Initialize it as needed.
3561 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3563 2006-01-31 Miguel de Icaza <miguel@novell.com>
3565 * expression.cs: There might be errors reported during the
3566 selection of applicable methods. If there are errors, do not
3567 continue execution as it will lead the compiler to crash.
3569 2006-01-30 Miguel de Icaza <miguel@novell.com>
3571 * expression.cs: Member access is not allowed on anonymous
3572 methods. Fixes #77402.
3574 2006-01-30 Raja R Harinath <rharinath@novell.com>
3577 * cs-parser.jay (VariableDeclaration): Don't set
3578 current_array_type to null.
3579 (field_declaration, event_declaration, declaration_statement):
3580 Set it to null here.
3582 2006-01-28 Raja R Harinath <harinath@gmail.com>
3584 * typemanager.cs (GenericParameterPosition): New.
3587 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
3589 * doc.cs : To process "include" elements, first we should create
3590 another list than XmlNodeList, because it could result in node
3591 removal, which could result in that the XmlNodeList gives up
3594 (Also made code identical to gmcs again.)
3596 2006-01-25 Miguel de Icaza <miguel@novell.com>
3598 * ecore.cs: Introduce an error report that we were not catching
3599 before, if not silent, we must report the error. Gonzalo ran into
3602 2006-01-23 Miguel de Icaza <miguel@novell.com>
3604 A fix for bug: #76957
3606 * iterators.cs (MoveNextMethod.CreateMethodHost): call
3607 ComputeMethodHost before creating the method, this is a new
3610 * anonymous.cs (AnonymousContainer): Now we track all the scopes
3611 that this method references (RegisterScope). The actual scope
3612 where the method is hosted is computed with the ComputeMethodHost
3613 before we create the method.
3615 Moved the Deepest routine here.
3617 (AnonymousContainer.ComputeMethodHost): New routine used to
3618 compute the proper ScopeInfo that will host the anonymous method.
3620 (ScopeInfo): Deal with multiple roots. The problem was that we
3621 did not have a unique root where all ScopeInfos could be hanged
3622 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
3625 Remove AdjustMethodScope which is now computed at the end. Remove
3626 LinkScope which did a partial link, instead link all ScopeInfos
3627 before code generation from the new "LinkScopes" routine.
3629 Simplify all the Add* routines as they no longer need to maintain
3630 the tree, they just need to record that they are using variables
3633 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3634 routines to produce the forest of ScopeInfo trees.
3636 * class.cs (TypeContainer.AppendMethod): This is just like
3637 AddMethod, but ensures that an interface implementation method
3638 (IEnumerable.XXX) is not inserted at the beginning of the queue of
3639 methods, but at the end.
3641 We use this functionality to ensure that the generated MoveNext
3642 method in the iterator class is resolved/emitted before the
3643 enumerator methods created.
3645 This is required because the MoveNext method computes the right
3646 ScopeInfo for the method. And the other methods will eventually
3647 need to resolve and fetch information computed from the anonymous
3650 2006-01-21 Raja R Harinath <harinath@gmail.com>
3651 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3654 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3656 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3657 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3659 2006-01-18 Raja R Harinath <rharinath@novell.com>
3661 Fix #76656, cs0231-2.cs.
3662 * cs-parser.jay (formal_parameter_list): Make error case catch
3664 (parenthesized_expression_0): Add CS1026 check.
3665 (invocation_expression): Remove unused { $$ = lexer.Location }.
3667 2006-01-17 Raja R Harinath <rharinath@novell.com>
3670 * cs-parser.jay (statement_expression): Don't list out the
3671 individual statement-expressions. Convert syntax error into
3674 2006-01-16 Raja R Harinath <rharinath@novell.com>
3677 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3678 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
3679 CheckIntermediateModification.
3680 (FieldExpr.DoResolve): Add new two-argument version that
3681 allows us to resolve the InstanceExpression as an lvalue.
3682 The one-argument variant is now just a wrapper.
3683 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3684 Resolve the lhs as an lvalue if the it has a value type.
3685 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3686 from Assign.DoResolve.
3687 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3688 resolved as an lvalue.
3689 (PropertyExpr.DoResolve): Update.
3690 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3691 has a value type. Move CS1612 check here from
3692 CheckIntermediateModification.
3693 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3694 * expression.cs (EmptyExpression.OutAccess): New. Used as the
3695 'right_side' of a ResolveLValue on an 'out' argument.
3696 (EmptyExpression.LValueMemberAccess): New. Used as the
3697 'right_side' of a propagated ResolveLValue on a value type.
3698 (LocalVariableReference.DoResolveBase): Recognize
3699 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3701 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3702 EmptyExpression.Null.
3704 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
3706 * typemanager.cs : added IsGenericParameter(). In mcs it always
3708 * doc.cs : for generic parameters, use GenericParameterPosition,
3711 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
3713 * expression.cs: Fix Console.WriteLine ((this = x).foo);
3715 2006-01-12 Miguel de Icaza <miguel@novell.com>
3717 This fixes the problem where we used ldfld instead of ldflda to
3718 load the "THIS" pointer on captured parameters, when THIS is a
3719 value type. See bug #77205.
3721 * iterators.cs (CapturedThisReference.Emit): Pass false to
3722 EmitThis (we do not need the address).
3724 * codegen.cs (EmitThis): it needs to know whether we need the
3725 address of `this' or not. This is used by value types.
3727 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3728 every other call passes false.
3730 2006-01-12 Raja R Harinath <rharinath@novell.com>
3733 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3735 * expression.cs (Invocation.OverloadResolve): Update.
3736 (Invocation.DoResolve): Avoid double resolution of invocation.
3738 2006-01-11 Raja R Harinath <rharinath@novell.com>
3741 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3742 unary negation of floating point types as 0-expr; negation cannot
3743 overflow in floating point types.
3746 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3747 on operands of 'void' type.
3750 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3751 and ExclusiveOr for boolean constants too.
3753 2006-01-09 Raja R Harinath <rharinath@novell.com>
3756 * expression.cs (Invocation.OverloadResolve): Replace reflected
3757 override methods with their base virtual methods, rather than
3759 * typemanager.cs (TypeManager.GetOverride): New.
3761 2006-01-05 Jb Evain <jbevain@gmail.com>
3763 * class.cs (Property.Define, Indexer.Define): do not tag the
3764 properties as SpecialName | RTSpecialName.
3766 2006-01-04 Miguel de Icaza <miguel@novell.com>
3768 * class.cs (MethodCore.IsDuplicateImplementation): This method was
3769 doing a low-level comparission of parameter types. It was lacking
3770 a check for __argslist.
3772 2005-12-30 Miguel de Icaza <miguel@novell.com>
3774 * expression.cs (ParameterReference.DoResolveBase): Allow
3775 reference parameters if they are local to this block.
3777 This allows the ref and out parameters of a delegate to be used in
3778 an anonymous method, for example:
3780 delegate void set (out int x);
3782 set s = delegate (out int x){
3786 This is used by functionality introduced late in the C# language.
3788 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3789 method that take ref and out parameters.
3791 Fixes #77119 which was a late change in the spec.
3793 2005-12-23 Miguel de Icaza <miguel@novell.com>
3795 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3796 parent if its the same scope. Fixes #77060.
3798 2005-12-21 Miguel de Icaza <miguel@novell.com>
3800 * driver.cs: Report the case of no source files and no -out:
3803 2005-12-20 Raja R Harinath <rharinath@novell.com>
3806 * expression.cs (ComposedCast.GetSignatureForError): Define.
3808 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3812 * namespace.cs (NamespaceEntry): Add extern_aliases as a
3813 ListDictionary, to contain the ExternAliasEntry entries (in
3814 addition to the NamespaceEntry.aliases hashtable). This field is
3815 shared between the original entry and its doppelganger (bodyless
3817 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3818 extern_aliases field.
3819 (NamespaceEntry.Lookup): Move the IsImplicit check after the
3820 lookup in extern_aliases.
3822 2005-12-16 Raja R Harinath <rharinath@novell.com>
3825 * class.cs (TypeContainer.Mark_HasEquals): New.
3826 (TypeContainer.Mark_HasGetHashCode): New.
3827 (ClassPart): Override them.
3828 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3831 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3832 'parent' argument to the base constructor.
3834 Remove all mention of TypeContainer from decl.cs.
3835 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3836 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3837 (DeclSpace.DeclSpace): Likewise.
3838 (DeclSpace.DefineMembers): Remove unused argument.
3839 * cs-parser.jay (pop_current_class): Update to changes. Simplify
3840 debugging check -- we don't care if the debug code throws an
3841 InvalidCastException instead of an InternalErrorException.
3842 * class.cs (TypeContainer.DefineMembers): Update to changes.
3843 (TypeContainer.DoDefineMembers): Likewise.
3844 (TypeContainer.GetMethods): Likewise.
3845 (PropertyMember.Define): Likewise.
3846 (MemberBase.Parent): New property that forwards to
3847 MemberCore.Parent, but ensures that we get a TypeContainer.
3848 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3849 (RootContext.PopulateTypes): Likewise. Remove special case code
3850 for !RootContext.StdLib: DefineMembers is idempotent.
3852 2005-12-14 Miguel de Icaza <miguel@novell.com>
3854 * convert.cs (ExplicitConversionCore): Check the return value from
3855 ExplicitConversionCore which can return null on failure. Fixes #76914
3857 2005-12-13 Marek Safar <marek.safar@seznam.cz>
3859 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3861 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
3863 * doc.cs : The search for referenced namespace was insufficient to
3864 get global one as it used to do. Fixed bug #76965.
3866 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
3868 * doc.cs : check name in cref in the last phase that whether it is
3871 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3873 * cs-tokenizer.cs : reverted the latest change: it somehow broke
3876 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3878 * doc.cs : so it turned out that we cannot skip override check for
3879 interface members. Fixed bug #76954.
3881 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3883 * cs-tokenizer.cs : fixed bug #75984:
3884 - #warning and #error should not be handled when the source line
3886 - #line is not checked strictly when the source line is disabled.
3887 - #define and #undef is on the other hand checked strictly at any
3890 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
3892 * cs-tokenizer.cs : missing Location (actually, filename) in one of
3895 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3897 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3899 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3901 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3902 (FieldBase.Initializer): Initializer is now optional.
3903 (EventField.Define): Only event field can have initializer.
3905 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3907 * const.cs (Const): Reuse initializer.
3909 * cs-parser.jay: Updated after FieldBase changes.
3910 Added current_array_type to simplify array initializers.
3912 * ecore.cs (NullCast.IsDefaultValue): Implemented.
3914 * expression.cs, iterators.cs: Updated.
3916 * namespace.cs (NamespaceEntry): Made UsingFound private.
3918 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3920 * parameterCollection.cs: Obsolete, removed.
3921 * parser.cs: Obsolete, removed.
3923 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3926 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3928 * enum.cs (Enum.Define): Set obsolete context here.
3930 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3933 - FindDocumentedMember() now expects 1) paramList as null
3934 when "we don't have to check the number of parameters" and
3935 2) Type.EmptyTypes when "there is no arguments".
3936 - Introduced FoundMember struct to hold the exact type which was
3937 used to find the documented member (the above change broke
3938 test-xml-044; it might be better just to use DeclaringType than
3939 what MS does, like this change does, but it depends on usage.)
3941 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3943 * doc.cs : documented member might be from DeclaringType for nested
3944 types. Fixed bug #76782.
3946 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3948 * anonymous.cs: Have the param code handle leaving copies on the
3949 stack etc. Allows anonymous params to take part in the assignment
3950 code (++, +=, etc). Fixes bug #76550
3952 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3953 it down to the anon code.
3955 * iterators.cs: Use dummy var here
3957 * codegen.cs: Handle new vars
3959 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3962 * class.cs (MethodData.Define): Set proper Obsolete context.
3964 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3966 (FieldExpr.DoResolve): Ditto.
3968 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3971 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3972 parent is not obsolete.
3974 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3976 * doc.cs : (FindDocumentedMember) find parameterless members first
3977 and get CS0419 in the early stage. Fixed first case of bug #76727.
3979 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3982 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3983 no error was reported.
3985 *expression.cs (Binary.DoResolve): left can be null.
3987 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3990 * class.cs (MethodData.Emit): Parameters should be labeled first.
3992 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3995 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3997 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3999 * attribute.cs (AreParametersCompliant): Moved to Parameter.
4001 * class.cs (MethodCore): Parameter clean up.
4002 (IMethodData): Added ParameterInfo.
4003 (MethodData): Parameter clean up.
4004 (Indexer.Define): Parameter clean up.
4016 * typemanager.cs: Parameter clean up.
4018 * delegate.cs (Define): Get rid of duplicated code.
4020 * expression.cs (ParameterReference): Removed useless parameters
4022 (Invocation): Ditto.
4024 * parameter.cs (ParamsParameter): New class, params specialization.
4025 (ArglistParameter): Attemp to separate arglist.
4026 (Parameter): Refactored to be reusable and faster.
4027 (Parameter.Modifier): Made understandable.
4028 (Parameters): Changed to be used as a class for `this' assembly
4029 parameters. Refactored to use new specialized classes.
4031 * support.cs (ParameterData): Added Types property.
4032 (InternalParameters): Deleted.
4034 2005-08-20 Martin Baulig <martin@ximian.com>
4036 Merging this patch from GMCS to fix #75867.
4038 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4039 scope if we don't already have it.
4041 2005-11-17 Martin Baulig <martin@ximian.com>
4044 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4045 inherit the scope from our parent. Fixes #76653.
4047 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4049 * doc.cs : the previous patch does not actually fix the bug.
4050 PropertyInfo override check is now implemented and really fixed it.
4051 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4053 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4055 * doc.cs : apply "override filter" also to properties.
4058 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4060 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4061 no need to check overrides. For classes, omit those results from
4062 interfaces since they must exist in the class. Fixed bug #76726.
4064 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4066 * typemanager.cs : (GetFullNameSignature) differentiate indexers
4067 with different parameters. Fixed the second problem in #76685.
4069 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4071 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4072 get expected 'protected' access in CheckValidFamilyAccess()).
4075 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4077 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4078 Fixed bug #76705. CS1569 was incorrectly commented out.
4080 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
4082 * doc.cs : use Invocation.IsOverride() to do real override check.
4083 * expression.cs : made Invocation.IsOverride() internal.
4085 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
4087 * doc.cs : use TypeManager.FindMembers() instead of (possible)
4088 TypeBuilder.FindMembers() and filter overriden base members out.
4091 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4093 * doc.cs : ref/out parameters are represented as '@' (instead of
4094 '&' in type FullName). Fixed bug #76630 (additionally crefs).
4096 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4098 * doc.cs : when there was no '.' in cref to methods in doc comment,
4099 then parameters were missing in the output. Fixed bug #76691.
4101 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4103 * driver.cs : don't output docs when there is an error.
4106 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4109 Now it should detect indexers. Fixed primary concern in bug #76685.
4110 Fixed CS0419 message to not show the identical member signature in
4113 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4115 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4116 instead of Type.FindMembers() since it does not handle events.
4119 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
4121 * codegen.cs: Fixed typo (speficied -> specified).
4123 2005-11-11 Marek Safar <marek.safar@seznam.cz>
4126 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4128 2005-11-11 Marek Safar <marek.safar@seznam.cz>
4130 * attribute.cs: Changed error message.
4132 * cs-tokenizer.cs: One more check.
4134 2005-11-10 Marek Safar <marek.safar@seznam.cz>
4136 * statement.cs (Block.Resolve): Ignore empty statement.
4138 2005-11-10 Marek Safar <marek.safar@seznam.cz>
4140 * report.cs: Made error/warning methods more strict to avoid
4143 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4144 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4145 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4146 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4148 2005-11-08 Marek Safar <marek.safar@seznam.cz>
4150 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4151 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4153 * class.cs (TypeContainer.IsComImport): New property.
4154 (Constructor.Define): Create proper ctor for ComImport types.
4156 * expression.cs (New.CheckComImport): Fixed.
4158 2005-11-07 Miguel de Icaza <miguel@novell.com>
4160 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4161 that a parameter has been captured does not mean that we do not
4162 have to do the rest of the processing. This fixes the second part
4163 of #76592. If there was another anonymous method capturing
4164 values in the past, the Scope would never be set for the second
4165 method that captured the same parameter.
4167 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4168 properly manipulate the stack. Second part of fix for #76592.
4170 * expression.cs (New): Add support for invoking "new" on
4171 interfaces that have been flagged with the ComImport attribute and
4172 the CoClass. Fixes #76637
4174 * statement.cs (Try.DoEmit): When a variable is captured, do not
4175 try to emit the vi.LocalBuilder variable as it has been captured.
4176 Create a temporary variable and store the results on the
4177 FieldBuilder. Fixes #76642
4179 2005-11-07 Marek Safar <marek.safar@seznam.cz>
4181 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4183 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4185 * expression.cs (Binary.DoResolve): Added && optimalization.
4187 * typemanager.cs (AddUserType): Removed useless argument.
4189 2005-11-04 Marek Safar <marek.safar@seznam.cz>
4191 * statement.cs (Block.variables): Uses ListDictionary.
4193 2005-11-03 Marek Safar <marek.safar@seznam.cz>
4196 * class.cs (PartialContainer.EmitType): Customized to emit
4197 security attributes.
4198 (ClassPart.ApplyAttributeBuilder): Transform security attribute
4199 for partial classes.
4201 2005-11-03 Marek Safar <marek.safar@seznam.cz>
4204 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4205 access has to be fixed.
4207 * typemanager.cs (IsUnmanagedType): Wrong common field type.
4209 2005-11-01 Marek Safar <marek.safar@seznam.cz>
4212 * ecore.cs (NullCast.Reduce): Implemented.
4214 * expression.cs (ArrayCreation.CheckIndices): Correcly check
4217 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4219 (Foreach.Resolve): Catch null properly.
4221 2005-10-29 Marek Safar <marek.safar@seznam.cz>
4223 * cs-tokenizer.cs: Warning text fix.
4225 * driver.cs: AllWarningNumbers exposed on public interface.
4227 * report.cs (): Reviewed warning numbers.
4228 (IsValidWarning): Use binary search.
4230 2005-10-29 Marek Safar <marek.safar@seznam.cz>
4232 * driver.cs: Implemeted resource visibility.
4233 (Resources): New class for code sharing between /res: and
4236 2005-10-28 Marek Safar <marek.safar@seznam.cz>
4239 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4242 * convert (Convert.ImplicitReferenceConversion): NullCast holds
4245 * ecore.cs (NullCast): Child is contant only.
4247 * literal.cs (NullLiteral.Reduce): null can be converted to any
4250 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
4252 * driver.cs: Use Encoding.Default as default code page instead
4255 2005-10-27 Raja R Harinath <rharinath@novell.com>
4258 * expression.cs (Invocation.Error_InvalidArguments): Handle
4259 __arglist parameters.
4260 (Invocation.VerifyArgumentsCompat): Likewise.
4261 * support.cs (ReflectionParameters.GetSignatureForError): Print
4262 __arglist parameters.
4263 (InternalParamters.GetSignatureForError): Likewise.
4264 * parameter.cs (Parameters.GetSignatureForError): Likewise.
4266 2005-10-26 Marek Safar <marek.safar@seznam.cz>
4268 * attribute.cs (GetPropertyValue): Made public.
4270 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4272 Add new property WrapNonExceptionThrows to handle 2.0 assembly
4274 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4277 * driver.cs: Reflect method name change.
4279 * statement.cs (Try.Resolve): Warn when try has both general
4282 * typemanager.cs: runtime_compatibility_attr_type new predefined
4285 2005-10-26 Raja R Harinath <harinath@gmail.com>
4288 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4289 treat it as an empty parameter list.
4291 2005-10-26 Raja R Harinath <rharinath@novell.com>
4294 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
4295 ResolveAsTypeStep silent.
4296 * statement.cs (Block.AddConstant): Mark block as used.
4297 (Block.ResolveMeta): Avoid piling on error messages
4298 if a constant initializer resolution fails.
4300 2005-10-25 Raja R Harinath <rharinath@novell.com>
4302 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4304 (NamespaceEntry.VerifyAllUsing): New.
4305 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
4306 behaviour. Delegates actual resolution of alias to ...
4307 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
4308 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4310 * driver.cs (Driver.MainDriver): Update.
4312 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4313 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4315 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4317 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4318 RootNamespace.DefineNamespacesForAll.
4320 2005-10-24 Raja R Harinath <harinath@gmail.com>
4322 * typemanager.cs (assemblies, external_aliases, modules)
4323 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4324 (ComputeNamespaces, GetRootNamespace): Remove extra staging
4325 overhead. Move resposibility ...
4326 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
4327 * driver.cs, attribute.cs, codegen.cs: Update to changes.
4329 2005-10-23 Raja R Harinath <harinath@gmail.com>
4331 * namespace.cs (RootNamespace.all_namespaces): Renamed from
4332 cached_namespaces. Improve usage.
4333 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4334 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4335 Move from GlobalRootNamespace and simplify.
4336 (RootNamespace.Global): Make instance variable.
4337 (RootNamespace.RootNamespace): Add "alias name" parameter.
4338 (GlobalRootNamespace): Simplify drastically.
4339 (Namespace.Lookup): Don't use GetNamespace.
4340 * typemanager.cs (GetRootNamespace): Rename from
4341 ComputeNamespaceForAlias.
4342 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4344 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4346 * anonymous.cs (AnonymousContainer): Don't crash when container
4349 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4351 * expression.cs (Binary.DoResolve): Warn when comparing same
4354 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4357 * expression.cs (Binary.DoResolve): It looks like there are no
4358 convetsion rules in enum context.
4360 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4362 Add support for extern alias qualifiers.
4363 * typemanager.cs: Move some LookupTypeReflection code
4364 to namespace.cs, to have cleaner code. Added some methods
4365 to help us keep track of the extern aliased references.
4366 * driver.cs: Add suport for extern alias assemblies on command
4367 line and check for their warnings/errors. Also keep track of the
4368 extern aliased assemblies.
4369 * namespace.cs: Move the global functionality of Namespace
4370 to GlobalRootNamespace/RootNamespace. Now the global namespace
4371 is GlobalRootNamespace.Globa. Also the code moved from
4372 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
4373 Finally added LocalAliasEntry (AliasEntry before) and
4374 ExternAliasEntry, to handle alias statements.
4375 * cs-parser.jay: Add support in the grammar for extern alias
4377 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
4378 Update callings to Namespace (now in GlobalRootNamespace).
4380 2005-10-18 Raja R Harinath <rharinath@novell.com>
4383 * class.cs (TypeContainer.DefineType): Move updating of
4384 topological sort earlier in the code.
4385 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4387 2005-10-18 Marek Safar <marek.safar@seznam.cz>
4390 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4392 * constant.cs (Constant.TryReduce): Moved from Cast class.
4393 (Reduce): Made little bit more OO and fixed missing conversions.
4395 * ecore.cs (Reduce): Implemented.
4396 (Binary.EnumLiftUp): New method to upgrade values to enum values.
4398 * literal.cs (Reduce): Implemented.
4400 * class.cs: Reverted Miguel's wrong commit.
4402 2005-10-14 Miguel de Icaza <miguel@novell.com>
4404 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4406 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
4408 * cs-parser.jay, expression.cs : CS0214 was missing error location
4409 for constants. Fixed bug #76404.
4411 2005-10-11 Marek Safar <marek.safar@seznam.cz>
4414 * convert.cs (ExplicitConversionCore): Fixed object->enum
4417 2005-10-10 Raja R Harinath <rharinath@novell.com>
4419 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4421 (PropertyExpr.EmitCall): Likewise.
4422 * expression.cs (Invocation.EmitArguments): Handle case where
4424 (Invocation.EmitCall): Avoid allocating temporary variable if
4425 there are no arguments.
4427 2005-10-07 Raja R Harinath <rharinath@novell.com>
4430 * convert.cs (ImplicitConversionStandard): Move conversion of
4431 void* to arbitrary pointer types ...
4432 (ExplicitConversionStandard): .. here.
4433 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4434 error to always print typenames.
4436 2005-10-07 Raja R Harinath <rharinath@novell.com>
4438 * convert.cs (GetConversionOperator): Rename from
4439 GetConversionOperators. Move operator selection code from ...
4440 (UserDefinedConversion): ... here.
4442 2005-10-06 Marek Safar <marek.safar@seznam.cz>
4444 * convert.cs (ExplicitConversionCore): Removed duplicate enum
4447 2005-10-05 Marek Safar <marek.safar@seznam.cz>
4449 * assign.cs (Assign.DoResolve): Error method changed.
4451 * cfold.cs (DoConstantNumericPromotions): Error method changed.
4453 * const.cs (ResolveValue): Reset in_transit immediately.
4455 * constant.cs: Error method changed.
4457 * convert.cs: Removed useless location parameter.
4458 (ExplicitNumericConversion): Don't do double enum check.
4459 (ExplicitConversionCore): Renamed from ExplicitConversion.
4460 (ExplicitUnsafe): Extracted from ExplicitConversion.
4461 (ExplicitConversion): Uses for error reporting.
4463 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4465 (ResolveBoolean): Uses common error method.
4466 (CastToDecimal): Get rid of ec.
4467 (CastFromDecimal): Optimized.
4468 (ConvCast): Get rid of ec.
4470 * enum.cs (ResolveValue): Reset in_transit immediately.
4471 (Emit): Return after first error.
4473 * expression.cs: Convert changes.
4475 * literal.cs: Error method changed.
4477 * statement.cs: Error method changed.
4479 2005-10-03 Raja R Harinath <rharinath@novell.com>
4481 * support.cs (SeekableStreamReader.Position): Don't error out when
4482 the requested position is just beyond the end of the current
4485 2005-09-28 Raja R Harinath <rharinath@novell.com>
4487 * support.cs (SeekableStreamReader): Simplify drastically. Don't
4488 try to keep in sync with the byte count of the underlying Stream.
4489 However, this limits us to a window size of 2048 characters: i.e.,
4490 the maximum lookahead of our lexer/parser can be 2048 characters.
4492 2005-09-28 Marek Safar <marek.safar@seznam.cz>
4495 * driver.cs: Fix compilation files with full root path.
4497 2005-09-25 Miguel de Icaza <miguel@novell.com>
4499 * report.cs (SymbolRelatedToPreviousError): Format the output so
4500 it does not use an open parenthesis that is never closed.
4502 * driver.cs: Follow coding guidelines
4504 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4507 * const.cs (Const.ResolveValue): Check for assigning non-null
4508 value to reference type.
4510 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4512 * anonymous.cs: Implemented ExprClassName.
4514 * assign.cs (Assign.DoResolve): Don't chrash when type is not
4517 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4520 * class.cs (StaticClass.DefineContainerMembers): Report protected
4523 * codegen.cs: if(ed) PRODUCTION.
4525 * convert.cs (Error_CannotImplicitConversion): Better error
4528 * cs-parser.jay: More error checks.
4530 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4532 * driver.cs (CSCParseOption): Enabled wrong option check.
4534 * ecore.cs (Expression.ExprClassName): Turned to property.
4535 (MemberExpr.CheckIntermediateModification): For checking boxed
4536 value types modification.
4538 * statement.cs (Fixed.Resolve): Expression type must be
4539 convertible to fixed type.
4540 (CollectionForeach.GetEnumeratorFilter,TryType):
4541 Small refactoring for easier error checking.
4543 2005-09-26 Marek Safar <marek.safar@seznam.cz>
4545 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4548 * class.cs (GeneratedBaseInitializer): New class for customization
4549 compiler generated initializers.
4550 (MemberBase.DoDefine): Check Obsolete attribute here.
4551 (FieldMember.DoDefine): Ditto.
4553 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4556 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4557 (MemberCore.GetObsoleteAttribute): Removed argument.
4558 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4559 (MemberCore.CheckObsoleteType): New helper.
4563 * statement.cs: Updates after MemberCore changes.
4565 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4566 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4568 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4569 obsolete attribute for compiler construct.
4570 (As.DoResolve): Cache result.
4572 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4574 2005-09-26 Raja R Harinath <rharinath@novell.com>
4577 * expression.cs (This.VerifyFixed): In a value type T, the type of
4578 'this' is T&, iow, 'this' is either an out or ref parameter. In a
4579 value type R, 'this' is treated as a value parameter.
4581 2005-09-22 Miguel de Icaza <miguel@novell.com>
4583 * statement.cs (Lock): Use the TemporaryVariable class instead of
4584 manually using local variables as those do not work when variables
4587 * ecore.cs: Moved the TemporaryVariable class from being a nested
4588 class inside Foreach to be a public class that can be employed in
4591 2005-09-19 Marek Safar <marek.safar@seznam.cz>
4593 * cs-parser.jay: interface_accessors replaced by
4594 accessor_declarations.
4596 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4599 * statement.cs (GotoCase.Resolve): Convert null constant to
4601 (SwitchLabel.ResolveAndReduce): Ditto.
4602 (SwitchLabel.NullStringCase): Custom null stamp.
4603 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4605 typemanager.cs (CSharpSignature): Don't skip first argument
4608 2005-09-18 Miguel de Icaza <miguel@novell.com>
4610 * driver.cs: Set InEmacs based on the environment variable EMACS.
4612 * location.cs (InEmacs): in this mode, do not report column
4613 location as it confuses Emacs.
4615 2005-09-16 Marek Safar <marek.safar@seznam.cz>
4617 * cfold.cs, constant.cs, convert.cs, ecore.cs,
4618 expression.cs, iterators.cs, literal.cs: Store constants and
4621 * class.cs (MemberBase.ShortName): Pass location.
4623 * cs-parser.jay: Some location fixes.
4625 * ecore.cs (Expression.Location): Made virtual.
4627 2005-09-05 Miguel de Icaza <miguel@novell.com>
4629 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4630 if the underlying types are the same, otherwise we need to produce
4631 code that will do the proper cast.
4633 This was exposed by Marek's constant rewrite which produced
4634 invalid code for the call site:
4637 void Method (X v) {}
4641 This fixes test-49.cs
4643 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4645 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4646 Type/Object should be allowed as well. Fixed bug #75968.
4648 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4650 * expression.cs : (Binary.DoResolve): when one is enum constant and
4651 another is constant 0, then return enum one *as enum type*.
4654 2005-09-02 Raja R Harinath <rharinath@novell.com>
4656 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4660 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4661 flow-branching for LocalVariableReferences in case we were invoked
4662 from a MemberAccess.
4663 * expression.cs (LocalVariableReference.VerifyAssigned): New.
4665 (LocalVariableReference.DoResolveBase): ... this.
4666 (MemberAccess.Resolve): Do the check that was disabled during
4669 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4672 (PartialContainer.Create): check abstract/sealed/static strictly
4673 but abstract/sealed can exist only at one side. Fixed bug #75883.
4675 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
4678 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4679 specified, don't default to UnmanagedType.I4.
4681 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4683 * expression.cs : conditional operator should check possibly
4684 incorrect assign expression. Fixed bug #75946.
4686 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4688 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4689 Reverting the change. gmcs is much complex than mcs on this matter.
4691 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4693 * cs-tokenizer.cs : To read another token ahead of the actual
4694 consumption, use new SavedToken and cache token instead of moving
4695 back the stream with SeekableStreamReader (it seemed problematic).
4697 driver.cs : Thus use StreamReader directly.
4698 * support.cs : Thus removed SeekableStreamReader.
4700 2005-08-30 Raja R Harinath <rharinath@novell.com>
4703 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4704 (ScopeInfo.EmitScopeType): Use it to construct field names from
4705 names of captured locals.
4708 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4709 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4710 Pass 'target_type' to BoxedCast. Don't default to 'object'.
4711 (ExplicitConversion): Remove enum cases already handled by
4712 implicit conversion. Move implicit conversion check to the beginning.
4713 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4714 * expression.cs (ArrayCreation.EmitDynamicInitializers):
4715 Don't treat System.Enum as a struct.
4717 2005-08-30 Jb Evain <jbevain@gmail.com>
4719 * attribute.cs: handles as expression in parameters.
4721 2005-08-30 Raja R Harinath <rharinath@novell.com>
4724 * class.cs (TypeContainer.VerifyClsName): Don't use a
4725 PartialContainer when verifying CLS compliance.
4726 (AbstractPropertyEventMethod): Set Parent here, ...
4727 (PropertyMethod): ... not here.
4729 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
4731 * attribute.cs : escaped attribute name should not be allowed to be
4732 resolved (e.g. @class as classAttribute). Fixed bug #75930.
4734 2005-08-29 Raja R Harinath <rharinath@novell.com>
4737 * convert.cs (ImplicitStandardConversionExists): Allow zero also
4738 when converting a long constant to unsigned long.
4739 * expression.cs (Invocation.OverloadResolve): Add sanity check to
4740 detect where IsApplicable and VerifyArgumentsCompat disagree.
4742 2005-08-29 Raja R Harinath <rharinath@novell.com>
4743 and Carlos Alberto Cortez <carlos@unixmexico.org>
4746 * class.cs (TypeContainer.CanElideInitializer): New helper.
4747 (TypeContainer.EmitFieldInitializers): Use it to determine if we
4748 can safely emitting the initializer of a field.
4750 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4752 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4753 allowed inside a switch (without loop). Fixed bug #75433.
4755 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4757 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4758 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4760 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4762 * driver.cs : kinda reverting the default encoding changes (not exact
4763 revert since I noticed that "codepage:reset" might not work fine).
4765 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4767 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4768 Location. Now getter and setter store location correctly.
4769 (errors/cs0111-12.cs now reports the expected location.)
4771 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4773 * driver.cs : Use default encoding on the environment.
4774 Removed (now that) extra parameter for SeekableStreamReader.
4775 * support.cs : (SeekableStreamReader) third .ctor() argument for
4776 StreamReader is not required (always true). preamble size could
4777 be acquired in simpler and safe way.
4779 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4781 * cs-parser.jay: report CS0642 at warning level 3
4782 and report CS0642 for an if else statement also
4783 fixes bug #74745. Patch by John Luke (and a bit
4785 Removed extra CS0642 warning check for "while",
4787 * statement.cs: In Block.Resolve(), CS0642 check
4788 is reimplemented to check a sequence of an empty
4789 statement and a block.
4791 Both fix bug #66777.
4793 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4795 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4796 detection until I fix it.
4798 * cs-tokenizer.cs: Changed error message.
4800 * cs-parser.jay: Fixed 2 error locations.
4802 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4803 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4806 * enum.cs (GetSignatureForError): Fixed.
4808 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4812 * typemanager.cs (RegisterProperty): Removed.
4814 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4816 2005-08-24 Raja R Harinath <rharinath@novell.com>
4819 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4820 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4822 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4824 * expression.cs : tiny fix is required for not warning positive ulong.
4827 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4829 * expression.cs : add CS0652 check for constant and integral
4830 expression. Fixed bug #53974.
4832 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4834 * expression.cs : in DoNumericPromotions(), check if there is implicit
4835 conversion overload for string (to check CS0034). Fixed bug #52492.
4837 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4839 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4841 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4843 * ecore.cs : report location when it is *not* Null.
4845 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4851 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4852 correctly. Fixed bug #75721.
4854 2005-08-23 Raja R Harinath <rharinath@novell.com>
4856 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4857 loop that performs 'min (pos, char_count)'.
4860 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4861 converted value in Operator.OnesComplement.
4863 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4865 * anonymous.cs: If the anon method is pulled into a helper class,
4866 it needs to be `internal' not `private'. Fixes runtime behavior on
4869 2005-08-20 Martin Baulig <martin@ximian.com>
4871 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4872 scope if we don't already have it.
4874 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4875 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4878 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4881 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4884 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4886 The big constants rewrite
4887 Fix #75746, #75685 and more
4888 As a side effect saved 1MB for MWF ;-)
4890 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4891 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4892 enum based for corlib compilation.
4894 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4897 * class.cs (FixedField.Define): Use ResolveAsConstant.
4899 * const.cs (IConstant): Interface constants and enums.
4900 (Const.ResolveValue): New method for constant resolvning.
4901 (ExternalConstant): Constants from imported assemblies.
4903 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4904 conversion; like enums.
4905 (Constant.ToType): Converts this constant to different type.
4906 (Constant.Increment): Adds 1.
4908 * convert.cs (ImplicitConversionRequired): Simplified.
4910 * cs-parser.jay: Create EnumMember directly.
4912 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4914 * doc.cs (GenerateEnumDocComment): Removed.
4916 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4917 (ConvertIntLiteral): Removed.
4918 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4920 * enum.cs (EnumMember): Implement IConstant.
4921 (Enum.IsValidEnumConstant): Removed.
4922 (Enum.GetNextDefaultValue): Removed.
4923 (Enum.FindMembers): Updated.
4924 (Enum.GenerateDocComment): Iterate enum members.
4926 * expression.cs (Cast.TryReduce): Handle enums correctly.
4927 (New.Constantify): Made public.
4928 (MemberAccess.DoResolve): Removed contant specific if(s).
4930 * literal.cs (NullLiteral): Implement new abstract methods.
4932 * statement.cs (GotoCase.Resolve): Use new constant methods.
4933 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4935 * typemanager.cs (LookupEnum): Removed.
4936 (IsEnumType): Fixed to work with corlib.
4937 (RegisterConstant): Removed.
4938 (LookupConstant): Removed.
4939 (GetConstant): Changed to work with IConstant.
4941 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4943 * location.cs : Fixed overflown (>255) column number.
4945 2005-08-03 Raja R Harinath <rharinath@novell.com>
4947 First cut of the qualified-alias-member feature.
4948 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4950 * cs-parser.jay (DOUBLE_COLON): New token.
4951 (namespace_or_type_name): Add rule for recognizing
4952 qualified-alias-members.
4953 (primary_expression): Likewise.
4954 (element_access): Allow QualifiedAliasMember as a possible
4955 type-bearing expression.
4956 (local_variable_type, local_variable_pointer_type): Likewise.
4957 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4958 aliases in the current and enclosing namespace declarations.
4959 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4960 * decl.cs (MemberName.is_double_colon): New.
4961 (MemberName.MemberName): Add new constructor for alias-member.
4962 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4963 * expression.cs (QualifiedAliasMember): New expression type.
4965 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4967 * location.cs : it borked when no argument was specified.
4969 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4971 * location.cs : tiny ToString() format fix.
4973 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4975 * statement.cs : oops, it was missing.
4977 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4979 A set of fixes for precise line/column location.
4982 "token" field now holds a file/line "delta", a line number offset
4983 from the segment, and a column number. See also:
4984 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4985 December/009508.html
4986 Removed static IsNull. Use instance IsNull property instead.
4988 For some tokens it stores Location. For Identifier it stores
4989 LocatedToken which is a pair of string name and location.
4990 Column numbers are adjusted only at getChar().
4992 Use Location.ToString() for reporting (it now contains column).
4994 Largely modified to use LocatedToken instead of
4995 string (IDENTIFIER), and to acquire Location from some tokens.
4996 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4997 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4999 Now MemberName holds Location. DeclSpace.ctor() receives Location
5000 as a parameter. Removed extra parameters to all derived classes.
5001 Replaced Location.IsNull() with instance property.
5002 * assign.cs, expression.cs :
5003 Added .ctor() overload that omits Location.
5005 Added "nameEscaped" flag that indicates the identifier was escaped
5006 in the source file. This fixes bug #57047.
5008 2005-08-02 Marek Safar <marek.safar@seznam.cz>
5010 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5011 New method, looking for lo-case imported cls type.
5013 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5016 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5018 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5020 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5022 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5024 Optimized to save 3.5 MB for SWF compilation.
5026 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5028 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5029 (PartialContainer.Create): Moved logic AddToContainer.
5030 (PartialContainer.MarkForDuplicationCheck): Shares name.
5032 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5035 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5037 (Namespace.GetSignatureForError): New method.
5039 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5040 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5042 2005-08-01 Raja R Harinath <rharinath@novell.com>
5045 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5046 member lookup rather than qualifier_type, since qualifier_type can
5049 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5051 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5054 2005-07-31 Miguel de Icaza <miguel@novell.com>
5056 * statement.cs: Copy the local exception into the exception
5057 captured local. Fixes 75674
5059 2005-07-31 Raja R Harinath <harinath@gmail.com>
5062 * expression.cs (Invocation.OverloadResolve): Don't report error
5063 CS1501 if error CS1502 has been reported.
5064 (New.DoResolve): Delegate CS1501 reporting to
5065 Invocation.OverloadResolve.
5068 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5069 invariant-meaning-in-block property in an enclosing block if
5072 2005-07-29 Marek Safar <marek.safar@seznam.cz>
5074 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5075 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5076 (Switch.CheckSwitch): Just save 50kb for SWF.
5078 2005-07-27 Martin Baulig <martin@ximian.com>
5080 * anonymous.cs (CaptureContext.AddField): Added
5081 `AnonymousContainer am' argument; compute its toplevel scope if
5082 it's not already computed. Fixes #75649.
5084 2005-07-26 Raja R Harinath <rharinath@novell.com>
5087 * class.cs (Constructor.Emit): Reset block to null if the block
5090 2005-07-25 Marek Safar <marek.safar@seznam.cz>
5092 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5094 2005-07-25 Marek Safar <marek.safar@seznam.cz>
5096 * class.cs (MethodData.Define): Check whether accessor implementing
5097 interface is public.
5099 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5101 2005-07-22 Marek Safar <marek.safar@seznam.cz>
5104 * namespace.cs (LookupType): Moved same type check to...
5106 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5109 2005-07-21 Raja R Harinath <rharinath@novell.com>
5111 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5112 already found a typebuilder.
5113 * class.cs (MethodCore.IsDuplicateImplementation): Compare
5114 MemberNames, not strings.
5116 * const.cs (Error_ExpressionMustBeConst):
5117 Rename from Error_EpressionMustBeConst.
5118 * const.cs, class.cs, statement.cd: Update.
5120 2005-07-21 Marek Safar <marek.safar@seznam.cz>
5124 * const.cs (Const.LookupConstantValue): Report missing contant expression
5126 (Error_EpressionMustBeConstant): Only one error method.
5128 * class.cs, statement.c: Updated.
5130 2005-07-20 Raja R Harinath <rharinath@novell.com>
5132 * statement.cs (Block.Flags): Add back HasVarargs.
5133 (Block.flags): Make protected.
5134 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5136 * typemanager.cs (types, typecontainers, user_types): Remove.
5137 (UserTypes, TypeContainers): Likewise.
5138 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5139 (CleanUp, Reset): Update.
5140 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
5141 (GetNestedType): Use Type.GetNestedType.
5142 (CoreLookupType): Take two arguments, the namespace and the
5143 basename of the type. Update to use the Namespace.Lookup
5145 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5146 (RealMemberLookup): Use IsNestedChildOf instead of playing with
5147 string concatenation and substring matches.
5148 * class.cs, enum.cs, delegate.cs: Update to changes.
5150 2005-07-20 Marek Safar <marek.safar@seznam.cz>
5152 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5153 Expression and made virtual.
5155 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5156 (ImplicitStandardConversionExists): Fixed `byte' typo ?
5158 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5160 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5163 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5166 2005-07-18 Marek Safar <marek.safar@seznam.cz>
5169 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5170 AssemblyCultureAttribute is not used on executable.
5173 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5175 2005-07-16 Raja R Harinath <rharinath@novell.com>
5178 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5179 New. Reports CS0252/CS0253.
5180 Mostly taken from preliminary patch by Duncak Mak.
5181 (Binary.DoResolveOperator): Store results of operator lookup.
5182 Use them to detect if we need to warn about unintended reference
5185 2005-07-15 Raja R Harinath <rharinath@novell.com>
5188 * namespace.cs (Namespace.Lookup): Add back location parameter.
5189 (Namespace.LookupType): Add CS0436 report. Add location parameter.
5190 * delegate.cs, ecore.cs, expression.cs: Update to changes.
5192 * codegen.cs (EmitContext.DeclSpace): Make readonly.
5193 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5194 (Namespace.LookupType): ... this.
5195 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5197 * typemanager.cs (LookupTypeReflection): Remove buggy code that
5198 purported to handle pointers.
5199 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5202 2005-07-15 Marek Safar <marek.safar@seznam.cz>
5204 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5207 2005-07-15 Raja R Harinath <rharinath@novell.com>
5209 * namespace.cs (Namespace.Lookup): Drop location parameter.
5210 (NamespaceEntry.LookupAlias): Remove. Merge into ...
5211 (NamespaceEntry.Lookup): ... this.
5212 (NamespaceEntry.Error_AmbiguousTypeReference):
5213 Move here from DeclSpace.
5214 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5216 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5217 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5218 Move to NamespaceEntry.
5219 * delegate.cs, expression.cs: Update to changes.
5221 2005-07-14 Marek Safar <marek.safar@seznam.cz>
5223 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5224 CheckAttributeType and refactored.
5225 (Attribute.ResolvePossibleAttributeType): Changed to reuse
5226 ResolveAsTypeTerminal error handling.
5227 (ResolveAsTypeTerminal): Introduced because of global attributes extra
5229 (GetSignatureForError): Print errors in same way.
5232 * codegen.cs: Reflect attribute GetSignatureForError change.
5235 * expression.cs: Add silent parameter to ResolveAsTypeStep.
5237 * namespace.cs (UsingEntry): Refactored to make fields private.
5240 statement.cs: Error_UnexpectedKind has extra parameter.
5242 2005-07-14 Raja R Harinath <rharinath@novell.com>
5244 * ecore.cs (IAlias): Remove.
5245 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
5246 that implement the interface.
5247 * namespace.cs (Namespace): Likewise.
5248 (Namespace.declspaces): Renamed from 'defined_names'.
5249 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
5250 DeclSpace instead of an IAlias.
5251 * tree.cs (Tree.AddDecl): Update.
5253 2005-07-12 Raja R Harinath <rharinath@novell.com>
5255 * statement.cs (Block.Flags); Remove HasVarargs.
5256 (Block.HasVarargs): Move to ToplevelBlock.
5257 (Block.ThisVariable, Block.AddThisVariable): Likewise.
5258 (Block.Variables): Make protected. Initialize variable hashtable
5260 (Block.AddVariable): Update.
5261 (Block.Resolve): Update to changes.
5262 (ToplevelBlock.HasVarargs): New boolean.
5263 (ToplevelBlock.ThisVariable): Move here from Block.
5264 (ToplevelBlock.AddThisVariable): Likewise.
5265 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
5266 * expression.cs (This.ResolveBase): Update to changes.
5267 (ArglistAccess.DoResolve): Likewise.
5269 2005-07-11 Marek Safar <marek.safar@seznam.cz>
5272 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5274 * class.cs (TypeContainer.VerifyMembers): Distinguish between
5275 not used and not used & assigned.
5276 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5278 2005-07-11 Marek Safar <marek.safar@seznam.cz>
5281 * expression.cs (Is.DoResolve): null is never provided type.
5283 2005-07-08 Marek Safar <marek.safar@seznam.cz>
5286 * cs-parser.jay: Less strict event error rule to catch more errors.
5288 2005-07-08 Martin Baulig <martin@ximian.com>
5290 Fix test-iter-10.cs - distinguish whether we `yield' in a property
5291 gettter (allowed) or setter (not allowed).
5293 * class.cs (Accessor): Implement IIteratorContainer.
5294 (Accessor.Yields): New public field.
5295 (PropertyBase.PropertyMethod.Define): Handle iterators on a
5299 (get_accessor_declaration, set_accessor_declaration): Set the
5300 `yields' flag on the accessor, not the property.
5301 (property_declaration): Do the iterators check on a per-accessor
5302 basis and not for the whole property.
5304 2005-07-08 Martin Baulig <martin@ximian.com>
5306 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5307 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5309 2005-07-07 Marek Safar <marek.safar@seznam.cz>
5312 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5313 (ExtractSecurityPermissionSet): Cope with self referencing security
5314 attributes properly.
5316 * driver.cs (SetOutputFile): Made public property OutputFile.
5318 2005-07-07 Raja R Harinath <rharinath@novell.com>
5321 * class.cs (TypeContainer.first_nonstatic_field): Rename from
5322 has_nonstatic_fields. Make into a FieldBase pointer.
5323 (TypeContainer.AddField): Add CS0282 check.
5324 (TypeContainer.EmitType): Update.
5326 2005-07-06 Miguel de Icaza <miguel@novell.com>
5328 * cs-tokenizer.cs (consume_identifier): Do not create strings to
5329 compare if they start with __.
5331 2005-07-06 Raja R Harinath <rharinath@novell.com>
5333 * statement.cs (Switch.SwitchGoverningType): Only look at
5334 UserCasts that don't need implicit standard conversions to one of
5335 the allowed switch types (Fixes test-322.cs).
5336 (LocalInfo.Resolve): Re-enable sanity-test.
5338 2005-07-06 Marek Safar <marek.safar@seznam.cz>
5340 * cs-tokenizer.cs (consume_identifier): Detect double undescores
5342 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5344 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5346 2005-07-06 Raja R Harinath <rharinath@novell.com>
5349 * ecore.cs (SimpleName.GetSignatureForError): Add.
5350 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5351 (MemberAccess.GetSignatureForError): Add.
5353 2005-07-05 Marek Safar <marek.safar@seznam.cz>
5355 The big error and warning messages review.
5385 * typemanager.cs: Updated.
5387 * class.cs: (MethodCore.SetYields): Moved here to share.
5388 (PropertyMethod.Define): Moved iterator setup here.
5390 * iterators.cs: Add orig_method to have full access to parent
5393 2005-07-05 Raja R Harinath <rharinath@novell.com>
5395 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5396 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5397 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5398 variable of struct type.
5399 * expression.cs (Unary.ResolveOperator): Update to change.
5400 (Indirection.VerifyFixed): Likewise.
5401 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5402 (ParameterReference.VerifyFixed): Value parameters are fixed.
5403 (This.VerifyFixed): Treat 'this' as a value parameter.
5404 * statement.cs (LocalInfo.IsFixed): Remove.
5406 2005-07-01 Martin Baulig <martin@ximian.com>
5408 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5409 `ec.EmitThis ()' to get the correct scope.
5411 2005-07-01 Martin Baulig <martin@ximian.com>
5413 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5414 instance is a ParameterReference; fixes #75299.
5416 2005-07-01 Martin Baulig <martin@ximian.com>
5418 Reverted Marek's latest patch (r46725):
5419 - it contains structural changes which are neither mentioned in
5420 the ChangeLog nor explained anywhere; for example the additional
5421 argument of EmitContext's and Iterator's .ctor's and the
5422 TypeContainer.DefineMembers() change.
5423 - structural changes like this should go in in seperate patches
5424 and not be hidden in a huge patch which just seems to affect
5425 warnings and errors.
5426 a big and hard to understand patch.
5427 - it breaks iterators and causes regressions, for instance in
5430 2005-06-30 Raja R Harinath <rharinath@novell.com>
5433 * expression.cs (Indexers.map): Remove.
5434 (Indexers.Append): Filter out inaccessible setters and getters.
5435 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5438 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
5440 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5441 (FieldExpr.Emit, PropertyExpr.Emit): Update.
5442 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5443 * expression.cs (Invocation.EmitCall): Add CS0120 check.
5445 2005-06-30 Marek Safar <marek.safar@seznam.cz>
5448 * class.cs (FieldBase.GetInitializerExpression): One more field
5451 2005-06-28 Miguel de Icaza <miguel@novell.com>
5453 * pending.cs: Do not define a proxy if the base method is virtual,
5454 it will be picked up by the runtime (bug 75270).
5456 2005-06-08 Martin Baulig <martin@ximian.com>
5458 The big Iterators rewrite :-)
5460 * iterators.cs: Rewrite this to use the anonymous methods framework.
5462 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5463 before the TypeContainers; see 2test-21.cs.
5466 (TypeContainer.DefineType): Don't create a new EmitContext if we
5467 already have one (this only happens if we're an Iterator).
5468 (TypeContainer.Define): Also call Define() on all our iterators.
5469 (Method.CreateEmitContext): Added support for iterators.
5472 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5473 (AnonymousContainer.CreateMethodHost): Moved here from
5474 AnonymousMethod and made abstract.
5475 (AnonymousContainer.CreateScopeType): New abstract method.
5476 (AnonymousContainer.IsIterator): New public property.
5477 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5478 get the ScopeTypeBuilder rather than manually defining it here.
5479 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5482 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5483 before RootContext.DefineTypes().
5485 * codegen.cs (EmitContext.RemapToProxy): Removed.
5486 (EmitContext.CurrentAnonymousMethod): Changed type from
5487 AnonymousMethod -> AnonymousContainer.
5488 (EmitContext.ResolveTopBlock): Protect from being called twice.
5489 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5490 (EmitContext.EmitThis): Removed the iterators hacks; use the
5491 anonymous methods framework for that.
5494 (ToplevelBlock.Container): Make this a property, not a field.
5495 (ToplevelBlock.ReParent): New public method; move the
5496 ToplevelBlock into a new container.
5497 (Foreach.TemporaryVariable): Simplify.
5499 2005-06-05 Martin Baulig <martin@ximian.com>
5501 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5502 (Block.AddTemporaryVariable): New public method; creates a new
5503 `LocalInfo' for a temporary variable.
5504 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5506 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5507 non-iterator variables.
5509 2005-06-05 Martin Baulig <martin@ximian.com>
5511 * statement.cs (Foreach.TemporaryVariable): Create the
5512 LocalBuilder in the Emit phase and not in Resolve since in some
5513 situations, we don't have an ILGenerator during Resolve; see
5514 2test-19.cs for an example.
5516 2005-06-04 Martin Baulig <martin@ximian.com>
5518 **** Merged r45395 from GCS ****
5520 The big Foreach rewrite - Part II.
5522 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5523 with `PropertyInfo ienumerator_getcurrent'.
5525 * codegen.cs (VariableStorage): Removed.
5528 (Foreach): Derive from Statement, not ExceptionStatement.
5529 (Foreach.CollectionForeach): New nested class. Moved all the code
5530 dealing with collection foreach here.
5531 (Foreach.ForeachHelperMethods): Removed.
5532 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5534 2005-05-23 Martin Baulig <martin@ximian.com>
5536 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5537 don't need to. Fix #75014.
5539 2005-05-20 Martin Baulig <martin@ximian.com>
5541 Merged r44808 from GMCS.
5543 * class.cs (TypeContainer.CircularDepException): Removed.
5544 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5545 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5546 (CS0146) and interface (CS0529) dependencies here.
5548 2005-06-21 Raja R Harinath <rharinath@novell.com>
5550 * expression.cs (Invocation.EmitCall): Fix initialization
5551 'this_call' to reflect current behaviour. Fix indentation.
5553 * convert.cs (FindMostEncompassedType): Add two trivial special
5554 cases (number_of_types == 0 || number_of_types == 1).
5555 (FindMostEncompasingType): Likewise.
5557 2005-06-17 Raja R Harinath <rharinath@novell.com>
5559 Some cleanups preparing for the fix of #75283.
5560 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5562 (EventExpr.InstanceResolve): Likewise.
5563 (EventExpr.DoResolve): Remove redundant checks.
5565 2005-06-10 Duncan Mak <duncan@novell.com>
5567 * cs-tokenizer.cs (process_directives): New flag for controlling
5568 the processing of preprocessor directives.
5569 (x_token): After seeing a '#', return Token.NONE instead of going
5570 to handle_preprocessing_directive() when not processing
5571 directives. This avoids unnecessary processing during the token peek in
5576 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5577 the existing error reporting methods instead of Report.Error.
5579 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5580 after Raja's rewrite.
5582 2005-06-08 Miguel de Icaza <miguel@novell.com>
5584 * class.cs: Small fix.
5586 2005-06-08 Raja R Harinath <rharinath@novell.com>
5589 * class.cs (GetPartialBases): Fix return value check of
5592 2005-06-07 Raja R Harinath <rharinath@novell.com>
5594 Ensure that partial classes are registered in their enclosing
5595 namespace. Initial part of fix of #75160.
5596 * tree.cs (Tree.RecordDecl): Add new namespace argument.
5597 Register declspace with namespace here, not in
5598 DeclSpace.RecordDecl.
5599 * cs-parser.jay: Pass namespace to RecordDecl.
5600 * class.cs (PartialContainer.Create): Likewise.
5601 (ClassPart.DefineType): New sanity-check. Throws an exception if
5603 * decl.cs (Declspace.RecordDecl): Remove.
5604 * namespace.cs (NamespaceEntry.DefineName): Remove.
5606 2005-06-06 Marek Safar <marek.safar@seznam.cz>
5608 * rootcontext.cs: Reset TargetExt as well.
5610 2005-06-03 Raja R Harinath <rharinath@novell.com>
5612 * ecore.cs (Expression.Resolve): Emit CS0654 error when
5615 2005-06-02 Raja R Harinath <rharinath@novell.com>
5617 Fix #75080, cs0119.cs.
5618 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
5620 (Expression.Resolve): ... this. Use it. Remove bogus code
5621 allowing ExprClass.Type and ExprClass.Namespace for
5622 ResolveFlags.VariableOrValue.
5623 (Expression.Resolve) [1-argument variant]: Change default resolve
5624 flags based on language version.
5625 (Expression.Error_UnexpectedKind): Use a simple string array
5626 rather than an ArrayList.
5627 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5629 (TypeOfVoid.DoResolve): Likewise.
5630 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
5631 flags argument -- it always has the same value.
5633 2005-05-31 Raja R Harinath <rharinath@novell.com>
5636 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5637 Use it in the error message.
5638 * assign.cs, expression.cs, statement.cs: Update.
5640 2005-05-30 Raja R Harinath <rharinath@novell.com>
5643 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5644 the "almostMatchedMember" case too.
5645 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5646 that failed the accessibility checks to 'almost_match'.
5648 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
5650 * attribute.cs: Use internal MethodBuilder methods to set
5651 ExactSpelling and SetLastError on PInvoke methods, instead
5652 of passing them via charset. Fixes #75060.
5654 2005-05-27 Raja R Harinath <rharinath@novell.com>
5656 * parameter.cs (Parameter): Remove TODO comment.
5657 (Parameter.DefineParameter): Remove Location parameter.
5658 (Parameters.LabelParameters): Likewise.
5659 * class.cs (Constructor.Emit): Update to change.
5660 (MethodData.Emit): Likewise.
5661 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
5662 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5664 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
5667 Removed Parameters.Location and added Parameter.Location instead.
5668 Removed Location parameter from Emit() and GetSignature().
5675 Modified all related calls.
5677 2005-05-26 Raja R Harinath <rharinath@novell.com>
5679 Improve user-defined conversion handling.
5680 * convert.cs (GetConversionOperators): Rewrite. Return only the
5681 applicable operators.
5682 (AddConversionOperators): New. Helper for GetConversionOperators.
5683 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5684 there is only one most encompassed/encompassing type.
5685 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5686 "applicable operator" handling.
5687 (UserConversion): Move cache here from GetConversionOperators.
5688 Directly cache the chosen operator, rather than the whole
5690 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5691 case. Allow conversion of decimal to sbyte and byte too.
5692 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5693 New static methods. Used to avoid allocating EmptyExpressions in
5696 2005-05-24 Duncan Mak <duncan@novell.com>
5698 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5699 another class, used in Convert.ExplicitNumericConversion.
5700 (CastToDecimal): New class, similar to above, but casts to
5701 System.Decimal, used in Convert.ImplicitNumericConversion and also
5702 in explicit convesion from double/float to decimal.
5704 * convert.cs (ImplicitNumericConversion): Handle implicit
5705 conversions to System.Decimal.
5706 (ExplicitNumericConversion): handle explicit conversions to
5711 2005-05-20 Miguel de Icaza <miguel@novell.com>
5713 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5714 know the type at this stage, just break through. Fixes #75008
5716 2005-05-19 Martin Baulig <martin@ximian.com>
5719 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5720 to disable error reporting.
5722 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5723 here since we don't want to report an error; see the new test-336.cs.
5725 2005-05-19 Raja R Harinath <rharinath@novell.com>
5727 * statement.cs (ToplevelBlock.GetParameterReference)
5728 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5729 Move here from class Block.
5730 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5731 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5733 2005-05-18 Martin Baulig <martin@ximian.com>
5738 (FlowBranching.Reachability): Add non-static public And() and Or()
5740 (FlowBranchingSwitch): New class; do the `break_origins' thing
5741 like in FlowBranchingLoop.
5742 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5743 reachability, not just locals and parameters.
5744 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5745 switch; MergeBreakOrigins() now takes care of that.
5747 2005-05-18 Martin Baulig <martin@ximian.com>
5749 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5750 a loop and may leave it, reset the barrier; fixes #74974.
5752 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5754 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5757 * cs-parser.jay: Catch more lexical errors.
5759 * report.cs: Add one more Error method.
5762 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5764 2005-05-17 Martin Baulig <martin@ximian.com>
5766 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5769 2005-05-16 Raja R Harinath <rharinath@novell.com>
5771 Fix test-382.cs. Emit values of decimal constants.
5772 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5774 (TypeContainer.AddField): ... this.
5775 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5776 with initializers to include 'Const's.
5777 (ClassPart.RegisterFieldForInitialization): Forward to
5779 * const.cs (Const.Const): Pass initializer to base class.
5780 (Const.Define): In case of decimal constants, register them for
5781 initialization in a static constructor.
5783 2005-05-14 Martin Baulig <martin@ximian.com>
5785 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5786 do not call ResolveUnreachable() on unreachable statements in
5787 here, see the comment in the source code.
5789 2005-05-13 Raja R Harinath <rharinath@novell.com>
5792 * expression.cs (BinaryResolveOperator): If one of the operands of
5793 an equality comparison is 'null' and the other is a pointer type,
5794 convert the null to a NullPointer.
5795 * convert.cs (ImplicitReferenceConversion): If the expression is a
5796 NullLiteral and the target type is a pointer type, return a
5797 NullPointer instead.
5798 (ImplicitConversionStandard): Likewise.
5800 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5802 * cs-parser.jay: Set readonly context based on special constructs.
5804 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5805 readonly variable error handling.
5807 * rootcontext.cs (EmitCode): Don't verify members when error
5810 * statement.cs (LocalInfo): Add reaodnly context information.
5811 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5813 2005-05-13 Raja R Harinath <rharinath@novell.com>
5815 * statement.cs (Block.Resolve): Revert change below. Modify fix
5816 for #74041 to initialize 'resolved' to false only for explicit
5817 blocks. Fixes #74873.
5819 2005-05-12 Raja R Harinath <harinath@gmail.com>
5822 * typemanager.cs (unmanaged_enclosing_types): New.
5823 (IsUnmanagedType): Avoid infloops by using
5824 'unmanaged_enclosing_types' to talk with recursive invocations.
5826 2005-05-13 Martin Baulig <martin@ximian.com>
5828 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5829 instance variable, not a local. Fix #74873.
5830 (Block.ResolveUnreachable): Set it to true here.
5832 2005-05-11 Duncan Mak <duncan@novell.com>
5834 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5835 continuing to process for 'arg'.
5836 (handle_preprocessing_directive): Check the argument of the #endif
5837 directive and report error CS1025 if there are any trailing
5840 According to the C# spec, having even whitespace after the #endif
5841 directive is illegal; however, because we call arg.TrimEnd ()
5842 beforehand, we have the same behavior as csc, allowing whitespace
5843 after the directive.
5847 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5851 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5852 (Constructor.GetObsoleteAttribute): Implemented correctly.
5854 2005-05-10 Martin Baulig <martin@ximian.com>
5856 * support.cs (ReflectionParameters.ParameterModifier): Use
5857 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5858 and `ParameterAttributes.In'. Fixes #74884.
5860 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5862 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5864 * expression.cs (Argument.GetParameterModifier): Turned to property.
5865 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5867 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5870 2005-05-09 Raja R Harinath <rharinath@novell.com>
5873 * decl.cs (MemberCache.AddMethods): Register override methods,
5874 rather than non-override methods.
5875 * typemanager.cs (RegisterOverride): New.
5876 (IsOverride): Update.
5878 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5882 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5883 recursive declaration.
5885 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5887 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5889 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5891 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5893 2005-05-05 Raja R Harinath <rharinath@novell.com>
5896 * decl.cs (DeclSpace.FamilyAccessible):
5897 Use TypeManager.IsNestedFamilyAccessible.
5899 Fix reopened #64812.
5900 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5903 2005-05-04 Raja R Harinath <rharinath@novell.com>
5904 Abin Thomas <projectmonokochi@rediffmail.com>
5905 Anoob V E <projectmonokochi@rediffmail.com>
5906 Harilal P R <projectmonokochi@rediffmail.com>
5909 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5910 allow access to all static members.
5912 2005-05-04 Martin Baulig <martin@ximian.com>
5914 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5916 2005-05-04 Martin Baulig <martin@ximian.com>
5920 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5921 section at the end; make things work if `default' is not the last
5924 2005-05-04 Martin Baulig <martin@ximian.com>
5928 * statement.cs (Switch): Replaced the `got_default' field with a
5929 `default_section' one.
5930 (Switch.CheckSwitch): Set `default_section' here.
5931 (Switch.Resolve): If we're a constant switch and the constant is
5932 not found, use the default section.
5934 2005-05-03 Martin Baulig <martin@ximian.com>
5936 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5938 * statement.cs (Foreach.ArrayForeach): New nested class.
5939 (Foreach.TemporaryVariable): New nested class.
5940 (Foreach.EmitArrayForeach): Removed; this is now in the new
5943 2005-05-03 Raja R Harinath <rharinath@novell.com>
5945 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5947 (VerifyPendingMethods): Revert change below.
5949 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5950 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5951 that used to trigger warning -28. Remove warning -28.
5952 * expression.cs (Invocation.OverloadResolve): Use
5953 TypeManager.IsOverride to distinguish override methods.
5956 * pending.cs (VerifyPendingMethods): If a base type implements the
5957 requested interface, don't bother checking individual methods of
5958 the base type. As a side-effect, this prevents the creation of
5959 unnecessary proxies.
5961 2005-05-02 Martin Baulig <martin@ximian.com>
5965 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5966 Also `And' the locals if the old vector is null.
5967 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5968 null; in this case we basically reset all the variables.
5970 2005-05-02 Martin Baulig <martin@ximian.com>
5974 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5975 Added `FlowBranching branching' argument; always `and' the
5976 variables instead of `or'ing them unless we're an infinite loop.
5978 * statement.cs (While.Resolve): Create a new sibling unless we're
5981 2005-05-02 Martin Baulig <martin@ximian.com>
5985 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5986 arguments; use it instead of creating a new TopLevelBlock.
5987 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5988 our ConstructorInitializer.
5991 (TopLevelBlock.TopLevelBranching): New public property.
5992 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5993 and create our `TopLevelBranching'.
5995 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5996 anonymous method host, use `block.TopLevelBranching' rather than
5997 creating a new branching.
5999 2005-04-20 Miguel de Icaza <miguel@novell.com>
6001 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6002 a ScopeInfo, if any of the current children is a child of the new
6003 entry, move those children there.
6005 2005-04-30 Martin Baulig <martin@ximian.com>
6007 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6008 at the beginning of a SwitchSection. Fix #73335.
6010 2005-04-27 Marek Safar <marek.safar@seznam.cz>
6013 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6015 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6016 (FieldExpr.DoResolve): Obsolete members are ignored for field
6019 2005-04-26 Marek Safar <marek.safar@seznam.cz>
6021 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6022 of arrays detection.
6024 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6026 (Field.VerifyClsCompliance): Volatile fields are not compliant.
6028 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6031 2005-04-25 Ben Maurer <bmaurer@ximian.com>
6033 * cs-parser.jay: Use the prefered version of -unsafe in error
6036 2005-04-22 Marek Safar <marek.safar@seznam.cz>
6038 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6041 2005-04-20 John Luke <john.luke@gmail.com>
6043 * driver.cs: fix typo in error message, --outout to --output
6045 2005-04-20 Marek Safar <marek.safar@seznam.cz>
6047 * codegen.cs (InRefOutArgumentResolving): New field.
6049 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6050 fields outside contructor.
6052 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6054 2005-04-19 Miguel de Icaza <miguel@novell.com>
6056 * anonymous.cs (CaptureContext.EmitParameterInstance): The
6057 parameter code was not completed ever, so it was not as up-to-date
6058 as local variables. Must finish it.
6060 The bug fix was to compare the Toplevel of the block, not the
6061 current block. Thanks for Ben for pointing this out.
6063 2005-04-19 Raja R Harinath <rharinath@novell.com>
6065 * decl.cs (AddMethods): Use the declaring type of the problem
6066 method to determine if we want to squash a warning.
6068 2005-04-19 Marek Safar <marek.safar@seznam.cz>
6070 * attribute.cs: Removed debug output.
6072 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6074 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6077 2005-04-18 Raja R Harinath <rharinath@novell.com>
6080 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6081 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6082 all null comparisons against reference types.
6084 2005-04-18 Marek Safar <marek.safar@seznam.cz>
6087 * class.cs (TypeContainer.CircularDepException) New nested
6089 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6090 (TypeContainer.DefineType): Removed error, reset InTransit before
6092 (Class.DefineType): Throw exception when is in Transit.
6093 Catch exception and report error.
6094 (Struct.DefineType): Throw exception when is in Transit.
6095 Catch exception and report error.
6096 (Interface.DefineType): Throw exception when is in Transit.
6097 Catch exception and report error.
6099 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6100 handle nested exception handlers.
6102 * flowanalysis.cs (InTryWithCatch): New method, search for try with
6105 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6106 InFinally and InCatch storage.
6108 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6109 (Catch.Resolve): Set and Restore ec.InCatch.
6110 (Try.Resolve): Set and Restore ec.InFinally.
6111 (Try.HasCatch): True when try has catch.
6113 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
6115 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6116 for the same event member, so exclude such cases from warning 419.
6119 2005-04-16 Miguel de Icaza <miguel@novell.com>
6121 * expression.cs (Binary.ResolveOperator): Apply patch from John
6122 Luke to fix bug 59864: operators &, | and ^ on enumerations
6123 require that the same enum type on both sides.
6125 * driver.cs: Add warnings to old flag usage, this is to assist
6126 people who produce Makefiles and hope that the Makefiles will be
6129 * class.cs (TypeContainer.EmitType): Moved the definition of the
6130 special $PRIVATE$ field from the resolve phase to the Emit phase.
6131 During resolve we do not know if we are a struct with
6132 HasExplicitLayout, we know this only after the attributes for the
6135 Set the FieldOffset to zero on the dummy field that we create for
6136 the class. Fixes 74590.
6138 2005-04-16 Raja R Harinath <rharinath@novell.com>
6141 * ecore.cs (PropertyExpr.resolved): New.
6142 (DoResolve): Use it to handle a case of double resolution here.
6143 Handle a case of identical-name-and-type-name.
6144 * expression.cs (ArrayCreation.CheckIndices): Avoid double
6145 resolution by storing the results of expression resolution back
6146 into the "probes" array.
6148 2005-04-15 Raja R Harinath <rharinath@novell.com>
6150 Fix cs0208-7.cs and cs0208-8.cs.
6151 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6152 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
6153 error reporting to point out the reason a struct is not unmanaged.
6155 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
6157 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
6158 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6160 2005-04-13 Raja R Harinath <rharinath@novell.com>
6163 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6164 IdenticalNameAndTypeName here.
6165 (EventExpr.InstanceResolve): Likewise.
6167 2005-04-13 Marek Safar <marek.safar@seznam.cz>
6169 C# 2.0 DefaultCharSetAttribute implementation
6171 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6172 which allows us to set GlobalNamespace for every resolve.
6173 (Attribute.ResolveArguments): Cut from Resolve.
6174 (Attribute.GetCharSetValue): Returns CharSet named argument.
6175 (Attribute.DefinePInvokeMethod): Gets default charset from
6177 (GlobalAttribute.ResolveAsTypeStep): Override.
6178 (GlobalAttribute.ResolveArguments): Override.
6180 * class.cs (TypeAttr): Is protected.
6182 * codegen.cs (ModuleClass.DefaultCharSet): New member.
6183 (ModuleClass.DefaultCharSetType): New memeber.
6184 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6186 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6187 charset from module.
6189 * delegate.cs (TypeAttr): Override.
6190 (Delegate.DefineType): Use this TypeAttr.
6192 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6193 at very early stage (before types are defined) to resolve model
6194 module attributes. It will probably not work with corlib but it
6197 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6198 charset from module.
6200 * typemanager.cs (default_charset_type): New type.
6202 2005-04-13 Raja R Harinath <rharinath@novell.com>
6204 * decl.cs (MemberCache.AddMethods): Don't warn if
6205 System.Object.Finalize has buggy MethodAttributes.
6207 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6210 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
6212 * doc.cs : detect ambiguous reference to overloaded members.
6213 Fixed bug #71603. MS 1.1 csc does not detect it.
6215 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
6217 * doc.cs : delegates must not be referenced with parameters.
6220 2005-04-12 Miguel de Icaza <miguel@novell.com>
6222 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6224 2005-04-10 Miguel de Icaza <miguel@novell.com>
6226 * driver.cs (MainDriver): Stop processing if the CLS stage found
6229 (CompilerCallableEntryPoint.InvokeCompiler): Always
6230 reset after execution; Take a TextWriter argument for the
6233 * report.cs: Use the error stream instead of hardcoding stderr.
6235 2005-04-09 Miguel de Icaza <miguel@novell.com>
6237 * class.cs: Reduce code paths to test, too small of an
6238 optimization to make it worth the extra testing. Always perform
6241 2005-04-08 Raja R Harinath <rharinath@novell.com>
6244 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6245 operators that had errors reported on them.
6247 2005-04-08 Marek Safar <marek.safar@seznam.cz>
6249 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6251 (Attribute.Resolve): Add named argument type checking.
6253 * class.cs (FixedField.Define): Use IsPrimitiveType
6255 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6257 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6258 unsafe parameter types.
6260 * statement.cs (Using.ResolveExpression): Add better error description.
6262 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6264 2005-04-08 Raja R Harinath <rharinath@novell.com>
6267 * attribute.cs (Attribute.GetAttributeUsage): Resolve
6268 AttributeUsageAttribute in the emitcontext of the attribute class,
6269 not in the emitcontext of the attributable entity it was attached to.
6270 * cs-parser.jay: Use 'current_class', not 'current_container',
6271 when creating a GlobalAttribute.
6273 2005-04-08 Alp Toker <alp@atoker.com>
6275 * pending.cs: The fix to #58413 failed to compile methods implementing
6276 interfaces with/without params modifiers and vice versa, even though
6277 params modifiers aren't part of the signature. Make the modifier check
6278 less strict as in csc.
6280 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
6281 Anoob V E <projectmonokochi@rediffmail.com>
6282 Harilal P R <projectmonokochi@rediffmail.com>
6285 * pending.cs (TypeAndMethods.mods): New. Store the parameter
6286 modifiers of pending methods.
6287 (PendingImplementation.PendingImplementation): Initialize it.
6288 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6289 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6290 with ParameterData. Add check for modifiers.
6291 * class.cs (MethodData.Define): Update to changes.
6293 2005-04-07 Raja R Harinath <rharinath@novell.com>
6295 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6297 2005-04-07 Marek Safar <marek.safar@seznam.cz>
6299 * class.cs (PropertyMethod.Define): Check private accessor in abstract
6302 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6305 * typemanager.cs: Registered RequiredAttributeAttribute.
6307 2005-04-06 Marek Safar <marek.safar@seznam.cz>
6309 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6310 Warning CS0169 is back at level 3.
6311 (IMethodData.SetMemberIsUsed): New method.
6313 * decl.cs (IsUsed): New value; moved from FieldBase.Status
6314 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6316 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6318 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6320 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6323 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6326 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6327 to avoid the problems with nested types.
6329 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
6330 Anoob V.E <projectmonokochi@rediffmail.com>
6331 Harilal P.R <projectmonokochi@rediffmail.com>
6332 Raja R Harinath <rharinath@novell.com>
6335 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6337 * typemanager (GetConstructor): Make public.
6339 2005-04-05 John Luke <john.luke@gmail.com>
6340 Raja R Harinath <rharinath@novell.com>
6343 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6344 struct too. Return false quicker in a few cases.
6345 (VerifyUnManaged): Use it.
6347 2005-04-05 Raja R Harinath <rharinath@novell.com>
6350 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6351 not 'unreachable_seen'.
6353 2005-04-04 Marek Safar <marek.safar@seznam.cz>
6355 * attribute.cs (Attribute.GetValue): Removed unused.
6357 * codegen.cs (CodeGen.TrimExt): Removed unused.
6359 * cs-parser.jay (output): Removed unused.
6361 * cs-tokenizer.cs (hex_digits): Removed unused.
6363 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6365 * expression.cs (Indirection.LoadExprValue): Removed unused.
6366 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6368 * iterators.cs (Iterator.param_types): Removed unused.
6370 * statement.cs (Goto.block): Removed unused.
6371 (ToplevelBlock.did): Removed unused.
6372 (Switch.ResolveConstantSwitch): Removed unused.
6374 2005-04-01 Ben Maurer <bmaurer@ximian.com>
6376 * rootcontext.cs: Allow mcs to bootstrap with the compilation
6379 2005-04-01 Raja R Harinath <rharinath@novell.com>
6381 Fix #74232 and cs0208-3.cs.
6382 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6383 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6384 unmanaged type. Don't use FieldBuilders when 't' is a
6385 TypeBuilder. Use ModFlags and MemberType fields.
6386 * class.cs (MemberBase.member_type): Rename from MemberType.
6387 (MemberBase.MemberType): New property. Determines member_type on
6389 (MemberBase.DoDefine): Don't initialize MemberType here.
6390 (FieldMember.Define): Likewise.
6392 2005-04-01 Marek Safar <marek.safar@seznam.cz>
6395 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6396 Attributes are emitted there.
6398 2005-04-01 Raja R Harinath <rharinath@novell.com>
6400 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6401 keyword in 'partial enum' too.
6402 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6404 Report from Kamil Skalski <nazgul@omega.pl>.
6407 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6408 have partial containers too.
6410 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6411 in block' checks to Block.CheckInvariantMeaningInBlock.
6412 * statement.cs (Block.GetKnownVariableInfo): Make private.
6413 (Block.IsVariableUsedInChildBlock): Remove.
6414 (Block.IsVariableUsedInBlock): Likewise.
6415 (Block.CheckInvariantMeaningInBlock): New. Show location of
6416 conflicting declaration.
6417 (Block.AddVariable): Make error messages less long-winded and more
6418 specific. Show location of conflicting declaration.
6419 * parameter.cs (Parameters.Location): New readonly property.
6421 2005-03-31 Raja R Harinath <rharinath@novell.com>
6423 Clean up semantics of invoking ResolveMemberAccess.
6424 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6425 can have an instance, ensure that we pass in a non-TypeExpression
6426 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
6427 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6428 argument. Update to changes and simplify.
6429 (FieldExpr.Emitinstance): Remove CS0120 check.
6430 (PropertyExpr.EmitInstance): Likewise.
6431 * expression.cs (Argument.Resolve): Likewise.
6432 (Invocation.DoResolve): Update to changes in semantics of
6435 2005-03-31 Marek Safar <marek.safar@seznam.cz>
6438 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6441 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6443 2005-03-31 Raja R Harinath <rharinath@novell.com>
6445 Fix difference in behaviour with commandline invocation.
6446 * driver.cs (Driver.Reset): New.
6447 (CompilerCallableEntryPoint): Call it.
6449 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6450 variable" warnings if the boolean expression failed to resolve.
6452 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6454 * attribute.cs: Fix the union of several permissions when some of them
6455 are unrestricted (so the result isn't an unrestricted permission set).
6458 2005-03-30 Raja R Harinath <rharinath@novell.com>
6460 * ecore.cs (MemberExpr): New class. Convert from interface
6462 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6463 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6465 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6466 (MethodGroupExpr.IsExplicitImpl): Remove.
6467 (Expression.GetFieldFromEvent): Remove.
6468 (SimpleName.MemberStaticCheck): Remove.
6469 (SimpleName.DoSimpleNameResolve): Update to changes.
6470 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6471 (MemberAccess.IdenticalNameAndTypeName): Remove.
6472 (MemberAccess.error176): Move to MemberExpr.
6473 (MemberAccess.DoResolve): Update to changes.
6474 (BaseAccess.DoResolve): Likewise.
6476 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6478 C# 2.0 Conditional attribute class implementation
6480 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6481 Analyzes class whether it has attribute which has ConditionalAttribute
6482 and its condition is not defined.
6484 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6485 (Class.IsExcluded): New method. Search for at least one defined
6486 condition in ConditionalAttribute of attribute class.
6488 2005-03-30 Raja R Harinath <rharinath@novell.com>
6490 * ecore.cs (PropertyExpr): Derive from Expression, not
6491 ExpressionStatement.
6492 (PropertyExpr.EmitStatement): Remove.
6494 2005-03-29 Raja R Harinath <rharinath@novell.com>
6497 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6498 internal field "value__" of an enum be private. The examples for
6499 "value__" that I found on MSDN all used FieldAttributes.Private.
6501 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6502 Don't mention IL method attribute names.
6504 Fix #47991. Remove a TODO.
6505 * statement.cs (Block.Toplevel): Make into a field.
6506 (Block.Parameters): Move into ToplevelBlock.
6507 (Block.known_variables): Rename from child_variable_names.
6508 (Block.Block): Remove variants that take Parameters. Initialize
6509 'Toplevel' with the immediately surrounding toplevel block.
6510 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6511 LocalInfo parameter.
6512 (Block.GetKnownVariableInfo): New.
6513 (Block.IsVariableNameUsedInChildBlock): Update.
6514 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6515 the block, even though it may not be in scope.
6516 (Block.AddVariable): Remove Parameters parameter. Use
6517 Toplevel.Parameters instead.
6518 (Block.AddConstant): Remove Parameters parameter.
6519 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6520 (Block.IsParamaterReference): Likewise.
6521 (Block.IsLocalParameter): Likewise. Simplify a lot.
6522 (ToplevelBlock.Parameters): New. Moved from Block.
6523 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6524 initialize Parameters to a non-null value.
6525 * cs-parser.jay: Update to changes.
6526 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6527 simple names that mean different things in the same block. Use
6528 Block.IsVariableNameUsedInBlock.
6530 2005-03-28 Raja R Harinath <rharinath@novell.com>
6532 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6533 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6534 GetTypeHandle. It is possible for a reflected type to derive from
6535 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6536 System.Array during mscorlib compilation).
6537 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6538 contain a method_hash, don't create one either. Don't create a
6539 deep copy of the base cache's method_hash.
6540 (MemberCache.SetupCache): Rename back from DeepCopy.
6541 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6542 already initialized. If we see an override function, add its
6543 underlying base virtual function to the member_hash too.
6545 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6547 2005-03-26 Raja R Harinath <harinath@acm.org>
6550 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6551 fails to resolve, ensure that the LHS is still resolved as an
6554 2005-03-25 Raja R Harinath <harinath@acm.org>
6556 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6558 (Enum.current_ec): Remove.
6559 (Enum.LookupEnumValue): Remove EmitContext argument.
6560 Just uses the one created during DefineType.
6561 (Enum.FindMembers): Update.
6562 * expression.cs (MemberAccess.DoResolve): Update.
6564 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6566 * assign.cs (Assign.DoResolve): Check for CS1717 when
6567 source and target are same (uses Equals).
6569 * expression.cs (LocalVariableReference, ParameterReference,
6570 This): Implemented Equals, GetHashCode.
6572 * statement.cs (Block.GetParameterReference): Removed useless
6575 2005-03-22 Raja R Harinath <rharinath@novell.com>
6578 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6579 blocks before deciding whether the error is cs0136 or cs0128.
6581 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6582 (using_alias_directive, using_namespace_directive): Pass
6583 MemberName, not an expression to Namespace.UsingAlias and
6585 (MakeName): Use the MemberName of the namespace.
6586 * namespace.cs (Namespace.MemberName): New.
6587 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6588 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6590 * decl.cs (MemberName.Name): Make readonly.
6591 (MemberName.FromDotted): New "constructor".
6592 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6593 (MemberCore.Name): Compute from MemberName on demand.
6594 (MemberCore.SetMemberName): Provide a way to change the
6596 (MemberCore.AddToContainer): Don't take a fullname parameter.
6597 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6598 fully qualified name of the container to the member name.
6599 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6600 only if the type is a member of the root container.
6601 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6602 MemberName.Left rather than searching for an embedded ".".
6603 (PartialContainer.CreatePart): Update to changes in RootContext.
6604 (MemberBase.ShortName): Turn into a property. Use
6605 MemberCore.SetMemberName.
6606 (MemberBase.ExplicitInterfaceName): Remove.
6607 (MemberBase.UpdateMemberName): Remove.
6608 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6609 (PropertyBase.SetMemberName): New override.
6610 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6611 (Tree.GetDecl): New.
6612 (Tree.AllDecls): Rename from Decls.
6613 * attribute.cs, enum.cs, report.cs: Update to changes.
6614 * driver.cs (MainDriver): Use MemberName.FromDotted on
6615 RootContext.MainClass.
6617 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6619 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6622 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6624 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6626 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6627 property accessor modifiers.
6629 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6630 fixed buffer attribute (CS1716).
6631 (PropertyMethod.HasCustomAccessModifier): When property accessor
6632 has custom modifier.
6634 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6636 (PropertyExpr.DoResolveLValue): Add CS0272.
6638 2005-03-17 Miguel de Icaza <miguel@novell.com>
6640 * convert.cs: When converting to a pointer, use the proper Conv.U
6641 or Conv.I depending on the source data type.
6643 * cs-tokenizer.cs: Make the size for large decimal constants,
6646 2005-03-17 Martin Baulig <martin@ximian.com>
6648 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6649 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6651 2005-03-17 Martin Baulig <martin@ximian.com>
6653 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6654 to bool so we can return an error condition.
6655 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6658 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6660 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6663 2005-03-16 Raja R Harinath <rharinath@novell.com>
6665 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6666 Refactor to avoid traversing the list of assemblies, and to avoid
6667 string concatenation.
6668 * typemanager.cs (guid_attr_type): Remove.
6669 (negative_hits, pointers, references): Remove hashes.
6671 (GetConstructedType): New. Uses type_hash to handle constructed
6672 types (arrays, references, pointers).
6673 (GetReferenceType, GetPointerType): Use it.
6674 (GetNestedType): New. Uses type_hash to handle nested types of
6676 (LookupType, LookupTypeDirect): Remove.
6677 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6678 'types' hash and LookupTypeReflection directly.
6679 (params_string, params_object): Use GetConstructedType.
6680 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6682 (Namespace.Lookup): Use cached_types.
6683 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6684 provided by old TypeManager.LookupType.
6685 * rootcontext.cs (MakeFQN): Remove.
6686 * decl.cs (DeclSpace.MakeFQN): Likewise.
6687 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6688 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6689 TypeManager.GetConstructedType.
6690 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6692 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6694 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6697 * cs-parser.jay: Reports CS1527 for any namespace element.
6699 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6702 * expression.cs (ParameterReference.IsAssigned): Changed error to
6704 (Error_WrongNumArguments): Moved CS0245 detection here.
6706 * statement.cs (Return.Resolve): Add CS1622 report.
6708 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6710 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6712 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6714 * attribute.cs expression.cs: Get rid of some allocations.
6716 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6718 * doc.cs : just eliminate the latest change.
6720 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6722 * doc.cs : commented out the latest change. It breaks xml-030.cs
6724 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6726 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6727 fail. So invoke CreateType() in FindDocumentedType().
6729 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6731 * cs-tokenizer.cs : added IsKeyword().
6732 * doc.cs : Detect keyword incorrectly used as identifier.
6733 Allow identifiers prefixed by @.
6735 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6737 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6738 It caused exception in namespace resolving (again!).
6740 * class.cs (Class.ctor): Removed exit.
6741 (PropertyMethod.ctor): ditto.
6743 * codegen.cs (Codegen.Reset): Reset static data.
6744 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6746 * cs-tokenizer.cs (Cleanup): Removed.
6748 * driver.cs (GetSystemDir): Rewrote to one line command.
6749 It caused problem with unloaded dynamic modules.
6750 (UnixParseOption): Removed Exit.
6751 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6752 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6753 Now can be mcs used as library.
6755 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6758 * location.cs (Reset): Reset static data.
6760 * namespace.cs (Reset): Reset static data.
6762 * report.cs (Report.Reset): Reset static data.
6764 * rootcontext.cs (RootContext.Reset): Reset static data.
6766 * tree.cs (RootTypes.ctor): Use Location.Null
6768 * typemanager.cs (TypeManager.Reset): Reset static data.
6769 (CoreLookupType): Removed Exit.
6770 (TypeHandle.Reset): Reset static data.
6772 2005-03-10 Raja R Harinath <rharinath@novell.com>
6775 * typemanager.cs (ComputeNamespaces): Import namespaces from
6776 referenced modules too.
6778 2005-03-09 Raja R Harinath <rharinath@novell.com>
6780 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6783 2005-03-09 Raja R Harinath <rharinath@novell.com>
6785 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6786 enclosing DeclSpace. This ensures that a name-lookup populates
6787 more caches and there are fewer 'TypeExpression's. Carve out
6788 nested type lookup into ...
6789 (LookupNestedTypeInHierarchy): ... this.
6791 2005-03-09 Raja R Harinath <rharinath@novell.com>
6793 Clean up a few partial-class semantics.
6794 Fixes test-357.cs and cs1618-2.cs.
6795 * cs-parser.jay (struct_declaration): Use 'current_class' as
6796 parent of newly-created struct. Remove call to Register ().
6797 Use 'pop_current_class' to complete handing the current struct.
6798 (interface_declaration): Likewise.
6799 (class_declaration): Likewise.
6800 (enum_declaration): Use 'current_class' as parent of newly created
6802 (delegate_declaration): Likewise.
6803 (pop_current_class): New function. This is used to handle closing
6804 up the 'current_class' and 'current_container', and pointing them
6805 to the enclosing class/container.
6806 (CSharpParser): Initialize 'current_class' too.
6807 * decl.cs (MemberCore): Add check for invariant: a partial
6808 container is not a parsed entity, and thus does not enclose any
6810 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6811 (DeclSpace.BaseTypeExpr): Use it.
6812 (DeclSpace.LookupType): Add check for invariant.
6813 * class.cs (TypeContainer): Add check for invariant: a nested
6814 class should have the same NamespaceEntry as its enclosing class.
6815 (TypeContainer.EmitFieldInitializers): Make virtual.
6816 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6818 (TypeContainer.Register): Remove.
6819 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6820 null. Use TypeResolveEmitContext for resolving base types and
6821 interfaces. Move initialization of Parts.TypeBuilder here from
6823 (TypeContainer.DefineNestedTypes): ... here.
6824 (PartialContainer): Take a Namespace not a NamespaceEntry.
6825 (PartialContainer.Create): Don't use Register. Call the
6826 appropriate Add... function directly.
6827 (ClassPart): Take both the PartialContainer and the enclosing
6828 class as constructor arguments.
6829 (ClassPart.EmitFieldInitializers): Override.
6830 (ClassPart.PartFindNestedTypes): Remove.
6831 (FieldBase.GetInitializerExpression): Resolve the initializer
6832 expression in the emit context of the enclosing class.
6833 * tree.cs (RootTypes): Remove Register ().
6835 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6837 * cs-parser.jay: Removed CS0134.
6839 * driver.cs: Removed CS1901.
6841 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6842 for predefined types.
6844 2005-03-07 Duncan Mak <duncan@novell.com>
6846 * codegen.cs (Save): Catch UnauthorizedAccessException as
6847 well. Fixes bug #73454.
6849 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6851 * cs-tokenizer.cs (xtoken): Add CS1035.
6853 * class.cs (MethodData.Define): Add CS0683.
6854 (FieldMember.ctor): Add CS0681.
6856 2005-03-07 Raja R Harinath <rharinath@novell.com>
6858 * ecore.cs (SimpleName.DoResolve): Rename from
6859 SimpleName.DoResolveAllowStatic.
6860 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6861 Pass 'intermediate' flag to MemberStaticCheck.
6862 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6863 of "intermediate" lookups via MemberAccess.
6864 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6865 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6867 2005-03-07 Raja R Harinath <rharinath@novell.com>
6870 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6871 slipped in because of variable names that are identical to a
6872 builtin type's BCL equivalent ('string String;', 'int Int32;').
6873 (PropertyExpr.EmitInstance): Likewise.
6875 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6877 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6879 * report.cs (warning_ignore_table): Made public.
6881 2005-03-04 Raja R Harinath <rharinath@novell.com>
6884 * class.cs (MethodData.Emit): Pass 'container' to
6885 container.GetObsoleteAttribute instead of 'container.Parent'.
6887 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6889 * cs-parser.jay: Add 1534 error test.
6891 * iterators.cs (Yield.CheckContext): Add error 1629.
6892 (Iterator.ctor): Save unsafe modifier.
6893 (MoveNextMethod.DoEmit): Restore unsafe context.
6895 * namespace.cs (UsingAlias): Better error message.
6897 2005-03-03 Dan Winship <danw@novell.com>
6899 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6900 the warning message [#73219]
6902 2005-03-03 Raja R Harinath <rharinath@novell.com>
6904 Fix compile with MCS 1.0.0.0.
6905 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6906 w_restore to not depend on string constant folding.
6908 2005-03-03 Raja R Harinath <rharinath@novell.com>
6910 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6911 CS0246 check to users who passed 'silent = false'.
6912 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6914 (SimpleName.SimpleNameResolve): Update.
6915 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6916 (MemberAccess.IdenticalNameAndTypeName): Update.
6917 * doc.cs (FindDocumentedTypeNonArray): Update.
6919 2005-03-03 Raja R Harinath <rharinath@novell.com>
6921 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6922 * parameters.cs (ComputeAndDefineParameters): Remove.
6923 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6924 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6925 Use GetParameterInfo.
6927 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6929 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6931 2005-03-02 Raja R Harinath <rharinath@novell.com>
6933 Unify DeclSpace.LookupType and DeclSpace.FindType.
6934 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6935 is in charge of defining nested types on demand.
6936 (DeclSpace.LookupType): Use it when the current_type is a
6937 TypeBuilder. Use LookupTypeDirect for reflected types.
6938 (DeclSpace.FindType): Remove.
6939 (DeclSpace.LookupInterfaceOrClass): Likewise.
6940 (DeclSpace.DefineTypeAndParents): Likewise.
6941 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6942 DeclSpace.LookupType.
6943 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6944 * typemanager.cs (LookupType): Simplify.
6945 (AddUserType): Remove type from negative_hits.
6946 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6947 * class.cs (TypeContainer.FindMembers): Move handling of nested
6949 (TypeContainer.FindMembers_NestedTypes): ... here.
6950 (TypeContainer.FindNestedType): Implement override.
6951 (ClassPart.FindNestedType): Delegate to PartialContainer.
6952 (ClassPart.PartFindNestedType): Looks up the nested types of the
6955 2005-03-02 Martin Baulig <martin@ximian.com>
6957 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6958 static constructor in static classes.
6960 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6962 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6963 sizeParamIndex is not specified.
6965 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6968 * report.cs (WarningMessage.IsEnabled): Missing null check.
6970 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6972 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6973 in the fields and not in the properties.
6975 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6977 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6980 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6982 * attribute.cs: Small refactoring (improved robustness).
6983 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6984 (ValidateGuid): Removed.
6985 (Resolve): Removed referenced to above mentioned.
6986 (GetAttributeUsage): Made private and changed to work without
6988 (GetIndexerAttributeValue): Don't crash.
6989 (GetConditionalAttributeValue): Ditto.
6990 (GetClsCompliantAttributeValue): Ditto.
6991 (ExtractSecurityPermissionSet): All attributes exceptions are
6993 (GetPropertyValue): New helper.
6994 (GetMethodImplOptions): New method.
6995 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6996 some missing properties.
6998 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6999 (Method.ApplyAttributeBuilder): Updated.
7001 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7004 2005-02-28 Raja R Harinath <rharinath@novell.com>
7007 * report.cs (Report.SymbolRelatedToPreviousError): Handle
7008 non-simple types (array, pointer, reference).
7010 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7012 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7014 * class.cs (MethodCore.IsDuplicateImplementation): Special error
7016 (Method.CheckBase): Catch wrong destructor here.
7017 (MethodData.Define): Add errors 550, 668.
7019 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7021 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7023 * pending.cs (VerifyPendingMethods): Add error 551.
7025 * typemanager.cs (CSharpName): Next error report helper.
7027 2005-02-25 Marek Safar <marek.safar@seznam.cz>
7029 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7030 attributes. Removed useless attribute double check.
7031 It saves almost 2MBs for corlib.
7033 2005-02-25 Raja R Harinath <rharinath@novell.com>
7036 * statement.cs (ExpressionStatement.Resolve): Make robust to being
7037 called twice in case of error.
7039 2005-02-23 Chris Toshok <toshok@ximian.com>
7041 Fix compiler portions of #72827.
7042 * statement.cs (Block.Emit): call Begin/EndScope on the
7043 EmitContext instead of the ILGenerator.
7045 * codegen.cs (EmitContext.BeginScope): new method, call
7046 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7048 (EmitContext.BeginScope): same, but EndScope and CloseScope
7050 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7051 offset and call the superclass's OpenScope(int) with it.
7052 (SymbolWriter.CloseScope): get the current il
7053 offset and call superclass's CloseScope(int) with it.
7055 2005-02-23 Marek Safar <marek.safar@seznam.cz>
7057 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7058 CS1677 for out and ref as well.
7060 * class.cs (Method.Define): Add error CS1599 detection.
7062 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7064 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7066 * delegate.cs (Delegate.Define): Add error CS1599 detection.
7068 * support.cs.cs (ModifierDesc): New helper method.
7070 2005-02-23 Raja R Harinath <rharinath@novell.com>
7071 Abin Thomas <projectmonokochi@rediffmail.com>
7072 Anoob V E <projectmonokochi@rediffmail.com>
7073 Harilal P R <projectmonokochi@rediffmail.com>
7076 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7077 MemberLookup (used for error reporting) actually returns a result.
7078 Fix error report number (122, not 112).
7080 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
7081 Anoob V E <projectmonokochi@rediffmail.com>
7082 Harilal P R <projectmonokochi@rediffmail.com>
7085 * pending.cs (PendingImplementation.GetAbstractMethods):
7086 Find NonPublic members too.
7088 2005-02-22 Marek Safar <marek.safar@seznam.cz>
7090 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7093 * class.cs (MethodCore.CheckMethodAgainstBase):
7094 Add error 239 report.
7096 2005-02-21 Raja R Harinath <rharinath@novell.com>
7099 * expression.cs (Invocation.IsApplicable): Make public.
7100 (Invocation.IsParamsMethodApplicable): Likewise.
7101 * delegate.cs (Delegate.VerifyApplicability): Don't use
7102 Invocation.VerifyArgumentCompat for parameter applicability
7103 testing. Use Invocation.IsApplicable and
7104 Invocation.IsParamsMethodApplicable.
7106 2005-02-21 Marek Safar <marek.safar@seznam.cz>
7108 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7110 * class.cs (Operator.Define): Add error 217 report.
7112 2005-02-21 Raja R Harinath <rharinath@novell.com>
7114 * namespace.cs (UsingEntry.Resolve): Undo change below.
7116 2005-02-21 Raja R Harinath <rharinath@novell.com>
7119 * ecore.cs (Expression.MemberLookupFailed): Add argument to
7120 disable the error message when the extended MemberLookup also
7122 (Expression.MemberLookupFinal): Update.
7123 (SimpleName.DoSimpleNameResolve): Update.
7124 * expression.cs (MemberAccess.ResolveNamespaceOrType):
7125 Don't use MemberLookupFinal.
7126 (New.DoResolve): Update.
7127 (BaseAccess.CommonResolve): Update.
7129 2005-02-21 Raja R Harinath <rharinath@novell.com>
7132 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7133 occured previously, don't resolve again.
7135 2005-02-21 Marek Safar <marek.safar@seznam.cz>
7138 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7139 argument. Call ResolveAttributeUsage for unresolved.
7140 when types doesn't match ctor arguments.
7142 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7143 for nested attribute classes.
7144 (Class.attribute_usage): Removed.
7145 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7146 for attribute class.
7148 * ecore.cs (IsAttribute): Removed.
7150 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7152 * rootcontext.cs (RegisterAttribute): Removed, attributes are
7154 (attribute_types): Removed.
7155 (EmitCode): Global attributes are emited as the latest.
7157 2005-02-18 Marek Safar <marek.safar@seznam.cz>
7159 * class.cs (EmitFieldInitializers): Don't emit field initializer
7160 for default values when optimilization is on.
7162 * constant.cs (Constant.IsDefaultValue): New property.
7164 * driver.cs: Add /optimize handling.
7168 * literal.cs: Implement new IsDefaultValue property.
7170 * rootcontext.cs (Optimize): New field, holds /optimize option.
7172 2005-02-18 Raja R Harinath <rharinath@novell.com>
7174 Fix crasher in re-opened #72347.
7175 * namespace.cs (Namespace.Lookup): Return null if
7176 DeclSpace.DefineType returns null.
7179 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7181 2005-02-18 Raja R Harinath <rharinath@novell.com>
7183 Fix remainder of #63202. Change semantics of DoResolveLValue: it
7184 now returns null if it cannot resolve to an lvalue.
7185 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7186 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7187 returned null. Remove check for SimpleName.
7188 (EventExpr.DoResolveLValue): New.
7189 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7190 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
7192 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
7194 (Unary.ResolveOperator): Move CS0211 check ...
7195 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
7197 (Unary.DoResolveLValue): Simplify.
7198 (AddressOf.DoResolveLValue): New.
7199 (ArrayAccess.DoResolveLValue): New.
7201 2005-02-16 Marek Safar <marek.safar@seznam.cz>
7203 * attribute.cs (Attribute.Resolve): Add arguments casting for
7204 when types doesn't match ctor arguments.
7206 2005-02-16 Raja R Harinath <rharinath@novell.com>
7208 Fix parts of #63202.
7209 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7210 lookup of operator in base type. Ensure that all checks happen
7211 when the operator resolves to an "op_..." method.
7213 2005-02-15 Raja R Harinath <rharinath@novell.com>
7216 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7217 'ignore_cs0104' parameter. Pass it to ...
7218 (NamespaceEntry.Lookup): ... this.
7219 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7220 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7221 (TypeLookupExpression.DoResolveAsTypeStep): Update.
7222 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7223 Update. Request that cs0104 errors be ignored.
7224 (ComposedCast.ResolveAsTypeStep): Update.
7226 2005-02-14 Raja R Harinath <rharinath@novell.com>
7229 * expression.cs (Invocation.BetterFunction): Remove support for
7230 comparing virtual functions and their overrides.
7231 (Invocation.IsOverride): New.
7232 (Invocation.OverloadResolve): Don't consider 'override' functions
7233 during candidate selection. Store them in a lookaside list.
7234 If the selected method is a 'virtual' function, use the list to
7235 find any overrides that are closer to the LHS type.
7237 2005-02-14 Marek Safar <marek.safar@seznam.cz>
7239 * expression.cs (New.DoResolve): Add complex core type reduction.
7240 (New.Constantify): Converts complex core type syntax like 'new int ()'
7243 2005-02-14 Raja R Harinath <rharinath@novell.com>
7245 * decl.cs (EntryType.EntryType): New constructor to create an
7246 updated copy of a cache entry.
7247 (MemberCache.AddMethods): Use it.
7248 (MemberCache.ClearDeclaredOnly): Remove.
7249 (MemberCache.MemberCache): Update.
7251 2005-02-11 Miguel de Icaza <miguel@novell.com>
7253 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7254 variable. This one is represents the actual low-level declaration
7255 of the method, as opposed to the semantic level `IsStatic'.
7257 An anonymous method which is hosted into a static method might be
7258 actually an instance method. IsStatic would reflect the
7259 container, while MethodIsStatic represents the actual code
7262 * expression.cs (ParameterReference): Use the new MethodIsStatic
7263 instead of IsStatic.
7265 * anonymous.cs (AnonymousMethod.Compatible): Pass the
7266 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7267 set on the current EmitContext.
7269 * expression.cs (Cast): Overload DoResolveLValue so we can pass
7270 resolve our casted expression as an LValue. This triggers the
7271 proper LValue processing that is later required by Assign.
7275 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7277 2005-02-11 Marek Safar <marek.safar@seznam.cz>
7279 C# 2.0 Fixed buffer implementation
7281 * anonymous.cs: Update after RegisterHelperClass renaming.
7283 * attribute.cs (AttributeTester.fixed_buffer_cache):
7284 Cache of external fixed buffers.
7285 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7286 implementation if field is fixed buffer else null.
7289 (TypeContainer.AddField): Accept FieldMember instead of Field.
7290 (FieldBase.IsFieldClsCompliant): Extracted code from
7291 VerifyClsCompliance descendant customization.
7292 (FixedField): New class handles fixed buffer fields.
7293 (FixedFieldExternal): Keeps information about imported fixed
7295 (IFixedField): Make access to internal or external fixed buffer
7298 * cs-parser.jay: Add fixed buffer parsing.
7300 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7303 * expression.cs (Indirection): Extended implementation to accept
7305 (PointerArithmetic.Emit): Get element from fixed buffer as well.
7306 (ElementAccess.MakePointerAccess): Get type as parameter.
7307 (DoResolve): Add fixed buffer field expression conversion.
7308 (DoResolveLValue): Ditto.
7309 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7310 (ArrayPtr): Derives from FixedBufferPtr.
7311 (ArrayPtr.Emit): Add extra emit for array elements.
7313 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7315 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7316 for compiler generated types.
7317 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7319 * statement.cs (Fixed): Refactored to be easier add fixed buffer
7320 and consume less memory.
7321 (Fixed.Resolve): Add fixed buffer case.
7323 * typemanager.cs (compiler_generated_attr_ctor,
7324 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7325 (HasElementType): Add our own implementation to work on every
7328 2005-02-11 Miguel de Icaza <miguel@novell.com>
7330 * anonymous.cs (CaptureContext): Track whether `this' has been
7333 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
7334 only captured `this' if it was implicitly done (instance
7335 methods/variables were used).
7337 * codegen.cs (EmitContext.CaptureThis): New method to flag that
7338 `this' must be captured.
7340 2005-01-30 Miguel de Icaza <miguel@novell.com>
7342 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7343 is null it means that there has been no need to capture anything,
7344 so we just create a sibling.
7346 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7348 Just a partial fix. The other half is fairly elusive.
7350 2005-02-10 Raja R Harinath <rharinath@novell.com>
7352 Fix #52586, cs0121-4.cs.
7353 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
7354 and return a hashtable.
7355 (MemberCache.ClearDeclaredOnly): New.
7356 (MemberCache.MemberCache): Update to change. Make a deep copy of
7357 the method_hash of a base type too.
7358 (MemberCache.AddMethods): Adapt to having a deep copy of the base
7359 type methods. Overwrite entries with the same MethodHandle so
7360 that the ReflectedType is correct. The process leaves in base
7361 virtual functions and their overrides as distinct entries.
7362 (CacheEntry): Now a class instead of a struct. It shouldn't alter
7363 matters since it was boxed in a ArrayList before.
7364 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7366 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
7367 case of a virtual function and its override (choose the overload
7369 (Invocation.OverloadResolve): Avoid 'override' members during
7370 'applicable_type' calculation.
7372 2005-02-09 Raja R Harinath <rharinath@novell.com>
7374 Combine two near-redundant caches.
7375 * typemanager.cs (method_params): Rename from method_internal_params.
7376 (TypeManager.GetParameterData): New. Replace
7377 Invocation.GetParameterData.
7378 (TypeManager.LookupParametersByBuilder): Remove.
7379 * expression.cs (Invocation.method_parameter_cache): Remove.
7380 (Invocation.GetParameterData): Remove.
7382 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7385 2005-02-08 Raja R Harinath <rharinath@novell.com>
7388 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7389 TypeManager.multicast_delegate_type is null, resolve it by looking
7390 up "System.MulticastDelegate".
7391 * rootcontext.cs (RootContext.ResolveCore): Simplify.
7393 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
7394 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
7395 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
7398 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7399 (LabeledStatement.AddReference): New. Set 'referenced'.
7400 (Goto.Resolve): Use it.
7402 2005-02-05 John Luke <john.luke@gmail.com>
7404 * driver.cs: remove duplicate -doc line in Usage ()
7406 2005-02-04 Raja R Harinath <rharinath@novell.com>
7408 * location.cs (Location.AddFile): Fix CS2002 error report.
7410 2005-02-02 Martin Baulig <martin@ximian.com>
7412 * delegate.cs (Delegate.DefineType): Report an internal error if
7413 TypeManager.multicast_delegate_type is null. See bug #72015 for
7416 2005-02-02 Raja R Harinath <rharinath@novell.com>
7418 Fix a crasher in a variant of #31984.
7419 * const.cs (Constant.CheckBase): New override that defers the
7420 new-or-override check in case the base type hasn't been populated
7422 (Constant.Define): Ensure the new-or-override check is performed.
7424 2005-02-01 Duncan Mak <duncan@ximian.com>
7426 * const.cs (LookupConstantValue): Check that `ce' is not null
7427 before calling GetValue ().
7429 2005-02-01 Raja R Harinath <rharinath@novell.com>
7431 Fix test-334.cs (#69519).
7432 * cs-parser.jay (using_alias_directive): Pass in an expression to
7433 NamespaceEntry.UsingAlias.
7434 (using_namespace_directive): Pass in an expression to
7435 NamespaceEntry.Using.
7436 (namespace_name): Don't flatten to a string.
7437 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7438 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7440 (NamespaceEntry.UsingEntry): Likewise.
7441 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7443 (NamespaceEntry.LookupForUsing): Remove.
7444 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7446 (NamespaceEntry.Lookup): Remove support for dotted names.
7448 2005-02-01 Raja R Harinath <rharinath@novell.com>
7450 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7452 (NamespaceEntry.ImplicitParent): Compute on demand.
7453 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7454 parallels the current.
7455 (NamespaceEntry.LookupForUsing): Use it.
7456 (NamespaceEntry.Lookup): If the current namespace-entry is
7457 implicit, don't search aliases and using tables.
7459 2005-02-01 Raja R Harinath <rharinath@novell.com>
7462 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7464 (TypeContainer.BaseCache): Compute on demand.
7465 (TypeContainer.FindMembers): Define constants and types if they're
7466 not already created.
7467 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7469 * const.cs (Constant.Define): Make idempotent.
7471 2005-01-29 Miguel de Icaza <miguel@novell.com>
7473 * pending.cs: Produce better code (no nops produced by using Ldarg
7476 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7477 i - 1' it should be arg + 1.
7481 2005-01-28 Raja R Harinath <rharinath@novell.com>
7483 * attribute.cs (Attribute.CheckAttributeType): Make private
7485 (Attribute.ResolveType): Make virtual.
7486 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7487 handling of RootContext.Tree.Types.
7489 2005-01-27 Raja R Harinath <rharinath@novell.com>
7491 Update attribute-handling to use the SimpleName/MemberAccess
7493 * cs-parser.jay (attribute): Pass in an expression to the
7494 constructors of Attribute and GlobalAttribute.
7495 * attribute.cs (Attribute): Take an expression for the name.
7496 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7497 passed in attribute name expression.
7498 (Attribute.CheckAttributeType): Use it.
7499 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7500 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7501 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7502 argument to prevent error messages if the lookup fails.
7504 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7506 * expression.cs (Indirection): Implemented IVariable interface
7507 to support indirection in AddressOf operator.
7508 (PointerArithmetic.Emit): Add optimalization for case where
7509 result can be precomputed.
7511 2005-01-26 Martin Baulig <martin@ximian.com>
7513 * class.cs (TypeContainer.AttributeTargets): Return the correct
7514 AttributeTargets depending on our `Kind' instead of throwing an
7515 exception; fixes #71632.
7517 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7520 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7523 2005-01-25 Raja R Harinath <rharinath@novell.com>
7526 * expression.cs (MemberAccess.DoResolve): Don't complain with
7527 cs0572 when the LHS of a member access has identical name and type
7530 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7533 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7535 Create custom PermissionSet only for PermissionSetAttribute.
7537 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7540 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7541 delegates in static class.
7543 2005-01-24 Martin Baulig <martin@ximian.com>
7545 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7546 merging an implicit block, just use its reachability.
7548 * statement.cs (Block.Resolve): Make the unreachable code check
7549 work wrt. implicit blocks; see test-337 from #63842.
7551 2005-01-21 Alp Toker <alp@atoker.com>
7553 * cs-parser.jay: destructor_declaration's container is PartialContainer
7554 not Class when partial types are used, so use Kind prop instead of
7557 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7559 * cs-parser.jay: Improve error reporting when an interface
7562 2005-01-20 Dick Porter <dick@ximian.com>
7564 * support.cs: SeekableStreamReader fix from Sandor Dobos
7565 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7566 chars are read. Fixes bug 70369.
7568 2005-01-20 Raja R Harinath <rharinath@novell.com>
7570 * cs-parser.jay (catch_clause): Simplify current_block handling
7573 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7575 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7576 code with ImplicitStandardConversion to handle the implicit
7577 conversion of method groups into valid delegate invocations.
7579 The problem is that in parameter handling we were using this code
7580 path. Fixes bug #64698
7582 2005-01-19 Raja R Harinath <rharinath@novell.com>
7584 * cs-parser.jay: Fix several infelicities.
7585 - Avoid assigning to the parser value stack. Code like
7586 '$3 = null' is unclean. Synthesize a value for the code block
7588 - Avoid using oob_stack for storing location information. Use ...
7589 (_mark_): ... this. New (empty) rule. Saves the current location
7591 (foreach_statement): Avoid using oob_stack for current_block
7592 handling. Use technique used in for_statement and
7593 using_statement. Synthesize a value for the code block to store
7594 additional intermediate information.
7596 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7598 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7599 of a different type is only allowed to private fields of a
7600 containing type, not on fields of a base class.
7602 See test-174.cs and error cs0122-9.cs
7604 2005-01-13 Raja R Harinath <rharinath@novell.com>
7606 Fix test-335.cs (bug #58126).
7607 * cs-parser.jay (argument): Split out non-expression parts of the
7608 rule into 'non_simple_argument'.
7609 (invocation_expression): Support parenthesized invocations with
7610 multiple arguments, and with single non-simple arguments.
7612 2005-01-13 Raja R Harinath <rharinath@novell.com>
7614 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7617 2005-01-12 Raja R Harinath <rharinath@novell.com>
7619 Fix cs0038-1.cs, cs1640-6.cs.
7620 * ecore.cs (Expression.Resolve): Remove special-case for
7621 SimpleName in error-handling.
7622 (Expression.almostMatchedMembers): Relax access permission to
7624 (Expression.MemberLookupFailed): Handle duplicates in
7625 almostMatchedMembers list.
7626 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7627 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7628 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7629 overload if the passed in MemberInfo is a MethodBase.
7631 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7634 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7635 for non-CAS & merge permission sets properly.
7637 2005-01-11 Raja R Harinath <rharinath@novell.com>
7639 Improve standard-compliance of simple name and member access
7640 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7641 * ecore.cs (FullNamedExpression): New abstract base class
7642 for Namespaces and TypeExpressions.
7643 (ResolveFlags.SimpleName): Remove.
7644 (SimpleName): Remove support for dotted names.
7645 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7646 DeclSpace.FindType and DeclSpace.LookupType.
7647 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7648 (Expression.ExprClassName): Make member function.
7649 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7650 a namespace. Remove creation of dotted "SimpleName"s.
7651 (MemberAccess.DoResolve): Likewise.
7652 * decl.cs (DeclSpace.Cache): Make private.
7653 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7654 (DeclSpace.FindType): Update.
7655 (DeclSpace.LookupType): Move here from RootContext. Return a
7656 FullNamedExpression.
7657 * namespace.cs (Namespace): Derive from FullNamedExpression
7658 so that it can be part of expression resolution.
7659 (Namespace.Lookup): Return an FullNamedExpression.
7660 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7662 * rootcontext.cs (NamespaceLookup): Remove.
7663 (LookupType): Move to DeclSpace.
7664 * attribute.cs (CheckAttributeType): Update.
7665 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7666 (FindDocumentedTypeNonArray): Likewise.
7668 2005-01-11 Raja R Harinath <rharinath@novell.com>
7670 Fix cs0509.cs, cs1632.cs.
7671 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7672 is the same as IsInterface.
7673 (TypeContainer.GetClassBases): Likewise.
7674 * statement.cs (LabeledStatement.ig): New field.
7675 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7677 (LabeledStatement.DoEmit): Check that the label was created with
7678 the same ILGenerator.
7680 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7683 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7684 accessors to its properties.
7686 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7687 from accessors to property.
7689 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7692 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7695 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7697 * attribute.cs: Check for null and empty strings.
7699 I have lost another battle to Paolo.
7701 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7704 * class.cs (PropertyMethod): Set Parent field in ctors.
7705 (SetMethod.InternalParameters): Add unsafe switch hack.
7706 Override MarkForDuplicationCheck where it is appropriate.
7708 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7709 It says whether container allows members with the same name.
7711 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7712 Removed is_method parameter.
7714 2005-01-06 Duncan Mak <duncan@ximian.com>
7716 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7717 because the previous change led to incorrect reporting of CS1032
7718 ("Cannot define/undefine preprocessor symbols after first token in
7719 file"). Instead of using `tokens_seen' as the only flag that
7720 triggers CS1040, introduce `comments_seen'. This new flag is used
7721 to signify having seen comments on the current line, so it is
7722 unset after a newline.
7724 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7726 * doc.cs : When searching for a type, find nested type too.
7727 This fixes bug #71040.
7729 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7732 - Warn missing member comment on those classes which also does not
7733 have doc comments. Fixed bug #71041.
7734 - Don't warn missing doc comment on default constructor.
7737 2005-01-06 Duncan Mak <duncan@ximian.com>
7739 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7740 comments, set `tokens_seen' to true. This allows us to detect
7741 misplaced preprocessor directives (i.e. not at the beginning of
7742 the a line, nor after whitespaces). In that case, report error
7743 CS1040. This fixes bug #56460.
7745 * cs-parser.jay (interface_member_declaration): Add checks for
7746 IsExplicitImpl, and report CS0541 error if an interface member is
7747 defined as an explicit interface declaration.
7749 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7752 * class.cs (PropertyMethod): Set Parent field in ctors.
7753 (SetMethod.InternalParameters): Add unsafe switch hack.
7755 * decl.cs (MemberCore.Parent): Cannot be readonly.
7757 2005-01-06 Raja R Harinath <rharinath@novell.com>
7759 * decl.cs (DeclSpace.ResolveType): Remove.
7760 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7761 Merge in code from ...
7762 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7763 * class.cs, enum.cs: Update to changes.
7765 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7767 * anonymous.cs: Ensure that we init the scope of our parent if it
7768 has not been initialized yet.
7770 2004-12-30 Duncan Mak <duncan@ximian.com>
7772 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7773 if field.FieldBuilder is null. Fixes #70758.
7775 * convert.cs: Fixed some typos and updated some of the comments.
7776 (ImplicitStandardConversionExists):
7777 (TryImplicitIntConversion): If `target_type' is an interface and
7778 the type of `ic' implements this interface, return true or a new
7779 BoxedCast instead of null. This fixes #70468.
7781 2004-12-29 Duncan Mak <duncan@ximian.com>
7783 * expression.cs (Argument.Emit): Check that Expr is
7784 IMemoryLocation before casting to it, and report CS1510 otherwise.
7788 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7790 * statement.cs (Block.ThisVariable): remove the recursion here, to
7791 make the --profile more sane.
7793 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7795 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7796 assembly, by JB Evain.
7798 2004-12-17 Raja R Harinath <rharinath@novell.com>
7800 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7801 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7802 "parent" refers to enclosing type/class. "base" refers to superclass.
7804 2004-12-17 Raja R Harinath <rharinath@novell.com>
7806 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7807 Ensure that we only have GlobalAttributes.
7808 * attribute.cs (Attribute.Emit): Make non-virtual.
7809 (GlobalAttribute.Emit): Remove.
7810 (Attribute.Resolve): Make virtual.
7811 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7812 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7813 the argument. Don't create one.
7814 (Attribute.GetObsoleteAttribute): Likewise.
7815 (Attribute.GetClsCompliantAttributeValue): Likewise.
7816 * class.cs, decl.cs: Update to changes.
7818 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7820 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7822 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7824 * statement.cs (Foreach.Resolve): Add error 186 report.
7826 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7828 * expression.cs (Conditional.DoResolve): Add warning 429.
7830 * statement.cs (If.Resolve): Add warning 665.
7832 2004-12-16 Raja R Harinath <rharinath@novell.com>
7834 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7835 except when in the parser, and in GlobalAttribute.
7836 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7837 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7838 RootContext.Tree.Types.NamespaceEntry once work is done.
7839 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7840 and resets RootContext.Tree.Types.NamespaceEntry.
7842 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7844 * cs-parser.jay: Don't create a block for every variable.
7846 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7848 * location.cs: Provide extra information.
7850 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7851 variables from the captured environment, it is the ldarg_0.
7853 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7855 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7858 * class.cs: Changed warning level for 169 to avoid developer
7859 displeasure from warning flooding. It will be changed back when they
7860 fix most of current BCL warnings.
7862 * RootContext.cs: Pushed default WarningLevel to 3.
7864 * statement.cs: Removed unused variable.
7866 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7868 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7869 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7870 Add error 502 report.
7871 (StaticClass.DefineType): Add error 441 report.
7872 (Class.AllowedModifiersProp): New virtual property as temporary
7873 extension to AllowedModifiers.
7874 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7875 to share implementation with StaticClass and don't call virtual
7878 * driver.cs (MainDriver): Add error 1558 test.
7880 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7881 report. Moved error 36 test here.
7883 * statement.cs (Throw.Resolve): Add error 724 report.
7885 * typemanager.cs: Add out_attribute_type core type.
7887 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7889 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7891 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7893 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7896 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7898 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7899 Add error 3023 report.
7900 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7902 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7905 2004-12-12 John Luke <john.luke@gmail.com>
7907 * driver.cs (AddArgs): take -- into account when
7908 adding arguments, fixes bug 65710
7910 2004-12-12 Martin Baulig <martin@ximian.com>
7912 * expression.cs (Unary.TryReduceNegative): Added support for
7913 SByteConstant and ByteConstant.
7914 (Unary.Reduce): Check error values from TryReduceNegative().
7916 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7918 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7919 and report exception as error 182.
7921 2004-12-10 Raja R Harinath <rharinath@novell.com>
7923 * driver.cs (Main): Fix message when there are warnings.
7925 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7927 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7929 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7931 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7932 Reduced number of warnings.
7934 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7936 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7938 * driver.cs: Removed message.
7940 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7942 2004-12-08 <vargaz@freemail.hu>
7944 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7946 2004-12-08 Martin Baulig <martin@ximian.com>
7948 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7949 instead of a CS3002 for properties and indexer.
7951 2004-12-08 Martin Baulig <martin@ximian.com>
7953 * decl.cs (MemberName.ToString): Make this work again.
7955 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7957 * attribute.cs (Resolve): Add error 591 detection.
7959 * class.cs (FieldMember.Define): Add error 1547 detection.
7960 (Indexer.Define): Add error 620 detection.
7961 (Operator.Define): Add error 590 detection.
7963 * ecore.cs: Missing argument for error 79.
7965 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7968 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7971 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7974 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7976 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7977 Some operator comments were suppressed.
7978 * doc.cs : Implicit/explicit operator name in doc comments are like
7979 "op_Explicit(type)~returnType", so added suffix handling.
7981 2004-12-07 Martin Baulig <martin@ximian.com>
7984 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7985 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7986 (DeclSpace.ec): New protected field; store the EmitContext here.
7987 (DeclSpace.EmitContext): New public property; moved here from
7989 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7992 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7993 (Enum.Emit): Don't create a new EmitContext.
7995 * delegate.cs (Delegate.DefineType): Always create the
7998 * iterators.cs (Iterators.DefineIterator): Create a new
7999 EmitContext and store it in `ec'.
8001 2004-08-24 Martin Baulig <martin@ximian.com>
8004 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8005 this for accessibility checks.
8006 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8007 IsNestedFamilyAccessible.
8008 (TypeManager.IsSubclassOf): New method, do what the name actually
8011 2004-12-06 Raja R Harinath <rharinath@novell.com>
8013 Fix crash on cs0657-17.cs.
8014 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8015 Use RootContext.Tree.Types, not 'new RootTypes ()'.
8016 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8017 the case where the NamespaceEntry gets overwritten.
8019 2004-12-06 Marek Safar <marek.safar@seznam.cz>
8021 Fixed #69195, #56821
8022 * ecore.cs (ResolveBoolean): Tiny refactoring.
8024 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8025 of right expression resolving when left is false constant and
8026 operator is LogicalAnd OR true constant and operator is LogicalOr.
8028 * statement.cs (ResolveUnreachable): Always reports warning.
8030 2004-12-05 Miguel de Icaza <miguel@ximian.com>
8032 * class.cs: Distinguish between 1721 and 1722 (just a little help
8033 for the programmer).
8035 2004-12-03 Miguel de Icaza <miguel@ximian.com>
8037 * delegate.cs: Only allow this on new versions of the language.
8039 2004-12-02 Duncan Mak <duncan@ximian.com>
8041 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8043 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8044 here as a static method. Take an additional bool out parameter
8045 `must_do_cs1540_check' for signaling to InstanceResolve.
8046 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8047 member field from PropertyExpr class and made it an argument of
8049 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8050 check for MarshalByRefObject, and report CS0122 instead of CS1540.
8051 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8052 and `remove_accessor' as well as InstanceResolve: report CS0122
8057 2004-12-03 Raja R Harinath <rharinath@novell.com>
8059 Fix test-327.cs, test-328.cs, and put in early infrastructure
8060 for eventually fixing #52697.
8061 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8062 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8064 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8065 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8066 (VerifyUsing, error246): Update.
8067 * rootcontext.cs (RootContext.NamespaceLookup): Just use
8068 'NamespaceEntry.LookupNamespaceOrType'.
8070 2004-12-03 Martin Baulig <martin@ximian.com>
8072 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8073 method as our child, call AnonymousMethod.Compatible() on it.
8075 2004-12-03 Raja R Harinath <rharinath@novell.com>
8077 Disable XML documentation support in 'basic' profile.
8078 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8079 Redirect XmlElement to System.Object.
8080 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8081 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8082 * mcs.exe.sources: Add doc-bootstrap.cs.
8083 * doc-bootstrap.cs: New file. Contains empty stub implementation
8086 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
8088 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8089 comments are allowed.
8091 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8093 * delegate.cs: Add checks for subtypes in paramaters and return values
8094 in VerifyMethod () to add support for Covariance/Contravariance
8097 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8099 * report.cs: Remove extra closing parenthesis.
8101 * convert.cs (Error_CannotImplicitConversion): If the name of the
8102 types are the same, provide some extra information.
8104 * class.cs (FieldBase): Use an unused bit field from the field to
8105 encode the `has_offset' property from the FieldMember. This saves
8106 a couple of Ks on bootstrap compilation.
8108 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8109 method as our child, return the AnonymousMethod resolved
8112 * expression.cs (New.DoResolve): Allow return values from
8113 NewDelegate to also include AnonymousMethods.
8117 2004-12-02 Marek Safar <marek.safar@seznam.cz>
8120 * attribute.cs (Resolve): Improved implementation of params
8121 attribute arguments.
8123 * support.cs (ParameterData): Add HasParams to be faster.
8125 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
8127 all things are for /doc support:
8129 * doc.cs: new file that supports XML documentation generation.
8130 * mcs.exe.sources: added doc.cs.
8132 Handle /doc command line option.
8133 Report error 2006 instead of 5 for missing file name for /doc.
8134 Generate XML documentation when required, after type resolution.
8136 Added support for picking up documentation (/// and /** ... */),
8137 including a new XmlCommentState enumeration.
8139 Added lines to fill Documentation element for field, constant,
8140 property, indexer, method, constructor, destructor, operator, event
8141 and class, struct, interface, delegate, enum.
8142 Added lines to warn incorrect comment.
8144 Added Documentation field (passed only when /doc was specified).
8146 Added DocComment, DocCommentHeader, GenerateDocComment() and
8147 OnGenerateDocComment() and some supporting private members for
8148 /doc feature to MemberCore.
8150 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8152 Added overriden DocCommentHeader.
8154 Added overriden DocCommentHeader and GenerateDocComment().
8156 2004-12-01 Miguel de Icaza <miguel@ximian.com>
8158 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8159 unwrapping the enumeration values, chain to
8160 DoConstantNumericPromotions again, so we can promote things to the
8161 fundamental types (takes care of enums that are bytes, sbytes).
8165 2004-12-01 Raja R Harinath <rharinath@novell.com>
8167 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8168 Fix long-standing bug in type-lookup. Use FindType instead of
8169 LookupType when ec.ResolvingTypeTree.
8170 (Attribute.ResolveType, Attribute.Resolve)
8171 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8173 (Attributes.Search): Remove internal version. Update.
8174 (Attributes.SearchMulti): Update.
8175 (Attributes.GetClsCompliantAttribute): Remove.
8176 (Attributes.GetIndexerNameAttribute): Remove.
8177 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8178 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8179 * class.cs (Indexer.Define): Likewise.
8181 2004-12-01 Marek Safar <marek.safar@seznam.cz>
8184 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8185 MarshallByReference members access.
8187 * expression.cs: Use CheckMarshallByRefAccess;
8188 Better error CS0197 message.
8190 * report.cs: Print whole related error message.
8192 2004-11-30 Raja R Harinath <rharinath@novell.com>
8194 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8195 the current directory to help debugging.
8197 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8199 * class (GetClassBases): Better error 60 report.
8200 (EventProperty): Disabled warning 67 detection.
8202 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8205 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8207 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8210 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8213 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8215 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8217 2004-11-26 Miguel de Icaza <miguel@ximian.com>
8219 * attribute.cs (Attribute.Resolve): Refine error reporting and
8220 report a cs0117 if the identifier does not exist, to distinguish
8221 from 0617 which is a miss-use of the actual identifier.
8223 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8224 between cs0070 and cs0079.
8226 * class.cs (MemberBase.DoDefine): When reporting a wrong
8227 accessibility level, we use MethodCore to compare instead of
8228 Method (this was a regression in some refactoring effort).
8230 So now we correctly report cs0056 again.
8232 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8233 testing the target_type (which was known to be object_type) and
8234 not the source type (which is anonymous_method).
8236 Fixed reporting of error cs1660.
8238 * expression.cs (UserCast.Source): Expose the underlying cast.
8240 * statement.cs (Switch.SwitchGoverningType): Sort the list of
8241 allowed types to find a match to int32 first (most common).
8243 In addition, it ignores any ImplicitUserConversions that did an
8244 internal implicit conversion (as the switch statement allows only
8245 one integral conversion to exist).
8247 * class.cs (PartialContainer.Create): rename `name' to
8248 `member_name' for clarity. Then replace the string calls with a
8249 call to MemberName.GetPartialName, as now using
8250 MemberName.ToString is an error (this is due to the side effects
8251 it had, that were fixed in the past).
8253 This will restore the error reporting on a number of partial class
8254 errors that were missusing this (and getting an exception as a
8255 results, which is now just a plain textual warning, because
8256 yyparse debug output would crash otherwise).
8258 2004-11-26 Raja R Harinath <rharinath@novell.com>
8260 * Makefile (PROGRAM_INSTALL_DIR): Remove.
8262 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8264 * rootcontext.cs (LookupType): Make sure to cache lookups that
8265 don't give us a negative result. This saves about 5% of corlib
8268 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8270 * report.cs (AbstractMessage.Print): messages are sent to stderr
8272 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8273 non-interface in the list of interfaces (at this point, either
8274 parent was properly set, or a base class is being listed in the
8275 interfaces section).
8277 This flags error 1722, and resolves the crash from bug 69259.
8279 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8281 * statement.cs (Using.EmitExpressionFinally): make this work right
8282 for valuetypes. Fixes 69926.
8284 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8286 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8287 converted to an enum" here, before we try to change the underlying
8288 type. This code exists, but it is a different code path than the
8289 one used while encoding constants.
8291 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8292 old bug: when converting from the null literal to a pointer,
8293 return an EmptyCast, not the NullLiteral.
8295 This fixes #69921, the recent null_type changes probably made this
8298 (ImplicitReferenceConversionExists): In addition, resynchronized
8299 the code here, so it matches the same code in
8300 ImplicitReferenceConversionExists for the `from any class-type S
8301 to any interface-type T'.
8304 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8306 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8308 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8310 * cs-parser.jay: Use verbosity accordingly.
8312 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8314 * expression.cs (Unary.ResolveOperator): Do not report warning;
8315 AddressOf reads from variable.
8317 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8319 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8323 * attribute.cs (Attributable): Removed CheckTargets.
8324 (Attributes.Emit): Explicit attribute targets are tested here.
8326 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8327 not enabled for interfaces.
8329 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8330 (GetAssemblyName): Ouch next bug there.
8332 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8334 * expression.cs: Error 275 added.
8336 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8338 Fix bug #69177 (Implemented decimal constant support)
8340 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8341 (BinaryFold): Add DecimalConstant.
8343 * const.cs (Define): Decimal constant
8345 (ChangeType): Add decimal type handling.
8346 (LookupConstantValue): Don't set value for decimal type but
8347 emit DecimalConstantAttribute. Needed for constant optimization.
8349 * constant.cs (ToDecimal): New method.
8350 (ConvertToDecimal): New method.
8351 (IntConstant): Implemented ConvertToDecimal.
8352 (DecimalConstant.Emit): Emit optimized version for decimals in
8355 * expression.cs (ResolveOperator): Changed order of constant
8356 reduction to work correctly with native types which have
8357 overloaded operators.
8358 (ResolveMemberAccess): Extract constant value from attribute
8361 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8363 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8364 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8365 (ChangeType): Decimal is special.
8366 (TypeToCoreType): Add decimal type.
8368 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8370 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8373 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8375 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8378 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8380 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8382 * pending.cs (PendingImplementation): Grab only interfaces.
8384 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8386 * statement.cs (ForeachHelperMethods): Add location member and
8387 error 202 detection.
8389 2004-11-19 Raja R Harinath <rharinath@novell.com>
8391 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
8392 automatically handled by executable.make.
8393 (PROGRAM): Make profile-specific.
8395 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8397 * expression.cs (DoResolveBase): Fixed wrong warning for out
8400 2004-11-18 Martin Baulig <martin@ximian.com>
8402 Merged latest changes into gmcs. Please keep this comment in
8403 here, it makes it easier for me to see what changed in MCS since
8404 the last time I merged.
8406 2004-11-17 Raja R Harinath <rharinath@novell.com>
8408 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8409 (TypeHandle.GetMemberCache): New.
8410 (TypeHandle.TypeHandle): Update.
8411 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8412 (TypeManager.LookupParentInterfacesCache):
8413 Rename from LookupInterfaceCache. Optimize slightly.
8414 (TypeManager.MemberLookup_FindMembers): Update.
8415 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8417 (AddCacheContents): Rename from AddHashtable.
8418 * class.cs (TypeContainer.parent_container): Remove.
8419 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8420 (TypeContainer.DoDefineMembers): Don't initialize it.
8421 Update to name changes.
8423 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8425 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8426 that factors the code to check access modifiers on override.
8428 (PropertyBase): Use the code here.
8430 Patch from Lluis S'anchez, fixes bug #69361.
8432 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8434 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8435 routine that is used to report the use of a captured variable
8436 whose address has been taken.
8438 There are two checks: one when variables are being captured and
8439 the other check is when the address of a variable is taken.
8441 (because an anonymous methods might be resolved before *or* after
8442 the address has been taken) and
8444 * expression.cs (Conditional.DoResolve): Remove the special
8445 casing that Martin added to trueExpr and falseExpr being both
8446 NullLiteral. We get the right behavior now just by introducing
8447 the null_type into the compiler.
8449 * convert.cs (ExplicitConversion): Change the code to use
8450 null_type instead of testing `expr is NullLiteral'.
8451 (ImplicitConversionStandard): use null_type too.
8452 (ImplicitReferenceConversionExists): use null_type too.
8453 (ImplicitReferenceConversion): use null_type too.
8455 * literal.cs: The type of `NullLiteral' is now null_type instead
8457 (Resolve): Set the type here.
8459 * typemanager.cs: Introduce null_type.
8461 2004-11-17 Martin Baulig <martin@ximian.com>
8463 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8464 direction, like FindMembers() does. Fixes #69546, testcase is in
8467 2004-11-16 Martin Baulig <martin@ximian.com>
8469 This is based on a patch from Marek Safar, see bug #69082.
8470 Fixes bugs #63705 and #67130.
8472 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8473 method; create a MemberCache for an interface type and cache the
8476 * decl.cs (IMemberContainer.ParentContainer): Removed.
8477 (IMemberContainer.ParentCache): New property.
8478 (MemberCache.SetupCacheForInterface): Removed.
8479 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8480 to create a cache for an interface's "parent".
8482 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8485 2004-11-16 Martin Baulig <martin@ximian.com>
8487 Merged back from gmcs; these changes already went into gmcs a
8488 couple of weeks ago.
8491 (TypeManager.AddUserType): Removed the `ifaces' argument.
8492 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8494 (TypeManager.AddUserInterface): Removed.
8495 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8497 (TypeManager.GetInterfaces): Likewise.
8498 (TypeManager.GetExplicitInterfaces): Likewise.
8500 * ecore.cs (TypeExpr.GetInterfaces): Removed.
8502 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8503 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8505 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8507 * statement.cs: Avoid adding bools to a hashtable.
8509 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8511 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8512 calling an unsafe method from a safe location.
8514 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8517 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8519 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8521 * namespace.cs (VerifyUsing): use GetPartialName instead of
8524 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8526 * statement.cs (Return.Resolve): Fix regression in typo: if
8527 `in_exc', we have to request a NeedReturnLabel, this was a typo
8528 introduced in the anonymous method check-in. Fixes #69131.
8530 * Indexers were using the ShortName when defining themselves,
8531 causing a regression in the compiler bootstrap when applying the
8532 patch from 2004-11-02 (first part), now they use their full name
8533 and the bug is gone.
8535 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8537 * driver.cs: Strip the path from the names of embedded resources. Fixes
8540 2004-11-04 Raja R Harinath <rharinath@novell.com>
8542 Fix error message regression: cs0104-2.cs.
8543 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8544 (AliasEntry.Resolve): Update.
8545 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8547 (RootContext.LookupType): Update.
8549 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8551 * cs-parser.jay: Add support for handling accessor modifiers
8552 * class: Add support port accessor modifiers and error checking,
8553 define PropertyMethod.Define as virtual (not abstract anymore)
8554 * ecore.cs: Add checking for proeprties access with access modifiers
8555 * iterators.cs: Modify Accessor constructor call based in the modified
8557 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8559 * expression.cs (StringConcat): Handle being called twice,
8560 as when we have a concat in a field init with more than two
8563 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8565 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8566 special case explicit implementations, we should always produce
8567 the .property or .event declaration.
8569 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8570 since it will not return correct data if people use this
8571 unresolved in the presence of using statements (see test-313).
8573 * class.cs (MethodData.Define): If we are an explicit interface
8574 implementation, set the method name to the full name of the
8575 interface plus the name of the method.
8577 Notice that using the method.MethodName.GetFullName() does not
8578 work, as it will only contain the name as declared on the source
8579 file (it can be a shorthand in the presence of using statements)
8580 and not the fully qualifed type name, for example:
8584 class D : ICloneable {
8585 object ICloneable.Clone () {
8589 Would produce a method called `ICloneable.Clone' instead of
8590 `System.ICloneable.Clone'.
8592 * namespace.cs (Alias.Resolve): Use GetPartialName.
8594 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8596 * cs-parser.jay: Add error 1055 report.
8598 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8600 * assign.cs (Assign.DoResolve): Only do the transform of
8601 assignment into a New if the types are compatible, if not, fall
8602 through and let the implicit code deal with the errors and with
8603 the necessary conversions.
8605 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8607 * cs-parser.jay: Add error 1031 report.
8609 * cs-tokenizer.cs: Add location for error 1038.
8611 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8613 * cs-parser.jay: Add error 1016 report.
8615 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8617 * cs-parser.jay: Add errors 1575,1611 report.
8619 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8621 * cs-parser.jay: Add error 1001 report.
8623 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8626 * attribute.cs (GetMarshal): Add method argument for
8627 caller identification.
8629 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8630 agument for GetMarshal and RuntimeMissingSupport.
8632 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8634 * attribute.cs (ExtractSecurityPermissionSet): Removed
8635 TypeManager.code_access_permission_type.
8637 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8639 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8641 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8642 for obsolete use of a variable here. Fixes regression on errors
8643 cs0619-25 and cs0619-26.
8645 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8647 Fix #62358, implemented security attribute encoding.
8649 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8650 Tests permitted SecurityAction for assembly or other types.
8651 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8652 data from SecurityPermissionAttribute to PermisionSet class.
8654 * class.cs (ApplyAttributeBuilder): Added special handling
8655 for System.Security.Permissions.SecurityAttribute based types.
8657 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8658 special handling for System.Security.Permissions.SecurityAttribute
8661 * enum.cs (ApplyAttributeBuilder): Added special handling
8662 for System.Security.Permissions.SecurityAttribute based types.
8664 * parameter.cs (ApplyAttributeBuilder): Added special handling
8665 for System.Security.Permissions.SecurityAttribute based types.
8667 * rootcontext.cs: Next 2 core types.
8669 * typemanager.cs (TypeManager.security_permission_attr_type):
8670 Built in type for the SecurityPermission Attribute.
8671 (code_access_permission_type): Build in type.
8673 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8675 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8676 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8677 all of this information into
8678 EmitContext.EmitCapturedVariableInstance.
8680 * codegen.cs (EmitCapturedVariableInstance): move here the
8681 funcionality of emitting an ldarg.0 in the presence of a
8682 remapping. This centralizes the instance emit code.
8684 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8685 then emit a load of this: it means that we have reached the
8686 topmost ScopeInfo: the one that contains the pointer to the
8687 instance of the class hosting the anonymous method.
8689 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8690 captures to the topmost CaptureContext.
8692 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8694 * expression.cs (LocalVariableReference): Move the knowledge about
8695 the iterators into codegen's EmitCapturedVariableInstance.
8697 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8699 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8700 all code paths return a value from an anonymous method (it is the
8701 same as the 161 error, but for anonymous methods).
8703 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8705 The introduction of anonymous methods in the compiler changed
8706 various ways of doing things in the compiler. The most
8707 significant one is the hard split between the resolution phase
8708 and the emission phases of the compiler.
8710 For instance, routines that referenced local variables no
8711 longer can safely create temporary variables during the
8712 resolution phase: they must do so from the emission phase,
8713 since the variable might have been "captured", hence access to
8714 it can not be done with the local-variable operations from the runtime.
8718 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8719 is a toplevel block.
8721 (ToplevelBlock): A new kind of Block, these are the blocks that
8722 are created by the parser for all toplevel method bodies. These
8723 include methods, accessors and anonymous methods.
8725 These contain some extra information not found in regular blocks:
8726 A pointer to an optional CaptureContext (for tracking captured
8727 local variables and parameters). A pointer to the parent
8730 (Return.Resolve): Catch missmatches when returning a value from an
8731 anonymous method (error 1662).
8732 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8735 (Break.Resolve): ditto.
8737 (SwitchLabel): instead of defining the labels during the
8738 resolution phase, we now turned the public ILLabel and ILLabelCode
8739 labels into methods called GetILLabelCode() and GetILLabel() that
8740 only define the label during the Emit phase.
8742 (GotoCase): Track the SwitchLabel instead of the computed label
8743 (its contained therein). Emit the code by using
8744 SwitchLabel.GetILLabelCode ().
8746 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8747 whether the Local has been captured or not.
8749 (LocalInfo.IsCaptured): New property, used to tell whether the
8750 local has been captured.
8752 * anonymous.cs: Vastly updated to contain the anonymous method
8755 The main classes here are: CaptureContext which tracks any
8756 captured information for a toplevel block and ScopeInfo used to
8757 track the activation frames for various local variables.
8759 Each toplevel block has an optional capture context associated
8760 with it. When a method contains an anonymous method both the
8761 toplevel method and the anonymous method will create a capture
8762 context. When variables or parameters are captured, they are
8763 recorded on the CaptureContext that owns them, for example:
8767 MyDelegate d = delegate {
8772 Here `a' will be recorded as captured on the toplevel
8773 CapturedContext, the inner captured context will not have anything
8774 (it will only have data if local variables or parameters from it
8775 are captured in a nested anonymous method.
8777 The ScopeInfo is used to track the activation frames for local
8778 variables, for example:
8780 for (int i = 0; i < 10; i++)
8781 for (int j = 0; j < 10; j++){
8782 MyDelegate d = delegate {
8787 At runtime this captures a single captured variable `i', but it
8788 captures 10 different versions of the variable `j'. The variable
8789 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8790 recorded on a child.
8792 The toplevel ScopeInfo will also track information like the `this'
8793 pointer if instance variables were referenced (this is necessary
8794 as the anonymous method lives inside a nested class in the host
8795 type of the method).
8797 (AnonymousMethod): Expanded to track the Toplevel, implement
8798 `AnonymousMethod.Compatible' to tell whether an anonymous method
8799 can be converted to a target delegate type.
8801 The routine now also produces the anonymous method content
8803 (AnonymousDelegate): A helper class that derives from
8804 DelegateCreation, this is used to generate the code necessary to
8805 produce the delegate for the anonymous method that was created.
8807 * assign.cs: API adjustments for new changes in
8808 Convert.ImplicitStandardConversionExists.
8810 * class.cs: Adjustments to cope with the fact that now toplevel
8811 blocks are of type `ToplevelBlock'.
8813 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8814 insteda of standard blocks.
8816 Flag errors if params arguments are passed to anonymous methods.
8818 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8819 `CurrentAnonymousMethod' which points to the current Anonymous
8820 Method. The variable points to the AnonymousMethod class that
8821 holds the code being compiled. It is set in the new EmitContext
8822 created for the anonymous method.
8824 (EmitContext.Phase): Introduce a variable and an enumeration to
8825 assist in enforcing some rules about when and where we are allowed
8826 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8827 only one that enfonces this right now).
8829 (EmitContext.HaveCaptureInfo): new helper method that returns
8830 whether we have a CapturedContext initialized.
8832 (EmitContext.CaptureVariable): New method used to register that a
8833 LocalInfo must be flagged for capturing.
8835 (EmitContext.CapturedParameter): New method used to register that a
8836 parameters must be flagged for capturing.
8838 (EmitContext.CapturedField): New method used to register that a
8839 field must be flagged for capturing.
8841 (EmitContext.HaveCapturedVariables,
8842 EmitContext.HaveCapturedFields): Return whether there are captured
8843 variables or fields.
8845 (EmitContext.EmitMethodHostInstance): This is used to emit the
8846 instance for the anonymous method. The instance might be null
8847 (static methods), this (for anonymous methods that capture nothing
8848 and happen to live side-by-side with the current method body) or a
8849 more complicated expression if the method has a CaptureContext.
8851 (EmitContext.EmitTopBlock): Routine that drives the emission of
8852 code: it will first resolve the top block, then emit any metadata
8853 and then emit the code. The split is done so that we can extract
8854 any anonymous methods and flag any captured variables/parameters.
8856 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8857 during this phase, the ILGenerator should not be used as labels
8858 and local variables declared here might not be accessible to any
8859 code that is part of an anonymous method.
8861 Exceptions to this include the temporary variables that are
8862 created by some statements internally for holding temporary
8865 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8868 (EmitContext.TemporaryReturn): This method is typically called
8869 from the Emit phase, and its the only place where we allow the
8870 ReturnLabel to be defined other than the EmitMeta. The reason is
8871 that otherwise we would have to duplicate a lot of logic in the
8872 Resolve phases of various methods that today is on the Emit
8875 (EmitContext.NeedReturnLabel): This no longer creates the label,
8876 as the ILGenerator is not valid during the resolve phase.
8878 (EmitContext.EmitThis): Extended the knowledge in this class to
8879 work in anonymous methods in addition to iterators.
8881 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8882 code is necessary on the stack to access the instance to a local
8883 variable (the variable will be accessed as a field).
8885 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8886 EmitContext.EmitAddressOfParameter): Routines to support
8887 parameters (not completed at this point).
8889 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8890 will also remove the parameters.
8892 * convert.cs (Convert): Define a `ConstantEC' which points to a
8893 null. This is just to prefity some code that uses
8894 ImplicitStandardConversion code and do not have an EmitContext
8897 The idea is to flag explicitly that at that point in time, it is
8898 known that the conversion will not trigger the delegate checking
8899 code in implicit conversions (which requires a valid
8902 Everywhere: pass new EmitContext parameter since
8903 ImplicitStandardConversionExists now requires it to check for
8904 anonymous method conversions.
8906 (Convert.ImplicitStandardConversionExists): If the type of an
8907 expression is the anonymous_method_type, and the type is a
8908 delegate, we invoke the AnonymousMethod.Compatible method to check
8909 whether an implicit conversion is possible.
8911 (Convert.ImplicitConversionStandard): Only do implicit method
8912 group conversions if the language level is not ISO_1.
8914 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8915 MethodInfo for the Invoke method. used by Delegate and
8918 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8919 method conversions if the target type is a delegate.
8921 Removed extra debugging nops.
8923 (LocalVariableReference): Turn the `local_info' into a public
8926 Add `prepared' field, the same hack used for FieldExprs to cope
8927 with composed assignments, as Local variables do not necessarily
8928 operate purely on the stack as they used to: they can be captured
8931 Add `temp' for a temporary result, like fields.
8933 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8935 It now copes with Local variables that are captured and emits the
8936 proper instance variable to load it from a field in the captured
8939 (ParameterReference.DoResolveBase): During the resolve phase,
8940 capture parameters if we are in an anonymous method.
8942 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8943 anonymous method, use the EmitContext helper routines to emit the
8944 parameter reference.
8946 * iterators.cs: Set RemapToProxy to true/false during the
8949 * parameters.cs (GetParameterByName): New helper method.
8951 * typemanager.cs (anonymous_method_type) a new type that
8952 represents an anonyous method. This is always an internal type,
8953 used as a fencepost to test against the anonymous-methodness of an
8956 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8958 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8960 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8962 2004-10-18 Martin Baulig <martin@ximian.com>
8964 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8965 `Type' directly, but call ResolveType() on it.
8966 (Catch.Resolve): Likewise.
8967 (Foreach.Resolve): Likewise.
8969 2004-10-18 Martin Baulig <martin@ximian.com>
8971 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8972 `Type' directly, but call ResolveType() on it.
8973 (Probe.DoResolve): Likewise.
8974 (ArrayCreation.LookupType): Likewise.
8975 (TypeOf.DoResolve): Likewise.
8976 (SizeOf.DoResolve): Likewise.
8978 2004-10-18 Martin Baulig <martin@ximian.com>
8980 * expression.cs (Invocation.BetterFunction): Put back
8981 TypeManager.TypeToCoreType().
8983 2004-10-18 Raja R Harinath <rharinath@novell.com>
8985 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8988 2004-10-18 Martin Baulig <martin@ximian.com>
8990 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
8991 `Type' directly, but call ResolveType() on it.
8993 2004-10-18 Martin Baulig <martin@ximian.com>
8995 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8996 `Type' directly, but call ResolveType() on it.
8997 (MemberBase.DoDefine): Likewise.
8999 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9000 `Type' directly, but call ResolveType() on it.
9001 (ComposedCast.DoResolveAsTypeStep): Likewise.
9003 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9004 `Type' directly, but call ResolveType() on it.
9006 2004-10-17 John Luke <john.luke@gmail.com>
9008 * class.cs (Operator.GetSignatureForError): use CSharpName
9010 * parameter.cs (Parameter.GetSignatureForError): Returns
9011 correct name even if was not defined.
9013 2004-10-13 Raja R Harinath <rharinath@novell.com>
9016 * class.cs (TypeContainer.EmitContext): New property.
9017 (DefineNestedTypes): Create an emitcontext for each part.
9018 (MethodCore.DoDefineParameters): Use container's emitcontext.
9019 Pass type array to InternalParameters.
9020 (MemberBase.DoDefine): Use container's emitcontext.
9021 (FieldMember.Define): Likewise.
9022 (Event.Define): Likewise.
9023 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9024 Pass type array to InternalParameters.
9025 (SetIndexerMethod.GetParameterInfo): Likewise.
9026 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9027 * delegate.cs (Define): Pass emitcontext to
9028 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9029 array to InternalParameters.
9030 * expression.cs (ParameterReference.DoResolveBase): Pass
9031 emitcontext to GetParameterInfo.
9032 (ComposedCast.DoResolveAsTypeStep): Remove check on
9033 ec.ResolvingTypeTree.
9034 * parameter.cs (Parameter.Resolve): Change argument to
9035 EmitContext. Use ResolveAsTypeTerminal.
9036 (Parameter.GetSignature): Change argument to EmitContext.
9037 (Parameters.ComputeSignature): Likewise.
9038 (Parameters.ComputeParameterTypes): Likewise.
9039 (Parameters.GetParameterInfo): Likewise.
9040 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9041 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9042 * support.cs (InternalParameters..ctor): Remove variant that takes
9044 * typemanager.cs (system_intptr_expr): New.
9045 (InitExpressionTypes): Initialize it.
9047 2004-10-12 Chris Toshok <toshok@ximian.com>
9049 * cs-parser.jay: fix location for try_statement and catch_clause.
9051 2004-10-11 Martin Baulig <martin@ximian.com>
9053 * report.cs: Don't make --fatal abort on warnings, we have
9054 -warnaserror for that.
9056 2004-10-07 Raja R Harinath <rharinath@novell.com>
9058 More DeclSpace.ResolveType avoidance.
9059 * decl.cs (MemberCore.InUnsafe): New property.
9060 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9061 with newly created EmitContext.
9062 (FieldMember.Define): Likewise.
9063 * delegate.cs (Delegate.Define): Likewise.
9064 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9065 only if normal name-lookup fails.
9066 (TypeExpr.DoResolve): Enable error-checking.
9067 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9068 (SizeOf.DoResolve): Likewise.
9069 (ComposedCast.DoResolveAsTypeStep): Likewise.
9070 (StackAlloc.DoResolve): Likewise.
9071 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9072 (Block.Unsafe): New property.
9073 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9074 (Unsafe): Set 'unsafe' flag of contained block.
9075 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9076 (Fixed.Resolve): Likewise.
9077 (Catch.Resolve): Likewise.
9078 (Using.ResolveLocalVariableDecls): Likewise.
9079 (Foreach.Resolve): Likewise.
9081 2004-10-05 John Luke <john.luke@gmail.com>
9083 * cs-parser.jay: add location to error CS0175
9085 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9087 * ecore.cs (Expression.Constantity): Add support for turning null
9090 * const.cs (Const.Define): Allow constants to be reference types
9091 as long as the value is Null.
9093 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9095 * namespace.cs (NamespaceEntry.Using): No matter which warning
9096 level is set, check if this namespace name has already been added.
9098 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9100 * expression.cs: reftype [!=]= null should always use br[true,false].
9103 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9106 * attribute.cs: Enum conversion moved to
9107 GetAttributeArgumentExpression to be applied to the all
9110 2004-10-01 Raja R Harinath <rharinath@novell.com>
9112 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9113 * class.c (TypeContainer.DefineType): Flag error if
9114 base types aren't accessible due to access permissions.
9115 * decl.cs (DeclSpace.ResolveType): Move logic to
9116 Expression.ResolveAsTypeTerminal.
9117 (DeclSpace.ResolveTypeExpr): Thin layer over
9118 Expression.ResolveAsTypeTerminal.
9119 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9120 Refactor code into NestedAccess. Use it.
9121 (DeclSpace.NestedAccess): New.
9122 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9123 argument to silence errors. Check access permissions.
9124 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9125 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9126 (Cast.DoResolve): Likewise.
9127 (New.DoResolve): Likewise.
9128 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9129 (TypeOf.DoResolve): Likewise.
9131 * expression.cs (Invocation.BetterConversion): Return the Type of
9132 the better conversion. Implement section 14.4.2.3 more faithfully.
9133 (Invocation.BetterFunction): Make boolean. Make correspondence to
9134 section 14.4.2.2 explicit.
9135 (Invocation.OverloadResolve): Update.
9136 (Invocation): Remove is_base field.
9137 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9138 (Invocation.Emit): Likewise.
9140 2004-09-27 Raja R Harinath <rharinath@novell.com>
9142 * README: Update to changes.
9144 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9146 * cs-parser.jay: Reverted 642 warning fix.
9148 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9151 * decl.cs (FindMemberWithSameName): Indexer can have more than
9154 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9156 * expression.cs (LocalVariableReference.DoResolveLValue):
9157 Do not report warning 219 for out values.
9158 (EmptyExpression.Null): New member to avoid extra allocations.
9160 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9162 * cs-parser.jay: Fix wrong warning 642 report.
9164 * cs-tokenizer.cs (CheckNextToken): New helper;
9165 Inspect next character if is same as expected.
9167 2004-09-23 Martin Baulig <martin@ximian.com>
9169 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9170 (Convert.ImplicitReferenceConversionExists): Likewise.
9172 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9174 * class.cs (Operator.Define): Add error 448 and 559 report.
9176 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9178 * class.cs (MemberBase.IsTypePermitted): New protected
9179 method for checking error CS0610.
9181 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9183 * class.cs (TypeContainer.HasExplicitLayout): New property
9184 Returns whether container has StructLayout attribute set Explicit.
9185 (FieldMember): New abstract class for consts and fields.
9186 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9187 (Field): Reuse FieldMember.
9189 * const.cs (Const): Reuse FieldMember.
9191 * rootcontext.cs: EmitConstants call moved to class.
9193 2004-09-22 Martin Baulig <martin@ximian.com>
9195 Thanks to Peter Sestoft for this bug report.
9197 * expression.cs (Conditional): If both the `trueExpr' and the
9198 `falseExpr' is a NullLiteral, return a NullLiteral.
9200 2004-09-22 Martin Baulig <martin@ximian.com>
9202 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9203 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9204 for the "get_Current" call.
9206 2004-09-22 Martin Baulig <martin@ximian.com>
9208 Marek and me just fixed one of our oldest bugs: #28562 :-)
9210 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9212 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9213 we're an EnumConstant, just return that.
9214 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9215 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9216 to get the value which'll actually be written into the attribute.
9217 However, we have to use GetValue() to access the attribute's value
9220 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9222 * constant.cs (Constant.IsNegative): New abstract property
9225 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9226 (StackAlloc.DoResolve): Reused IsNegative.
9228 2004-09-21 Martin Baulig <martin@ximian.com>
9230 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9231 if we're used in an iterator, we may be called from different
9234 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9235 we actually have an exception block.
9237 2004-09-20 John Luke <jluke@cfl.rr.com>
9239 * class.cs, cs-parser.jay: Improve the error report for 1520:
9240 report the actual line where the error happens, not where the
9243 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9244 Pass location information that was available elsewhere.
9246 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
9248 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9249 runtime to delay sign assemblies.
9251 2004-09-19 Miguel de Icaza <miguel@ximian.com>
9253 * cs-parser.jay: Do not report the stack trace, this is barely
9256 2004-08-22 John Luke <john.luke@gmail.com>
9258 * driver.cs : check that a resource id is not already used
9259 before adding it, report CS1508 if it is, bug #63637
9261 2004-09-19 Miguel de Icaza <miguel@ximian.com>
9263 * ecore.cs: Removed dead code.
9265 2004-09-18 Marek Safar <marek.safar@seznam.cz>
9267 * class.cs: Do not report warning CS0067 on the interfaces.
9269 2004-09-16 Marek Safar <marek.safar@seznam.cz>
9271 * cs-parser.jay: Add error 504 report.
9273 2004-09-16 Marek Safar <marek.safar@seznam.cz>
9275 * rootcontext.cs: WarningLevel is 4 by default now.
9277 * statement.cs (Fixed.Resolve): Do not null
9280 2004-09-16 Marek Safar <marek.safar@seznam.cz>
9283 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9284 deep search when property is not virtual.
9285 (PropertyExpr.ResolveAccessors): Make one call for both
9288 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9291 * statement.cs: Error 152 report constains also location.
9293 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9296 * const.cs: Explicitly set constant as static.
9298 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9301 * cs-parser.jay: Add error 1017 report.
9303 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9305 Fixed bug #59980, #64224
9306 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9308 * typemanager.cs (IsSpecialMethod): Simplified
9310 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9312 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9313 condition with better params.
9315 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9318 * attribute.cs (Resolve): Property has to have both
9321 2004-09-14 Martin Baulig <martin@ximian.com>
9323 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9325 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9328 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9329 called and is obsolete then this member suppress message
9330 when call is inside next [Obsolete] method or type.
9332 * expression.cs: Use TestObsoleteMethodUsage member.
9334 2004-09-14 Martin Baulig <martin@ximian.com>
9336 * cs-parser.jay: Sync a bit with the GMCS version.
9338 2004-09-14 Martin Baulig <martin@ximian.com>
9340 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9341 (CSharpParser.yacc_verbose_flag): New public field.
9343 * genericparser.cs: Removed.
9345 2004-09-14 Raja R Harinath <rharinath@novell.com>
9347 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9349 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9351 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9353 2004-09-10 Martin Baulig <martin@ximian.com>
9355 Backported my MemberName changes from GMCS into MCS.
9357 - we are now using a special `MemberName' class instead of using
9358 strings; in GMCS, the `MemberName' also contains the type
9361 - changed the grammar rules a bit:
9362 * the old `member_name' is now a `namespace_or_type_name':
9363 The rule is that we use `namespace_or_type_name' everywhere
9364 where we expect either a "member name" (GetEnumerator) or a
9365 "member name" with an explicit interface name
9366 (IEnumerable.GetEnumerator).
9367 In GMCS, the explicit interface name may include type arguments
9368 (IEnumerable<T>.GetEnumerator).
9369 * we use `member_name' instead of just `IDENTIFIER' for
9371 The rule is that we use `member_name' wherever a member may
9372 have type parameters in GMCS.
9374 * decl.cs (MemberName): New public class.
9375 (MemberCore.MemberName): New public readonly field.
9376 (MemberCore.ctor): Take a `MemberName' argument, not a string.
9377 (DeclSpace): Likewise.
9379 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9380 * enum.cs (Enum.ctor): Likewise.
9382 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9384 (AliasEntry.ctor): Take a MemberName, not an Expression.
9385 (AliasEntry.UsingAlias): Likewise.
9387 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9388 (IMethodData.MemberName): Changed type from string to MemberName.
9389 (MemberBase.ExplicitInterfaceName): Likewise.
9390 (AbstractPropertyEventMethod.SetupName): Make this private.
9391 (AbstractPropertyEventMethod.ctor): Added `string prefix'
9392 argument; compute the member name here.
9393 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9394 on the `member.MemberName' and the `prefix'.
9396 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9398 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9399 thus, we get a `MemberName' instead of a `string'. These
9400 declarations may have type parameters in GMCS.
9401 (interface_method_declaration, delegate_declaration): Likewise.
9402 (class_declaration, interface_declaration): Likewise.
9403 (method_header): Use `namespace_or_type_name' instead of
9404 `member_name'. We may be an explicit interface implementation.
9405 (property_declaration, event_declaration): Likewise.
9406 (member_name): This is now just an `IDENTIFIER', not a
9407 `namespace_or_type_name'.
9408 (type_name, interface_type): Removed.
9409 (namespace_or_type_name): Return a MemberName, not an Expression.
9410 (primary_expression): Use `member_name' instead of `IDENTIFIER';
9411 call GetTypeExpression() on the MemberName to get an expression.
9412 (IndexerDeclaration.interface_type): Changed type from string to
9414 (MakeName): Operate on MemberName's instead of string's.
9416 2004-09-13 Raja R Harinath <rharinath@novell.com>
9419 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9420 (NamespaceEntry.Lookup): Add new argument to flag if we want the
9421 lookup to avoid symbols introduced by 'using'.
9422 * rootcontext.cs (NamespaceLookup): Update.
9424 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9426 * class.cs (TypeContainer.DoDefineMembers): Do not call
9427 DefineDefaultConstructor for static classes.
9429 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9431 * attribute.cs (Attribute.Resolve): Add error 653 report.
9433 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9435 (Method.ApplyAttributeBuilder): Add error 685 report.
9436 (Operator.Define): Add error 564 report.
9438 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9440 * expression.cs (Invocation.DoResolve): Add error
9443 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9446 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9448 * class.cs (ConstructorInitializer.Resolve):
9449 Wrong error number (515->516).
9451 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9453 * class.cs (Indexer.Define): Add error 631 report.
9455 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9457 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9459 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9461 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9463 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9465 * cs-parser.jay: Added error CS0241 report.
9467 2004-09-10 Raja R Harinath <rharinath@novell.com>
9469 * cs-parser.jay (fixed_statement): Introduce a scope for the
9470 declaration in the 'fixed' statement.
9472 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9474 * cs-parser.jay: Added CS0230 error report.
9476 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9478 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9480 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9482 * expression.cs (Argument.Resolve): Added error CS0192 and
9485 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9487 C# 2.0 #pragma warning feature
9489 * cs-tokenizer.cs (PreProcessPragma): New method;
9490 Handles #pragma directive.
9492 * report.cs (WarningRegions): New class; Support
9493 class for #pragma warning directive. It tests whether
9494 warning is enabled for a given line.
9496 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9498 * const.cs: Add more descriptive error report, tahnks to
9501 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9503 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9505 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9507 * expression.cs: Apply patch from Ben: Remove dead code from
9508 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9509 as that code just threw an exception anwyays.
9511 * const.cs: Remove the call to the turnintoconstant, for details
9514 * literal.cs: The type of the null-literal is the null type; So
9515 we use a placeholder type (literal.cs:System.Null, defined here)
9518 * expression.cs (Conditional.DoResolve): Remove some old code that
9519 is no longer needed, conversions have been fixed.
9521 (ArrayCreationExpression.DoResolve): Return false if we fail to
9522 resolve the inner expression.
9524 2004-09-07 Raja R Harinath <rharinath@novell.com>
9527 * cs-parser.jay (delegate_declaration): Record a delegate
9528 declaration as a type declaration.
9529 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9531 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9533 * parameter.cs: Do not crash if the type can not be resolved.
9535 * expression.cs: Report errors with unsafe pointers, fixes #64896
9537 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9539 * expression.cs: Pointer arith always needs to do a conv.i
9540 if the operand is a long. fix 65320
9542 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9544 Fixed cs0619-37.cs, cs0619-38.cs
9546 * enum.cs (GetObsoleteAttribute): Removed.
9548 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9549 on Enum member is double staged. The first is tested member
9552 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9554 Fixed #56986, #63631, #65231
9556 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9557 adds member to name container.
9558 (TypeContainer.AddToTypeContainer): New method, adds type to
9560 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9561 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9562 AddOperator): Simplified by reusing AddToMemberContainer.
9563 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9565 (Method.CheckForDuplications): Fixed implementation to test all
9567 (MemberBase): Detection whether member is explicit interface
9568 implementation is now in constructor.
9569 (MemberBase.UpdateMemberName): Handles IndexerName.
9570 (Accessor): Changed to keep also location information.
9571 (AbstractPropertyEventMethod): Is derived from MemberCore.
9572 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9573 will be emited or not.
9574 (PropertyBase.AreAccessorsDuplicateImplementation):
9575 Tests whether accessors are not in collision with some method.
9576 (Operator): Is derived from MethodCore to simplify common
9579 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9581 (DeclSpace.AddToContainer): Adds the member to defined_names
9582 table. It tests for duplications and enclosing name conflicts.
9584 * enum.cs (EnumMember): Clean up to reuse the base structures
9586 2004-09-03 Martin Baulig <martin@ximian.com>
9588 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9589 into TypeContainer, to make partial classes work again.
9591 2004-09-03 Martin Baulig <martin@ximian.com>
9593 * rootcontext.cs (RootContext.V2): Removed.
9595 2004-03-23 Martin Baulig <martin@ximian.com>
9597 * expression.cs (Invocation.OverloadResolve): Added `bool
9598 may_fail' argument and use it instead of the Location.IsNull() hack.
9600 2004-09-03 Martin Baulig <martin@ximian.com>
9602 Merged latest changes into gmcs. Please keep this comment in
9603 here, it makes it easier for me to see what changed in MCS since
9604 the last time I merged.
9606 2004-09-03 Raja R Harinath <rharinath@novell.com>
9609 * expression.cs (BetterConversion): Don't allow either conversion
9610 to be null. Remove redundant implicit conversion test when 'q ==
9611 null' -- when this function is invoked, we already know that the
9612 implicit conversion exists.
9613 (BetterFunction): Assume that 'best' is non-null. Remove
9614 redundant reimplementation of IsApplicable when 'best' is null.
9615 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9616 number of arguments.
9617 (IsAncestralType): Extract from OverloadResolve.
9618 (OverloadResolve): Make robust to the MethodGroupExpr being
9619 unsorted. Implement all the logic of Section 14.5.5.1, and
9620 support overloading of methods from multiple applicable types.
9621 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9623 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9624 (RealError, Warning): Append type of report to related symbol.
9626 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9628 * enum.cs: Fixed CLS-Compliance checks for enum members.
9629 Error tests cs3008-8.cs, cs3014-8.cs
9631 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9633 Fixed bug #62342, #63102
9634 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9635 like ImplementMethod.
9637 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9639 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9642 2004-09-02 Martin Baulig <martin@ximian.com>
9644 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9645 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9648 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9650 C# 2.0 Static classes implemented
9652 * class.cs (TypeContainer): instance_constructors,
9653 initialized_fields, initialized_static_fields,
9654 default_constructor, base_inteface_types are protected to be
9655 accessible from StaticClass.
9656 (TypeContainer.DefineDefaultConstructor): New virtual method
9657 for custom default constructor generating
9658 (StaticClass): New class to handle "Static classes" feature.
9660 * cs-parser.jay: Handle static keyword on class like instance
9663 * driver.cs: Added "/langversion" command line switch with two
9664 options (iso-1, default).
9666 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9668 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9670 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9672 * delegate.cs: Style.
9674 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9676 * delegate.cs: Add seperate instance expr field for miguel.
9678 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9680 * PointerArithmetic (Resolve): make sure we are not doing
9681 pointer arith on void*. Also, make sure we are resolved
9682 by not setting eclass until resolve.
9684 All callers: Make sure that PointerArithmetic gets resolved.
9686 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9688 * ArrayCreation (LookupType): If the type does not resolve
9689 to an array, give an error.
9691 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9693 * statement.cs (Try.Resolve): Fixed bug #64222
9695 2004-08-27 Martin Baulig <martin@ximian.com>
9698 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9701 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9703 * ecore.cs (Constantify): Get underlying type via
9704 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9705 Windows in special cases.
9707 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9709 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9710 for obtaining also private methods.
9711 (GetRemoveMethod): Used GetRemoveMethod (true)
9712 for obtaining also private methods.
9714 2004-08-24 Martin Baulig <martin@ximian.com>
9716 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9717 MethodAttributes.HideBySig for operators.
9719 2004-08-23 Martin Baulig <martin@ximian.com>
9721 Back to the old error reporting system :-)
9723 * report.cs (Message): Removed.
9724 (Report.MessageData, ErrorData, WarningData): Removed.
9725 (Report.Error, Warning): Back to the old system.
9727 2004-08-23 Martin Baulig <martin@ximian.com>
9729 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9731 * class.cs (TypeContainer.ParentContainer): New public virtual
9732 method; replaces the explicit interface implementation.
9733 (ClassPart.ParentContainer): Override.
9735 2004-08-23 Martin Baulig <martin@ximian.com>
9737 * statement.cs (Switch): Added support for constant switches; see
9738 #59428 or test-285.cs.
9740 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9743 * statement.cs (GetEnumeratorFilter): Removed useless
9744 logic because C# specs is strict. GetEnumerator must be
9747 2004-08-22 Martin Baulig <martin@ximian.com>
9749 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9750 a switch and may break, reset the barrier. Fixes #59867.
9752 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9754 CLS-Compliance speed up (~5% for corlib)
9756 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9757 New method. Tests container for CLS-Compliant names
9759 * class.cs (TypeContainer.VerifyClsName): New method.
9760 Checks whether container name is CLS Compliant.
9761 (Constructor): Implements IMethodData.
9763 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9764 low-case table for CLS Compliance test.
9765 (MemberCache.VerifyClsParameterConflict): New method.
9766 Checks method parameters for CS3006 error.
9768 * enum.cs (EnumMember): Is derived from MemberCore.
9769 (Enum.VerifyClsName): Optimized for better performance.
9771 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9773 * report.cs: Renamed Error_T to Error and changed all
9776 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9778 * class.cs (TypeContainer.IndexerArrayList): New inner class
9779 container for indexers.
9780 (TypeContainer.DefaultIndexerName): New constant for default
9781 indexer name. Replaced all "Item" with this constant.
9782 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9784 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9785 DefaultMemberAttribute constructor.
9787 2004-08-05 Martin Baulig <martin@ximian.com>
9789 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9792 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9794 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9795 multi platforms problem.
9797 * compiler.csproj: Included shared files.
9799 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9801 Fix bug 60333, 55971 in the more general way
9802 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9803 Added arg_type argument for constant conversion.
9804 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9806 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9809 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9810 OperatorArrayList, MethodCoreArrayList for typecontainer
9811 containers. Changed class member types to these new types.
9812 (MethodArrayList.DefineMembers): Added test for CS0659.
9814 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9816 * cfold.cs: Synchronize the folding with the code in expression.cs
9817 Binary.DoNumericPromotions for uint operands.
9819 * attribute.cs: Revert patch from Raja, it introduced a regression
9820 while building Blam-1.2.1 (hard to isolate a test case).
9822 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9826 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9828 (MethodCore.parent_method): New member. The method we're overriding
9829 if this is an override method.
9830 (MethodCore.CheckBase): Moved from Method class and made common.
9831 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9833 (MethodCore.CheckForDuplications): New abstract method. For custom
9834 member duplication search in a container
9835 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9836 method and its return type.
9837 (Event.conflict_symbol): New member. Symbol with same name in the
9841 (MemberCache.FindMemberWithSameName): New method. The method
9842 is looking for conflict with inherited symbols.
9844 2004-08-04 Martin Baulig <martin@ximian.com>
9846 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9848 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9850 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9852 * report.cs (Message): New enum for better error, warning reference in
9854 (MessageData): New inner abstract class. It generally handles printing of
9855 error and warning messages.
9856 Removed unused Error, Warning, Message methods.
9858 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9860 Fix for cs0592-8.cs test
9862 (Attributable.ValidAttributeTargets): Made public.
9863 (Attribute.ExplicitTarget): New member for explicit target value.
9864 (Attribute.CheckTargets): Now we translate explicit attribute
9865 target to Target here.
9867 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9869 * ecore.cs (MethodGroupExpr): new IsBase property.
9871 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9873 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9874 rather than an instance expr.
9876 (DelegateCreation.Emit): Use the method group rather than
9877 the instance expression. Also, if you have base.Foo as the
9878 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9880 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9882 (NewDelegate.DoResolve): Only check for the existance of Invoke
9883 if the method is going to be needed. Use MethodGroupExpr.
9885 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9887 * expression.cs: For pointer arith., make sure to use
9888 the size of the type, not the size of the pointer to
9891 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9894 * class.cs (Class): Added error CS0502 test.
9896 2004-08-03 John Luke <jluke@cfl.rr.com>
9897 Raja R Harinath <rharinath@novell.com>
9900 * attribute.cs (Attribute.complained_before): New flag.
9901 (Attribute.ResolveType, Attribute.Resolve),
9902 (Attribute.DefinePInvokeMethod): Set it.
9903 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9905 2004-08-03 Martin Baulig <martin@ximian.com>
9907 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9908 use a user-defined operator; we still need to do numeric
9909 promotions in case one argument is a builtin type and the other
9910 one has an implicit conversion to that type. Fixes #62322.
9912 2004-08-02 Martin Baulig <martin@ximian.com>
9914 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9915 (LocalInfo.IsThis): New public property.
9916 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9918 2004-08-01 Martin Baulig <martin@ximian.com>
9920 * class.cs (TypeContainer.GetClassBases): Don't set the default
9921 here since we may get called from GetPartialBases().
9922 (TypeContainer.DefineType): If GetClassBases() didn't return a
9923 parent, use the default one.
9925 2004-07-30 Duncan Mak <duncan@ximian.com>
9927 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9929 2004-07-30 Martin Baulig <martin@ximian.com>
9931 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9933 * class.cs (SourceMethod): New public class, derive from the
9934 symbol writer's ISourceMethod.
9935 (Method): Use the new symbol writer API.
9937 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9938 as argument and use the new symbol writer.
9941 (SourceFile): Implement the symbol writer's ISourceFile.
9942 (Location.SymbolDocument): Removed.
9943 (Location.SourceFile): New public property.
9945 * symbolwriter.cs: Use the new symbol writer API.
9947 2004-07-30 Raja R Harinath <rharinath@novell.com>
9949 * Makefile (install-local): Remove. Functionality moved to
9952 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9954 * Makefile: Install mcs.exe.config file together with mcs.exe.
9955 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9956 correct runtime version.
9958 2004-07-25 Martin Baulig <martin@ximian.com>
9961 (TypeContainer.RegisterOrder): Removed, this was unused.
9962 (TypeContainer, interface_order): Removed.
9963 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9964 TypeContainer as argument since we can also be called with a
9965 `PartialContainer' for a partial class/struct/interface.
9966 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9967 of checking whether we're an `Interface' - we could be a
9969 (PartialContainer.Register): Override; call
9970 AddClass()/AddStruct()/AddInterface() on our parent.
9972 * cs-parser.jay (interface_member_declaration): Add things to the
9973 `current_container', not the `current_class'.
9975 * rootcontext.cs (RegisterOrder): The overloaded version which
9976 takes an `Interface' was unused, removed.
9978 * typemanager.cs (TypeManager.LookupInterface): Return a
9979 `TypeContainer', not an `Interface'.
9980 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9981 contain a `PartialContainer' for an interface, so check it's
9982 `Kind' to figure out what it is.
9984 2004-07-25 Martin Baulig <martin@ximian.com>
9986 * class.cs (Class.DefaultTypeAttributes): New public constant.
9987 (Struct.DefaultTypeAttributes): Likewise.
9988 (Interface.DefaultTypeAttributes): Likewise.
9989 (PartialContainer.TypeAttr): Override this and add the
9990 DefaultTypeAttributes.
9992 2004-07-25 Martin Baulig <martin@ximian.com>
9994 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9995 we can just use the `Parent' field instead.
9997 2004-07-25 Martin Baulig <martin@ximian.com>
9999 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10001 2004-07-25 Martin Baulig <martin@ximian.com>
10003 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10004 our parts before defining any methods.
10005 (TypeContainer.VerifyImplements): Make this virtual.
10006 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10007 on our PartialContainer.
10009 2004-07-25 Martin Baulig <martin@ximian.com>
10011 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10013 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10014 argument, we can just use the `Parent' field instead.
10017 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10018 (MemberBase.DoDefine): Likewise.
10020 2004-07-24 Martin Baulig <martin@ximian.com>
10022 * decl.cs (MemberCore.Parent): New public field.
10023 (DeclSpace.Parent): Moved to MemberCore.
10025 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10026 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10028 (FieldBase, Field, Operator): Likewise.
10029 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10030 (EventField, Event): Likewise.
10032 2004-07-23 Martin Baulig <martin@ximian.com>
10034 * class.cs (PartialContainer): New public class.
10035 (ClassPart): New public class.
10036 (TypeContainer): Added support for partial classes.
10037 (TypeContainer.GetClassBases): Splitted some of the functionality
10038 out into GetNormalBases() and GetPartialBases().
10040 * cs-tokenizer.cs (Token.PARTIAL): New token.
10041 (Tokenizer.consume_identifier): Added some hacks to recognize
10042 `partial', but only if it's immediately followed by `class',
10043 `struct' or `interface'.
10045 * cs-parser.jay: Added support for partial clases.
10047 2004-07-23 Martin Baulig <martin@ximian.com>
10049 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10050 a `DeclSpace' and also made it readonly.
10051 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10052 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10053 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10055 * cs-parser.jay: Pass the `current_class', not the
10056 `current_container' (at the moment, this is still the same thing)
10057 to a new Method, Property, Event, Indexer or Constructor.
10059 2004-07-23 Martin Baulig <martin@ximian.com>
10061 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10062 and removed the `current_interface' one.
10063 (struct_declaration, class_declaration, interface_declaration):
10064 Set `current_class' to the newly created class/struct/interface;
10065 set their `Bases' and call Register() before parsing their body.
10067 2004-07-23 Martin Baulig <martin@ximian.com>
10069 * class.cs (Kind): New public enum.
10070 (TypeContainer): Made this class abstract.
10071 (TypeContainer.Kind): New public readonly field.
10072 (TypeContainer.CheckDef): New public method; moved here from
10074 (TypeContainer.Register): New public abstract method.
10075 (TypeContainer.GetPendingImplementations): New public abstract
10077 (TypeContainer.GetClassBases): Removed the `is_class' and
10078 `is_iface' parameters.
10079 (TypeContainer.DefineNestedTypes): Formerly known as
10081 (ClassOrStruct): Made this class abstract.
10083 * tree.cs (RootTypes): New public type.
10085 2004-07-20 Martin Baulig <martin@ximian.com>
10087 * tree.cs (Tree.RecordNamespace): Removed.
10088 (Tree.Namespaces): Removed.
10090 * rootcontext.cs (RootContext.IsNamespace): Removed.
10092 * cs-parser.jay (namespace_declaration): Just create a new
10093 NamespaceEntry here.
10095 2004-07-20 Martin Baulig <martin@ximian.com>
10097 * statement.cs (ExceptionStatement): New abstract class. This is
10098 now used as a base class for everyone who's using `finally'.
10099 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10100 our local variables before using them.
10102 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10103 virtual method. This is used by Yield.Resolve() to "steal" an
10104 outer block's `finally' clauses.
10105 (FlowBranchingException): The .ctor now takes an ExceptionStatement
10108 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10109 version which takes an ExceptionStatement. This version must be
10110 used to create exception branchings.
10113 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10114 (Iterator.EmitMoveNext): Added exception support; protect the
10115 block with a `fault' clause, properly handle 'finally' clauses.
10116 (Iterator.EmitDispose): Run all the `finally' clauses here.
10118 2004-07-20 Martin Baulig <martin@ximian.com>
10120 * iterator.cs: This is the first of a set of changes in the
10121 iterator code. Match the spec more closely: if we're an
10122 IEnumerable, then GetEnumerator() must be called. The first time
10123 GetEnumerator() is called, it returns the current instance; all
10124 subsequent invocations (if any) must create a copy.
10126 2004-07-19 Miguel de Icaza <miguel@ximian.com>
10128 * expression.cs: Resolve the constant expression before returning
10131 2004-07-19 Martin Baulig <martin@ximian.com>
10133 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10134 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10135 the return type of the new EmitContext.
10137 2004-07-18 Martin Baulig <martin@ximian.com>
10139 * class.cs (Property.Define): Fix iterators.
10141 * iterators.cs (Iterator.Define): Moved the
10142 `container.AddInterator (this)' call here from the .ctor; only do
10143 it if we resolved successfully.
10145 2004-07-17 Miguel de Icaza <miguel@ximian.com>
10147 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10148 `true' for preprocessing directives that we parse. The return
10149 value indicates whether we should return to regular tokenizing or
10150 not, not whether it was parsed successfully.
10152 In the past if we were in: #if false ... #line #endif, we would
10153 resume parsing after `#line'. See bug 61604.
10155 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10156 building: IsEnumType should return true only for enums, not for
10157 enums or System.Enum itself. This fixes #61593.
10159 Likely what happened is that corlib was wrong: mcs depended on
10160 this bug in some places. The bug got fixed, we had to add the
10161 hack, which caused bug 61593.
10163 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10164 that was a workaround for the older conditions.
10166 2004-07-16 Ben Maurer <bmaurer@ximian.com>
10168 * assign.cs: IAssignMethod has a new interface, as documented
10169 inline. All assignment code now uses this new api.
10171 * ecore.cs, expression.cs: All classes which implement
10172 IAssignMethod now use the new interface.
10174 * expression.cs (Invocation): add a hack to EmitCall so that
10175 IndexerAccess can be the target of a compound assignment without
10176 evaluating its arguments twice.
10178 * statement.cs: Handle changes in Invocation api.
10180 2004-07-16 Martin Baulig <martin@ximian.com>
10182 * iterators.cs: Rewrote this. We're now using one single Proxy
10183 class for both the IEnumerable and the IEnumerator interface and
10184 `Iterator' derives from Class so we can use the high-level API.
10186 * class.cs (TypeContainer.AddIterator): New method.
10187 (TypeContainer.DoDefineType): New protected virtual method, which
10188 is called from DefineType().
10189 (TypeContainer.DoDefineMembers): Call DefineType() and
10190 DefineMembers() on all our iterators.
10191 (TypeContainer.Emit): Call Emit() on all our iterators.
10192 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10194 * codegen.cs (EmitContext.CurrentIterator): New public field.
10196 2004-07-15 Martin Baulig <martin@ximian.com>
10199 (TypeManager.not_supported_exception_type): New type.
10201 2004-07-14 Martin Baulig <martin@ximian.com>
10203 * iterators.cs: Use real error numbers.
10205 2004-07-14 Martin Baulig <martin@ximian.com>
10207 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10208 requires this to be a System.Collection.IEnumerable and not a
10209 class implementing that interface.
10210 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10212 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10214 * class.cs: Fixed previous fix, it broke some error tests.
10216 2004-07-12 Martin Baulig <martin@ximian.com>
10218 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10221 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10223 * assign.cs (LocalTemporary): Add new argument: is_address,If
10224 `is_address' is true, then the value that we store is the address
10225 to the real value, and not the value itself.
10227 * ecore.cs (PropertyExpr): use the new local temporary
10228 stuff to allow us to handle X.Y += z (where X is a struct)
10230 2004-07-08 Martin Baulig <martin@ximian.com>
10232 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10233 not always return, just like we're doing in Using.Resolve().
10235 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10237 * cs-parser.jay (fixed_statement): flag this as Pinned.
10239 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10241 * typemanager.cs (TypeManager): Removed MakePinned method, this
10242 mechanism is replaced with the .NET 2.x compatible mechanism of
10243 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10245 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10246 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10247 `IsFixed' property which has a different meaning.
10249 2004-07-02 Raja R Harinath <rharinath@novell.com>
10251 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10252 visible from inside a nested class, not just the names of the
10253 immediately enclosing class.
10254 Fix for bug #60730.
10256 2004-06-24 Raja R Harinath <rharinath@novell.com>
10258 * expression.cs (BetterConversion): Remove buggy special-case
10259 handling of "implicit constant expression conversions". At this
10260 point, we already know that the conversion is possible -- we're
10261 only checking to see which is better.
10263 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10265 * cs-parser.jay: Added error CS0210 test.
10267 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10269 * cs-parser.jay: Added error CS0134 test.
10271 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10274 * cs-parser.jay: Added error CS0145 test.
10276 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10278 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10280 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10282 * expression.cs (StackAlloc.Resolve): The argument may not
10283 be a constant; deal with this case.
10285 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10287 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10288 GetIndexerAttributeValue.
10289 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10291 * class.cs (Indexer.Define): Added error tests for CS0415,
10294 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10296 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10299 2004-06-23 Martin Baulig <martin@ximian.com>
10301 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10302 neither return nor throw, reset the barrier as well. Fixes #60457.
10304 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10306 * class.cs : EventAttributes is now set to None by default.
10307 This fixes bug #60459.
10309 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10312 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10313 Don't throw exception but return null (it's sufficient now).
10315 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10317 * typemanager.cs (GetArgumentTypes): Faster implementation.
10319 2004-06-18 Martin Baulig <martin@ximian.com>
10321 * attribute.cs (Attribute.Resolve): Check whether we're an
10322 EmptyCast which a Constant child. Fixes #60333.
10324 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10326 * statement.cs (EmitCollectionForeach): Account for the fact that
10327 not all valuetypes are in areas which we can take the address of.
10328 For these variables, we store to a temporary variable. Also, make
10329 sure that we dont emit a `callvirt' on a valuetype method.
10331 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10333 * expression.cs (StackAlloc.DoReSolve): Added test for
10334 negative parameter (CS0247).
10336 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10339 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10341 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10344 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10347 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10349 Fix bug #58254 & cs1555.cs, cs1556.cs
10350 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10352 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10354 * cs-parser.jay: Added error CS1669 test for indexers.
10356 2004-06-11 Martin Baulig <martin@ximian.com>
10358 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10359 call this twice: for params and varargs methods.
10361 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10364 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10366 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10368 * attribute.cs (Attribute.GetValidTargets): Made public.
10371 (AbstractPropertyEventMethod): New class for better code sharing.
10372 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10374 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10376 2004-06-11 Raja R Harinath <rharinath@novell.com>
10379 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10380 that the call to Resolve is part of a MemberAccess.
10381 (Expression.Resolve): Use it for SimpleName resolution.
10382 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10383 Add 'intermediate' boolean argument.
10384 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
10385 error message when the SimpleName can be resolved ambiguously
10386 between an expression and a type.
10387 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10389 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10390 call on the left-side.
10392 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10395 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10397 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10399 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10401 2004-06-11 Martin Baulig <martin@ximian.com>
10403 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10404 varargs methods if applicable.
10406 2004-06-11 Martin Baulig <martin@ximian.com>
10408 * expression.cs (Invocation.EmitCall): Don't use
10409 `method.CallingConvention == CallingConventions.VarArgs' since the
10410 method could also have `CallingConventions.HasThis'.
10412 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10414 * class.cs (Event.GetSignatureForError): Implemented.
10415 Fixed crash in error test cs3010.cs
10417 2004-06-10 Miguel de Icaza <miguel@ximian.com>
10419 * cs-tokenizer.cs: Change the way we track __arglist to be
10420 consistent with the other keywords.
10422 2004-06-09 Miguel de Icaza <miguel@ximian.com>
10424 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10427 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
10429 * codegen.cs: Check that all referenced assemblies have a strongname
10430 before strongnaming the compiled assembly. If not report error CS1577.
10431 Fix bug #56563. Patch by Jackson Harper.
10432 * typemanager.cs: Added a method to return all referenced assemblies.
10433 Fix bug #56563. Patch by Jackson Harper.
10435 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10438 (Method.ApplyAttributeBuilder): Moved and added conditional
10439 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10442 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10444 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10447 * class.cs: (EventField.attribute_targets): Changed default target.
10449 2004-06-08 Martin Baulig <martin@ximian.com>
10451 * expression.cs (Invocation.EmitCall): Enable varargs methods.
10453 2004-06-08 Martin Baulig <martin@ximian.com>
10455 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10457 2004-06-07 Martin Baulig <martin@ximian.com>
10459 Added support for varargs methods.
10461 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10464 * cs-parser.jay: Added support for `__arglist'.
10466 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10468 * expression.cs (Argument.AType): Added `ArgList'.
10469 (Invocation): Added support for varargs methods.
10470 (ArglistAccess): New public class.
10471 (Arglist): New public class.
10473 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10475 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
10476 a method's top-level block if the method has varargs.
10478 * support.cs (ReflectionParameters, InternalParameters): Added
10479 support for varargs methods.
10481 2004-06-07 Miguel de Icaza <miguel@ximian.com>
10483 * class.cs: Provide location in indexer error report.
10485 * driver.cs: Use standard names.
10487 * namespace.cs: Catch the use of using after a namespace has been
10488 declared also on using aliases.
10490 2004-06-03 Raja R Harinath <rharinath@novell.com>
10493 * typemanager.cs (closure_private_ok, closure_invocation_type)
10494 (closure_qualifier_type, closure_invocation_assembly)
10495 (FilterWithClosure): Move to ...
10496 (Closure): New internal nested class.
10497 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10498 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10499 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10500 (MemberLookup, MemberLookupFailed): Use it.
10501 * expression.cs (New.DoResolve): Treat the lookup for the
10502 constructor as being qualified by the 'new'ed type.
10503 (Indexers.GetIndexersForTypeOrInterface): Update.
10505 2004-06-03 Marek Safar <marek.safar@seznam.cz>
10508 (GetConditionalAttributeValue): New method. Returns
10509 condition of ConditionalAttribute.
10510 (SearchMulti): New method. Returns all attributes of type 't'.
10511 Use it when attribute is AllowMultiple = true.
10512 (IsConditionalMethodExcluded): New method.
10515 (Method.IsExcluded): Implemented. Returns true if method has conditional
10516 attribute and the conditions is not defined (method is excluded).
10517 (IMethodData): Extended interface for ConditionalAttribute support.
10518 (PropertyMethod.IsExcluded): Implemented.
10521 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10524 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10527 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
10529 * expression.cs (ArrayCreationExpression): Make this just an
10530 `expression'. It can't be a statement, so the code here was
10533 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10536 * typemanager.cs (GetFullNameSignature): New method for
10539 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10542 * class.cs (MemberBase.GetSignatureForError): New virtual method.
10543 Use this method when MethodBuilder is null.
10544 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10545 Added test for error CS0626 (MONO reports error for this situation).
10546 (IMethodData.GetSignatureForError): Extended interface.
10548 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10551 (AttributeTester.GetObsoleteAttribute): Returns instance of
10552 ObsoleteAttribute when type is obsolete.
10555 (TypeContainer.VerifyObsoleteAttribute): Override.
10556 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10557 (MethodCode.VerifyObsoleteAttribute): Override.
10558 (MemberBase.VerifyObsoleteAttribute): Override.
10561 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10562 and report proper error.
10565 Delegate.VerifyObsoleteAttribute): Override.
10568 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10569 and report proper error.
10570 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10573 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10577 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10578 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10579 Added test for ObsoleteAttribute.
10582 (Catch): Derived from Statement.
10584 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10586 Fixed bug #59071 & cs0160.cs
10588 * statement.cs (Try.Resolve): Check here whether order of catch
10589 clauses matches their dependencies.
10591 2004-05-31 Miguel de Icaza <miguel@ximian.com>
10593 * Reverted patch to namespace.cs (Use lookuptypedirect). This
10594 caused a regression: #59343. Referencing nested classes from an
10595 assembly stopped working.
10597 2004-05-31 Martin Baulig <martin@ximian.com>
10599 MCS is now frozen for beta 2.
10601 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10603 * convert.cs: add a trivial cache for overload operator resolution.
10605 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10607 * decl.cs: If possible, use lookuptypedirect here. We can only do
10608 this if there is no `.' after the namespace. Avoids using
10609 LookupType, which does lots of slow processing.
10610 (FindNestedType) New method, does what it says :-).
10611 * namespace.cs: use LookupTypeDirect.
10612 * rootcontext.cs: use membercache, if possible.
10613 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10615 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10618 According to the spec,
10620 In a member access of the form E.I, if E is a single identifier,
10621 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10622 field, property, localvariable, or parameter with the same type as
10623 the meaning of E as a type-name (§3.8), then both possible
10624 meanings of E are permitted.
10626 We did not check that E as a simple-name had the same type as E as
10629 This trivial check gives us 5-7% on bootstrap time.
10631 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10633 * expression.cs (Invocation.OverloadResolve): Avoid the
10634 use of hashtables and boxing here by allocating on demand.
10636 2004-05-30 Martin Baulig <martin@ximian.com>
10638 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10639 we're doing a silent lookup. Don't try to lookup nested types in
10640 TypeManager.object_type (thanks to Ben Maurer).
10642 2004-05-30 Martin Baulig <martin@ximian.com>
10644 Committing a patch from Ben Maurer.
10646 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10648 2004-05-29 Martin Baulig <martin@ximian.com>
10650 * class.cs (IMethodData.ShouldIgnore): New method.
10652 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10653 `Location' argument, we don't need it anywhere. Use
10654 `IMethodData.ShouldIgnore ()' instead of
10655 `MethodData.GetMethodFlags ()'.
10656 (TypeManager.AddMethod): Removed.
10657 (TypeManager.AddMethod2): Renamed to AddMethod.
10659 2004-05-29 Martin Baulig <martin@ximian.com>
10661 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10663 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10664 converting from a class type S to an interface type and we already
10665 have an object on the stack, don't box it again. Fixes #52578.
10667 2004-05-29 Martin Baulig <martin@ximian.com>
10669 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10670 Added support for `params' parameters. Fixes #59267.
10672 2004-05-29 Martin Baulig <martin@ximian.com>
10674 * literal.cs (NullPointer): Provide a private .ctor which sets
10675 `type' to TypeManager.object_type. Fixes #59048.
10677 2004-05-29 Martin Baulig <martin@ximian.com>
10679 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10680 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10682 * ecore.cs (EventExpr.instance_expr): Make the field private.
10684 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10686 Fixed bug #50080 & cs0214-2.cs
10687 * expression.cs (Cast.DoResolve): Check unsafe context here.
10689 * statement.cs (Resolve.DoResolve): Likewise.
10691 2004-05-26 Martin Baulig <martin@ximian.com>
10693 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10695 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10696 (RootContext.LookupType): Pass down the `silent' flag.
10698 2004-05-25 Martin Baulig <martin@ximian.com>
10701 (MethodGroupExpr.IdenticalTypeName): New public property.
10702 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10703 expression actually refers to a type.
10705 2004-05-25 Martin Baulig <martin@ximian.com>
10707 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10708 for #56176 and made it actually work.
10710 2004-05-25 Martin Baulig <martin@ximian.com>
10712 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10713 (FieldExpr, PropertyExpr): Override and implement
10714 CacheTemporaries. Fixes #52279.
10716 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10718 * location.cs: In the new compiler listing a file twice is a
10719 warning, not an error.
10721 2004-05-24 Martin Baulig <martin@ximian.com>
10723 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10724 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10726 2004-05-24 Martin Baulig <martin@ximian.com>
10728 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10729 walking the `using' list. Fixes #53921.
10731 2004-05-24 Martin Baulig <martin@ximian.com>
10733 * const.cs (Const.LookupConstantValue): Added support for
10734 EmptyCast's; fixes #55251.
10736 2004-05-24 Martin Baulig <martin@ximian.com>
10738 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10739 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10740 which does the CS0135 check. The reason is that we first need to
10741 check whether the variable actually exists.
10743 2004-05-24 Martin Baulig <martin@ximian.com>
10745 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10746 than RootContext.LookupType() to find the explicit interface
10747 type. Fixes #58584.
10749 2004-05-24 Raja R Harinath <rharinath@novell.com>
10751 * Makefile: Simplify. Use executable.make.
10752 * mcs.exe.sources: New file. List of sources of mcs.exe.
10754 2004-05-24 Anders Carlsson <andersca@gnome.org>
10758 Use the invariant culture when doing String.Compare for CLS case
10761 2004-05-23 Martin Baulig <martin@ximian.com>
10763 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10764 don't have any dots. Fixes #52622, added cs0246-8.cs.
10766 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10768 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10770 * class.cs (MemberBase.Define): Reuse MemberType member for
10771 resolved type. Other methods can use it too.
10773 2004-05-23 Martin Baulig <martin@ximian.com>
10775 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10776 the variable also exists in the current block (otherwise, we need
10777 to report a CS0103). Fixes #58670.
10779 2004-05-23 Martin Baulig <martin@ximian.com>
10781 * flowanalysis.cs (Reachability.Reachable): Compute this
10782 on-the-fly rather than storing it as a field.
10784 2004-05-23 Martin Baulig <martin@ximian.com>
10786 * flowanalysis.cs (Reachability.And): Manually compute the
10787 resulting `barrier' from the reachability.
10789 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10792 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10793 instance of ObsoleteAttribute when symbol is obsolete.
10796 (IMethodData): Extended interface for ObsoleteAttribute support.
10798 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10800 * attribute.cs: Fix bug #55970
10802 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10806 (GetObsoleteAttribute): New method. Creates the instance of
10808 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10809 ObsoleteAttribute when member is obsolete.
10810 (AttributeTester.Report_ObsoleteMessage): Common method for
10811 Obsolete error/warning reporting.
10814 (TypeContainer.base_classs_type): New member for storing parent type.
10817 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10818 for this MemberCore.
10820 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10822 * attribute.cs, const.cs: Fix bug #58590
10824 2004-05-21 Martin Baulig <martin@ximian.com>
10826 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10827 out parameters if the end of the method is unreachable. Fixes
10830 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10832 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10833 Hari was right, why extra method.
10835 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10837 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10839 2004-05-20 Martin Baulig <martin@ximian.com>
10841 Merged this back from gmcs to keep the differences to a minumum.
10843 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10844 instead of a Declspace.
10845 (Attribute.ResolveType): Likewise.
10846 (Attributes.Search): Likewise.
10847 (Attributes.Contains): Likewise.
10848 (Attributes.GetClsCompliantAttribute): Likewise.
10850 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10852 (MethodData.ApplyAttributes): Take an EmitContext instead of a
10855 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10857 Fix bug #58688 (MCS does not report error when the same attribute
10860 * attribute.cs (Attribute.Emit): Distinction between null and default.
10862 2004-05-19 Raja R Harinath <rharinath@novell.com>
10864 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10865 of a top-level attribute without an attribute target.
10866 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10868 (Attribute.Conditional_GetConditionName),
10869 (Attribute.Obsolete_GetObsoleteMessage): Update.
10870 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10871 part of ScanForIndexerName.
10872 (Attribute.CanIgnoreInvalidAttribute): New function.
10873 (Attribute.ScanForIndexerName): Move to ...
10874 (Attributes.ScanForIndexerName): ... here.
10875 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10876 (Attributes.Search): New internal variant that can choose not to
10877 complain if types aren't resolved. The original signature now
10879 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10880 complaints suppressed.
10881 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10882 only if it not useful.
10883 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10884 top-level for attributes that are shared between the assembly
10885 and a top-level class.
10886 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10887 * class.cs: Update to reflect changes.
10888 (DefineIndexers): Fuse loops.
10889 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10890 a couple more variants of attribute names.
10892 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10894 Fix bug #52585 (Implemented explicit attribute declaration)
10897 (Attributable.ValidAttributeTargets): New abstract method. It gets
10898 list of valid attribute targets for explicit target declaration.
10899 (Attribute.Target): It holds target itself.
10900 (AttributeSection): Removed.
10901 (Attribute.CheckTargets): New method. It checks whether attribute
10902 target is valid for the current element.
10905 (EventProperty): New class. For events that are declared like
10906 property (with add and remove accessors).
10907 (EventField): New class. For events that are declared like field.
10910 * cs-parser.jay: Implemented explicit attribute target declaration.
10912 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10913 Override ValidAttributeTargets.
10916 (ReturnParameter): Class for applying custom attributes on
10918 (ParameterAtribute): New class. Class for applying custom
10919 attributes on the parameter type.
10921 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10923 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10926 (Method): Allow UNSAFE here.
10928 * modifiers.cs: Support unsafe reporting.
10930 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10932 * decl.cs: Fix bug #58478.
10934 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10936 * statement.cs: When checking for unreachable code on an EmptyStatement,
10937 set the location. Fixes bug #58488.
10939 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10941 * driver.cs: Add -pkg handling.
10943 From Gonzalo: UseShelLExecute=false
10945 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10948 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10950 (Attribute.IsClsCompliaceRequired): Moved to base for better
10952 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10953 when attribute is AttributeUsageAttribute.
10954 (Attribute.GetValidTargets): Simplified.
10955 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10956 attribute for this type.
10957 (Attribute.ApplyAttributes): Method renamed to Emit and make
10959 (GlobalAttributeSection): New class for special handling of global
10960 attributes (assembly, module).
10961 (AttributeSection.Emit): New method.
10963 * class.cs: Implemented Attributable abstract methods.
10964 (MethodCore.LabelParameters): Moved to Parameter class.
10965 (Accessor): Is back simple class.
10966 (PropertyMethod): Implemented Attributable abstract class.
10967 (DelegateMethod): Implemented Attributable abstract class.
10968 (Event): New constructor for disctintion between normal Event
10969 and Event with accessors.
10971 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10973 * codegen.cs, const.cs, decl.cs, delegate.cs:
10974 (CommonAssemblyModulClass): Implemented Attributable abstract class
10977 * enum.cs: Implement IAttributeSupport interface.
10978 (EnumMember): New class for emum members. Implemented Attributable
10982 (ParameterBase): Is abstract.
10983 (ReturnParameter): New class for easier [return:] attribute handling.
10985 * typemanager.cs: Removed builder_to_attr.
10987 2004-05-11 Raja R Harinath <rharinath@novell.com>
10990 * attribute.cs (Attribute.GetPositionalValue): New function.
10991 * class.cs (TypeContainer.VerifyMembers): New function.
10992 (TypeContainer.Emit): Use it.
10993 (ClassOrStruct): New base class for Class and Struct.
10994 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10995 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10997 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10998 then each non-static field should have a FieldOffset attribute.
10999 Otherwise, none of the fields should have a FieldOffset attribute.
11000 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11001 and FieldOffset attributes.
11002 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11003 (TypeManager.field_offset_attribute_type): New core types.
11004 (TypeManager.InitCoreTypes): Initialize them.
11006 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11008 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11009 Return correct type.
11012 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11014 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11015 be implicitly converted to ulong.
11017 * expression.cs: The logic for allowing operator &, | and ^ worked
11018 was wrong, it worked before because we did not report an error in
11019 an else branch. Fixes 57895.
11021 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11022 allow volatile fields to be reference types.
11024 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11026 * driver.cs: Add support for /debug-
11028 2004-05-07 Raja R Harinath <rharinath@novell.com>
11030 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11031 Add a 'complain' parameter to silence errors.
11032 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11033 silently overlooked type-resolutions.
11034 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11035 to reflect changes.
11036 (Attributes.Search): New function.
11037 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11038 (Attributes.GetAttributeFullName): Remove hack.
11039 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11040 Update to reflect changes.
11041 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11042 Use Attributes.Search instead of nested loops.
11044 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11047 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11048 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11049 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11051 * report.cs: (Report.Warning): Renamed to Warning_T because of
11052 parameter collision.
11054 2004-05-05 Raja R Harinath <rharinath@novell.com>
11056 * expression.cs (MemberAccess.ResolveMemberAccess):
11057 Exit with non-zero status after Report.Error.
11058 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11060 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11062 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11064 * support.cs: Don't hang when the file is empty.
11066 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11068 * support.cs: In SeekableStreamReader, compute the preamble size of the
11069 underlying stream. Position changes should take into account that initial
11072 2004-05-03 Todd Berman <tberman@sevenl.net>
11074 * driver.cs: remove unused GetSysVersion function.
11076 2004-05-03 Todd Berman <tberman@sevenl.net>
11078 * driver.cs: Remove the hack from saturday, as well as the hack
11079 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11080 link_paths to get that bit proper.
11082 2004-05-01 Todd Berman <tberman@sevenl.net>
11084 * driver.cs: Try a LoadFrom before a Load, this checks the current
11085 path. This is currently a bug in mono that is be fixed, however, this
11086 provides a workaround for now. This will be removed when the bug
11089 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11091 * CryptoConvert.cs: Updated to latest version. Fix issue with
11092 incomplete key pairs (#57941).
11094 2004-05-01 Todd Berman <tberman@sevenl.net>
11096 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11099 2004-04-30 Jackson Harper <jackson@ximian.com>
11101 * codegen.cs: Open keys readonly.
11103 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11105 * typemanager.cs: don't report cyclic struct layout when a struct
11106 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11107 which has 2 Pango.Rectangle fields.
11109 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11111 * expression.cs: Handle IntPtr comparisons with IL code
11112 rather than a method call.
11114 2004-04-29 Martin Baulig <martin@ximian.com>
11116 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11117 the list of PropertyInfo's in class hierarchy and find the
11118 accessor. Fixes #56013.
11120 2004-04-29 Martin Baulig <martin@ximian.com>
11122 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11124 2004-04-29 Martin Baulig <martin@ximian.com>
11126 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11128 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11130 2004-04-29 Martin Baulig <martin@ximian.com>
11132 * class.cs (ConstructorInitializer.Resolve): Check whether the
11133 parent .ctor is accessible. Fixes #52146.
11135 2004-04-29 Martin Baulig <martin@ximian.com>
11137 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11139 * statement.cs (Using.EmitLocalVariableDecls): Use
11140 TypeManager.idisposable_type, not typeof (IDisposable).
11141 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11143 2004-04-29 Martin Baulig <martin@ximian.com>
11145 * class.cs (Event.Define): Don't emit the field and don't set
11146 RTSpecialName and SpecialName for events on interfaces. Fixes
11149 2004-04-29 Raja R Harinath <rharinath@novell.com>
11151 Refactor Attribute.ApplyAttributes.
11152 * attribute.cs (Attributable): New base class for objects that can
11153 have Attributes applied on them.
11154 (Attribute): Make AttributeUsage fields public.
11155 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11156 (Attribute.IsInternalCall): New property.
11157 (Attribute.UsageAttr): Convert to a public read-only property.
11158 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11159 (Attribute.ResolveType, Attribute.Resolve)
11160 (Attribute.ScanForIndexerName): Update to reflect changes.
11161 (Attribute.CheckAttributeTarget): Re-format.
11162 (Attribute.ApplyAttributes): Refactor, to various
11163 Attributable.ApplyAttributeBuilder methods.
11164 * decl.cs (MemberCore): Make Attributable.
11165 * class.cs (Accessor): Make Attributable.
11166 (MethodData.ApplyAttributes): Use proper attribute types, not
11168 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11169 (TypeContainer.ApplyAttributeBuilder)
11170 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11171 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11172 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11173 (Operator.ApplyAttributeBuilder): New factored-out methods.
11174 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11175 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11176 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11177 * parameter.cs (ParameterBase): New Attributable base class
11178 that can also represent Return types.
11179 (Parameter): Update to the changes.
11181 2004-04-29 Jackson Harper <jackson@ximian.com>
11183 * driver.cs: Prefer the corlib system version when looking for
11184 assemblies in the GAC. This is still a hack, but its a better hack
11187 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11189 * decl.cs, enum.cs: Improved error 3005 reporting.
11191 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11192 (related_symbols): New private member for list of symbols
11193 related to reported error/warning.
11195 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11197 2004-04-29 Martin Baulig <martin@ximian.com>
11199 * ecore.cs (Expression.Constantify): If we're an enum and
11200 TypeManager.TypeToCoreType() doesn't give us another type, use
11201 t.UnderlyingSystemType. Fixes #56178.
11203 2004-04-29 Martin Baulig <martin@ximian.com>
11205 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11206 interfaces and for each interface, only add members directly
11207 declared in that interface. Fixes #53255.
11209 2004-04-28 Martin Baulig <martin@ximian.com>
11211 * expression.cs (ConditionalLogicalOperator): Use a temporary
11212 variable for `left' to avoid that we evaluate it more than once;
11215 2004-04-28 Martin Baulig <martin@ximian.com>
11217 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11220 2004-04-28 Martin Baulig <martin@ximian.com>
11222 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11225 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11226 whether the type is not void (CS1547).
11228 2004-04-28 Martin Baulig <martin@ximian.com>
11230 * expression.cs (Unary.DoResolveLValue): Override this and report
11231 CS0131 for anything but Operator.Indirection.
11233 2004-04-28 Martin Baulig <martin@ximian.com>
11235 Committing a patch from Ben Maurer; see bug #50820.
11237 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11240 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11243 2004-04-28 Martin Baulig <martin@ximian.com>
11245 Committing a patch from Ben Maurer; see bug #50820.
11247 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11250 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11253 2004-04-28 Martin Baulig <martin@ximian.com>
11255 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11256 (Block.AddLabel): Call DoLookupLabel() to only search in the
11259 2004-04-28 Martin Baulig <martin@ximian.com>
11261 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11262 comparing StringConstants and NullLiterals in Equality and Inequality.
11264 2004-04-28 Jackson Harper <jackson@ximian.com>
11266 * driver.cs: Attempt to load referenced assemblies from the
11267 GAC. This is the quick and dirty version of this method that
11268 doesnt take into account versions and just takes the first
11269 canidate found. Will be good enough for now as we will not have more
11270 then one version installed into the GAC until I update this method.
11272 2004-04-28 Martin Baulig <martin@ximian.com>
11274 * typemanager.cs (TypeManager.CheckStructCycles): New public
11275 static method to check for cycles in the struct layout.
11277 * rootcontext.cs (RootContext.PopulateTypes): Call
11278 TypeManager.CheckStructCycles() for each TypeContainer.
11279 [Note: We only need to visit each type once.]
11281 2004-04-28 Martin Baulig <martin@ximian.com>
11283 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11285 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11286 success and added `out object value'. Use a `bool resolved' field
11287 to check whether we've already been called rather than
11288 `ConstantValue != null' since this breaks for NullLiterals.
11290 2004-04-28 Raja R Harinath <rharinath@novell.com>
11292 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11293 setting of this flag, since the 'set' method may be non-public.
11295 2004-04-28 Raja R Harinath <rharinath@novell.com>
11297 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11298 check on current_vector.Block.
11300 2004-04-27 Martin Baulig <martin@ximian.com>
11302 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11303 a field initializer. Fixes #56459.
11305 2004-04-27 Martin Baulig <martin@ximian.com>
11307 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11308 we're not attempting to use an indexer. Fixes #52154.
11310 2004-04-27 Martin Baulig <martin@ximian.com>
11312 * statement.cs (Return): Don't create a return label if we don't
11313 need it; reverts my change from January 20th. Thanks to Ben
11316 2004-04-27 Martin Baulig <martin@ximian.com>
11318 According to the spec, `goto' can only leave a nested scope, but
11321 * statement.cs (Block.LookupLabel): Only lookup in the current
11322 block, don't recurse into parent or child blocks.
11323 (Block.AddLabel): Check in parent and child blocks, report
11324 CS0140/CS0158 if we find a duplicate.
11325 (Block): Removed this indexer for label lookups.
11326 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11327 this already does the error reporting for us.
11330 (FlowBranching.UsageVector.Block): New public variable; may be null.
11331 (FlowBranching.CreateSibling): Added `Block' argument.
11332 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11333 label for the target of a `goto' and check whether we're not
11334 leaving a `finally'.
11336 2004-04-27 Martin Baulig <martin@ximian.com>
11338 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11339 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11342 2004-04-27 Martin Baulig <martin@ximian.com>
11344 * statement.cs (Block.AddLabel): Also check for implicit blocks
11345 and added a CS0158 check.
11347 2004-04-27 Martin Baulig <martin@ximian.com>
11349 * flowanalysis.cs (FlowBranchingLoop): New class.
11350 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11351 UsageVector's instead of an ArrayList.
11352 (FlowBranching.Label): Likewise.
11353 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11354 (FlowBranching.AddBreakVector): New method.
11356 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11358 * attribute.cs: Small regression fix: only convert the type if we
11359 the type is different, fixes System.Drawing build.
11361 2004-04-27 Martin Baulig <martin@ximian.com>
11363 * attribute.cs (Attribute.Resolve): If we have a constant value
11364 for a named field or property, implicity convert it to the correct
11367 2004-04-27 Raja R Harinath <rharinath@novell.com>
11369 * statement.cs (Block.Block): Implicit blocks share
11370 'child_variable_names' fields with parent blocks.
11371 (Block.AddChildVariableNames): Remove.
11372 (Block.AddVariable): Mark variable as "used by a child block" in
11373 every surrounding block.
11374 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11375 been used in a child block, complain about violation of "Invariant
11376 meaning in blocks" rule.
11377 * cs-parser.jay (declare_local_variables): Don't use
11378 AddChildVariableNames.
11379 (foreach_statement): Don't create an implicit block: 'foreach'
11380 introduces a scope.
11382 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11384 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11385 converting from 0L to ulong. Fixes 57522.
11387 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11389 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11390 derived class hides via 'new' keyword field from base class (test-242.cs).
11391 TODO: Handle this in the more general way.
11393 * class.cs (CheckBase): Ditto.
11395 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11397 * decl.cs (caching_flags): New member for storing cached values
11399 (MemberCore.Flags): New enum where bit flags for caching_flags
11401 (MemberCore.cls_compliance): Moved to caching_flags.
11402 (DeclSpace.Created): Moved to caching_flags.
11404 * class.cs: Use caching_flags instead of DeclSpace.Created
11406 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11408 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11409 if we are only a derived class, not a nested class.
11411 * typemanager.cs: Same as above, but do this at the MemberLookup
11412 level (used by field and methods, properties are handled in
11413 PropertyExpr). Allow for the qualified access if we are a nested
11416 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11418 * class.cs: Refactoring.
11419 (IMethodData): New inteface; Holds links to parent members
11420 to avoid member duplication (reduced memory allocation).
11421 (Method): Implemented IMethodData interface.
11422 (PropertyBase): New inner classes for get/set methods.
11423 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11424 (Event): New inner classes for add/remove methods.
11425 (Event.DelegateMethod): Implemented IMethodData interface.
11427 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11428 EmitContext (related to class.cs refactoring).
11430 2004-04-21 Raja R Harinath <rharinath@novell.com>
11432 * delegate.cs (Delegate.VerifyApplicability): If the number of
11433 arguments are the same as the number of parameters, first try to
11434 verify applicability ignoring any 'params' modifier on the last
11438 2004-04-16 Raja R Harinath <rharinath@novell.com>
11440 * class.cs (TypeContainer.AddIndexer): Use
11441 'ExplicitInterfaceName' to determine if interface name was
11442 explicitly specified. 'InterfaceType' is not initialized at this time.
11443 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11444 Indexers array is already in the required order. Initialize
11445 'IndexerName' only if there are normal indexers.
11446 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11447 (TypeContainer.Emit): Emit DefaultMember attribute only if
11448 IndexerName is initialized.
11451 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11453 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11456 2004-04-15 Raja R Harinath <rharinath@novell.com>
11458 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11462 * attribute.cs (Attribute.Resolve): Check for duplicate named
11466 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11468 * iterators.cs (MarkYield): track whether we are in an exception,
11469 and generate code accordingly. Use a temporary value to store the
11470 result for our state.
11472 I had ignored a bit the interaction of try/catch with iterators
11473 since their behavior was not entirely obvious, but now it is
11474 possible to verify that our behavior is the same as MS .NET 2.0
11478 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11480 * iterators.cs: Avoid creating temporaries if there is no work to
11483 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11484 Enumerations, use TypeManager.EnumToUnderlying and call
11487 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11490 (This.Emit): Use EmitContext.EmitThis to emit our
11493 (This.EmitAssign): Ditto.
11495 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11496 codepaths, we will move all the functionality into
11499 (FieldExpr.EmitAssign): Ditto.
11501 This fixes several hidden bugs that I uncovered while doing a code
11502 review of this today.
11504 * codegen.cs (EmitThis): reworked so the semantics are more clear
11505 and also support value types "this" instances.
11507 * iterators.cs: Changed so that for iterators in value types, we
11508 do not pass the value type as a parameter.
11510 Initialization of the enumerator helpers is now done in the caller
11511 instead of passing the parameters to the constructors and having
11512 the constructor set the fields.
11514 The fields have now `assembly' visibility instead of private.
11516 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11518 * expression.cs (Argument.Resolve): Check if fields passed as ref
11519 or out are contained in a MarshalByRefObject.
11521 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11522 another compiler type.
11524 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11526 * class.cs (Indexer.Define): use the new name checking method.
11527 Also, return false on an error.
11528 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11529 (is_identifier_[start/part]_character): make static.
11531 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11533 * expression.cs (Binary.ResolveOperator): Do no append strings
11534 twice: since we can be invoked more than once (array evaluation)
11535 on the same concatenation, take care of this here. Based on a fix
11536 from Ben (bug #56454)
11538 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11540 * codegen.cs: Fix another case where CS1548 must be reported (when
11541 delay-sign isn't specified and no private is available #56564). Fix
11542 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11543 error when MCS is used on the MS runtime and we need to delay-sign
11544 (which seems unsupported by AssemblyBuilder - see #56621).
11546 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11548 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11549 (TypeManager.ComputeNamespaces): Faster implementation for
11552 * compiler.csproj: Updated AssemblyName to mcs.
11554 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11556 * rootcontext.cs: Add new types to the boot resolution.
11558 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11559 MulticastDelegate is not allowed.
11561 * typemanager.cs: Add new types to lookup: System.TypedReference
11564 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11565 check for TypedReference or ArgIterator, they are not allowed.
11567 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11568 makes us properly catch 1510 in some conditions (see bug 56016 for
11571 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11573 * CryptoConvert.cs: update from corlib version
11576 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11578 * class.cs (Indexer.Define): Check indexername declaration
11580 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11582 * attribute.cs (IsClsCompliant): Fixed problem with handling
11583 all three states (compliant, not-compliant, undetected).
11585 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11587 * attribute.cs (Attribute): Location is now public.
11588 (Resolve): Store resolved arguments (pos_values) in attribute class.
11589 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11590 (GetClsCompliantAttributeValue): New method that gets
11591 CLSCompliantAttribute value.
11592 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11593 if exists else null.
11594 (AttributeTester): New class for CLS-Compliant verification routines.
11596 * class.cs (Emit): Add CLS-Compliant verification.
11597 (Method.GetSignatureForError): Implemented.
11598 (Constructor.GetSignatureForError): Implemented
11599 (Constructor.HasCompliantArgs): Returns if constructor has
11600 CLS-Compliant arguments.
11601 (Constructor.Emit): Override.
11602 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11603 is needed to test only parameters.
11604 (FieldBase.GetSignatureForError): Implemented.
11605 (TypeContainer): New member for storing base interfaces.
11606 (TypeContainer.FindMembers): Search in base interfaces too.
11608 * codegen.cs (GetClsComplianceAttribute): New method that gets
11609 assembly or module CLSCompliantAttribute value.
11610 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11612 (ModuleClass.Emit): Add error 3012 test.
11614 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11616 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11617 state for all decl types.
11618 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11619 if CLS-Compliant tests are required.
11620 (IsClsCompliaceRequired): New method. Analyze whether code
11621 must be CLS-Compliant.
11622 (IsExposedFromAssembly): New method. Returns true when MemberCore
11623 is exposed from assembly.
11624 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11625 value or gets cached value.
11626 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11627 is explicitly marked with CLSCompliantAttribute.
11628 (IsIdentifierClsCompliant): New abstract method. This method is
11629 used to testing error 3005.
11630 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11631 for identifier and parameters CLS-Compliant testing.
11632 (VerifyClsCompliance): New method. The main virtual method for
11633 CLS-Compliant verifications.
11634 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11635 null. I don't know why is null (too many public members !).
11636 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11637 and get value of first CLSCompliantAttribute that found.
11639 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11640 (VerifyClsCompliance): Override and add extra tests.
11642 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11643 clscheck- disable CLS-Compliant verification event if assembly is has
11644 CLSCompliantAttribute(true).
11646 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11647 ApllyAttribute is now called in emit section as in the other cases.
11648 Possible future Emit integration.
11649 (IsIdentifierClsCompliant): New override.
11650 (VerifyClsCompliance): New override.
11651 (GetEnumeratorName): Returns full enum name.
11653 * parameter.cs (GetSignatureForError): Implemented.
11655 * report.cs (WarningData): New struct for Warning message information.
11656 (LocationOfPreviousError): New method.
11657 (Warning): New method. Reports warning based on the warning table.
11658 (Error_T): New method. Reports error based on the error table.
11660 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11661 verifications are done here.
11663 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11665 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11666 CLSCompliantAttribute.
11667 (all_imported_types): New member holds all imported types from other
11669 (LoadAllImportedTypes): New method fills static table with exported types
11670 from all referenced assemblies.
11671 (Modules): New property returns all assembly modules.
11673 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11675 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11676 throwing a parser error.
11678 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11679 which removes the hardcoded get_/set_ prefixes for properties, as
11680 IL allows for the properties to be named something else.
11684 * expression.cs: Do not override operand before we know if it is
11685 non-null. Fix 56207
11687 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11689 * typemanager.cs: support for pinned variables.
11691 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11693 * decl.cs, typemanager.cs: Avoid using an arraylist
11694 as a buffer if there is only one result set.
11696 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11698 * expression.cs: Make sure you cant call a static method
11699 with an instance expression, bug #56174.
11701 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11703 * class.cs (IsDuplicateImplementation): Improve error reporting to
11704 flag 663 (method only differs in parameter modifier).
11706 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11707 in preprocessor directives.
11709 * location.cs (LookupFile): Allow for the empty path.
11711 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11712 better approach for some of that patch, but its failing with the
11713 CharSet enumeration. For now try/catch will do.
11715 * typemanager.cs: Do not crash if a struct does not have fields.
11718 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11720 * expression.cs: cs0213, cant fix a fixed expression.
11723 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11725 * cs-parser.jay: detect invalid embeded statements gracefully.
11728 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11730 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11733 the invocation type may not be a subclass of the tye of the item/
11734 The type of the item must be a subclass of the invocation item.
11739 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11741 * attribute.cs: Added methods to get a string and a bool from an
11742 attribute. Required to information from AssemblyKeyFileAttribute,
11743 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11744 * codegen.cs: Modified AssemblyName creation to include support for
11745 strongnames. Catch additional exceptions to report them as CS1548.
11746 * compiler.csproj: Updated include CryptoConvert.cs.
11747 * compiler.csproj.user: Removed file - user specific configuration.
11748 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11749 Mono.Security assembly. The original class is maintained and tested in
11750 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11751 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11752 like CSC 8.0 (C# v2) supports.
11753 * Makefile: Added CryptoConvert.cs to mcs sources.
11754 * rootcontext.cs: Added new options for strongnames.
11756 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11758 * driver.cs: For --expect-error, report error code `2'
11759 if the program compiled with no errors, error code `1' if
11760 it compiled with an error other than the one expected.
11762 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11764 * compiler.csproj: Updated for Visual Studio .NET 2003.
11765 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11766 * compiler.sln: Updated for Visual Studio .NET 2003.
11768 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11770 * expression.cs: Fix bug #47234. We basically need to apply the
11771 rule that we prefer the conversion of null to a reference type
11772 when faced with a conversion to 'object' (csc behaviour).
11774 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11776 * statement.cs: Shorter form for foreach, eliminates
11777 a local variable. r=Martin.
11779 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11781 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11782 checks if we can use brtrue/brfalse to test for 0.
11783 * expression.cs: use the above in the test for using brtrue/brfalse.
11784 cleanup code a bit.
11786 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11788 * expression.cs: Rewrite string concat stuff. Benefits:
11790 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11791 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11792 rather than a concat chain.
11794 * typemanager.cs: Add lookups for more concat overloads.
11796 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11798 * expression.cs: Emit shorter il code for array init.
11815 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11817 * statement.cs: Before, two switch blocks would be merged if the
11818 total size of the blocks (end_item - begin_item + 1) was less than
11819 two times the combined sizes of the blocks.
11821 Now, it will only merge if after the merge at least half of the
11826 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11828 * class.cs : csc build fix for GetMethods(). See bug #52503.
11830 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11832 * expression.cs: Make sure fp comparisons work with NaN.
11833 This fixes bug #54303. Mig approved this patch a long
11834 time ago, but we were not able to test b/c the runtime
11837 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11839 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11841 2004-03-19 Martin Baulig <martin@ximian.com>
11843 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11844 error here and not in our caller.
11846 2004-03-19 Martin Baulig <martin@ximian.com>
11848 * interface.cs: Completely killed this file.
11849 (Interface): We're now a TypeContainer and live in class.cs.
11851 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11852 argument; we're now also called for interfaces.
11853 (TypeContainer.DefineMembers): Allow this method being called
11855 (TypeContainer.GetMethods): New public method; formerly known as
11856 Interface.GetMethod(). This is used by PendingImplementation.
11857 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11858 it's now private and non-static.
11859 (Interface): Moved this here; it's now implemented similar to
11861 (Method, Property, Event, Indexer): Added `bool is_interface'
11862 argument to their .ctor's.
11863 (MemberBase.IsInterface): New public field.
11865 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11866 instances instead of InterfaceMethod, InterfaceProperty, etc.
11867 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11868 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11870 2004-03-19 Martin Baulig <martin@ximian.com>
11872 * class.cs (MethodCore.IsDuplicateImplementation): New private
11873 method which does the CS0111 checking.
11874 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11875 Use IsDuplicateImplementation().
11877 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11879 * decl.cs (FindMemberToOverride): New method to find the correct
11880 method or property to override in the base class.
11882 - Make Method/Property use the above method to find the
11883 version in the base class.
11884 - Remove the InheritableMemberSignatureCompare as it is now
11887 This patch makes large code bases much faster to compile, as it is
11888 O(n) rather than O(n^2) to do this validation.
11890 Also, it fixes bug 52458 which is that nested classes are not
11891 taken into account when finding the base class member.
11893 Reviewed/Approved by Martin.
11895 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11897 * interface.cs: In all interface classes removed redundant
11898 member initialization.
11900 2004-03-16 Martin Baulig <martin@ximian.com>
11902 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11904 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11906 * decl.cs (DefineTypeAndParents): New helper method to define a
11907 type's containers before the type itself is defined; This is a
11908 bug exposed by the recent changes to Windows.Forms when an
11909 implemented interface was defined inside a class that had not been
11912 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11914 (Check): Loop correctly to report errors modifiers
11915 (UNSAFE was not in the loop, since it was the same as TOP).
11917 * interface.cs: Every interface member now takes a ModFlags,
11918 instead of a "is_new" bool, which we set on the base MemberCore.
11920 Every place where we called "UnsafeOk" in the interface, now we
11921 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11922 the unsafe settings from the member declaration instead of the
11923 container interface.
11925 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11927 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11928 `set_indexer_name' to the pending bits (one per type).
11930 We fixed a bug today that was picking the wrong method to
11931 override, since for properties the existing InterfaceMethod code
11932 basically ignored the method name. Now we make sure that the
11933 method name is one of the valid indexer names.
11935 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11937 * support.cs (SeekableStreamReader): Keep track of stream byte
11938 positions and don't mix them with character offsets to the buffer.
11940 Patch from Gustavo Giráldez
11942 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11944 * interface.cs (InterfaceSetGetBase): Removed double member
11945 initialization, base class does it as well.
11947 2004-03-13 Martin Baulig <martin@ximian.com>
11949 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11950 when compiling corlib.
11952 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11954 * convert.cs (ExplicitConversion): We were reporting an error on
11955 certain conversions (object_type source to a value type, when the
11956 expression was `null') before we had a chance to pass it through
11957 the user defined conversions.
11959 * driver.cs: Replace / and \ in resource specifications to dots.
11962 * class.cs: Add check for duplicate operators. Fixes 52477
11964 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11966 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11967 that are in the middle of the statements, not only at the end.
11970 * class.cs (TypeContainer.AddField): No longer set the
11971 `HaveStaticConstructor' flag, now we call it
11972 `UserDefineStaticConstructor' to diferentiate the slightly
11973 semantic difference.
11975 The situation is that we were not adding BeforeFieldInit (from
11976 Modifiers.TypeAttr) to classes that could have it.
11977 BeforeFieldInit should be set to classes that have no static
11982 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11984 And most importantly Zoltan's comment:
11986 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11988 "I think beforefieldinit means 'it's ok to initialize the type sometime
11989 before its static fields are used', i.e. initialization does not need
11990 to be triggered by the first access to the type. Setting this flag
11991 helps the JIT to compile better code, since it can run the static
11992 constructor at JIT time, and does not need to generate code to call it
11993 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11994 this flag for lots of classes like String.
11996 csc sets this flag if the type does not have an explicit static
11997 constructor. The reasoning seems to be that if there are only static
11998 initalizers for a type, and no static constructor, then the programmer
11999 does not care when this initialization happens, so beforefieldinit
12002 This bug prevents the AOT compiler from being usable, since it
12003 generates so many calls to mono_runtime_class_init that the AOT code
12004 is much slower than the JITted code. The JITted code is faster,
12005 because it does not generate these calls if the vtable is type is
12006 already initialized, which is true in the majority of cases. But the
12007 AOT compiler can't do this."
12009 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12011 * class.cs (MethodData.Emit): Refactor the code so symbolic
12012 information is generated for destructors; For some reasons we
12013 were taking a code path that did not generate symbolic information
12016 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12018 * class.cs: Create a Constructor.CheckBase method that
12019 takes care of all validation type code. The method
12020 contains some code that was moved from Define.
12022 It also includes new code that checks for duplicate ctors.
12023 This fixes bug #55148.
12025 2004-03-09 Joshua Tauberer <tauberer@for.net>
12027 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12028 a { ... }-style array creation invokes EmitStaticInitializers
12029 which is not good for reference-type arrays. String, decimal
12030 and now null constants (NullCast) are not counted toward
12031 static initializers.
12033 2004-03-05 Martin Baulig <martin@ximian.com>
12035 * location.cs (SourceFile.HasLineDirective): New public field;
12036 specifies whether the file contains or is referenced by a "#line"
12038 (Location.DefineSymbolDocuments): Ignore source files which
12039 either contain or are referenced by a "#line" directive.
12041 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12043 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12044 direct access to our parent, so check the method inline there.
12046 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12048 * expression.cs (Invocation.EmitCall): Miguel's last commit
12049 caused a regression. If you had:
12054 In Foo the implict this would be null.
12056 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12058 * expression.cs (Invocation.EmitCall): If the method is not
12059 virtual, do not emit a CallVirt to it, use Call.
12061 * typemanager.cs (GetFullNameSignature): Improve the method to
12062 cope with ".ctor" and replace it with the type name.
12064 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12065 as an argument the ConstructorBuilder where it is being defined,
12066 to catch the recursive constructor invocations.
12068 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12070 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12071 routines to check if a type is an enumerable/enumerator allow
12072 classes that implement the IEnumerable or IEnumerator interfaces.
12074 * class.cs (Property, Operator): Implement IIteratorContainer, and
12075 implement SetYields.
12077 (Property.Define): Do the block swapping for get_methods in the
12078 context of iterators. We need to check if Properties also
12079 include indexers or not.
12081 (Operator): Assign the Block before invoking the
12082 OperatorMethod.Define, so we can trigger the Iterator code
12085 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12086 Property and Operator classes are not created when we parse the
12087 declarator but until we have the block completed, so we use a
12088 singleton SimpleIteratorContainer.Simple to flag whether the
12089 SetYields has been invoked.
12091 We propagate this setting then to the Property or the Operator to
12092 allow the `yield' to function.
12094 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12096 * codegen.cs: Implemented attribute support for modules.
12097 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12098 Assembly/Module functionality.
12100 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12101 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12102 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12104 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12106 * interface.cs (FindMembers): The operation is performed on all base
12107 interfaces and not only on the first. It is required for future CLS Compliance patch.
12109 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12111 * statement.cs, codegen.cs:
12112 This patch deals with patterns such as:
12114 public class List : IEnumerable {
12116 public MyEnumerator GetEnumerator () {
12117 return new MyEnumerator(this);
12120 IEnumerator IEnumerable.GetEnumerator () {
12124 public struct MyEnumerator : IEnumerator {
12129 Before, there were a few things we did wrong:
12130 1) we would emit callvirt on a struct, which is illegal
12131 2) we emited ldarg when we needed to emit ldarga
12132 3) we would mistakenly call the interface methods on an enumerator
12133 type that derived from IEnumerator and was in another assembly. For example:
12135 public class MyEnumerator : IEnumerator
12137 Would have the interface methods called, even if there were public impls of the
12138 method. In a struct, this lead to invalid IL code.
12140 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12142 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12145 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12147 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12149 * cs-parser.jay: Fix small regression: we were not testing V2
12150 compiler features correctly.
12152 * interface.cs: If the emit context is null, then create one
12154 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12156 * decl.cs (GetSignatureForError): New virtual method to get full name
12157 for error messages.
12159 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12160 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12162 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12163 Duplicated members and code in these classes has been removed.
12164 Better encapsulation in these classes.
12166 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12168 * assign.cs (Assign.DoResolve): When dealing with compound
12169 assignments, there is a new rule in ECMA C# 2.4 (might have been
12170 there before, but it is documented here) that states that in:
12174 If b is of type int, and the `op' is a shift-operator, then the
12175 above is evaluated as:
12179 * expression.cs (Binary.ResolveOperator): Instead of testing for
12180 int/uint/long/ulong, try to implicitly convert to any of those
12181 types and use that in pointer arithmetic.
12183 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12184 method to print information for from the type, not from the
12185 null-method we were given.
12187 2004-02-01 Duncan Mak <duncan@ximian.com>
12189 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12190 parsing for cmd, fixes bug #53694.
12192 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12194 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12195 in the member name duplication tests. Property and operator name duplication
12196 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12198 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12200 * interface.cs (PopulateMethod): Fixed crash when interface method
12201 returns not existing type (error test cs0246-3.cs).
12203 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12205 * cs-parser.jay (interface_accessors): Re-write actions to also
12206 store attributes attached to get and set methods. Fix spelling
12209 (inteface_property_declaration): Modify accordingly.
12211 (InterfaceAccessorInfo): New helper class to store information to pass
12212 around between rules that use interface_accessors.
12214 * interface.cs (Emit): Apply attributes on the get and set
12215 accessors of properties and indexers too.
12217 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12218 right MethodBuilder when applying attributes to the get and set accessors.
12220 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12222 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12224 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12226 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12228 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12230 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12231 changes that treat `yield' specially when present before `break'
12232 or `return' tokens.
12234 * cs-tokenizer.cs: yield is no longer a keyword.
12236 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12238 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12239 setting for default constructors.
12240 For default constructors are almost every time set wrong Modifier. The
12241 generated IL code has been alright. But inside mcs this values was
12242 wrong and this was reason why several of my CLS Compliance tests
12245 2004-01-22 Martin Baulig <martin@ximian.com>
12247 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12248 not a QualifiedIdentifier. This is what `type_name_expression'
12249 was previously doing.
12250 (type_name_expression): Removed; the code is now in
12251 `namespace_or_type_name'.
12252 (qualified_identifier): Removed, use `namespace_or_type_name'
12254 (QualifiedIdentifier): Removed this class.
12256 2004-01-22 Martin Baulig <martin@ximian.com>
12258 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12259 not a string as alias name.
12261 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12263 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12264 #52730 bug, and instead compute correctly the need to use a
12265 temporary variable when requesting an address based on the
12266 static/instace modified of the field and the constructor.
12268 2004-01-21 Martin Baulig <martin@ximian.com>
12270 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12271 class and namespace before looking up aliases. Fixes #52517.
12273 2004-01-21 Martin Baulig <martin@ximian.com>
12275 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12276 assinged in a 'try'; fixes exception4.cs.
12278 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12279 * class.cs : Implemented parameter-less constructor for TypeContainer
12281 * decl.cs: Attributes are now stored here. New property OptAttributes
12283 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12285 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12287 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12289 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12290 (CSharpSignature): New method for indexer and property signature.
12292 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12294 * pending.cs (IsVirtualFilter): Faster implementation.
12296 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12298 * typemanager.cs: Avoid inclusion of same assembly more than once.
12300 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12302 * cs-parser.jay: Fixed problem where the last assembly attribute
12303 has been applied also to following declaration (class, struct, etc.)
12305 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12307 * class.cs: Added error CS0538, CS0539 reporting.
12308 Fixed crash on Microsoft runtime when field type is void.
12310 * cs-parser.jay: Added error CS0537 reporting.
12312 * pending.cs: Added error CS0535 reporting.
12313 Improved error report for errors CS0536, CS0534.
12315 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12317 Merge a few bits from the Anonymous Method MCS tree.
12319 * statement.cs (ToplevelBlock): New class for toplevel methods,
12320 will hold anonymous methods, lifted variables.
12322 * cs-parser.jay: Create toplevel blocks for delegates and for
12323 regular blocks of code.
12325 2004-01-20 Martin Baulig <martin@ximian.com>
12327 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12328 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12329 and `NeedExplicitReturn'; added `IsLastStatement'.
12330 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12331 have a `ReturnLabel' or we're not unreachable.
12333 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12334 child's reachability; don't just override ours with it. Fixes
12335 #58058 (lluis's example).
12336 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12337 InFinally(), InLoop(), InSwitch() and
12338 BreakCrossesTryCatchBoundary() methods.
12340 * statement.cs (Return): Do all error checking in Resolve().
12341 Unless we are the last statement in a top-level block, always
12342 create a return label and jump to it.
12343 (Break, Continue): Do all error checking in Resolve(); also make
12344 sure we aren't leaving a `finally'.
12345 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12346 statement in a top-level block.
12347 (Block.Flags): Added `IsDestructor'.
12348 (Block.IsDestructor): New public property.
12350 2004-01-20 Martin Baulig <martin@ximian.com>
12352 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12354 2004-01-20 Martin Baulig <martin@ximian.com>
12356 * statement.cs (Statement.ResolveUnreachable): New public method.
12357 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12358 (Block.Resolve): Resolve unreachable statements.
12360 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12362 * expression.cs: We need to fix the case where we do
12363 not have a temp variable here.
12365 * assign.cs: Only expression compound assignments need
12366 temporary variables.
12368 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12370 * flowanalysis.cs: Reduce memory allocation in a few ways:
12371 - A block with no variables should not allocate a bit
12373 - A method with no out parameters does not need any tracking
12374 for assignment of the parameters, so we need not allocate
12377 public readonly Type[] VariableTypes;
12378 public readonly string[] VariableNames;
12379 Are redundant. The data is already stored in the variable
12380 map, so we need not allocate another array for it.
12381 - We need to add alot of checks for if (params | locals) == null
12382 due to the first two changes.
12384 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12386 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12387 implement IMemoryLocation, we store a copy on a local variable and
12388 take the address of it. Patch from Benjamin Jemlich
12390 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12391 to use a special "type_name_expression" rule which reduces the
12392 number of "QualifiedIdentifier" classes created, and instead
12393 directly creates MemberAccess expressions.
12395 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12397 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12398 that fixes #52853. Null literal assignment to ValueType
12400 * class.cs (MethodData.Emit): Instead of checking the name of the
12401 method to determine if its a destructor, create a new derived
12402 class from Method called Destructor, and test for that.
12404 * cs-parser.jay: Create a Destructor object instead of a Method.
12406 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12410 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12412 * expression.cs (Binary.ResolveOperator): Perform an implicit
12413 conversion from MethodGroups to their delegate types on the
12414 Addition operation.
12416 * delegate.cs: Introduce a new class DelegateCreation that is the
12417 base class for `NewDelegate' and `ImplicitDelegateCreation',
12418 factor some code in here.
12420 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12421 conversion from MethodGroups to compatible delegate types.
12423 * ecore.cs (Expression.Resolve): Do not flag error 654
12424 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12425 we allow conversions from MethodGroups to delegate types now.
12427 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12428 assignments in v2 either.
12430 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12432 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12433 static read-only fields in ctors.
12435 Applied patch from Benjamin Jemlich
12437 * expression.cs (UnaryMutator): Avoid leaking local variables.
12439 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12441 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12442 here to return true, as they can be used like this:
12444 (XXX) int.MEMBER ()
12446 Fixed 49836 and all the other dups
12448 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12450 * driver.cs: Implement /win32res and /win32icon.
12452 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12454 * cs-parser.jay: Add a rule to improve error handling for the
12455 common mistake of placing modifiers after the type.
12457 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12459 * cs-parser.jay (interface_event_declaration): Catch
12460 initialization of events on interfaces, and report cs0068
12462 * cs-parser.jay (interface_event_declaration): Catch
12463 initialization of events.
12465 * ecore.cs: Better report missing constructors.
12467 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12468 the error reporting done in the wrong place. Fix.
12470 * expression.cs (Binary.ResolveOperator): Catch the
12471 operator + (E x, E y) error earlier, and later allow for implicit
12472 conversions in operator +/- (E e, U x) from U to the underlying
12475 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12476 52596, if the container class is abstract, the default constructor
12477 is protected otherwise its public (before, we were always public).
12479 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12482 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12483 Jemlich that fixes bug #52597, MCS was generating invalid code for
12484 idisposable structs. Thanks to Ben for following up with this
12487 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12489 * driver.cs: Allow assemblies without code to be generated, fixes
12492 2004-01-07 Nick Drochak <ndrochak@gol.com>
12494 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12496 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12498 * cs-parser.jay: Add rules to improve error reporting if fields or
12499 methods are declared at the namespace level (error 116)
12501 * Add rules to catch event add/remove
12503 2004-01-04 David Sheldon <dave-mono@earth.li>
12505 * expression.cs: Added matching ")" to error message for
12508 2004-01-03 Todd Berman <tberman@gentoo.org>
12510 * ecore.cs, attribute.cs:
12511 Applying fix from #52429.
12513 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12515 * ecore.cs, expression.cs, statement.cs:
12516 Total rewrite of how we handle branching. We
12517 now handle complex boolean expressions with fewer
12518 jumps. As well if (x == 0) no longer emits a ceq.
12520 if (x is Foo) is much faster now, because we generate
12523 Overall, we get a pretty big improvement on our benchmark
12524 tests. The code we generate is smaller and more readable.
12526 I did a full two-stage bootstrap. The patch was reviewed
12527 by Martin and Miguel.
12529 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12531 * cs-parser.jay: Make primary_expression not take a QI.
12532 we dont need this because the member_access rule covers
12533 us here. So we replace the rule with just IDENTIFIER.
12535 This has two good effects. First, we remove a s/r conflict.
12536 Second, we allocate many fewer QualifiedIdentifier objects.
12538 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12540 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12541 set the correct information via SRE. This prevents
12542 hanging on the MS runtime. Fixes #29374.
12544 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12546 * convert.cs: correctly handle conversions to value types
12547 from Enum and ValueType as unboxing conversions.
12549 Fixes bug #52569. Patch by Benjamin Jemlich.
12551 2004-01-02 Ravi Pratap <ravi@ximian.com>
12553 * expression.cs (BetterConversion): Prefer int -> uint
12554 over int -> ulong (csc's behaviour). This fixed bug #52046.
12556 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12558 * decl.cs (MemberCache.FindMembers): now returns a
12561 * typemanager.cs: In general, go with with ^^.
12562 (CopyNewMethods): take an IList.
12563 (RealMemberLookup): Only allocate an arraylist
12564 if we copy from two sets of methods.
12566 This change basically does two things:
12567 1) Fewer array lists allocated due to CopyNewMethods.
12568 2) the explicit cast in MemberList costed ALOT.
12570 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12572 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12573 a hashtable to avoid needless string allocations when an identifier is
12574 used more than once (the common case).
12576 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12578 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12579 is broken, it will not return anything. So, we
12580 have to use the information we have in mcs to
12583 * typemanager.cs: Add a cache for GetInterfaces,
12584 since this will now be used more often (due to ^^)
12586 (GetExplicitInterfaces) New method that gets the
12587 declared, not effective, interfaces on a type
12588 builder (eg, if you have interface IFoo, interface
12589 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12592 This patch makes MCS able to bootstrap itself on
12595 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12597 * expression.cs: Remove the Nop's that Miguel put
12600 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12602 * report.cs, codegen.cs: Give the real stack trace to
12603 the error when an exception is thrown.
12605 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12607 * decl.cs: only allocate hashtables for ifaces if
12610 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12612 * expression.cs: fix the error from cs0121-2.cs
12613 (a parent interface has two child interfaces that
12614 have a function with the same name and 0 params
12615 and the function is called through the parent).
12617 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12619 * class.cs, rootcontext.cs, typmanager.cs: do not
12622 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12624 * codegen.cs: remove stack for the ec flow branching.
12625 It is already a linked list, so no need.
12627 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12629 * Makefile: Allow custom profiler here.
12631 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12633 * typemanager.cs (LookupType):
12634 - Use a static char [], because split takes
12635 a param array for args, so it was allocating
12637 - Do not store true in a hashtable, it boxes.
12639 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12641 * flowanalysis.cs: bytify common enums.
12643 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12645 * modifiers.cs: Add a new set of flags for the
12646 flags allowed on explicit interface impls.
12647 * cs-parser.jay: catch the use of modifiers in
12648 interfaces correctly.
12649 * class.cs: catch private void IFoo.Blah ().
12651 All related to bug #50572.
12653 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12655 * decl.cs: Rewrite the consistant accessability checking.
12656 Accessability is not linear, it must be implemented in
12657 a tableish way. Fixes #49704.
12659 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12661 * expression.cs: Handle negation in a checked context.
12662 We must use subtraction from zero. Fixes #38674.
12664 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12666 * class.cs: Ignore static void main in DLLs.
12667 * rootcontext.cs: Handle the target type here,
12668 since we are have to access it from class.cs
12669 * driver.cs: account for the above.
12671 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12673 * report.cs: Give line numbers and files if available.
12675 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12677 * driver.cs: Implement /addmodule.
12679 * typemanager.cs: Change 'modules' field so it now contains Modules not
12682 2003-12-20 Martin Baulig <martin@ximian.com>
12684 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12685 (FieldBase.IsAssigned): Removed this field.
12686 (FieldBase.SetAssigned): New public method.
12687 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12689 2003-12-20 Martin Baulig <martin@ximian.com>
12691 * expression.cs (LocalVariableReference.DoResolve): Don't set
12692 `vi.Used' if we're called from DoResolveLValue().
12694 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12695 returns the usage vector it just merged into the current one -
12696 pass this one to UsageWarning().
12697 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12698 of the `EmitContext', don't call this recursively on our children.
12700 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12702 * driver.cs: Implement /target:module.
12704 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12706 * support.cs (CharArrayHashtable): New helper class.
12708 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12709 char arrays, not strings, so we can avoid creating a string in
12710 consume_identifier if the identifier is a keyword.
12712 2003-12-16 Martin Baulig <martin@ximian.com>
12714 * statement.cs (LocalInfo.Assigned): Removed this property.
12715 (LocalInfo.Flags): Removed `Assigned'.
12716 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12717 and uses flow analysis.
12718 (Block.UsageWarning): Made this method private.
12719 (Block.Resolve): Call UsageWarning() if appropriate.
12721 * expression.cs (LocalVariableReference.DoResolve): Always set
12722 LocalInfo.Used here.
12724 2003-12-13 Martin Baulig <martin@ximian.com>
12726 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12727 any value here; we're now using flow analysis to figure out
12728 whether a statement/block returns a value.
12730 2003-12-13 Martin Baulig <martin@ximian.com>
12732 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12734 (FlowBranching.MergeFinally): Don't call
12735 `branching.CheckOutParameters()' here, this is called in
12737 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12738 when adding the `finally' vector.
12740 2003-12-13 Martin Baulig <martin@ximian.com>
12743 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12744 actually work and also fix #48962.
12746 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12748 * decl.cs: Do not check System.Object for nested types,
12749 since we know it does not have any. Big bang for buck:
12752 Run 1: 8.35 seconds
12753 Run 2: 8.32 seconds
12754 corlib: 17.99 seconds
12756 Run 1: 8.17 seconds
12757 Run 2: 8.17 seconds
12758 corlib: 17.39 seconds
12760 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12762 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12763 time we are returning 0 members, so we save alot here.
12765 2003-12-11 Martin Baulig <martin@ximian.com>
12767 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12768 `MergeChild()', also just take the `FlowBranching' as argument;
12769 call Merge() on it and return the result.
12770 (FlowBranching.Merge): We don't need to do anything if we just
12773 2003-12-11 Martin Baulig <martin@ximian.com>
12775 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12776 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12777 Maurer for this idea.
12779 2003-12-11 Martin Baulig <martin@ximian.com>
12781 * flowanalysis.cs (MergeResult): This class is now gone; we now
12782 use the `UsageVector' for this. The reason for this is that if a
12783 branching just has one sibling, we don't need to "merge" them at
12784 all - that's the next step to do.
12785 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12788 2003-12-11 Martin Baulig <martin@ximian.com>
12790 Reworked flow analyis and made it more precise and bug-free. The
12791 most important change is that we're now using a special `Reachability'
12792 class instead of having "magic" meanings of `FlowReturns'. I'll
12793 do some more cleanups and optimizations and also add some more
12794 documentation this week.
12796 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12797 largely reworked this class.
12798 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12799 the new `Reachability' class instead of having "magic" values here.
12800 (FlowBranching): We're now using an instance of `Reachability'
12801 instead of having separate `Returns', `Breaks' etc. fields.
12803 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12804 based on flow analysis; ignore the return value of block.Emit ().
12806 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12808 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12809 if they are private.
12811 2003-12-09 Martin Baulig <martin@ximian.com>
12813 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12814 call them directly on the UsageVector.
12816 2003-12-09 Martin Baulig <martin@ximian.com>
12818 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12819 Changed return type from `FlowReturns' to `Reachability'.
12821 2003-12-09 Martin Baulig <martin@ximian.com>
12823 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12824 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12825 `Reachable' fields with a single `Reachability' one.
12827 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12829 * class.cs (FindMembers): Remove foreach's.
12834 Run 1: 8.74 seconds
12835 Run 2: 8.71 seconds
12838 Run 1: 8.64 seconds
12839 Run 2: 8.58 seconds
12842 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12847 This patch does a few things:
12848 1. EmptyStatement is now a singleton, so it is never reallocated.
12849 2. All blah is EmptyStatement constructs have been changed to
12850 blah == EmptyStatement.Value, which is much faster and valid
12851 now that EmptyStatement is a singleton.
12852 3. When resolving a block, rather than allocating a new array for
12853 the non-empty statements, empty statements are replaced with
12854 EmptyStatement.Value
12855 4. Some recursive functions have been made non-recursive.
12856 Mainly the performance impact is from (3), however (1) and (2) are needed for
12857 this to work. (4) does not make a big difference in normal situations, however
12858 it makes the profile look saner.
12863 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12864 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12865 Total memory allocated: 56397 KB
12868 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12869 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12870 Total memory allocated: 55666 KB
12872 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12874 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12875 than the hashtable in a hashtable version
12877 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12878 we always end up concating a string. This results in a huge perf
12879 loss, because many strings have to be tracked by the GC. In this
12880 patch, we first use a hashtable that works with two keys, so that
12881 the strings do not need to be concat'ed.
12885 Run 1: 8.74 seconds
12886 Run 2: 8.71 seconds
12889 Run 1: 8.65 seconds
12890 Run 2: 8.56 seconds
12892 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12894 * Makefile: Add a new target `do-time' that does a quick and simple
12895 profile, leaving easy to parse output.
12897 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12899 * codegen.cs (Init): Create the dynamic assembly with
12900 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12902 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12904 * support.cs: Make the PtrHashtable use only one
12905 instance of its comparer.
12907 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12909 * typemanager.cs: Fix lookup of GetNamespaces.
12911 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12913 * expression.cs: Removed redundant line.
12915 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12916 ArrayLists, use for loops with bounds.
12918 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12921 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12922 arraylists, use for loop with bounds.
12924 The above three changes give us a 0.071 second performance
12925 improvement out of 3.294 seconds down to 3.223. On my machine
12926 the above changes reduced the memory usage by 1,387 KB during
12927 compiler bootstrap.
12929 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12930 QualifiedIdentifiers. Before we created a new string through
12931 concatenation, and mostly later on, the result would be
12932 manipulated by DecomposeQI through string manipulation.
12934 This reduced the compiler memory usage for bootstrapping from
12935 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12936 compile times in 0.05 seconds.
12938 2003-11-28 Dick Porter <dick@ximian.com>
12940 * support.cs: Do string compares with the Invariant culture.
12948 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12949 the comparison is done with the Invariant culture.
12951 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12953 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12954 GetEnumerator method.
12956 (ProbeCollectionType): Iterate starting at the most specific type
12957 upwards looking for a GetEnumerator
12959 * expression.cs: Shift count can be up to 31 for int/uint and 63
12962 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12964 * statement.cs (Block.LookupLabel): Also look for the label on the
12965 children blocks. Use a hash table to keep track of visited
12968 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12969 we actually did transform the other operand, otherwise fall back
12970 to the common codepath that casts to long.
12972 * cs-tokenizer.cs: Use the same code pattern as the int case.
12973 Maybe I should do the parsing myself, and avoid depending on the
12974 Parse routines to get this done.
12976 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12978 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12979 which fixes bug 51347. This time test it.
12981 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12982 attributes for example can not tell the difference between these.
12983 The difference was only a syntax feature of the language.
12985 * attribute.cs: Apply attributes to delegates.
12987 * delegate.cs: Call the apply attributes method.
12989 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12991 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12992 comparing 0 vs Byte.MinValue, not the value
12994 (ImplicitConversionRequired): When reporting a conversion error,
12995 use error 31 to print out the constant error instead of the
12998 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12999 which fixes bug 51347.
13001 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13003 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13004 which fixes the -warnaserror command line option.
13006 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13008 * cfold.cs (DoNumericPromotions): During constant folding of
13009 additions on UIntConstant, special case intconstants with
13010 IntConstants like we do on the expression binary operator.
13012 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13014 * convert.cs (ImplicitReferenceConversion): We were missing a case
13015 (System.Enum are not value types or class types, so we need to
13016 classify them separatedly).
13018 * driver.cs: We do not support error 2007.
13020 2003-11-12 Jackson Harper <jackson@ximian.com>
13022 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13023 system directory. Also use the full file name so users can
13024 libraries names mscorlib-o-tron.dll in a non system dir.
13026 2003-11-10 Martin Baulig <martin@ximian.com>
13028 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13029 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13030 calling `ResolveType()' on them, directly assign their `Type'.
13032 2003-11-08 Martin Baulig <martin@ximian.com>
13034 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13035 return value and the `out parent' parameter.
13036 (TypeContainer.DefineType): Moved the CS0644 check into
13037 GetClassBases(). Don't pass the interface types to the
13038 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13039 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13041 * ecore.cs (TypeExpr.IsAttribute): New property.
13042 (TypeExpr.GetInterfaces): New method.
13044 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13045 TypeExpr instead of a Type.
13046 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13047 (Interface.DefineType): Don't pass the interface types to the
13048 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13049 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13051 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13052 instead of a `Type[]'.
13053 (TypeManager.RegisterBuilder): Likewise.
13054 (TypeManager.AddUserInterface): Likewise.
13055 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13056 `Type[]' and also return a `TypeExpr[]'.
13057 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13059 2003-11-08 Martin Baulig <martin@ximian.com>
13061 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13064 2003-11-08 Martin Baulig <martin@ximian.com>
13066 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13067 TypeManager.ResolveExpressionTypes().
13069 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13070 instead of an Expression.
13071 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13072 (TypeExpression): New public class; formerly known as `TypeExpr'.
13074 * expression.cs (ComposedCast): Derive from TypeExpr.
13076 * typemanager.cs (TypeManager.system_*_expr): These are now
13077 TypExpr's instead of Expression's.
13078 (TypeManager.ResolveExpressionTypes): New public static function;
13079 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13082 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13084 * expression.cs (New.DoResolve): Do not dereference value that
13085 might be a null return.
13087 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13088 sure that the constant value has the right type. Fixes an
13089 unreported bug, similar to 50425.
13091 * const.cs (Const.LookupConstantValue): Call
13092 ImplicitStandardConversionExists before doing a conversion to
13093 avoid havng the TypeManager.ChangeType do conversions.
13095 Reduced the number of casts used
13097 (Const.ChangeType): New routine to enable reuse of the constant
13098 type changing code from statement.
13100 * typemanager.cs (ChangeType): Move common initialization to
13101 static global variables.
13105 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13106 every value type to go through, even if it was void. Fix that.
13108 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13109 character of the define, and the is_identifier_part_character for
13110 the rest of the string.
13112 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13114 * expression.cs (UnaryMutator.EmitCode): When I updated
13115 LocalVariableReference.DoResolve, I overdid it, and dropped an
13116 optimization done on local variable references.
13118 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13120 * ecore.cs: Convert the return from Ldlen into an int.
13122 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13124 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13125 the accessibility, this is a special case for toplevel non-public
13126 classes (internal for instance).
13128 2003-10-20 Nick Drochak <ndrochak@gol.com>
13130 * ecore.cs: Fix typo and build. Needed another right paren.
13132 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13134 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13135 `internal' case regular and protected, but not allowing protected
13136 to be evaluated later. Bug 49840
13138 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13140 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13141 to kb.Nlast, and not the kb.nFirst to isolate the switch
13144 Extract the underlying type, so enumerations of long/ulong are
13145 treated like long/ulong.
13147 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13149 * expression.cs (New): Overload the meaning of RequestedType to
13150 track the possible creation of the NewDelegate type, since
13151 DoResolve is invoked more than once for new constructors on field
13154 See bugs: #48800 and #37014
13156 * cs-parser.jay (declare_local_constants): Take an arraylist
13157 instead of a single constant.
13159 (local_constant_declaration): It should take a
13160 constant_declarators, not a constant_declarator. Fixes 49487
13162 * convert.cs: Fix error report.
13164 2003-10-13 Jackson Harper <jackson@ximian.com>
13166 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13169 2003-10-09 Martin Baulig <martin@ximian.com>
13171 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13173 (MethodCore.DoDefineParameters): Removed the TypeContainer
13174 argument; use the DeclSpace which was passed to the .ctor instead.
13175 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13176 TypeContainer; we only need a DeclSpace here.
13178 2003-10-09 Martin Baulig <martin@ximian.com>
13180 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13182 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13183 EmitContext's .ctor.
13185 2003-10-09 Martin Baulig <martin@ximian.com>
13187 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13188 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13189 AsAccessible(), moved them as well.
13191 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13193 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13195 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13197 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13199 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13200 generation for >=, as spotted by Paolo, bug 48679.
13201 Patch from David Waite.
13203 * cs-tokenizer.cs: Add handling for #pragma.
13205 * cs-parser.jay: Allow for both yield and yield return in the
13206 syntax. The anti-cobolization of C# fight will go on!
13208 * class.cs (TypeBuilder.DefineType): Catch error condition here
13209 (Parent.DefineType erroring out and returning null).
13211 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13212 coping with enumerations variables, we were mistakenly processing
13213 them as a regular value type instead of built-in types. Fixes the
13216 * typemanager.cs (IsBuiltinOrEnum): New method.
13218 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13220 * cs-parser.jay: Upgrade: yield now needs the return clause.
13222 2003-09-19 Martin Baulig <martin@ximian.com>
13224 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13225 `MemberCache parent' argument. Normally, an interface doesn't
13226 have a parent type except System.Object, but we use this in gmcs
13227 for generic type parameters.
13229 2003-09-18 Martin Baulig <martin@ximian.com>
13231 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13232 on `type.IsInterface'; don't check whether the type has a parent
13233 to determine whether it's an interface.
13235 2003-09-15 Martin Baulig <martin@ximian.com>
13237 * class.cs (TypeContainer.DefineType): Added an error flag to
13238 avoid reporting duplicate CS0146's ("class definition is
13241 * driver.cs (Driver.MainDriver): Abort if
13242 RootContext.ResolveTree() reported any errors.
13244 2003-09-07 Martin Baulig <martin@ximian.com>
13246 * report.cs (Error, Warning): Added overloaded versions which take
13247 a `params object[] args' and call String.Format().
13249 2003-09-07 Martin Baulig <martin@ximian.com>
13251 * decl.cs (DeclSpace..ctor): Don't call
13252 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13253 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13254 (DeclSpace.RecordDecl): New method.
13256 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13258 2003-09-02 Ravi Pratap <ravi@ximian.com>
13260 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13261 value attributes to be applied to ParameterBuilders.
13263 * class.cs (MethodCore.LabelParameters): Make static and more
13264 generic so that it can be used from other places - like interface
13265 methods, for instance.
13267 * interface.cs (Interface.Emit): Call LabelParameters before
13268 emitting attributes on the InterfaceMethod.
13270 2003-08-26 Martin Baulig <martin@ximian.com>
13272 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13273 resolving aliases; fixes #47927.
13275 2003-08-26 Martin Baulig <martin@ximian.com>
13277 * statement.cs (Using.DoResolve): This is internally emitting a
13278 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13279 do not always return. Fixes #47681.
13281 2003-08-26 Martin Baulig <martin@ximian.com>
13283 * decl.cs (MemberCore): Moved WarningNotHiding(),
13284 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13286 (AdditionResult): Make this nested in DeclSpace.
13287 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13288 argument; call NamespaceEntry.Define() unless we're nested in a
13291 * namespace.cs (Namespace.DefineName): New public function. This
13292 is called from DeclSpace's .ctor to add
13293 (Namespace.Lookup): Include DeclSpaces in the lookup.
13295 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13297 * const.cs (Const): Derive from MemberBase, not MemberCore.
13299 2003-08-25 Martin Baulig <martin@ximian.com>
13301 * convert.cs (Convert.ExplicitReferenceConversion): When
13302 converting from an interface type to a class, unbox if the target
13303 type is a struct type. Fixes #47822.
13305 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13307 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13310 2003-08-22 Martin Baulig <martin@ximian.com>
13312 * class.cs (TypeManager.DefineType): When defining a nested type,
13313 call DefineType() on our parent; fixes #47801.
13315 2003-08-22 Martin Baulig <martin@ximian.com>
13317 * class.cs (MethodData.Define): While checking if a method is an
13318 interface implementation, improve the test a bit more to fix #47654.
13320 2003-08-22 Martin Baulig <martin@ximian.com>
13322 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13323 correctly; fixes #47722.
13325 2003-08-22 Martin Baulig <martin@ximian.com>
13327 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13328 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13330 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13332 2003-08-22 Martin Baulig <martin@ximian.com>
13334 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13335 can only be assigned in static constructors. Fixes #47161.
13337 2003-08-22 Martin Baulig <martin@ximian.com>
13339 Rewrote and improved the flow analysis code.
13341 * flowbranching.cs (FlowBranching): Make this class abstract.
13342 (FlowBranching.CreateBranching): New static function to create a
13343 new flow branching.
13344 (FlowBranchingBlock, FlowBranchingException): New classes.
13345 (FlowBranching.UsageVector.Type): New public readonly field.
13346 (FlowBranching.UsageVector.Breaks): Removed the setter.
13347 (FlowBranching.UsageVector.Returns): Removed the setter.
13348 (FlowBranching.UsageVector): Added Break(), Return(),
13349 NeverReachable() and Throw() methods to modify the reachability.
13350 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13351 done by FlowBranching.Merge().
13352 (FlowBranching.UsageVector.MergeChild): New method; merges the
13353 merge result into the current vector.
13354 (FlowBranching.Merge): New abstract method to merge a branching.
13356 2003-08-12 Martin Baulig <martin@ximian.com>
13358 * expression.cs (Indirection.CacheTemporaries): Create the
13359 LocalTemporary with the pointer type, not its element type.
13361 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13363 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13364 token was a keyword or not.
13366 Add `error' options where an IDENTIFIER was expected; Provide
13367 CheckToken and CheckIdentifierToken convenience error reporting
13370 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13372 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13373 NameSpaceEntry NameSpaceEntry.
13375 (LookupInterfaceOrClass): Avoid creating a full qualified name
13376 from namespace and name: avoid doing lookups when we know the
13377 namespace is non-existant. Use new Tree.LookupByNamespace which
13378 looks up DeclSpaces based on their namespace, name pair.
13380 * driver.cs: Provide a new `parser verbose' to display the
13381 exception thrown during parsing. This is turned off by default
13382 now, so the output of a failure from mcs is more graceful.
13384 * namespace.cs: Track all the namespaces defined in a hashtable
13387 (IsNamespace): New method
13389 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13391 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13392 we know that we need to concatenate (full typename can never be
13397 * statement.cs: Use a bitfield; Do not initialize to null things
13398 which are done by the constructor by default.
13400 * cs-parser.jay: bug fix, parameter was 4, not 3.
13402 * expression.cs: Just use the property;
13404 * statement.cs: No need for GetVariableInfo method.
13406 2003-08-08 Martin Baulig <martin@ximian.com>
13408 * flowanalysis.cs (FlowReturns): This is now nested in the
13409 `FlowBranching' class.
13410 (MyBitVector): Moved this here from statement.cs.
13411 (FlowBranching.SiblingType): New enum type.
13412 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13414 2003-08-07 Martin Baulig <martin@ximian.com>
13416 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13417 `FlowBranching' class and called `BranchingType'.
13419 2003-08-07 Martin Baulig <martin@ximian.com>
13421 * flowanalysis.cs: Moved all the control flow analysis code into
13424 2003-08-07 Martin Baulig <martin@ximian.com>
13426 * assign.cs (Assign.DoResolve): `target' must either be an
13427 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13430 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13432 * expression.cs (BinaryMethod): This kind of expression is created by the
13433 Binary class if it determines that the operator has to be handled
13436 (BinaryDelegate): This kind of expression is created if we are
13437 dealing with a + or - operator on delegates.
13439 (Binary): remove method, argumetns, and DelegateOperator: when
13440 dealing with methods,
13442 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13444 * statement.cs (Block): use bitfields for the three extra booleans
13445 we had in use. Remove unused topblock parameter.
13447 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13449 * assign.cs: Drop extra unneeded tests.
13451 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13453 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13455 * statement.cs (Foreach): Use VariableStorage instead of
13458 * codegen.cs (VariableStorage): New class used by clients that
13459 require a variable stored: locals or fields for variables that
13460 need to live across yield.
13462 Maybe provide a convenience api for EmitThis+EmitLoad?
13464 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13467 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13469 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13470 RemapParameterLValue): New methods that are used to turn a
13471 precomputed FieldInfo into an expression like this:
13475 The idea is to use this instead of making LocalVariableReference
13476 have more than one meaning.
13478 * cs-parser.jay: Add error production to BASE.
13480 * ecore.cs: Deal with TypeManager.GetField returning null, which
13481 is now a valid return value.
13483 (FieldExprNoAddress): New expression for Fields whose address can
13486 * expression.cs (LocalVariableReference): During the resolve
13487 phases, create new expressions if we are in a remapping context.
13488 Remove code that dealt with remapping here.
13490 (ParameterReference): same.
13492 (ProxyInstance): New expression, like the `This' expression, but
13493 it is born fully resolved. We know what we are doing, so remove
13494 the errors that are targeted to user-provided uses of `this'.
13496 * statement.cs (Foreach): our variable is now stored as an
13497 Expression; During resolution, follow the protocol, dont just
13498 assume it will return this.
13500 2003-08-06 Martin Baulig <martin@ximian.com>
13502 * support.cs (SeekableStreamReader.cs): New public class.
13504 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13505 SeekableStreamReader instead of the normal StreamReader.
13507 2003-08-04 Martin Baulig <martin@ximian.com>
13509 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13510 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13511 deambiguate casts and delegate invocations.
13512 (parenthesized_expression): Use the new tokens to ensure this is
13513 not a cast of method invocation.
13515 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13516 when reading a `)' and Deambiguate_CloseParens () was previously
13519 * expression.cs (ParenthesizedExpression): New class. This is
13520 just used for the CS0075 test.
13521 (Binary.DoResolve): Check for CS0075.
13523 2003-07-29 Ravi Pratap <ravi@ximian.com>
13525 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13526 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13527 reference comparison.
13529 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13530 examine the ReturnType for equality - this is necessary in the
13531 cases of implicit and explicit operators whose signature also
13532 includes the return type.
13534 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13536 * namespace.cs: Cache the result of the namespace computation,
13537 instead of computing it every time.
13539 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13541 * decl.cs: Use a global arraylist that we reuse over invocations
13542 to avoid excesive memory consumption. Reduces memory usage on an
13543 mcs compile by one meg (45 average).
13545 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13546 private, work around that.
13548 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13550 * literal.cs (IntLiteral): Define Zero and One static literals.
13552 * cs-parser.jay (integer_literal): use static literals to reduce
13553 memory usage for the most used literals (0, 1 and -1). 211kb
13554 reduced in memory usage.
13556 Replace all calls to `new ArrayList' with `new
13557 ArrayList(4)' which is a good average number for most allocations,
13558 and also requires only 16 bytes of memory for its buffer by
13561 This reduced MCS memory usage in seven megabytes for the RSS after
13564 2003-07-28 Ravi Pratap <ravi@ximian.com>
13566 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13567 handle params methods the correct way by forming only one
13568 applicable set with params and normal methods in them. Earlier we
13569 were looking at params methods only if we found no normal methods
13570 which was not the correct thing to do.
13572 (Invocation.BetterFunction): Take separate arguments indicating
13573 when candidate and the best method are params methods in their
13576 This fixes bugs #43367 and #46199.
13578 * attribute.cs: Documentation updates.
13580 (CheckAttribute): Rename to CheckAttributeTarget.
13581 (GetValidPlaces): Rename to GetValidTargets.
13583 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13584 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13588 2003-07-28 Martin Baulig <martin@ximian.com>
13590 * class.cs (TypeContainer.DefineMembers): Use the base type's full
13591 name when looking up the base class of a nested class. Fixes #46977.
13593 2003-07-26 Martin Baulig <martin@ximian.com>
13595 * expression.cs (Indexers.Indexer): New nested struct; contains
13596 getter, setter and the indexer's type.
13597 (Indexers.Properties): This is now an ArrayList of
13598 Indexers.Indexer's.
13599 (IndexerAccess.DoResolveLValue): Correctly set the type if the
13600 indexer doesn't have any getters.
13602 * assign.cs (Assign.DoResolve): Also do the implicit conversions
13603 for embedded property and indexer assignments.
13605 2003-07-26 Martin Baulig <martin@ximian.com>
13607 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13608 preprocessor directive is not the first non-whitespace character
13611 2003-07-26 Martin Baulig <martin@ximian.com>
13613 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13614 namespace parsing, follow the spec more closely.
13616 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13617 NamespaceEntry.Lookup().
13619 2003-07-25 Martin Baulig <martin@ximian.com>
13621 * MethodCore.cs (OverridesSomething): New public field; it's set
13622 from TypeContainer.DefineMembers if this method overrides
13623 something (which doesn't need to be a method). Fix #39462.
13625 2003-07-25 Ravi Pratap <ravi@ximian.com>
13627 * typemanager.cs (GetMembers): Ensure that the list of members is
13628 reversed. This keeps things in sync.
13630 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13631 find an AttributeUsage attribute.
13633 * expression.cs (Invocation.OverloadResolve): Perform the check
13634 which disallows Invoke to be directly called on a Delegate.
13636 (Error_InvokeOnDelegate): Report error cs1533.
13638 2003-07-25 Martin Baulig <martin@ximian.com>
13640 * expression.cs (Indexers.GetIndexersForType): Only look in the
13641 interface hierarchy if the requested type is already an
13642 interface. Fixes #46788 while keeping #46502 fixed.
13644 2003-07-25 Martin Baulig <martin@ximian.com>
13646 * class.cs (TypeContainer.DefineMembers): Check whether all
13647 readonly fields have been assigned and report warning CS0649 if
13650 * statement.cs (LocalInfo.IsFixed): Always return true if this is
13653 2003-07-24 Ravi Pratap <ravi@ximian.com>
13655 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13656 returned from GetMethods to make things consistent with the
13657 assumptions MCS makes about ordering of methods.
13659 This should comprehensively fix bug #45127 and it does :-)
13661 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13662 ordering is actually reverse.
13664 * Clean up some debug messages I left lying around.
13666 * interface.cs (Populate*): Get rid of code which emits attributes
13667 since the stage in which we emit attributes is the 'Emit' stage,
13668 not the define stage.
13670 (Emit): Move attribute emission for interface members here.
13672 2003-07-22 Ravi Pratap <ravi@ximian.com>
13674 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13675 closely: we eliminate methods in base types when we have an
13676 applicable method in a top-level type.
13678 Please see section 14.5.5.1 for an exact description of what goes
13681 This fixes bug #45127 and a host of other related to corlib compilation.
13683 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13684 array is the method corresponding to the top-level type (this is
13685 because of the changes made to icall.c) so we change this
13688 (MethodGroupExpr.Name): This too.
13690 * typemanager.cs (GetElementType): New method which does the right
13691 thing when compiling corlib.
13693 * everywhere: Make use of the above in the relevant places.
13695 2003-07-22 Martin Baulig <martin@ximian.com>
13697 * cs-parser.jay (invocation_expression): Moved
13698 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13699 `cast_expression', but create a InvocationOrCast which later
13700 resolves to either an Invocation or a Cast.
13702 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13703 method; call this before EmitStatement() to make sure that this
13704 expression can be used as a statement.
13706 * expression.cs (InvocationOrCast): New class; resolves to either
13707 an Invocation or a Cast.
13709 * statement.cs (StatementExpression): Call ResolveStatement() on
13710 the ExpressionStatement before emitting it.
13712 2003-07-21 Martin Baulig <martin@ximian.com>
13714 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13715 `ref' and `out' attributes match; fixes #46220.
13716 (MemberAccess.ResolveMemberAccess): You can't reference a type
13717 through an expression; fixes #33180.
13718 (Indexers.GetIndexersForType): Don't return the indexers from
13719 interfaces the class implements; fixes #46502.
13721 2003-07-21 Martin Baulig <martin@ximian.com>
13723 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13724 CS0661 checks; fixes bug #30442.
13726 2003-07-21 Martin Baulig <martin@ximian.com>
13728 * decl.cs (AdditionResult): Added `Error'.
13730 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13732 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13733 makes cs0031.cs actually work.
13735 2003-07-20 Martin Baulig <martin@ximian.com>
13737 * namespace.cs: Fixed that bug which caused a crash when compiling
13738 the debugger's GUI.
13740 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13742 * typemanager.cs (LookupTypeReflection): Never expose types which
13743 are NotPublic, NestedPrivate, NestedAssembly, or
13744 NestedFamANDAssem. We used to return these, and later do a check
13745 that would report a meaningful error, but the problem is that we
13746 would not get the real match, if there was a name override.
13748 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13750 * namespace.cs (Namespace, Name): Do not compute the namespace
13751 name dynamically, compute it in the constructor. This reduced
13752 memory usage by 1697 KB.
13754 * driver.cs: Use --pause to pause at the end.
13756 2003-07-17 Peter Williams <peter@newton.cx>
13758 * Makefile: Change the name of the test target so that it doesn't
13759 conflict with the recursive test target.
13761 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13763 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13764 AddressOf): Do not use EmitThis, that was wrong, use the actual
13767 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13769 * class.cs (MethodData.Define): While checking if a method is an
13770 interface implementation, improve the test: If we are not public
13771 (use new test here: use the computed MethodAttributes directly,
13772 instead of the parsed modifier flags) check if the `implementing'
13773 method comes from an interface or not.
13775 * pending.cs (VerifyPendingMethods): Slightly better error
13778 * makefile: add test target that does the mcs bootstrap.
13780 2003-07-16 Ravi Pratap <ravi@ximian.com>
13782 * interface.cs (Define): Do nothing here since there are no
13783 members to populate etc. Move the attribute emission out of here
13784 since this was just totally the wrong place to put it. Attribute
13785 application happens during the 'Emit' phase, not in the 'Define'
13788 (Emit): Add this method and move the attribute emission here
13790 * rootcontext.cs (EmitCode): Call the Emit method on interface
13793 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13795 * expression.cs (OverloadResolve): Report error only if Location
13796 is not 'Null' which means that there was a probe going on.
13798 2003-07-14 Martin Baulig <martin@ximian.com>
13800 * expression.cs (ConditionalLogicalOperator): New public class to
13801 implement user defined conditional logical operators.
13802 This is section 14.11.2 in the spec and bug #40505.
13804 2003-07-14 Martin Baulig <martin@ximian.com>
13806 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13808 2003-07-14 Martin Baulig <martin@ximian.com>
13810 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13812 * ecore.cs (IVariable.VerifyFixed): New interface method.
13814 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13815 operator, check whether the variable is actually fixed. Fixes bug
13816 #36055. Set a variable definitely assigned when taking its
13817 address as required by the spec.
13819 * statement.cs (LocalInfo.IsFixed): New field.
13820 (LocalInfo.MakePinned): Set `IsFixed' to true.
13822 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13824 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13825 for .ctors, ensure that we only ask for members declared in the
13826 attribute type (BindingFlags.DeclaredOnly).
13830 * expression.cs (Error_WrongNumArguments): Report error 1501
13831 correctly the way CSC does.
13833 2003-07-13 Martin Baulig <martin@ximian.com>
13835 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13836 lookup on the fully qualified name, to make things like "X.X" work
13837 where "X.X" is a fully qualified type name, but we also have a
13838 namespace "X" in the using list. Fixes #41975.
13840 2003-07-13 Martin Baulig <martin@ximian.com>
13842 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13843 function. If we're a CompoundAssign, we need to create an embedded
13844 CompoundAssign, not an embedded Assign.
13845 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13848 2003-07-13 Martin Baulig <martin@ximian.com>
13850 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13851 work to fix bug #46088.
13853 2003-07-13 Ravi Pratap <ravi@ximian.com>
13855 * class.cs (Operator.Emit): Do not emit attributes here - it is
13856 taken care of by the Method class that we delegate too. This takes
13857 care of bug #45876.
13859 2003-07-10 Martin Baulig <martin@ximian.com>
13861 * expression.cs (TypeOfVoid): New class.
13862 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13864 2003-07-10 Martin Baulig <martin@ximian.com>
13866 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13869 2003-07-10 Martin Baulig <martin@ximian.com>
13871 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13872 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13874 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13876 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13878 2003-07-10 Martin Baulig <martin@ximian.com>
13880 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13881 of decimal. Fixes #42850.
13883 NOTE: I also fixed the created byte blob, but this doesn't work on
13884 the MS runtime and csc never produces any byte blobs for decimal
13887 2003-07-10 Martin Baulig <martin@ximian.com>
13889 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13890 structs; fixes #32068.
13891 (Block.AddChildVariableNames): Fixed #44302.
13893 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13895 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13897 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13899 * attribute.cs: And this test is onger needed.
13901 2003-07-08 Martin Baulig <martin@ximian.com>
13903 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13904 inaccessible types. Fixes #36313.
13906 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13908 * namespace.cs (NamespaceEntry): Create implicit entries for all
13909 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13910 implicit entries for N1.N2 and N1.
13912 2003-07-08 Martin Baulig <martin@ximian.com>
13914 Rewrote the handling of namespaces to fix a lot of the issues
13915 wrt. `using' aliases etc.
13917 * namespace.cs (Namespace): Splitted this class into a
13918 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13920 * typemanager.cs (TypeManager.IsNamespace): Removed.
13921 (TypeManager.ComputeNamespaces): Only compute namespaces from
13922 loaded assemblies here, not the namespaces from the assembly we're
13923 currently compiling.
13925 2003-07-08 Martin Baulig <martin@ximian.com>
13927 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13929 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13931 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13934 I thought about the memory savings here, but LookupTypeReflection
13935 is used under already very constrained scenarios. Compiling
13936 corlib or mcs only exposes one hit, so it would not really reduce
13937 any memory consumption.
13939 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13941 * typemanager.cs: fixes bug #45889 by only adding public types from
13942 other assemblies to the list of known types.
13944 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13946 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13947 on the type we resolved.
13949 2003-07-05 Martin Baulig <martin@ximian.com>
13951 * pending.cs (PendingImplementation.ParentImplements): Don't
13952 create the proxy if the parent is abstract.
13954 * class.cs (TypeContainer.DefineIndexers): Process explicit
13955 interface implementations first. Fixes #37714.
13957 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13959 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13960 defined recursively; but since we modify the input parameters
13961 (left is set to `this' temporarily), we reset this value if the
13962 left_is_explicit is false, which gives the original semantics to
13965 * literal.cs (NullPointer): new class used to represent a null
13966 literal in a pointer context.
13968 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13969 type is a pointer, use a NullPointer object instead of a
13970 NullLiteral. Closes 43687
13972 (ExplicitConversion): Convert pointer values using
13973 the conv opcode to the proper type.
13975 * ecore.cs (New): change ValueTypeVariable property into a method,
13976 that returns whether the valuetype is suitable for being used.
13978 * expression.cs (Binary.DoNumericPromotions): Only return if we
13979 the int constant was a valid uint, and we can return both left and
13980 right as uints. If not, we continue processing, to trigger the
13981 type conversion. This fixes 39018.
13983 * statement.cs (Block.EmitMeta): During constant resolution, set
13984 the CurrentBlock property on the emitcontext, so that we resolve
13985 constants propertly.
13987 2003-07-02 Martin Baulig <martin@ximian.com>
13989 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13990 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13992 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13993 than emitting it here.
13995 * statement.cs: Fixed some more flow analysis bugs.
13997 2003-07-02 Martin Baulig <martin@ximian.com>
13999 * class.cs (MethodData.Define): When implementing interface
14000 methods, set Final unless we're Virtual.
14002 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14003 check work for interface methods.
14005 2003-07-01 Martin Baulig <martin@ximian.com>
14007 * ecore.cs (EmitContext.This): Replaced this property with a
14008 GetThis() method which takes a Location argument. This ensures
14009 that we get the correct error location for a CS0188.
14011 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14013 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14014 ImplicitStandardConversion.
14016 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14018 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14020 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14023 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14025 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14028 (MethodData.Define): Turn off initlocals for unsafe methods.
14030 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14032 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14033 complete; Fixes #37521.
14035 * delegate.cs: Use Modifiers.TypeAttr to compute the
14036 TypeAttributes, instead of rolling our own. This makes the flags
14037 correct for the delegates.
14039 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14041 * class.cs (Constructor.Define): Set the private flag for static
14042 constructors as well.
14044 * cs-parser.jay (statement_expression): Set the return value to
14045 null, to avoid a crash when we catch an error.
14047 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14049 * cs-parser.jay: Applied patch from Jackson that adds support for
14050 extern and unsafe modifiers to destructor declarations.
14052 * expression.cs: Report error 21 if the user is trying to index a
14055 * driver.cs: Add an error message, suggested by the bug report.
14057 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14058 if we do not have a ": this ()" constructor initializer. Fixes 45149
14060 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14062 * namespace.cs: Add some information to reduce FAQs.
14064 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14066 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14067 underlying enumeration types. Fixes #43915.
14069 * expression.cs: Treat ushort/short as legal values to be used in
14070 bitwise operations.
14072 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14074 * delegate.cs: transfer custom attributes for paramenters from
14075 the delegate declaration to Invoke and BeginInvoke.
14077 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14079 * attribute.cs: handle custom marshalers and emit marshal info
14082 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14084 * makefile.gnu: Added anonymous.cs to the compiler sources.
14086 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14088 * iterators.cs: Change the name of the proxy class to include two
14091 * cs-parser.jay: Update grammar to include anonymous methods.
14093 * anonymous.cs: new file.
14095 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14097 * class.cs (Field.Define): Add missing test for pointers and
14100 2003-05-27 Ravi Pratap <ravi@ximian.com>
14102 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14103 we use the stobj opcode.
14105 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14106 since it wasn't the correct fix.
14108 It still is puzzling that we are required to use stobj for IntPtr
14109 which seems to be a ValueType.
14111 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14113 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14114 during regular simple name resolution. Now, the trick is that
14115 instead of returning for processing the simplename, we do a
14116 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14117 contextual lookup type). If a match is found, return that, if
14118 not, return for further composition.
14120 This fixes long-standing 30485.
14122 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14123 using the address to initialize an object, do an Stobj instead of
14124 using the regular Stelem.
14126 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14127 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14128 Because if we are a BaseIndexerAccess that value will be true.
14131 * statement.cs (GotoCase.Resolve): Return after reporting an
14132 error, do not attempt to continue.
14134 * expression.cs (PointerArithmetic.Emit): If our operand is a
14135 long, convert our constants to match the operand before
14136 multiplying. Convert to I type before adding. Fixes 43670.
14138 2003-05-14 Ravi Pratap <ravi@ximian.com>
14140 * enum.cs (ImplicitConversionExists) : Rename to
14141 ImplicitEnumConversionExists to remove ambiguity.
14143 * ecore.cs (NullCast): New type of cast expression class which
14144 basically is very similar to EmptyCast with the difference being
14145 it still is a constant since it is used only to cast a null to
14147 (eg. (string) null)
14149 * convert.cs (ImplicitReferenceConversion): When casting a null
14150 literal, we return a NullCast.
14152 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14153 should be around anymore.
14155 The renaming (reported was slightly wrong). Corrections:
14157 ConvertImplicitStandard -> ImplicitConversionStandard
14158 ConvertExplicitStandard -> ExplicitConversionStandard
14160 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14161 before passing them in !
14163 * convert.cs (ImplicitConversionStandard): When comparing for
14164 equal expr and target types, ensure that expr is not a
14167 In general, we must not be checking (expr_type ==
14168 target_type) in the top level conversion methods
14169 (ImplicitConversion, ExplicitConversion etc). This checking is
14170 done in the methods that they delegate to.
14172 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14174 * convert.cs: Move Error_CannotConvertType,
14175 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14176 ImplicitNumericConversion, ImplicitConversionExists,
14177 ImplicitUserConversionExists, StandardConversionExists,
14178 FindMostEncompassedType, FindMostSpecificSource,
14179 FindMostSpecificTarget, ImplicitUserConversion,
14180 ExplicitUserConversion, GetConversionOperators,
14181 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14182 TryImplicitIntConversion, Error_CannotConvertImplicit,
14183 ConvertImplicitRequired, ConvertNumericExplicit,
14184 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14185 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14188 Perform the following renames:
14190 StandardConversionExists -> ImplicitStandardConversionExists
14191 ConvertImplicit -> ImplicitConversion
14192 ConvertImplicitStandard -> ImplicitStandardConversion
14193 TryImplicitIntConversion -> ImplicitIntConversion
14194 ConvertImplicitRequired -> ImplicitConversionRequired
14195 ConvertNumericExplicit -> ExplicitNumericConversion
14196 ConvertReferenceExplicit -> ExplicitReferenceConversion
14197 ConvertExplicit -> ExplicitConversion
14198 ConvertExplicitStandard -> ExplicitStandardConversion
14200 2003-05-19 Martin Baulig <martin@ximian.com>
14202 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14203 (TypeInfo): Added support for structs having structs as fields.
14205 * ecore.cs (FieldExpr): Implement IVariable.
14206 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14207 VariableInfo for the field.
14209 2003-05-18 Martin Baulig <martin@ximian.com>
14211 * expression.cs (This.DoResolve): Report a CS0027 if we're
14212 emitting a field initializer.
14214 2003-05-18 Martin Baulig <martin@ximian.com>
14216 * expression.cs (This.ResolveBase): New public function.
14217 (This.DoResolve): Check for CS0188.
14219 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14222 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14223 `instance_expression' to null if we don't have any non-static
14226 2003-05-18 Martin Baulig <martin@ximian.com>
14228 Reworked the way how local variables and parameters are handled by
14229 the flow analysis code.
14231 * statement.cs (TypeInfo, VariableMap): New public classes.
14232 (VariableInfo): New public class. This is now responsible for
14233 checking whether a variable has been assigned. It is used for
14234 parameters and local variables.
14235 (Block.EmitMeta): Take the InternalParameters as argument; compute
14236 the layout of the flow vectors here.
14237 (Block.LocalMap, Block.ParameterMap): New public properties.
14238 (FlowBranching): The .ctor doesn't get the InternalParameters
14239 anymore since Block.EmitMeta() now computes the layout of the flow
14241 (MyStructInfo): This class is now known as `StructInfo' and nested
14242 in `TypeInfo'; we don't access this directly anymore.
14244 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14245 property and removed IsAssigned(), IsFieldAssigned(),
14246 SetAssigned() and SetFieldAssigned(); we now call them on the
14247 VariableInfo so we don't need to duplicate this code everywhere.
14249 * expression.cs (ParameterReference): Added `Block block' argument
14251 (LocalVariableReference, ParameterReference, This): The new
14252 VariableInfo class is now responsible for all the definite
14255 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14256 IsParameterAssigned, SetParameterAssigned): Removed.
14258 2003-05-18 Martin Baulig <martin@ximian.com>
14260 * typemanager.cs (InitCoreTypes): Try calling
14261 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14262 the 3-args-version. Corlib now also needs our `void_type'.
14263 (GetMethod): Added overloaded version which takes an optional
14264 `bool report_errors' to allow lookups of optional methods.
14266 2003-05-12 Martin Baulig <martin@ximian.com>
14268 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14269 only used for locals and not for parameters.
14271 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14273 * support.cs (InternalParameters.ParameterType): Return the
14274 ExternalType of the parameter.
14276 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14279 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14281 * class.cs (MethodData.Define): Do not set the `newslot' on
14282 interface members, if they are also flagged as "override".
14284 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14285 better code for ++i and i++. This only works for static fields
14286 and local variables.
14288 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14289 want to pull the DeclSpace out of the builder_to_declspace instead
14290 of the TypeBuilder (like in TypeContainer.FindMembers).
14292 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14293 instead of LookupTypeContainer. Fixes the crash on .NET for
14294 looking up interface members.
14296 * const.cs: Create our own emit context during the Definition
14297 stage, so that constants are evaluated in the proper context, when
14298 a recursive definition happens.
14300 2003-05-11 Martin Baulig <martin@ximian.com>
14302 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14303 new block for a switch section.
14304 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14305 the adding/lookup in the switch block. Fixes #39828.
14307 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14309 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14310 functionality: I needed to convert the data after I had performed
14311 the add/sub operation into the operands type size.
14313 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14314 pass the type for the box operation, otherwise the resulting
14315 object would have been of type object.
14317 (BoxedCast): Add constructor to specify the type to box as.
14319 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14321 * iterators.cs: I was reusing the `count' variable inadvertently,
14322 take steps to not allow this to happen.
14324 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14326 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14327 by creating an array at the point where the params starts and
14328 putting all those arguments there, then adjusting the size of the
14331 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14333 * expression.cs (New.AddressOf): Implement interface
14334 IMemoryLocation. This is used when the `new' operator is used in
14335 the context of an invocation to a method on a value type.
14337 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14340 * namespace.cs: Also check the using aliases here.
14342 * driver.cs: Move the test for using validity after the types have
14343 been entered, so we do a single pass that also includes the using
14346 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14347 in the regular case. CreateSiblingForFinally is doing extra
14350 * attribute.cs (GetAttributeArgumentExpression): Store the result
14351 on an out value, and use the return value to indicate failure
14352 instead of using null (which is a valid return for Constant.GetValue).
14354 * statement.cs: Perform the analysis flow for the increment
14355 portion after the statement, because this will be the real flow of
14356 execution. Fixes #42385
14358 * codegen.cs (EmitContext.EmitArgument,
14359 EmitContext.EmitStoreArgument): New helper functions when the
14360 RemapToProxy flag is set.
14362 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14365 Add support for remapping parameters.
14367 * iterators.cs: Propagate parameter values; Store parameter
14368 values in the proxy classes.
14370 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14372 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14373 need a proxy reference; I do not know what I was thinking
14375 * cs-parser.jay (constructor_initializer): catch another error,
14376 and display nice message.
14378 (field_declaration): catch void field declaration
14379 to flag a better error.
14381 * class.cs (MemberBase.CheckBase): Report an error instead of a
14382 warning if a new protected member is declared in a struct.
14383 (Field.Define): catch the error of readonly/volatile.
14385 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14387 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14388 volatile variable is taken
14390 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14392 * statement.cs (Fixed.Resolve): Report an error if we are not in
14395 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14397 * typemanager.cs: reuse the code that handles type clashes for
14398 delegates and enumerations.
14400 * class.cs (Report28): Always report.
14402 * expression.cs (EncodeAsAttribute): Allow nulls here.
14404 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14406 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14407 the functionality for testing whether an expression is valid for
14408 an attribute here. Also handle the case of arrays of elements
14411 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14412 encoding a linear array into an array of objects that are suitable
14413 to be passed to an CustomAttributeBuilder.
14415 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14417 * ecore.cs: (FieldExpr): Handle field remapping here.
14419 * iteratators.cs: Pass the instance variable (if the method is an
14420 instance method) to the constructors, so we can access the field
14421 variables on the class.
14423 TODO: Test this with structs. I think the THIS variable on
14424 structs might have to be a pointer, and not a refenrece
14426 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14428 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14429 local variables to fields in a proxy class.
14431 * iterators.cs (PopulateProxy): Rename our internal fields to
14433 Create a <THIS> field if we are an instance method, so we can
14434 reference our parent container variables.
14435 (MapVariable): Called back from the EmitContext code to enter a
14436 new variable to field mapping into the proxy class (we just create
14440 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14441 for using the remapped locals to fields.
14443 I placed the code here, because that gives the same semantics to
14444 local variables, and only changes the Emit code.
14446 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14447 statements inside iterators.
14448 (VariableInfo): Add a FieldBuilder for the cases when we are
14449 remapping local variables to fields in a proxy class
14451 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14452 current_block != null.
14454 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14455 not cope with strings, as it has been moved to the
14456 TableSwitchEmit. Fixed bug in switch generation.
14458 * expression.cs (New.DoResolve): Provide more context for the user
14459 when reporting an error.
14461 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14464 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14465 check the permissions for it. Note than in a type-resolution
14466 context the check was already present in DeclSpace.ResolveType,
14467 but was missing from the MemberAccess.
14469 (ArrayCreation.CheckIndices): warn if the user has
14470 more nested levels of expressions, but there are no more
14471 dimensions specified. Avoids crash on bug 41906.
14473 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14475 * statement.cs (Block): replace Implicit bool, for a generic
14477 New flag: `Unchecked'. This is used during the EmitMeta phase
14478 (which is out-of-line with the regular Resolve/Emit process for a
14479 statement, as this is done ahead of time, but still gets a chance
14480 to call constant resolve).
14482 (Block.Flags): new enum for adding a new flag.
14484 (Block.EmitMeta): track the state of unchecked.
14486 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14487 to enable constant resolution to work there as well.
14489 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14491 * typemanager.cs (ienumerable_type): Also look up
14492 System.Collections.IEnumerable.
14494 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14496 TODO: Test more than one conditional per method.
14498 * class.cs (Indexer.Define): Report the location where the user is
14499 referencing the unsupported feature.
14501 (MethodData): Overload the use of `conditionals' to
14502 minimize the creation of needless ArrayLists. This saves roughly
14503 212kb on my machine.
14505 (Method): Implement the new IIteratorContainer interface.
14506 (Method.SetYields): Implement the method by setting the ModFlags
14507 to contain METHOD_YIELDS.
14509 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14510 which just got set to null.
14512 * iterators.cs: New file.
14514 (Yield, YieldBreak): New statements.
14516 * statement.cs (Return.Resolve): Flag an error if we are used in
14517 an iterator method.
14519 * codegen.cs (InIterator): New flag set if the code is being
14520 compiled in an iterator method.
14522 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14523 internal modifier, and we just use it to avoid adding extra
14524 fields, as this is seldom used.
14526 * cs-parser.jay: Add yield_statement (yield and yield break).
14528 * driver.cs: New flag -v2 to turn on version 2 features.
14530 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14531 hashtable when v2 is enabled.
14533 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14535 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14536 there is already a namespace defined with this name.
14538 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14539 people upgraded their corlibs.
14541 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14542 always use fully qualified types, no need to use the compiler
14545 (TypeManager.IsNamespace): Use binarysearch.
14547 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14548 AddDelegate): I did not quite use the new IsValid API properly: I
14549 have to pass the short-name and the fullname. I was passing only
14550 the basename instead of the fullname sometimes.
14552 (TypeContainer.DefineType): call NamespaceClash.
14554 * interface.cs (Interface.DefineType): use NamespaceClash before
14557 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14560 * enum.cs: (Enum.DefineType): use NamespaceClash before
14563 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14564 speed increase. First, use the negative_hits cache when we get a
14565 negative. Second, add the type with its full original name
14566 instead of the new . and + encoded name (reflection uses + to
14567 separate type from a nested type). Use LookupTypeReflection
14568 directly which bypasses the type->name hashtable (that we already
14569 know does not contain the type.
14571 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14572 location/container type.
14574 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14576 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14578 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14580 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14581 method is being referenced in the method group from a static
14582 context, and report error 120 if so.
14584 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14587 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14588 is created, we create the A namespace).
14590 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14593 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14595 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14596 invocation to ModuleBuilder.GetType with the same values will
14597 return a new type instance, so we need to cache its return
14600 * expression.cs (Binary.ResolveOperator): Only allow the compare
14601 operators on enums if they are of the same type.
14603 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14604 types of ValueType on their own case. Before we were giving them
14605 the same treatment as objects.
14607 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14608 fullname. Short name is used to compare against container name.
14609 Fullname is used to check against defined namespace names.
14611 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14612 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14614 (Method.CheckBase): Call parent.
14615 (MemberBase.CheckBase): Check for protected members on sealed
14617 (PropertyBase.CheckBase): Call parent.
14618 (Field.Define): Call parent.
14620 * report.cs: Negative error codes are now mapped to 8000 - code,
14621 so that the display is render more nicely.
14623 * typemanager.cs: Do not use try/catch, instead report a regular
14626 (GetPointerType, GetReferenceType): These methods provide
14627 mechanisms to obtain the T* and T& from a T. We had the code
14628 previously scattered around the code base, and it also used
14629 TypeManager.LookupType that would go through plenty of caches.
14630 This one goes directly to the type source.
14632 In some places we did the Type.GetType followed by
14633 ModuleBuilder.GetType, but not in others, so this unifies the
14634 processing as well.
14636 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14637 statements now that we have namespace information.
14639 * typemanager.cs (IsNamespace): New method, returns whether the
14640 string presented is a namespace or not.
14642 (ComputeNamespaces): New public entry point, computes the list of
14643 available namespaces, using the GetNamespaces API call in Mono, or
14644 the slower version in MS.NET.
14646 Now before we start the semantic analysis phase, we have a
14647 complete list of namespaces including everything that the user has
14650 Deleted old code to cache namespaces in .nsc files.
14652 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14654 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14655 class/struct location definition Location for the implicit
14656 constructor location.
14658 (Operator.Define): Use the location of the operator for the
14659 implicit Method definition.
14661 (Constructor.Emit): use the constructor location for the implicit
14662 base initializer constructor.
14664 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14665 and the Expression class now contains two new methods:
14667 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14668 isolate type lookup from the rest of the resolution process.
14670 Since we use Expressions to hold type definitions due to the way
14671 we parse the input we have historically overloaded Resolve to
14672 perform the Type lookups if a special flag is passed. Now this is
14673 eliminated and two methods take their place.
14675 The differences in the two methods between xStep and xTerminal is
14676 that xStep is involved in our current lookup system that uses
14677 SimpleNames to compose a name, while xTerminal is used just to
14678 catch the case where the simplename lookup failed.
14680 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14682 * expression.cs (ResolveMemberAccess): Remove redundant code.
14683 TypeExpr expressions are always born fully resolved.
14685 * interface.cs (PopulateMethod): Do not lookup the types twice.
14686 We were doing it once during SemanticAnalysis and once during
14689 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14690 in local variable type definitions, were being returned as a
14691 SimpleName (we decomposed everything into a string), that is
14692 because primary_expression was being used instead of a type in the
14693 grammar (reduce/reduce conflicts).
14695 The part that was wrong is that we converted the expression into a
14696 string (an oversimplification in one hand, compounded with primary
14697 expressions doing string concatenation).
14703 Would return "A.B.C[]" as a SimpleName. This stopped things like
14704 using clauses from working on this particular context. And a type
14705 was being matched directly against "A.B.C[]".
14707 We now use the correct approach, and allow for ComposedCast to be
14708 part of the unary expression. So the "A.B.C []" become a composed
14709 cast of "A.B.C" (as a nested group of MemberAccess with a
14710 SimpleName at the end) plus the rank composition "[]".
14714 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14716 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14717 for the access level checking.
14719 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14720 `TypeContainer container', because I kept getting confused when I
14721 was debugging this code.
14723 * expression.cs (Indexers): Instead of tracking getters/setters,
14724 we now track them in parallel. We create one arraylist less, but
14725 most importantly it is possible now for the LValue code to find a
14726 matching get for a set.
14728 (IndexerAccess.DoResolveLValue): Update the code.
14729 GetIndexersForType has been modified already to extract all the
14730 indexers from a type. The code assumed it did not.
14732 Also make the code set the correct return type for the indexer.
14733 This was fixed a long time ago for properties, but was missing for
14734 indexers. It used to be void_type.
14736 (Binary.Emit): Test first for doubles instead of
14737 floats, as they are more common.
14739 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14740 when dealing with floats and the <=, >= operators. This fixes bug
14743 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14744 to load the array value by emitting a load on the foreach variable
14745 type. This was incorrect.
14747 We now emit the code to load an element using the the array
14748 variable type, and then we emit the conversion operator.
14752 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14754 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14756 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14758 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14759 test for protection before we test for signatures.
14761 (MethodSignature.ToString): implement.
14763 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14764 to the case where we reduced into a LongConstant.
14766 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14767 depend on whether the information is acurrate, because the
14768 Microsoft runtime will always claim that the array type is public,
14769 regardless of the real state.
14771 If the type is a pointer, another problem happens: the type is
14772 reported as non-public in Microsoft.
14774 In both cases we have to call CheckAccessLevel recursively with
14775 the underlying type as the argument to be tested.
14777 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14779 * assign.cs (Assign.Emit): If we are dealing with a compound
14780 assignment expression, we should use the code path that stores the
14781 intermediate result in a temporary value. This fixes #40903.
14783 *expression.cs (Indirection.ToString): Provide ToString method for
14786 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14788 * class.cs: Null out fields holding references to Block objects so
14789 they can be garbage collected.
14791 * expression.cs (OverloadResolve): Remove unused local.
14793 2003-04-07 Martin Baulig <martin@ximian.com>
14795 * codegen.cs (EmitContext.CurrentFile): New public field.
14796 (EmitContext.Mark): Use the CurrentFile to check whether the
14797 location is in the correct file.
14798 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14800 2003-04-07 Martin Baulig <martin@ximian.com>
14802 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14804 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14805 location. [FIXME: The location argument which gets passed to this
14806 method is sometimes wrong!]
14808 2003-04-07 Nick Drochak <ndrochak@gol.com>
14810 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14812 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14814 * expression.cs (Indirection.EmitAssign): We were using the
14815 temporary, but returning immediately instead of continuing the
14818 2003-04-06 Martin Baulig <martin@ximian.com>
14820 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14821 if it's a nested child, but also deriving from the outer class.
14824 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14825 nested child, but also deriving from the outer class. See
14827 (FilterWithClosure): We may access private members of the outer
14828 class if we're a nested child and deriving from the outer class.
14829 (RealMemberLookup): Only set `closure_private_ok' if the
14830 `original_bf' contained BindingFlags.NonPublic.
14832 2003-04-05 Martin Baulig <martin@ximian.com>
14834 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14836 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14838 * class.cs (Event.Define): Do not allow abstract events to have
14841 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14843 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14844 block in event declarations.
14846 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14847 value type, get its address.
14849 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14850 leaving a class on the stack instead of a boolean value (int
14851 0/1). Change the code so we compare against null, and then the
14852 result against zero.
14854 * class.cs (TypeContainer.GetClassBases): We were checking for the
14855 parent class being sealed too late.
14857 * expression.cs (Binary.Emit): For <= and >= when dealing with
14858 floating point values, use cgt.un and clt.un instead of cgt and
14861 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14863 * statement.cs: Apply the same optimization as MS: skip the
14864 GetEnumerator returning an IEnumerator, and use the one returning a
14865 CharEnumerator instead. This allows us to avoid the try-finally block
14868 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14870 * cs-parser.jay: Attributes cannot be applied to
14871 namespaces. Fixes #40473
14873 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14876 (Add*): check if the name is valid using the full name for constants,
14877 fields, properties and events.
14879 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14881 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14882 char constants to be part of the enumeration.
14884 * expression.cs (Conditional.DoResolve): Add support for operator
14885 true. Implements the missing functionality from 14.12
14887 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14888 operator true/false as required by the spec.
14890 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14891 implicit conversion to boolean.
14893 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14894 also one where the type implements `operator true'.
14896 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14897 get an expression that will invoke operator true based on an
14900 (GetConversionOperators): Removed the hack that called op_True
14903 (Expression.ResolveBoolean): Move this from Statement.
14905 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14907 * ecore.cs (FieldExpr): do not allow initialization of initonly
14908 fields on derived classes
14910 2003-03-13 Martin Baulig <martin@ximian.com>
14912 * statement.cs (Block.Emit): Call ig.BeginScope() and
14913 ig.EndScope() when compiling with debugging info; call
14914 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14916 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14918 * expression.cs (Indexers): Do not construct immediately, allow
14919 for new members to be appended as we go. Fixes 38143
14921 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14923 * expression.cs: save/restore context when resolving an unchecked
14926 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14928 * cfold.cs: Catch division by zero in modulus operator during
14931 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14933 * interface.cs (Interface.DefineMembers): Avoid defining members
14936 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14938 * driver.cs: handle the +/- options for -noconfig
14940 * statement.cs (Unckeched.Resolve): Also track the state of
14941 unchecked in the Resolve phase.
14943 2003-02-27 Martin Baulig <martin@ximian.com>
14945 * ecore.cs (Expression.MemberLookup): Don't create a
14946 MethodGroupExpr for something which is not a method. Fixes #38291.
14948 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14950 * class.cs (MemberBase.CheckParameters): Also check that the type
14951 is unmanaged if it is a pointer.
14953 * expression.cs (SizeOf.Resolve): Add location information.
14955 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14956 a managed type is declared.
14958 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14959 parameter modifiers as well. Fixes bug 38606
14961 * class.cs: Very sad. Am backing out the speed up changes
14962 introduced by the ArrayList -> Array in the TypeContainer, as they
14963 were not actually that much faster, and introduced a bug (no error
14964 reports on duplicated methods).
14966 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14967 source first, this will guarantee that we have a valid expression
14968 before calling in lower levels functions that will require a
14969 resolved object. Then use this original_source in the
14970 target.ResolveLValue instead of the original source that was
14973 Another change. Use target.Resolve instead of LValueResolve.
14974 Although we are resolving for LValues, we will let the Assign code
14975 take care of that (it will be called again from Resolve). This
14976 basically allows code like this:
14978 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14979 class Y { void A (X x) { x [0] += o; }
14981 The problem was that the indexer was trying to resolve for
14982 set_Item (idx, object o) and never finding one. The real set_Item
14983 was set_Item (idx, X). By delaying the process we get the right
14988 2003-02-23 Martin Baulig <martin@ximian.com>
14990 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14991 while calling DoEmit ().
14993 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14994 source files; if you use the #line directive inside a method, the
14995 compiler stops emitting line numbers for the debugger until it
14996 reaches the end of the method or another #line directive which
14997 restores the original file.
14999 2003-02-23 Martin Baulig <martin@ximian.com>
15001 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15003 2003-02-23 Martin Baulig <martin@ximian.com>
15005 * statement.cs (Block.AddChildVariableNames): We need to call this
15006 recursively, not just for our immediate children.
15008 2003-02-23 Martin Baulig <martin@ximian.com>
15010 * class.cs (Event.Define): Always make the field private, like csc does.
15012 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15013 actually work, fixes bug #37521.
15015 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15017 * delegate.cs: When creating the various temporary "Parameters"
15018 classes, make sure that we call the ComputeAndDefineParameterTypes
15019 on those new parameters (just like we do with the formal ones), to
15020 allow them to be resolved in the context of the DeclSpace.
15022 This fixes the bug that Dick observed in Bugzilla #38530.
15024 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15026 * expression.cs (ResolveMemberAccess): When resolving a constant,
15027 do not attempt to pull a constant if the value was not able to
15028 generate a valid constant.
15030 * const.cs (LookupConstantValue): Do not report more errors than required.
15032 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15034 * expression.cs: fixes bug #38328.
15036 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15038 * class.cs: Changed all the various members that can be part of a
15039 class from being an ArrayList to be an Array of the right type.
15040 During the DefineType type_list, interface_list, delegate_list and
15041 enum_list are turned into types, interfaces, delegates and enums
15044 And during the member population, indexer_list, event_list,
15045 constant_list, field_list, instance_constructor_list, method_list,
15046 operator_list and property_list are turned into their real arrays.
15048 Although we could probably perform this operation earlier, for
15049 good error reporting we need to keep the lists and remove the
15050 lists for longer than required.
15052 This optimization was triggered by Paolo profiling the compiler
15053 speed on the output of `gen-sample-program.pl' perl script.
15055 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15056 not crash in methods like MemberLookupFailed that use this field.
15058 This problem arises when the compiler fails to resolve a type
15059 during interface type definition for example.
15061 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15063 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15064 inherit from System.Object, so we have to stop at null, not only
15065 when reaching System.Object.
15067 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15069 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15070 DeclaredOnly because the parent indexer might have had a different
15071 name, but did not loop until the top of the hierarchy was reached.
15073 The problem this one fixes is 35492: when a class implemented an
15074 indexer from an interface, we were getting the interface method
15075 (which was abstract) and we were flagging an error (can not invoke
15078 This also keeps bug 33089 functioning, and test-148 functioning.
15080 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15081 out if a method is special is to see if it is declared in a
15082 property or event, or whether it is one of the predefined operator
15083 names. This should fix correctly #36804.
15085 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15087 The goal here is to remove the dependency on EmptyCast.Peel ().
15088 Killing it completely.
15090 The problem is that currently in a number of places where
15091 constants are expected, we have to "probe" for an EmptyCast, and
15092 Peel, which is not the correct thing to do, as this will be
15093 repetitive and will likely lead to errors.
15095 The idea is to remove any EmptyCasts that are used in casts that
15096 can be reduced to constants, so we only have to cope with
15099 This bug hunt was triggered by Bug 37363 and the desire to remove
15100 the duplicate pattern where we were "peeling" emptycasts to check
15101 whether they were constants. Now constants will always be
15104 * ecore.cs: Use an enumconstant here instead of wrapping with
15107 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15108 throwing me off. By handling this we can get rid of a few hacks.
15110 * statement.cs (Switch): Removed Peel() code.
15112 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15114 * class.cs: Location information for error 508
15116 * expression.cs (New.DoResolve): Add a guard against double
15117 resolution of an expression.
15119 The New DoResolve might be called twice when initializing field
15120 expressions (see EmitFieldInitializers, the call to
15121 GetInitializerExpression will perform a resolve on the expression,
15122 and later the assign will trigger another resolution
15124 This leads to bugs (#37014)
15126 * delegate.cs: The signature for EndInvoke should contain any ref
15127 or out parameters as well. We were not doing this in the past.
15129 * class.cs (Field.Define): Do not overwrite the type definition
15130 inside the `volatile' group. Turns out that volatile enumerations
15131 were changing the type here to perform a validity test, which
15134 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15136 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15137 and structs, we do not want to load the instance variable
15139 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15140 enum_type has to be handled like an object reference (implicit
15141 conversions exists from this to object), but the regular IsClass
15142 and IsValueType tests will never return true for this one.
15144 Also we use TypeManager.IsValueType instead of type.IsValueType,
15145 just for consistency with the rest of the code (this is only
15146 needed if we ever use the construct exposed by test-180.cs inside
15147 corlib, which we dont today).
15149 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15151 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15154 2003-02-09 Martin Baulig <martin@ximian.com>
15156 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15157 (Namespace.DefineNamespaces): New static public method; this is
15158 called when we're compiling with debugging to add all namespaces
15159 to the symbol file.
15161 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15162 pass it to the Namespace's .ctor.
15164 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15165 and MethodBase arguments; pass the namespace ID to the symwriter;
15166 pass the MethodBase instead of the token to the symwriter.
15167 (SymbolWriter.DefineNamespace): New method to add a namespace to
15170 2003-02-09 Martin Baulig <martin@ximian.com>
15172 * symbolwriter.cs: New file. This is a wrapper around
15173 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15174 methods here in near future.
15176 2003-02-09 Martin Baulig <martin@ximian.com>
15178 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15179 ILGenerator.MarkSequencePoint() which are actually used by the
15182 2003-02-09 Martin Baulig <martin@ximian.com>
15184 * location.cs (SourceFile): New public sealed class. This
15185 contains the name and an index which is used in the location's token.
15186 (Location): Reserve an appropriate number of bits in the token for
15187 the source file instead of walking over that list, this gives us a
15188 really huge performance improvement when compiling with debugging.
15190 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15191 `SourceFile' argument instead of a string.
15192 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15193 but don't parse/tokenize here, we need to generate the list of all
15194 source files before we do that.
15195 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15198 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15199 instead of a string.
15201 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15204 2003-02-09 Martin Baulig <martin@ximian.com>
15206 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15207 filename on `#line default'.
15209 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15211 * statement.cs: don't clear the pinned var when the fixed statement
15212 returns from the method (fixes bug#37752).
15214 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15216 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15219 2003-02-07 Martin Baulig <martin@ximian.com>
15221 * driver.cs: Removed the `--debug-args' command line argument.
15223 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15224 automatically by the AsssemblyBuilder.
15225 (CodeGen.InitializeSymbolWriter): We don't need to call any
15226 initialization function on the symbol writer anymore. This method
15227 doesn't take any arguments.
15229 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15231 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15232 from referenced assemblies as well.
15234 2003-02-02 Martin Baulig <martin@ximian.com>
15236 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15238 2003-02-02 Martin Baulig <martin@ximian.com>
15240 * class.cs (Constructor.Emit): Open the symbol writer before
15241 emitting the constructor initializer.
15242 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15243 single-stepping through constructor initializers.
15245 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15247 * class.cs: Handle error 549: do not allow virtual methods in
15250 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15252 * decl.cs: Check access levels when resolving types
15254 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15256 * statement.cs: Add parameters and locals set in catch blocks that might
15257 return to set vector
15259 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15261 * class.cs (Operator): Set the SpecialName flags for operators.
15263 * expression.cs (Invocation.DoResolve): Only block calls to
15264 accessors and operators on SpecialName methods.
15266 (Cast.TryReduce): Handle conversions from char constants.
15269 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15271 * statement.cs: small memory and time optimization in FlowBranching.
15273 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15275 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15276 problem that the last fix but in the other sid (Set).
15278 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15279 access when there is no indexer in the hierarchy.
15281 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15283 * class.cs: Combine some if statements.
15285 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15287 * driver.cs: fixed bug #37187.
15289 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15291 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15292 any indexer, it's needed to build a list with all the indexers in the
15293 hierarchy (AllGetters), else we have problems. Fixes #35653.
15295 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15297 * class.cs (MethodData.Define): It is wrong for an interface
15298 implementation to be static in both cases: explicit and implicit.
15299 We were only handling this in one case.
15301 Improve the if situation there to not have negations.
15303 * class.cs (Field.Define): Turns out that we do not need to check
15304 the unsafe bit on field definition, only on usage. Remove the test.
15306 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15308 * driver.cs: use assembly.Location instead of Codebase (the latest
15309 patch made mcs fail when using MS assemblies).
15311 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15313 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15314 get the path to *corlib.dll.
15316 2003-01-21 Nick Drochak <ndrochak@gol.com>
15320 * typemanager.cs: Remove compiler warnings
15322 2003-01-20 Duncan Mak <duncan@ximian.com>
15324 * AssemblyInfo.cs: Bump the version number to 0.19.
15326 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15328 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15330 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15332 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15334 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15336 * cs-parser.jay: Small fix: we were not comparing the constructor
15337 name correctly. Thanks to Zoltan for the initial pointer.
15339 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15341 * cs-tokenizer.cs: Set file name when specified with #line
15343 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15345 * cs-parser.jay: Only perform the constructor checks here if we
15346 are named like the class; This will help provider a better
15347 error. The constructor path is taken when a type definition is
15348 not found, but most likely the user forgot to add the type, so
15349 report that rather than the constructor error.
15351 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15353 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15356 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15358 * cs-parser.jay: Add cleanup call.
15360 2003-01-13 Duncan Mak <duncan@ximian.com>
15362 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15363 consistent with other methods.
15365 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15367 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15369 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15371 * attribute.cs: only set GuidAttr to true when we have a
15374 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15378 * typemanager.cs: fixes to allow mcs compile corlib with the new
15379 Type.IsSubclassOf fix.
15381 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15383 * expression.cs (LocalVariableReference.DoResolve): Classify a
15384 constant as a value, not as a variable. Also, set the type for
15387 * cs-parser.jay (fixed_statement): take a type instead of a
15388 pointer_type, so we can produce a better error message later.
15390 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15393 (For.DoEmit): Make inifinite loops have a
15394 non-conditional branch back.
15396 (Fixed.DoEmit): First populate the pinned variables, then emit the
15397 statement, then clear the variables. Before I was emitting the
15398 code once for each fixed piece.
15401 2003-01-08 Martin Baulig <martin@ximian.com>
15403 * statement.cs (FlowBranching.MergeChild): A break in a
15404 SWITCH_SECTION does not leave a loop. Fixes #36155.
15406 2003-01-08 Martin Baulig <martin@ximian.com>
15408 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15409 lives in the same number space than `param_map'. Fixes #36154.
15411 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15413 * cs-parser.jay (constructor_declaration): Set the
15414 Constructor.ModFlags before probing for it. This makes the
15415 compiler report 514, 515 and 132 (the code was there, but got
15418 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15419 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15420 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15422 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15424 * enum.cs: create the enum static fields using the enum type.
15426 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15428 * class.cs: don't try to create the ParamBuilder for the return
15429 type if it's not needed (and handle it breaking for the ms runtime
15432 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15434 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15436 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15438 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15439 the command. This showed up while compiling the JANET source
15440 code, which used \r as its only newline separator.
15442 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15444 * class.cs (Method.Define): If we are an operator (because it
15445 reuses our code), then set the SpecialName and HideBySig. #36128
15447 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15449 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15450 exception, report error 120 `object reference required'.
15452 * driver.cs: Add --pause option, used during to measure the size
15453 of the process as it goes with --timestamp.
15455 * expression.cs (Invocation.DoResolve): Do not allow methods with
15456 SpecialName to be invoked.
15458 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15460 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15461 number before adding it.
15463 2002-12-21 Ravi Pratap <ravi@ximian.com>
15465 * ecore.cs (StandardImplicitConversion): When in an unsafe
15466 context, we allow conversion between void * to any other pointer
15467 type. This fixes bug #35973.
15469 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15471 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15472 is not thrown when extensionless outputs are used
15474 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15476 * rootcontext.cs: fixed compilation of corlib.
15478 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15480 * attribute.cs (Attributes.Contains): Add new method.
15482 * class.cs (MethodCore.LabelParameters): if the parameter is an
15483 `out' parameter, check that no attribute `[In]' has been passed.
15485 * enum.cs: Handle the `value__' name in an enumeration.
15487 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15489 * decl.cs: Added special case to allow overrides on "protected
15492 2002-12-18 Ravi Pratap <ravi@ximian.com>
15494 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15495 since it makes much more sense.
15497 (Attributes.ctor): Don't require a Location parameter.
15499 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15501 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15502 since we already have that information per attribute.
15504 * everywhere : make appropriate changes.
15506 * class.cs (LabelParameters): Write the code which actually
15507 applies attributes to the return type. We can't do this on the MS
15508 .NET runtime so we flag a warning in the case an exception is
15511 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15513 * const.cs: Handle implicit null conversions here too.
15515 2002-12-17 Ravi Pratap <ravi@ximian.com>
15517 * class.cs (MethodCore.LabelParameters): Remove the extra
15518 Type [] parameter since it is completely unnecessary. Instead
15519 pass in the method's attributes so that we can extract
15520 the "return" attribute.
15522 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15524 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15525 of ignoring it and letting the compile continue.
15527 * typemanager.cs (ChangeType): use an extra argument to return an
15528 error condition instead of throwing an exception.
15530 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15532 * expression.cs (Unary.TryReduce): mimic the code for the regular
15533 code path. Perform an implicit cast in the cases where we can
15534 implicitly convert to one of the integral types, and then reduce
15535 based on that constant. This fixes bug #35483.
15537 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15539 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15541 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15543 * namespace.cs: fixed bug #35489.
15545 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15547 * class.cs: Remove some dead code.
15549 * cs-parser.jay: Estimate the number of methods needed
15550 (RootContext.MethodCount);
15552 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15553 numbers instead of StringBuilders.
15555 * support.cs (PtrHashtable): Add constructor with initial size;
15556 We can now reduce reallocations of the method table.
15558 2002-12-10 Ravi Pratap <ravi@ximian.com>
15560 * attribute.cs (ApplyAttributes): Keep track of the emitted
15561 attributes on a per-target basis. This fixes bug #35413.
15563 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15565 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15566 default to the Windows 1252 encoding.
15568 (UnixParseOption): Support version, thanks to Alp for the missing
15571 * AssemblyInfo.cs: Add nice assembly information.
15573 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15576 * cs-parser.jay: Allow a trailing comma before the close bracked
15577 in the attribute_section production.
15579 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15580 address of the instance was being taken, I will take this out,
15581 because we take the address of the object immediately here.
15583 2002-12-09 Ravi Pratap <ravi@ximian.com>
15585 * typemanager.cs (AreMultipleAllowed): Take care of the most
15586 obvious case where attribute type is not in the current assembly -
15589 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15591 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15592 definitions, instead of doing that afterwards.
15594 Also we use a nice little hack, depending on the constructor, we
15595 know if we are a "composed" name or a simple name. Hence, we
15596 avoid the IndexOf test, and we avoid
15598 * codegen.cs: Add code to assist in a bug reporter to track down
15599 the source of a compiler crash.
15601 2002-12-07 Ravi Pratap <ravi@ximian.com>
15603 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15604 types have been emitted for a given element and flag an error
15605 if something which does not have AllowMultiple set is used more
15608 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15609 attribute types and their corresponding AllowMultiple properties
15611 (AreMultipleAllowed): Check the property for a given type.
15613 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15614 property in the case we have a TypeContainer.
15616 (Attributes.AddAttribute): Detect duplicates and just skip on
15617 adding them. This trivial fix catches a pretty gross error in our
15618 attribute emission - global attributes were being emitted twice!
15620 Bugzilla bug #33187 is now fixed.
15622 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15624 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15625 instead of pp_and).
15627 * expression.cs (Binary.ResolveOperator): I can only use the
15628 Concat (string, string, string) and Concat (string, string,
15629 string, string) if the child is actually a concatenation of
15632 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15634 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15635 context where we need a 2-character lookahead.
15637 * pending.cs (PendingImplementation): Rework so we can keep track
15638 of interface types all the time, and flag those which were
15639 implemented by parents as optional.
15641 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15643 * expression.cs (Binary.ResolveOperator): Use
15644 String.Concat(string,string,string) or
15645 String.Concat(string,string,string,string) when possible.
15647 * typemanager: More helper methods.
15650 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15652 * pending.cs: remove the bogus return from GetMissingInterfaces()
15653 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15655 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15657 * namespace.cs: avoid duplicated 'using xxx' being added to
15658 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15659 when we get more than one 'using' statement for the same namespace.
15660 Report a CS0105 warning for it.
15662 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15664 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15665 of calling getChar/putback, uses internal knowledge of it.
15667 (xtoken): Reorder tokenizer so most common patterns are checked
15668 first. This reduces the compilation time in another 5% (from 8.11s
15669 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15671 The parsing time is 22% of the compilation in mcs, and from that
15672 64% is spent on the tokenization process.
15674 I tried using a binary search for keywords, but this is slower
15675 than the hashtable. Another option would be to do a couple of
15678 * Not use a StringBuilder, instead use an array of chars,
15679 with a set value. Notice that this way we could catch
15680 the 645 error without having to do it *afterwards*.
15682 * We could write a hand-parser to avoid the hashtable
15683 compares altogether.
15685 The identifier consumption process takes 37% of the tokenization
15686 time. Another 15% is spent on is_number. 56% of the time spent
15687 on is_number is spent on Int64.Parse:
15689 * We could probably choose based on the string length to
15690 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15693 Another 3% is spend on wrapping `xtoken' in the `token' function.
15695 Handle 0xa0 as whitespace (#34752)
15697 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15699 * typemanager.cs (IsCLRType): New routine to tell whether a type
15700 is one of the builtin types.
15702 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15703 typecode in more places instead of doing pointer comparissions.
15704 We could leverage some knowledge about the way the typecodes are
15707 New code to cache namespaces in assemblies, it is currently not
15708 invoked, to be used soon.
15710 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15712 * expression.cs (Binary.ResolveOperator): specially handle
15713 strings, and do not perform user-defined operator overloading for
15716 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15718 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15719 internalcall as it is a pretty simple operation; Avoid whenever
15720 possible to call Char.IsLetter.
15722 (consume_identifier): Cut by half the number of
15723 hashtable calls by merging the is_keyword and GetKeyword behavior.
15725 Do not short-circuit, because if we do, we
15726 report errors (ie, #if false && true would produce an invalid
15730 2002-11-24 Martin Baulig <martin@ximian.com>
15732 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15733 check constant ranges and report a CS0221. Fixes #33186.
15735 2002-11-24 Martin Baulig <martin@ximian.com>
15737 * cs-parser.jay: Make this work for uninitialized variable
15738 declarations in the `for' initializer. Fixes #32416.
15740 2002-11-24 Martin Baulig <martin@ximian.com>
15742 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15743 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15745 2002-11-24 Martin Baulig <martin@ximian.com>
15747 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15748 argument; if true, we also check for user-defined conversions.
15749 This is only needed if both arguments are of a user-defined type.
15750 Fixes #30443, added test-175.cs.
15751 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15753 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15755 2002-11-24 Martin Baulig <martin@ximian.com>
15757 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15758 function to get the store opcode.
15759 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15760 only emit the Ldelema if the store opcode is Stobj. You must run
15761 both test-34 and test-167 to test this. Fixes #34529.
15763 2002-11-23 Martin Baulig <martin@ximian.com>
15765 * ecore.cs (Expression.MemberLookup): Added additional
15766 `qualifier_type' argument which is used when we're being called
15767 from MemberAccess.DoResolve() and null if we're called from a
15769 (Expression.MemberLookupFailed): New method to report errors; this
15770 does the CS1540 check and reports the correct error message.
15772 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15773 argument for the CS1540 check and redone the way how we're dealing
15774 with private members. See the comment in the source code for details.
15775 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15776 `closure_start_type' to `closure_qualifier_type' and check whether
15777 it's not null. It was not this filter being broken, it was just
15778 being called with the wrong arguments.
15780 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15781 and pass it the correct `qualifier_type'; this also does the error
15784 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15786 * expression.cs (Invocation.EmitParams): If the we are dealing
15787 with a non-built-in value type, load its address as well.
15789 (ArrayCreation): Use a a pretty constant instead
15790 of the hardcoded value 2. Use 6 instead of 2 for the number of
15791 static initializers.
15793 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15794 because they are not really value types, just glorified integers.
15796 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15798 * ecore.cs: Remove redundant code for enumerations, make them use
15799 the same code path as everything else, fixes the casting issue
15800 with enumerations in Windows.Forms.
15802 * attribute.cs: Do only cast to string if it is a string, the
15803 validation happens later.
15805 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15806 people upgrade their corlibs.
15808 * ecore.cs: Oops, enumerations were not following the entire code path
15810 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15812 * typemanager.cs (FilterWithClosure): Commented out the test for
15813 1540 in typemanager.cs, as it has problems when accessing
15814 protected methods from a parent class (see test-174.cs).
15816 * attribute.cs (Attribute.ValidateGuid): new method.
15817 (Attribute.Resolve): Use above.
15819 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15821 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15823 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15824 handling for enumerations, as we only needed the TypeContainer
15825 functionality to begin with (this is required for the fix below to
15826 work for enums that reference constants in a container class for
15829 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15831 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15832 a valid TypeBuilder to perform lookups on.o
15834 * class.cs (InheritableMemberSignatureCompare): Use true in the
15835 call to GetGetMethod and GetSetMethod, because we are comparing
15836 the signature, and we need to get the methods *even* if they are
15839 (PropertyBase.CheckBase): ditto.
15841 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15842 GotoCase.Resolve): Use Peel on EmpytCasts.
15844 * ecore.cs (EmptyCast): drop child, add Peel method.
15846 2002-11-17 Martin Baulig <martin@ximian.com>
15848 * ecore.cs (EmptyCast.Child): New public property.
15850 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15851 label resolved to an EmptyCast. Fixes #34162.
15852 (GotoCase.Resolve): Likewise.
15853 (Block.EmitMeta): Likewise.
15855 2002-11-17 Martin Baulig <martin@ximian.com>
15857 * expression.cs (Invocation.BetterConversion): Prefer int over
15858 uint; short over ushort; long over ulong for integer literals.
15859 Use ImplicitConversionExists instead of StandardConversionExists
15860 since we also need to check for user-defined implicit conversions.
15861 Fixes #34165. Added test-173.cs.
15863 2002-11-16 Martin Baulig <martin@ximian.com>
15865 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15866 with the `true' and `false' literals. Fixes #33151.
15868 2002-11-16 Martin Baulig <martin@ximian.com>
15870 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15871 October 22nd; don't do the cs1540 check for static members.
15873 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15874 now using our own filter here and doing the cs1540 check again.
15876 2002-11-16 Martin Baulig <martin@ximian.com>
15878 * support.cs (InternalParameters): Don't crash if we don't have
15879 any fixed parameters. Fixes #33532.
15881 2002-11-16 Martin Baulig <martin@ximian.com>
15883 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15884 when looking up static methods to make this work on Windows.
15887 2002-11-16 Martin Baulig <martin@ximian.com>
15889 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15890 a setter rather than using PropertyInfo.CanWrite.
15892 2002-11-15 Nick Drochak <ndrochak@gol.com>
15894 * class.cs: Allow acces to block member by subclasses. Fixes build
15897 2002-11-14 Martin Baulig <martin@ximian.com>
15899 * class.cs (Constructor.Emit): Added the extern/block check.
15902 2002-11-14 Martin Baulig <martin@ximian.com>
15904 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15905 iteration while looking for indexers, this is needed because the
15906 indexer may have a different name in our base classes. Fixed the
15907 error reporting (no indexers at all, not get accessor, no
15908 overloaded match). Fixes bug #33089.
15909 (IndexerAccess.DoResolveLValue): Likewise.
15911 2002-11-14 Martin Baulig <martin@ximian.com>
15913 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15914 indexers. Fixes the first part of bug #33089.
15915 (MethodSignature.InheritableMemberSignatureCompare): Added support
15918 2002-11-13 Ravi Pratap <ravi@ximian.com>
15920 * attribute.cs (Attribute.Resolve): Catch the
15921 NullReferenceException and report it since it isn't supposed to
15924 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15926 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15927 LogicalOr and LogicalAnd that can benefit from recursively
15928 handling EmitBranchable. The code now should be nice for Paolo.
15930 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15932 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15933 the Type lookups, as we perform quite a number of lookups on
15934 non-Types. This can be removed once we can deterministically tell
15935 whether we have a type or a namespace in advance.
15937 But this might require special hacks from our corlib.
15941 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15942 and double which avoids a conversion from an integer to a double.
15944 * expression.cs: tiny optimization, avoid calling IsConstant,
15945 because it effectively performs the lookup twice.
15947 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15949 But a bogus return here to keep the semantics of the old code
15950 until the Mono runtime is fixed.
15952 * pending.cs (GetMissingInterfaces): New method used to remove all
15953 the interfaces that are already implemented by our parent
15954 classes from the list of pending methods.
15956 * interface.cs: Add checks for calls after ResolveTypeExpr.
15958 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15960 * class.cs (Class.Emit): Report warning 67: event not used if the
15961 warning level is beyond 3.
15963 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15964 being a NullLiteral.
15966 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15969 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15970 path that might fail if a type can not be resolved.
15972 * expression.cs (Binary.Emit): Emit unsigned versions of the
15975 * driver.cs: use error 5.
15977 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15979 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15981 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15983 * cs-parser.jay (switch_section): A beautiful patch from Martin
15984 Baulig that fixed 33094.
15986 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15988 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15989 Check whether the base is abstract and report an error if so.
15991 * expression.cs (IndexerAccess.DoResolveLValue,
15992 IndexerAccess.DoResolve): ditto.
15994 (Invocation.DoResolve): ditto.
15996 (Invocation.FullMethodDesc): Improve the report string.
15998 * statement.cs (Block): Eliminate IsVariableDefined as it is
15999 basically just a wrapper for GetVariableInfo.
16001 * ecore.cs (SimpleName): Use new
16003 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16004 type, as we return the actual parameter ref/unref state on a
16007 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16009 * support.cs: Return proper flags REF/OUT fixing the previous
16012 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16013 not used to mean `ref' but `ref or out' in ParameterReference
16015 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16016 full type signature instead of calling TypeManger.CSharpName
16019 * support.cs (InternalParameters.ParameterDesc): Do not compare
16020 directly to the modflags, because REF/OUT will actually be bitsets
16023 * delegate.cs (VerifyMethod): Check also the modifiers.
16025 * cs-tokenizer.cs: Fix bug where floating point values with an
16026 exponent where a sign was missing was ignored.
16028 * driver.cs: Allow multiple assemblies to be specified in a single
16031 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16033 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16034 because identifiers after a parenthesis would end up in this kind
16035 of production, and we needed to desamiguate it for having casts
16038 (UserDefinedType *) xxx
16040 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16042 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16043 we should set on the Bindingflags.NonPublic, but not turn on
16044 private_ok. private_ok controls whether a Private member is
16045 returned (this is chekced on the filter routine), while the
16046 BindingFlags.NonPublic just controls whether private/protected
16047 will be allowed. This fixes the problem part of the problem of
16048 private properties being allowed to be used in derived classes.
16050 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16051 so we can call the children DoResolveLValue method (this will
16052 properly signal errors on lvalue assignments to base properties)
16054 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16055 getter are null, and we have a property info, we know that this
16056 happened because the lookup failed, so we report an error 122 for
16057 protection level violation.
16059 We also silently return if setter and getter are null in the
16060 resolve functions, this condition only happens if we have flagged
16061 the error before. This is the other half of the problem.
16063 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16064 not have accessibility information, that is why we were returning
16065 true in the filter function in typemanager.cs.
16067 To properly report 122 (property is inaccessible because of its
16068 protection level) correctly, we report this error in ResolveAccess
16069 by failing if both the setter and the getter are lacking (ie, the
16072 DoResolve and DoLResolve have been modified to check for both
16073 setter/getter being null and returning silently, the reason being
16074 that I did not want to put the knowledge about this error in upper
16077 int old = Report.Errors;
16078 x = new PropertyExpr (...);
16079 if (old != Report.Errors)
16084 So the property expr is returned, but it is invalid, so the error
16085 will be flagged during the resolve process.
16087 * class.cs: Remove InheritablePropertySignatureCompare from the
16088 class, as we no longer depend on the property signature to compute
16089 whether it is possible to implement a method or not.
16091 The reason is that calling PropertyInfo.GetGetMethod will return
16092 null (in .NET, in Mono it works, and we should change this), in
16093 cases where the Get Method does not exist in that particular
16098 class X { public virtual int A { get { return 1; } } }
16100 class Z : Y { public override int A { get { return 2; } } }
16102 Would fail in Z because the parent (Y) would not have the property
16103 defined. So we avoid this completely now (because the alternative
16104 fix was ugly and slow), and we now depend exclusively on the
16107 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16108 reference method, instead of using the property.
16110 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16111 routines are gone now.
16113 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16114 names, they were incorrectly named.
16116 * cs-tokenizer.cs: Return are more gentle token on failure.
16118 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16119 had an out-of-sync index variable, which caused it to remove from
16120 the list of pending methods the wrong method sometimes.
16122 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16124 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16125 CanWrite, because those refer to this particular instance of the
16126 property, and do not take into account the fact that we can
16127 override single members of a property.
16129 Constructor requires an EmitContext. The resolution process does
16130 not happen here, but we need to compute the accessors before,
16131 because the resolution does not always happen for properties.
16133 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16134 subclass, before we did not update this flag, but we did update
16137 (GetAccessors): Drop this routine, as it did not work in the
16138 presence of partially overwritten set/get methods.
16140 Notice that this broke the cs1540 detection, but that will require
16143 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16147 * driver.cs: issue a warning instead of an error if we don't support
16148 debugging for the platform. Also ignore a couple of errors that may
16149 arise when trying to write the symbols. Undo my previous patch.
16151 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16153 * driver.cs: ignore /debug switch except for Unix platforms.
16155 2002-10-23 Nick Drochak <ndrochak@gol.com>
16157 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16159 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16161 * driver.cs: Do not make mcs-debug conditional, so we do not break
16162 builds that use it.
16164 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16165 review this patch. But basically after all the children variables
16166 have been merged, the value of "Breaks" was not being set to
16167 new_breaks for Switch blocks. I think that it should be set after
16168 it has executed. Currently I set this to the value of new_breaks,
16169 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16170 conservative, but I do not understand this code very well.
16172 I did not break anything in the build, so that is good ;-)
16174 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16176 2002-10-20 Mark Crichton <crichton@gimp.org>
16178 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16180 2002-10-20 Nick Drochak <ndrochak@gol.com>
16182 * cfold.cs: Fixed compile blocker.
16184 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16186 * driver.cs: I was chekcing the key, not the file.
16188 2002-10-19 Ravi Pratap <ravi@ximian.com>
16190 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16191 message that we were generating - we just need to silently return
16194 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16196 * class.cs (Event.Define): Change my previous commit, as this
16197 breaks the debugger. This is a temporary hack, as it seems like
16198 the compiler is generating events incorrectly to begin with.
16200 * expression.cs (Binary.ResolveOperator): Added support for
16201 "U operator - (E x, E y)"
16203 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16206 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16207 init-only variables, but this path did not take into account that
16208 there might be also instance readonly variables. Correct this
16211 This fixes bug 32253
16213 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16216 * driver.cs: Change the extension for modules to `netmodule'
16218 * cs-parser.jay: Improved slightly the location tracking for
16219 the debugger symbols.
16221 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16222 modifiers that were specified instead of the hardcoded value
16223 (FamAndAssem). This was basically ignoring the static modifier,
16224 and others. Fixes 32429.
16226 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16227 fixed a bug in the process (32476)
16229 * expression.cs (ArrayAccess.EmitAssign): Patch from
16230 hwang_rob@yahoo.ca that fixes bug 31834.3
16232 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16234 * driver.cs: Make the module extension .netmodule.
16236 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16238 * driver.cs: Report an error if the resource file is not found
16239 instead of crashing.
16241 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16242 false, like Emit does.
16244 2002-10-16 Nick Drochak <ndrochak@gol.com>
16246 * typemanager.cs: Remove unused private member. Also reported mcs
16247 bug to report this as a warning like csc.
16249 2002-10-15 Martin Baulig <martin@gnome.org>
16251 * statement.cs (Statement.Emit): Made this a virtual method; emits
16252 the line number info and calls DoEmit().
16253 (Statement.DoEmit): New protected abstract method, formerly knows
16254 as Statement.Emit().
16256 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16258 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16260 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16261 have fixed a remaining problem: not every AddXXXX was adding a
16262 fully qualified name.
16264 Now everyone registers a fully qualified name in the DeclSpace as
16265 being defined instead of the partial name.
16267 Downsides: we are slower than we need to be due to the excess
16268 copies and the names being registered this way.
16270 The reason for this is that we currently depend (on the corlib
16271 bootstrap for instance) that types are fully qualified, because
16272 we dump all the types in the namespace, and we should really have
16273 types inserted into the proper namespace, so we can only store the
16274 basenames in the defined_names array.
16276 2002-10-10 Martin Baulig <martin@gnome.org>
16278 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16279 from bug #31834, see the bug report for a testcase which is
16282 2002-10-10 Martin Baulig <martin@gnome.org>
16284 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16285 flow analysis code for this.
16287 * statement.cs (Do, While, For): Tell the flow analysis code about
16289 (FlowBranching.UsageVector): Added support for infinite loops.
16290 (Block.Resolve): Moved the dead code elimination here and use flow
16293 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16295 * class.cs (Field.Define): Catch cycles on struct type
16298 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16299 fields if the fields are static. We only need to check instance
16302 * expression.cs (As.DoResolve): Test for reference type.
16304 * statement.cs (Using.ResolveExpression): Use
16305 ConvertImplicitRequired, not ConvertImplicit which reports an
16307 (Using.ResolveLocalVariableDecls): ditto.
16309 * expression.cs (Binary.ResolveOperator): Report errors in a few
16310 places where we had to.
16312 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16314 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16316 * expression.cs: Use StoreFromPtr instead of extracting the type
16317 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16319 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16320 an enumeration value to a System.Enum, but System.Enum is not a
16321 value type, but an class type, so we need to box.
16323 (Expression.ConvertExplicit): One codepath could return
16324 errors but not flag them. Fix this. Fixes #31853
16326 * parameter.cs (Resolve): Do not allow void as a parameter type.
16328 2002-10-06 Martin Baulig <martin@gnome.org>
16330 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16331 if it's a class type and not a struct. Fixes #31815.
16333 2002-10-06 Martin Baulig <martin@gnome.org>
16335 * statement.cs: Reworked the flow analysis code a bit to make it
16336 usable for dead code elimination.
16338 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16340 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16342 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16344 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16345 to fix the test 165, will investigate deeper.
16347 2002-10-04 Martin Baulig <martin@gnome.org>
16349 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16350 finally blocks actually work.
16351 (Try.Resolve): We don't need to create a sibling for `finally' if
16352 there is no finally block.
16354 2002-10-04 Martin Baulig <martin@gnome.org>
16356 * class.cs (Constructor.Define): The default accessibility for a
16357 non-default constructor is private, not public.
16359 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16361 * class.cs (Constructor): Make AllowedModifiers public, add
16364 * cs-parser.jay: Perform the modifiers test here, as the
16365 constructor for the Constructor class usually receives a zero
16366 because of the way we create it (first we create, later we
16367 customize, and we were never checking the modifiers).
16369 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16370 is a version of LookupTypeReflection that includes the type-name
16371 cache. This can be used as a fast path for functions that know
16372 the fully qualified name and are only calling into *.GetType() to
16373 obtain a composed type.
16375 This is also used by TypeManager.LookupType during its type
16378 (LookupType): We now also track the real type name, as sometimes
16379 we can get a quey for the real type name from things like
16380 ComposedCast. This fixes bug 31422.
16382 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16383 complete type fullname, it does not have to go through the type
16384 resolution system to obtain the composed version of the type (for
16385 obtaining arrays or pointers).
16387 (Conditional.Emit): Use the EmitBoolExpression to
16388 generate nicer code, as requested by Paolo.
16390 (ArrayCreation.CheckIndices): Use the patch from
16391 hwang_rob@yahoo.ca to validate the array initializers.
16393 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16395 * class.cs (ConstructorInitializer.Emit): simplify code by using
16396 Invocation.EmitCall, and at the same time, fix the bugs in calling
16397 parent constructors that took variable arguments.
16399 * ecore.cs (Expression.ConvertNumericExplicit,
16400 Expression.ImplicitNumericConversion): Remove the code that
16401 manually wrapped decimal (InternalTypeConstructor call is now gone
16404 * expression.cs (Cast.TryReduce): Also handle decimal types when
16405 trying to perform a constant fold on the type.
16407 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16409 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16410 that only turned off an error report, and did nothing else.
16412 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16414 * driver.cs: Handle and ignore /fullpaths
16416 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16418 * expression.cs (Binary.ResolveOperator): Catch the case where
16419 DoNumericPromotions returns true,
16421 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16423 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16425 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16428 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16430 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16431 conversion exists, but it is also required that the conversion be
16432 performed. This manifested in "(Type64Enum) 2".
16434 * class.cs (TypeManager.AddMethod): The fix is not to change
16435 AddEnum, because that one was using a fully qualified name (every
16436 DeclSpace derivative does), but to change the AddMethod routine
16437 that was using an un-namespaced name. This now correctly reports
16438 the duplicated name.
16440 Revert patch until I can properly fix it. The issue
16441 is that we have a shared Type space across all namespaces
16442 currently, which is wrong.
16444 Options include making the Namespace a DeclSpace, and merge
16445 current_namespace/current_container in the parser.
16447 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16449 * cs-parser.jay: Improve error reporting when we get a different
16450 kind of expression in local_variable_type and
16451 local_variable_pointer_type.
16453 Propagate this to avoid missleading errors being reported.
16455 * ecore.cs (ImplicitReferenceConversion): treat
16456 TypeManager.value_type as a target just like object_type. As
16461 Is valid, and needs to result in the int 1 being boxed before it
16462 is assigned to the value type v.
16464 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16465 to validate the enumeration name.
16467 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16468 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16469 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16471 * ecore.cs (TryImplicitIntConversion): When doing an
16472 implicit-enumeration-conversion, check if the type is 64-bits and
16473 perform a conversion before passing to EnumConstant.
16475 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16477 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16478 report ambiguous type references. Unlike the MS version, we
16479 report what the ambiguity is. Innovation at work ;-)
16481 (DeclSpace.FindType): Require a location argument to
16482 display when we display an ambiguous error.
16484 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16486 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16488 * expression.cs (EmitDynamicInitializers): Apply patch from
16489 hwang_rob@yahoo.ca that fixes the order in which we emit our
16492 2002-09-21 Martin Baulig <martin@gnome.org>
16494 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16495 delegate takes no arguments.
16497 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16499 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16502 * expression.cs: Extract the underlying type.
16504 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16506 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16508 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16510 * class.cs (TypeContainer.DefineType): We can not use the nice
16511 PackingSize with the size set to 1 DefineType method, because it
16512 will not allow us to define the interfaces that the struct
16515 This completes the fixing of bug 27287
16517 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16518 means also structs. This fixes part of the problem.
16519 (Expresion.ImplicitReferenceConversionExists): ditto.
16521 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16522 error if there were no errors reported during the type lookup
16523 process, to avoid duplicates or redundant errors. Without this
16524 you would get an ambiguous errors plus a type not found. We have
16525 beaten the user enough with the first error.
16527 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16530 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16531 during the resolution process, stop the lookup, this avoids
16532 repeated error reports (same error twice).
16534 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16536 * typemanager.cs (LookupType): Redo the type lookup code to match
16537 the needs of System.Reflection.
16539 The issue is that System.Reflection requires references to nested
16540 types to begin with a "+" sign instead of a dot. So toplevel
16541 types look like: "NameSpace.TopLevelClass", and nested ones look
16542 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16545 2002-09-19 Martin Baulig <martin@gnome.org>
16547 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16548 says that a method always returns or always throws an exception,
16549 don't report the CS0161.
16551 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16552 set `Returns = new_returns'.
16554 2002-09-19 Martin Baulig <martin@gnome.org>
16556 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16557 to an enum constant, check for a CS0176.
16559 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16561 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16562 for operators that must be in pairs and report errors.
16564 * ecore.cs (SimpleName.DoResolveType): During the initial type
16565 resolution process, when we define types recursively, we must
16566 check first for types in our current scope before we perform
16567 lookups in the enclosing scopes.
16569 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16571 (Invocation.VerifyArgumentsCompat): Call
16572 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16573 I thought we were supposed to always call this, but there are a
16574 few places in the code where we dont do it.
16576 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16578 * driver.cs: Add support in -linkres and -resource to specify the
16579 name of the identifier.
16581 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16583 * ecore.cs (StandardConversionExists): Sync with the conversion
16584 code: allow anything-* to void* conversions.
16586 (FindMostSpecificSource): Use an Expression argument
16587 instead of a Type, because we might be handed over a Literal which
16588 gets a few more implicit conversions that plain types do not. So
16589 this information was being lost.
16591 Also, we drop the temporary type-holder expression when not
16594 2002-09-17 Martin Baulig <martin@gnome.org>
16596 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16597 this is an explicit interface implementation.
16599 2002-09-17 Martin Baulig <martin@gnome.org>
16601 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16602 different `IndexerName' attributes.
16604 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16605 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16606 virtual CommonResolve().
16608 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16610 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16611 and convert that to the UnderlyingType.
16613 * statement.cs (Foreach.Resolve): Indexers are just like variables
16614 or PropertyAccesses.
16616 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16617 inside quoted strings, we were not doing this before.
16619 2002-09-16 Martin Baulig <martin@gnome.org>
16621 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16622 resolve it. This is needed for the definite assignment check of the
16623 instance expression, fixes bug #29846.
16624 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16626 2002-09-16 Nick Drochak <ndrochak@gol.com>
16628 * parameter.cs: Fix compile error. Cannot reference static member
16629 from an instance object. Is this an mcs bug?
16631 2002-09-14 Martin Baulig <martin@gnome.org>
16633 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16634 multiple times. Fixes bug #30295, added test-166.cs.
16636 2002-09-14 Martin Baulig <martin@gnome.org>
16638 * statement.cs (Block.Emit): Don't emit unreachable code.
16639 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16640 `break' statements.
16641 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16643 2002-09-14 Martin Baulig <martin@gnome.org>
16645 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16648 2002-09-14 Martin Baulig <martin@gnome.org>
16650 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16651 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16652 be false on the ms runtime.
16654 2002-09-13 Martin Baulig <martin@gnome.org>
16656 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16657 the CS0038 error message.
16659 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16661 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16662 constant inside, return it.
16664 2002-09-12 Martin Baulig <martin@gnome.org>
16666 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16667 implicit conversion can be done between enum types.
16669 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16670 check whether an implicit conversion to the current enum's UnderlyingType
16671 exists and report an error if not.
16673 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16674 without debugging support.
16676 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16677 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16679 2002-09-12 Martin Baulig <martin@gnome.org>
16681 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16683 * ecore.cs (IMemberExpr.DeclaringType): New property.
16684 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16685 nonstatic member of an outer type (CS0038).
16687 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16689 * driver.cs: Activate the using-error detector at warning level
16690 4 (at least for MS-compatible APIs).
16692 * namespace.cs (VerifyUsing): Small buglett fix.
16694 * pending.cs (PendingImplementation): pass the container pointer.
16696 * interface.cs (GetMethods): Allow for recursive definition. Long
16697 term, I would like to move every type to support recursive
16698 definitions, not the current ordering mechanism that we have right
16701 The situation is this: Attributes are handled before interfaces,
16702 so we can apply attributes to interfaces. But some attributes
16703 implement interfaces, we will now handle the simple cases
16704 (recursive definitions will just get an error).
16706 * parameter.cs: Only invalidate types at the end if we fail to
16709 2002-09-09 Martin Baulig <martin@gnome.org>
16711 * ecore.cs (PropertyExpr.Emit): Also check for
16712 TypeManager.system_int_array_get_length so this'll also work when
16713 compiling corlib. Fixes #30003.
16715 2002-09-09 Martin Baulig <martin@gnome.org>
16717 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16718 and throw an exception if we can't get the type's size. Fixed #30040,
16721 2002-09-09 Martin Baulig <martin@gnome.org>
16723 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16725 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16726 context. Fixes bug #30027.
16728 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16729 virtual functions. Fixes bug #30043, added test-164.cs.
16731 2002-09-08 Ravi Pratap <ravi@ximian.com>
16733 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16735 2002-09-08 Nick Drochak <ndrochak@gol.com>
16737 * driver.cs: Use an object to get the windows codepage since it's not a
16740 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16742 * statement.cs (For.Emit): for infinite loops (test == null)
16743 return whether there is a break inside, not always "true".
16745 * namespace.cs (UsingEntry): New struct to hold the name of the
16746 using definition, the location where it is defined, and whether it
16747 has been used in a successful type lookup.
16749 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16754 2002-09-06 Ravi Pratap <ravi@ximian.com>
16756 * attribute.cs : Fix incorrect code which relied on catching
16757 a NullReferenceException to detect a null being passed in
16758 where an object was expected.
16760 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16762 * statement.cs (Try): flag the catch variable as assigned
16764 * expression.cs (Cast): Simplified by using ResolveType instead of
16765 manually resolving.
16767 * statement.cs (Catch): Fix bug by using ResolveType.
16769 2002-09-06 Ravi Pratap <ravi@ximian.com>
16771 * expression.cs (BetterConversion): Special case for when we have
16772 a NullLiteral as the argument and we have to choose between string
16773 and object types - we choose string the way csc does.
16775 * attribute.cs (Attribute.Resolve): Catch the
16776 NullReferenceException and report error #182 since the Mono
16777 runtime no more has the bug and having this exception raised means
16778 we tried to select a constructor which takes an object and is
16781 2002-09-05 Ravi Pratap <ravi@ximian.com>
16783 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16784 message (1502, 1503) when we can't locate a method after overload
16785 resolution. This is much more informative and closes the bug
16788 * interface.cs (PopulateMethod): Return if there are no argument
16789 types. Fixes a NullReferenceException bug.
16791 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16792 expressions too. Previously we were checking only in one place for
16793 positional arguments leaving out named arguments.
16795 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16796 type to the enum type is not allowed. Remove code corresponding to
16799 (ConvertNumericExplicit): Allow explicit conversions from
16800 the underlying type to enum type. This precisely follows the spec
16801 and closes a bug filed by Gonzalo.
16803 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16806 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16808 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16810 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16811 it was important that we stored the right value after the
16812 reduction in `converted'.
16814 2002-09-04 Martin Baulig <martin@gnome.org>
16816 * location.cs (Location.SymbolDocument): Use full pathnames for the
16819 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16821 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16822 of the expression resolve mechanism, because that will catch the
16823 SimpleName error failures.
16825 (Conditional): If we can not resolve the
16826 expression, return, do not crash.
16828 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16831 (location): display token name instead of its number.
16833 2002-08-28 Martin Baulig <martin@gnome.org>
16835 * expression.cs (Binary.ResolveOperator): Don't silently return
16836 but return an error if an operator cannot be applied between two
16839 2002-08-28 Martin Baulig <martin@gnome.org>
16841 * class.cs (Constructor.Define): Set the permission attributes
16842 correctly instead of making all constructors public.
16844 2002-08-28 Martin Baulig <martin@gnome.org>
16846 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16847 for private members before reporting a CS0103; if we find anything,
16850 2002-08-28 Martin Baulig <martin@gnome.org>
16852 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16853 to check whether `closure_start_type == closure_invocation_type',
16854 we also need to check whether `m.DeclaringType == closure_invocation_type'
16855 before bypassing the permission checks. We might be accessing
16856 protected/private members from the base class.
16857 (TypeManager.RealMemberLookup): Only set private_ok if private
16858 members were requested via BindingFlags.NonPublic.
16860 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16862 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16863 MethodGroupExpr.IsExplicitImpl if appropriate.
16864 (Invocation.DoResolve): Don't report the CS0120 for explicit
16865 interface implementations.
16867 2002-08-27 Martin Baulig <martin@gnome.org>
16869 * expression.cs (Invocation.DoResolve): If this is a static
16870 method and we don't have an InstanceExpression, we must report
16873 2002-08-25 Martin Baulig <martin@gnome.org>
16875 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16876 `==' between a valuetype and an object.
16878 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16880 * ecore.cs (TypeExpr): Provide a ToString method.
16882 2002-08-24 Martin Baulig <martin@gnome.org>
16884 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16885 now called proggie.dbg and it's a binary file.
16887 2002-08-23 Martin Baulig <martin@gnome.org>
16889 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16891 2002-08-23 Martin Baulig <martin@gnome.org>
16893 * struct.cs (MyStructInfo.ctor): Make this work with empty
16894 structs; it's not allowed to use foreach() on null.
16896 2002-08-23 Martin Baulig <martin@gnome.org>
16898 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16899 writer the full pathname of the generated assembly.
16901 2002-08-23 Martin Baulig <martin@gnome.org>
16903 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16904 A `finally' block never returns or breaks; improved handling of
16907 2002-08-23 Martin Baulig <martin@gnome.org>
16909 * statement.cs (Throw.Resolve): Allow `throw null'.
16911 2002-08-23 Martin Baulig <martin@gnome.org>
16913 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16914 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16915 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16916 MemberLookup would return a wrong event if this is an explicit
16917 interface implementation and the class has an event with the same
16920 2002-08-23 Martin Baulig <martin@gnome.org>
16922 * statement.cs (Block.AddChildVariableNames): New public method.
16923 (Block.AddChildVariableName): Likewise.
16924 (Block.IsVariableNameUsedInChildBlock): Likewise.
16925 (Block.AddVariable): Check whether a variable name has already
16926 been used in a child block.
16928 * cs-parser.jay (declare_local_variables): Mark all variable names
16929 from the current block as being used in a child block in the
16932 2002-08-23 Martin Baulig <martin@gnome.org>
16934 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16935 find the symbol writer.
16937 * driver.cs: csc also allows the arguments to /define being
16938 separated by commas, not only by semicolons.
16940 2002-08-23 Martin Baulig <martin@gnome.org>
16942 * interface.cs (Interface.GetMembers): Added static check for events.
16944 2002-08-15 Martin Baulig <martin@gnome.org>
16946 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16947 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16949 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16950 why the MethodData.EmitDestructor() change was necessary.
16952 2002-08-20 Martin Baulig <martin@gnome.org>
16954 * class.cs (TypeContainer.FindMembers): Added static check for events.
16956 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16958 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16959 use Type.GetEvents(), not Type.FindMembers().
16961 2002-08-20 Martin Baulig <martin@gnome.org>
16963 * decl.cs (MemberCache): Added a special method cache which will
16964 be used for method-only searched. This ensures that a method
16965 search will return a MethodInfo with the correct ReflectedType for
16968 2002-08-20 Martin Baulig <martin@gnome.org>
16970 * decl.cs (DeclSpace.FindMembers): Made this public.
16972 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16974 * delegate.cs: fixed build on windows.
16975 [FIXME: Filed as bug #29150: MCS must report these errors.]
16977 2002-08-19 Ravi Pratap <ravi@ximian.com>
16979 * ecore.cs (StandardConversionExists): Return a false
16980 if we are trying to convert the void type to anything else
16981 since that is not allowed.
16983 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16984 we flag error 70 in the event an event is trying to be accessed
16985 directly from outside the declaring type.
16987 2002-08-20 Martin Baulig <martin@gnome.org>
16989 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16990 MemberCache from typemanager.cs to decl.cs.
16992 2002-08-19 Martin Baulig <martin@gnome.org>
16994 * class.cs (TypeContainer): Implement IMemberContainer.
16995 (TypeContainer.DefineMembers): Create the MemberCache.
16996 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16997 return public members if BindingFlags.Public was given, check
16998 whether members are static.
17000 2002-08-16 Martin Baulig <martin@gnome.org>
17002 * decl.cs (DeclSpace.Define): Splitted this in Define and
17003 DefineMembers. DefineMembers is called first and initializes the
17006 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17007 DefineMembers() on all our DeclSpaces.
17009 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17010 but call DefineMembers() on all nested interfaces. We call their
17011 Define() in our new Define() function.
17013 * interface.cs (Interface): Implement IMemberContainer.
17014 (Interface.Define): Moved all code except the attribute stuf to
17016 (Interface.DefineMembers): Initialize the member cache.
17018 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17019 need this anymore since we can use MemberCache.FindMembers directly.
17021 2002-08-19 Martin Baulig <martin@gnome.org>
17023 * typemanager.cs (MemberCache): When creating the cache for an
17024 interface type, add all inherited members.
17025 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17026 to `out bool used_cache' and documented it.
17027 (TypeManager.MemberLookup): If we already used the cache in the first
17028 iteration, we don't need to do the interfaces check.
17030 2002-08-19 Martin Baulig <martin@gnome.org>
17032 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17033 here from IMemberFinder and don't implement this interface anymore.
17034 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17036 * typemanager.cs (IMemberFinder): This interface is now only used by
17037 classes which actually support the member cache.
17038 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17039 since we only put DeclSpaces into this Hashtable.
17040 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17041 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17043 2002-08-16 Martin Baulig <martin@gnome.org>
17045 * typemanager.cs (ICachingMemberFinder): Removed.
17046 (IMemberFinder.MemberCache): New property.
17047 (TypeManager.FindMembers): Merged this with RealFindMembers().
17048 This function will never be called from TypeManager.MemberLookup()
17049 so we can't use the cache here, just the IMemberFinder.
17050 (TypeManager.MemberLookup_FindMembers): Check whether the
17051 IMemberFinder has a MemberCache and call the cache's FindMembers
17053 (MemberCache): Rewrote larger parts of this yet another time and
17054 cleaned it up a bit.
17056 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17058 * driver.cs (LoadArgs): Support quoting.
17060 (Usage): Show the CSC-like command line arguments.
17062 Improved a few error messages.
17064 2002-08-15 Martin Baulig <martin@gnome.org>
17066 * typemanager.cs (IMemberContainer.Type): New property.
17067 (IMemberContainer.IsInterface): New property.
17069 The following changes are conditional to BROKEN_RUNTIME, which is
17070 defined at the top of the file.
17072 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17073 class'es members, but add all members from TypeHandle.ObjectType
17074 if we're an interface.
17075 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17076 is the current type.
17077 (MemberCache.CacheEntry.Container): Removed this field.
17078 (TypeHandle.GetMembers): Include inherited members.
17080 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17082 * typemanager.cs: fixed compilation and added a comment on a field that
17085 2002-08-15 Martin Baulig <martin@gnome.org>
17087 * class.cs (ConstructorInitializer.Resolve): In the
17088 Expression.MemberLookup call, use the queried_type as
17091 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17092 declared' attribute, it's always true.
17093 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17094 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17095 temporary wrapper for FindMembers which tells MemberLookup whether
17096 members from the base classes are included in the return value.
17097 This will go away soon.
17098 (TypeManager.MemberLookup): Use this temporary hack here; once the
17099 new MemberCache is completed, we don't need to do the DeclaredOnly
17100 looping here anymore since the MemberCache will take care of this.
17101 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17102 (MemberCache): When creating the MemberCache for a class, get
17103 members from the current class and all its base classes.
17104 (MemberCache.CacheEntry.Container): New field. This is a
17105 temporary hack until the Mono runtime is fixed to distinguish
17106 between ReflectedType and DeclaringType. It allows us to use MCS
17107 with both the MS runtime and the unfixed Mono runtime without
17108 problems and without accecting performance.
17109 (MemberCache.SearchMembers): The DeclaredOnly looping from
17110 TypeManager.MemberLookup is now done here.
17112 2002-08-14 Martin Baulig <martin@gnome.org>
17114 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17115 Type.GetFields on dynamic types but get the fields from the
17116 corresponding TypeContainer.
17117 (MyStructInfo.GetStructInfo): Added check for enum types.
17119 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17120 (MemberList.SyncRoot): Implemented.
17121 (TypeManager.FilterWithClosure): No need to check permissions if
17122 closure_start_type == closure_invocation_type, don't crash if
17123 closure_invocation_type is null.
17125 2002-08-13 Martin Baulig <martin@gnome.org>
17127 Rewrote TypeContainer.FindMembers to use a member cache. This
17128 gives us a speed increase of about 35% for the self-hosting MCS
17129 build and of about 15-20% for the class libs (both on GNU/Linux).
17131 * report.cs (Timer): New class to get enhanced profiling. This
17132 whole class is "TIMER" conditional since it remarkably slows down
17135 * class.cs (MemberList): New class. This is an IList wrapper
17136 which we're now using instead of passing MemberInfo[]'s around to
17137 avoid copying this array unnecessarily.
17138 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17139 (ICachingMemberFinder, IMemberContainer): New interface.
17140 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17141 has already been checked, otherwise use it for the name comparision.
17142 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17143 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17144 if possible. Returns a MemberList, not a MemberInfo [].
17145 (TypeHandle): New class, implements IMemberContainer. We create
17146 one instance of this class per type, it contains a MemberCache
17147 which is used to do the member lookups.
17148 (MemberCache): New class. Each instance of this class contains
17149 all members of a type and a name-based hash table.
17150 (MemberCache.FindMembers): This is our new member lookup
17151 function. First, it looks up all members of the requested name in
17152 the hash table. Then, it walks this list and sorts out all
17153 applicable members and returns them.
17155 2002-08-13 Martin Baulig <martin@gnome.org>
17157 In addition to a nice code cleanup, this gives us a performance
17158 increase of about 1.4% on GNU/Linux - not much, but it's already
17159 half a second for the self-hosting MCS compilation.
17161 * typemanager.cs (IMemberFinder): New interface. It is used by
17162 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17163 Enum, Delegate or Interface.
17164 (TypeManager.finder_to_member_finder): New PtrHashtable.
17165 (TypeManager.finder_to_container): Removed.
17166 (TypeManager.finder_to_delegate): Removed.
17167 (TypeManager.finder_to_interface): Removed.
17168 (TypeManager.finder_to_enum): Removed.
17170 * interface.cs (Interface): Implement IMemberFinder.
17172 * delegate.cs (Delegate): Implement IMemberFinder.
17174 * enum.cs (Enum): Implement IMemberFinder.
17176 * class.cs (TypeContainer): Implement IMemberFinder.
17178 2002-08-12 Martin Baulig <martin@gnome.org>
17180 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17182 2002-08-12 Martin Baulig <martin@gnome.org>
17184 * ecore.cs (ITypeExpression): New interface for expressions which
17186 (TypeExpression): Renamed to TypeLookupExpression.
17187 (Expression.DoResolve): If we're doing a types-only lookup, the
17188 expression must implement the ITypeExpression interface and we
17189 call DoResolveType() on it.
17190 (SimpleName): Implement the new ITypeExpression interface.
17191 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17192 hack, the situation that we're only looking up types can't happen
17193 anymore when this method is called. Moved the type lookup code to
17194 DoResolveType() and call it.
17195 (SimpleName.DoResolveType): This ITypeExpression interface method
17196 is now doing the types-only lookup.
17197 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17198 (ResolveFlags): Added MaskExprClass.
17200 * expression.cs (MemberAccess): Implement the ITypeExpression
17202 (MemberAccess.DoResolve): Added support for a types-only lookup
17203 when we're called via ITypeExpression.DoResolveType().
17204 (ComposedCast): Implement the ITypeExpression interface.
17206 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17207 Expression.Resolve() with ResolveFlags.Type instead.
17209 2002-08-12 Martin Baulig <martin@gnome.org>
17211 * interface.cs (Interface.Define): Apply attributes.
17213 * attribute.cs (Attribute.ApplyAttributes): Added support for
17214 interface attributes.
17216 2002-08-11 Martin Baulig <martin@gnome.org>
17218 * statement.cs (Block.Emit): Only check the "this" variable if we
17219 do not always throw an exception.
17221 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17222 whether the property has a set accessor.
17224 2002-08-11 Martin Baulig <martin@gnome.org>
17226 Added control flow analysis support for structs.
17228 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17229 with control flow analysis turned off.
17230 (IVariable): New interface.
17231 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17232 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17233 (FieldExpr.DoResolve): Resolve the instance expression with flow
17234 analysis turned off and do the definite assignment check after the
17235 resolving when we know what the expression will resolve to.
17237 * expression.cs (LocalVariableReference, ParameterReference):
17238 Implement the new IVariable interface, only call the flow analysis
17239 code if ec.DoFlowAnalysis is true.
17240 (This): Added constructor which takes a Block argument. Implement
17241 the new IVariable interface.
17242 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17243 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17244 This does the definite assignment checks for struct members.
17246 * class.cs (Constructor.Emit): If this is a non-static `struct'
17247 constructor which doesn't have any initializer, call
17248 Block.AddThisVariable() to tell the flow analysis code that all
17249 struct elements must be initialized before control returns from
17252 * statement.cs (MyStructInfo): New public class.
17253 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17254 argument to this indexer. If non-zero, check an individual struct
17255 member, not the whole struct.
17256 (FlowBranching.CheckOutParameters): Check struct members.
17257 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17258 overloaded versions of these methods which take an additional
17259 `int field_idx' argument to check struct members.
17260 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17261 overloaded versions of these methods which take an additional
17262 `string field_name' argument to check struct member.s
17263 (VariableInfo): Implement the IVariable interface.
17264 (VariableInfo.StructInfo): New public property. Returns the
17265 MyStructInfo instance of the variable if it's a struct or null.
17266 (Block.AddThisVariable): New public method. This is called from
17267 Constructor.Emit() for non-static `struct' constructor which do
17268 not have any initializer. It creates a special variable for the
17269 "this" instance variable which will be checked by the flow
17270 analysis code to ensure that all of the struct's fields are
17271 initialized before control returns from the constructor.
17272 (UsageVector): Added support for struct members. If a
17273 variable/parameter is a struct with N members, we reserve a slot
17274 in the usage vector for each member. A struct is considered fully
17275 initialized if either the struct itself (slot 0) or all its
17276 members are initialized.
17278 2002-08-08 Martin Baulig <martin@gnome.org>
17280 * driver.cs (Driver.MainDriver): Only report an error CS5001
17281 if there were no compilation errors.
17283 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17284 `UnsafeContext' property to determine whether the parent is in
17285 unsafe context rather than checking the parent's ModFlags:
17286 classes nested in an unsafe class are unsafe as well.
17288 2002-08-08 Martin Baulig <martin@gnome.org>
17290 * statement.cs (UsageVector.MergeChildren): Distinguish between
17291 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17292 we return. Added test17() and test18() to test-154.cs.
17294 2002-08-08 Martin Baulig <martin@gnome.org>
17296 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17297 Family access, make sure the invoking type isn't a subclass of the
17298 queried type (that'd be a CS1540).
17300 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17301 this method which takes an additional `Type invocation_type'.
17303 * expression.cs (BaseAccess.DoResolve): Use the base type as
17304 invocation and query type.
17305 (MemberAccess.DoResolve): If the lookup failed and we're about to
17306 report a CS0122, try a lookup with the ec.ContainerType - if this
17307 succeeds, we must report a CS1540.
17309 2002-08-08 Martin Baulig <martin@gnome.org>
17311 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17312 (MethodGroupExpr): Implement the IMemberExpr interface.
17314 * expression (MemberAccess.ResolveMemberAccess): No need to have
17315 any special code for MethodGroupExprs anymore, they're now
17318 2002-08-08 Martin Baulig <martin@gnome.org>
17320 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17321 Family, FamANDAssem and FamORAssem permissions.
17322 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17324 2002-08-08 Martin Baulig <martin@gnome.org>
17326 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17327 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17330 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17332 * driver.cs: implemented /resource option to embed managed resources.
17334 2002-08-07 Martin Baulig <martin@gnome.org>
17336 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17337 (FieldBase.HasFieldInitializer): New public property.
17338 (FieldBase.GetInitializerExpression): New public method. Resolves and
17339 returns the field initializer and makes sure it is only resolved once.
17340 (TypeContainer.EmitFieldInitializers): Call
17341 FieldBase.GetInitializerExpression to get the initializer, this ensures
17342 that it isn't resolved multiple times.
17344 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17345 the resolving process (SimpleName/MemberLookup) that we're currently
17346 emitting a field initializer (which must not access any instance members,
17347 this is an error CS0236).
17349 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17350 argument, if the `IsFieldInitializer' flag is set, we must report and
17351 error CS0236 and not an error CS0120.
17353 2002-08-07 Martin Baulig <martin@gnome.org>
17355 * ecore.cs (IMemberExpr): New public interface.
17356 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17357 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17358 if the expression is an IMemberExpr.
17360 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17361 to be null, implicitly default to `this' if we're non-static in
17362 this case. Simplified the code a lot by using the new IMemberExpr
17363 interface. Also fixed bug #28176 here.
17365 2002-08-06 Martin Baulig <martin@gnome.org>
17367 * cs-parser.jay (SimpleLookup): Removed. We need to create
17368 ParameterReferences during semantic analysis so that we can do a
17369 type-only search when resolving Cast, TypeOf and SizeOf.
17370 (block): Pass the `current_local_parameters' to the Block's
17373 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17374 argument to the constructor.
17375 (ConstructorInitializer.Resolve): Create a temporary implicit
17376 block with the parameters.
17378 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17379 references here if we aren't doing a type-only search.
17381 * statement.cs (Block): Added constructor which takes a
17382 `Parameters parameters' argument.
17383 (Block.Parameters): New public property.
17385 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17386 to `Parameters' and made it public readonly.
17388 2002-08-06 Martin Baulig <martin@gnome.org>
17390 * ecore.cs (Expression.Warning): Made this public as well.
17392 * report.cs (Report.Debug): Print the contents of collections.
17394 2002-08-06 Martin Baulig <martin@gnome.org>
17396 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17397 used to tell Resolve() which kinds of expressions it may return.
17398 (Expression.Resolve): Added overloaded version of this method which
17399 takes a `ResolveFlags flags' argument. This can be used to tell
17400 Resolve() which kinds of expressions it may return. Reports a
17402 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17403 ResolveFlags.SimpleName.
17404 (Expression.Error118): Added overloaded version of this method which
17405 takes a `ResolveFlags flags' argument. It uses the flags to determine
17406 which kinds of expressions are allowed.
17408 * expression.cs (Argument.ResolveMethodGroup): New public method.
17409 Resolves an argument, but allows a MethodGroup to be returned.
17410 This is used when invoking a delegate.
17412 * TODO: Updated a bit.
17414 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17416 Fixed compilation with csc.
17418 * ecore.cs: Expression.Error made public. Is this correct? Should
17419 Warning be made public too?
17421 * expression.cs: use ea.Location instead of ea.loc.
17422 [FIXME: Filed as bug #28607: MCS must report these errors.]
17424 2002-08-06 Martin Baulig <martin@gnome.org>
17426 * ecore.cs (Expression.loc): Moved the location here instead of
17427 duplicating it in all derived classes.
17428 (Expression.Location): New public property.
17429 (Expression.Error, Expression.Warning): Made them non-static and
17430 removed the location argument.
17431 (Expression.Warning): Added overloaded version which takes an
17432 `int level' argument.
17433 (Expression.Error118): Make this non-static and removed the
17434 expression and location arguments.
17435 (TypeExpr): Added location argument to the constructor.
17437 * expression.cs (StaticCallExpr): Added location argument to
17439 (Indirection, PointerArithmetic): Likewise.
17440 (CheckedExpr, UnCheckedExpr): Likewise.
17441 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17442 (StringPtr): Likewise.
17445 2002-08-05 Martin Baulig <martin@gnome.org>
17447 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17449 * assign.cs (Assign.DoResolve): Check whether the source
17450 expression is a value or variable.
17452 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17453 while resolving the corresponding blocks.
17455 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17456 an error, don't silently return null.
17458 * statement.cs (Block.AddVariable): Do the error reporting here
17459 and distinguish between CS0128 and CS0136.
17460 (Block.DoResolve): Report all unused labels (warning CS0164).
17461 (LabeledStatement): Pass the location to the constructor.
17462 (LabeledStatement.HasBeenReferenced): New property.
17463 (LabeledStatement.Resolve): Set it to true here.
17465 * statement.cs (Return.Emit): Return success even after reporting
17466 a type mismatch error (CS0126 or CS0127), this is what csc does and
17467 it avoids confusing the users with any consecutive errors.
17469 2002-08-05 Martin Baulig <martin@gnome.org>
17471 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17473 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17475 * expression.cs (MemberAccess.DoResolve): Silently return if an
17476 error has already been reported.
17478 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17479 error has already been reported.
17481 2002-08-05 Martin Baulig <martin@gnome.org>
17483 * statement.cs (UsageVector): Only initialize the `parameters'
17484 vector if we actually have any "out" parameters.
17486 2002-08-05 Martin Baulig <martin@gnome.org>
17488 * expression.cs (Binary.ResolveOperator): When combining delegates,
17489 they must have the same type.
17491 2002-08-05 Martin Baulig <martin@gnome.org>
17493 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17494 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17495 work with the ms runtime and we also don't need it: if we're a
17496 PropertyBuilder and not in the `indexer_arguments' hash, then we
17497 are a property and not an indexer.
17499 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17500 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17501 since the latter one doesn't work with the ms runtime.
17503 2002-08-03 Martin Baulig <martin@gnome.org>
17505 Fixed bugs #27998 and #22735.
17507 * class.cs (Method.IsOperator): New public field.
17508 (Method.CheckBase): Report CS0111 if there's already a method
17509 with the same parameters in the current class. Report CS0508 when
17510 attempting to change the return type of an inherited method.
17511 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17512 and it's not marked abstract or extern.
17513 (PropertyBase): New abstract base class for Property and Indexer.
17514 (PropertyBase.CheckBase): Moved here from Property and made it work
17516 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17517 the same so we can reuse it there.
17518 (Property, Indexer): Derive from PropertyBase.
17519 (MethodSignature.inheritable_property_signature_filter): New delegate
17520 to find properties and indexers.
17522 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17523 argument and improved error reporting.
17525 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17526 EmptyReadOnlyParameters and made it a property.
17528 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17529 version of this method which takes a `PropertyInfo indexer'.
17530 (TypeManager.RegisterIndexer): New method.
17532 * class.cs: Added myself as author of this file :-)
17534 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17536 * class.cs: fixed compilation on windoze.
17538 2002-08-03 Martin Baulig <martin@gnome.org>
17540 * interface.cs (Interface.GetInterfaceBases): Check whether all
17541 base interfaces are at least as accessible than the current one.
17543 * class.cs (TypeContainer.GetClassBases): Check whether base types
17544 are at least as accessible than the current type.
17545 (TypeContainer.AsAccessible): Implemented and made non-static.
17546 (MemberBase.CheckParameters): Report errors if the accessibility
17549 * delegate.cs (Delegate.Delegate): The default visibility is
17550 internal for top-level types and private for nested types.
17551 (Delegate.Define): Report errors if the accessibility checks fail.
17553 * enum.cs (Enum.Enum): The default visibility is internal for
17554 top-level types and private for nested types.
17555 (Enum.DefineType): Compute the correct visibility.
17557 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17558 function which takes a `bool is_toplevel' instead of a TypeContainer.
17560 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17563 2002-08-02 Martin Baulig <martin@gnome.org>
17565 * expression.cs (LocalVariableReferenc): Added constructor which
17566 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17567 (LocalVariableReference.IsReadOnly): New property.
17568 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17569 variable is readonly, use our own readonly flag to do this; you can
17570 use the new constructor to get a writable reference to a read-only
17573 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17574 reference to the local variable.
17576 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17578 * rootcontext.cs (ResolveCore): Also include System.Exception
17580 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17581 we reach an EmptyStatement.
17583 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17586 * expression.cs (Binary.ResolveOperator): Check error result in
17589 use brtrue/brfalse directly and avoid compares to null.
17591 2002-08-02 Martin Baulig <martin@gnome.org>
17593 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17594 Fixes bug #28407, added test-155.cs.
17596 2002-08-01 Martin Baulig <martin@gnome.org>
17598 * class.cs (Event.EmitDefaultMethod): Make this work with static
17599 events. Fixes #28311, added verify-3.cs.
17601 2002-08-01 Martin Baulig <martin@gnome.org>
17603 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17604 `is_disposable' fields.
17605 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17606 `hm.is_disposable' if we're using the collection pattern.
17607 (Foreach.EmitCollectionForeach): Use the correct type for the
17608 enumerator's local variable, only emit the try/finally block if
17609 necessary (fixes #27713).
17611 2002-08-01 Martin Baulig <martin@gnome.org>
17613 * ecore.cs (Expression.report118): Renamed to Error118 and made
17616 * statement.cs (Throw.Resolve): Check whether the expression is of
17617 the correct type (CS0118) and whether the type derives from
17618 System.Exception (CS0155).
17619 (Catch.Resolve): New method. Do the type lookup here and check
17620 whether it derives from System.Exception (CS0155).
17621 (Catch.CatchType, Catch.IsGeneral): New public properties.
17623 * typemanager.cs (TypeManager.exception_type): Added.
17625 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17627 * driver.cs: Updated About function.
17629 2002-07-31 Martin Baulig <martin@gnome.org>
17631 Implemented Control Flow Analysis.
17633 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17634 (EmitContext.CurrentBranching): Added.
17635 (EmitContext.StartFlowBranching): Added.
17636 (EmitContext.EndFlowBranching): Added.
17637 (EmitContext.KillFlowBranching): Added.
17638 (EmitContext.IsVariableAssigned): Added.
17639 (EmitContext.SetVariableAssigned): Added.
17640 (EmitContext.IsParameterAssigned): Added.
17641 (EmitContext.SetParameterAssigned): Added.
17642 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17643 Added control flow analysis stuff here.
17645 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17646 resolve the expression as lvalue.
17647 (LocalVariableReference.DoResolve): Check whether the variable has
17648 already been assigned.
17649 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17650 the parameter as assigned here.
17651 (ParameterReference.DoResolve): Check whether the parameter has already
17653 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17654 expression as lvalue.
17656 * statement.cs (FlowBranching): New class for the flow analysis code.
17657 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17658 (LabeledStatement.IsDefined): New public property.
17659 (LabeledStatement.AddUsageVector): New public method to tell flow
17660 analyis that the label may be reached via a forward jump.
17661 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17663 (VariableInfo.Number): New public field. This is used by flow analysis
17664 to number all locals of a block.
17665 (Block.CountVariables): New public property. This is the number of
17666 local variables in this block (including the locals from all parent
17668 (Block.EmitMeta): Number all the variables.
17670 * statement.cs: Added flow analysis support to all classes.
17672 2002-07-31 Martin Baulig <martin@gnome.org>
17674 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17675 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17676 then use this argument.
17678 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17680 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17681 use this to specify /define options.
17683 2002-07-29 Martin Baulig <martin@gnome.org>
17685 * statement.cs (Fixed): Moved all code that does variable lookups
17686 and resolvings from Emit to Resolve.
17688 * statement.cs (For): Moved all code that does variable lookups
17689 and resolvings from Emit to Resolve.
17691 * statement.cs (Using): Moved all code that does variable lookups
17692 and resolvings from Emit to Resolve.
17694 2002-07-29 Martin Baulig <martin@gnome.org>
17696 * attribute.cs (Attribute.Resolve): Explicitly catch a
17697 System.NullReferenceException when creating the
17698 CustromAttributeBuilder and report a different warning message.
17700 2002-07-29 Martin Baulig <martin@gnome.org>
17702 * support.cs (ParameterData.ParameterName): Added method to
17703 get the name of a parameter.
17705 * typemanager.cs (TypeManager.IsValueType): New public method.
17707 2002-07-29 Martin Baulig <martin@gnome.org>
17709 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17710 is a flag which specifies that it's either ref or out.
17711 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17712 the out parameter to `out Parameter.Modifier mod', also set the
17713 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17715 * support.cs (InternalParameters.ParameterModifier): Distinguish
17716 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17717 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17719 * expression.cs (Argument.GetParameterModifier): Distinguish
17720 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17721 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17723 2002-07-29 Martin Baulig <martin@gnome.org>
17725 * expression.cs (ParameterReference.ParameterReference): Added
17726 `Location loc' argument to the constructor.
17728 * cs-parser.jay: Pass location to ParameterReference.
17730 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17732 * statement.cs (Try): Initialize the location.
17734 * cs-parser.jay: pass location to Try.
17736 * expression.cs (Unary.Reduce): Change the prototype to return
17737 whether a constant fold could be performed or not. The result is
17738 returned in an out parameters. In the case of Indirection and
17739 AddressOf, we want to perform the full tests.
17741 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17743 * statement.cs (Statement.Emit): Flag dead code.
17745 2002-07-27 Andrew Birkett <andy@nobugs.org>
17747 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17749 2002-07-27 Martin Baulig <martin@gnome.org>
17751 * class.cs (MethodData.Define): Put back call to
17752 TypeManager.AddMethod(), accidentally commented this out.
17754 * report.cs (Debug): New public method to print debugging information,
17755 this is `[Conditional ("DEBUG")]'.
17757 2002-07-26 Martin Baulig <martin@gnome.org>
17759 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17760 (switch_statement): Push the current_block to the switch_stack and
17761 pop it again when we're done with the switch.
17762 (switch_section): The new block is a child of the current_block.
17763 Fixes bug #24007, added test-152.cs.
17765 2002-07-27 Martin Baulig <martin@gnome.org>
17767 * expression.cs (Invocation.EmitArguments): When calling a varargs
17768 function with only its fixed arguments, we need to pass an empty
17771 2002-07-27 Martin Baulig <martin@gnome.org>
17773 Mono 0.13 has been released.
17775 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17777 * driver.cs: Rename --resource to --linkres, because that is what
17778 we do currently, we dont support --resource yet.
17780 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17782 2002-07-25 Martin Baulig <martin@gnome.org>
17784 * class.cs (MethodData): New public class. This is a `method builder'
17785 class for a method or one accessor of a Property/Indexer/Event.
17786 (MethodData.GetMethodFlags): Moved here from MemberBase.
17787 (MethodData.ApplyAttributes): Likewise.
17788 (MethodData.ApplyObsoleteAttribute): Likewise.
17789 (MethodData.ApplyConditionalAttribute): Likewise.
17790 (MethodData.ApplyDllImportAttribute): Likewise.
17791 (MethodData.CheckAbstractAndExternal): Likewise.
17792 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17793 (MethodData.Emit): Formerly known as Method.Emit().
17794 (MemberBase): Moved everything which was specific to a single
17795 accessor/method to MethodData.
17796 (Method): Create a new MethodData and call Define() and Emit() on it.
17797 (Property, Indexer, Event): Create a new MethodData objects for each
17798 accessor and call Define() and Emit() on them.
17800 2002-07-25 Martin Baulig <martin@gnome.org>
17802 Made MethodCore derive from MemberBase to reuse the code from there.
17803 MemberBase now also checks for attributes.
17805 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17806 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17808 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17809 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17810 (MemberBase.ApplyAttributes): New virtual method; applies the
17811 attributes to a method or accessor.
17812 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17813 (MemberBase.ApplyConditionalAttribute): Likewise.
17814 (MemberBase.ApplyDllImportAttribute): Likewise.
17815 (MemberBase.CheckAbstractAndExternal): Likewise.
17816 (MethodCore.ParameterTypes): This is now a property instead of a
17817 method, it's initialized from DoDefineParameters().
17818 (MethodCore.ParameterInfo): Removed the set accessor.
17819 (MethodCore.DoDefineParameters): New protected virtual method to
17820 initialize ParameterTypes and ParameterInfo.
17821 (Method.GetReturnType): We can now simply return the MemberType.
17822 (Method.GetMethodFlags): Override the MemberBase version and add
17823 the conditional flags.
17824 (Method.CheckBase): Moved some code from Define() here, call
17825 DoDefineParameters() here.
17826 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17827 here to avoid some larger code duplication.
17828 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17829 ensure that abstract and external accessors don't declare a body.
17831 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17832 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17833 lookup in the attribute's parent classes, so we need to abort as soon
17834 as we found the first match.
17835 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17836 the attribute has no arguments.
17838 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17841 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17843 * cs-parser.jay: reverted previous patch.
17845 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17847 * cs-parser.jay: fixed bug #22119.
17849 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17851 * attribute.cs: fixed compilation. The error was:
17852 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17853 be assigned to before control leaves the current method."
17854 [FIXME: Filed as bug #28186: MCS must report this error.]
17856 2002-07-25 Martin Baulig <martin@gnome.org>
17858 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17859 method to pull the condition name ouf of a Conditional attribute.
17860 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17861 the obsolete message and error flag out of an Obsolete attribute.
17863 * class.cs (Method.GetMethodFlags): New public method to get the
17864 TypeManager.MethodFlags for this method.
17865 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17867 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17868 if we're overriding a virtual function, set the new private variable
17869 `parent_method'; call the new TypeManager.AddMethod().
17871 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17872 the MethodBuilder and the Method in a PtrHashtable.
17873 (TypeManager.builder_to_method): Added for this purpose.
17874 (TypeManager.MethodFlags): Added IsObsoleteError.
17875 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17876 Obsolete and Conditional arguments in MethodBuilders. If we discover
17877 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17878 the message from the attribute.
17880 2002-07-24 Martin Baulig <martin@gnome.org>
17882 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17883 preprocessor directives, ensure that the argument to #define/#undef is
17884 exactly one identifier and that it's actually an identifier.
17886 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17889 2002-07-24 Martin Baulig <martin@gnome.org>
17891 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17892 initialize it to TypeManager.object_type in the constructor.
17893 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17894 of the `hm.get_current' method if we're using the collection pattern.
17895 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17896 for the explicit conversion to make it work when we're using the collection
17897 pattern and the `Current' property has a different return type than `object'.
17900 2002-07-24 Martin Baulig <martin@gnome.org>
17902 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17903 does not match, but don't report any errors. This method is called in
17904 order for all methods in a MethodGroupExpr until a matching method is
17905 found, so we don't want to bail out if the first method doesn't match.
17906 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17907 matches, report the 123. Fixes #28070.
17909 2002-07-24 Martin Baulig <martin@gnome.org>
17911 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17912 TypeManager.TypeToCoreType() to the top of the method so the
17913 following equality checks will work. Fixes #28107.
17915 2002-07-24 Martin Baulig <martin@gnome.org>
17917 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17918 operand is of type uint, and the other operand is of type sbyte,
17919 short or int, the operands are converted to type long." -
17920 Actually do what this comment already told us. Fixes bug #28106,
17923 2002-07-24 Martin Baulig <martin@gnome.org>
17925 * class.cs (MethodBase): New abstract class. This is now a base
17926 class for Property, Indexer and Event to avoid some code duplication
17927 in their Define() and DefineMethods() methods.
17928 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17929 generic methods for Define() and DefineMethods().
17930 (FieldBase): Derive from MemberBase, not MemberCore.
17931 (Property): Derive from MemberBase, not MemberCore.
17932 (Property.DefineMethod): Moved all the code from this method to the
17933 new MethodBase.DefineAccessor(), just call it with appropriate
17935 (Property.Define): Call the new Property.DoDefine(), this does some
17936 sanity checks and we don't need to duplicate the code everywhere.
17937 (Event): Derive from MemberBase, not MemberCore.
17938 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17939 accessors, this will also make them work with interface events.
17940 (Indexer): Derive from MemberBase, not MemberCore.
17941 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17942 (Indexer.Define): Use the new MethodBase functions.
17944 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17945 argument to the constructor.
17946 (Interface.FindMembers): Added support for interface events.
17947 (Interface.PopluateEvent): Implemented.
17949 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17951 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17953 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17954 but this is required to check for a method name being the same as
17955 the containing class.
17959 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17961 * interface.cs: initialize variable.
17963 2002-07-23 Martin Baulig <martin@gnome.org>
17965 Implemented the IndexerName attribute in interfaces.
17967 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17968 name if this is an explicit interface implementation.
17969 (Indexer.InterfaceIndexerName): New public variable. If we're
17970 implementing an interface indexer, this is the IndexerName in that
17971 interface. Otherwise, it's the IndexerName.
17972 (Indexer.DefineMethod): If we're implementing interface indexer,
17973 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17974 and Pending.ImplementIndexer methods.
17975 (Indexer.Define): Also define the PropertyBuilder if we're
17976 implementing an interface indexer and this is neither an explicit
17977 interface implementation nor do the IndexerName match the one in
17980 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17981 If a method is defined here, then we always need to create a proxy
17982 for it. This is used when implementing interface indexers.
17983 (Pending.IsInterfaceIndexer): New public method.
17984 (Pending.ImplementIndexer): New public method.
17985 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17986 This is used when implementing interface indexers to define a proxy
17988 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17989 define a proxy if necessary.
17991 * interface.cs (Interface.IndexerName): New public variable.
17992 (Interface.PopulateIndexer): Set the IndexerName.
17993 (Interface.DefineIndexers): New private method. Populate all the
17994 indexers and make sure their IndexerNames match.
17996 * typemanager.cs (IndexerPropertyName): Added support for interface
17999 2002-07-22 Martin Baulig <martin@gnome.org>
18001 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18002 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18003 ret if HasReturnLabel.
18004 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18007 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18008 and set the ec.LoopBeginTryCatchLevel.
18009 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18010 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18011 the current ec.TryCatchLevel, the branch goes out of an exception
18012 block. In this case, we need to use Leave and not Br.
18014 2002-07-22 Martin Baulig <martin@gnome.org>
18016 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18017 block unless the block does not always return or it is contained in
18018 another try { ... } catch { ... } block. Fixes bug #26506.
18019 Added verify-1.cs to the test suite.
18021 2002-07-22 Martin Baulig <martin@gnome.org>
18023 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18024 then we do not always return. Fixes bug #24985.
18026 2002-07-22 Martin Baulig <martin@gnome.org>
18028 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18029 lookup on a per-class level; ie. walk up the class hierarchy until we
18030 found at least one applicable method, then choose the best among them.
18031 Fixes bug #24463 and test-29.cs.
18033 2002-07-22 Martin Baulig <martin@gnome.org>
18035 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18036 return types of the methods. The return type is not part of the
18037 signature and we must not check it to make the `new' modifier work.
18038 Fixes bug #27999, also added test-147.cs.
18039 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18041 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18042 on the method's return type.
18044 2002-07-21 Martin Baulig <martin@gnome.org>
18046 * assign.cs: Make this work if the rightmost source is a constant and
18047 we need to do an implicit type conversion. Also adding a few more tests
18048 to test-38.cs which should have caught this.
18050 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18051 target in the makefile for this. The makefile.gnu is primarily intended
18052 for end-users who don't want to debug the compiler.
18054 2002-07-21 Martin Baulig <martin@gnome.org>
18056 * assign.cs: Improved the Assign class so it can now handle embedded
18057 assignments (X = Y = Z = something). As a side-effect this'll now also
18058 consume less local variables. test-38.cs now passes with MCS, added
18059 a few new test cases to that test.
18061 2002-07-20 Martin Baulig <martin@gnome.org>
18063 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18064 instructions. Fixes bug #27977, also added test-146.cs.
18066 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18068 * cs-tokenizer.cs: fixed getHex ().
18070 2002-07-19 Martin Baulig <martin@gnome.org>
18072 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18073 not Type.GetType() to lookup the array type. This is needed when
18074 we're constructing an array of a user-defined type.
18075 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18076 single-dimensional arrays, but also for single-dimensial arrays of
18079 2002-07-19 Martin Baulig <martin@gnome.org>
18081 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18082 this function is called, it's not allowed to share LocalBuilders
18083 among ILGenerators.
18085 2002-07-19 Martin Baulig <martin@gnome.org>
18087 * expression.cs (Argument.Resolve): Report an error 118 when trying
18088 to pass a type as argument.
18090 2002-07-18 Martin Baulig <martin@gnome.org>
18092 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18093 Conv_R_Un for the signed `long' type.
18095 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18097 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18098 `expr' for the temporary result, as that will fail if we do
18099 multiple resolves on the same expression.
18101 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18103 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18104 ec.TypeContainer for looking up aliases.
18106 * class.cs (TypeContainer): Remove LookupAlias from here.
18108 * decl.cs (DeclSpace); Move here.
18110 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18112 * class.cs (FindMembers): Only call filter if the constructor
18113 bulider is not null.
18115 Also handle delegates in `NestedTypes' now. Now we will perform
18116 type lookups using the standard resolution process. This also
18119 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18120 This uses Expressions (the limited kind that can be parsed by the
18121 tree) instead of strings.
18123 * expression.cs (ComposedCast.ToString): Implement, used to flag
18124 errors since now we have to render expressions.
18126 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18129 * ecore.cs (SimpleName.ToString): ditto.
18131 * cs-parser.jay: Instead of using strings to assemble types, use
18132 Expressions to assemble the type (using SimpleName, ComposedCast,
18133 MemberAccess). This should fix the type lookups in declarations,
18134 because we were using a different code path for this.
18136 * statement.cs (Block.Resolve): Continue processing statements
18137 even when there is an error.
18139 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18141 * class.cs (Event.Define): Also remove the `remove' method from
18142 the list of pending items.
18144 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18145 generate more compact code.
18147 2002-07-17 Martin Baulig <martin@gnome.org>
18149 * const.cs (Const.LookupConstantValue): Add support for constant
18150 `unchecked' and `checked' expressions.
18151 Also adding test case test-140.cs for this.
18153 2002-07-17 Martin Baulig <martin@gnome.org>
18155 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18156 check whether mi.ReturnType implements the IEnumerator interface; the
18157 `==' and the IsAssignableFrom() will fail in this situation.
18159 2002-07-16 Ravi Pratap <ravi@ximian.com>
18161 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18164 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18166 * expression.cs: fixed bug #27811.
18168 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18170 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18171 Molaro: when we are a ref, the value already contains a pointer
18172 value, do not take the address of it.
18174 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18175 * removed mb-parser.jay and mb-tokenizer.cs
18177 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18179 * expression.cs: check against the building corlib void type.
18181 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18183 * ecore.cs: fix for valuetype static readonly fields: when
18184 initializing them, we need their address, not the address of a copy.
18186 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18188 * typemanager.cs: register also enum_type in corlib.
18190 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18192 * class.cs: allow calling this (but not base) initializers in structs.
18194 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18196 * ecore.cs: make sure we compare against the building base types
18199 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18201 * typemanager.cs: fix TypeToCoreType() to handle void and object
18202 (corlib gets no more typerefs after this change).
18204 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18206 * expression.cs (ArrayCreation.EmitArrayArguments): use
18207 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18209 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18210 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18211 array indexes, the runtime actually forbids them.
18213 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18214 for array arguments here.
18216 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18217 instead of the default for ValueTypes.
18219 (New.DoEmit): Use IsValueType instead of
18220 IsSubclassOf (value_type)
18221 (New.DoResolve): ditto.
18222 (Invocation.EmitCall): ditto.
18224 * assign.cs (Assign): ditto.
18226 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18227 Statements *are* currently doing part of their resolution during
18230 Expressions do always resolve during resolve, but statements are
18231 only required to propagate resolution to their children.
18233 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18235 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18237 (LoadAssembly): Do not add the dll if it is already specified
18239 (MainDriver): Add the System directory to the link path at the end,
18240 after all the other -L arguments.
18242 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18243 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18244 ldelem.u1) and using the opposite for sbytes.
18246 This fixes Digger, and we can finally run it.
18248 * driver.cs (UnixParseOption): Move the option parsing here.
18249 (CSCParseOption): Implement CSC-like parsing of options.
18251 We now support both modes of operation, the old Unix way, and the
18252 new CSC-like way. This should help those who wanted to make cross
18253 platform makefiles.
18255 The only thing broken is that /r:, /reference: and /lib: are not
18256 implemented, because I want to make those have the same semantics
18257 as the CSC compiler has, and kill once and for all the confussion
18258 around this. Will be doing this tomorrow.
18260 * statement.cs (Unsafe.Resolve): The state is checked during
18261 resolve, not emit, so we have to set the flags for IsUnsfe here.
18263 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18265 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18266 not catch the Error_ObjectRefRequired in SimpleName (as it is
18267 possible to have a class/instance variable name that later gets
18268 deambiguated), we have to check this here.
18270 2002-07-10 Ravi Pratap <ravi@ximian.com>
18272 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18273 make static and put into Expression.
18275 (Event.Define): Register the private field of the event with the
18276 TypeManager so that GetFieldFromEvent can get at it.
18278 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18279 keep track of the private field associated with an event which
18282 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18285 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18287 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18289 * expression.cs (Binary.EmitBranchable): this routine emits the
18290 Binary expression in a branchable context. This basically means:
18291 we need to branch somewhere, not just get the value on the stack.
18293 This works together with Statement.EmitBoolExpression.
18295 * statement.cs (Statement.EmitBoolExpression): Use
18298 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18300 * statement.cs (For): Reduce the number of jumps in loops.
18302 (For): Implement loop inversion for the For statement.
18304 (Break): We can be breaking out of a Try/Catch controlled section
18305 (foreach might have an implicit try/catch clause), so we need to
18306 use Leave instead of Br.
18308 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18309 now). If the instace expression supports IMemoryLocation, we use
18310 the AddressOf method from the IMemoryLocation to extract the
18311 address instead of emitting the instance.
18313 This showed up with `This', as we were emitting the instance
18314 always (Emit) instead of the Address of This. Particularly
18315 interesting when This is a value type, as we dont want the Emit
18316 effect (which was to load the object).
18318 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18320 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18322 * statement.cs (Checked): Set the CheckedState during the resolve
18323 process too, as the ConvCast operations track the checked state on
18324 the resolve process, and not emit.
18326 * cs-parser.jay (namespace_member_declaration): Flag that we have
18327 found a declaration when we do. This is used to flag error 1529
18329 * driver.cs: Report ok when we display the help only.
18331 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18333 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18335 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18337 * cs-tokenizer.cs (define): We also have to track locally the
18338 defines. AllDefines is just used for the Conditional Attribute,
18339 but we also need the local defines for the current source code.
18341 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18343 * statement.cs (While, For, Do): These loops can exit through a
18344 Break statement, use this information to tell whether the
18345 statement is the last piece of code.
18347 (Break): Flag that we break.
18349 * codegen.cs (EmitContexts): New `Breaks' state variable.
18351 2002-07-03 Martin Baulig <martin@gnome.org>
18353 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18354 modifiers in method declarations in structs. Otherwise, you won't
18355 be able to override things like Object.Equals().
18357 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18359 * class.cs (Method, Property, Indexer): Do not allow the public
18360 modifier to be used in explicit interface implementations.
18362 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18363 override modifiers in method declarations in structs
18365 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18367 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18368 integer or real overflow, report an error
18370 2002-07-02 Martin Baulig <martin@gnome.org>
18372 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18373 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18374 to tell the runtime about our newly created System.Object and
18375 System.ValueType types.
18377 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18379 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18380 struct instead of Ldarg/Starg.
18382 2002-07-02 Martin Baulig <martin@gnome.org>
18384 * expression.cs (Indirection.Indirection): Call
18385 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18387 2002-07-02 Martin Baulig <martin@gnome.org>
18389 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18390 ValueType, call TypeManager.TypeToCoreType() on it.
18391 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18392 the OpCodes.Newarr argument.
18394 2002-07-02 Martin Baulig <martin@gnome.org>
18396 * expression.cs (Invocation.EmitCall): When compiling corlib,
18397 replace all calls to the system's System.Array type to calls to
18398 the newly created one.
18400 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18401 System.Array methods.
18402 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18403 from the system's System.Array type which must be replaced.
18405 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18407 * typemanager.cs: load unverifiable_code_ctor so we can build
18408 corlib using the correct type. Avoid using GetTypeCode() with
18410 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18411 TypeManager.object_type to allow building corlib.
18413 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18415 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18417 2002-07-01 Martin Baulig <martin@gnome.org>
18419 * class.cs: Make the last change actually work, we need to check
18420 whether `ifaces != null' to avoid a crash.
18422 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18424 * class.cs: when we build structs without fields that implement
18425 interfaces, we need to add the interfaces separately, since there is
18426 no API to both set the size and add the interfaces at type creation
18429 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18431 * expression.cs: the dimension arguments to the array constructors
18432 need to be converted if they are a long.
18434 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18436 * class.cs: don't emit ldarg.0 if there is no parent constructor
18437 (fixes showstopper for corlib).
18439 2002-06-29 Martin Baulig <martin@gnome.org>
18441 MCS now compiles corlib on GNU/Linux :-)
18443 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18444 ie. check for MethodImplOptions.InternalCall.
18446 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18447 and TypeManager.attribute_type are null, so we must explicitly check
18448 whether parent is not null to find out whether it's an attribute type.
18449 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18450 and SetBuilder, not only if the property is neither abstract nor external.
18451 This is necessary to set the MethodImplOptions on the accessor methods.
18452 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18453 SetBuilder, see Property.Emit().
18455 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18456 populate "System.Object", "System.ValueType" and "System.Attribute" since
18457 they've already been populated from BootCorlib_PopulateCoreTypes().
18459 2002-06-29 Martin Baulig <martin@gnome.org>
18461 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18462 is the NullLiteral, we also need to make sure that target_type is not
18465 2002-06-29 Martin Baulig <martin@gnome.org>
18467 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18468 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18469 before calling BootstrapCorlib_ResolveDelegate ().
18471 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18473 * statement.cs: fixed build-breaker. All tests passed ok.
18475 2002-06-27 Martin Baulig <martin@gnome.org>
18477 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18478 for System.Decimal when compiling corlib.
18480 2002-06-27 Martin Baulig <martin@gnome.org>
18482 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18483 switch blocks which contain nothing but a default clause.
18485 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18487 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18489 2002-06-27 Martin Baulig <martin@gnome.org>
18491 * ecore.cs (PropertyExpr.PropertyExpr): Call
18492 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18494 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18495 is already a TypeBuilder.
18497 2002-06-27 Martin Baulig <martin@gnome.org>
18499 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18500 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18501 the "from an array-type to System.Array" case. This makes it work
18502 when compiling corlib.
18504 2002-06-27 Martin Baulig <martin@gnome.org>
18506 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18507 non-static PropertyExpr, set its InstanceExpression. This makes
18508 the `ICollection.Count' property work in System/Array.cs.
18510 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18512 * driver.cs: Made error handling more consistent. Errors now
18513 tracked by Report class, so many methods which used to return int
18514 now return void. Main() now prints success/failure and
18515 errors/warnings message.
18517 Renamed '--probe' compiler argument to '--expect-error'. Removed
18518 the magic number return values (123 and 124). Now, if the
18519 expected error occurs, the compiler exits with success (exit value
18520 0). If the compilation completes without seeing that particular
18521 error, the compiler exits with failure (exit value 1). The
18522 makefile in mcs/errors has been changed to handle the new behaviour.
18524 * report.cs: Made 'expected error' number a property and renamed
18525 it from 'Probe' to 'ExpectedError'.
18527 * genericparser.cs: Removed error handling support, since it is
18528 now all done by Report class.
18530 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18531 class, so parse() no longer returns an int.
18533 * namespace.cs: Use Report.Error instead of GenericParser.error
18535 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18537 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18538 TypeContainer.AddOperator): At the front of the list put the
18539 explicit implementations, so they get resolved/defined first.
18541 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18543 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18544 interface type is implemented by this TypeContainer. Used during
18545 explicit interface implementation.
18547 (Property.Define, Indexer.Define, Method.Define): Validate that
18548 the given interface in the explicit implementation is one of the
18549 base classes for the containing type.
18551 Also if we are explicitly implementing an interface, but there is
18552 no match in the pending implementation table, report an error.
18554 (Property.Define): Only define the property if we are
18555 not explicitly implementing a property from an interface. Use the
18556 correct name also for those properties (the same CSC uses,
18557 although that is really not needed).
18559 (Property.Emit): Do not emit attributes for explicitly implemented
18560 properties, as there is no TypeBuilder.
18562 (Indexer.Emit): ditto.
18564 Hiding then means that we do not really *implement* a pending
18565 implementation, which makes code fail.
18567 2002-06-22 Martin Baulig <martin@gnome.org>
18569 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18570 the return value of Object.GetType(). [FIXME: we need to do this whenever
18571 we get a type back from the reflection library].
18573 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18575 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18577 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18579 * attribute.cs: Return null if we can not look up the type.
18581 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18582 the interface types found.
18584 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18585 interface types found.
18587 * typemanager.cs (GetInterfaces): Make this routine returns alll
18588 the interfaces and work around the lame differences between
18589 System.Type and System.Reflection.Emit.TypeBuilder in the results
18590 result for GetInterfaces.
18592 (ExpandInterfaces): Given an array of interface types, expand and
18593 eliminate repeated ocurrences of an interface. This expands in
18594 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18597 2002-06-21 Martin Baulig <martin@gnome.org>
18599 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18602 2002-06-21 Martin Baulig <martin@gnome.org>
18604 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18605 and called with one of the core types, return the corresponding typebuilder for
18608 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18611 2002-06-21 Martin Baulig <martin@gnome.org>
18613 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18614 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18615 (Expression.ConvertReferenceExplicit): Likewise.
18617 * expression.cs (ElementAccess.DoResolve): Likewise.
18618 (ElementAccess.DoResolveLValue): Likewise.
18620 2002-06-10 Martin Baulig <martin@gnome.org>
18622 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18623 add the "value" parameter to the parameter list.
18625 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18628 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18630 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18631 the argument to an int, uint, long or ulong, per the spec. Also
18632 catch negative constants in array creation.
18634 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18636 * class.cs: do not allow the same interface to appear twice in
18637 the definition list.
18639 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18641 * ecore.cs: don't use ldlen with System.Array.
18643 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18645 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18647 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18649 * modifiers.cs: produce correct field attributes for protected
18650 internal. Easy fix so miguel can work on ther harder stuff:-)
18652 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18654 * pending.cs: New file. Move the code from class.cs here.
18655 Support clearning the pending flag for all methods (when not doing
18656 explicit interface implementation).
18658 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18660 * rootcontext.cs: added a couple more types needed to bootstrap.
18662 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18664 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18665 constructor in the type, instead of any constructor in the type
18666 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18667 a bug in the Mono runtime when applying the params attribute).
18669 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18670 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18672 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18674 * expression.cs (Unary.ResolveOperator): Use TypeManager
18675 to resolve the type.
18677 2002-06-13 Ravi Pratap <ravi@ximian.com>
18679 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18682 * enum.cs (AddEnumMember): Add support to store the attributes associated
18683 with each member too.
18685 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18686 field builders too - this takes care of the enum member case.
18688 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18690 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18691 address-of operator on both value types and pointers.
18693 2002-06-10 Martin Baulig <martin@gnome.org>
18695 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18696 PropertyBuilder to the `property_builders' list.
18698 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18699 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18700 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18701 find any indexers which are inherited from an interface.
18703 2002-06-09 Martin Baulig <martin@gnome.org>
18705 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18706 the same type as the constant if necessary. There's also a test-130.cs
18709 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18711 * typemanager.cs (TypeManager.ChangeType): Previously known as
18712 Enum.ChangeEnumType().
18714 2002-06-09 Martin Baulig <martin@gnome.org>
18716 * expression.cs (Cast.TryReduce): Added support for consts.
18718 2002-06-08 Ravi Pratap <ravi@ximian.com>
18720 * class.cs (Accessor): Hold attributes information so we can pass
18723 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18724 Modify to pass in attributes attached to the methods.
18726 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18728 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18729 to handle the Accessor kind :-)
18731 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18733 2002-06-08 Martin Baulig <martin@gnome.org>
18735 * expression.cs (Unary.TryReduceNegative): Added support for
18738 2002-06-08 Martin Baulig <martin@gnome.org>
18740 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18741 name can't be found in the `defined_names' - the caller will do a
18742 MemberLookup in this case and thus find methods in System.Enum
18743 such as Enum.IsDefined().
18745 2002-06-08 Martin Baulig <martin@gnome.org>
18747 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18748 Convert.ChangeType() which works with TypeBuilder created types.
18749 (Enum.LookupEnumValue, Enum.Define): Use it here.
18751 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18752 `TypeBuilder.BaseType != null' check.
18753 (TypeContainer.FindMembers): Only lookup parent members if we
18754 actually have a parent.
18755 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18756 (ConstructorInitializer.Resolve): Likewise.
18758 * interface.cs (Interface.FindMembers): Added
18759 `TypeBuilder.BaseType != null' check.
18761 * rootcontext.cs (RootContext.ResolveCore): Added
18762 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18763 classes_second_stage.
18765 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18766 debug_type and trace_type when compiling with --nostdlib.
18768 2002-06-07 Martin Baulig <martin@gnome.org>
18770 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18771 (AddField): Set it to true when adding a non-static field.
18772 (DefineType): Use `have_nonstatic_fields' to find out whether we
18773 have non-static fields, not `Fields != null'.
18775 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18777 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18778 dereferencing a null on the static-field code path)
18780 2002-05-30 Martin Baulig <martin@gnome.org>
18782 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18783 to take command line arguments. Use reflection to call the new
18784 custom `Initialize' function on the symbol writer and pass it the
18785 command line arguments.
18787 * driver.cs (--debug-args): New command line argument to pass command
18788 line arguments to the symbol writer.
18790 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18792 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18793 the target type for indexers and properties. Thanks to Joe for
18796 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18798 * typemanager.cs (MethodFlags): returns the method flags
18799 (Obsolete/ShouldIgnore) that control warning emission and whether
18800 the invocation should be made, or ignored.
18802 * expression.cs (Invocation.Emit): Remove previous hack, we should
18803 not do this on matching a base type, we should do this based on an attribute
18805 Only emit calls to System.Diagnostics.Debug and
18806 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18807 on the command line.
18809 * rootcontext.cs: Global settings for tracing and debugging.
18811 * cs-tokenizer.cs (define): New utility function to track
18812 defines. Set the global settings for TRACE and DEBUG if found.
18814 2002-05-25 Ravi Pratap <ravi@ximian.com>
18816 * interface.cs (Populate*): Pass in the TypeContainer as well as
18817 the DeclSpace as parameters so that we can create EmitContexts and
18818 then use that to apply attributes etc.
18820 (PopulateMethod, PopulateEvent, PopulateProperty)
18821 (PopulateIndexer): Apply attributes everywhere.
18823 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18826 (ApplyAttributes): Update accordingly.
18828 We now apply interface attributes for all members too.
18830 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18832 * class.cs (Indexer.Define); Correctly check if we are explicit
18833 implementation (instead of checking the Name for a ".", we
18834 directly look up if the InterfaceType was specified).
18836 Delay the creation of the PropertyBuilder.
18838 Only create the PropertyBuilder if we are not an explicit
18839 interface implementation. This means that explicit interface
18840 implementation members do not participate in regular function
18841 lookups, and hence fixes another major ambiguity problem in
18842 overload resolution (that was the visible effect).
18844 (DefineMethod): Return whether we are doing an interface
18847 * typemanager.cs: Temporary hack until we get attributes in
18848 interfaces (Ravi is working on that) and we get IndexerName
18849 support in interfaces.
18851 * interface.cs: Register the indexers as properties.
18853 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18854 warning, I have verified that this is a bug in the .NET runtime
18855 (JavaScript suffers of the same problem).
18857 * typemanager.cs (MemberLookup): When looking up members for
18858 interfaces, the parent of an interface is the implicit
18859 System.Object (so we succeed in searches of Object methods in an
18860 interface method invocation. Example: IEnumerable x; x.ToString
18863 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18865 * class.cs (Event): Events should also register if they do
18866 implement the methods that an interface requires.
18868 * typemanager.cs (MemberLookup); use the new GetInterfaces
18871 (GetInterfaces): The code used to lookup interfaces for a type is
18872 used in more than one place, factor it here.
18874 * driver.cs: Track the errors at the bottom of the file, we kept
18877 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18878 instance if the method we are calling is static!
18880 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18882 * attribute.cs (ApplyAttributes): Make this function filter out
18883 the IndexerName attribute (as that attribute in reality is never
18884 applied) and return the string constant for the IndexerName
18887 * class.cs (TypeContainer.Emit): Validate that all the indexers
18888 have the same IndexerName attribute, and if so, set the
18889 DefaultName attribute on the class.
18891 * typemanager.cs: The return value might contain other stuff (not
18892 only methods). For instance, consider a method with an "Item"
18893 property and an Item method.
18895 * class.cs: If there is a problem with the parameter types,
18898 2002-05-24 Ravi Pratap <ravi@ximian.com>
18900 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18901 looks at user defined conversion after making a call to
18902 StandardConversionExists - we need this for overload resolution.
18904 * expression.cs : Update accordingly the various method calls.
18906 This fixes 2 bugs filed against implicit user defined conversions
18908 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18910 * statement.cs: Track the result of the assignment.
18912 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18914 * expression.cs (MemberAccess): Improved error reporting for
18915 inaccessible members.
18917 2002-05-22 Martin Baulig <martin@gnome.org>
18919 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18920 itself with debugging support.
18922 2002-05-22 Martin Baulig <martin@gnome.org>
18924 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18925 Removed, this isn't needed anymore.
18927 2002-05-20 Martin Baulig <martin@gnome.org>
18929 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18930 be underlying type for an enum.
18932 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18934 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18935 that splits out the loading of just the core types.
18937 * rootcontext.cs (ResolveCore): Split the struct resolution in
18938 two, so we can load the enumeration underlying types before any
18941 * expression.cs (Is): Bandaid until we fix properly Switch (see
18942 bug #24985 for details).
18944 * typemanager.cs (ImplementsInterface): The hashtable will contain
18945 a null if there are no interfaces implemented.
18947 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18949 * cs-parser.jay (indexer_declarator): It is fine to have array
18952 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18954 * typemanager.cs: (RegisterBuilder): New function used to register
18955 TypeBuilders that implement interfaces. Since
18956 TypeBuilder.GetInterfaces (as usual) does not work with lame
18958 (AddUserType): register interfaces.
18960 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18961 dealing with TypeBuilder. Also, arrays are showing up as
18962 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18963 methods can not be invoked on them!
18965 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18966 (ImplicitReferenceConversionExists): Split out from
18967 StandardConversionExists.
18969 * expression.cs (As): We were only implementing one of the three
18970 cases for the as operator. We now implement them all.
18971 (Is): Implement the various other cases for Is as well.
18973 * typemanager.cs (CACHE): New define used to control if we want or
18974 not the FindMembers cache. Seems to have a negative impact on
18975 performance currently
18977 (MemberLookup): Nested types have full acess to
18978 enclosing type members
18980 Remove code that coped with instance/static returns for events, we
18981 now catch this in RealFindMembers.
18983 (RealFindMembers): only perform static lookup if the instance
18984 lookup did not return a type or an event.
18986 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18988 * assign.cs (CompoundAssign): We pass more semantic information
18989 now to Compound Assignments than we did before: now we have all
18990 the information at hand, and now we resolve the target *before* we
18991 do the expression expansion, which allows the "CacheValue" method
18992 to have the effect we intended (before, a [x] += 1 would generate
18993 two differen ArrayAccess expressions from the ElementAccess,
18994 during the resolution process).
18996 (CompoundAssign.DoResolve): Resolve target and original_source here.
18998 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19000 * expression.cs (ArrayAccess): dropped debugging information.
19002 * typemanager.cs: Small bug fix: I was always returning i_members,
19003 instead of one of i_members or s_members (depending on which had
19006 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19007 method is invoked before any code generation takes place, and it
19008 is a mechanism to inform that the expression will be invoked more
19009 than once, and that the method should use temporary values to
19010 avoid having side effects
19012 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19014 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19017 * expression.cs (Indirection, ArrayAccess): Add support for
19018 CacheTemporaries in these two bad boys.
19020 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19021 ldobj or ldind_ref.
19022 (StoreFromPtr): Handle stobj as well.
19024 * expression.cs (UnaryMutator): Share more code.
19026 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19027 down: I was not tracking the Filter function as well, which
19028 was affecting the results of the cache.
19030 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19032 * attribute.cs: Remove the hack to handle the CharSet property on
19035 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19037 * attribute.cs (DoResolve): More uglyness, we now only try to
19038 resolve the attribute partially, to extract the CharSet
19039 information (only if we are a StructLayout attribute). Otherwise
19041 (GetExtraTypeInfo): Add some code to conditionally kill in the
19042 future this. I am more and more convinced that the .NET
19043 framework has special code to handle the attribute setting on
19046 * expression.cs (IsParamsMethodApplicable): Revert my previous
19047 foreach change here, it was wrong.
19049 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19051 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19052 (pp_expr): do not abort on unknown input, just return.
19053 (eval): abort if there are pending chars.
19055 * attribute.cs (Attribute.Resolve): Positional parameters are
19056 optional. Deal with that case.
19058 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19059 the Ansi/Unicode/Auto information for the type.
19061 (TypeContainer.DefineType): instantiate the EmitContext here, as
19062 we will be using it during the type definition (to resolve
19063 attributes) and during the emit phase.
19065 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19066 to pull type information out of the attributes
19068 (Attribute.Resolve): track the constructor builder, and allow for
19069 multiple invocations (structs and classes will use this).
19071 * ecore.cs (MemberLookupFinal): new version with all the
19072 parameters customizable.
19074 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19075 constructors. Return if the result value is null (as the error
19076 would have been flagged already by MemberLookupFinal)
19078 Do not allow instances of abstract classes or interfaces to be
19081 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19082 We have to compare the assembly property here when dealing with
19083 FamANDAssem and Assembly access modifiers, because we might be
19084 creating an assembly from *modules* (that means that we are not
19085 getting TypeBuilders for types defined in other modules that are
19086 part of this assembly).
19088 (Method.Emit): If the method is marked abstract and has a body,
19091 (TypeContainer.DefineMembers): If both the defined member and the
19092 parent name match are methods, then do not emit any warnings: let
19093 the Method.Define routine take care of flagging warnings. But if
19094 there is a mismatch (method overrides something else, or method is
19095 overriwritten by something, then emit warning).
19097 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19098 set to null, this means `do not check for the return type on the
19101 (Method.Define): set the return type for the method signature to
19102 null, so that we get methods with the same name and parameters and
19103 different return types. This is used to flag warning 114 (you are
19104 hiding a method, and you probably want to use the new/override
19107 * typemanager.cs (MemberLookup): Implemented proper access
19108 control, closing a long standing set of bug reports. The problem
19109 was that the Framework only has two bits: Public and NonPublic,
19110 and NonPublic includes private and protected methods, but we need
19111 to enforce the FamANDAssem, FamOrAssem and Family.
19113 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19115 * statement.cs (GotoCase): Return true: Ammounts to giving up
19116 knowledge on whether we return or not, and letting the other case
19117 be responsible for it.
19119 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19121 * driver.cs: Do not load directories for each file processed, only
19122 do it if there is a pattern.
19124 * ecore.cs: Report readonly assigns here as well, as we might have
19125 been resolved only by MemberAccess.
19127 (SimpleName.SimpleNameResolve): Also be useful for LValue
19128 resolution. We need this to propagate assign to local readonly variables
19130 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19131 do not want to reuse potential criteria memory.
19133 * class.cs (MyEventBuilder): Set reflected_type;
19135 * ecore.cs (Constantify): Added support for constifying bools.
19137 (RootContext.LookupType): Added a cache for values looked up in
19138 the declaration space.
19140 * typemanager.cs (FindMembers): Now is a front-end to
19141 RealFindMembers, and provides a two-level hashtable-based cache to
19144 15% performance improvement: from 22.5 to 19.2 seconds.
19146 * expression.cs (IsParamsMethodApplicable): use foreach.
19147 (Invocation.DoResolve): ditto.
19148 (New.DoResolve): ditto.
19149 (ArrayCreation.DoResolve): ditto.
19151 * ecore.cs (FindMostEncompassingType): use foreach.
19153 * delegate.cs (NewDelegate.DoResolve): Use foreach
19155 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19156 (RemoveMethods): use foreach.
19158 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19159 nested foreach statements instead of for, and also break out of
19160 the inner loop once a match is found.
19162 (Invocation.OverloadResolve): Use foreach, simplify the code.
19164 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19166 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19167 we actually unwrap the expression to allow for extra information
19170 * expression.cs: Use Shr_Un on unsigned operations.
19172 2002-05-08 Ravi Pratap <ravi@ximian.com>
19174 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19175 applicable operators was not being considered correctly. This closes
19176 the bug Miguel reported.
19178 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19180 * attribute.cs: check that the type derives from System.Attribute
19181 and report the correct error in that case (moved the duplicate code to
19182 its own method, too).
19184 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19186 * attribute.cs: lookup attribute type name as the spec says: first the
19187 bare attribute name and then name + "Attribute" (nant compiles with
19188 mcs after this fix).
19190 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19192 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19193 Because of the way we parse things, we should try to see if a
19194 UIntConstant can fit in an integer.
19196 2002-05-07 Ravi Pratap <ravi@ximian.com>
19198 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19199 when we are in an explicit context.
19201 (ConvertReferenceExplicit): When converting from Iface type S to Class
19202 T make sure the rules are implemented as an OR.
19204 * parameter.cs (ParameterType): Make it a property for now although the
19205 purpose really isn't anything immediate.
19207 * expression.cs (Is*Applicable): Do better checking on the parameter type
19208 of a ref/out parameter. The ones from the system assemblies are already
19209 marked with the correct type so we don't need to do any correction.
19211 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19212 the object type is standard too so include that.
19214 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19216 * ecore.cs (StandardConversionExists): Augment with missing code:
19217 deal with IntConstant, LongConstants and Enumerations.
19219 * assign.cs: Report the error, instead of failing silently
19221 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19222 typecontainer that they are declared, because the
19223 typecontainer/namespace will have the list of using clauses that
19224 need to be applied.
19226 Assembly Attributes were escaping the normal registration
19229 (EmitCode): Apply attributes within an EmitContext that represents
19230 the container they were declared on.
19232 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19234 2002-05-06 Ravi Pratap <ravi@ximian.com>
19236 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19237 Revamp completely - make much cleaner as we now operate only
19240 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19241 to implement the logic detailed in the spec more correctly.
19243 (UserDefinedConversion): Update accordingly.
19245 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19247 * statement.cs: Return flow analysis information up.
19249 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19252 (token): Do not consume an extra character before calling
19255 2002-05-06 Piers Haken <piersh@friskit.com>
19257 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19259 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19261 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19262 EmitContext during the instance constructor initializer
19263 resolution, to stop access to instance variables.
19265 This is mandated by the spec, last paragraph of the `constructor
19266 initializers' section.
19268 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19270 * cs-parser.jay, class.cs (Accessor): new class used to represent
19271 an accessor (get or set). In the past we used `null' to represent
19272 a missing accessor. But this is ambiguous because there was no
19273 way to tell in abstract indexers/properties if one of them was
19276 Now there is a way of addressing that.
19278 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19279 instead of FindMembers.
19281 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19282 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19284 * attribute.cs: Treat indexers and properties as the same in terms
19285 of applying attributes
19287 * ecore.cs (FindMostEncompassedType): Use statically initialized
19288 EmptyExpressions()s like we do elsewhere to avoid creating useless
19289 objects (and we take this out of the tight loop).
19291 (GetConversionOperators): Move the code to extract the actual
19292 operators to a separate routine to clean things up.
19294 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19296 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19297 events are always registered FieldBuilders.
19299 * class.cs (FieldBase): New class shared by Fields
19301 * delegate.cs: If we are a toplevel delegate, use our full name.
19302 If we are a nested delegate, then only use our tail name.
19304 2002-05-02 Ravi Pratap <ravi@ximian.com>
19306 * expression.cs (IsApplicable): Ensure that we add the "&" to
19307 ref/out types before comparing it with the type of the argument.
19309 (IsParamsMethodApplicable): Ditto.
19311 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19314 * delegate.cs : Handle the case when we have more than one applicable
19315 method. Flag an error only when we finish checking all.
19317 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19319 * expression.cs: Add support for boolean static initializers.
19321 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19323 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19325 * parameter.cs (ComputeParameterTypes,
19326 ComputeAndDefineParameterTypes): Better error handling: now we
19327 clear the `types' cache if we fail during any of the type lookups.
19328 We also return the status code correctly to our caller
19330 * delegate.cs: If we fail to define a delegate, abort the extra
19333 * expression.cs (Binary.ResolveOperator): for
19334 operator==(object,object) and operator !=(object, object) we also
19335 have to verify that there is an implicit conversion from one to
19338 (ArrayAccess.DoResolve): Array Access can operate on
19341 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19343 * assign.cs (CompoundAssign): A new class used as a "flag" that
19344 the assignment actually is happening as part of a compound
19345 assignment operator.
19347 During compound assignment, a few new rules exist to enable things
19354 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19355 to the type of x) if y is implicitly convertible to the type of x,
19356 and the operator is a builtin operator and the return type of the
19357 operator is explicitly convertible to the type of x.
19359 * rootcontext.cs: Reset warning level to 2. 4 catches various
19360 "interesting" features in mcs, we must clean this up at some
19361 point, but currently am trying to kill other bugs ;-)
19363 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19364 in container classes as well.
19366 * expression.cs (Binary.ResolveOperator): Handle string case
19367 before anything else (as operator overloading does emit an error
19368 before doing anything else).
19370 This code could go away when we move to a table driven model, but
19371 i could not come up with a good plan last night.
19373 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19375 * typemanager.cs (CSharpName): reimplementation using regex.
19376 * class.cs: added null check for fields in Emit
19377 * rootcontext.cs: set warninglevel to 4
19379 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19381 * typemanager.cs (CSharpName): reimplemented with Lupus
19384 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19386 * statement.cs (If): correclty implement Resolve, because we were
19387 not catching sem errors in there. The same process is needed
19389 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19392 (Statement.Warning_DeadCodeFound): Factorize code.
19393 (While): Report dead code here too.
19395 (Statement): Added Resolve virtual method to allow
19396 for resolution split from the emit code.
19398 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19400 * statement.cs (EmitBoolExpression): No longer try to resolve the
19402 (MakeBoolean): New utility function that resolve, implicitly
19403 converts to boolean and tags the expression.
19406 (If, Do): Implement dead code elimination.
19407 (While): Implement loop inversion
19409 (Do, While, For, If): Resolve the expression prior to calling our
19412 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19415 - added method Report28 (warning: program has more than one entry point)
19416 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19417 - modified method Method.Define, the part at the end of the method
19419 * rootcontext.cs: added static public Location EntryPointLocation;
19421 * ../errors/cs0028.cs : Add test case for the above warning.
19424 - modified method CSharpName to allow arrays of primitive type to
19425 be printed nicely (e.g. instead of System.Int32[][] it now prints
19427 - added method CSharpSignature: returns the signature of a method
19428 in string format to be used in reporting errors, warnings, etc.
19430 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19433 2002-04-26 Ravi Pratap <ravi@ximian.com>
19435 * delegate.cs (Define): Fix extremely silly bug where I was
19436 setting the type of the 'object' parameter of the BeginInvoke
19437 method to System.IAsyncResult instead of System.Object ;-)
19439 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19441 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19444 (Constructor.Emit): return if we fail to initialize the
19445 constructor. Another door closed!
19447 * expression.cs (New.DoResolve): Improve error message (from -6 to
19448 1501). Use DeclaredOnly lookup to find the exact constructor.
19450 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19451 loop. This is useful.
19453 * cs-parser.jay: Adjust the default parameters so that destructors
19454 have the proper signature.
19456 2002-04-26 Martin Baulig <martin@gnome.org>
19458 * driver.cs (LoadAssembly): If `assembly' contains any characters
19459 which are only valid in path names and not in assembly names
19460 (currently slash, backslash and point), use Assembly.LoadFrom ()
19461 instead of Assembly.Load () on the `assembly' (before iteration
19462 over the link_paths).
19464 2002-04-26 Martin Baulig <martin@gnome.org>
19466 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19468 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19470 * class.cs (Property): use the new typemanager.MemberLookup
19472 (TypeContainer.MemberLookup): Implement using the
19473 TypeManager.MemberLookup now.
19475 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19476 and return MemberInfos, so that these can be used without an
19477 EmitContext (what we had before).
19479 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19481 * expression.cs: Fix the case where the argument to params if the
19482 type of the params. I omitted handling this before. Fixed
19484 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19486 * driver.cs: Call BootCorlib_PopulateCoreType
19488 * class.cs (Property.CheckBase): Check for properties only, not
19491 * interface.cs: Temporary hack: try/catch around the
19492 CustomAttributeBuilder, because I am getting an exception that I
19495 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19496 types whose definitions are required to be there (attributes are
19497 defined before standard types).
19499 Compute definitions as we boot the various types, as they are used
19500 immediately (value_type class will need object_type, but if we do
19501 not initialize object_type, we will pass a null, which will let
19502 the runtime pick the System.Object from the existing corlib, which
19503 is not what we want).
19505 2002-04-22 Patrik Torstensson <totte@labs2.com>
19507 * cs-tokenizer.cs: fixed a number of trim() issues.
19509 2002-04-22 Ravi Pratap <ravi@ximian.com>
19511 * expression.cs (Argument.Type): Ensure that we return the correct
19512 type when we have out or ref parameters [in which case we
19515 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19517 * class.cs (Property, Indexer): Allow extern modifier in there.
19519 * typemanager.cs (InitBaseTypes): Initializes object_type and
19520 value_type, since those will be used early on during the bootstrap
19521 process to compile corlib.
19523 (InitCoreTypes): Move code from here to InitBaseTypes.
19525 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19527 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19528 single-dimension arrays as using the ldlen opcode.
19530 Daniel Lewis discovered this optimization.
19532 * typemanager.cs: Add signature for System.Array::get_Length
19534 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19536 * statement.cs: report the error when the foreach does not apply to an
19537 array nor a collection.
19539 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19541 * expression.cs: Add implicit conversions to the operator ~.
19543 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19545 * typemanager.cs: Locate the decimal constructor.
19547 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19549 * attribute.cs: use the new property of TypeOf.
19550 * expression.cs: added 'get' property around typearg.
19552 These changes fix a build breaker reported by NickD. Is this the
19553 correct way to fix? If not, please, revert my changes and make it
19556 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19558 * attribute.cs: Add support for typeof in attribute invocations.
19559 I am not sure that this is right though.
19561 2002-04-14 Duncan Mak <duncan@ximian.com>
19563 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19564 Binary.Operator.Division case.
19566 2002-04-13 Ravi Pratap <ravi@ximian.com>
19568 * class.cs (DefineType): Ensure that we do a proper check on
19569 attribute types and also register it with the TypeManager.
19571 (TypeContainer.Targets): The default for attribute types is
19572 AttributeTargets.All.
19574 * attribute.cs (ApplyAttributes): Registering the attribute type
19575 is done elsewhere, not when we discover we have a Usage attribute.
19577 2002-04-12 Ravi Pratap <ravi@ximian.com>
19579 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19580 and get rid of is_delegate parameter.
19582 * everywhere : update.
19584 2002-04-12 Ravi Pratap <ravi@ximian.com>
19586 * cs-parser.jay (compilation_unit): Revamp completely to use
19587 some new ideas that I got from Rhys' grammar to solve the problems
19588 with assembly level attributes.
19590 (outer_declaration): New grammar production.
19592 (attribute_sections): Add.
19594 (opt_attributes): Base on attribute_sections
19596 (namespace_declaration): Allow opt_attributes to tackle the case
19597 when we have assembly level attributes - we are clever in this
19600 * attribute.cs (ApplyAttributes): Do not worry about assembly
19601 attributes in the non-global context.
19603 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19604 instead of SetGlobalAttributes.
19606 * class.cs, rootcontext.cs : Ensure we define and generate
19607 attribute types before anything else.
19609 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19610 and flag the new error -20 for the case when the attribute type
19611 does not have valid targets specified. csc does not catch this.
19613 * ../errors/errors.txt : update for error # -20
19615 2002-04-11 Ravi Pratap <ravi@ximian.com>
19617 * support.cs (InternalParameters.ParameterModifier): Do some null
19618 checking and return sane values.
19620 * class.cs (Method.Define): If we are a PInvoke method, ensure
19621 that we are static and extern. Report error # 601
19623 * ../errors/cs0601.cs : Add test case for the above error.
19625 2002-04-07 Ravi Pratap <ravi@ximian.com>
19627 * rootcontext.cs (attribute_types): We need to keep type of
19628 all attribute types separately and emit code for them first.
19630 (RegisterAttribute) : Implement.
19632 * class.cs (DefineType): Check if the current Type is a custom
19633 attribute type and register it accordingly.
19635 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19636 adding the first attribute twice and rename to
19638 (SetGlobalAttributes): this.
19640 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19643 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19644 if we are processing global arguments. Hmm, I am unsure of this.
19646 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19648 * expression.cs: added static array of strings to avoid calling
19649 Enum.ToString () for Operator in Binary. Significant recover of
19652 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19654 * class.cs (FindMembers): Allow the Builders of the various
19655 members to be null. If they are skip them. This only happens
19656 during the PInvoke declaration.
19658 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19660 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19661 failure, so we do not keep going afterwards.
19663 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19664 wanted to pass `false' as the `is_delegate' argument. If this is
19665 the case, why not use delegate_type == null to mean `is_delegate =
19666 false' and anything else as is_delegate = true.
19668 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19670 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19671 code for the section, not the beginning of the tests.
19673 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19675 * cfold.cs: Handle operator + (Enum x, Underlying x)
19677 * expression.cs (Binary): same. Warn about errors where we have
19678 Enum/Enum in operator + as well.
19680 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19683 - added support for switch(bool)
19684 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19685 - add TableSwitchEmit() to handle table-based switch statements
19687 2002-04-05 Ravi Pratap <ravi@ximian.com>
19689 * expression.cs (Invocation.OverloadResolve): Factor out code which
19690 does parameter compatibility checking with arguments so that we can
19691 re-use the code even from Delegate.VerifyApplicability
19693 (VerifyArgumentsCompat): Move above code here.
19695 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19696 and instead make a call to the above method.
19698 2002-03-31 Ravi Pratap <ravi@ximian.com>
19700 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19701 We use it to keep track of classes which are attribute types.
19703 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19705 * delegate.cs (Delegate.Define): Correctly define the types in the
19706 presence of fixed and array parameters.
19708 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19711 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19712 include NonPublic after the first iteration.
19714 * class.cs (Indexer.CheckBase): Only check if both parents are
19717 * cs-parser.jay (accessor_body): If empty, set to null.
19719 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19720 same code path here to resolve constants names that we did have in
19721 MemberAccess.DoResolve. There is too much code duplicated here.
19723 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19725 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19727 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19730 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19731 tokens, numbers and strings.
19733 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19736 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19737 asyncronous parameters and the regular parameters.
19739 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19740 specify the target directory.
19742 * expression.cs: (This.DoResolve): Simplify
19743 (As.Emit): Optimize, do not generate IsInst if the expression is
19744 always of the given type.
19746 (Is.DoResolve): Bug fix, we were reporting both always/never for
19749 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19750 creating too many unnecessary arrays.
19752 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19754 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19755 fields instead of rolling our own initializer. Takes care of all
19756 implicit conversions, and drops unnecessary static checks/argument.
19758 2002-03-31 Dick Porter <dick@ximian.com>
19760 * driver.cs: use the GetDirectories() return values properly, and
19761 use "/" as path separator.
19763 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19765 * expression.cs (Unary): Optimize - - expr into expr.
19766 (Binary): Optimize a + (-b) into a -b.
19768 * codegen.cs (CodeGen): Made all methods static.
19770 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19774 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19775 TypeBuilder property.
19777 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19780 * tree.cs: Removed the various RecordXXXX, and replaced with a
19781 single RecordDecl. Removed all the accessor methods, and just
19782 left a single access point Type
19784 * enum.cs: Rename DefineEnum to DefineType.
19786 * decl.cs: New abstract method `DefineType' used to unify the
19787 Defines for Enumerations, Interfaces, TypeContainers and
19790 (FindType): Moved LookupInterfaceOrClass here. Moved the
19791 LookupBaseClasses method that used to live in class.cs and
19792 interface.cs here, and renamed to FindType.
19794 * delegate.cs: Implement DefineType. Take advantage of the
19795 refactored pattern for locating the parent builder without taking
19796 the parent_builder argument (which we know does not work if we are
19797 nested, and triggering a toplevel definition).
19799 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19801 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19802 accessibility of a member has changed during override and report
19805 * class.cs (Method.Define, Property.Define): Only complain on
19806 overrides if the method is private, any other accessibility is
19807 fine (and since we just checked the permission is the same, we are
19810 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19811 and elif are processed always. The other pre-processing
19812 directives are only processed if we are "taking" the path
19814 2002-03-29 Martin Baulig <martin@gnome.org>
19816 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19817 current location is not Null.
19819 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19820 a separate method so we can profile it.
19822 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19823 `span.Seconds' are just seconds, but no minutes or hours.
19824 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19826 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19828 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19829 Remove the gratuitous set of Final:
19831 // If an interface implementation, then we can set Final.
19832 if (((flags & MethodAttributes.Abstract) == 0) &&
19833 implementing.DeclaringType.IsInterface)
19834 flags |= MethodAttributes.Final;
19836 I do not know what I was smoking when I used that.
19839 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19840 step into fixing the name resolution issues for delegates and
19841 unifying the toplevel name resolution.
19843 2002-03-28 Martin Baulig <martin@gnome.org>
19845 * class.cs (Method.Emit): If we have a symbol writer, call its
19846 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19847 tell it about the current method.
19849 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19850 writer that we're going to emit the first byte of IL code for a new
19851 statement (a new source line).
19852 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19853 EmitContext.Mark() before emitting any code.
19855 * location.cs (SymbolDocument): Return null when we're Null.
19857 * statement.cs (Statement): Moved the `Location loc' variable here.
19858 (Statement.EmitBoolExpression): If we have a symbol writer, call
19859 ec.Mark() before emitting any code to tell it that we're at the
19860 beginning of a new statement.
19861 (StatementExpression): Added `Location' argument to the constructor.
19862 (Block): Added public readonly variable `StartLocation' and public
19863 variable `EndLocation'. The latter is to be set using SetEndLocation().
19864 (Block): Added constructor which takes a start and end location.
19865 (Block.SetEndLocation): New method. This sets the end location.
19866 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19867 local variables we create.
19868 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19869 each statement and do also mark the begin and end of the block.
19871 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19872 tell it the current lexer.Location, use Location.Null for the end of the
19874 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19875 current block, set its end location using SetEndLocation().
19876 (statement_expression): StatementExpression constructor now takes the
19877 lexer.Location as additional argument.
19878 (for_statement, declare_local_variables): Likewise.
19879 (declare_local_variables): When creating a new implicit block, use the
19880 new Block constructor and pass it the lexer.Location.
19882 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19884 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19885 members also on the parent interfaces recursively.
19887 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19889 * report.cs: Use new formats, since Gonzalo finished the missing
19892 * expression.cs (Binary.ResolveOperator): added missing operator|
19893 operator& and operator^ for bool/bool.
19895 * cs-parser.jay: CheckDef now takes a Location argument that is
19896 used to report errors more precisly (instead of reporting the end
19897 of a definition, we try to track something which is a lot closer
19898 to the source of the problem).
19900 * cs-tokenizer.cs: Track global token use, so we can properly flag
19901 the use of #define/#undef after the first token has been seen.
19903 Also, rename the reportXXXX to Error_DescriptiveName
19905 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19906 TypeContainer, so that Enum and Interface can use this too.
19908 * class.cs (TypeContainer.LookupInterfaceOrClass,
19909 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19910 `builder' argument. Typically this was used to pass the parent
19911 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19914 The problem is that a nested class could trigger the definition of
19915 a toplevel class, and the builder would be obviously wrong in that
19918 So we drop this argument, and we compute dynamically the
19919 TypeBuilder/ModuleBuilder (the correct information was available
19920 to us anyways from DeclSpace.Parent)
19922 * interface.cs (Interface.DefineInterface): Drop builder
19923 parameter cleanup like class.cs
19925 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19928 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19931 (Try.Emit): Propagate the returns value from the statement.
19933 (Return.Emit): Even if we are leavning
19935 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19937 * modifiers.cs: Fix the computation of MethodAttributes flags.
19939 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19941 * driver.cs: allow compilation of files that start with '/'.
19942 Add a default case when checking the argument of --target.
19944 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19946 * interface.cs: Implement the same search algorithm for types in
19947 the interface code.
19949 * delegate.cs: Do not allow multiple definition.
19951 * Recovered ChangeLog that got accidentally amputated
19953 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19955 * rootcontext.cs: Load manually enum to allow core classes to
19956 contain enumerations.
19958 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19959 Update to new static methods in TypeManager.
19961 * typemanager.cs (GetMethod, GetConstructor): Use our
19962 implementation of FindMembers to find the members, since during
19963 corlib compilation, the types are TypeBuilders and GetMethod and
19964 GetConstructor do not work.
19966 Make all methods in TypeManager static.
19968 (InitCodeHelpers): Split the functionality from
19969 the InitCodeTypes function.
19971 * driver.cs: Call InitCodeHelpers after we have populated the
19974 * cs-parser.jay (delegate_declaration): we did not used to compute
19975 the delegate name correctly for void delegates.
19977 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19979 * rootcontext.cs (RootContext): Init the interface_resolve_order
19980 and type_container_resolve_order always.
19982 (ResolveCore, BootstrapCorlib_ResolveClass,
19983 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19984 compiler when compiling with --nostdlib
19986 * class.cs (TypeContainer.DefineType): Check that our parent is
19987 not null. This test is most important when we are bootstraping
19990 * codegen.cs: Split out the symbol writing code.
19992 2002-03-25 Martin Baulig <martin@gnome.org>
19994 * driver.cs (-g): Made -g an alias for --debug.
19996 2002-03-24 Martin Baulig <martin@gnome.org>
19998 * codegen.cs (SymbolWriter): New public variable. Returns the
19999 current symbol writer.
20000 (CodeGen): Added `bool want_debugging_support' argument to the
20001 constructor. If true, tell the ModuleBuild that we want debugging
20002 support and ask it for the ISymbolWriter.
20003 (Save): If we have a symbol writer, call it's Close() method after
20004 saving the assembly.
20006 * driver.c (--debug): New command line argument to create a
20007 debugger information file.
20009 * location.cs (SymbolDocument): New public property. Returns an
20010 ISymbolDocumentWriter object for the current source file or null
20011 if we don't have a symbol writer.
20013 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20015 * driver.cs (LoadAssembly): Correctly return when all the paths
20016 have been tried and not before.
20018 * statement.cs (Switch.Emit): return the actual coverage for this
20019 statement (returns/not-returns)
20021 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20022 switch of the statement if we are the last switch section. That
20023 kills two problems: try/catch problems (we used to emit an empty
20024 nop at the end) and switch statements where all branches would
20027 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20029 * driver.cs: Add default assemblies (the equivalent to the
20030 Microsoft CSC.RSP file)
20032 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20033 also update tokens_seen and set it to false.
20035 * driver.cs: Implement --recurse for Mike.
20037 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20038 correctly splitting out the paths.
20040 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20042 * interface.cs (Interface.PopulateProperty): Instead of using
20043 `parent' as the declaration space for the set parameters, use
20046 * support.cs (InternalParameters): InternalParameters constructor
20047 takes a DeclSpace instead of a TypeContainer.
20049 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20050 types are being initialized, load the address of it before calling
20053 (New): Provide a mechanism to disable the generation of local
20054 value type temporaries when the caller will be providing us with
20055 an address to store it.
20057 (ArrayCreation.EmitDynamicInitializers): Use it.
20059 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20061 * expression.cs (Invocation.EmitArguments): Only probe for array
20062 property if there is more than one argument. Sorry about that.
20064 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20065 empty param arrays.
20067 * class.cs (Method.LabelParameters): Fix incorrect code path that
20068 prevented the `ParamArrayAttribute' from being applied to the
20071 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20073 * support.cs (ReflectionParameters): Correctly compute whether the
20074 last argument is a params array. Fixes the problem with
20077 * typemanager.cs: Make the assemblies array always be non-null
20078 (empty, but non-null)
20080 * tree.cs (RecordDecl): New function that abstracts the recording
20081 of names. This reports error 101, and provides a pointer to the
20082 previous declaration. Fixes a crash in the compiler.
20084 * cs-parser.jay (constructor_declaration): Update to new grammar,
20085 and provide a constructor_body that can be empty.
20087 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20089 * driver.cs: Add support for --resources.
20091 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20092 Make all types for the various array helper methods be integer.
20094 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20095 CheckState to ConvCast.
20097 (ConvCast): Now it takes a `checked' state argument, to avoid
20098 depending on the emit context for the conversion, and just using
20099 the resolve time setting.
20101 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20102 instead of Invocation.EmitArguments. We do not emit the original
20103 arguments, instead we emit those which have been converted to
20104 unsigned int expressions.
20106 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20108 * codegen.cs: ditto.
20110 * expression.cs (LocalVariableReference): Drop the use of the
20111 Store function that depended on the variable index.
20113 * statement.cs (VariableInfo): Drop the `Idx' property from this
20114 class, as this is not taking into account the indexes for
20115 temporaries tat we generate during the execution, getting the
20118 * class.cs: First emit class initializers, then call the parent
20121 * expression.cs (Binary): Fix opcode emision.
20122 (UnaryMutator.EmitCode): Support checked code generation
20124 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20125 matches for events for both the Static and Instance scans,
20126 pointing to the same element. Fix that.
20128 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20130 * rootcontext.cs (ResolveTree): Always set the
20131 interface_resolve_order, because nested interfaces will be calling
20134 * class.cs (GetInterfaceOrClass): Track the same resolution
20135 process used by TypeManager.LookupType. This fixes the nested
20136 type lookups in class declarations (separate path from
20139 (TypeContainer.DefineType): Also define nested interfaces.
20140 (TypeContainer.RegisterOrder): New public function used to
20141 register the order in which child interfaces need to be closed.
20143 Nested interfaces need to be closed after their parents have been
20146 * interface.cs (InterfaceAttr): Put all the logic for computing
20147 the interface attribute here.
20149 (DefineInterface): Register our interface order with the
20150 RootContext or with the TypeContainer depending on the case.
20152 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20154 * cs-parser.jay: rework foreach statement to work with the new
20155 changes to the policy on SimpleNames.
20157 * report.cs: support Stacktrace on warnings as well.
20159 * makefile: drop --unsafe and /unsafe from the compile.
20161 2002-03-13 Ravi Pratap <ravi@ximian.com>
20163 * ecore.cs (StandardConversionExists): Modify to take an Expression
20164 as the first parameter. Ensure we do null -> reference type conversion
20167 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20168 temporary Expression objects.
20170 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20172 * interface.cs: workaround bug in method overloading resolution
20173 (there is already a bugzilla bug for it).
20175 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20177 We could also solve this problem by having a separate path for
20178 performing type lookups, instead of DoResolve, we could have a
20179 ResolveType entry point, and only participating pieces of the
20180 production (simplename, deref, array) would implement this.
20182 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20183 signal SimpleName to only resolve type names and not attempt to
20184 resolve anything else.
20186 * expression.cs (Cast): Set the flag.
20188 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20190 * class.cs: Only report 108 if there is no `new' modifier.
20192 * cs-parser.jay: rework foreach statement to work with the new
20193 changes to the policy on SimpleNames.
20195 * report.cs: support Stacktrace on warnings as well.
20197 * makefile: drop --unsafe and /unsafe from the compile.
20199 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20201 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20202 lookups here, instead of doing that at parse time. This means
20203 that our grammar will not introduce `LocalVariableReferences' as
20204 expressions at this point. That solves the problem of code like
20208 static void Main ()
20212 This is only half the fix. The full fix requires parameters to
20213 also be handled in this way.
20215 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20216 makes the use more obvious of the DeclSpace. The
20217 ec.TypeContainer.TypeBuilder is now only used to pull the
20218 TypeBuilder for it.
20220 My theory is that I can get rid of the TypeBuilder completely from
20221 the EmitContext, and have typecasts where it is used (from
20222 DeclSpace to where it matters).
20224 The only pending problem is that the code that implements Aliases
20225 is on TypeContainer, and probably should go in DeclSpace.
20227 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20228 lookups here, instead of doing that at parse time. This means
20229 that our grammar will not introduce `LocalVariableReferences' as
20230 expressions at this point. That solves the problem of code like
20234 static void Main ()
20238 This is only half the fix. The full fix requires parameters to
20239 also be handled in this way.
20241 * class.cs (Property.DefineMethod): When implementing an interface
20242 method, set newslot, when implementing an abstract method, do not
20243 set the flag (before we tried never setting it, or always setting
20244 it, which is the difference).
20245 (Indexer.DefineMethod): same.
20246 (Method.DefineMethod): same.
20248 * ecore.cs: Only set the status used flag if we get back a Field.
20250 * attribute.cs: Temporary hack, so Paolo can keep working.
20252 2002-03-08 Ravi Pratap <ravi@ximian.com>
20254 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20255 the unmanaged type in the case we have a MarshalAs attribute.
20257 (Resolve): Handle the case when we are parsing the special MarshalAs
20258 attribute [we need to store the unmanaged type to use later]
20260 * typemanager.cs (marshal_as_attr_type): Built in type for the
20261 MarshalAs Attribute.
20263 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20264 on parameters and accordingly set the marshalling info.
20266 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20268 * class.cs: Optimizing slightly by removing redundant code after
20269 we switched to the `NoTypes' return value.
20270 (Property.DefineMethod): use NoTypes here too.
20272 This fixes the bug I introduced in my last batch of changes.
20274 2002-03-05 Ravi Pratap <ravi@ximian.com>
20276 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20278 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20279 Enums since those are types too.
20281 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20283 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20284 thanks to a call during the lookup process.
20286 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20288 * statement.cs (Foreach): Lots of work to accomodate a particular
20289 kind of foreach statement that I had not kept in mind. It is
20290 possible to have foreachs on classes that provide a GetEnumerator
20291 method that return objects that implement the "pattern" for using
20292 a foreach, there is no need to support GetEnumerator
20295 This is needed to compile nant.
20297 * decl.cs: Only report 114 if the member is not `Finalize' and if
20298 the warning level is at least 2.
20300 * class.cs: Moved the compare function from Method to
20303 (MethodSignature.InheritableMemberSignatureCompare): Add new
20304 filter function that is used to extract inheritable methods from a
20307 (Method.Define): Use the new `inheritable_method_signature_filter'
20310 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20313 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20315 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20317 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20319 * expression.cs: Pass location information to
20320 ConvertImplicitStandard.
20322 * class.cs: Added debugging code to track return values from
20325 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20327 * expression.cs (Is.DoResolve): If either side of the `is' is an
20328 interface, do not flag the warning.
20330 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20333 * report.cs: Allow for --fatal to be used with --probe.
20335 * typemanager.cs (NoTypes): Move the definition for the empty Type
20338 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20340 (TypeContainer.DefineProxy): New function used to proxy to parent
20341 implementations when implementing interfaces.
20342 (TypeContainer.ParentImplements): used to lookup if our parent
20343 implements a public function that is required by an interface.
20344 (TypeContainer.VerifyPendingMethods): Hook this up.
20346 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20347 `modules' and `assemblies' arraylists into arrays. We only grow
20348 these are the very early start up of the program, so this improves
20349 the speedof LookupType (nicely measured).
20351 * expression.cs (MakeByteBlob): Replaced unsafe code with
20352 BitConverter, as suggested by Paolo.
20354 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20355 folding of string concatenation, but if either side is a string,
20356 and the other is not, then return null, and let the runtime use
20357 the concatenation on the string plus the object (using
20358 `Object.ToString').
20360 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20362 Constant Folding has been implemented now.
20364 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20365 the error instead on types that are not supported in one's
20368 * constant.cs (Constant and all children): New set of functions to
20369 perform implict and explicit conversions.
20371 * ecore.cs (EnumConstant): Implement the new functions to perform
20372 conversion by proxying to the child expression.
20374 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20375 own separate setting that can not be turned off from the command
20376 line using --unchecked or --checked and is only controlled using
20377 the checked/unchecked statements and expressions. This setting is
20378 used by the constant folder to flag errors.
20380 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20381 ConstantCheckState as well.
20383 During Resolve, they also have to flag the state, because the
20384 constant folder runs completely in the Resolve phase.
20386 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20389 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20391 * cfold.cs: New file, this file contains the constant folder.
20393 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20394 argument to track whether we are using the resulting address to
20395 load or store a value and provide better error messages.
20397 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20398 new AddressOf arguments.
20400 * statement.cs (Foreach.EmitCollectionForeach): Update
20402 * expression.cs (Argument.Emit): Call AddressOf with proper
20403 arguments to track usage.
20405 (New.DoEmit): Call AddressOf with new arguments.
20407 (Unary.Emit): Adjust AddressOf call.
20409 2002-03-01 Ravi Pratap <ravi@ximian.com>
20411 * cs-parser.jay (member_access): Change the case for pre-defined types
20412 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20415 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20418 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20419 essentially like methods and apply attributes like MethodImplOptions to them too.
20421 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20424 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20425 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20428 * Update code everywhere accordingly.
20430 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20432 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20434 2002-02-28 Ravi Pratap <ravi@ximian.com>
20436 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20437 try performing lookups against those instead of jumping straight into using
20438 the 'using' clauses.
20440 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20442 (LookupType): Perform lookups in implicit parents too.
20444 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20445 sequence as RootContext.LookupType.
20447 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20448 the various cases of namespace lookups into this method.
20450 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20452 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20453 in positional arguments)
20455 * class.cs (Operator): Update the AllowedModifiers to contain
20458 * cs-parser.jay: Update operator declaration to allow for the
20459 operator body to be empty.
20461 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20464 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20466 * class.cs (Method.Emit): Label parameters.
20468 * driver.cs: Return 1 or 0 as the program exit code.
20470 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20472 * expression.cs: Special case the `null' object when trying to
20473 auto-compute the type, as anything can be explicitly converted to
20476 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20477 spotting this Paolo.
20479 (Expression.ImplicitNumericConversion): Perform comparissions of
20480 the type using the underlying type in the case of an enumeration
20481 rather than using the enumeration type for the compare.
20483 Cope with the underlying == type case, which is not possible to
20486 (Expression.ConvertNumericExplicit): Perform comparissions of
20487 the type using the underlying type in the case of an enumeration
20488 rather than using the enumeration type for the compare.
20490 * driver.cs: If the user does not supply an extension, assume .exe
20492 * cs-parser.jay (if_statement): Rewrote so that we can track the
20493 location for the if statement.
20495 * expression.cs (Binary.ConstantFold): Only concat strings when
20496 the operation is "+", not everything ;-)
20498 * statement.cs (Statement.EmitBoolExpression): Take a location
20500 (If, While, Do): Track location.
20502 * expression.cs (Binary.ResolveOperator): In the object + string
20503 case, I was missing a call to ConvertImplicit
20505 2002-02-25 Ravi Pratap <ravi@ximian.com>
20507 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20508 Location arguments. Ensure we use RootContext.LookupType to do our work
20509 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20511 * interface.cs (PopulateMethod): Handle the type of the parameter being
20514 * expression.cs (Invocation.BetterFunction): Handle the case when we
20515 have a params method with no fixed arguments and a call is made with no
20518 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20520 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20521 the verbatim-string-literal
20523 * support.cs (InternalParameters.ParameterModifier): handle null
20525 (InternalParameters.ParameterType): ditto.
20527 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20528 duplicating the name of the variable parameter.
20529 (GetParameterByName): Fix bug where we were not looking up array
20530 paramters if they were the only present (thanks Paolo!).
20531 (GetParameterInfo): We only have an empty set of types if both
20532 fixed and array are set to null.
20533 (GetParameterInfo-idx): Handle FixedParameter == null
20535 * cs-parser.jay: Handle the case where there is no catch
20536 statements (missing null test).
20538 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20540 * driver.cs (MainDriver): Be conservative on our command line
20543 Catch DirectoryNotFoundException when calling GetFiles.
20545 (SplitPathAndPattern): Used to split the input specification into
20546 a path and a pattern that we can feed to Directory.GetFiles.
20548 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20550 * statement.cs (Fixed): Implement the last case of the Fixed
20551 statement (string handling).
20553 * expression.cs (StringPtr): New class used to return a char * to
20554 a string; Used by the Fixed statement.
20556 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20558 * expression.cs (Binary.ResolveOperator): Remove redundant
20559 MemberLookup pn parent type.
20560 Optimize union call, we do not need a union if the types are the same.
20561 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20564 Specialize the use of MemberLookup everywhere, instead of using
20565 the default settings.
20567 (StackAlloc): Implement stackalloc keyword.
20569 * cs-parser.jay: Add rule to parse stackalloc.
20571 * driver.cs: Handle /h, /help, /?
20573 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20574 before we supported unsafe code.
20576 * makefile: add --unsafe to the self compilation of mcs.
20578 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20580 * expression.cs (PointerArithmetic): New class that is used to
20581 perform pointer arithmetic.
20582 (Binary.Resolve): Handle pointer arithmetic
20583 Handle pointer comparission.
20584 (ArrayPtr): Utility expression class that is used to take the
20585 address of an array.
20587 (ElementAccess): Implement array access for pointers
20589 * statement.cs (Fixed): Implement fixed statement for arrays, we
20590 are missing one more case before we are done.
20592 * expression.cs (Indirection): Implement EmitAssign and set the
20593 ExprClass to Variable. This allows pointer dereferences to be
20594 treated as variables, and to have values assigned to them.
20596 * ecore.cs (Expression.StoreFromPtr): New utility function to
20597 store values dereferencing.
20599 2002-02-20 Ravi Pratap <ravi@ximian.com>
20601 * expression.cs (Binary.ResolveOperator): Ensure that we are
20602 not trying to operate on a void type - this fixes the reported
20605 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20606 the parent implementation is sealed.
20608 * ../errors/cs0239.cs : Add.
20610 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20612 * typemanager.cs (unverifiable_code_type): Corresponds to
20613 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20614 which have unsafe code in them.
20616 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20619 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20621 * cs-tokenizer.cs: Add support for @"litreal strings"
20623 Make tokenizer accept pre-processor directives
20624 on any column (remove the old C-like limitation).
20626 * rootcontext.cs (EmitCode): Emit any global attributes.
20627 (AddGlobalAttributes): Used to keep track of assembly attributes.
20629 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20631 * cs-parser.jay: Add support for global attributes.
20633 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20635 * expression.cs (Indirection): New helper class. Unary will
20636 create Indirection classes to be able to implement the
20637 IMemoryLocation interface on it.
20639 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20641 * cs-parser.jay (fixed_statement): reference the right statement.
20643 * statement.cs (Fixed.Emit): Finish implementing the fixed
20644 statement for the &x case.
20646 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20648 * class.cs (Property.Define, Method.Define): Remove newslot when
20651 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20652 wrong. NewSlot should only be used if the `new' keyword is present.
20654 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20655 locating our system dir. Sorry about this.
20657 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20659 * driver.cs (GetSystemDir): Compute correctly the location of our
20660 system assemblies. I was using the compiler directory instead of
20661 the library directory.
20663 2002-02-13 Ravi Pratap <ravi@ximian.com>
20665 * expression.cs (BetterFunction): Put back in what Miguel commented out
20666 since it is the correct fix. The problem is elsewhere ;-)
20668 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20669 parameters of the parms method are themselves compatible or not !
20671 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20672 to check that a class implements an interface before saying that an implicit
20673 conversion was allowed. Use ImplementsInterface to do the checking.
20675 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20677 * class.cs (Method.Define): Track whether we are an explicit
20678 implementation or not. And only call DefineMethodOverride if we
20679 are an explicit implementation.
20681 (Property.DefineMethod): Ditto.
20683 2002-02-11 Ravi Pratap <ravi@ximian.com>
20685 * expression.cs (BetterFunction): Catch hideous bug which was
20686 preventing us from detecting ambiguous calls due to implicit casts i.e
20689 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20691 * support.cs (Pair): Remove un-needed method. I figured why I was
20692 getting the error in cs-parser.jay, the variable in a foreach loop
20693 is readonly, and the compiler does not really treat this as a variable.
20695 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20696 instead of EQUALS in grammar.
20698 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20700 * expression.cs (Unary.DoResolve): Check whether the argument is
20703 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20705 * support.cs: Api for Pair to set a value. Despite the fact that
20706 the variables are public the MS C# compiler refuses to compile
20707 code that accesses the field if the variable is part of a foreach
20710 * statement.cs (Fixed): Begin implementation of the fixed
20713 (Block.AddVariable): Return the VariableInfo on success and null
20714 on failure instead of true/false.
20716 * cs-parser.jay (foreach): Catch errors on variables already
20717 defined (we were ignoring this value before) and properly unwind
20718 the block hierarchy
20720 (fixed_statement): grammar for the fixed statement.
20722 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20724 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20725 pointer types to be incretemented.
20727 (SizeOf): Implement.
20729 * cs-parser.jay (pointer_member_access): Implement
20730 expr->IDENTIFIER production.
20732 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20733 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20736 (Unary): Implement indirection.
20738 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20739 use in non-unsafe context).
20741 (SimpleName.DoResolve): Check for pointers in field access on safe
20744 (Expression.LoadFromPtr): Factor the load-indirect code in this
20745 function. This was duplicated in UnboxCast and ParameterReference
20747 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20749 * expression.cs (ComposedCast): report an error if a pointer cast
20750 is used in a safe region.
20752 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20753 pointer type casts in unsafe context.
20755 * codegen.cs (EmitContext): Set up IsUnsafe.
20757 * cs-parser.jay (non_expression_type): Add productions for pointer
20760 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20761 code. We should not use force into static mode if the method is
20762 not virtual. Fixes bug in MIS
20764 * statement.cs (Do.Emit, While.Emit, For.Emit,
20765 Statement.EmitBoolExpression): Add support to Do and While to
20766 propagate infinite loop as `I do return' semantics.
20768 Improve the For case to also test for boolean constants.
20770 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20771 to the list of attributes we can add.
20773 Remove `EmitContext' argument.
20775 * class.cs (Method.Define): Apply parameter attributes.
20776 (Constructor.Define): Apply parameter attributes.
20777 (MethodCore.LabelParameters): Move here the core of labeling
20780 * support.cs (ReflectionParameters.ParameterModifier,
20781 InternalParameters.ParameterModifier): Use IsByRef on the type and
20782 only return the OUT bit for these parameters instead of in/out/ref
20785 This is because I miss-understood things. The ParameterInfo.IsIn
20786 and IsOut represent whether the parameter has the [In] and [Out]
20789 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20791 * ecore.cs (FieldExpr.Emit): Release temporaries.
20793 * assign.cs (LocalTemporary.Release): new function.
20795 * codegen.cs (EmitContext.GetTemporaryStorage,
20796 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20797 temporary storage. Now we can "put back" localbuilders when we
20800 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20802 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20803 need to make a copy of the variable to generate verifiable code.
20805 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20807 * driver.cs: Compute dynamically the system directory.
20809 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20810 Slower, but more generally useful. Used by the abstract
20811 registering implementation.
20813 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20814 the rules for the special rule on Type/instances. First check if
20815 we have the same name, and if so, try that special static path
20816 rather than the instance path.
20818 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20820 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20823 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20824 Enum, ValueType, Delegate or Array for non-corlib compiles.
20826 * cs-tokenizer.cs: Catch long identifiers (645)
20828 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20831 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20832 fix, we were returning too early, so we were not registering
20833 pending methods from abstract classes.
20835 Do not register pending methods if the class is abstract.
20837 * expression.cs (Conditional.DoResolve): Report circular implicit
20838 conversions when we neecd to compute it for conditional
20841 (Is.DoResolve): If the expression is always of the provided type,
20842 flag warning 183. If the expression can not ever be of the
20843 provided type flag warning 184.
20845 * class.cs: Catch 169 as well.
20847 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20850 2002-01-18 Nick Drochak <ndrochak@gol.com>
20852 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20854 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20856 * interface.cs: (PopulateMethod): Check for pointers being defined
20857 only if the unsafe context is active.
20858 (PopulateProperty): ditto.
20859 (PopulateIndexer): ditto.
20861 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20862 specified. If pointers are present, make sure that they are
20863 present in an unsafe context.
20864 (Constructor, Constructor.Define): ditto.
20865 (Field, Field.Define): ditto.
20866 (Property, Property.Define): ditto.
20867 (Event, Event.Define): ditto.
20869 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20870 hashtable if there are classes or structs defined.
20872 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20873 code, as the constant resolution moved.
20875 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20876 the metadata, so we can flag error 133.
20878 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20879 pointer is being declared in an unsafe context.
20881 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20883 * modifiers.cs (Modifiers.Check): Require a Location argument.
20884 Report error 227 for Unsafe use.
20886 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20888 * statement.cs (For.Emit): If the test is null, then report that
20889 we do `return', as we wont reach anything afterwards.
20891 (Switch.SwitchGoverningType): Track the expression that matched
20894 * driver.cs: Allow negative numbers as an error code to flag.
20896 * cs-parser.jay: Handle 1551.
20898 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20900 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20902 * cs-parser.jay: Report 1518 (type declaration can only contain
20903 class, struct, interface, enum or delegate)
20905 (switch_label): Report 1523 (keywords `case' or `default' must
20908 (opt_switch_sections): Report 1522 (empty switch)
20910 * driver.cs: Report 1515 (response file specified multiple times)
20911 Report 1516 (Source file specified multiple times).
20913 * expression.cs (Argument.Resolve): Signal 1510
20915 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20916 access not allowed in static code)
20918 2002-01-11 Ravi Pratap <ravi@ximian.com>
20920 * typemanager.cs (IsPointerType): Utility method which we are going
20923 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20924 the object type, so we take care of that.
20926 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20928 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20929 added to non-params parameters :-)
20931 * typemanager.cs (CSharpName): Include 'void' type too.
20933 (void_ptr_type): Include in the set of core types.
20935 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20938 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20941 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20942 completely forgotten about it.
20944 2002-01-10 Ravi Pratap <ravi@ximian.com>
20946 * cs-parser.jay (pointer_type): Add. This begins our implementation
20947 of parsing rules for unsafe code.
20949 (unsafe_statement): Implement.
20951 (embedded_statement): Modify to include the above.
20953 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20955 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20956 if the current context is an unsafe one.
20958 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20959 are handled differently, we need separate rules for them.
20961 (local_variable_declaration): Update to use local_variable_pointer_type
20962 to allow variable declarations of unmanaged pointer types.
20964 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20965 in unsafe contexts.
20967 * ../errors/cs0214.cs : Add.
20969 2002-01-16 Nick Drochak <ndrochak@gol.com>
20971 * makefile: remove 'response' file when cleaning.
20973 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20975 * cs-parser.jay: Report 1524.
20977 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20979 * typemanager.cs (RegisterMethod): drop checking if we have
20980 registered this from here
20982 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20984 * class.cs (Method.EmitDestructor): Implement calling our base
20987 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20988 value of InFinally.
20990 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20991 this routine and will wrap the call in a try/catch block. Deal
20994 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20996 * ecore.cs (Expression.MemberLookup): instead of taking a
20997 parameter `same_type' that was used to tell whether we could
20998 access private members we compute our containing type from the
21001 (FieldExpr): Added partial support for volatile fields. This does
21002 not work for volatile fields exposed from assemblies, as I can not
21003 figure out how to extract the modreq from it.
21005 Updated all the source files to use this.
21007 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21008 because it is referenced by MemberLookup very often.
21010 2002-01-09 Ravi Pratap <ravi@ximian.com>
21012 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21013 TypeBuilder.GetCustomAttributes to retrieve what we need.
21015 Get rid of redundant default_member_attr_type as this is the same as
21016 default_member_type which already exists.
21018 * interface.cs, attribute.cs : Update accordingly.
21020 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21022 * typemanager.cs: Enable IndexerPropertyName again. It does not
21023 work for TYpeBuilders though. Ravi, can you please fix this?
21025 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21027 * expression.cs (Argument.Emit): Handle the case of ref objects
21028 being passed to ref functions;
21030 (ParameterReference.EmitLoad): Loads the content of the pointer
21031 without dereferencing.
21033 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21035 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21037 2002-01-08 Ravi Pratap <ravi@ximian.com>
21039 * class.cs (Indexer.DefineMethod): Incorporate the interface
21040 type in the name of the method if we are doing explicit interface
21043 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21045 (BetterConversion): Fix extremely trivial bug where we were referring to
21046 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21049 * ../errors/bug16.cs : Add although we have fixed it.
21051 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21053 * expression.cs (BaseIndexer): Begin implementation.
21055 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21057 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21058 production directly to remove a shift/reduce, and implement
21059 explicit interface implementation.
21061 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21062 after a floating point suffix.
21064 * expression.cs (DoNumericPromotions): Improved the conversion for
21065 uint/uint. If we have a constant, we avoid doing a typecast to a
21068 * class.cs (Indexer): Implement explicit interface implementation
21071 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21073 * class.cs: make the default instance constructor public and hidebysig.
21075 2001-01-03 Ravi Pratap <ravi@ximian.com>
21077 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21078 so we can call it from elsewhere.
21080 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21081 we emit it internally if the class has a defined indexer; otherwise the user
21082 emits it by decorating the class definition with the DefaultMemberAttribute.
21084 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21085 attribute is not used on a type which defines an indexer.
21087 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21088 character when we skip whitespace.
21090 * ../errors/cs0646.cs : Add.
21092 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21094 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21097 * makefile: Add practical target `mcs3.exe' which builds the third
21098 generation compiler.
21100 * expression.cs (New): Fix structures constructor calling.
21102 * class.cs (Property, Method, Indexer): Emit Final flag on the
21103 method if we are an interface implementation and we are not
21106 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21107 whether this property is referencing a `base' method.
21109 * expression.cs (Invocation.EmitCall): take an extra argument:
21110 is_base, this is used to determine whether the `call' or
21111 `callvirt' opcode should be used.
21114 * delegate.cs: update EmitCall.
21116 * class.cs (Method.Define): Set NewSlot for the cases where we are
21117 not implementing an interface method.
21119 (Property.Define): ditto.
21121 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21123 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21124 'r'. Allows mcs to parse itself fully.
21126 2002-01-02 Ravi Pratap <ravi@ximian.com>
21128 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21129 of the number of initializers that require the InitializeArray method.
21131 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21132 update the above field where necessary.
21134 (MakeByteBlob): Update accordingly.
21136 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21139 (EmitDynamicInitializers): Update in accordance with the new optimization.
21141 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21142 same OpCode applies.
21144 * cs-parser.jay : Fix some glaring errors I introduced.
21146 2002-01-01 Ravi Pratap <ravi@ximian.com>
21148 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21149 so that we can check for name clashes there too.
21151 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21152 for interface indexers.
21154 * interfaces.cs (Define): Emit the default member attribute.
21156 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21157 variable was being referred to while setting the value ;-)
21159 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21161 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21162 byte-by-byte information when we know the data is zero.
21164 Make the block always a multiple of 4, because
21165 DefineInitializedData has a bug.
21167 * assign.cs: Fix, we should assign from the temporary, not from
21170 * expression.cs (MakeByteBlob): Fix my incorrect code.
21172 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21174 * typemanager.cs (EnumToUnderlying): This function is used to get
21175 the underlying type from an enumeration, because it does not
21178 * constant.cs: Use the I4_S form for values between -128 and 127.
21180 * statement.cs (Block.LookupLabel): Looks up a label.
21181 (Block): Drop support for labeled blocks.
21183 (LabeledStatement): New kind of statement that represents a label
21186 (Goto): Finally implement this bad boy.
21188 * cs-parser.jay: Update to reflect new mechanism to implement
21191 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21193 * codegen.cs (EmitContext.This): a codegen property that keeps the
21194 a single instance of this instead of creating many different this
21197 * delegate.cs (Delegate.DoResolve): Update to use the property;
21199 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21201 * expression.cs (BaseAccess.DoResolve): Ditto.
21203 2001-12-29 Ravi Pratap <ravi@ximian.com>
21205 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21206 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21208 (InitCoreTypes): Update accordingly.
21210 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21211 so we can quickly store the state.
21213 (ApplyAttributes): Set the correct implementation flags
21214 for InternalCall methods.
21216 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21218 * expression.cs (EmitCall): if a method is not virtual, then do
21219 not use callvirt on it.
21221 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21222 user defined stuff) requires the use of stobj, which takes an
21223 address on the stack instead of an array and an index. So emit
21224 the Ldelema operation for it.
21226 (EmitStoreOpcode): Use stobj for valuetypes.
21228 (UnaryMutator.EmitCode): Use the right 1 value depending on
21229 whether we are dealing with int64/uint64, float or doubles.
21231 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21232 constructors that I implemented last night.
21234 (Constructor.IsDefault): Fix to work properly for static
21237 * cs-parser.jay (CheckDef): report method signature errors.
21238 Update error number 103 to be 132.
21240 * decl.cs: New AdditionResult enumeration value: MethodExists.
21241 Although we do this check for methods later on in the semantic
21242 analysis, catching repeated default constructors is so easy that
21243 we catch these here.
21245 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21248 (ParameterReference.EmitAssign, Emit): handle
21251 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21252 (ArrayAccess.EmitStoreOpcode): ditto.
21254 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21256 * expression.cs (MakeByteBlob): Complete all the missing types
21257 (uint, short, ushort, byte, sbyte)
21259 * class.cs: Only init instance field initializers on instance
21262 Rename `constructors' to instance_constructors.
21264 (TypeContainer.AddConstructor): Only add constructors to the list
21265 if it is not static.
21267 Make sure that we handle default_static_constructor independently
21268 everywhere where we handle instance_constructors
21270 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21272 * class.cs: Do not lookup or create a base initializer for a
21273 static constructor.
21275 (ConstructorInitializer.Resolve): use the proper type to lookup
21278 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21280 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21283 * decl.cs: CloseType is now an virtual method, the default
21284 implementation just closes this type.
21286 2001-12-28 Ravi Pratap <ravi@ximian.com>
21288 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21289 to PreserveSig by default. Also emit HideBySig on such methods.
21291 Basically, set the defaults to standard values.
21293 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21294 argument, if candidate is better, it can't be worse than the best !
21296 (Invocation): Re-write bits to differentiate between methods being
21297 applicable in their expanded form and their normal form - for params
21300 Get rid of use_standard everywhere as only standard conversions are allowed
21301 in overload resolution.
21303 More spec conformance.
21305 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21307 * driver.cs: Add --timestamp, to see where the compiler spends
21310 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21311 `this' in static code.
21313 (SimpleName.DoResolve): Implement in terms of a helper function
21314 that allows static-references to be passed upstream to
21317 (Expression.ResolveWithSimpleName): Resolve specially simple
21318 names when called by MemberAccess to implement the special
21321 (Expression.ImplicitReferenceConversion): Handle conversions from
21322 Null to reference types before others, as Null's type is
21325 * expression.cs (Invocation.EmitCall): Handle the special case of
21326 calling methods declared on a reference type from a ValueType
21327 (Base classes System.Object and System.Enum)
21329 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21330 the left hand side is a TypeExpr, not on every enumeration.
21332 (Binary.Resolve): If types are reference types, then do a cast to
21333 object on operators != and == of both arguments.
21335 * typemanager.cs (FindMembers): Extract instance and static
21336 members if requested.
21338 * interface.cs (PopulateProperty): Use void_type instead of null
21339 as the return type for the setter method.
21341 (PopulateIndexer): ditto.
21343 2001-12-27 Ravi Pratap <ravi@ximian.com>
21345 * support.cs (ReflectionParameters): Fix minor bug where we
21346 were examining the wrong parameter for the ParamArray attribute.
21348 Cope with requests for the type of the parameter at position
21349 greater than the params parameter's. We now return the element
21350 type of the params array as that makes more sense.
21352 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21353 accordingly as we no longer have to extract the element type
21356 (Invocation.OverloadResolve): Update.
21358 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21360 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21361 against IEnumerator, test whether the return value is a descendant
21362 of the IEnumerator interface.
21364 * class.cs (Indexer.Define): Use an auxiliary method to implement
21365 the other bits of the method definition. Begin support for
21366 explicit interface implementation.
21368 (Property.DefineMethod): Use TypeManager.void_type instead of null
21369 for an empty return value.
21371 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21373 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21374 dealing with a FieldExpr which is composed of a FieldBuilder, in
21375 the code path we did extract the constant, but we should have
21376 obtained the underlying value to be able to cast it (otherwise we
21377 end up in an infinite loop, this is what Ravi was running into).
21379 (ArrayCreation.UpdateIndices): Arrays might be empty.
21381 (MemberAccess.ResolveMemberAccess): Add support for section
21382 14.5.4.1 that deals with the special case of E.I when E is a type
21383 and something else, that I can be a reference to a static member.
21385 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21386 handle a particular array type to create byte blobs, it is just
21387 something we dont generate byteblobs for.
21389 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21392 * location.cs (Push): remove the key from the hashtable that we
21393 are about to add. This happens for empty files.
21395 * driver.cs: Dispose files after we have parsed them.
21397 (tokenize): new function that only runs the tokenizer on its
21398 input, for speed testing.
21400 2001-12-26 Ravi Pratap <ravi@ximian.com>
21402 * class.cs (Event.Define): Define the private field only if there
21403 are no accessors defined.
21405 * expression.cs (ResolveMemberAccess): If there is no associated
21406 field with the event, that means we have an event defined with its
21407 own accessors and we should flag error cs0070 since transforming
21408 ourselves into a field is not valid in that case.
21410 * ecore.cs (SimpleName.DoResolve): Same as above.
21412 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21413 and charset to sane values.
21415 2001-12-25 Ravi Pratap <ravi@ximian.com>
21417 * assign.cs (DoResolve): Perform check on events only if they
21418 are being accessed outside the declaring type.
21420 * cs-parser.jay (event_declarations): Update rules to correctly
21421 set the type of the implicit parameter etc.
21423 (add_accessor, remove_accessor): Set current local parameters.
21425 * expression.cs (Binary): For delegate addition and subtraction,
21426 cast the return value from the method into the appropriate delegate
21429 2001-12-24 Ravi Pratap <ravi@ximian.com>
21431 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21432 of these as the workaround is unnecessary.
21434 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21435 delegate data - none of that is needed at all.
21437 Re-write bits to extract the instance expression and the delegate method
21440 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21443 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21444 of attaching attributes instead of duplicating code everywhere.
21446 * everywhere : Update code to do attribute emission using the above method.
21448 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21450 * expression.cs (IsParamsMethodApplicable): if there are not
21451 parameters, return immediately.
21453 * ecore.cs: The 0 literal can be implicity converted to an enum
21456 (SimpleName.DoResolve): First lookup the type, then lookup the
21459 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21460 want to get its address. If the InstanceExpression is not
21461 addressable, store the result in a temporary variable, then get
21464 * codegen.cs: Only display 219 errors on warning level or above.
21466 * expression.cs (ArrayAccess): Make it implement the
21467 IMemoryLocation interface.
21469 (Binary.DoResolve): handle the operator == (object a, object b)
21470 and operator != (object a, object b) without incurring into a
21471 BoxedCast (because 5 != o should never be performed).
21473 Handle binary enumerator operators.
21475 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21476 value type, otherwise use Ldelem_ref.
21478 Use precomputed names;
21480 (AddressOf): Implement address of
21482 * cs-parser.jay (labeled_statement): Fix recursive block
21483 addition by reworking the production.
21485 * expression.cs (New.DoEmit): New has a special case:
21487 If we are dealing with a ValueType, we have a few
21488 situations to deal with:
21490 * The target of New is a ValueType variable, that is
21491 easy, we just pass this as the variable reference
21493 * The target of New is being passed as an argument,
21494 to a boxing operation or a function that takes a
21497 In this case, we need to create a temporary variable
21498 that is the argument of New.
21501 2001-12-23 Ravi Pratap <ravi@ximian.com>
21503 * rootcontext.cs (LookupType): Check that current_type is not null before
21504 going about looking at nested types.
21506 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21507 not implement the IAssignMethod interface any more.
21509 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21510 where we tranform them into FieldExprs if they are being resolved from within
21511 the declaring type.
21513 * ecore.cs (SimpleName.DoResolve): Do the same here.
21515 * assign.cs (DoResolve, Emit): Clean up code considerably.
21517 * ../errors/bug10.cs : Add.
21519 * ../errors/cs0070.cs : Add.
21521 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21523 * assign.cs : Get rid of EventIsLocal everywhere.
21525 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21527 * ecore.cs (ConvertIntLiteral): finished the implementation.
21529 * statement.cs (SwitchLabel): Convert the value we are using as a
21530 key before looking up the table.
21532 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21534 * codegen.cs (EmitTopBlock): Require a Location argument now.
21536 * cs-parser.jay (constructor_declarator): We need to setup
21537 current_local_parameters before we parse the
21538 opt_constructor_initializer, to allow the variables to be bound
21539 to the constructor arguments.
21541 * rootcontext.cs (LookupType): First lookup nested classes in our
21542 class and our parents before we go looking outside our class.
21544 * expression.cs (ConstantFold): Extract/debox the values at the
21547 * rootcontext.cs (EmitCode): Resolve the constants first before we
21548 resolve the types. This is not really needed, but it helps debugging.
21550 * statement.cs: report location.
21552 * cs-parser.jay: pass location to throw statement.
21554 * driver.cs: Small bug fix.
21556 * report.cs: Updated format to be 4-zero filled digits.
21558 2001-12-22 Ravi Pratap <ravi@ximian.com>
21560 * expression.cs (CheckIndices): Fix minor bug where the wrong
21561 variable was being referred to ;-)
21563 (DoEmit): Do not call EmitStaticInitializers when the
21564 underlying type is System.Object.
21566 2001-12-21 Ravi Pratap <ravi@ximian.com>
21568 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21569 and do the usual workaround for SRE.
21571 * class.cs (MyEventBuilder.EventType): New member to get at the type
21572 of the event, quickly.
21574 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21576 * assign.cs (Assign.DoResolve): Handle the case when the target
21577 is an EventExpr and perform the necessary checks.
21579 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21582 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21584 (EventExpr): Set the type in the constructor itself since we
21585 are meant to be born fully resolved.
21587 (EventExpr.Define): Revert code I wrote earlier.
21589 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21590 instance expression is null. The instance expression is a This in that case
21591 or a null, depending on whether it is a static method or not.
21593 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21594 refers to more than one method.
21596 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21597 and accordingly flag errors.
21599 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21601 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21603 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21605 * location.cs (ToString): Provide useful rutine.
21607 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21609 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21610 objects, return the actual integral boxed.
21612 * statement.cs (SwitchLabel): define an ILLabel for each
21615 (Switch.CheckSwitch): If the value is a Literal, extract
21616 the underlying literal.
21618 Also in the unused hashtable we had, add the SwitchLabel so we can
21619 quickly look this value up.
21621 * constant.cs: Implement a bunch of new constants. Rewrite
21622 Literal based on this. Made changes everywhere to adapt to this.
21624 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21625 dereferencing array only once, and also copes with enumrations.
21627 bytes are two bytes wide, not one.
21629 (Cast): Perform constant conversions.
21631 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21632 wrappers to the literals here.
21634 * expression.cs (DoNumericPromotions): long literals can converted
21635 to ulong implicity (this is taken care of elsewhere, but I was
21636 missing this spot).
21638 * ecore.cs (Expression.Literalize): Make the return type Literal,
21639 to improve type checking.
21641 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21643 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21645 * literal.cs: Revert code from ravi that checked the bounds. The
21646 bounds are sane by the definition of the type itself.
21648 * typemanager.cs: Fix implementation of ImplementsInterface. We
21649 need to actually look up in our parent hierarchy for interfaces
21652 * const.cs: Use the underlying type for enumerations
21654 * delegate.cs: Compute the basename for the delegate creation,
21655 that should fix the delegate test case, and restore the correct
21656 Type Lookup semantics in rootcontext
21658 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21659 referencing a nested type with the Reflection API is using the "+"
21662 * cs-parser.jay: Do not require EOF token at the end.
21664 2001-12-20 Ravi Pratap <ravi@ximian.com>
21666 * rootcontext.cs (LookupType): Concatenate type names with
21667 a '.' instead of a '+' The test suite passes again.
21669 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21670 field of the enumeration.
21672 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21673 the case when the member is an EventExpr.
21675 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21676 static has an associated instance expression.
21678 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21680 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21682 * class.cs (Event.Define): Register event and perform appropriate checks
21685 We define the Add and Remove methods even if the use provides none because
21686 in that case, we provide default implementations ourselves.
21688 Define a private field of the type of the event. This is done by the CSC compiler
21689 and we should be doing it too ;-)
21691 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21692 More methods we use in code we generate.
21694 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21697 (InitCoreTypes): Update accordingly for the above.
21699 * class.cs (Event.Emit): Generate code for default accessors that we provide
21701 (EmitDefaultMethod): Do the job in the above.
21703 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21706 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21708 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21709 builders even if we were missing one.
21711 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21712 pass the Basename as our class name instead of the Name. The
21713 basename will be correctly composed for us.
21715 * parameter.cs (Paramters): Now takes a Location argument.
21717 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21718 make all the code call directly LookupType in RootContext and take
21719 this chance to pass the Location information everywhere.
21721 * Everywhere: pass Location information.
21723 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21725 * class.cs (Constructor.Define): Updated way of detecting the
21726 length of the parameters.
21728 (TypeContainer.DefineType): Use basename as the type name for
21731 (TypeContainer.Define): Do not recursively define types here, as
21732 definition is taken care in order by the RootContext.
21734 * tree.cs: Keep track of namespaces in a per-file basis.
21736 * parameter.cs (Parameter.ComputeSignature): Update to use
21739 (Parameters.GetSignature): ditto.
21741 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21742 instead of a TypeContainer.
21744 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21745 resolve names. Because we need to be resolve in our context, not
21748 * driver.cs: Implement response files.
21750 * class.cs (TypeContainer.DefineType): If we are defined, do not
21751 redefine ourselves.
21753 (Event.Emit): Emit the code for add/remove handlers.
21754 (Event.Define): Save the MethodBuilders for add/remove.
21756 * typemanager.cs: Use pair here too.
21758 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21759 DictionaryEntry requires the first argument to be non-null.
21761 (enum_declaration): Compute full name for registering the
21764 (delegate_declaration): Instead of using
21765 formal_parameter_list, use opt_formal_parameter_list as the list
21768 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21769 (EventParsing): New property that controls whether `add' and
21770 `remove' are returned as tokens or identifiers (for events);
21772 2001-12-19 Ravi Pratap <ravi@ximian.com>
21774 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21775 use MyEventBuilder only and let it wrap the real builder for us.
21777 (MyEventBuilder): Revamp constructor etc.
21779 Implement all operations that we perform on EventBuilder in precisely the same
21782 (FindMembers): Update to use the EventBuilder member.
21784 (Event.Emit): Update accordingly.
21786 2001-12-18 Ravi Pratap <ravi@ximian.com>
21788 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21789 by calling the appropriate methods.
21791 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21794 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21796 2001-12-17 Ravi Pratap <ravi@ximian.com>
21798 * delegate.cs (Delegate.Populate): Check that the return type
21799 and various parameters types are indeed accessible.
21801 * class.cs (Constructor.Define): Same here.
21803 (Field.Define): Ditto.
21805 (Event.Define): Ditto.
21807 (Operator.Define): Check that the underlying Method defined itself
21808 correctly - so it's MethodBuilder should not be null.
21810 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21811 expression happens to be null.
21813 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21814 members but as of now we don't seem to be able to do anything really useful with it.
21816 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21817 not the EventBuilder.
21819 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21821 * cs-tokenizer.cs: Add support for defines.
21822 Add support for #if, #elif, #else, #endif
21824 (eval_var): evaluates a variable.
21825 (eval): stubbed for evaluating functions.
21827 * cs-parser.jay: Pass the defines information
21829 * driver.cs: Add --define command line option.
21831 * decl.cs: Move MemberCore here.
21833 Make it the base class for DeclSpace. This allows us to catch and
21834 report 108 and 109 for everything now.
21836 * class.cs (TypeContainer.Define): Extract all the members
21837 before populating and emit the warning 108 (new keyword required
21838 to override) instead of having each member implement this.
21840 (MemberCore.Define): New abstract method, we will be using this in
21841 the warning reporting engine in Populate.
21843 (Operator.Define): Adjust to new MemberCore protocol.
21845 * const.cs (Const): This does not derive from Expression, it is a
21846 temporary object we use to create fields, it is a MemberCore.
21848 * class.cs (Method.Define): Allow the entry point to be in a
21851 * driver.cs: Rewrite the argument handler to clean it up a bit.
21853 * rootcontext.cs: Made it just an auxiliary namespace feature by
21854 making everything static.
21856 * driver.cs: Adapt code to use RootContext type name instead of
21859 * delegate.cs: Remove RootContext argument.
21861 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21864 * class.cs (Event.Define): The lookup can fail.
21866 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21868 * expression.cs: Resolve the this instance before invoking the code.
21870 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21872 * cs-parser.jay: Add a production in element_access that allows
21873 the thing to become a "type" reference. This way we can parse
21874 things like "(string [])" as a type.
21876 Note that this still does not handle the more complex rules of
21880 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21882 * ecore.cs: (CopyNewMethods): new utility function used to
21883 assemble the list of methods from running FindMembers.
21885 (MemberLookup): Rework FindMembers so that
21887 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21889 * class.cs (TypeContainer): Remove Delegates who fail to be
21892 * delegate.cs (Populate): Verify that we dont get null return
21893 values. TODO: Check for AsAccessible.
21895 * cs-parser.jay: Use basename to emit error 574 (destructor should
21896 have the same name as container class), not the full name.
21898 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21899 possible representation.
21901 Also implements integer type suffixes U and L.
21903 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21905 * expression.cs (ArrayCreation.DoResolve): We need to do the
21906 argument resolution *always*.
21908 * decl.cs: Make this hold the namespace. Hold the root context as
21910 (LookupType): Move here.
21912 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21914 * location.cs (Row, Name): Fixed the code, it was always returning
21915 references to the first file.
21917 * interface.cs: Register properties defined through interfaces.
21919 * driver.cs: Add support for globbing on the command line
21921 * class.cs (Field): Make it derive from MemberCore as well.
21924 2001-12-15 Ravi Pratap <ravi@ximian.com>
21926 * class.cs (Event::Define): Check that the type of the event is a delegate
21927 type else flag error #66.
21929 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21932 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21933 values of EntryPoint, CharSet etc etc.
21935 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21937 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21938 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21939 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21940 which needs this to do its work.
21942 * ../errors/cs0066.cs : Add.
21944 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21946 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21949 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21950 clears out the parameters field.
21951 (MemberSignatureCompare): Cleanup
21953 (MemberCore): New base class used to share code between MethodCore
21956 (RegisterRequiredImplementations) BindingFlags.Public requires
21957 either BindingFlags.Instace or Static. Use instance here.
21959 (Property): Refactored code to cope better with the full spec.
21961 * parameter.cs (GetParameterInfo): Return an empty array instead
21964 * class.cs (Property): Abstract or extern properties have no bodies.
21966 * parameter.cs (GetParameterInfo): return a zero-sized array.
21968 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21969 method modifier validation to the typecontainer so we can reuse
21970 this on properties.
21972 (MethodCore.ParameterTypes): return an empty sized array of types.
21974 (Property.Define): Test property modifier validity.
21976 Add tests for sealed/override too.
21978 (Method.Emit): abstract or extern methods have no bodies.
21980 2001-12-14 Ravi Pratap <ravi@ximian.com>
21982 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21985 (Method::Define, ::Emit): Modify accordingly.
21987 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21989 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21991 * makefile: Pass in /unsafe.
21993 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21995 * class.cs (MakeKey): Kill routine.
21997 * class.cs (TypeContainer.Define): Correctly define explicit
21998 method implementations (they require the full interface name plus
22001 * typemanager.cs: Deply the PtrHashtable here and stop using the
22002 lame keys. Things work so much better.
22004 This of course broke everyone who depended on `RegisterMethod' to
22005 do the `test for existance' test. This has to be done elsewhere.
22007 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22008 the object stupid Equals method (because, that like fails all over
22009 the place). We still do not use it.
22011 * class.cs (TypeContainer.SetRequiredInterface,
22012 TypeContainer.RequireMethods): Killed these two routines and moved
22013 all the functionality to RegisterRequiredImplementations.
22015 (TypeContainer.RegisterRequiredImplementations): This routine now
22016 registers all the implementations required in an array for the
22017 interfaces and abstract methods. We use an array of structures
22018 which can be computed ahead of time to reduce memory usage and we
22019 also assume that lookups are cheap as most classes will not
22020 implement too many interfaces.
22022 We also avoid creating too many MethodSignatures.
22024 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22025 clear the "pending" bit if we find that there are problems with
22028 (TypeContainer.VerifyPendingMethods): Update to report errors of
22029 methods that look like implementations but are not.
22031 (TypeContainer.Define): Add support for explicit interface method
22034 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22036 * typemanager.cs: Keep track of the parameters here instead of
22037 being a feature of the TypeContainer.
22039 * class.cs: Drop the registration of parameters here, as
22040 InterfaceMethods are also interface declarations.
22042 * delegate.cs: Register methods with the TypeManager not only with
22043 the TypeContainer. This code was buggy.
22045 * interface.cs: Full registation here.
22047 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22049 * expression.cs: Remove reducer for binary expressions, it can not
22052 * const.cs: Put here the code that used to go into constant.cs
22054 * constant.cs: Put here the code for constants, this is a new base
22055 class for Literals.
22057 * literal.cs: Make Literal derive from Constant.
22059 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22061 * statement.cs (Return.Emit): Report error 157 if the user
22062 attempts to return from a finally block.
22064 (Return.Emit): Instead of emitting a return, jump to the end of
22067 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22068 LocalBuilder to store the result of the function. ReturnLabel is
22069 the target where we jump.
22072 2001-12-09 Radek Doulik <rodo@ximian.com>
22074 * cs-parser.jay: remember alias in current namespace
22076 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22079 * class.cs (LookupAlias): lookup alias in my_namespace
22081 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22083 (LookupAlias): lookup alias in this and if needed in parent
22086 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22090 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22091 making things static. I need this to avoid passing the
22092 TypeContainer when calling ParameterType.
22094 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22095 that did string manipulation to compute the type and then call
22096 GetType. Use Parameter.ParameterType instead.
22098 * cs-tokenizer.cs: Consume the suffix for floating values.
22100 * expression.cs (ParameterReference): figure out whether this is a
22101 reference parameter or not. Kill an extra variable by computing
22102 the arg_idx during emission.
22104 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22105 function that returns whether a parameter is an out/ref value or not.
22107 (Parameter.ParameterType): The type of the parameter (base,
22108 without ref/out applied).
22110 (Parameter.Resolve): Perform resolution here.
22111 (Parameter.ExternalType): The full type (with ref/out applied).
22113 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22114 support for expressions on the using statement.
22116 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22118 * statement.cs (Using.EmitLocalVariableDecls): Split the
22119 localvariable handling of the using statement.
22121 (Block.EmitMeta): Keep track of variable count across blocks. We
22122 were reusing slots on separate branches of blocks.
22124 (Try.Emit): Emit the general code block, we were not emitting it.
22126 Check the type of the declaration to be an IDisposable or
22127 something that can be implicity converted to it.
22129 Emit conversions if required.
22131 * ecore.cs (EmptyExpression): New utility class.
22132 (Expression.ImplicitConversionExists): New utility function.
22134 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22136 * statement.cs (Using): Implement.
22138 * expression.cs (LocalVariableReference): Support read only variables.
22140 * statement.cs: Remove the explicit emit for the Leave opcode.
22141 (VariableInfo): Add a readonly field.
22143 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22145 * ecore.cs (ConvCast): new class used to encapsulate the various
22146 explicit integer conversions that works in both checked and
22147 unchecked contexts.
22149 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22150 properly generate the overflow opcodes.
22152 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22154 * statement.cs: The correct type for the EmptyExpression is the
22155 element_type, not the variable type. Ravi pointed this out.
22157 2001-12-04 Ravi Pratap <ravi@ximian.com>
22159 * class.cs (Method::Define): Handle PInvoke methods specially
22160 by using DefinePInvokeMethod instead of the usual one.
22162 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22163 above to do the task of extracting information and defining the method.
22165 2001-12-04 Ravi Pratap <ravi@ximian.com>
22167 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22168 of the condition for string type.
22170 (Emit): Move that here.
22172 (ArrayCreation::CheckIndices): Keep string literals in their expression
22175 (EmitDynamicInitializers): Handle strings appropriately.
22177 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22179 * codegen.cs (EmitContext): Replace multiple variables with a
22180 single pointer to the current Switch statement.
22182 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22185 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22189 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22192 (Foreach.Emit): Foreach on arrays was not setting
22193 up the loop variables (for break/continue).
22195 (GotoCase): Semi-implented.
22197 2001-12-03 Ravi Pratap <ravi@ximian.com>
22199 * attribute.cs (CheckAttribute): Handle system attributes by using
22200 Attribute.GetAttributes to examine information we need.
22202 (GetValidPlaces): Same here.
22204 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22206 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22208 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22210 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22212 (Method::Emit): Handle the case when we are a PInvoke method.
22214 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22216 * expression.cs: Use ResolveWithSimpleName on compound names.
22218 2001-12-02 Ravi Pratap <ravi@ximian.com>
22220 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22221 before trying to reduce it.
22223 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22225 * constant.cs (LookupConstantValue): Implement.
22227 (EmitConstant): Use the above in emitting the constant.
22229 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22230 that are user-defined by doing a LookupConstantValue on them.
22232 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22235 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22237 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22239 (BaseAccess.DoResolve): Implement.
22241 (MemberAccess.DoResolve): Split this routine into a
22242 ResolveMemberAccess routine that can be used independently
22244 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22246 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22247 As that share bits of the implementation. Is returns a boolean,
22248 while As returns the Type that is being probed.
22250 2001-12-01 Ravi Pratap <ravi@ximian.com>
22252 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22253 instead of a Literal - much easier.
22255 (EnumInTransit): Remove - utterly useless :-)
22257 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22259 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22261 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22262 chain when we have no associated expression.
22264 2001-11-30 Ravi Pratap <ravi@ximian.com>
22266 * constant.cs (Define): Use Location while reporting the errror.
22268 Also emit a warning when 'new' is used and there is no inherited
22271 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22274 (LookupEnumValue): Implement to lookup an enum member's value and define it
22277 (Populate): Re-write accordingly to use the above routine.
22279 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22281 * expression.cs (This): Fix prototype for DoResolveLValue to
22282 override the base class DoResolveLValue.
22284 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22287 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22288 (we need to load the address of the field here). This fixes
22291 (FieldExpr.DoResolveLValue): Call the DoResolve
22292 function to initialize the Instance expression.
22294 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22295 correctly the GetEnumerator operation on a value type.
22297 * cs-parser.jay: Add more simple parsing error catches.
22299 * statement.cs (Switch): Add support for string switches.
22300 Handle null specially.
22302 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22304 2001-11-28 Ravi Pratap <ravi@ximian.com>
22306 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22308 (declare_local_constant): New helper function.
22310 * statement.cs (AddConstant): Keep a separate record of constants
22312 (IsConstant): Implement to determine if a variable is a constant.
22314 (GetConstantExpression): Implement.
22316 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22318 * statement.cs (IsVariableDefined): Re-write.
22320 2001-11-27 Ravi Pratap <ravi@ximian.com>
22322 * class.cs (TypeContainer::FindMembers): Look for constants
22323 in the case when we are looking for MemberTypes.Field
22325 * expression.cs (MemberAccess::DoResolve): Check that in the
22326 case we are a FieldExpr and a Literal, we are not being accessed
22327 by an instance reference.
22329 * cs-parser.jay (local_constant_declaration): Implement.
22331 (declaration_statement): Implement for constant declarations.
22333 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22335 * statement.cs (Switch): Catch double defaults.
22337 (Switch): More work on the switch() statement
22338 implementation. It works for integral values now, need to finish
22342 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22344 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22345 integer literals into other integer literals. To be used by
22348 2001-11-24 Ravi Pratap <ravi@ximian.com>
22350 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22353 (EmitDynamicInitializers): Cope with the above since we extract data
22354 directly from ArrayData now.
22356 (ExpectInitializers): Keep track of whether initializers are mandatory
22359 (Bounds): Make it a hashtable to prevent the same dimension being
22360 recorded for every element in that dimension.
22362 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22365 Also fix bug which was causing the indices to be emitted in the reverse
22368 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22370 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22371 unfinished. They do not work, because the underlying code is
22374 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22376 * cs-parser.jay: Remove bogus fixme.
22378 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22379 on Switch statement.
22381 2001-11-23 Ravi Pratap <ravi@ximian.com>
22383 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22386 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22387 parameter. Apparently, any expression is allowed.
22389 (ValidateInitializers): Update accordingly.
22391 (CheckIndices): Fix some tricky bugs thanks to recursion.
22393 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22394 I was being completely brain-dead.
22396 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22397 and re-write acordingly.
22399 (DelegateInvocation): Re-write accordingly.
22401 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22403 (MakeByteBlob): Handle types more correctly.
22405 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22406 initialization from expressions but it is incomplete because I am a complete
22409 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22411 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22412 on If. Basically, we have to return `true' (ie, we do return to
22413 our caller) only if both branches of the if return.
22415 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22416 short-circuit operators, handle them as short circuit operators.
22418 (Cast.DoResolve): Resolve type.
22419 (Cast.Cast): Take an expression as the target type.
22421 * cs-parser.jay (cast_expression): Remove old hack that only
22422 allowed a limited set of types to be handled. Now we take a
22423 unary_expression and we resolve to a type during semantic
22426 Use the grammar productions from Rhys to handle casts (this is
22427 not complete like Rhys syntax yet, we fail to handle that corner
22428 case that C# has regarding (-x), but we will get there.
22430 2001-11-22 Ravi Pratap <ravi@ximian.com>
22432 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22433 field which is an array type.
22435 * cs-parser.jay (declare_local_variables): Support array initialization too.
22437 * typemanager.cs (MakeKey): Implement.
22439 (everywhere): Use the above appropriately.
22441 * cs-parser.jay (for_statement): Update for array initialization while
22442 declaring variables.
22444 * ecore.cs : The error message was correct, it's the variable's names that
22445 were misleading ;-) Make the code more readable.
22447 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22448 the correct type etc.
22450 (ConvertExplicit): Handle Enum types by examining the underlying type.
22452 2001-11-21 Ravi Pratap <ravi@ximian.com>
22454 * parameter.cs (GetCallingConvention): Always return
22455 CallingConventions.Standard for now.
22457 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22459 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22460 and `r' after calling DoNumericPromotions.
22462 * ecore.cs: Fix error message (the types were in the wrong order).
22464 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22465 BindingFlags.Instance as well
22467 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22468 implicit int literal conversion in an empty cast so that we
22469 propagate the right type upstream.
22471 (UnboxCast): new class used to unbox value types.
22472 (Expression.ConvertExplicit): Add explicit type conversions done
22475 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22476 the target type before applying the implicit LongLiterals to ULong
22479 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22481 * cs-parser.jay (for_statement): Reworked the way For works: now
22482 we declare manually any variables that are introduced in
22483 for_initializer to solve the problem of having out-of-band code
22484 emition (that is what got for broken).
22486 (declaration_statement): Perform the actual variable declaration
22487 that used to be done in local_variable_declaration here.
22489 (local_variable_declaration): Do not declare anything, just pass
22490 the information on a DictionaryEntry
22492 2001-11-20 Ravi Pratap <ravi@ximian.com>
22494 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22495 re-write of the logic to now make it recursive.
22497 (UpdateIndices): Re-write accordingly.
22499 Store element data in a separate ArrayData list in the above methods.
22501 (MakeByteBlob): Implement to dump the array data into a byte array.
22503 2001-11-19 Ravi Pratap <ravi@ximian.com>
22505 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22508 * constant.cs (Define): Implement.
22510 (EmitConstant): Re-write fully.
22512 Pass in location info.
22514 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22517 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22518 DictionaryEntry since we need location info too.
22520 (constant_declaration): Update accordingly.
22522 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22523 code into another method : UpdateIndices.
22525 2001-11-18 Ravi Pratap <ravi@ximian.com>
22527 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22528 some type checking etc.
22530 2001-11-17 Ravi Pratap <ravi@ximian.com>
22532 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22533 bits to provide dimension info if the user skips doing that.
22535 Update second constructor to store the rank correctly.
22537 2001-11-16 Ravi Pratap <ravi@ximian.com>
22539 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22540 and try to implement.
22542 * ../errors/cs0150.cs : Add.
22544 * ../errors/cs0178.cs : Add.
22546 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22548 * statement.cs: Implement foreach on multi-dimensional arrays.
22550 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22551 name of the params argument.
22553 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22554 initializing the array.
22556 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22557 we can use this elsewhere.
22559 * statement.cs: Finish implementation of foreach for single
22562 * cs-parser.jay: Use an out-of-band stack to pass information
22563 around, I wonder why I need this.
22565 foreach_block: Make the new foreach_block the current_block.
22567 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22568 function used to return a static Parameters structure. Used for
22569 empty parameters, as those are created very frequently.
22571 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22573 2001-11-15 Ravi Pratap <ravi@ximian.com>
22575 * interface.cs : Default modifier is private, not public. The
22576 make verify test passes again.
22578 2001-11-15 Ravi Pratap <ravi@ximian.com>
22580 * support.cs (ReflectionParameters): Fix logic to determine
22581 whether the last parameter is a params one. Test 9 passes again.
22583 * delegate.cs (Populate): Register the builders we define with
22584 RegisterParameterForBuilder. Test 19 passes again.
22586 * cs-parser.jay (property_declaration): Reference $6 instead
22587 of $$ to get at the location.
22589 (indexer_declaration): Similar stuff.
22591 (attribute): Ditto.
22593 * class.cs (Property): Register parameters for the Get and Set methods
22594 if they exist. Test 23 passes again.
22596 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22597 call to EmitArguments as we are sure there aren't any params arguments.
22598 Test 32 passes again.
22600 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22601 IndexOutOfRangeException.
22603 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22604 Test 33 now passes again.
22606 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22608 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22609 broke a bunch of things. Will have to come up with a better way
22610 of tracking locations.
22612 * statement.cs: Implemented foreach for single dimension arrays.
22614 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22616 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22617 an error. This removes the lookup from the critical path.
22619 * cs-parser.jay: Removed use of temporary_loc, which is completely
22622 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22624 * support.cs (ReflectionParameters.ParameterModifier): Report
22625 whether the argument is a PARAMS argument or not.
22627 * class.cs: Set the attribute `ParamArrayAttribute' on the
22628 parameter argument.
22630 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22631 and cons_param_array_attribute (ConstructorInfo for
22632 ParamArrayAttribute).,
22634 * codegen.cs: Emit the return using the `Return' statement, that
22635 way we can report the error correctly for missing return values.
22637 * class.cs (Method.Emit): Clean up.
22639 * expression.cs (Argument.Resolve): Take another argument: the
22640 location where this argument is used. Notice that this is not
22641 part of the "Argument" class as to reduce the size of the
22642 structure (we know the approximate location anyways).
22644 Test if the argument is a variable-reference, if not, then
22645 complain with a 206.
22647 (Argument.Emit): Emit addresses of variables.
22649 (Argument.FullDesc): Simplify.
22651 (Invocation.DoResolve): Update for Argument.Resolve.
22653 (ElementAccess.DoResolve): ditto.
22655 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22656 method should be virtual, as this method is always virtual.
22658 (NewDelegate.DoResolve): Update for Argument.Resolve.
22660 * class.cs (ConstructorInitializer.DoResolve): ditto.
22662 * attribute.cs (Attribute.Resolve): ditto.
22664 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22666 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22668 * expression.cs (ParameterReference): Drop IStackStorage and implement
22669 IAssignMethod instead.
22671 (LocalVariableReference): ditto.
22673 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22674 IAssignMethod instead.
22676 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22678 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22679 enumerations that are used in heavily used structures derive from
22680 byte in a laughable and pathetic attempt to reduce memory usage.
22681 This is the kind of pre-optimzations that you should not do at
22682 home without adult supervision.
22684 * expression.cs (UnaryMutator): New class, used to handle ++ and
22685 -- separatedly from the other unary operators. Cleans up the
22686 code, and kills the ExpressionStatement dependency in Unary.
22688 (Unary): Removed `method' and `Arguments' from this class, making
22689 it smaller, and moving it all to SimpleCall, so I can reuse this
22690 code in other locations and avoid creating a lot of transient data
22691 strucutres when not required.
22693 * cs-parser.jay: Adjust for new changes.
22695 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22697 * enum.cs (Enum.Populate): If there is a failure during
22700 * cs-parser.jay (opt_enum_base): we used to catch type errors
22701 here, but this is really incorrect. The type error should be
22702 catched during semantic analysis.
22704 2001-12-11 Ravi Pratap <ravi@ximian.com>
22706 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22707 current_local_parameters as expected since I, in my stupidity, had forgotten
22710 * attribute.cs (GetValidPlaces): Fix stupid bug.
22712 * class.cs (Method::Emit): Perform check on applicability of attributes.
22714 (Constructor::Emit): Ditto.
22716 (Field::Emit): Ditto.
22718 (Field.Location): Store location information.
22720 (Property, Event, Indexer, Operator): Ditto.
22722 * cs-parser.jay (field_declaration): Pass in location for each field.
22724 * ../errors/cs0592.cs : Add.
22726 2001-11-12 Ravi Pratap <ravi@ximian.com>
22728 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22730 (InitCoreTypes): Update accordingly.
22732 (RegisterAttrType, LookupAttr): Implement.
22734 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22735 info about the same.
22737 (Resolve): Update to populate the above as necessary.
22739 (Error592): Helper.
22741 (GetValidPlaces): Helper to the above.
22743 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22745 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22747 2001-11-12 Ravi Pratap <ravi@ximian.com>
22749 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22751 * ../errors/cs0617.cs : Add.
22753 2001-11-11 Ravi Pratap <ravi@ximian.com>
22755 * enum.cs (Emit): Rename to Populate to be more consistent with what
22756 we expect it to do and when exactly it is called.
22758 * class.cs, rootcontext.cs : Update accordingly.
22760 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22761 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22763 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22765 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22766 of a fieldinfo using the above, when dealing with a FieldBuilder.
22768 2001-11-10 Ravi Pratap <ravi@ximian.com>
22770 * ../errors/cs0031.cs : Add.
22772 * ../errors/cs1008.cs : Add.
22774 * ../errrors/cs0543.cs : Add.
22776 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22779 (FindMembers): Implement.
22781 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22782 enums and delegates too.
22784 (enum_types): Rename to builder_to_enum.
22786 (delegate_types): Rename to builder_to_delegate.
22788 * delegate.cs (FindMembers): Implement.
22790 2001-11-09 Ravi Pratap <ravi@ximian.com>
22792 * typemanager.cs (IsEnumType): Implement.
22794 * enum.cs (Emit): Re-write parts to account for the underlying type
22795 better and perform checking etc.
22797 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22798 of the underlying type.
22800 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22803 * enum.cs (error31): Helper to report error #31.
22805 * cs-parser.jay (enum_declaration): Store location of each member too.
22807 * enum.cs (member_to_location): New hashtable.
22809 (AddEnumMember): Update location hashtable.
22811 (Emit): Use the location of each member while reporting errors.
22813 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22815 * cs-parser.jay: A for_initializer if is a
22816 local_variable_declaration really ammount to have an implicit
22817 block with the variable declaration and no initializer for for.
22819 * statement.cs (For.Emit): Cope with null initializers.
22821 This fixes the infinite loop on for initializers.
22823 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22825 * enum.cs: More cleanup.
22827 * ecore.cs: Remove dead code.
22829 * class.cs (Property.Emit): More simplification.
22830 (Event.Emit): ditto.
22832 Reworked to have less levels of indentation.
22834 2001-11-08 Ravi Pratap <ravi@ximian.com>
22836 * class.cs (Property): Emit attributes.
22846 * enum.cs (Emit): Ditto.
22848 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22851 * class.cs (Field, Event, etc.): Move attribute generation into the
22852 Emit method everywhere.
22854 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22855 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22856 as we had no way of defining nested enums !
22858 * rootcontext.cs : Adjust code accordingly.
22860 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22862 2001-11-07 Ravi Pratap <ravi@ximian.com>
22864 * expression.cs (EvalConstantExpression): Move into ecore.cs
22866 * enum.cs (Enum): Rename some members and make them public and readonly
22867 according to our convention.
22869 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22872 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22874 (Enum::Emit): Write a simple version for now which doesn't try to compute
22875 expressions. I shall modify this to be more robust in just a while.
22877 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22879 (TypeContainer::CloseType): Create the Enum types too.
22881 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22883 * expression.cs (EvalConstantExpression): Get rid of completely.
22885 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22886 user-defined values and other cases.
22888 (IsValidEnumLiteral): Helper function.
22890 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22891 out there in the case we had a literal FieldExpr.
22893 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22895 (Literalize): Revamp a bit to take two arguments.
22897 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22899 2001-11-06 Ravi Pratap <ravi@ximian.com>
22901 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22903 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22905 (Resolve): Use the above to ensure we have proper initializers.
22907 2001-11-05 Ravi Pratap <ravi@ximian.com>
22909 * expression.cs (Expression::EvalConstantExpression): New method to
22910 evaluate constant expressions.
22912 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22914 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22916 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22919 (Binary.ResolveOperator): Handle operator != (object a, object b)
22920 and operator == (object a, object b);
22922 (Binary.DoNumericPromotions): Indicate whether the numeric
22923 promotion was possible.
22925 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22928 Made the ArrayAccess implement interface IAssignMethod instead of
22929 IStackStore as the order in which arguments are passed reflects
22932 * assign.cs: Instead of using expr.ExprClass to select the way of
22933 assinging, probe for the IStackStore/IAssignMethod interfaces.
22935 * typemanager.cs: Load InitializeArray definition.
22937 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22938 static data that can be used to initialize arrays.
22940 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22942 * expression.cs: Handle operator== and operator!= for booleans.
22944 (Conditioal.Reduce): Implement reducer for the ?: operator.
22946 (Conditional.Resolve): Implement dead code elimination.
22948 (Binary.Resolve): Catch string literals and return a new
22949 concatenated string.
22951 (Unary.Reduce): Implement reduction of unary expressions.
22953 * ecore.cs: Split out the expression core handling here.
22955 (Expression.Reduce): New method used to perform constant folding
22956 and CSE. This is needed to support constant-expressions.
22958 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22959 targets, and optimize for !x.
22961 2001-11-04 Ravi Pratap <ravi@ximian.com>
22963 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22964 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22965 set custom atttributes.
22967 * literal.cs (Literal::GetValue): New abstract method to return the actual
22968 value of the literal, cast as an object.
22970 (*Literal): Implement GetValue method.
22972 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22973 expressions to the arraylist but objects of type Argument.
22975 * class.cs (TypeContainer::Emit): Emit our attributes too.
22977 (Method::Emit, Constructor::Emit): Ditto.
22979 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22980 to be ignoring earlier.
22982 2001-11-03 Ravi Pratap <ravi@ximian.com>
22984 * attribute.cs (AttributeSection::Define): Implement to do the business
22985 of constructing a CustomAttributeBuilder.
22987 (Attribute): New trivial class. Increases readability of code.
22989 * cs-parser.jay : Update accordingly.
22991 (positional_argument_list, named_argument_list, named_argument): New rules
22993 (attribute_arguments): Use the above so that we are more correct.
22995 2001-11-02 Ravi Pratap <ravi@ximian.com>
22997 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22998 to perform all checks for a method with a params parameter.
23000 (Invocation::OverloadResolve): Update to use the above method and therefore
23001 cope correctly with params method invocations.
23003 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23006 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23007 constructors in our parent too because we can't afford to miss out on
23010 * attribute.cs (AttributeSection): New name for the class Attribute
23012 Other trivial changes to improve readability.
23014 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23015 use the new class names.
23017 2001-11-01 Ravi Pratap <ravi@ximian.com>
23019 * class.cs (Method::Define): Complete definition for params types too
23021 (Indexer::Define): Ditto.
23023 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23024 Cope everywhere with a request for info about the array parameter.
23026 2001-11-01 Ravi Pratap <ravi@ximian.com>
23028 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23030 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23031 local_variable_type to extract the string corresponding to the type.
23033 (local_variable_type): Fixup the action to use the new helper method.
23035 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23038 * expression.cs : Clean out code which uses the above.
23040 2001-10-31 Ravi Pratap <ravi@ximian.com>
23042 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23043 and bale out if necessary by returning a false.
23045 (RegisterProperty): Ditto.
23047 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23048 and print out appropriate error messages.
23050 * interface.cs (everywhere): Ditto.
23052 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23053 location to constructor.
23055 * class.cs (Property, Event, Indexer): Update accordingly.
23057 * ../errors/cs111.cs : Added.
23059 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23060 of a method, as laid down by the spec.
23062 (Invocation::OverloadResolve): Use the above method.
23064 2001-10-31 Ravi Pratap <ravi@ximian.com>
23066 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23067 now take a TypeContainer and a Parameters object.
23069 (ParameterData): Modify return type of ParameterModifier method to be
23070 Parameter.Modifier and not a string.
23072 (ReflectionParameters, InternalParameters): Update accordingly.
23074 * expression.cs (Argument::GetParameterModifier): Same here.
23076 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23077 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23078 symbol in it at all so maybe this is only for now.
23080 2001-10-30 Ravi Pratap <ravi@ximian.com>
23082 * support.cs (InternalParameters): Constructor now takes an extra argument
23083 which is the actual Parameters class.
23085 (ParameterDesc): Update to provide info on ref/out modifiers.
23087 * class.cs (everywhere): Update call to InternalParameters to pass in
23088 the second argument too.
23090 * support.cs (ParameterData): Add ParameterModifier, which is a method
23091 to return the modifier info [ref/out etc]
23093 (InternalParameters, ReflectionParameters): Implement the above.
23095 * expression.cs (Argument::ParameterModifier): Similar function to return
23096 info about the argument's modifiers.
23098 (Invocation::OverloadResolve): Update to take into account matching modifiers
23101 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23102 a new SetFormalParameters object which we pass to InternalParameters.
23104 2001-10-30 Ravi Pratap <ravi@ximian.com>
23106 * expression.cs (NewArray): Merge into the ArrayCreation class.
23108 2001-10-29 Ravi Pratap <ravi@ximian.com>
23110 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23111 NewUserdefinedArray into one as there wasn't much of a use in having
23114 * expression.cs (Argument): Change field's name to ArgType from Type.
23116 (Type): New readonly property which returns the proper type, taking into
23117 account ref/out modifiers.
23119 (everywhere): Adjust code accordingly for the above.
23121 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23122 whether we are emitting for a ref or out parameter.
23124 * expression.cs (Argument::Emit): Use the above field to set the state.
23126 (LocalVariableReference::Emit): Update to honour the flag and emit the
23129 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23131 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23133 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23135 (ReflectionParameters, InternalParameters): Implement the above method.
23137 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23140 (Invocation::FullMethodDesc): Ditto.
23142 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23144 * cs-parser.jay: Add extra production for the second form of array
23147 * expression.cs (ArrayCreation): Update to reflect the above
23150 * Small changes to prepare for Array initialization.
23152 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23154 * typemanager.cs (ImplementsInterface): interface might be null;
23155 Deal with this problem;
23157 Also, we do store negative hits on the cache (null values), so use
23158 this instead of calling t.GetInterfaces on the type everytime.
23160 2001-10-28 Ravi Pratap <ravi@ximian.com>
23162 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23164 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23165 split functionality out into different classes.
23167 (New::FormArrayType): Move into NewBuiltinArray.
23169 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23172 (NewBuiltinArray): New class to handle creation of built-in arrays.
23174 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23175 account creation of one-dimensional arrays.
23177 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23179 (NewUserdefinedArray::DoResolve): Implement.
23181 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23183 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23184 we maintain inside the TypeManager. This is necessary to perform lookups on the
23187 (LookupType): Update to perform GetType on the module builders too.
23189 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23191 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23193 2001-10-23 Ravi Pratap <ravi@ximian.com>
23195 * expression.cs (New::DoResolve): Implement guts of array creation.
23197 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23199 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23201 * expression.cs: Fix bug I introduced lsat night that broke
23204 (Expression.Resolve): Report a 246 error (can not resolve name)
23205 if we find a SimpleName in the stream.
23207 (Expression.ResolveLValue): Ditto.
23209 (Expression.ResolveWithSimpleName): This function is a variant of
23210 ResolveName, this one allows SimpleNames to be returned without a
23211 warning. The only consumer of SimpleNames is MemberAccess
23213 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23215 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23216 might arrive here. I have my doubts that this is correct.
23218 * statement.cs (Lock): Implement lock statement.
23220 * cs-parser.jay: Small fixes to support `lock' and `using'
23222 * cs-tokenizer.cs: Remove extra space
23224 * driver.cs: New flag --checked, allows to turn on integer math
23227 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23228 Threading.Monitor.Exit
23230 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23232 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23233 Expression Class to be IndexerAccess.
23235 Notice that Indexer::DoResolve sets the eclass to Value.
23237 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23239 * class.cs (TypeContainer::Emit): Emit code for indexers.
23241 * assign.cs (IAssignMethod): New interface implemented by Indexers
23242 and Properties for handling assignment.
23244 (Assign::Emit): Simplify and reuse code.
23246 * expression.cs (IndexerAccess, PropertyExpr): Implement
23247 IAssignMethod, clean up old code.
23249 2001-10-22 Ravi Pratap <ravi@ximian.com>
23251 * typemanager.cs (ImplementsInterface): New method to determine if a type
23252 implements a given interface. Provides a nice cache too.
23254 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23257 (ConvertReferenceExplicit): Ditto.
23259 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23260 various methods, with correct names etc.
23262 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23263 Operator.UnaryNegation.
23265 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23266 we have a unary plus or minus operator.
23268 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23271 * everywhere : update accordingly.
23273 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23276 * class.cs (Method::Define): For the case where we are implementing a method
23277 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23278 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23280 2001-10-21 Ravi Pratap <ravi@ximian.com>
23282 * interface.cs (FindMembers): Implement to work around S.R.E
23285 * typemanager.cs (IsInterfaceType): Implement.
23287 (FindMembers): Update to handle interface types too.
23289 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23290 use IsAssignableFrom as that is not correct - it doesn't work.
23292 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23293 and accordingly override EmitStatement.
23295 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23296 using the correct logic :-)
23298 2001-10-19 Ravi Pratap <ravi@ximian.com>
23300 * ../errors/cs-11.cs : Add to demonstrate error -11
23302 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23304 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23305 then pass this as a hint to ResolveLValue.
23307 * expression.cs (FieldExpr): Add Location information
23309 (FieldExpr::LValueResolve): Report assignment to readonly
23312 (Expression::ExprClassFromMemberInfo): Pass location information.
23314 (Expression::ResolveLValue): Add new method that resolves an
23317 (Expression::DoResolveLValue): Default invocation calls
23320 (Indexers): New class used to keep track of indexers in a given
23323 (IStackStore): Renamed from LValue, as it did not really describe
23324 what this did. Also ResolveLValue is gone from this interface and
23325 now is part of Expression.
23327 (ElementAccess): Depending on the element access type
23329 * typemanager.cs: Add `indexer_name_type' as a Core type
23330 (System.Runtime.CompilerServices.IndexerNameAttribute)
23332 * statement.cs (Goto): Take a location.
23334 2001-10-18 Ravi Pratap <ravi@ximian.com>
23336 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23337 if two delegates are compatible.
23339 (NewDelegate::DoResolve): Update to take care of the case when
23340 we instantiate a delegate from another delegate.
23342 * typemanager.cs (FindMembers): Don't even try to look up members
23343 of Delegate types for now.
23345 2001-10-18 Ravi Pratap <ravi@ximian.com>
23347 * delegate.cs (NewDelegate): New class to take care of delegate
23350 * expression.cs (New): Split the delegate related code out into
23351 the NewDelegate class.
23353 * delegate.cs (DelegateInvocation): New class to handle delegate
23356 * expression.cs (Invocation): Split out delegate related code into
23357 the DelegateInvocation class.
23359 2001-10-17 Ravi Pratap <ravi@ximian.com>
23361 * expression.cs (New::DoResolve): Implement delegate creation fully
23362 and according to the spec.
23364 (New::DoEmit): Update to handle delegates differently.
23366 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23367 because of which we were printing out arguments in reverse order !
23369 * delegate.cs (VerifyMethod): Implement to check if the given method
23370 matches the delegate.
23372 (FullDelegateDesc): Implement.
23374 (VerifyApplicability): Implement.
23376 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23377 delegate invocations too.
23379 (Invocation::Emit): Ditto.
23381 * ../errors/cs1593.cs : Added.
23383 * ../errors/cs1594.cs : Added.
23385 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23387 2001-10-16 Ravi Pratap <ravi@ximian.com>
23389 * typemanager.cs (intptr_type): Core type for System.IntPtr
23391 (InitCoreTypes): Update for the same.
23393 (iasyncresult_type, asynccallback_type): Ditto.
23395 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23398 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23401 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23402 the builders for the 4 members of a delegate type :-)
23404 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23407 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23409 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23411 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23413 * statement.cs (Break::Emit): Implement.
23414 (Continue::Emit): Implement.
23416 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23417 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23418 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23419 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23422 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23423 properties that track the label for the current loop (begin of the
23424 loop and end of the loop).
23426 2001-10-15 Ravi Pratap <ravi@ximian.com>
23428 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23429 use of emitting anything at all.
23431 * class.cs, rootcontext.cs : Get rid of calls to the same.
23433 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23435 (Populate): Define the constructor correctly and set the implementation
23438 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23441 (AddDelegateType): Implement.
23443 (IsDelegateType): Implement helper method.
23445 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23447 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23448 and accordingly handle it.
23450 * delegate.cs (Populate): Take TypeContainer argument.
23451 Implement bits to define the Invoke method. However, I still haven't figured out
23452 how to take care of the native int bit :-(
23454 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23455 Qualify the name of the delegate, not its return type !
23457 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23460 (StandardConversionExists): Checking for array types turns out to be recursive.
23462 (ConvertReferenceExplicit): Implement array conversion.
23464 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23466 2001-10-12 Ravi Pratap <ravi@ximian.com>
23468 * cs-parser.jay (delegate_declaration): Store the fully qualified
23469 name as it is a type declaration.
23471 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23474 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23475 as TypeContainer::DefineType.
23477 (Populate): Method in which all the definition of the various methods (Invoke)
23480 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23483 (CloseDelegate): Finally creates the delegate.
23485 * class.cs (TypeContainer::DefineType): Update to define delegates.
23486 (Populate, Emit and CloseType): Do the same thing here too.
23488 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23489 delegates in all these operations.
23491 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23493 * expression.cs: LocalTemporary: a new expression used to
23494 reference a temporary that has been created.
23496 * assign.cs: Handle PropertyAccess back here, so that we can
23497 provide the proper semantic access to properties.
23499 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23500 a few more explicit conversions.
23502 * modifiers.cs: `NEW' modifier maps to HideBySig.
23504 * expression.cs (PropertyExpr): Make this into an
23505 ExpressionStatement, and support the EmitStatement code path.
23507 Perform get/set error checking, clean up the interface.
23509 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23510 them into toplevel access objects.
23512 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23514 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23517 * typemanager.cs: Keep track here of our PropertyBuilders again to
23518 work around lameness in SRE.
23520 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23522 * expression.cs (LValue::LValueResolve): New method in the
23523 interface, used to perform a second resolution pass for LValues.
23525 (This::DoResolve): Catch the use of this in static methods.
23527 (This::LValueResolve): Implement.
23529 (This::Store): Remove warning, assigning to `this' in structures
23532 (Invocation::Emit): Deal with invocation of
23533 methods on value types. We need to pass the address to structure
23534 methods rather than the object itself. (The equivalent code to
23535 emit "this" for structures leaves the entire structure on the
23536 stack instead of a pointer to it).
23538 (ParameterReference::DoResolve): Compute the real index for the
23539 argument based on whether the method takes or not a `this' pointer
23540 (ie, the method is static).
23542 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23543 value types returned from functions when we need to invoke a
23544 method on the sturcture.
23547 2001-10-11 Ravi Pratap <ravi@ximian.com>
23549 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23550 defining the type in the Modulebuilder or Typebuilder. This is to take
23551 care of nested types which need to be defined on the TypeBuilder using
23552 DefineNestedMethod.
23554 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23555 methods in RootContext, only ported to be part of TypeContainer.
23557 (TypeContainer::GetInterfaceOrClass): Ditto.
23559 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23561 * interface.cs (Interface::DefineInterface): New method. Does exactly
23562 what RootContext.CreateInterface did earlier, only it takes care of nested types
23565 (Interface::GetInterfaces): Move from RootContext here and port.
23567 (Interface::GetInterfaceByName): Same here.
23569 * rootcontext.cs (ResolveTree): Re-write.
23571 (PopulateTypes): Re-write.
23573 * class.cs (TypeContainer::Populate): Populate nested types too.
23574 (TypeContainer::Emit): Emit nested members too.
23576 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23577 instead just use the name argument passed in as it is already fully
23580 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23581 to TypeContainer mapping to see if a type is user-defined.
23583 * class.cs (TypeContainer::CloseType): Implement.
23585 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23586 the default constructor.
23588 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23591 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23593 * interface.cs (CloseType): Create the type here.
23595 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23598 Remove all the methods which are now in TypeContainer.
23600 2001-10-10 Ravi Pratap <ravi@ximian.com>
23602 * delegate.cs (Define): Re-write bits to define the delegate
23605 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23607 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23609 * expression.cs (ImplicitReferenceConversion): handle null as well
23610 as a source to convert to any reference type.
23612 * statement.cs (Return): Perform any implicit conversions to
23613 expected return type.
23615 Validate use of return statement.
23617 * codegen.cs (EmitContext): Pass the expected return type here.
23619 * class.cs (Method, Constructor, Property): Pass expected return
23620 type to EmitContext.
23622 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23624 * expression.cs: Make DoResolve take an EmitContext instead of a
23627 Replaced `l' and `location' for `loc', for consistency.
23629 (Error, Warning): Remove unneeded Tc argument.
23631 * assign.cs, literal.cs, constant.cs: Update to new calling
23634 * codegen.cs: EmitContext now contains a flag indicating whether
23635 code is being generated in a static method or not.
23637 * cs-parser.jay: DecomposeQI, new function that replaces the old
23638 QualifiedIdentifier. Now we always decompose the assembled
23639 strings from qualified_identifier productions into a group of
23642 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23644 * rootcontext.cs: Deal with field-less struct types correctly now
23645 by passing the size option to Define Type.
23647 * class.cs: Removed hack that created one static field.
23649 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23651 * statement.cs: Moved most of the code generation here.
23653 2001-10-09 Ravi Pratap <ravi@ximian.com>
23655 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23658 (ElementAccess): Remove useless bits for now - keep checks as the spec
23661 2001-10-08 Ravi Pratap <ravi@ximian.com>
23663 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23664 and start performing checks according to the spec.
23666 2001-10-07 Ravi Pratap <ravi@ximian.com>
23668 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23669 rank_specifiers instead.
23671 (rank_specifiers): Change the order in which the rank specifiers are stored
23673 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23675 * expression.cs (ElementAccess): Implement the LValue interface too.
23677 2001-10-06 Ravi Pratap <ravi@ximian.com>
23679 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23680 except that user defined conversions are not included.
23682 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23683 perform the conversion of the return type, if necessary.
23685 (New::DoResolve): Check whether we are creating an array or an object
23686 and accordingly do the needful.
23688 (New::Emit): Same here.
23690 (New::DoResolve): Implement guts of array creation.
23692 (New::FormLookupType): Helper function.
23694 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23696 * codegen.cs: Removed most of the code generation here, and move the
23697 corresponding code generation bits to the statement classes.
23699 Added support for try/catch/finalize and throw.
23701 * cs-parser.jay: Added support for try/catch/finalize.
23703 * class.cs: Catch static methods having the flags override,
23704 virtual or abstract.
23706 * expression.cs (UserCast): This user cast was not really doing
23707 what it was supposed to do. Which is to be born in fully resolved
23708 state. Parts of the resolution were being performed at Emit time!
23712 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23714 * expression.cs: Implicity convert the result from UserCast.
23716 2001-10-05 Ravi Pratap <ravi@ximian.com>
23718 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23719 prevented it from working correctly.
23721 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23722 merely ConvertImplicit.
23724 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23726 * typemanager.cs: Make the LookupTypeContainer function static,
23727 and not per-instance.
23729 * class.cs: Make static FindMembers (the one that takes a Type
23732 * codegen.cs: Add EmitForeach here.
23734 * cs-parser.jay: Make foreach a toplevel object instead of the
23735 inline expansion, as we need to perform semantic analysis on it.
23737 2001-10-05 Ravi Pratap <ravi@ximian.com>
23739 * expression.cs (Expression::ImplicitUserConversion): Rename to
23740 UserDefinedConversion.
23742 (Expression::UserDefinedConversion): Take an extra argument specifying
23743 whether we look for explicit user conversions too.
23745 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23747 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23749 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23750 with the appropriate arguments.
23752 * cs-parser.jay (cast_expression): Record location too.
23754 * expression.cs (Cast): Record location info.
23756 (Expression::ConvertExplicit): Take location argument.
23758 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23759 to determine if we are doing explicit conversions.
23761 (UserCast::Emit): Update accordingly.
23763 (Expression::ConvertExplicit): Report an error if everything fails.
23765 * ../errors/cs0030.cs : Add.
23767 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23769 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23770 virtual and newslot bits.
23772 * class.cs (TypeContainer::RegisterRequiredImplementations):
23773 Record methods we need.
23775 (TypeContainer::MakeKey): Helper function to make keys for
23776 MethodBases, since the Methodbase key is useless.
23778 (TypeContainer::Populate): Call RegisterRequiredImplementations
23779 before defining the methods.
23781 Create a mapping for method_builders_to_methods ahead of time
23782 instead of inside a tight loop.
23784 (::RequireMethods): Accept an object as the data to set into the
23785 hashtable so we can report interface vs abstract method mismatch.
23787 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23789 * report.cs: Make all of it static.
23791 * rootcontext.cs: Drop object_type and value_type computations, as
23792 we have those in the TypeManager anyways.
23794 Drop report instance variable too, now it is a global.
23796 * driver.cs: Use try/catch on command line handling.
23798 Add --probe option to debug the error reporting system with a test
23801 * report.cs: Add support for exiting program when a probe
23802 condition is reached.
23804 2001-10-03 Ravi Pratap <ravi@ximian.com>
23806 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23807 we do a forcible conversion regardless of type, to check if
23808 ForceConversion returns a null.
23810 (Binary::error19): Use location to report error.
23812 (Unary::error23): Use location here too.
23814 * ../errors/cs0019.cs : Check in.
23816 * ../errors/cs0023.cs : Check in.
23818 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23819 case of a non-null MethodInfo object with a length of 0 !
23821 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23822 an applicable member - according to the spec :-)
23823 Also fix logic to find members in base types.
23825 (Unary::ResolveOperator): Same here.
23827 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23828 as I was getting thoroughly confused between this and error19 :-)
23830 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23831 (::FindMostEncompassedType): Implement.
23832 (::FindMostEncompassingType): Implement.
23833 (::StandardConversionExists): Implement.
23835 (UserImplicitCast): Re-vamp. We now need info about most specific
23836 source and target types so that we can do the necessary conversions.
23838 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23839 mathematical union with no duplicates.
23841 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23843 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23844 in order from base classes to child classes, so that we can in
23845 child classes look up in our parent for method names and
23846 attributes (required for handling abstract, virtual, new, override
23847 constructs: we need to instrospect our base class, and if we dont
23848 populate the classes in order, the introspection might be
23849 incorrect. For example, a method could query its parent before
23850 the parent has any methods and would determine that the parent has
23851 no abstract methods (while it could have had them)).
23853 (RootContext::CreateType): Record the order in which we define the
23856 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23858 * class.cs (TypeContainer::Populate): Also method definitions can
23859 fail now, keep track of this.
23861 (TypeContainer::FindMembers): Implement support for
23862 DeclaredOnly/noDeclaredOnly flag.
23864 (Constructor::Emit) Return the ConstructorBuilder.
23866 (Method::Emit) Return the MethodBuilder.
23867 Check for abstract or virtual methods to be public.
23869 * rootcontext.cs (RootContext::CreateType): Register all the
23870 abstract methods required for the class to be complete and the
23871 interface methods that must be implemented.
23873 * cs-parser.jay: Report error 501 (method requires body if it is
23874 not marked abstract or extern).
23876 * expression.cs (TypeOf::Emit): Implement.
23878 * typemanager.cs: runtime_handle_type, new global type.
23880 * class.cs (Property::Emit): Generate code for properties.
23882 2001-10-02 Ravi Pratap <ravi@ximian.com>
23884 * expression.cs (Unary::ResolveOperator): Find operators on base type
23885 too - we now conform exactly to the spec.
23887 (Binary::ResolveOperator): Same here.
23889 * class.cs (Operator::Define): Fix minor quirk in the tests.
23891 * ../errors/cs0215.cs : Added.
23893 * ../errors/cs0556.cs : Added.
23895 * ../errors/cs0555.cs : Added.
23897 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23899 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23900 single integer which is really efficient
23902 2001-10-01 Ravi Pratap <ravi@ximian.com>
23904 * expression.cs (Expression::ImplicitUserConversion): Use location
23905 even in the case when we are examining True operators.
23907 * class.cs (Operator::Define): Perform extensive checks to conform
23908 with the rules for operator overloading in the spec.
23910 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23911 some of the other conversions mentioned in the spec.
23913 * typemanager.cs (array_type): New static member for the System.Array built-in
23916 (cloneable_interface): For System.ICloneable interface.
23918 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23919 we start resolving the tree and populating types.
23921 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23923 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23925 * expression.cs (Expression::ExprClassFromMemberInfo,
23926 Expression::Literalize): Create literal expressions from
23927 FieldInfos which are literals.
23929 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23930 type casts, because they were wrong. The test suite in tests
23933 (ImplicitNumericConversion): ushort to ulong requires a widening
23936 Int32 constant to long requires widening cast as well.
23938 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23939 for integers because the type on the stack is not i4.
23941 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23943 * expression.cs (report118): require location argument.
23945 * parameter.cs: Do not dereference potential null value.
23947 * class.cs: Catch methods that lack the `new' keyword when
23948 overriding a name. Report warnings when `new' is used without
23949 anything being there to override.
23951 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23953 * class.cs: Only add constructor to hashtable if it is non-null
23954 (as now constructors can fail on define).
23956 (TypeManager, Class, Struct): Take location arguments.
23958 Catch field instance initialization in structs as errors.
23960 accepting_filter: a new filter for FindMembers that is static so
23961 that we dont create an instance per invocation.
23963 (Constructor::Define): Catch errors where a struct constructor is
23966 * cs-parser.jay: Pass location information for various new
23969 * delegate.cs (Delegate): take a location argument.
23971 * driver.cs: Do not call EmitCode if there were problesm in the
23972 Definition of the types, as many Builders wont be there.
23974 * decl.cs (Decl::Decl): Require a location argument.
23976 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23977 into integers, and find the most appropiate integer for it.
23979 * literal.cs: Implement ULongLiteral.
23981 * rootcontext.cs: Provide better information about the location of
23982 failure when CreateType fails.
23984 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23986 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23989 * expression.cs (Binary::CheckShiftArguments): Add missing type
23991 (Binary::ResolveOperator): Add type to the logical and and logical
23992 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23995 (Binary::DoNumericPromotions): In the case where either argument
23996 is ulong (and most signed types combined with ulong cause an
23997 error) perform implicit integer constant conversions as well.
23999 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24001 * expression.cs (UserImplicitCast): Method should always be
24003 (Invocation::BetterConversion): Simplified test for IntLiteral.
24005 (Expression::ImplicitNumericConversion): Split this routine out.
24006 Put the code that performs implicit constant integer conversions
24009 (Expression::Resolve): Become a wrapper around DoResolve so we can
24010 check eclass and type being set after resolve.
24012 (Invocation::Badness): Remove this dead function
24014 (Binary::ResolveOperator): Do not compute the expensive argumnets
24015 unless we have a union for it.
24017 (Probe::Emit): Is needs to do an isinst and then
24018 compare against null.
24020 (::CanConvert): Added Location argument. If the Location argument
24021 is null (Location.Null), then we do not report errors. This is
24022 used by the `probe' mechanism of the Explicit conversion. We do
24023 not want to generate an error for something that the user
24024 explicitly requested to be casted. But the pipeline for an
24025 explicit cast first tests for potential implicit casts.
24027 So for now, if the Location is null, it means `Probe only' to
24028 avoid adding another argument. Might have to revise this
24031 (ClassCast): New class used to type cast objects into arbitrary
24032 classes (used in Explicit Reference Conversions).
24034 Implement `as' as well.
24036 Reverted all the patches from Ravi below: they were broken:
24038 * The use of `level' as a mechanism to stop recursive
24039 invocations is wrong. That was there just to catch the
24040 bug with a strack trace but not as a way of addressing
24043 To fix the problem we have to *understand* what is going
24044 on and the interactions and come up with a plan, not
24045 just get things going.
24047 * The use of the type conversion cache that I proposed
24048 last night had an open topic: How does this work across
24049 protection domains. A user defined conversion might not
24050 be public in the location where we are applying the
24051 conversion, a different conversion might be selected
24052 (ie, private A->B (better) but public B->A (worse),
24053 inside A, A->B applies, but outside it, B->A will
24056 * On top of that (ie, even if the above is solved),
24057 conversions in a cache need to be abstract. Ie, `To
24058 convert from an Int to a Short use an OpcodeCast', not
24059 `To convert from an Int to a Short use the OpcodeCast on
24060 the variable 5' (which is what this patch was doing).
24062 2001-09-28 Ravi Pratap <ravi@ximian.com>
24064 * expression.cs (Invocation::ConversionExists): Re-write to use
24065 the conversion cache
24067 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24068 cache all conversions done, not just user-defined ones.
24070 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24071 to determine if a conversion exists instead of acutually trying to
24072 perform the conversion. It's faster too.
24074 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24075 and only then attempt the implicit conversion.
24077 2001-09-28 Ravi Pratap <ravi@ximian.com>
24079 * expression.cs (ConvertImplicit): Use a cache for conversions
24080 already found. Check level of recursion and bail out if necessary.
24082 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24084 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24085 Export standard methods that we expect for string operations.
24087 * statement.cs (Block::UsageWarning): Track usage of variables and
24088 report the errors for not used variables.
24090 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24093 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24095 * codegen.cs: remove unnneded code
24097 * expression.cs: Removed BuiltinTypeAccess class
24099 Fix the order in which implicit conversions are
24102 The previous fixed dropped support for boxed conversions (adding a
24103 test to the test suite now)
24105 (UserImplicitCast::CanConvert): Remove test for source being null,
24106 that code is broken. We should not feed a null to begin with, if
24107 we do, then we should track the bug where the problem originates
24108 and not try to cover it up here.
24110 Return a resolved expression of type UserImplicitCast on success
24111 rather than true/false. Ravi: this is what I was talking about,
24112 the pattern is to use a static method as a "constructor" for
24115 Also, do not create arguments until the very last minute,
24116 otherwise we always create the arguments even for lookups that
24117 will never be performed.
24119 (UserImplicitCast::Resolve): Eliminate, objects of type
24120 UserImplicitCast are born in a fully resolved state.
24122 * typemanager.cs (InitCoreTypes): Init also value_type
24123 (System.ValueType).
24125 * expression.cs (Cast::Resolve): First resolve the child expression.
24127 (LValue): Add new method AddressOf to be used by
24130 Change the argument of Store to take an EmitContext instead of an
24131 ILGenerator, because things like FieldExpr need to be able to call
24132 their children expression to generate the instance code.
24134 (Expression::Error, Expression::Warning): Sugar functions for
24137 (Expression::MemberLookup): Accept a TypeContainer instead of a
24138 Report as the first argument.
24140 (Expression::ResolvePrimary): Killed. I still want to improve
24141 this as currently the code is just not right.
24143 (Expression::ResolveMemberAccess): Simplify, but it is still
24146 (Unary::Resolve): Catch errors in AddressOf operators.
24148 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24149 index to a byte for the short-version, or the compiler will choose
24150 the wrong Emit call, which generates the wrong data.
24152 (ParameterReference::Emit, ::Store): same.
24154 (FieldExpr::AddressOf): Implement.
24156 * typemanager.cs: TypeManager: made public variable instead of
24159 * driver.cs: document --fatal.
24161 * report.cs (ErrorMessage, WarningMessage): new names for the old
24162 Error and Warning classes.
24164 * cs-parser.jay (member_access): Turn built-in access to types
24165 into a normal simplename
24167 2001-09-27 Ravi Pratap <ravi@ximian.com>
24169 * expression.cs (Invocation::BetterConversion): Fix to cope
24170 with q being null, since this was introducing a bug.
24172 * expression.cs (ConvertImplicit): Do built-in conversions first.
24174 2001-09-27 Ravi Pratap <ravi@ximian.com>
24176 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24178 2001-09-27 Ravi Pratap <ravi@ximian.com>
24180 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24181 I had introduced long ago (what's new ?).
24183 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24184 the work of all the checking.
24185 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24186 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24188 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24189 that is the right way.
24191 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24192 overloading resolution. Use everywhere instead of cutting and pasting code.
24194 (Binary::ResolveOperator): Use MakeUnionSet.
24196 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24197 we have to convert to bool types. Not complete yet.
24199 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24201 * typemanager.cs (TypeManager::CSharpName): support ushort.
24203 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24204 to provide an expression that performsn an implicit constant int
24205 conversion (section 6.1.6).
24206 (Expression::ConvertImplicitRequired): Reworked to include
24207 implicit constant expression conversions.
24209 (Expression::ConvertNumericExplicit): Finished.
24211 (Invocation::Emit): If InstanceExpression is null, then it means
24212 that we perform a call on this.
24214 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24216 * expression.cs (Unary::Emit): Remove some dead code.
24217 (Probe): Implement Resolve and Emit for `is'.
24218 (Expression::ConvertImplicitRequired): Attempt to do constant
24219 expression conversions here. Maybe should be moved to
24220 ConvertImplicit, but I am not sure.
24221 (Expression::ImplicitLongConstantConversionPossible,
24222 Expression::ImplicitIntConstantConversionPossible): New functions
24223 that tell whether is it possible to apply an implicit constant
24224 expression conversion.
24226 (ConvertNumericExplicit): Started work on explicit numeric
24229 * cs-parser.jay: Update operator constants.
24231 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24232 (Parameters::GetSignature): Hook up VerifyArgs here.
24233 (Parameters::VerifyArgs): Verifies that no two arguments have the
24236 * class.cs (Operator): Update the operator names to reflect the
24237 ones that the spec expects (as we are just stringizing the
24240 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24241 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24242 previous usage did only work for our methods.
24243 (Expression::ConvertImplicit): Handle decimal implicit numeric
24244 conversions as well.
24245 (Expression::InternalTypeConstructor): Used to invoke constructors
24246 on internal types for default promotions.
24248 (Unary::Emit): Implement special handling for the pre/post
24249 increment/decrement for overloaded operators, as they need to have
24250 the same semantics as the other operators.
24252 (Binary::ResolveOperator): ditto.
24253 (Invocation::ConversionExists): ditto.
24254 (UserImplicitCast::Resolve): ditto.
24256 2001-09-26 Ravi Pratap <ravi@ximian.com>
24258 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24259 operator, return after emitting body. Regression tests pass again !
24261 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24262 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24263 (Invocation::OverloadResolve): Ditto.
24264 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24266 * everywhere : update calls to the above methods accordingly.
24268 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24270 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24272 * expression.cs (ExpressionStatement): New base class used for
24273 expressions that can appear in statements, so that we can provide
24274 an alternate path to generate expression that do not leave a value
24277 (Expression::Emit, and all the derivatives): We no longer return
24278 whether a value is left on the stack or not. Every expression
24279 after being emitted leaves a single value on the stack.
24281 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24282 facilties of ExpressionStatement if possible.
24284 * cs-parser.jay: Update statement_expression.
24286 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24288 * driver.cs: Change the wording of message
24290 2001-09-25 Ravi Pratap <ravi@ximian.com>
24292 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24293 the type of the expression to the return type of the method if
24294 we have an overloaded operator match ! The regression tests pass again !
24295 (Unary::ResolveOperator): Ditto.
24297 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24298 to find "op_Implicit", not "implicit" ;-)
24299 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24300 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24302 * everywhere : Correct calls to the above accordingly.
24304 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24305 (ConvertImplicit): Do user-defined conversion if it exists.
24307 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24309 * assign.cs: track location.
24310 (Resolve): Use implicit conversions on assignment.
24312 * literal.cs: Oops. Not good, Emit of short access values should
24313 pass (Bytes) or the wrong argument will be selected.
24315 * expression.cs (Unary::Emit): Emit code for -expr.
24317 (Unary::ResolveOperator): Handle `Substract' for non-constants
24318 (substract from zero from the non-constants).
24319 Deal with Doubles as well.
24321 (Expression::ConvertImplicitRequired): New routine that reports an
24322 error if no implicit conversion exists.
24324 (Invocation::OverloadResolve): Store the converted implicit
24325 expressions if we make them
24327 2001-09-24 Ravi Pratap <ravi@ximian.com>
24329 * class.cs (ConstructorInitializer): Take a Location argument.
24330 (ConstructorBaseInitializer): Same here.
24331 (ConstructorThisInitializer): Same here.
24333 * cs-parser.jay : Update all calls accordingly.
24335 * expression.cs (Unary, Binary, New): Take location argument.
24336 Update accordingly everywhere.
24338 * cs-parser.jay : Update all calls to the above to take a location
24341 * class.cs : Ditto.
24343 2001-09-24 Ravi Pratap <ravi@ximian.com>
24345 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24346 (Invocation::BetterConversion): Same here
24347 (Invocation::ConversionExists): Ditto.
24349 (Invocation::ConversionExists): Implement.
24351 2001-09-22 Ravi Pratap <ravi@ximian.com>
24353 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24354 Also take an additional TypeContainer argument.
24356 * All over : Pass in TypeContainer as argument to OverloadResolve.
24358 * typemanager.cs (CSharpName): Update to check for the string type and return
24361 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24364 2001-09-21 Ravi Pratap <ravi@ximian.com>
24366 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24367 (Invocation::BetterFunction): Implement.
24368 (Invocation::BetterConversion): Implement.
24369 (Invocation::ConversionExists): Skeleton, no implementation yet.
24371 Okay, things work fine !
24373 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24375 * typemanager.cs: declare and load enum_type, delegate_type and
24378 * expression.cs (Expression::Emit): Now emit returns a value that
24379 tells whether a value is left on the stack or not. This strategy
24380 might be reveted tomorrow with a mechanism that would address
24381 multiple assignments.
24382 (Expression::report118): Utility routine to report mismatches on
24385 (Unary::Report23): Report impossible type/operator combination
24388 (Unary::IsIncrementableNumber): Whether the type can be
24389 incremented or decremented with add.
24390 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24392 (Unary::ResolveOperator): Implement ++, !, ~,
24394 (Invocation::Emit): Deal with new Emit convetion.
24396 * All Expression derivatives: Updated their Emit method to return
24397 whether they leave values on the stack or not.
24399 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24400 stack for expressions that are statements.
24402 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24404 * expression.cs (LValue): New interface. Must be implemented by
24406 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24409 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24410 interface for generating code, simplifies the code.
24412 2001-09-20 Ravi Pratap <ravi@ximian.com>
24414 * expression.cs (everywhere): Comment out return statements in ::Resolve
24415 methods to avoid the warnings.
24417 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24419 * driver.cs (parse): Report error 2001 if we can not open the
24422 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24425 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24428 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24429 otherwise nested blocks end up with the same index.
24431 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24433 * expression.cs: Instead of having FIXMEs in the Resolve
24434 functions, throw exceptions so it is obvious that we are facing a
24437 * cs-parser.jay (invocation_expression): Pass Location information.
24439 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24440 Use a basename for those routines because .NET does not like paths
24443 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24446 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24448 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24449 are loading the correct data types (throws an exception if not).
24450 (TypeManager::InitCoreTypes): Use CoreLookupType
24452 * expression.cs (Unary::ResolveOperator): return the child
24453 expression for expressions which are just +expr.
24454 (Unary::ResolveOperator): Return negative literals for -LITERAL
24455 expressions (otherwise they are Unary {Literal}).
24456 (Invocation::Badness): Take into account `Implicit constant
24457 expression conversions'.
24459 * literal.cs (LongLiteral): Implement long literal class.
24460 (IntLiteral): export the `Value' of the intliteral.
24462 2001-09-19 Ravi Pratap <ravi@ximian.com>
24464 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24466 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24467 instead of 'Operator'
24469 * expression.cs (Binary::ResolveOperator): Update accordingly.
24470 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24473 * cs-parser.jay (unary_expression): Update to use the new names.
24475 * gen-treedump.cs (GetUnary): Same here.
24477 * expression.cs (Unary::Resolve): Implement.
24478 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24479 operators are found instead of making noise ;-)
24480 (Unary::ResolveOperator): New method to do precisely the same thing which
24481 Binary::ResolveOperator does for Binary expressions.
24482 (Unary.method, .Arguments): Add.
24483 (Unary::OperName): Implement.
24484 (Unary::ForceConversion): Copy and Paste !
24486 * class.cs (Operator::Define): Fix a small bug for the case when we have
24489 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24490 for the inbuilt operators. Only overloading works for now ;-)
24492 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24494 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24495 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24497 * expression.cs (This::Emit): Implement.
24498 (This::Resolve): Implement.
24499 (TypeOf:Resolve): Implement.
24500 (Expression::ResolveSimpleName): Add an implicit this to instance
24502 (MemberAccess::Resolve): Deal with Parameters and Fields.
24503 Bind instance variable to Field expressions.
24504 (FieldExpr::Instance): New field used to track the expression that
24505 represents the object instance.
24506 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24508 (FieldExpr::Emit): Implement.
24510 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24511 the last instruction contains a return opcode to avoid generating
24512 the last `ret' instruction (this generates correct code, and it is
24513 nice to pass the peverify output).
24515 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24516 initializer for static and instance variables.
24517 (Constructor::Emit): Allow initializer to be null in the case of
24518 static constructors. Only emit initializer for instance
24521 (TypeContainer::FindMembers): Return a null array if there are no
24524 Also fix the code for the MemberTypes.Method branch, as it was not
24525 scanning that for operators (or tried to access null variables before).
24527 * assign.cs (Assign::Emit): Handle instance and static fields.
24531 * driver.cs: Stop compilation if there are parse errors.
24533 * cs-parser.jay (constructor_declaration): Provide default base
24534 initializer for non-static constructors.
24535 (constructor_declarator): Do not provide a default base
24536 initializers if none was specified.
24537 Catch the fact that constructors should not have parameters.
24539 * class.cs: Do not emit parent class initializers for static
24540 constructors, that should be flagged as an error.
24542 2001-09-18 Ravi Pratap <ravi@ximian.com>
24544 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24545 Move back code into TypeContainer::Populate.
24547 2001-09-18 Ravi Pratap <ravi@ximian.com>
24549 * class.cs (TypeContainer::AddConstructor): Fix the check to
24550 compare against Name, not Basename.
24551 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24553 * cs-parser.jay : Update accordingly.
24555 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24556 for methods, don't forget to look into the operators too.
24557 (RegisterMethodBuilder): Helper method to take care of this for
24558 methods, constructors and operators.
24559 (Operator::Define): Completely revamp.
24560 (Operator.OperatorMethod, MethodName): New fields.
24561 (TypeContainer::Populate): Move the registering of builders into
24562 RegisterMethodBuilder.
24563 (Operator::Emit): Re-write.
24565 * expression.cs (Binary::Emit): Comment out code path to emit method
24566 invocation stuff for the case when we have a user defined operator. I am
24567 just not able to get it right !
24569 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24571 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24574 (Expression::MemberLookup): Provide a version that allows to
24575 specify the MemberTypes and BindingFlags.
24577 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24578 so it was not fetching variable information from outer blocks.
24580 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24581 Beforefieldinit as it was buggy.
24583 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24584 that Ravi put here.
24586 * class.cs (Constructor::Emit): Only emit if block is not null.
24587 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24588 deal with this by semantically definining it as if the user had
24591 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24592 constructors as we now "emit" them at a higher level.
24594 (TypeContainer::DefineDefaultConstructor): Used to define the
24595 default constructors if none was provided.
24597 (ConstructorInitializer): Add methods Resolve and Emit.
24599 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24601 2001-09-17 Ravi Pratap <ravi@ximian.com>
24603 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24604 the default constructor builder with our hashtable for methodbuilders
24607 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24608 and argument_count is 0 in which case we have a match.
24609 (Binary::ResolveOperator): More null checking and miscellaneous coding
24612 2001-09-17 Ravi Pratap <ravi@ximian.com>
24614 * rootcontext.cs (IsNameSpace): Compare against null.
24616 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24618 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24619 and Unary::Operator.
24621 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24624 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24625 we have overloaded operators.
24626 (Binary::ResolveOperator): Implement the part which does the operator overload
24629 * class.cs (Operator::Emit): Implement.
24630 (TypeContainer::Emit): Emit the operators we have too.
24632 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24633 the case when we have a user-defined operator.
24635 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24637 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24639 2001-09-16 Ravi Pratap <ravi@ximian.com>
24641 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24642 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24643 (Constructor::Emit): Implement.
24644 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24645 if we have no work to do.
24646 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24649 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24650 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24652 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24655 2001-09-15 Ravi Pratap <ravi@ximian.com>
24657 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24659 (Tree::RecordNamespace): Method to do what the name says ;-)
24660 (Tree::Namespaces): Property to get at the namespaces hashtable.
24662 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24665 * rootcontext.cs (IsNamespace): Fixed it :-)
24667 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24669 * class.cs (TypeContainer::FindMembers): Add support for
24671 (MethodCore): New class that encapsulates both the shared aspects
24672 of a Constructor and a Method.
24673 (Method, Constructor): Factored pieces into MethodCore.
24675 * driver.cs: Added --fatal which makes errors throw exceptions.
24676 Load System assembly as well as part of the standard library.
24678 * report.cs: Allow throwing exceptions on errors for debugging.
24680 * modifiers.cs: Do not use `parent', instead use the real type
24681 container to evaluate permission settings.
24683 * class.cs: Put Ravi's patch back in. He is right, and we will
24684 have to cope with the
24686 2001-09-14 Ravi Pratap <ravi@ximian.com>
24688 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24689 FamORAssem, not FamANDAssem.
24691 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24693 * driver.cs: Added --parse option that only parses its input files
24696 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24697 incorrect. IsTopLevel is not used to tell whether an object is
24698 root_types or not (that can be achieved by testing this ==
24699 root_types). But to see if this is a top-level *class* (not
24700 necessarly our "toplevel" container).
24702 2001-09-14 Ravi Pratap <ravi@ximian.com>
24704 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24705 parent instead of a direct call to GetType.
24707 2001-09-14 Ravi Pratap <ravi@ximian.com>
24709 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24710 Modifiers.TypeAttr. This should just be a call to that method.
24712 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24713 object so that we can determine if we are top-level or not.
24715 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24718 * enum.cs (Enum::Define): Ditto.
24720 * modifiers.cs (FieldAttr): Re-write.
24722 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24723 (TypeContainer::HaveStaticConstructor): New property to provide access
24724 to precisely that info.
24726 * modifiers.cs (MethodAttr): Re-write.
24727 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24729 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24730 of top-level types as claimed.
24732 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24734 * expression.cs (MemberLookup): Fruitless attempt to lookup
24735 constructors. Maybe I need to emit default constructors? That
24736 might be it (currently .NET emits this for me automatically).
24737 (Invocation::OverloadResolve): Cope with Arguments == null.
24738 (Invocation::EmitArguments): new function, shared by the new
24739 constructor and us.
24740 (Invocation::Emit): Handle static and instance methods. Emit
24741 proper call instruction for virtual or non-virtual invocations.
24742 (New::Emit): Implement.
24743 (New::Resolve): Implement.
24744 (MemberAccess:Resolve): Implement.
24745 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24746 to track instances.
24747 (FieldExpr::Resolve): Set type.
24749 * support.cs: Handle empty arguments.
24751 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24752 SimpleLookup): Auxiliary routines to help parse a qualifier
24755 Update qualifier_identifier rule.
24757 * codegen.cs: Removed debugging messages.
24759 * class.cs: Make this a global thing, this acts just as a "key" to
24760 objects that we might have around.
24762 (Populate): Only initialize method_builders_to_methods once.
24764 * expression.cs (PropertyExpr): Initialize type from the
24767 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24768 Resolve pattern. Attempt to implicitly convert value to boolean.
24771 * expression.cs: Set the type for the int32/int32 argument case.
24772 (Binary::ResolveOperator): Set the return type to boolean for
24773 comparission operators
24775 * typemanager.cs: Remove debugging print code.
24777 (Invocation::Resolve): resolve type.
24779 * class.cs: Allocate a MemberInfo of the correct size, as the code
24780 elsewhere depends on the test to reflect the correct contents.
24782 (Method::) Keep track of parameters, due to System.Reflection holes
24784 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24787 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24788 of the exact size and return that.
24790 (Class::LookupMethodByBuilder): New function that maps
24791 MethodBuilders to its methods. Required to locate the information
24792 on methods because System.Reflection bit us again.
24794 * support.cs: New file, contains an interface ParameterData and
24795 two implementations: ReflectionParameters and InternalParameters
24796 used to access Parameter information. We will need to grow this
24799 * expression.cs (Invocation::GetParameterData): implement a cache
24800 and a wrapper around the ParameterData creation for methods.
24801 (Invocation::OverloadResolve): Use new code.
24803 2001-09-13 Ravi Pratap <ravi@ximian.com>
24805 * class.cs (TypeContainer::EmitField): Remove and move into
24806 (Field::Define): here and modify accordingly.
24807 (Field.FieldBuilder): New member.
24808 (TypeContainer::Populate): Update accordingly.
24809 (TypeContainer::FindMembers): Implement.
24811 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24813 * statement.cs: (VariableInfo::VariableType): New field to be
24814 initialized with the full type once it is resolved.
24816 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24818 * parameter.cs (GetParameterInfo): Use a type cache to compute
24819 things only once, and to reuse this information
24821 * expression.cs (LocalVariableReference::Emit): Implement.
24822 (OpcodeCast::Emit): fix.
24824 (ParameterReference::Resolve): Implement.
24825 (ParameterReference::Emit): Implement.
24827 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24828 that are expressions need to stay as Expressions.
24830 * typemanager.cs (CSharpName): Returns the C# name of a type if
24833 * expression.cs (Expression::ConvertImplicit): New function that
24834 implements implicit type conversions.
24836 (Expression::ImplicitReferenceConversion): Implements implicit
24837 reference conversions.
24839 (EmptyCast): New type for transparent casts.
24841 (OpcodeCast): New type for casts of types that are performed with
24842 a sequence of bytecodes.
24844 (BoxedCast): New type used for casting value types into reference
24845 types. Emits a box opcode.
24847 (Binary::DoNumericPromotions): Implements numeric promotions of
24848 and computation of the Binary::Type.
24850 (Binary::EmitBranchable): Optimization.
24852 (Binary::Emit): Implement code emission for expressions.
24854 * typemanager.cs (TypeManager): Added two new core types: sbyte
24857 2001-09-12 Ravi Pratap <ravi@ximian.com>
24859 * class.cs (TypeContainer::FindMembers): Method which does exactly
24860 what Type.FindMembers does, only we don't have to use reflection. No
24861 implementation yet.
24863 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24864 typecontainer objects as we need to get at them.
24865 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24867 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24868 typecontainer object.
24870 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24871 of just a Report object.
24873 2001-09-11 Ravi Pratap <ravi@ximian.com>
24875 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24877 (TypeContainer::Populate): Now define the delegates of the type too.
24878 (TypeContainer.Delegates): Property to access the list of delegates defined
24881 * delegates.cs (Delegate::Define): Implement partially.
24883 * modifiers.cs (TypeAttr): Handle more flags.
24885 2001-09-11 Ravi Pratap <ravi@ximian.com>
24887 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24889 (Operator::Define): Re-write logic to get types by using the LookupType method
24890 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24891 (Indexer::Define): Ditto.
24892 (Event::Define): Ditto.
24893 (Property::Define): Ditto.
24895 2001-09-10 Ravi Pratap <ravi@ximian.com>
24897 * class.cs (TypeContainer::Populate): Now define operators too.
24898 (TypeContainer.Operators): New property to access the list of operators
24900 (Operator.OperatorMethodBuilder): New member to hold the method builder
24901 for the operator we are defining.
24902 (Operator::Define): Implement.
24904 2001-09-10 Ravi Pratap <ravi@ximian.com>
24906 * class.cs (Event::Define): Make the prefixes of the accessor methods
24907 addOn_ and removeOn_
24909 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24910 of the location being passed in too. Ideally, this should go later since all
24911 error reporting should be done through the Report object.
24913 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24914 (Populate): Iterate thru the indexers we have and define them too.
24915 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24916 for the get and set accessors.
24917 (Indexer::Define): Implement.
24919 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24921 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24922 my previous implementation, did not work.
24924 * typemanager.cs: Add a couple of missing types (the longs).
24926 * literal.cs: Use TypeManager.bool_type instead of getting it.
24928 * expression.cs (EventExpr): New kind of expressions.
24929 (Expressio::ExprClassFromMemberInfo): finish
24931 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24933 * assign.cs: Emit stores to static fields differently.
24935 2001-09-08 Ravi Pratap <ravi@ximian.com>
24937 * Merge in changes and adjust code to tackle conflicts. Backed out my
24938 code in Assign::Resolve ;-)
24940 2001-09-08 Ravi Pratap <ravi@ximian.com>
24942 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24943 instead Report.Error and also pass in the location.
24944 (CSharpParser::Lexer): New readonly property to return the reference
24945 to the Tokenizer object.
24946 (declare_local_variables): Use Report.Error with location instead of plain
24950 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24951 (Operator.CheckBinaryOperator): Ditto.
24953 * cs-parser.jay (operator_declarator): Update accordingly.
24955 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24956 (CheckBinaryOperator): Same here.
24958 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24959 on the name without any prefixes of namespace names etc. This is because we
24960 already might have something already fully qualified like
24961 'System.Console.WriteLine'
24963 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24965 2001-09-07 Ravi Pratap <ravi@ximian.com>
24967 * cs-tokenizer.cs (location): Return a string which also contains
24970 * expression.cs (ElementAccess): New class for expressions of the
24971 type 'element access.'
24972 (BaseAccess): New class for expressions of the type 'base access.'
24973 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24976 * cs-parser.jay (element_access): Implement action.
24977 (base_access): Implement actions.
24978 (checked_expression, unchecked_expression): Implement.
24980 * cs-parser.jay (local_variable_type): Correct and implement.
24981 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24983 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24985 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24986 name and the specifiers.
24988 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24990 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24991 making them all public ;-)
24993 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24996 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24998 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25000 (FieldExpr, PropertyExprs): New resolved expressions.
25001 (SimpleName::MemberStaticCheck): Perform static checks for access
25002 to non-static fields on static methods. Maybe this should be
25003 generalized for MemberAccesses.
25004 (SimpleName::ResolveSimpleName): More work on simple name
25007 * cs-parser.jay (primary_expression/qualified_identifier): track
25008 the parameter index.
25010 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25011 (EmitContext::EmitBoolExpression): Chain to expression generation
25012 instead of temporary hack.
25013 (::EmitStatementExpression): Put generic expression code generation.
25015 * assign.cs (Assign::Emit): Implement variable assignments to
25016 local variables, parameters and fields.
25018 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25020 * statement.cs (Block::GetVariableInfo): New method, returns the
25021 VariableInfo for a variable name in a block.
25022 (Block::GetVariableType): Implement in terms of GetVariableInfo
25024 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25025 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25027 2001-09-06 Ravi Pratap <ravi@ximian.com>
25029 * cs-parser.jay (operator_declaration): Continue on my quest : update
25030 to take attributes argument.
25031 (event_declaration): Ditto.
25032 (enum_declaration): Ditto.
25033 (indexer_declaration): Ditto.
25035 * class.cs (Operator::Operator): Update constructor accordingly.
25036 (Event::Event): Ditto.
25038 * delegate.cs (Delegate::Delegate): Same here.
25040 * enum.cs (Enum::Enum): Same here.
25042 2001-09-05 Ravi Pratap <ravi@ximian.com>
25044 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25046 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25048 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25049 being passed around as an arraylist.
25050 (Attributes::AddAttribute): Method to add attribute sections.
25052 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25053 (struct_declaration): Update accordingly.
25054 (constant_declaration): Update.
25055 (field_declaration): Update.
25056 (method_header): Update.
25057 (fixed_parameter): Update.
25058 (parameter_array): Ditto.
25059 (property_declaration): Ditto.
25060 (destructor_declaration): Ditto.
25062 * class.cs (Struct::Struct): Update constructors accordingly.
25063 (Class::Class): Ditto.
25064 (Field::Field): Ditto.
25065 (Method::Method): Ditto.
25066 (Property::Property): Ditto.
25067 (TypeContainer::OptAttribute): update property's return type.
25069 * interface.cs (Interface.opt_attributes): New member.
25070 (Interface::Interface): Update to take the extra Attributes argument.
25072 * parameter.cs (Parameter::Parameter): Ditto.
25074 * constant.cs (Constant::Constant): Ditto.
25076 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25077 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25078 the attributes as a parameter.
25079 (InterfaceProperty): Update constructor call.
25080 (InterfaceEvent): Ditto.
25081 (InterfaceMethod): Ditto.
25082 (InterfaceIndexer): Ditto.
25084 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25085 pass the attributes too.
25086 (interface_event_declaration): Ditto.
25087 (interface_property_declaration): Ditto.
25088 (interface_method_declaration): Ditto.
25089 (interface_declaration): Ditto.
25091 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25093 * class.cs (Method::Define): Track the "static Main" definition to
25094 create an entry point.
25096 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25097 EntryPoint if we find it.
25099 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25100 (EmitContext::ig): Make this variable public.
25102 * driver.cs: Make the default output file be the first file name
25103 with the .exe extension.
25105 Detect empty compilations
25107 Handle various kinds of output targets. Handle --target and
25108 rename -t to --dumper.
25110 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25111 methods inherited from Expression return now an Expression. This
25112 will is used during the tree rewriting as we resolve them during
25115 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25116 the spec. Missing entirely is the information about
25117 accessability of elements of it.
25119 (Expression::ExprClassFromMemberInfo): New constructor for
25120 Expressions that creates a fully initialized Expression based on
25121 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25124 (Invocation::Resolve): Begin implementing resolution of invocations.
25126 * literal.cs (StringLiteral): Implement Emit.
25128 2001-09-05 Ravi Pratap <ravi@ximian.com>
25130 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25133 2001-09-04 Ravi Pratap <ravi@ximian.com>
25135 * cs-parser.jay (attribute_arguments): Implement actions.
25136 (attribute): Fix bug in production. Implement action.
25137 (attribute_list): Implement.
25138 (attribute_target): Implement.
25139 (attribute_target_specifier, opt_target_specifier): Implement
25140 (CheckAttributeTarget): New method to check if the attribute target
25142 (attribute_section): Implement.
25143 (opt_attributes): Implement.
25145 * attribute.cs : New file to handle attributes.
25146 (Attribute): Class to hold attribute info.
25148 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25149 (attribute_section): Modify production to use 2 different rules to
25150 achieve the same thing. 1 s/r conflict down !
25151 Clean out commented, useless, non-reducing dimension_separator rules.
25153 * class.cs (TypeContainer.attributes): New member to hold list
25154 of attributes for a type.
25155 (Struct::Struct): Modify to take one more argument, the attribute list.
25156 (Class::Class): Ditto.
25157 (Field::Field): Ditto.
25158 (Method::Method): Ditto.
25159 (Property::Property): Ditto.
25161 * cs-parser.jay (struct_declaration): Update constructor call to
25162 pass in the attributes too.
25163 (class_declaration): Ditto.
25164 (constant_declaration): Ditto.
25165 (field_declaration): Ditto.
25166 (method_header): Ditto.
25167 (fixed_parameter): Ditto.
25168 (parameter_array): Ditto.
25169 (property_declaration): Ditto.
25171 * constant.cs (Constant::Constant): Update constructor similarly.
25172 Use System.Collections.
25174 * parameter.cs (Parameter::Parameter): Update as above.
25176 2001-09-02 Ravi Pratap <ravi@ximian.com>
25178 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25179 (TypeContainer.delegates): New member to hold list of delegates.
25181 * cs-parser.jay (delegate_declaration): Implement the action correctly
25182 this time as I seem to be on crack ;-)
25184 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25186 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25187 tell whether an identifier represents a namespace.
25189 * expression.cs (NamespaceExpr): A namespace expression, used only
25190 temporarly during expression resolution.
25191 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25192 utility functions to resolve names on expressions.
25194 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25196 * codegen.cs: Add hook for StatementExpressions.
25198 * class.cs: Fix inverted test for static flag in methods.
25200 2001-09-02 Ravi Pratap <ravi@ximian.com>
25202 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25203 to make it coincide with MS' number.
25204 (Operator::CheckBinaryOperator): Ditto.
25206 * ../errors/errors.txt : Remove error numbers added earlier.
25208 * ../errors/cs1019.cs : Test case for error # 1019
25210 * ../errros/cs1020.cs : Test case for error # 1020
25212 * cs-parser.jay : Clean out commented cruft.
25213 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25214 used anywhere - non-reducing rule.
25215 (namespace_declarations): Non-reducing rule - comment out.
25217 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25218 with TypeContainer::AddEnum.
25220 * delegate.cs : New file for delegate handling classes.
25221 (Delegate): Class for declaring delegates.
25223 * makefile : Update.
25225 * cs-parser.jay (delegate_declaration): Implement.
25227 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25229 * class.cs (Event::Define): Implement.
25230 (Event.EventBuilder): New member.
25232 * class.cs (TypeContainer::Populate): Update to define all enums and events
25234 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25235 readonly fields for all these cases ?
25237 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25239 * class.cs (Property): Revamp to use the convention of making fields readonly.
25240 Accordingly modify code elsewhere.
25242 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25243 the Define method of the Property class.
25245 * class.cs : Clean up applied patch and update references to variables etc. Fix
25247 (TypeContainer::Populate): Update to define all the properties we have. Also
25248 define all enumerations.
25250 * enum.cs (Define): Implement.
25252 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25254 * cs-parser.jay (overloadable_operator): The semantic value is an
25255 enum of the Operator class.
25256 (operator_declarator): Implement actions.
25257 (operator_declaration): Implement.
25259 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25260 validity of definitions.
25261 (Operator::CheckBinaryOperator): Static method to check for binary operators
25262 (TypeContainer::AddOperator): New method to add an operator to a type.
25264 * cs-parser.jay (indexer_declaration): Added line to actually call the
25265 AddIndexer method so it gets added ;-)
25267 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25268 already taken care of by the MS compiler ?
25270 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25272 * class.cs (Operator): New class for operator declarations.
25273 (Operator::OpType): Enum for the various operators.
25275 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25277 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25278 ostensibly handle this in semantic analysis.
25280 * cs-parser.jay (general_catch_clause): Comment out
25281 (specific_catch_clauses, specific_catch_clause): Ditto.
25282 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25283 (catch_args, opt_catch_args): New productions.
25284 (catch_clause): Rewrite to use the new productions above
25285 (catch_clauses): Modify accordingly.
25286 (opt_catch_clauses): New production to use in try_statement
25287 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25288 and re-write the code in the actions to extract the specific and
25289 general catch clauses by being a little smart ;-)
25291 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25292 Hooray, try and catch statements parse fine !
25294 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25296 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25297 string from the hashtable of variables.
25299 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25300 I end up making that mistake ;-)
25301 (catch_clauses): Fixed gross error which made Key and Value of the
25302 DictionaryEntry the same : $1 !!
25304 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25306 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25308 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25309 when the add and remove accessors are specified.
25311 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25313 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25314 information about indexer_declarator.
25315 (indexer_declarator): Implement actions.
25316 (parsing_indexer): New local boolean used to keep track of whether
25317 we are parsing indexers or properties. This is necessary because
25318 implicit_parameters come into picture even for the get accessor in the
25319 case of an indexer.
25320 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25322 * class.cs (Indexer): New class for indexer declarations.
25323 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25324 (TypeContainer::indexers): New member to hold list of indexers for the
25327 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25329 * cs-parser.jay (add_accessor_declaration): Implement action.
25330 (remove_accessor_declaration): Implement action.
25331 (event_accessors_declaration): Implement
25332 (variable_declarators): swap statements for first rule - trivial.
25334 * class.cs (Event): New class to hold information about event
25336 (TypeContainer::AddEvent): New method to add an event to a type
25337 (TypeContainer::events): New member to hold list of events.
25339 * cs-parser.jay (event_declaration): Implement actions.
25341 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25343 * cs-parser.jay (dim_separators): Implement. Make it a string
25344 concatenating all the commas together, just as they appear.
25345 (opt_dim_separators): Modify accordingly
25346 (rank_specifiers): Update accordingly. Basically do the same
25347 thing - instead, collect the brackets here.
25348 (opt_rank_sepcifiers): Modify accordingly.
25349 (array_type): Modify to actually return the complete type string
25350 instead of ignoring the rank_specifiers.
25351 (expression_list): Implement to collect the expressions
25352 (variable_initializer): Implement. We make it a list of expressions
25353 essentially so that we can handle the array_initializer case neatly too.
25354 (variable_initializer_list): Implement.
25355 (array_initializer): Make it a list of variable_initializers
25356 (opt_array_initializer): Modify accordingly.
25358 * expression.cs (New::NType): Add enumeration to help us
25359 keep track of whether we have an object/delegate creation
25360 or an array creation.
25361 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25362 members to hold data about array creation.
25363 (New:New): Modify to update NewType
25364 (New:New): New Overloaded contructor for the array creation
25367 * cs-parser.jay (array_creation_expression): Implement to call
25368 the overloaded New constructor.
25370 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25372 * class.cs (TypeContainer::Constructors): Return member
25373 constructors instead of returning null.
25375 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25377 * typemanager.cs (InitCoreTypes): Initialize the various core
25378 types after we have populated the type manager with the user
25379 defined types (this distinction will be important later while
25380 compiling corlib.dll)
25382 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25383 on Expression Classification. Now all expressions have a method
25384 `Resolve' and a method `Emit'.
25386 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25387 generation from working. Also add some temporary debugging
25390 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25392 * codegen.cs: Lots of code generation pieces. This is only the
25393 beginning, will continue tomorrow with more touches of polish. We
25394 handle the fundamentals of if, while, do, for, return. Others are
25395 trickier and I need to start working on invocations soon.
25397 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25400 * codegen.cs (EmitContext): New struct, used during code
25401 emission to keep a context. Most of the code generation will be
25404 * cs-parser.jay: Add embedded blocks to the list of statements of
25405 this block. So code generation proceeds in a top down fashion.
25407 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25409 * statement.cs: Add support for multiple child blocks.
25411 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25413 * codegen.cs (EmitCode): New function, will emit the code for a
25414 Block of code given a TypeContainer and its ILGenerator.
25416 * statement.cs (Block): Standard public readonly optimization.
25417 (Block::Block constructors): Link children.
25418 (Block::Child): Child Linker.
25419 (Block::EmitVariables): Emits IL variable declarations.
25421 * class.cs: Drop support for MethodGroups here, delay until
25423 (Method::): Applied the same simplification that I did before, and
25424 move from Properties to public readonly fields.
25425 (Method::ParameterTypes): Returns the parameter types for the
25426 function, and implements a cache that will be useful later when I
25427 do error checking and the semantic analysis on the methods is
25429 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25430 and made a method, optional argument tells whether this is a class
25431 or a structure to apply the `has-this' bit.
25432 (Method::GetCallingConvention): Implement, returns the calling
25434 (Method::Define): Defines the type, a second pass is performed
25435 later to populate the methods.
25437 (Constructor::ParameterTypes): implement a cache similar to the
25438 one on Method::ParameterTypes, useful later when we do semantic
25441 (TypeContainer::EmitMethod): New method. Emits methods.
25443 * expression.cs: Removed MethodGroup class from here.
25445 * parameter.cs (Parameters::GetCallingConvention): new method.
25447 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25449 * class.cs (TypeContainer::Populate): Drop RootContext from the
25452 (Constructor::CallingConvention): Returns the calling convention.
25453 (Constructor::ParameterTypes): Returns the constructor parameter
25456 (TypeContainer::AddConstructor): Keep track of default constructor
25457 and the default static constructor.
25459 (Constructor::) Another class that starts using `public readonly'
25460 instead of properties.
25462 (Constructor::IsDefault): Whether this is a default constructor.
25464 (Field::) use readonly public fields instead of properties also.
25466 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25467 track of static constructors; If none is used, turn on
25468 BeforeFieldInit in the TypeAttributes.
25470 * cs-parser.jay (opt_argument_list): now the return can be null
25471 for the cases where there are no arguments.
25473 (constructor_declarator): If there is no implicit `base' or
25474 `this', then invoke the default parent constructor.
25476 * modifiers.cs (MethodAttr): New static function maps a set of
25477 modifiers flags into a MethodAttributes enum
25478 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25479 MethodAttr, TypeAttr to represent the various mappings where the
25480 modifiers are used.
25481 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25483 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25485 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25488 * interface.cs (PopulateIndexer): Implemented the code generator
25489 for interface indexers.
25491 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25493 * interface.cs (InterfaceMemberBase): Now we track the new status
25496 (PopulateProperty): Implement property population. Woohoo! Got
25497 Methods and Properties going today.
25499 Removed all the properties for interfaces, and replaced them with
25500 `public readonly' fields.
25502 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25504 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25505 initialize their hashtables/arraylists only when they are needed
25506 instead of doing this always.
25508 * parameter.cs: Handle refs and out parameters.
25510 * cs-parser.jay: Use an ArrayList to construct the arguments
25511 instead of the ParameterCollection, and then cast that to a
25514 * parameter.cs: Drop the use of ParameterCollection and use
25515 instead arrays of Parameters.
25517 (GetParameterInfo): Use the Type, not the Name when resolving
25520 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25522 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25523 and instead use public readonly fields.
25525 * class.cs: Put back walking code for type containers.
25527 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25529 * class.cs (MakeConstant): Code to define constants.
25531 * rootcontext.cs (LookupType): New function. Used to locate types
25534 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25536 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25537 this System.Reflection code is. Kudos to Microsoft
25539 * typemanager.cs: Implement a type cache and avoid loading all
25540 types at boot time. Wrap in LookupType the internals. This made
25541 the compiler so much faster. Wow. I rule!
25543 * driver.cs: Make sure we always load mscorlib first (for
25544 debugging purposes, nothing really important).
25546 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25547 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25549 * rootcontext.cs: Lookup types on their namespace; Lookup types
25550 on namespaces that have been imported using the `using' keyword.
25552 * class.cs (TypeContainer::TypeAttr): Virtualize.
25553 (Class::TypeAttr): Return attributes suitable for this bad boy.
25554 (Struct::TypeAttr): ditto.
25555 Handle nested classes.
25556 (TypeContainer::) Remove all the type visiting code, it is now
25557 replaced with the rootcontext.cs code
25559 * rootcontext.cs (GetClassBases): Added support for structs.
25561 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25563 * interface.cs, statement.cs, class.cs, parameter.cs,
25564 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25565 Drop use of TypeRefs, and use strings instead.
25567 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25571 * class.cs (Struct::Struct): set the SEALED flags after
25572 checking the modifiers.
25573 (TypeContainer::TypeAttr): new property, returns the
25574 TypeAttributes for a class.
25576 * cs-parser.jay (type_list): Oops, list production was creating a
25577 new list of base types.
25579 * rootcontext.cs (StdLib): New property.
25580 (GetInterfaceTypeByName): returns an interface by type name, and
25581 encapsulates error handling here.
25582 (GetInterfaces): simplified.
25583 (ResolveTree): Encapsulated all the tree resolution here.
25584 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25587 * driver.cs: Add support for --nostdlib, to avoid loading the
25588 default assemblies.
25589 (Main): Do not put tree resolution here.
25591 * rootcontext.cs: Beginning of the class resolution.
25593 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25595 * rootcontext.cs: Provide better error reporting.
25597 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25599 * rootcontext.cs (CreateInterface): Handle the case where there
25600 are no parent interfaces.
25602 (CloseTypes): Routine to flush types at the end.
25603 (CreateInterface): Track types.
25604 (GetInterfaces): Returns an array of Types from the list of
25605 defined interfaces.
25607 * typemanager.c (AddUserType): Mechanism to track user types (puts
25608 the type on the global type hash, and allows us to close it at the
25611 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25613 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25614 RecordInterface instead.
25616 * cs-parser.jay: Updated to reflect changes above.
25618 * decl.cs (Definition): Keep track of the TypeBuilder type that
25619 represents this type here. Not sure we will use it in the long
25620 run, but wont hurt for now.
25622 * driver.cs: Smaller changes to accomodate the new code.
25624 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25627 * rootcontext.cs (CreateInterface): New method, used to create
25628 the System.TypeBuilder type for interfaces.
25629 (ResolveInterfaces): new entry point to resolve the interface
25631 (CodeGen): Property, used to keep track of the code generator.
25633 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25635 * cs-parser.jay: Add a second production for delegate_declaration
25638 (enum_body): Put an opt_comma here instead of putting it on
25639 enum_body or enum_member_declarations so we can handle trailing
25640 commas on enumeration members. Gets rid of a shift/reduce.
25642 (type_list): Need a COMMA in the middle.
25644 (indexer_declaration): Tell tokenizer to recognize get/set
25646 * Remove old targets.
25648 * Re-add the parser target.
25650 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25652 * cs-parser.jay: Add precendence rules for a number of operators
25653 ot reduce the number of shift/reduce conflicts in the grammar.
25655 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25657 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25660 Get rid of old crufty code.
25662 * rootcontext.cs: Use this to keep track of the parsed
25663 representation and the defined types available to the program.
25665 * gen-treedump.cs: adjust for new convention.
25667 * type.cs: Split out the type manager, and the assembly builder
25670 * typemanager.cs: the type manager will live here now.
25672 * cil-codegen.cs: And the code generator here.
25674 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25676 * makefile: Fixed up for easy making.
25678 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25680 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25683 (unary_expression): Expand pre_increment_expression and
25684 post_decrement_expression to reduce a shift/reduce.
25686 2001-07-11 Simon Cozens
25688 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25690 Improve allow_keyword_as_indent name.
25692 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25694 * Adjustments for Beta2.
25696 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25698 * decl.cs: Added `Define' abstract method.
25699 (InTransit): new property, used to catch recursive definitions.
25701 * interface.cs: Implement `Define'.
25703 * modifiers.cs: Map Modifiers.constants to
25704 System.Reflection.TypeAttribute flags.
25706 * class.cs: Keep track of types and user-defined types.
25707 (BuilderInit): New method for creating an assembly
25708 (ResolveType): New function to launch the resolution process, only
25709 used by interfaces for now.
25711 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25712 that are inserted into the name space.
25714 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25716 * ARGH. I have screwed up my tree so many times due to the use of
25717 rsync rather than using CVS. Going to fix this at once.
25719 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25722 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25724 * Experiment successful: Use System.Type rather that our own
25727 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25729 * cs-parser.jay: Removed nsAliases from here.
25731 Use new namespaces, handle `using XXX;'
25733 * namespace.cs: Reimplemented namespace handling, use a recursive
25734 definition of the class. Now we can keep track of using clauses
25735 and catch invalid using clauses.
25737 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25739 * gen-treedump.cs: Adapted for all the renaming.
25741 * expression.cs (Expression): this class now has a Type property
25742 which returns an expression Type.
25744 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25745 `Type', as this has a different meaning now in the base
25747 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25749 * interface.cs, class.cs: Removed from all the sources the
25750 references to signature computation, as we can not do method
25751 signature computation during the parsing time, as we are not
25752 trying to solve at that point distinguishing:
25756 void a (NS.Blah x) {}
25759 Which depending on the context might be valid or not, as we do not
25760 know if Blah is the same thing as NS.Blah at that point.
25762 * Redid everything so the code uses TypeRefs now instead of
25763 Types. TypeRefs are just temporary type placeholders, that need
25764 to be resolved. They initially have a pointer to a string and the
25765 current scope in which they are used. This is used later by the
25766 compiler to resolve the reference to an actual Type.
25768 * DeclSpace is no longer a CIR.Type, and neither are
25769 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25770 are all DeclSpaces, but no Types.
25772 * type.cs (TypeRefManager): This implements the TypeRef manager,
25773 which keeps track of all the types that need to be resolved after
25774 the parsing has finished.
25776 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25778 * ARGH. We are going to have to store `foreach' as a class rather
25779 than resolving it, as we need to verify error 1579 after name
25780 resolution. *OR* we could keep a flag that says `This request to
25781 IEnumerator comes from a foreach statement' which we can then use
25782 to generate the error.
25784 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25786 * class.cs (TypeContainer.AddMethod): we now add methods to the
25787 MethodGroup instead of the method hashtable.
25789 * expression.cs: Add MethodGroup abstraction, which gets us one
25790 step closer to the specification in the way we handle method
25793 * cs-parser.jay (primary_expression): qualified_identifier now
25794 tried to match up an identifier to a local variable reference or
25795 to a parameter reference.
25797 current_local_parameters is now a parser global variable that
25798 points to the current parameters for the block, used during name
25801 (property_declaration): Now creates an implicit `value' argument to
25804 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25806 * parameter.cs: Do not use `param' arguments as part of the
25807 signature, per the spec.
25809 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25811 * decl.cs: Base class for classes, structs and interfaces. This
25812 is the "Declaration Space"
25814 * cs-parser.jay: Use CheckDef for checking declaration errors
25815 instead of having one on each function.
25817 * class.cs: Factor out some code for handling error handling in
25818 accordance to the "Declarations" section in the "Basic Concepts"
25819 chapter in the ECMA C# spec.
25821 * interface.cs: Make all interface member classes derive from
25822 InterfaceMemberBase.
25824 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25826 * Many things: all interfaces are parsed and generated in
25827 gen-treedump. Support for member variables, constructors,
25828 destructors, properties, constants is there.
25830 Beginning of the IL backend, but very little done, just there for
25833 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25835 * cs-parser.jay: Fix labeled statement.
25837 * cs-tokenizer.cs (escape): Escape " and ' always.
25838 ref_line, ref_name: keep track of the line/filename as instructed
25839 by #line by the compiler.
25842 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25844 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25845 to match the values in System.CodeDOM.
25847 Divid renamed to Divide.
25849 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25851 (Statements.set): remove.
25853 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25856 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25857 falseStatements always have valid values.
25859 * cs-parser.jay: Use System.CodeDOM now.