1 2007-06-05 Marek Safar <marek.safar@gmail.com>
3 * typemanager.cs (CSharpSignature): One more missing build-in types
5 More tricks for non-mono runtime.
7 2007-06-05 Raja R Harinath <harinath@gmail.com>
9 * statement.cs (Block.CheckError136_InParents): Remove.
10 (Block.AddVariable): Use GetParameterInfo instead.
11 (ToplevelBlock.ProcessArguments): Likewise.
13 2007-06-04 Raja R Harinath <rharinath@novell.com>
15 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
17 (ToplevelBlock.GetParameterInfo): Split out of ...
18 (ToplevelBlock.GetParameterRefernce): ... this.
19 (ToplevelBlock.ParameterMap): Remove.
20 * expression.cs (ParameterReference): Update to use
21 ToplevelParameterInfo.
23 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
26 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
27 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
29 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
30 (ToplevelBlock.ProcessParameters) ... here.
31 (ToplevelBlock..ctor): Invoke it.
33 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
36 * statement.cs (IKnownVariable): New interface.
37 (LocalInfo): Implement it.
38 (ToplevelParameterInfo): New class.
39 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
40 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
43 2007-06-03 Raja R Harinath <harinath@gmail.com>
45 Partly speed up CS0136 error checks.
46 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
48 (Block.DoCheckError136): Only check errors in parameters. Move
49 local variable checks ...
50 (Block.AddVariable): ... here, and ...
51 (ToplevelBlock.ResolveMeta): ... here.
53 2007-06-02 Raja R Harinath <harinath@gmail.com>
55 * statement.cs (Block.IsChildOf): Remove.
57 * statement.cs (Statement.Clone): Move special case code ...
58 (Block.CloneTo): ... here.
60 2007-05-29 Raja R Harinath <rharinath@novell.com>
62 * statement.cs (ToplevelBlock.container): Remove field. It's
63 redundant with 'Parent'.
64 (ToplevelBlock.ContainerBlock): Remove accessor.
65 (ToplevelBlock..ctor): Update to changes. Register anonymous
66 child with parent here, ...
67 * cs-parser.jay (end_anonymous): ... not here. Don't modify
69 (start_anonymous): Don't save current_block.
70 (top_current_block): Remove.
72 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
73 (Block.Resolve): Update to changes.
74 (Block..ctor): Move setting of "correct" 'Toplevel'
75 and 'Explicit' fields to ...
76 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
78 2007-05-27 Raja R Harinath <harinath@gmail.com>
81 * statement.cs (Block.Implicit): Remove.
82 (Block): Update to changes.
83 * flowanalysis.cs: Likewise.
85 Mildly speed up CheckInvariantMeaningInBlock
86 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
87 Recursively call AddKnownVariable to all enclosing blocks.
88 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
89 Remove recursive calls.
90 (Block): Update to changes.
92 New ExplicitBlock invariants
93 * statement.cs (Block.Explicit): New field. It points to the
94 immediately enclosing non-implicit block.
95 (Block..ctor): Maintain the invariant.
96 * cs-parser.jay: Take advantage of invariant.
98 Introduce ExplicitBlock
99 * statement.cs (ExplicitBlock): New.
100 (ToplevelBlock): Derive from it.
101 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
103 (Block.Implicit): Update to changes.
104 * cs-parser.jay: Update to changes.
107 * codegen.cs (EmitContext.IsLastStatement): Remove.
108 * statement.cs (Block.DoEmit): Update to changes.
110 2007-05-25 Raja R Harinath <rharinath@novell.com>
112 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
113 modifying current_block directly.
115 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
117 * class.cs: Implemented automatic properties (C# 3.0)
118 Thanks to Marek for the help.
120 2007-05-23 Raja R Harinath <rharinath@novell.com>
122 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
123 variable as assigned, note also that all its components are
125 (MyBitVector.SetRange): New. Function to set multiple bits to true.
127 2007-05-19 Marek Safar <marek.safar@gmail.com>
129 * anonymous.cs, class.cs: Emit Compiler generated attribute when
130 member is marked as compiler generated.
132 * decl.cs (MemberCore): Refactored ModFlags into property.
134 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
135 (Check): Check only accessibility modifiers.
137 2007-05-18 Raja R Harinath <rharinath@novell.com>
139 Track all assignable slots in one bit array
140 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
141 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
142 logic from VariableMap constructor here. Use the same 'offset'
143 variable that's later used for computing offsets of local
145 * flowanalysis.cs (UsageVector.parameters): Remove.
146 (UsageVector): Update to changes.
147 (VariableMap): Remove.
149 Avoid creating ParameterMap in every block
150 * statement.cs (Block.ParameterMap): Move ...
151 (ToplevelBlock.ParameterMap): ... here.
152 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
154 * flowanalysis.cs (FlowBranching.param_map): Remove.
155 (FlowBranching.UsageVector): Update to changes.
156 (FlowBranchingToplevel.CheckOutParameters): Likewise.
158 * statement.cs (Block.CloneTo): Clone Toplevel field too.
160 * expression.cs (ParameterReference): Distinguish between block
161 where parameter was referenced and declared.
163 2007-05-18 Marek Safar <marek.safar@gmail.com>
165 * flowanalysis.cs, statement.cs: Put back improved error handling.
167 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
171 Imporved object and collection initialization (C# 3.0).
173 2007-05-15 Marek Safar <marek.safar@gmail.com>
176 * expression.cs (Is.DoResolve): Only value types have constant `is'
179 2007-05-15 Raja R Harinath <rharinath@novell.com>
181 * statement.cs (ToplevelBlock.child): Remove.
183 2007-05-15 Raja R Harinath <harinath@gmail.com>
185 Rationalize ResolveMeta: refactoring
186 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
187 out constant handling code into ...
188 (Block.DoResolveConstants): ... this.
190 Rationalize ResolveMeta: kill local_map
191 * statement.cs (Block.local_map, Block.LocalMap): Remove.
192 (Block.AssignableSlots): New.
193 (Block.ResolveMeta): Make protected. Don't create a VariableMap
194 for locals -- move code from VariableMap here. Avoid unnecessary
196 * flowanalysis.cs (FlowBranching.local_map): Remove.
197 (FlowBranching..ctor): Use Block.AssignableSlots.
198 (VariableMap): Remove unused constructors.
200 2007-05-11 Raja R Harinath <rharinath@novell.com>
202 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
204 2007-05-11 Marek Safar <marek.safar@gmail.com>
206 * typemanager.cs (IsFriendAssembly): Should not be called for building
209 2007-05-09 Marek Safar <marek.safar@gmail.com>
211 * literal.cs (NullConstant): Print null in all cases.
213 * expression.cs (Binary.ResolveOperator): Implemented delegate
214 comparison based on C# 2.0 changes.
216 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
218 This code is contributed under the MIT X11 license
220 The following enables support for several C# 3.0 language features:
222 * cs-tokenizer.cs: Added support for the "var" keyword.
224 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
225 Added VarExpr class to facilitate type inferencing.
227 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
228 to support anonymous types.
230 * assign.cs: Added support for type inferencing and initialization.
232 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
234 * expression.cs: Added implicit array support to ArrayCreation.
235 Added 5 types and 1 interface:
237 IInitializable Implementing classes can inject initializing
238 statements after object instantiation.
240 Initializer Stores data for object initialization.
242 AnonymousType An expression for anonymous types.
244 AnonymousTypeParameter Stores data about an anonymous type's field.
246 NewInitialize An expression for object initialization.
248 CollectionInitialize An expression for collection initialization.
250 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
253 2007-05-06 Marek Safar <marek.safar@gmail.com>
256 * cs-tokenizer.cs: Add special handling for coalescing operator.
258 2007-05-06 Marek Safar <marek.safar@gmail.com>
261 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
262 its value from base class until it is redefined.
264 2007-05-02 Raja R Harinath <rharinath@novell.com>
266 Fix regression in cs0631-3.cs
267 * cs-parser.jay (operator_declarator): Add opt_attributes to error
268 fallback. Make error fallback catch more cases.
270 2007-05-01 Miguel de Icaza <miguel@novell.com>
272 * cs-parser.jay: Allow parameters in operator declarations to have
275 2007-04-27 Miguel de Icaza <miguel@novell.com>
277 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
280 * lambda.cs (ContextualReturn.Resolve): An expression is valid
281 inside the ContextualReturn, it does not have to be an
284 2007-04-24 Miguel de Icaza <miguel@novell.com>
286 * lambda.cs (ContextualReturn.Resolve): if the return type is not
289 2007-04-23 Miguel de Icaza <miguel@novell.com>
291 * anonymous.cs (AnonymousContainer): split the virtual Resolve
292 method in two methods: ResolveNoDefine and Resolve.
294 ResolveNoDefine will stop just after ResolveTopBlock has been
297 Resolve will then continue by creating a method and issuing the
298 call to method.Define ().
300 (AnonymousMethod): Split and implement the new Resolve and
301 ResolveNoDefine as well.
303 * lambda.cs (LambdaExpression): Split the anonymous method
304 resolution code into a separate routine (CoreCompatibilityTest)
305 from DoCompatibleTest.
307 (LambdaExpression.TryBuild): New method, this method tries to
308 build the LambdaExpression with the given set of types to be used
309 as the types for the various parameters of the lambda expression.
311 If the compilation succeed with the given types, the infered type
312 of the Anonymous method is returned, otherwise null is returned.
314 2007-04-23 Marek Safar <marek.safar@gmail.com>
317 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
319 2007-04-22 Miguel de Icaza <miguel@novell.com>
321 * cs-tokenizer.cs: Change various identifiers here from the
322 camelCasing to the recommended Linux-like style for instance
323 variables from the Coding Guidelines.
325 2007-04-19 Martin Baulig <martin@ximian.com>
328 (Convert.ImplicitReferenceConversionCore): Allow conversions from
329 System.Enum to System.ValueType.
331 2007-04-13 Martin Baulig <martin@ximian.com>
333 Rewrote implicit reference conversions. We need to distinguish
334 between implicit reference conversions (13.1.4) and implicit
335 boxing conversions (13.1.5).
337 According to the spec, there's an an implicit conversion
338 "From a one-dimensional array-type S[] to IList<T> and base
339 interfaces of this interface, provided there is an implicit
340 reference conversion from S to T." Note that this does not
341 include boxing conversions.
344 (Convert.ImplicitTypeParameterBoxingConversion): New method.
345 (Convert.ImplicitReferenceConversion): Split into
346 ImplicitReferenceConversionCore() and
347 ImplicitBoxingConversionExist().
348 (Convert.ImplicitReferenceConversionExists): Use the new
349 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
351 2007-04-12 Martin Baulig <martin@ximian.com>
353 * convert.cs (Convert.ImplicitReferenceConversion): Move the
354 `TypeManager.null_type' checks up to the top of the method.
356 2007-04-11 Marek Safar <marek.safar@gmail.com>
359 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
362 2007-04-11 Martin Baulig <martin@ximian.com>
364 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
365 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
366 to make this work for generic classes; fixes #79561.
368 2007-04-11 Martin Baulig <martin@ximian.com>
370 * expression.cs (As): Add support for nullable types; fixes #79371.
372 2007-04-11 Martin Baulig <martin@ximian.com>
374 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
375 `type.FullName' is null; fixes #80243.
377 2007-04-11 Martin Baulig <martin@ximian.com>
379 * expression.cs (Invocation.IsApplicable): Don't modify the method
380 if type inference succeeded, but the method was not applicable.
383 2007-04-10 Marek Safar <marek.safar@gmail.com>
386 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
387 internal and external namespaces containers.
389 2007-04-10 Martin Baulig <martin@ximian.com>
391 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
392 TypeManager.DropGenericMethodArguments() so we also call
393 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
395 2007-04-10 Martin Baulig <martin@ximian.com>
397 * iterators.cs (Iterator.CreateIterator): Don't crash if
398 `method.ReturnType' is null. This happens if something went wrong
399 while resolving that typ (we already reported an error in this case).
401 2007-04-10 Martin Baulig <martin@ximian.com>
403 * expression.cs (New.DoResolve): Don't call CheckComImport() on
404 generic interfaces; report the CS0144 directly.
406 2007-04-10 Martin Baulig <martin@ximian.com>
408 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
409 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
411 2007-04-10 Martin Baulig <martin@ximian.com>
413 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
415 2007-04-09 Raja R Harinath <rharinath@novell.com>
418 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
419 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
422 * statement.cs (For.Resolve): If resolution fails, use
425 2007-04-08 Marek Safar <marek.safar@gmail.com>
427 * anonymous.cs (MakeName): Make faster and zero-based.
428 (VerifyExplicitParameterCompatibility): Back to mode where generic
429 parameter is ignored.
430 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
432 * class.cs (EmitType): Method can emit another new method.
434 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
436 * driver.cs: Updated.
438 * lambda.cs: Reuse predefined empty parameters.
440 * parameter.cs: Updated
442 * support.cs: Implemented InflateTypes.
444 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
445 (InitSystemCore): Introduced to isolate 3.0 dependencies.
447 2007-04-03 Martin Baulig <martin@ximian.com>
451 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
452 version of TypeManager.IsOverride() which also works with generic
455 2007-04-03 Martin Baulig <martin@ximian.com>
460 (Convert.ExplicitReferenceConversion): We need to cast when
461 converting from IList<T> to S[].
463 2007-04-01 Marek Safar <marek.safar@gmail.com>
465 * decl.cs (FindExtensionMethods): Consider all candidates with same name
468 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
470 2007-03-31 Marek Safar <marek.safar@gmail.com>
472 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
473 argument and return type inferring.
475 * codegen.cs (InferReturnType): Flag whether return can be inferred.
476 (ReturnType): Turned to property.
478 * statement.cs (Return): Implemented return type inferring.
480 * support.cs (ReflectionParameters): Use local types if possible.
482 2007-03-30 Raja R Harinath <rharinath@novell.com>
484 * flowanalysis.cs (FlowBranching.Reachability): Remove.
485 (FlowBranching.UsageVector): Update to changes.
487 Prepare to kill 'Reachability'
488 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
489 argument of constructor.
491 2007-03-29 Raja R Harinath <rharinath@novell.com>
493 Prepare to kill 'Reachability'
494 * flowanalysis.cs (UsageVector.is_unreachable): New.
495 (UsageVector): Update to maintain 'is_unreachable' in parallel to
496 'reachability', and verify they're consistent.
499 * expression.cs (New.EmitStatement): Handle type parameters here too.
501 2007-03-29 Martin Baulig <martin@ximian.com>
506 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
507 CompilerGeneratedClass.
508 (ScopeInfo.EmitScopeInstance): Make this protected.
509 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
510 `ec.CurrentAnonymousMethod.Scope == Scope'.
512 * statement.cs (Block.ScopeInfo): Make this a property.
514 2007-03-27 Raja R Harinath <harinath@gmail.com>
516 Prepare to kill 'Reachability'
517 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
518 (FlowBranching.UsageVector.Reachability): Remove property.
519 (FlowBranching.UsageVector.IsUnreachable): New property.
520 (FlowBranching.UsageVector.ResetBarrier): New.
521 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
522 * codegen.cs, statement.cs: Update to changes.
524 2007-03-27 Martin Baulig <martin@ximian.com>
529 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
532 2007-03-26 Raja R Harinath <rharinath@novell.com>
534 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
535 instead of TriState. Remove all mention of TriState.
537 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
538 replaced by a boolean. Add boolean 'is_unreachable' field, check
539 and maintain invariants.
541 2007-03-25 Marek Safar <marek.safar@gmail.com>
543 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
545 2007-03-25 Marek Safar <marek.safar@gmail.com>
547 * expression.cs: Stop using obsolete 2.0 opcodes.
549 2007-03-25 Marek Safar <marek.safar@gmail.com>
551 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
552 one of the latests Martin's fixes.
554 2007-03-23 Miguel de Icaza <miguel@novell.com>
556 * expression.cs: On BigEndian systems, swap the bytes, temporary
557 solution until we get a new bitconverter class.
559 2007-03-23 Martin Baulig <martin@ximian.com>
563 * decl.cs (MemberCache.AddMembers): Add generic methods both as
564 "Method" and "Method`1". Normally, a cache lookup is done on the
565 "Method" form (ie. without the generic arity), but this one makes
566 lookups on the full form work as well.
568 2007-03-22 Raja R Harinath <rharinath@novell.com>
570 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
573 2007-03-20 Bill Holmes <billholmes54@gmail.com>
575 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
576 ordered_member_list, to TypeBuilder to store members to be defined
577 in the order they were parsed in.
578 - ordered_explicit_member_list contains all properties indexers
579 and methods that are defined as explicit implementation of an
580 interface or base class.
581 - ordered_member_list contains all properties indexers and methods
582 that are not defined as explicit implementation of an interface
585 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
586 functionality in these removed classes has been replaced with
587 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
588 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
590 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
591 to CheckForDuplications inside GetMethod and SetMethod Define Method
592 to handle method property and indexer name conflicts.
596 All code is contributed under the MIT/X11 license.
598 2007-03-20 Martin Baulig <martin@ximian.com>
600 * class.cs (TypeContainer.Interfaces): Removed; they're now
601 included in `TypeContainer.Types'.
603 2007-03-20 Martin Baulig <martin@ximian.com>
605 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
607 * class.cs (TypeContainer.CreateType): New public method. This is
608 now called before DefineType() to create the TypeBuilders.
609 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
610 has already been created by CreateType().
611 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
612 don't resolve our base classes here; this has been moved into
613 DefineBaseTypes(). We're now called from CreateType().
614 (TypeContainer.DefineBaseTypes): New private method; resolve our
615 base classes here. We're now called from DefineType().
618 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
619 our types first to create all the TypeBuilders. After that, call
620 TypeContainer.DefineType() on all the types which'll resolve their
621 base classes and setup the resolve order.
623 2007-03-20 Martin Baulig <martin@ximian.com>
625 * class.cs (TypeContainer.Enums): Removed; they're now included in
626 `TypeContainer.Types'.
628 2007-03-20 Martin Baulig <martin@ximian.com>
631 (TypeContainer.DefineType): Don't call ResolveMembers() here.
632 (TypeContainer.DoResolveMembers): Call DefineType() on our
633 `compiler_generated' classes; moved here from DefineNestedTypes().
636 (RootContext.ResolveTree): Call ResolveMembers() on all
637 TypeContainer's in the `type_container_resolve_order'.
639 2007-03-19 Marek Safar <marek.safar@gmail.com>
641 * class.cs: Use corlib to handle InternalMethodImplAttribute.
643 2007-03-17 Marek Safar <marek.safar@gmail.com>
645 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
646 implementation flags.
648 2007-03-17 Marek Safar <marek.safar@gmail.com>
650 * class.cs: More optimizations for type parameters.
652 2007-03-15 Marek Safar <marek.safar@gmail.com>
654 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
656 * ecore.cs, parameter.cs: More common code for both corlibs.
658 * typemanager.cs (IsGenericMethod): Simplified.
660 2007-03-15 Raja R Harinath <rharinath@novell.com>
662 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
664 * statement.cs, iterators.cs, lambda.cs: Update to changes.
666 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
667 unconditionally. Simplify explanation.
668 (Try.Resolve, Using.Resolve): Likewise.
670 2007-03-15 Martin Baulig <martin@ximian.com>
674 * decl.cs (DeclSpace): If we're a partial class, use our
675 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
677 2007-03-15 Raja R Harinath <rharinath@novell.com>
679 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
681 (FlowBranching.UsageVector): Update to changes.
682 (FlowBranching.MergeSiblings): Likewise.
683 * statement.cs: Likewise.
685 2007-03-15 Martin Baulig <martin@ximian.com>
690 (MemberCache): Added a special .ctor for type parameters.
693 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
696 2007-03-09 Martin Baulig <martin@ximian.com>
698 * enum.cs (Enum): Make this a TypeContainer.
699 (EnumMember): Derive from `Const'.
702 (Const.DoResolveValue): New protected virtual method; move most of
703 the functionality of ResolveValue() here so we can override it in
705 (Const.CreateConstantReference): Make this virtual.
707 * class.cs (Kind): Add `Kind.Enum'.
708 (TypeContainer.Emit): Don't emit the enums here; they're already
709 in the `RootContext.typecontainer_resolve_order'.
711 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
712 here; they're already in the `typecontainer_resolve_order'.
714 * ecore.cs (EnumConstant.ConvertImplicitly): Add
715 TypeManager.DropGenericTypeArguments().
718 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
719 (TypeManager.IsEnumType): Likewise.
720 (TypeManager.EnumToUnderlying): Likewise.
721 (TypeManager.IsEqual): Add support for enums.
723 2007-03-12 Raja R Harinath <rharinath@novell.com>
725 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
726 DefaultParameterValueAttribute to be undefined, say if System.dll
729 2007-03-11 Marek Safar <marek.safar@gmail.com>
731 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
734 2007-03-10 Marek Safar <marek.safar@gmail.com>
736 * class.cs, parameter.cs: Unified parameters verification.
738 2007-03-08 Martin Baulig <martin@ximian.com>
740 * cs-parser.jay (constructor_header): Pass the location to the
741 newly created TopLevelBlock.
743 2007-03-07 Martin Baulig <martin@ximian.com>
745 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
747 2007-03-06 Miguel de Icaza <miguel@novell.com>
749 * convert.cs (ExplicitReferenceConversionExists): Sync this method
750 with the changes from David, fixes the build.
752 2007-03-05 David Mitchell <dmitchell@logos.com>
754 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
755 and its base interfaces to a one-dimensional array type S[],
756 provided there is an implicit or explicit reference conversion
759 2007-03-03 Marek Safar <marek.safar@gmail.com>
761 * cs-tokenizer.cs: Implemented basic linq grammar.
763 * driver.cs: Set linq lang version on demand.
765 2007-02-26 Marek Safar <marek.safar@gmail.com>
767 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
769 2007-02-25 Marek Safar <marek.safar@gmail.com>
771 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
774 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
776 Check property and event extern attributes.
778 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
781 2007-02-24 Marek Safar <marek.safar@gmail.com>
784 * ecore.cs: Don't report ambiguity error when methods have same parent.
786 2007-02-23 Marek Safar <marek.safar@gmail.com>
789 * class.cs, cs-parser.jay: Event property can host anonymous methods.
791 2007-02-22 Marek Safar <marek.safar@gmail.com>
793 * attribute.cs: Enable ExtensionAttribute presence test.
795 2007-02-22 Marek Safar <marek.safar@gmail.com>
797 * class.cs: Warn about missing GetHashCode only when Equals is override.
799 * decl.cs: Check accessibility of type arguments.
801 * typemanager.cs: Correctly report nullable array.
803 2007-02-20 Marek Safar <marek.safar@gmail.com>
805 * class.cs, report.cs: Capture more details when things go wrong.
807 2007-02-20 Marek Safar <marek.safar@gmail.com>
810 * cs-parser.jay: Anonymous container starts at constructor declaration
811 and not at block beginning because it has to be usable in constructor
814 * statement.cs: Use context location and not block one for error reporting.
816 2007-02-18 Marek Safar <marek.safar@gmail.com>
819 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
822 2007-02-18 Marek Safar <marek.safar@gmail.com>
824 A fix for bug #80493 by Atsushi Enomoto
825 * cs-parser.jay: Ignore invalid attribute target.
827 2007-02-18 Marek Safar <marek.safar@gmail.com>
829 * cs-tokenizer.cs: Ignore '\0' as white space character.
831 2007-02-17 Miguel de Icaza <miguel@novell.com>
833 * cs-parser.jay: Add support for lambda expressions to the mcs
836 * lambda.cs: Only clone when we are probing, not on the final call
837 (Compatible is the final call).
839 * statement.cs (CloneContext): Introduce class to provide block
840 remapping during clone.
842 All statements Clone themselves now.
844 (Clone): special handling for blocks, when we clone a block, we
845 register the block inside this routine, as children of the block
846 might trigger a lookup.
848 * expression.cs: Add support for CloneContext in all expressions.
850 2007-02-17 Marek Safar <marek.safar@gmail.com>
853 * statement.cs: Report ambiguous warning when interfaces are not related.
855 2007-02-15 Marek Safar <marek.safar@gmail.com>
857 C# 3.0 extension methods.
859 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
860 cannot be used directly.
862 * class.cs (Class.Emit): Emit extension attribute if any class method
864 (Method.Define): Add basic extension method validation conditions.
865 (Method.Emit): Emit extension attribute for method.
867 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
868 extension method exists. Currently we follow same approach as Microsoft
869 does, emit even if a method or a class are private but this can change
872 * cs-parser.jay: Add handling of `this' keyword in method parameters
875 * decl.cs (DeclSpace.IsStaticClass): New property.
876 (MemberCache.FindExtensionMethods): Looks for extension methods with
877 defined name and extension type.
879 * doc.cs: Updated after OverloadResolve changes.
881 * driver.cs: Add new soft reference to System.Core.dll.
883 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
884 (ExtensionMethodGroupExpr): Represents group of extension methods.
886 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
887 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
888 to MethodGroupExpr and made non-static for easier customization.
889 (Invocation.DoResolve): Add extension method lookup when no standard
891 (MemberAccess.DoResolve): Try extension methods if no member exists.
893 * modifiers.cs: Add METHOD_EXTENSION modifier.
895 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
896 as well as candidate extension type.
897 (ComputeNamespaces): When assembly constains extension methods registers
899 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
900 extension method lookup.
901 (Namespace.LookupExtensionMethod): Looks for extension method in this
903 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
904 find a method which matches name and extensionType.
906 * parameter.cs (Parameter): Add This modifer.
907 (HasExtensionMethodModifier): New property.
908 (Resolve): Add extension parameter check.
909 (ModFlags): turned to property to exclude this modifier as it is not real
911 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
913 * support.cs (ParameterData): Add ExtensionMethodType.
914 (ReflectionParameters): Implemented ExtensionMethodType interface property.
916 * typemanager.cs: Add type and ctor extension attribute type.
918 2007-02-15 Miguel de Icaza <miguel@novell.com>
920 * report.cs (DisableErrors, EnableErrors): used to prevent error
921 output when we are "trying" to compile various methods with
924 * ecore.cs (Expression): Add Clone method that calls the virtual
925 CloneTo method. The current CloneTo method in Expression throws
926 an exception so we can track down all the places where this must
927 be implemented (not using abstract, because that would be a lot of
928 up-front-work before we can start testing the implementation
931 Important: we only need Clone capabilities for expressions created
932 by the parser, as the expressions we will be cloning are
933 expressions in the pre-resolved state. This vastly simplifies
936 (SimpleName): Add CloneTo that does nothing.
937 (EmptyCast): Add CloneTo.
939 * expression.cs (Binary): Implement CloneTo.
940 (Invocation.IsApplicable): Store the current ec in
941 EmitContext.TempEc and restore it on return. This is used so we
942 do not have to sprinkle hundres of methods with an extra
943 EmitContext, we know that the only user is the lambda expression
944 ImplicitConversionExists code.
946 (Argument): Add Cloning capabilities.
947 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
948 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
949 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
950 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
951 IndexerAccess): Add Clone capability.
953 (LocalVariableReference, This): TODO: needs cloned Block mapping.
955 (Argument): Add cloning capability.
957 * assign.cs (Assign): Implement CloneTo.
959 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
961 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
962 version by calling Convert with the EmitContext (that we are
963 currently storing in ec, this is not great, but will do for now,
964 to avoid passing EmitContext parameters to hundreds of functions
965 that do not need them now).
967 (SetExpression): Remove, it is not needed.
969 (ContextualReturn): Implement CloneTo.
971 * statement.cs (Statement): Implement cloning infrastructure,
972 similar to expressions.
974 (Block): Partial implementation of Clone for statements.
976 (Return): Implement clone.
978 * constant.cs (Constant.CloneTo): New method, does nothing.
980 * codegen.cs (TempEc): Add a static EmitContext as a temporary
981 solution, until we decide how to exactly do this.
983 2007-02-14 Marek Safar <marek.safar@gmail.com>
986 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
987 a property is override we need to use second accessor.
989 2007-02-13 Marek Safar <marek.safar@gmail.com>
992 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
995 2007-02-13 Marek Safar <marek.safar@gmail.com>
997 Another fix for bug #80749
998 * pending.cs: Abstract class has priority over interfaces.
1000 2007-02-13 Marek Safar <marek.safar@gmail.com>
1002 Another fix for bug #80749
1003 * pending.cs: Abstract class has priority over interfaces.
1005 2007-02-13 Marek Safar <marek.safar@gmail.com>
1007 Another fix for bug #80749
1008 * pending.cs: Abstract class has priority over interfaces.
1010 2007-02-13 Marek Safar <marek.safar@gmail.com>
1012 Another fix for bug #80749
1013 * pending.cs: Abstract class has priority over interfaces.
1015 2007-02-13 Marek Safar <marek.safar@gmail.com>
1017 * class.cs Better error message.
1019 * driver.cs: Add shorter versions of -optimize option.
1021 2007-02-13 Martin Baulig <martin@ximian.com>
1023 * class.cs (Constructor.Emit): Check the return value of
1024 ec.ResolveTopBlock() and return on error.
1026 2007-02-13 Raja R Harinath <rharinath@novell.com>
1028 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1029 message to fix error message regression.
1031 2007-02-12 Marek Safar <marek.safar@gmail.com>
1033 * delegate.cs: Delegate creation expression cannot be of Nullable type.
1035 2007-02-12 Marek Safar <marek.safar@gmail.com>
1037 A fix for bug #80749
1038 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1039 its parent container.
1041 * class.cs (DefineFieldInitializers): Each initializer can has different
1044 * const.cs: Updated.
1046 2007-02-11 Miguel de Icaza <miguel@novell.com>
1048 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1049 now all the heavy lifting to check that embedded statements or
1050 expressions have the right form is done in the ContextualReturn.
1052 (ContextualReturn): New class.
1054 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1055 method that can be invoked to report 201, so we do not replicate
1058 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1060 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1061 treating tabs as spaces.
1063 2007-02-09 Marek Safar <marek.safar@gmail.com>
1065 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1066 * assign.cs: Use full implicit conversion for right side check.
1068 2007-02-09 Marek Safar <marek.safar@gmail.com>
1070 * statement.cs (Switch): Switch over boolean type is not standardized.
1072 2007-02-08 Marek Safar <marek.safar@gmail.com>
1074 A fix for bug #80755
1075 * decl.cs (FindBaseEvent): Don't use method cache for events.
1077 2007-02-07 Marek Safar <marek.safar@gmail.com>
1079 * cs-parser.jay: Better syntax error handling.
1081 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1082 instead of underlying type value.
1084 2007-02-06 Marek Safar <marek.safar@gmail.com>
1086 * driver.cs: Check define identifier before is registered.
1088 * namespace.cs: Use existing error message.
1090 * report.cs: New warning.
1092 2007-02-06 Marek Safar <marek.safar@gmail.com>
1094 A fix for bug #80742
1095 * expression.cs: Delegate Invoke method can be called directly.
1097 2007-02-06 Marek Safar <marek.safar@gmail.com>
1099 A fix for bug #80676
1100 * class.cs (IsEntryPoint): The Main method can have params modifier.
1102 2007-02-04 Miguel de Icaza <miguel@novell.com>
1104 * parameter.cs (Parameter, Parameters): Add Clone method.
1106 * anonymous.cs (Compatible): Turn method into virtual method, so
1107 LambdaExpression can implement a different behavior.
1109 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1110 out the basic checking here, so it can be used by
1113 * lambda.cs: Introduce "Compatible" function that will do the
1116 2007-02-02 Marek Safar <marek.safar@gmail.com>
1118 * attribute.cs: Unified one error message.
1120 * class.cs (Class): Use type attributes and not properties to test static
1122 (IsEntryPoint): Don's pass local variable.
1124 * convert.cs: Removed duplicate check.
1126 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1128 * driver.cs: Don't crash when soft reference does not exist.
1130 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1131 (UsingEntry): Removed redundant allocation.
1133 * parameter.cs: Add fast path for type parameters.
1135 * support.cs: Don't allocate attribute when it's not used.
1137 2007-01-30 Miguel de Icaza <miguel@novell.com>
1140 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1141 this into a virtual method, so we can override it in LambdaExpression.
1143 * driver.cs: Improve diagnostics in case of failure.
1145 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1146 write a function that is slightly more complex and that parses:
1148 type identifier [, type identifier]* )
1150 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1153 (canEmpty ? i >= 0 : i > 0)
1155 2007-01-30 Raja R Harinath <rharinath@novell.com>
1157 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1158 exception on possibly valid code.
1160 2007-01-29 Raja R Harinath <rharinath@novell.com>
1162 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1164 (parse_opt_type_arguments): Remove. It's almost the same as
1166 (parse_namespace_or_typename): Use parse_less_than.
1168 2007-01-28 Miguel de Icaza <miguel@novell.com>
1170 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1171 this bug took a few hours to find, because the state saved and
1172 restored by PushPosition and PopPosition was ignoring the state of
1173 parse_generic_less_than.
1175 I can also now remove the handling of OP_LT and OP_GT, this solves
1178 * cs-tokenizer.cs: store the location for the ARROW token, we use
1181 (PushPosition, PopPosition): save/restore also `current_token',
1182 restore `parse_generic_less_than' (was missing).
1184 (parse_opt_type_arguments): use parse_type, not
1185 parse_namespace_or_typename to parse types.
1187 * lambda.cs: Empty new file, will eventually have the lambda
1188 expression implementation.
1190 * lambda.test: used to test the internal tokenizer.
1192 * report.cs (FeatureIsNotISO1): Rename from
1193 FeatureIsNotStandardized, because it was about the language level
1194 (1 vs 2) it was not about standarization.
1196 (FeatureRequiresLINQ): New.
1198 * support.cs (SeekableStreamReader): Only require that the reader
1199 is a TextReader, not a StreamReader, so we can plug StringReader.
1201 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1202 given position in the input stream the following tokens can be
1203 parsed as a type followed by an identifier.
1205 (is_punct): after a '(' if parse_type_and_parameter returns true,
1206 then return a special token OPEN_PARENS_LAMBDA which is used to
1207 avoid reduce/reduce errors in the grammar for the
1208 lambda_expression rules.
1210 (parse_type): implement a type parser inside the
1211 tokenizer, the parser only returns true or false depending on
1212 whether the input at a given position can be parsed as a type.
1214 (peek_token): new method used during type parsing.
1216 2007-01-28 Raja R Harinath <rharinath@novell.com>
1219 * anonymous.cs (ScopeInfo.InflateParameters): New.
1220 (AnonymousContainer.Resolve): Use it to redirect types of
1221 delegate parameters.
1223 2007-01-27 Raja R Harinath <rharinath@novell.com>
1226 * expression.cs (Error_InvalidArguments): Don't use two different
1227 messages for CS1503. Use ExtraInformation and
1228 SymbolRelatedToPreviousError instead.
1231 * decl.cs (DeclSpace.initialize_type_params): Don't access
1232 'type_params' of a partial class directly.
1234 2007-01-26 Miguel de Icaza <miguel@novell.com>
1236 * constant.cs: Removed a handful of out-of-range checks that were
1239 2007-01-25 Marek Safar <marek.safar@gmail.com>
1241 * expression.cs (CheckUselessComparison): Add additional check for char
1244 * namespace.cs: Fixed typo.
1246 2007-01-23 Miguel de Icaza <miguel@novell.com>
1248 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1249 gone, instead we inline the test, preventing the needless casts to
1250 longs, ulongs and doubles for the parameters, avoiding calls to
1251 methods that overchecked stuff, and instead inlined things
1254 2007-01-20 Marek Safar <marek.safar@gmail.com>
1256 * cs-parser.jay: Better parameter error handling.
1258 2007-01-17 Marek Safar <marek.safar@gmail.com>
1260 A fix for bug #80368, #80522
1261 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1262 whether array initializer contains constants only.
1263 (ArrayCreation.Emit): Use better formula to decide when
1264 are array initializers for static initialization.
1265 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1266 have to emit even constants otherwise they are pre-initialized.
1268 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
1269 Raja R Harinath <rharinath@novell.com>
1271 Fix emit order of 'get' vs. 'set'.
1272 * support.cs (Accessors): New.
1273 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1274 Note the order in which accessors are declared in the source.
1275 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1276 Refactored from Property.Define and Indexer.Define.
1277 (PropertyBase.DefineAccessors): New helper that calls the above in
1278 appropriate order as noted by the parser.
1279 (Property.Define, Indexer.Define): Update to changes.
1280 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1282 2007-01-17 Raja R Harinath <rharinath@novell.com>
1284 Fix cs0029-6.cs and gcs0029-2.cs (regression)
1285 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1286 there's an implicit conversion from the current type to the target
1287 type before converting the underlying constant.
1289 2007-01-16 Marek Safar <marek.safar@gmail.com>
1291 * const.cs (ResolveValue): Updated after constant conversion was made more
1294 * constant.cs (GetAttributableValue): constant to object conversion is
1295 used for attributes only.
1296 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1297 constant conversions.
1298 (LongConstant.ConvertImplicitly): Ditto.
1300 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1301 (ImplicitConversionStandard): Handle constant conversion as extra step.
1302 It solves the issue when constant conversion was called indirectly like
1303 inside array initializer and constant folding was skipped.
1305 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1308 * statement.cs(ImplicitConversionStandard): Updated after constant
1309 conversion was made more generic.
1311 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
1313 * expression.cs (As.DoResolve): Use GenericConstraints instead of
1314 Constraints, solves the problem where the compiler incorrectly
1315 reported that a type parameter was not constrained to a class (Bug
1318 2007-01-14 Marek Habersack <grendello@gmail.com>
1320 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1322 2007-01-14 Marek Safar <marek.safar@gmail.com>
1324 A fix for bug #80368
1325 * assign.cs (FieldInitializer): New class implements field
1326 initializer statement.
1328 * attribute.cs: Update after FieldMember rename.
1330 * class.cs (PropertyBasedMember): New common class for property based
1332 (InterfaceMemberBase): New base class for all members which can be used as
1333 an interface members.
1334 (MethodCore): Moved really common code to InterfaceMemberBase.
1335 (Method.Define): Equal and GetHasCode detection is relevant for methods
1337 (MethodData.Define): Don't assume that public event implements an
1338 interface automatically.
1339 (MethodData.DefineMethodBuilder): Issue an error even if only extern
1341 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1342 (FieldMember): Merged with FieldBase.
1343 (EventProperty.AEventPropertyAccessor): New specialization to check whether
1344 event extern modifier can be used.
1345 (EventField.EventFieldAccessor): Moved event field specific code here.
1346 (Event.AllowedModifiers): Even event can be extern.
1347 (Event.FindOutBaseMethod): New override specific to events.
1348 (Indexer.parameters): Reintroduce parameters because base class holds
1349 only properties common data.
1350 (Indexer.CheckForDuplications): Indexers are threated as methods so we
1351 need do extra parameters check.
1353 * const.cs: Update after FieldMember rename.
1355 * decl.cs (MemberCache.FindBaseEvent): New method.
1357 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1358 to reflect that indexer is now derived from PropertyBased.
1360 * ecore.cs (GetMemberType): Made public.
1361 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1364 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1366 * typemanager.cs (CSharpSignature): Correctly print event accessors.
1367 (RegisterEvent): Removed.
1368 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1369 (GetPrivateFieldOfEvent): Renamed to GetEventField.
1371 2007-01-11 Raja R Harinath <rharinath@novell.com>
1374 * statement.cs (CollectionForeach.TryType): Prefer generic
1375 GetEnumerator over non-generic variant. Fix code to follow comments.
1377 2007-01-09 Raja R Harinath <rharinath@novell.com>
1380 * support.cs (ReflectionParameter): Don't use an invalid index on
1381 the generic parameter data.
1383 2007-01-08 Miguel de Icaza <miguel@novell.com>
1385 * driver.cs: Just add a tiny bit of infrastructure.
1387 2007-01-02 Marek Safar <marek.safar@gmail.com>
1389 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1390 where field type is struct from current assembly.
1392 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1395 2007-01-02 Marek Safar <marek.safar@gmail.com>
1397 A fix for bug #80381
1398 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1401 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1403 (Namespace.LookupType): Always use core types from corlib when speficied.
1405 * report.cs: A new warning.
1407 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1408 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1409 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1411 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1412 (InitCoreTypes): Set expression type of object_type and value_type
1413 immediately after lookup.
1415 2007-01-01 Miguel de Icaza <miguel@novell.com>
1417 * cs-tokenizer.cs: Accept Pc class characters (Connector
1418 Punctuation) as valid identifiers. Fixes #78259
1420 * expression.cs (Invocation.DoResolve): Moved the check for the
1421 use of `this' for doing method calls to the Invocation resolution
1422 step, after overload resolution has taken place instead of doing
1423 the check at the low-level `This.DoResolve' level.
1425 The `This.DoResolve'(appens before overload resolution, so it has
1426 no way of knowing if the method that will be called will be
1427 instace or static, triggering an erroneous report for cs0188 (Bug
1430 We now do the check for instance method invocations after we know
1431 what method will be called.
1433 (This.CheckThisUsage): Move the actual use of this structure
1434 checking into its own method and expose it.
1436 * Everywhere that called Error_ValueCannotBeConverted: pass a new
1439 Exceptions: Null.ConvertImplicitly,
1440 Constant.ImplicitConversionRequired as there are too many call
1441 sites for passing the ec.
1443 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1444 EmitContext, if the value is null, then we do not try to provide
1445 the extra information from the error (If a userdefined conversion
1446 exists, as UserDefinedConversion requires a non null-EmitContext).
1450 2006-12-30 Raja R Harinath <rharinath@novell.com>
1452 * flowanalysis.cs (MyBitVector): Document some invariants.
1453 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1454 introduced below, and add a couple of others,
1456 2006-12-30 Marek Safar <marek.safar@gmail.com>
1458 * attribute.cs (GetMethodObsoleteAttribute): Uses new
1459 GetPropertyFromAccessor and GetEventFromAccessor.
1461 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1462 overrides non-obsolete one.
1463 (Indexer.Define): Error message has been moved to the parser.
1465 * cs-parser.jay: Better syntax errors handling.
1467 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1468 when an invocation has no arguments.
1470 * ecore.cs: Removed not used caching.
1472 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1475 * report.cs: Add a new warning.
1477 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1479 * typemanager.cs (enumeration_type): Removed.
1480 (CSharpSignature): Reuses IsSpecialMethod.
1481 (IsEqual): Hack for MS BCL.
1482 (GetPropertyFromAccessor): New method.
1483 (GetEventFromAccessor): New method.
1484 (IsSpecialMethod): Fixed to handle more cases.
1486 2006-12-30 Marek Safar <marek.safar@gmail.com>
1488 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1489 Made white spaces array static.
1491 * ecore.cs (RemoveGenericArity): Optimized.
1493 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1495 (MyBitVector.initialize_vector): Simplified.
1497 2006-12-22 Miguel de Icaza <miguel@novell.com>
1499 * ecore.cs: Am not entirely happy with this hack, but it seems to
1500 address the issue in 80257 (a small test case for
1503 I set the MethodGroupExpr.Type to an internal compiler type
1504 (itself in this case) to force the resolution to take place. Why
1505 it does not take place with a null is beyond me.
1507 2006-12-20 Marek Safar <marek.safar@gmail.com>
1509 A fix for bug #80288
1510 * expression.cs (ResolveOperator): Consider user defined conversion for
1511 logical and operator too.
1512 (EmitBranchable): Optimization for logical and when full constant folding
1513 could not be applied but one operand is constant.
1515 2006-12-19 Marek Safar <marek.safar@gmail.com>
1517 * class.cs (GetClassBases): Write 5 times every day, will never use
1518 FullName for error reporting.
1520 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1522 2006-12-19 Martin Baulig <martin@ximian.com>
1524 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1525 the symbol file info here.
1527 2006-12-18 Marek Safar <marek.safar@gmail.com>
1529 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1530 of `elseif' is taking then following sections are not taking.
1531 Fixes an issue reported on mono mailing list.
1533 2006-12-18 Marek Safar <marek.safar@gmail.com>
1535 A fix for bug #80300
1536 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1537 a caller is not taking.
1539 2006-12-18 Raja R Harinath <rharinath@novell.com>
1541 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1542 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1543 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1544 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1545 * class.cs: Update to changes.
1547 2006-12-17 Marek Safar <marek.safar@gmail.com>
1549 A fix for bug #79934
1550 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1553 * class.cs (ResolveMembers): Register an iterator in current container and
1556 2006-12-16 Raja R Harinath <rharinath@novell.com>
1559 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1560 satisfy a params annotated parameter.
1562 2006-12-16 Marek Safar <marek.safar@gmail.com>
1564 A fix for bug #77014
1565 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1566 paramters correctly and not rely on hacks in Parameters class.
1567 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1569 (Invocation.VerifyArgumentsCompat): Ditto.
1570 (Invocation.EmitArguments): Changed to correctly emit params arguments at
1573 * parameter.cs (HasParams): Don't assume that params is the last one.
1575 * support.cs (ReflectionParameters.ctor): Look for params attribute
1577 (ReflectionParameters.ParameterType): Removed hack when we returned last
1578 parameter for out of range parameters.
1579 (ParameterName, ParameterModifier): Ditto.
1581 2006-12-14 Marek Safar <marek.safar@gmail.com>
1583 A fix for bug #79987
1584 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1585 when assembly is not CLS compliant but type is. I have no idea why is this
1588 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1590 2006-12-13 Miguel de Icaza <miguel@novell.com>
1592 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1593 in struct constructors, they are basically no-ops.
1595 2006-12-12 Marek Safar <marek.safar@gmail.com>
1597 * cs-tokenizer.cs (Position): Save preprocessor status too.
1599 2006-12-12 Marek Safar <marek.safar@gmail.com>
1601 A fix for bug #77794
1602 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1604 2006-12-12 Marek Safar <marek.safar@gmail.com>
1606 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1608 (pp_expr): Report error for an invalid expression.
1609 (handle_preprocessing_directive): Simplified; add more error checking.
1611 2006-12-11 Marek Safar <marek.safar@gmail.com>
1613 A fix for bug #74939
1614 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1615 directives handling.
1617 2006-12-10 Marek Safar <marek.safar@gmail.com>
1619 A fix for bugs #80093, and #75984
1620 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1621 logic, it seems to me as it worked before "by coincidence".
1622 (xtoken): Simplified to use reworked handle_preprocessing_directive.
1623 (cleanup): Enabled endif check.
1625 2006-12-09 Marek Safar <marek.safar@gmail.com>
1627 A fix for bug #80162
1628 * statement.cs (CollectionForeach.TryType): Generics and non-generics
1629 enumerators are never ambiguous.
1631 2006-12-08 Raja R Harinath <rharinath@novell.com>
1634 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1636 2006-12-06 Marek Safar <marek.safar@gmail.com>
1638 A fix for bug #80144
1639 * class.cs (EventProperty.Define): Explicit implementation means
1640 that an even is used.
1642 2006-12-06 Marek Safar <marek.safar@gmail.com>
1644 Fixes the operators implementation (part II)
1646 * cfold.cs (DoConstantNumericPromotions): Renamed to
1647 DoBinaryNumericPromotions and simplified.
1648 (BinaryFold): Couple of conversion fixes; simplified.
1650 * constant.cs, ecore.cs, literal.cs
1651 (ToType): Renamed to ConvertImplicitly.
1652 (Reduce): Renamed to ConvertExplicitly.
1654 * class.cs, convert.cs: Updated.
1656 * expression.cs: TryReduce doesn't throw an exception.
1658 2006-12-01 Marek Safar <marek.safar@gmail.com>
1660 A fix for bug #80108
1661 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1664 2006-11-30 Marek Safar <marek.safar@gmail.com>
1666 Fixes unary operators implementation (part I)
1669 * cfold.cs (Error_CompileTimeOverflow): Made internal
1671 * const.cs (IConstant): Changed to use reference to constant and
1672 not constant itself.
1673 Updated IConstant implementations.
1675 * constant.cs (CreateConstant): New factory method.
1676 Updated IConstant implementation.
1678 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1680 * ecore.cs: Updated to use CreateConstantReference.
1682 * enum.cs: Reflects IConstant changes.
1684 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1686 * literal.cs (NullConstant): Change to be independently usable.
1688 2006-11-29 Martin Baulig <martin@ximian.com>
1690 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1691 we need to emit the scope initializer before calling the base .ctor.
1693 * anonymous.cs: Merged back from the new anonymous methods branch.
1694 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1696 * expression.cs (ParameterReference.DoResolveBase): Create a
1697 "normal" ScopeInfo when capturing parameters rather than using the
1698 root scope; this makes things work with anonymous methods having
1702 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1704 2006-11-22 Marek Safar <marek.safar@gmail.com>
1706 A fix for bug #79987
1707 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1708 check to a base class.
1709 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1710 only when assembly has missing attribute.
1711 * report.cs: Update.
1713 2006-11-21 Marek Safar <marek.safar@gmail.com>
1715 * cs-tokenizer.cs: Merged with gmcs version.
1717 2006-11-20 Marek Safar <marek.safar@gmail.com>
1720 * cs-parser.jay: Better error message when partial keyword is misplaced.
1722 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
1724 A fix for bug #79810
1725 report.cs: CS1058 only applies to 2.0 profile (gmcs).
1726 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1727 a RuntimeWrappedException by default.
1729 2006-11-18 Marek Safar <marek.safar@gmail.com>
1731 A fix for bug #79843
1732 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1734 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1736 2006-11-18 Marek Safar <marek.safar@gmail.com>
1738 * driver.cs, namespace.cs: Uses faster IndexOf version.
1740 2006-11-17 Marek Safar <marek.safar@gmail.com>
1742 A fix for bug #79941
1743 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1745 (Operator.Define): Implicit/Explicit operator of same type is duplicate
1746 even if internal name is different.
1747 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1748 (UserDefinedConversion): Simplified as the operators cannot be internal.
1749 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1751 (MethodLookup): Replaced EmitContext with parentType.
1752 * expression.cs: Updated.
1754 2006-11-09 Raja R Harinath <rharinath@novell.com>
1756 * driver.cs (BadAssembly): Handle all the ugliness of
1757 DefineDynamicAssembly.
1759 2006-11-08 Raja R Harinath <rharinath@novell.com>
1761 Address parts of #58244 -- most of what's left is in the runtime
1762 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
1763 CS1509 error checks, and handle them for all assembly loads, not
1764 just the first invocation.
1765 (LoadModule): Likewise. Move handling of 'adder_method' ...
1766 * codegen.cs (AssemblyClass.AddModule): ... here.
1768 2006-11-02 Marek Safar <marek.safar@gmail.com>
1770 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1771 IEnumerable<T> is ambiguous.
1773 2006-10-31 Marek Safar <marek.safar@gmail.com>
1775 A fix for bug #67689
1776 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1777 GetEnumerator is ambiguous.
1779 * report.cs: Add new warning.
1781 2006-10-29 Marek Safar <marek.safar@gmail.com>
1783 A fix for bug #78602
1784 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1785 to protected member can be nested type.
1787 2006-10-28 Marek Safar <marek.safar@gmail.com>
1789 A fix for bug #78965
1790 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1791 to protected member must derive from current type.
1793 2006-10-27 Marek Safar <marek.safar@gmail.com>
1795 assign.cs: Reuses error method.
1797 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1798 instead of type for constants.
1799 (Expression.Error_ValueAssignment): Common error method.
1801 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1804 2006-10-27 Marek Safar <marek.safar@gmail.com>
1806 A fix for bug #79081
1807 * expression.cs (MemberAccess.DoResolve): Check nested type
1810 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
1812 * doc.cs : nested delegates were not handled. Fixed bug #79754.
1814 2006-10-26 Marek Safar <marek.safar@gmail.com>
1816 A fix for bug #76591
1817 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1819 2006-10-26 Marek Safar <marek.safar@gmail.com>
1821 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1822 type forwarder of the same type multiple times.
1824 2006-10-26 Raja R Harinath <rharinath@novell.com>
1827 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1828 instance as an rvalue, even when we later resolve as an lvalue.
1830 2006-10-25 Martin Baulig <martin@ximian.com>
1832 * anonymous.cs: Fix #79673.
1834 2006-10-24 Marek Safar <marek.safar@seznam.cz>
1836 A fix for bug #79666
1837 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1838 ignored when is optimized (= default value) as its value is already set.
1840 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1842 A fix for bug #79724
1843 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1844 TypeContainer for type lookup.
1846 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1848 A fix for bug #79231
1849 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1850 * expression.cs (OverloadResolve): Always convert type name for
1852 (ResolveNamespaceOrType): Don't confuse a nested type with any
1855 2006-10-18 Martin Baulig <martin@ximian.com>
1857 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1859 2006-10-17 Miguel de Icaza <miguel@novell.com>
1861 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1862 an int32, but requesting an int64 from the conversion
1864 2006-10-12 Martin Baulig <martin@ximian.com>
1867 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
1869 2006-10-12 Martin Baulig <martin@ximian.com>
1872 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1874 2006-10-11 Miguel de Icaza <miguel@novell.com>
1876 * convert.cs: Remove broken code: I was doing the "Existance"
1877 tests for Implicit conversions.
1879 2006-10-10 Miguel de Icaza <miguel@novell.com>
1881 * convert.cs: Added one missing case in
1882 ImplicitStandardConversionExists uint64 to intptr.
1886 * typemanager.cs (uintptr_type): another core known type.
1888 * ecore.cs (OperatorCast): routine used to do cast operations that
1889 depend on op_Explicit. We could change some of the Decimal
1890 conversions to use this.
1892 This one has a probe mechanism that checks both types for an op_
1893 which it coudl be used to eliminate two classes: CastToDecimal
1894 and CastFromDecimal.
1896 * convert.cs: Implement the conversions documented in #59800
1898 2006-10-10 Martin Baulig <martin@ximian.com>
1900 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1901 before RootScope.ResolveMembers().
1903 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1904 `CurrentType' if appropriate.
1906 2006-10-09 Marek Safar <marek.safar@seznam.cz>
1908 A fix for bug #78568
1909 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1910 when contains binary operators.
1911 * cs-parser.jay: Updated.
1913 2006-10-09 Martin Baulig <martin@ximian.com>
1916 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1917 moved that into Define() and also do the other type parameter
1918 checks there. Fixes #79094. Added gtest-292.cs.
1921 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1922 since that doesn't include type parameters; don't use `Ldelema'
1923 for type parameters. Fixes #78980. Added gtest-293.cs.
1925 2006-10-08 Marek Safar <marek.safar@seznam.cz>
1928 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1929 conversion is allowed.
1931 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1933 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1934 error reporting when no error occurs.
1936 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1938 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1941 2006-10-06 Raja R Harinath <rharinath@novell.com>
1944 * class.cs (DefineTypeBuilder): Check circular dependencies before
1945 setting the parent of the TypeBuilder.
1946 (CheckRecursiveDefinition): Don't use 'BaseType', since
1947 it may not be valid until after DefineTypeBuilder. Use
1948 'base_type' instead.
1950 2006-10-04 Martin Baulig <martin@ximian.com>
1952 Merged the Anonymous Methods patch.
1954 * anonymous.cs, iterators.cs: The new anonymous methods code.
1956 * statement.cs (Variable): New public abstract class.
1957 (LocalInfo.Variable): New public property.
1958 (LocalInfo.ResolveVariable): New public method.
1959 (Block.Flags): Add `IsIterator'.
1960 (Block.AddVariable): Improved the CS0136 check.
1961 (Block.AnonymousChildren): New public property.
1962 (Block.AddAnonymousChild): New public method.
1963 (ToplevelBlock): Update to use the new anonymous method framework.
1964 (ToplevelBlock.ctor): `container' is now a `Block' and not a
1965 `ToplevelBlock'; this is required to correctly implement the
1967 (Fixed, Using): Use `TemporaryVariable' instead of directly
1968 creating the `LocalBuilder'.
1970 * parameter.cs (Parameter.ResolveVariable): New public method.
1971 (Parameters.ResolveVariable): Likewise.
1973 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1975 * class.cs (TypeContainer): Replaced the `iterators' list and
1976 corresponding methods with a list of `CompilerGeneratedClass'es.
1977 (TypeContainer.ResolveMembers): New public method.
1978 (Method): `IIteratorContainer' has been replaced by
1981 * expression.cs (VariableReference): New public abstract base
1982 class for `LocalVariableReference', `ParameterReference' and
1985 * codegen.cs (EmitContext): Removed `capture_context',
1986 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1987 (EmitContext.EmitThis): Removed.
1989 * cs-parser.jay: Replace `iterator_container' with
1992 2006-10-04 Martin Baulig <martin@ximian.com>
1994 * generic.cs (GenericMethod): Don't make this abstract.
1995 (Constraints.Clone): Added dummy implementation.
1997 2006-10-04 Raja R Harinath <harinath@gmail.com>
2000 * namespace.cs (LookForAnyGenericType): Avoid nullref on
2001 'declspaces'. Avoid allocating arrays willy-nilly.
2004 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2005 cases out of the switch.
2007 2006-09-28 Marek Safar <marek.safar@seznam.cz>
2009 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2010 message when non-generic type is used with the type arguments.
2011 * expression.cs: Updated.
2013 2006-09-28 Raja R Harinath <rharinath@novell.com>
2016 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2017 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2018 Change semantics slightly. Don't insist on having only one
2019 temporary EmptyExpression -- just throttle the creation of new ones.
2022 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2023 non-interfaces too. If no methods are found, don't try to create
2026 2006-09-28 Marek Safar <marek.safar@seznam.cz>
2028 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2031 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2032 us produce better error message.
2034 2006-09-27 Marek Safar <marek.safar@seznam.cz>
2036 * expression.cs (Binary.ResolveOperator): Warn about a side effect
2037 of the `|' operator.
2039 * report.cs: A new warning added.
2041 2006-09-27 Martin Baulig <martin@ximian.com>
2043 * generic.cs (GenericMethod): Don't make this abstract.
2045 2006-09-27 Martin Baulig <martin@ximian.com>
2048 (InternalErrorException): Added overloaded ctor taking a params array.
2050 2006-09-26 Marek Safar <marek.safar@seznam.cz>
2052 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2053 Fixed the cases when same error was reported twice.
2055 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2056 now report symbol information.
2058 2006-09-25 Martin Baulig <martin@ximian.com>
2060 * class.cs: Completely unified with the gmcs version.
2062 2006-09-25 Martin Baulig <martin@ximian.com>
2064 * typemanager.cs (TypeManager.IsNullableType): New public function.
2065 (TypeManager.IsNullableTypeOf): Likewise.
2066 (TypeManager.IsNullableValueType): Likewise.
2068 * class.cs (MethodCore): Added the `GenericMethod' argument from
2069 gmcs and also unified all classes derived from `MethodCore' with gmcs.
2071 2006-09-24 Raja R Harinath <harinath@gmail.com>
2073 * convert.cs: Unify with gmcs version.
2075 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2077 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2078 verify them as well.
2080 * report.cs: New warning.
2082 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2084 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2085 for anonymous block with out argument.
2087 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2089 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2090 not used private events only.
2092 2006-09-23 Marek Safar <marek.safar@seznam.cz>
2094 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2096 * const.cs (Const.Define): Check for constant type.
2097 (Const.IsConstantTypeValid): Looks for valid constant types.
2099 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2101 * ecore.cs (EmptyConstantCast): New common class for all constant based
2104 * expression.cs (Is.DoResolve): Handle null constant especially.
2105 (New.DoResolve): Check for new void().
2106 (MemberAccess.DoResolve): Cope with all kind of nulls.
2108 * literal.cs (NullConstant): Uses EmptyConstantCast.
2109 (NullDefault): Based on EmptyConstantCast.
2110 (NullLiteral): Uses EmptyConstantCast.
2112 * statement.cs (Block.ResolveMeta): Check for constant type.
2114 2006-09-22 Martin Baulig <martin@ximian.com>
2116 * delegate.cs, attribute.cs: Merged with the gmcs versions.
2118 2006-09-22 Raja R Harinath <rharinath@novell.com>
2120 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2124 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2125 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
2128 2006-09-22 Martin Baulig <martin@ximian.com>
2130 * ecore.cs: Merged with the gmcs version.
2132 * generic.cs (ConstructedType): New dummy class.
2133 (TypeArguments): Don't make this abstract.
2136 (TypeManager.IsGenericTypeDefinition): New method.
2137 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2139 2006-09-22 Raja R Harinath <rharinath@novell.com>
2141 * expression.cs (ComposedCast): Check for arrays of TypedReference
2142 before creating the type, not after.
2144 2006-09-21 Marek Safar <marek.safar@seznam.cz>
2146 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2147 after ToType change.
2149 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2150 when constant must be implicitly convertible.
2152 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2154 * ecore.cs (NullCast): Derives from NullConstant.
2156 * expression.cs (Is.DoResolve): Removed useless variables.
2157 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2158 (New.Constantify): Add enum support.
2159 (MemberAccess.DoResolve): Add warning when accessing null constant or
2162 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2165 * literal.cs (NullConstant): New abstract class with common
2166 functionality for all null specializations.
2167 (NullDefault): Represents default(X) when result can be
2169 (NullLiteral): Updated.
2171 * report.cs: Add new warning.
2173 2006-09-21 Martin Baulig <martin@ximian.com>
2175 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2177 2006-09-21 Martin Baulig <martin@ximian.com>
2179 * generic.cs (GenericConstraints): New dummy class.
2180 (Constraints): Likewise.
2181 (TypeParameter): Likewise.
2182 (TypeParameterName): Likewise.
2183 (GenericMethod): Likewise.
2185 * typemanager.cs (TypeManager.GetGenericArguments): New method.
2187 * decl.cs: Merged with the gmcs version.
2189 2006-09-21 Raja R Harinath <rharinath@novell.com>
2191 * generic.cs (TypeParameter): Implement IMemberContainer.
2192 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
2194 * rootcontext.cs: Unify with gmcs version.
2196 * report.cs: Unify with gmcs version.
2197 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2198 from gmcs/generics.cs.
2199 * generics.cs (TypeParameter): New dummy class.
2201 * support.cs: Unify with gmcs version.
2203 2006-09-20 Raja R Harinath <rharinath@novell.com>
2205 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2206 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2208 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2209 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2210 * mcs.exe.sources: Add generic.cs.
2212 * codegen.cs: Unify with gmcs version.
2214 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2215 (EmitContext): Add GenericDeclContainer implementation.
2216 * decl.cs (MemberCore, DeclSpace): Likewise.
2217 * namespace.cs: Remove #ifdef GMCS_SOURCE.
2219 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2220 MCS TypeManager has a corresponding dummy method.
2222 2006-09-19 Martin Baulig <martin@ximian.com>
2224 * expression.cs: Completely merged with the gmcs version.
2226 2006-09-19 Martin Baulig <martin@ximian.com>
2228 * expression.cs (Invocation): Merged with the gmcs version.
2229 (ArrayAccess.GetStoreOpcode): Likewise.
2231 2006-09-19 Martin Baulig <martin@ximian.com>
2234 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2235 (TypeManager.IsGenericMethodDefinition): Likewise.
2237 2006-09-19 Martin Baulig <martin@ximian.com>
2240 (TypeManager.IsEqual): Moved the gmcs implementation here.
2241 (TypeManager.DropGenericTypeArguments): Likewise.
2242 (TypeManager.DropGenericMethodArguments): Likewise.
2243 (TypeManager.GetTypeArguments): Moved here from gmcs.
2244 (TypeManager.HasGenericArguments): Likewise.
2246 2006-09-19 Martin Baulig <martin@ximian.com>
2248 * expression.cs (Binary): Merged with the gmcs version.
2250 2006-09-19 Martin Baulig <martin@ximian.com>
2252 * expression.cs (Probe, As, Is): Merged with the gmcs version.
2254 2006-09-19 Martin Baulig <martin@ximian.com>
2256 * typemanager.cs: Merged with the gmcs version.
2258 2006-09-16 Raja R Harinath <rharinath@novell.com>
2260 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2261 * driver.cs: Likewise.
2263 2006-09-16 Marek Safar <marek.safar@seznam.cz>
2266 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2267 only if parent type is class.
2268 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2271 2006-09-15 Marek Safar <marek.safar@seznam.cz>
2274 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2276 * typemanager.cs(CSharpName): Converts NullType to null.
2278 2006-09-15 Martin Baulig <martin@ximian.com>
2281 (TypeManager.GetMethodName): Added mcs implementation.
2282 (TypeManager.IsEqual): Likewise.
2285 (SimpleName.RemoveGenericArity): Added dummy implementation.
2287 * pending.cs: Merged with the gmcs version.
2289 2006-09-15 Martin Baulig <martin@ximian.com>
2291 * statement.cs: Merge with the gmcs version.
2293 2006-09-15 Martin Baulig <martin@ximian.com>
2295 * statement.cs (Switch): Merge with the gmcs implementation
2296 (without nullables), which is newer.
2298 2006-09-15 Martin Baulig <martin@ximian.com>
2300 * statement.cs (Block.Variables): Make this public.
2301 (ToplevelBlock.Parameters): Make this a property.
2302 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2304 2006-09-15 Martin Baulig <martin@ximian.com>
2306 * namespace.cs: Merge with the gmcs version.
2308 2006-09-15 Martin Baulig <martin@ximian.com>
2310 * decl.cs (MemberName): Minor code cleanups.
2312 2006-09-15 Martin Baulig <martin@ximian.com>
2314 * parameter.cs: Merge with the gmcs version.
2316 2006-09-15 Martin Baulig <martin@ximian.com>
2318 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2319 and an error in mcs.
2321 2006-09-15 Martin Baulig <martin@ximian.com>
2323 * flowanalysis.cs: Merged from GMCS; added the generics code into
2324 a `GMCS_SOURCE' conditional so we can share this file.
2326 2006-09-08 Martin Baulig <martin@ximian.com>
2328 * typemanager.cs (TypeManager.interlocked_type): New public field.
2329 (TypeManager.int_interlocked_compare-exchange): New public field.
2330 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2331 enumerator types here and call InitGenericCoreTypes().
2332 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2333 after calling InitEnumUnderlyingTypes().
2336 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2337 `classes_second_stage'.
2339 2006-09-14 Marek Safar <marek.safar@seznam.cz>
2341 * assign.cs, ecore.cs, expression.cs: Share error message text.
2342 * class.cs (FieldMember.Define): Check for varible of static type.
2343 * driver.cs (LoadAssembly): Uses error output for errors.
2344 * statement.cs: Updated.
2346 2006-09-08 Marek Safar <marek.safar@seznam.cz>
2348 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2351 2006-09-07 Martin Baulig <martin@ximian.com>
2354 (MainDriver): Revert r62663 from Marek; see #70506 for details.
2356 2006-08-29 Miguel de Icaza <miguel@novell.com>
2358 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2360 2006-08-17 Miguel de Icaza <miguel@novell.com>
2362 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2363 #52019 and #79064, the use of the \uXXXX sequence in source code
2364 to represent unicode characters.
2366 2006-08-15 Marek Safar <marek.safar@seznam.cz>
2368 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2370 * class.cs, ecore.cs, statement.cs: Merged to one error message.
2372 2006-08-13 Miguel de Icaza <miguel@novell.com>
2374 * assign.cs: Catch attempts to assign to a method groups in += and
2377 2006-08-13 Marek Safar <marek.safar@seznam.cz>
2380 * cs-parser.jay: Don't destroy current array type by typeof of array's.
2382 2006-08-12 Marek Safar <marek.safar@seznam.cz>
2384 * class.cs (Method.Define): Issue a warning when generic method looks like
2386 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2389 2006-08-09 Marek Safar <marek.safar@seznam.cz>
2391 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2393 * decl.cs (MemberCache.FindMembers): When container is interface we need to
2394 search all base interfaces as a member can be ambiguous.
2395 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2396 Constructor member type filter.
2397 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2398 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2399 reporting for returned memberinfos.
2400 * report.cs: Updated.
2401 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2402 version to work on all runtimes.
2403 (TypeManager.RealMemberLookup): Removed members filtering.
2405 2006-08-08 Raja R Harinath <rharinath@novell.com>
2407 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2408 (PropertyExpr.EmitAssign): Likewise.
2409 * expression.cs (Indirection.EmitAssign): Likewise.
2410 (LocalVariableReference.EmitAssign): Likewise.
2411 (ParameterReference.EmitAssign): Likewise.
2412 (Invocation.EmitArguments): Likewise.
2413 (ArrayAccess.EmitAssign): Likewise.
2414 (IndexerAccess.EmitAssign): Likewise.
2415 (This.EmitAssign): Likewise.
2416 (ConditionalLogicalOperator.Emit): Likewise.
2419 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
2420 instead of ArrayList. If the hashtable has a LocalBuilder, don't
2421 leave it in after returning it.
2422 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
2424 2006-08-06 Marek Safar <marek.safar@seznam.cz>
2426 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2429 2006-08-03 Raja R Harinath <rharinath@novell.com>
2431 Fix cs0146-3.cs and cs0146-4.cs.
2432 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2433 enclosing types don't depend on the current type.
2435 2006-08-02 Raja R Harinath <rharinath@novell.com>
2438 * class.cs (TypeContainer.DoDefineMembers): Use
2439 FindBaseMemberWithSameName on Parent, since we're interested in
2440 whether we hide inherited members or not.
2441 (FindBaseMemberWithSameName): Make slightly more robust.
2443 Fix the non-generic testcase from #77396
2444 * decl.cs (DeclSpace.DeclContainer): Remove override.
2446 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2447 declspaces for doppelgangers too.
2448 (UsingEntry): Implement IResolveContext.
2449 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
2450 'this' as the resolve context.
2451 (LocalAliasEntry): Likewise.
2453 Implement parts of #77403
2454 * roottypes.cs (RootDeclSpace): New. Used to represent the
2455 toplevel declaration space. Each namespace declaration introduces
2456 a "partial" root declaretion space.
2457 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2458 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2459 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2460 from 'current_namespace.SlaveDeclSpace'.
2461 (namespace_declaration): Likewise.
2462 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2463 check. It can't happen now.
2464 * decl.cs (DeclSpace.LookupType): Likewise.
2465 * driver.cs (MainDriver): Sanity check.
2467 2006-08-01 Raja R Harinath <rharinath@novell.com>
2469 * decl.cs (DeclSpace.FindNestedType): Remove.
2470 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2471 LookupTypeContainer to get the container of the nested type.
2472 * class.cs (TypeContainer.FindNestedType): Make non-override.
2474 2006-07-31 Raja R Harinath <rharinath@novell.com>
2476 * decl.cs (DeclSpace.PartialContainer): Move field from ...
2477 * class.cs (TypeContainer.PartialContainer): ... here.
2478 (TypeContainer.AddBasesForPart): New helper.
2479 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
2481 * cs-parser.jay (current_class): Convert to DeclSpace.
2482 (struct_declaration, interface_declaration, class_declaration):
2483 Use AddBasesForPart instead of .Bases directly.
2484 * const.cs, iterators.cs: Update to changes.
2486 2006-07-28 Raja R Harinath <rharinath@novell.com>
2488 * class.cs (TypeContainer.AddMemberType): Rename from
2490 (TypeContainer.AddMember): Rename from AddToMemberContainer.
2491 (AddTypeContainer): New. Combine AddClassOrStruct and
2493 (AddPartial): Update. Add 'is_partial' argument.
2494 * roottypes.cs: Update to changes.
2495 * cs-parser.jay (push_current_class): New helper for handling
2496 current_container and current_class.
2497 (struct_declaration, interface_declaration, class_declaration):
2500 2006-07-26 Raja R Harinath <rharinath@novell.com>
2502 * roottypes.cs: Rename from tree.cs.
2504 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2505 * tree.cs (Tree, ITreeDump): Remove types.
2506 * rootcontext.cs (tree, Tree): Remove fields.
2507 (root, ToplevelTypes): New.
2508 * *.cs: Update to rename.
2510 * tree.cs (Tree.RecordDecl): Remove.
2511 (RootTypes.AddToTypeContainer): Record the toplevel type in its
2513 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2515 2006-07-23 Raja R Harinath <harinath@gmail.com>
2517 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2518 DoFlowAnalysis and OmitStructFlowAnalysis here.
2519 (ec.With): Rename from WithUnsafe and generalize.
2520 (ec.WithCheckState): Remove. All users can be handled by 'With'.
2521 (ec.WithFlowAnalyis): New.
2522 * ecore.cs, expression.cs, statement.cs: Update.
2524 2006-07-22 Raja R Harinath <harinath@gmail.com>
2526 * statement.cs (Block.ResolveMeta): Simplify slightly.
2528 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
2529 multiple boolean fields. Convert InUnsafe, constant_check_state,
2530 check_state to flags.
2531 (CheckState, ConstantCheckState): Update.
2532 (InUnsafe): New read-only property.
2533 (FlagsHandle): Rename from CheckStateHandle and convert to handle
2535 (WithUnsafe): New helper similar to WithCheckState.
2536 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2537 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2539 2006-07-21 Raja R Harinath <rharinath@novell.com>
2541 Make comparisons use the same IL irrespective of whether they're
2542 in a 'checked' or 'unchecked' context: one of the issues in #78899
2543 * codegen.cs (EmitContext.CheckState): Make read-only property.
2544 (EmitContext.ConstantCheckState): Likewise.
2545 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2546 helper that implement a save/restore stack for CheckState
2547 values. This is the only way to change check-state.
2548 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2549 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2550 (CheckedExpr.EmitBranchable): New forwarding method.
2551 (UnCheckedExpr): Likewise.
2552 * statement.cs (Block.ResolveMeta): Use WithCheckState.
2553 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2554 (Checked.Resolve, checked.DoEmit): Likewise.
2556 2006-07-20 Miguel de Icaza <miguel@novell.com>
2558 * anonymous.cs: Cache the resolved anonymous delegate, and return
2559 this so that the ResolveTopBlock is only triggered once, not
2562 Currently we trigger ResolvetopBlock twice due to a first pass of
2563 argument check compatibility, and a second pass that does the
2566 2006-07-15 Marek Safar <marek.safar@seznam.cz>
2568 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2570 * rootcontext.cs (Reset): Add helper_classes.
2572 2006-07-15 Marek Safar <marek.safar@seznam.cz>
2575 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2578 2006-07-13 Miguel de Icaza <miguel@novell.com>
2580 * statement.cs (Lock): Handle expressions of type
2581 TypeManager.null_type specially. Fixes #78770
2583 2006-07-08 Marek Safar <marek.safar@seznam.cz>
2585 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2588 2006-07-08 Marek Safar <marek.safar@seznam.cz>
2590 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2591 for accessors as well.
2592 * ecore.cs (EventExpr): Add AccessorTable.
2594 2006-07-01 Marek Safar <marek.safar@seznam.cz>
2597 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2598 for CS0122 where appropriate.
2599 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2601 (Filter): Assembly can be null in the case of top level attributes.
2603 2006-06-25 Marek Safar <marek.safar@seznam.cz>
2607 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2608 is done at global level.
2610 2006-06-24 Marek Safar <marek.safar@seznam.cz>
2612 A fix for #77002, Implemented TypeForwarder support.
2614 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2615 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2616 * typemanager.cs (): Add type_forwarder_attr_type.
2618 2006-06-24 Marek Safar <marek.safar@seznam.cz>
2620 * report.cs: Add CS0469 warning.
2622 2006-06-21 Martin Baulig <martin@ximian.com>
2624 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2625 the `try'-block, so we also report CS0016 etc. there.
2627 2006-06-21 Martin Baulig <martin@ximian.com>
2630 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2632 2006-06-21 Martin Baulig <martin@ximian.com>
2634 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2635 also report CS1686 for parameters.
2637 2006-06-21 Martin Baulig <martin@ximian.com>
2639 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2640 instead of an error if the value is not implicitly convertible to
2641 the switch types; fixes #77964.
2643 2006-06-21 Raja R Harinath <rharinath@novell.com>
2646 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2647 FieldBuilder is null.
2650 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2651 'left' and 'right' before error-checking.
2653 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
2655 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2657 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2658 (FieldExpr.DoResolve): likewise.
2659 (PropertyExpr.InstanceResolve): likewise.
2660 (EventExpr.InstanceResolve): likewise.
2662 2006-06-04 Marek Safar <marek.safar@seznam.cz>
2664 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2665 attribute applicable tests for attribute argument.
2667 2006-06-02 Raja R Harinath <rharinath@novell.com>
2670 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2671 (Binary.OverloadResolve_PredefinedIntegral): New.
2672 (Binary.OverloadResolve_PredefinedFloating): New.
2673 (Binary.OverloadResolve_PredefinedString): New.
2674 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2675 Follow the standard more closely, and treat numeric promotions in
2676 terms of overload resolution.
2677 (Binary.CheckShiftArguments): Simplify.
2679 2006-06-01 Raja R Harinath <rharinath@novell.com>
2681 * flowanalysis.cs (MyBitVector): Simplify representation.
2682 (MyBitVector.Clone): Avoid allocating BitArray.
2683 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2684 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2685 (*): Update. Change all references to MyBitVector.And and
2686 MyBitVector.Or to &= and |=.
2688 2006-05-29 Raja R Harinath <rharinath@novell.com>
2691 * cs-parser.jay (formal_parameter_list): Extend the pattern below
2692 to param arguments too.
2694 2006-05-26 Miguel de Icaza <miguel@novell.com>
2696 * cs-parser.jay: Catch another parsing form for arglist being
2697 followed by other arguments. Fixes #78313.
2699 2006-05-24 Raja R Harinath <rharinath@novell.com>
2701 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2702 checking of out parameters to ...
2703 (FlowBranchingToplevel.Merge): ... here.
2704 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2705 set, propagate the origin upward, and only complain if there was
2707 (FlowBranchingException.AddContinueOrigin): Likewise.
2708 (FlowBranchingException.AddReturnOrigin): Likewise.
2709 (FlowBranchingException.AddGotoOrigin): Likewise.
2711 2006-05-23 Raja R Harinath <rharinath@novell.com>
2713 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2714 unreachable, skip it.
2715 (FlowBranchingException.Merge): Always propagate jumps, even if
2716 the finally block renders subsequent code unreachable.
2718 2006-05-18 Raja R Harinath <rharinath@novell.com>
2721 * statement.cs (Goto.Resolve): Move responsibility for resolving
2722 'goto' to FlowBranching.AddGotoOrigin.
2723 (Goto.SetResolvedTarget): New. Callback to set the
2724 LabeledStatement that's the target of the goto.
2725 (Goto.DoEmit): Use Leave instead of Br when crossing an
2726 unwind-protect boundary.
2727 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2728 LookupLabel and adjust to new semantics.
2729 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2730 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2731 Goto.SetResolvedTarget to update target.
2732 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2733 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2734 AddBreakOrigin & co. Delay propagation until ...
2735 (FlowBranchingException.Merge): ... this.
2737 * statement.cs (Block.Resolve): Always depend on flow-branching to
2738 determine unreachability. Kill workaround that originally emitted
2739 only one statement after an "unreachable" label (see infloop in
2742 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2743 This is still "wrong", but anything better would probably need a
2744 multi-pass algorithm.
2745 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2746 usage vector. Force current usage vector to be reachable, to
2747 optimistically signify backward jumps.
2748 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2750 (FlowBranchingLabeled.Merge): New. If no backward jump was
2751 detected, return the original salted-away usage vector instead,
2752 updated with appropriate changes. Print unreachable warning if
2754 * statement.cs (Block.Resolve): Don't print unreachable warning on
2755 a labeled statement.
2757 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
2759 * driver.cs: Pass filename without path to AssemblyBuilder's
2760 AddResourceFile. Fixes bug #78407.
2762 2006-05-17 Raja R Harinath <rharinath@novell.com>
2764 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2765 * flowanalysis.cs (FlowBranchingLabeled): ... here.
2766 (FlowBranching.MergeChild): Overwrite
2767 reachability information from Labeled branchings too.
2769 2006-05-16 Raja R Harinath <rharinath@novell.com>
2771 * statement.cs (Goto.Resolve): Merge jump origins here ...
2772 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2774 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2775 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
2776 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
2777 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2779 * statement.cs (Goto.Resolve): ... not here.
2780 (Goto.Emit): Remove CS1632 check.
2782 2006-05-14 Marek Safar <marek.safar@seznam.cz>
2784 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2787 2006-05-11 Raja R Harinath <rharinath@novell.com>
2789 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2790 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2791 (FlowBranchingException.Label): Likewise.
2793 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
2795 (MyBitVector.Or): Use it to avoid losing information (Count).
2796 (FlowBranching.MergeOrigins): Likewise.
2798 * flowanalysis.cs (UsageVector.IsDirty): Remove.
2799 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2800 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2801 (UsageVector.ToString): Simplify.
2802 (UsageVector.MergeSiblings): Move here from ...
2803 (FlowBranching.Merge): ... here.
2804 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2807 2006-05-10 Raja R Harinath <rharinath@novell.com>
2809 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2810 null bitvector is treated as all-true.
2812 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2813 (MyBitVector): Rationalize invariants. 'vector != null' implies
2814 that we have our own copy of the bitvector. Otherwise,
2815 'InheritsFrom == null' implies all inherited bits are true.
2817 2006-05-09 Marek Safar <marek.safar@seznam.cz>
2819 * statement.cs (LocalInfo): Add IsConstant.
2820 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2821 local variable for constants.
2823 2006-05-09 Raja R Harinath <rharinath@novell.com>
2825 * flowanalysis.cs (MyBitVector.Empty): New.
2826 (MyBitVector): Don't allow InheritedFrom to be null.
2827 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2828 (UsageVector, FlowBranching): Update to changes.
2830 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2831 recursion. The 'Parent == null' condition isn't sufficient for
2833 (FlowBranching.AddBreakOrigin): Likewise.
2834 (FlowBranching.AddContinueOrigin): Likewise.
2835 (FlowBranching.AddReturnOrigin): Likewise.
2836 (FlowBranching.StealFinallyClauses): Likewise.
2837 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2838 (FlowBranching.CheckOutParameters): Likewise.
2839 (FlowBranchingToplevel): Terminate all the above recursions here.
2840 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2841 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2843 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
2845 (FlowBranchingToplevel): New. Empty for now.
2846 (FlowBranching.MergeTopBlock): Update.
2847 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2848 branching for the anonymous delegate.
2849 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2851 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2852 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2853 information at the start of the merge. Reorganize.
2855 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2857 * class.cs (MethodData.Define): Method cannot implement interface accessor.
2859 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2861 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2862 to newly introduced ctor.
2864 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2865 message to one place.
2866 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2869 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2871 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2873 * ecore.cs (Expression.ResolveAsConstant): Updated.
2875 * statement.cs (ResolveMeta): Updated.
2877 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2879 * cs-parser.jay: __arglist cannot be used in initializer.
2881 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2884 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2887 2006-05-05 Raja R Harinath <rharinath@novell.com>
2889 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2890 (LabeledStatement): Add 'name' parameter.
2891 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2892 (Block.AddLabel): Update to changes.
2893 * cs-parser.jay (labeled_statement): Likewise.
2895 * flowanalysis.cs (BranchingType.Labeled): New.
2896 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2897 (FlowBranchingLabeled): New. Does nothing for now, but will
2898 eventually handle 'goto' flows.
2899 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2900 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2901 that's terminated ...
2902 (Block.Resolve): ... here.
2904 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2905 (UsageVector.MergeFinallyOrigins): Likewise.
2906 (FlowBranching.InTryOrCatch): Likewise.
2907 (FlowBranching.AddFinallyVector): Likewise.
2908 (FlowBranchingException): Update to changes.
2911 * statement.cs (Return.Resolve): Move error checking to ...
2912 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2913 (FlowBranchingException): Handle return origins like break and
2915 (FlowBranching.UsageVector.CheckOutParameters): Remove.
2917 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2920 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2923 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2926 * class.cs (MethodData.Define): Do public accessor check only when method
2927 implements an interface.
2929 2006-05-04 Raja R Harinath <rharinath@novell.com>
2931 Remove special handling of 'break'
2932 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2933 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
2934 (UsageVector.Break): Remove.
2935 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2937 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2939 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2940 UsageVector.Breaks (). Don't set NeedsReturnLabel.
2942 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2945 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2946 be the interface member.
2948 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2951 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2952 for emitting small (int) values.
2954 2006-05-03 Raja R Harinath <rharinath@novell.com>
2957 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2958 control-flow passes through the 'finally' after merging-in all the
2959 control-flows from 'try' and the 'catch' clauses.
2961 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2962 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
2963 always true at the only non-recursive entry point.
2964 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2965 FlowBranchingBreakable.
2966 (FlowBranchingLoop): Remove.
2967 * statement.cs (Return.DoResolve): Update to changes.
2970 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2971 (FlowBranching.CreateBranching): Handle it: create a
2972 FlowBranchingContinuable.
2973 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2974 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2975 except that it handles the 'continue' command.
2976 (FlowBranching.UsageVector.MergeOrigins): Rename from
2978 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2979 except that it overrides AddContinueOrigin.
2980 (FlowBranchingException): Override AddContinueOrigin, similar to
2982 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2983 Create a new branching around the embedded statement.
2984 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
2985 control flow after the embedded statement.
2986 (Continue.Resolve): Move all error checking to AddContinueOrigin.
2988 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2989 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2990 FlowBranchingBreakable.
2991 (FlowBranchingSwitch): Remove.
2994 * statement.cs (Break.Resolve): Simplify. Move responsibility for
2995 error reporting to ...
2996 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2997 Rename from 'AddBreakVector'. Add new location argument. Return
2998 a bool indicating whether the 'break' crosses an unwind-protect.
2999 (FlowBranchingException.AddBreakOrigin): Add.
3000 (FlowBranchingException.Merge): Propagate 'break's to surrounding
3001 flowbranching after updating with the effects of the 'finally'
3003 (FlowBranchingBreakable): New common base class for
3004 FlowBranchingLoop and FlowBranchingSwitch.
3006 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3008 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3010 2006-05-02 Raja R Harinath <rharinath@novell.com>
3012 * statement.cs (Do.Resolve): If the loop is infinite, set the
3014 (While.Resolve, For.Resolve): Set a barrier after the embedded
3015 statement. There's no direct control flow that goes from the end
3016 of the embedded statement to the end of the loop.
3017 * flowanalysis.cs (FlowBranching.Infinite): Remove.
3018 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
3019 above ensure that the reachability is correctly computed.
3021 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3022 (UsageVector.MergeBreakOrigins): If the current path is
3023 unreachable, treat it as if all parameters/locals are initialized.
3024 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
3025 infinite loops before merging-in break origins.
3027 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3028 (Reachability.Reachable): Split part into ...
3029 (Reachability.Unreachable): ... this. Simplify.
3030 (Reachability.IsUnreachable): Use 'Unreachable' instead.
3032 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3033 (Reachability.SetThrowsSometimes): Likewise.
3034 (FlowBranchingBlock.MergeTopBlock): Don't compare against
3035 TriState.Always, use corresponding property.
3036 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3037 (Block.Resolve): Likewise. Remove some redundant checks.
3039 2006-05-02 Raja R Harinath <harinath@gmail.com>
3041 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3042 (Reachability.Meet): Don't bother checking AlwaysThrows --
3043 barrier is always set.
3044 (FlowBranchingBlock.Merge): Likewise.
3046 2006-05-01 Raja R Harinath <harinath@gmail.com>
3048 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3049 checks for unreachable.
3051 2006-05-01 Marek Safar <marek.safar@seznam.cz>
3054 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3056 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3057 whether field is really assigned.
3059 2006-04-30 Raja R Harinath <harinath@gmail.com>
3061 * flowanalysis.cs (Reachability): Make 4-argument constructor
3063 (Reachability.Meet): Rename from 'And'. Remove static variant.
3064 (Reachability.Always): Rename from the highly misleading
3065 'Reachability.Never'.
3066 (FlowBranching.Merge): Update to changes. Mark an impossible
3067 situation with a 'throw'.
3068 (*): Update to changes.
3070 2006-04-29 Raja R Harinath <harinath@gmail.com>
3072 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3074 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3075 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3076 (*): Update to changes.
3077 * statement.cs: Update to changes.
3079 2006-04-28 Marek Safar <marek.safar@seznam.cz>
3082 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3084 2006-04-28 Raja R Harinath <harinath@gmail.com>
3086 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3089 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3090 argument to two arguments: an usage-vector and a bool. Move call
3091 to FlowBranching.Merge () ...
3092 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3094 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3095 handling of loop and switch reachability to ...
3096 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3098 2006-04-27 Raja R Harinath <harinath@gmail.com>
3100 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3101 handling to FlowBranchingLoop.InLoop.
3102 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3104 2006-04-26 Marek Safar <marek.safar@seznam.cz>
3107 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3108 anonymous method is allowed from AnonymousContainer here.
3110 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3112 2006-04-24 Raja R Harinath <rharinath@novell.com>
3115 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3117 2006-04-23 Marek Safar <marek.safar@seznam.cz>
3120 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3121 (DoubleConstant.Reduce): Ditto.
3123 2006-04-23 Raja R Harinath <rharinath@novell.com>
3125 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3126 Remove 'lvalue_right_side' argument. Move parts to ...
3127 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3128 (LocalVariable.DoResolveLValue): ... these.
3130 2006-04-21 Raja R Harinath <rharinath@novell.com>
3133 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3134 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3135 (LocalVariableReference.DoResolveBase): Use it to implement new
3137 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3138 (Argument.Resolve): Simplify. Move CS1510 check ...
3139 * ecore.cs (Expression.ResolveLValue): ... here.
3140 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3141 (PropertyExpr.DoResolveLValue): Likewise.
3142 (FieldExpr.Report_AssignToReadonly): Likewise.
3143 (FieldExpr.DoResolve): Add 'out_access' argument. Use
3144 LValueMemberAccess or LValueMemberOutAccess on instance depending
3146 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3147 DoResolve as appropriate.
3149 2006-04-20 Raja R Harinath <rharinath@novell.com>
3152 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3153 implicit conversions on 'out' and 'ref' arguments.
3155 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3156 improve clarity. Remove dead code.
3159 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3160 (Catch.Resolve): Resolve VarBlock if it exists.
3162 2006-04-19 Miguel de Icaza <miguel@novell.com>
3164 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3165 twice, this was some residual code, the enumerator was emitted
3166 properly in the two branche of if later.
3168 2006-04-19 Raja R Harinath <rharinath@novell.com>
3170 * expression.cs (Cast.ResolveLValue): Remove. The result of a
3171 cast is never an lvalue.
3172 (Cast.DoResolve, Cast.ResolveRest): Combine.
3173 (Argument.Emit): Simplify slightly. Move 'Expr is
3174 IMemoryLocation' check ...
3175 (Argument.Resolve): ... here.
3176 (Argument.Error_LValueRequired): Remove. Inline into only user.
3178 Simplifications. Fix cs0191-2.cs
3179 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3180 CS1649 and CS1651 to ...
3181 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
3182 the actual selection of the error code and message to a lookup
3183 table. Add a dummy return value to simplify callsites.
3184 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3185 readonly fields of other instances of the same type. Move CS0197
3187 * expression.cs (Argument.Resolve): ... here. Simplify code.
3188 Ensure that ec.InRefOutArgumentResolving is only set during LValue
3189 resolution of an out or ref argument. The code simplification
3190 above uses this invariant.
3192 2006-04-18 Raja R Harinath <rharinath@novell.com>
3194 Possibly fix #77752. Fix cs1690-[4-7].cs.
3195 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3196 CheckMarshallByRefAccess. Drop parameter.
3197 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
3199 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3201 * report.cs (AllWarnings): Add CS1690.
3202 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3204 (LocalVariableReference.DoResolveBase): Update.
3206 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3208 * class.cs (MethodOrOperator): Moved common parts from method class.
3209 detect obsolete attributes.
3210 (Method.Define): Simplified as it reuses code from base.
3211 (Constructor.ValidAttributeTargets): Fixed issue found during
3213 (Destructor.ValidAttributeTargets): Fixed issue found during
3215 (Operator): Finished refactoring set off by #78020. Operator class is now
3216 ordinary method class.
3218 * anonymous.cs: Updated.
3220 * decl.cs (DeclSpace): Add IsGeneric
3222 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3224 * class.cs (Constructor.Emit): Don't emit the attributes twice.
3226 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3228 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3229 detect obsolete attributes.
3230 (Method.CreateEmitContext): Moved to MethodOrOperator.
3232 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3235 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3236 customized exception to make crash detection easier.
3237 (MethodOrOperator): Started to work on new base class for methods and
3239 (Method): Derives from MethodOrOperator.
3240 (Constructor.Emit): Emits its own attributes.
3241 (AbstractPropertyEventMethod.Emit): Ditto.
3242 (Operator): Derives from MethodOrOperator, will refactor fully in extra
3244 (Operator.Emit): It's temporary more tricky than should be.
3246 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3248 * report.cs (InternalErrorException): Add ctor with inner exception.
3250 2006-04-08 Marek Safar <marek.safar@seznam.cz>
3253 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3256 2006-04-07 Marek Safar <marek.safar@seznam.cz>
3259 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3262 2006-04-06 Marek Safar <marek.safar@seznam.cz>
3264 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3265 attribute is present and Guid not.
3266 (Interface.ApplyAttributeBuilder): Ditto.
3268 * attribute.cs: Add error message.
3270 2006-04-06 Marek Safar <marek.safar@seznam.cz>
3274 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3275 sources (it's composite) so hold them in extra array as they are used in
3276 Emit phase only. It worked in the previous versions by mistake.
3277 (Attribute.Emit): Emit attribute for more owners when exist.
3279 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3280 it has now different behaviour.
3282 2006-04-04 Marek Safar <marek.safar@seznam.cz>
3284 * constant.cs (Constant.IsDefaultInitializer): New method.
3286 * class.cs: Updated.
3288 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3289 re-initialize default values. It saves KBs almost for every assembly.
3290 Thanks Zoltan for the idea.
3291 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3292 (ArrayCreation.DoResolve): Resolve only once.
3293 (ArrayCreation.Emit): Emit static initializer only when it is faster.
3294 (ArrayCreation.GetAttributableValue): Cope with optimized values.
3296 2006-04-03 Zoltan Varga <vargaz@gmail.com>
3298 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3301 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3303 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3304 in an embedded statement too.
3306 2006-04-01 Raja R Harinath <rharinath@novell.com>
3309 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3311 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3315 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3318 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3320 2006-03-31 Marek Safar <marek.safar@seznam.cz>
3322 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3325 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3326 LocalTemporary change.
3328 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3330 (ClassOrStruct.DefineFieldInitializers): Implemented static field
3331 initializers optimization.
3332 (ClassOrStruct.TypeAttr): Moved from modifiers.
3333 (Constructor.CheckBase): Don't crash when static ctor has parameters.
3334 (FieldBase.ResolveInitializer): Resolves initializer.
3335 (FieldBase.HasDefaultInitializer): New property.
3337 * cs-parser.jay: Removed message.
3339 * expression.cs (CompilerGeneratedThis): New specialization.
3341 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3343 2006-03-28 Marek Safar <marek.safar@seznam.cz>
3345 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3347 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3349 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3350 be now EnumConstants only.
3352 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3354 * attribute.cs, driver.cs: Reset more caches.
3356 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3358 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3360 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3362 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3363 for easier reuse. Updated all overrides.
3364 (IntegralConstant): New base class for all integral constants.
3365 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3366 of the constant range, report custom error.
3367 (UIntConstant.Reduce): Fixed uint conversion.
3369 * ecore.cs, literal.cs: Reduce updates.
3371 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3375 * class.cs (Constructor.Define): Removed extra if for default ctors.
3376 A patch from Atsushi Enomoto.
3378 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3380 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3381 GetAttributableValue.
3383 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3386 * convert.cs (ImplicitConversionRequired): Error message moved to
3389 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3390 automatic implicit conversion of an output value.
3391 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3393 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3395 (TypeOf.GetAttributableValue): Add extra handling for object type.
3397 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3398 special error message.
3400 2006-03-25 Marek Safar <marek.safar@seznam.cz>
3402 * class.cs (Constructor.Emit): Don't crash when struct ctor is
3404 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3405 compatible with MS runtime.
3407 2006-03-23 Marek Safar <marek.safar@seznam.cz>
3409 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3410 attribute arguments here.
3412 * class.cs (Indexer.Define): The check was moved to attribute class.
3414 2006-03-22 Marek Safar <marek.safar@seznam.cz>
3416 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3417 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3420 2006-03-22 Raja R Harinath <rharinath@novell.com>
3422 Support ParameterDefaultValueAttribute in gmcs. Also applied to
3423 mcs to keep code differences small.
3424 * attribute.cs (Attribute.GetParameterDefaultValue): New.
3425 * typemanager.cs (parameter_default_value_attribute_type): New.
3426 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
3429 2006-03-21 Marek Safar <marek.safar@seznam.cz>
3431 * expression.cs (StringConcat.Append): Reverted back to no warning state.
3433 2006-03-21 Marek Safar <marek.safar@seznam.cz>
3435 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3437 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3440 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
3442 * doc-bootstrap.cs : fix build.
3444 2006-03-20 Marek Safar <marek.safar@seznam.cz>
3446 * expression.cs (StringConcat.Append): Issue a warning when empty string
3449 2006-03-20 Marek Safar <marek.safar@seznam.cz>
3451 * assign.cs (CompoundAssign.ResolveSource): Removed.
3453 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3456 * class.cs (TypeContainer.FindMethods): Removed.
3457 (TypeContainer.CheckMemberUsage): Made static.
3459 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3461 * constant.cs (CheckRange): Removed unused type argument.
3462 (CheckUnsigned): Removed unused type argument.
3464 * cs-parser.jay: Updated after MemberAccess clean up.
3465 Uses Length for empty string test.
3467 * cs-tokenizer.cs: Uses Length for empty string test.
3468 (IsCastToken): Made static.
3469 (is_hex): Made static.
3470 (real_type_suffix): Made static.
3472 * decl.cs (SetupCache): Made static.
3473 (OnGenerateDocComment): Removed unused ds argument.
3475 * delegate.cs (VerifyDelegate): Removed unused argument.
3477 * doc.cs: Uses Length for empty string test.
3479 * driver.cs: Uses Length for empty string test.
3481 * enum.cs (IsValidEnumType): Made static
3483 * expression.cs (EnumLiftUp): Removed unused argument.
3484 (ResolveMethodGroup): Ditto.
3485 (BetterConversion): Ditto.
3486 (GetVarargsTypes): Ditto.
3487 (UpdateIndices): Ditto.
3488 (ValidateInitializers): Ditto.
3489 (MemberAccess.ctor): Ditto.
3490 (GetIndexersForType): Ditto.
3492 * flowanalysis.cs: (MergeFinally): Removed unused argument.
3494 * iterators.cs: Updated after MemberAccess clean up.
3496 * location.cs: Uses Length for empty string test.
3498 * namespace.cs: Uses Length for empty string test.
3500 * report.cs (CheckWarningCode): Made static.
3502 * statement.cs (LabeledStatement): Removed unused argument.
3504 * typemanager.cs (FilterNone): Removed.
3506 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3508 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3511 * class.cs: Updated.
3513 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3515 * cs-parser.jay.cs: __arglist is not allowed for delegates.
3517 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3521 * expression.cs (VerifyArgumentsCompat): Reverted to double error
3522 reporting, it's more tricky than I thought.
3524 2006-03-18 Marek Safar <marek.safar@seznam.cz>
3528 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
3530 (AnonymousMethod.ImplicitStandardConversionExists): New method.
3531 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3532 Add more error reporting; Fixed issue with params.
3534 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3536 * cs-parser.jay: AnonymousMethod requires host container.
3538 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3540 2006-03-18 Raja R Harinath <harinath@gmail.com>
3542 * class.cs: Change 'TypeContainer ds' constructor argument to
3543 'DeclSpace parent'. Some classes were missed below due to
3544 different naming convention.
3546 * class.cs (MemberCore.Parent): Delete. This makes the
3547 ParentContainer changes below enforceable by the compiler.
3549 Treat pointers to enclosing declaration space as 'DeclSpace', not
3551 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3552 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3554 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3556 (Block.AddThisVariable): Likewise.
3557 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3558 (AbstractPropertyEventMethod.Emit): Likewise.
3559 (AbstractPropertyEventMethod.EmitMethod): Likewise.
3560 (GetMethod.Define, SetMethod.Define): Likewise.
3561 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3562 (DelegateMethod.EmitMethod): Likewise.
3564 Fix regression test-partial-13.cs.
3565 Rationalize use of PartialContainer. Ensure that the partial
3566 class semantics can be tied to type-correctness, i.e., any
3567 violation will cause a compile error.
3568 * class.cs, const.cs: Access all fields that belong to class
3569 TypeContainer via ParentContainer. Arguments of EmitContexts and
3570 Resolve()-like functions still use 'Parent'.
3572 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3573 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3574 (PropertyMethod.CheckModifiers): Remove unused argument.
3575 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3578 2006-03-17 Raja R Harinath <harinath@gmail.com>
3580 Make semantics of PartialContainer simpler.
3581 * decl.cs (DeclSpace.IsPartial): Remove.
3582 * class.cs (TypeContainer.IsPartial): Likewise.
3583 (TypeContainer..ctor): Set PartialContainer to point to self.
3584 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3585 (TypeContainer.FindNestedType): Likewise.
3586 (MemberCore.ParentContainer): Simplify. Remove deprecation.
3588 2006-03-17 Marek Safar <marek.safar@seznam.cz>
3590 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3592 2006-03-15 Marek Safar <marek.safar@seznam.cz>
3594 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3597 2006-03-15 Marek Safar <marek.safar@seznam.cz>
3599 * class.cs (Operator.Define): An error for base conversion was not
3602 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
3604 * iterator.cs : yield break is allowed in try statement which has
3605 catch clauses. Fixed bug #77767.
3607 2006-03-13 Marek Safar <marek.safar@seznam.cz>
3609 A fix for #77593, #77574.
3611 * class.cs (MethodCore.CheckBase): Another if for operator.
3613 2006-03-09 Marek Safar <marek.safar@seznam.cz>
3615 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3618 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3619 (DelegateCreation.ImplicitStandardConversionExists): New method for just
3622 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3625 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3626 Updated after another emitcontext usage was clean up. It should help us to
3627 synchronize with gmcs easier.
3629 2006-03-04 Marek Safar <marek.safar@seznam.cz>
3633 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3634 (Event.Define): ditto
3635 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3637 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3638 Removed redundant code and set NewSlot for Invoke method too.
3640 * parameter.cs (Parameters.ctor): Add custom, type ctor.
3641 (Parameters.MergeGenerated): New method. Use this method when you merge
3642 compiler generated argument with user arguments.
3644 2006-03-03 Marek Safar <marek.safar@seznam.cz>
3646 * attribute.cs (ResolveAsTypeTerminal): Removed.
3648 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3649 specialization for predefined types; 30% speed up.
3650 Finally placed obsolete check to right place.
3651 (Expression.ResolveType): Removed.
3653 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3654 Updated after ResolveType was removed.
3656 * expression.cs (Cast.ctor): Check void cast.
3657 (Binary.ResolveAsTypeTerminal): Is never type.
3658 (Conditional.ResolveAsTypeTerminal): Is never type.
3660 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3662 2006-03-01 Raja R Harinath <rharinath@novell.com>
3665 * expression.cs (ParameterReference.DoResolveBase): Change return
3667 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3671 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3674 * typemanager.cs (GetFullNameSignature): Don't nullref on
3675 protected accessors.
3677 2006-02-27 Marek Safar <marek.safar@seznam.cz>
3679 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3680 these two separated members to simplify the code.
3681 (Attribute.Resolve): Refactored to use new fields and methods.
3682 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3683 implemented obsolete attribute checking.
3684 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3685 implemented obsolete checking again. It look line never ending quest ;-)
3686 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3688 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3690 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3692 *class.cs (Property.Define): Add RegisterProperty call.
3694 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3695 argument groups (only 2).
3697 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3698 encoding expression to arguments.
3699 (Expression.ExprClassToResolveFlags): Just turned to property.
3701 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3702 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3703 optimized as well as implemented support for zero-length attributes.
3705 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3706 Add caching of PropertyInfo's.
3708 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3710 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3711 error multiple times.
3713 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3715 New partial class implementation.
3716 A fix for #77027, #77029, #77403
3718 * attribute.cs (Attributable): Made attributes protected.
3720 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3721 the replacements of ClassPart and PartialContainer.
3722 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3723 (TypeContainer.AddInterface): Ditto.
3724 (TypeContainer.AddPartial): The main method for partial classes. It checks
3725 for errors and merges ModFlags and attributes. At the end class is added to
3727 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3729 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3730 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3731 from the rest of partial classes.
3732 (TypeContainer.GetClassBases): Simplified.
3733 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3735 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3736 (TypeContainer.HasExplicitLayout): Uses Flags now.
3737 (PartialContainer): Removed.
3738 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3739 (StaticClass): Was merged with Class.
3740 (Class.GetClassBases): class and static class bases are verified here.
3741 (Class.TypeAttr): Added static attributes when class is static.
3742 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3743 (MemberBase): In some cases we need to call parent container for partial
3744 class. It should be eliminated but it's not easy now.
3746 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3748 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3749 partial classed to accumulate class comments.
3750 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3752 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3754 * driver.cs (MainDriver): Tree.GetDecl was removed.
3756 * modifiers.cs (Modifiers): Add partial modifier.
3758 * tree.cs (Tree.decl): Removed.
3759 (RootTypes): Started to use this class more often for root types
3762 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3766 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3767 external interface does not have an attribute.
3769 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3771 Another prerequisites for new partial classs implementation.
3773 * attribute.cs (Attribute.Equal): Implemented.
3774 (Attribute.Emit): Changed as attributes can be applied more than twice.
3775 (Attributes.Emit): Check for duplicate attributes here.
3777 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3778 as a parameter, clean-up.
3780 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3784 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3785 contains obsolete attribute check which can in some cases look for base
3786 type of current class which is not initialized yet.
3787 (TypeContainer.BaseType): Replacement of ptype.
3789 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3791 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3793 First of prerequisites for new partial classs implemention.
3795 * attribute.cs (Attributable): Extended by ResolveContext;
3796 Attributes finally have correct context for resolving in all cases.
3797 (AttachTo): Attribute owner is assigned here.
3799 * codegen.cs (IResolveContext): Introduce new interface to hold
3800 all information needed in resolving phase.
3801 (EmitContext): Implements IResolveContext; more clean-up needed here.
3803 * decl.cs (MemberCore): Implemented IResolveContext.
3805 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3806 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3807 parameter.cs, statement.cs, tree.cs, typemanager.cs:
3808 Refactored to use new IResolveContext instead of EmitContext; cleanup
3810 2006-02-06 Miguel de Icaza <miguel@novell.com>
3812 * codegen.cs (EmitScopeInitFromBlock): check here the
3813 capture_context, there is no need to make two calls to the
3816 * anonymous.cs: Add some debugging messages that might help me
3817 track other instances of this problem in the future (the
3818 regression of test 467).
3820 * cs-parser.jay: track the variable block, as we need to initalize
3821 any captured variables declared in this block for the "catch"
3822 portion of the "Try" statement.
3824 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3825 scope initialization for captured variables.
3827 Also, move the emit for the variables after the block location has
3830 2006-02-06 Marek Safar <marek.safar@seznam.cz>
3832 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3834 2006-02-02 Miguel de Icaza <miguel@novell.com>
3836 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3837 commit yesterday, the initialization for the roots is necessary.
3838 What is not necessary is the scope activation.
3840 2006-02-02 Raja R Harinath <rharinath@novell.com>
3842 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3843 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3845 (Argument.Resolve): Remove CS0206 checks.
3847 2006-02-01 Miguel de Icaza <miguel@novell.com>
3849 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3850 scopes for all the roots, the scopes will now be emitted when the
3851 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
3853 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3854 code. This reduces a lot of existing cruft.
3856 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3857 that the ScopeInfo is generated as we enter the scope, not at the
3858 time of use, which is what we used to do before.
3860 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3861 every time a Block is about to be emitted if we have a
3864 2006-02-01 Raja R Harinath <rharinath@novell.com>
3866 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3868 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3870 * typemanager.cs (cons_param_array_attribute): Make private.
3871 (Reset): Set it to null.
3872 (InitCoreHelpers): Don't initialize it.
3873 (ConsParamArrayAttribute): New. Initialize it as needed.
3874 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3876 2006-01-31 Miguel de Icaza <miguel@novell.com>
3878 * expression.cs: There might be errors reported during the
3879 selection of applicable methods. If there are errors, do not
3880 continue execution as it will lead the compiler to crash.
3882 2006-01-30 Miguel de Icaza <miguel@novell.com>
3884 * expression.cs: Member access is not allowed on anonymous
3885 methods. Fixes #77402.
3887 2006-01-30 Raja R Harinath <rharinath@novell.com>
3890 * cs-parser.jay (VariableDeclaration): Don't set
3891 current_array_type to null.
3892 (field_declaration, event_declaration, declaration_statement):
3893 Set it to null here.
3895 2006-01-28 Raja R Harinath <harinath@gmail.com>
3897 * typemanager.cs (GenericParameterPosition): New.
3900 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
3902 * doc.cs : To process "include" elements, first we should create
3903 another list than XmlNodeList, because it could result in node
3904 removal, which could result in that the XmlNodeList gives up
3907 (Also made code identical to gmcs again.)
3909 2006-01-25 Miguel de Icaza <miguel@novell.com>
3911 * ecore.cs: Introduce an error report that we were not catching
3912 before, if not silent, we must report the error. Gonzalo ran into
3915 2006-01-23 Miguel de Icaza <miguel@novell.com>
3917 A fix for bug: #76957
3919 * iterators.cs (MoveNextMethod.CreateMethodHost): call
3920 ComputeMethodHost before creating the method, this is a new
3923 * anonymous.cs (AnonymousContainer): Now we track all the scopes
3924 that this method references (RegisterScope). The actual scope
3925 where the method is hosted is computed with the ComputeMethodHost
3926 before we create the method.
3928 Moved the Deepest routine here.
3930 (AnonymousContainer.ComputeMethodHost): New routine used to
3931 compute the proper ScopeInfo that will host the anonymous method.
3933 (ScopeInfo): Deal with multiple roots. The problem was that we
3934 did not have a unique root where all ScopeInfos could be hanged
3935 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
3938 Remove AdjustMethodScope which is now computed at the end. Remove
3939 LinkScope which did a partial link, instead link all ScopeInfos
3940 before code generation from the new "LinkScopes" routine.
3942 Simplify all the Add* routines as they no longer need to maintain
3943 the tree, they just need to record that they are using variables
3946 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3947 routines to produce the forest of ScopeInfo trees.
3949 * class.cs (TypeContainer.AppendMethod): This is just like
3950 AddMethod, but ensures that an interface implementation method
3951 (IEnumerable.XXX) is not inserted at the beginning of the queue of
3952 methods, but at the end.
3954 We use this functionality to ensure that the generated MoveNext
3955 method in the iterator class is resolved/emitted before the
3956 enumerator methods created.
3958 This is required because the MoveNext method computes the right
3959 ScopeInfo for the method. And the other methods will eventually
3960 need to resolve and fetch information computed from the anonymous
3963 2006-01-21 Raja R Harinath <harinath@gmail.com>
3964 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3967 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3969 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3970 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3972 2006-01-18 Raja R Harinath <rharinath@novell.com>
3974 Fix #76656, cs0231-2.cs.
3975 * cs-parser.jay (formal_parameter_list): Make error case catch
3977 (parenthesized_expression_0): Add CS1026 check.
3978 (invocation_expression): Remove unused { $$ = lexer.Location }.
3980 2006-01-17 Raja R Harinath <rharinath@novell.com>
3983 * cs-parser.jay (statement_expression): Don't list out the
3984 individual statement-expressions. Convert syntax error into
3987 2006-01-16 Raja R Harinath <rharinath@novell.com>
3990 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3991 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
3992 CheckIntermediateModification.
3993 (FieldExpr.DoResolve): Add new two-argument version that
3994 allows us to resolve the InstanceExpression as an lvalue.
3995 The one-argument variant is now just a wrapper.
3996 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3997 Resolve the lhs as an lvalue if the it has a value type.
3998 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3999 from Assign.DoResolve.
4000 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4001 resolved as an lvalue.
4002 (PropertyExpr.DoResolve): Update.
4003 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4004 has a value type. Move CS1612 check here from
4005 CheckIntermediateModification.
4006 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4007 * expression.cs (EmptyExpression.OutAccess): New. Used as the
4008 'right_side' of a ResolveLValue on an 'out' argument.
4009 (EmptyExpression.LValueMemberAccess): New. Used as the
4010 'right_side' of a propagated ResolveLValue on a value type.
4011 (LocalVariableReference.DoResolveBase): Recognize
4012 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4014 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4015 EmptyExpression.Null.
4017 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
4019 * typemanager.cs : added IsGenericParameter(). In mcs it always
4021 * doc.cs : for generic parameters, use GenericParameterPosition,
4024 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
4026 * expression.cs: Fix Console.WriteLine ((this = x).foo);
4028 2006-01-12 Miguel de Icaza <miguel@novell.com>
4030 This fixes the problem where we used ldfld instead of ldflda to
4031 load the "THIS" pointer on captured parameters, when THIS is a
4032 value type. See bug #77205.
4034 * iterators.cs (CapturedThisReference.Emit): Pass false to
4035 EmitThis (we do not need the address).
4037 * codegen.cs (EmitThis): it needs to know whether we need the
4038 address of `this' or not. This is used by value types.
4040 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4041 every other call passes false.
4043 2006-01-12 Raja R Harinath <rharinath@novell.com>
4046 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4048 * expression.cs (Invocation.OverloadResolve): Update.
4049 (Invocation.DoResolve): Avoid double resolution of invocation.
4051 2006-01-11 Raja R Harinath <rharinath@novell.com>
4054 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4055 unary negation of floating point types as 0-expr; negation cannot
4056 overflow in floating point types.
4059 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4060 on operands of 'void' type.
4063 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4064 and ExclusiveOr for boolean constants too.
4066 2006-01-09 Raja R Harinath <rharinath@novell.com>
4069 * expression.cs (Invocation.OverloadResolve): Replace reflected
4070 override methods with their base virtual methods, rather than
4072 * typemanager.cs (TypeManager.GetOverride): New.
4074 2006-01-05 Jb Evain <jbevain@gmail.com>
4076 * class.cs (Property.Define, Indexer.Define): do not tag the
4077 properties as SpecialName | RTSpecialName.
4079 2006-01-04 Miguel de Icaza <miguel@novell.com>
4081 * class.cs (MethodCore.IsDuplicateImplementation): This method was
4082 doing a low-level comparission of parameter types. It was lacking
4083 a check for __argslist.
4085 2005-12-30 Miguel de Icaza <miguel@novell.com>
4087 * expression.cs (ParameterReference.DoResolveBase): Allow
4088 reference parameters if they are local to this block.
4090 This allows the ref and out parameters of a delegate to be used in
4091 an anonymous method, for example:
4093 delegate void set (out int x);
4095 set s = delegate (out int x){
4099 This is used by functionality introduced late in the C# language.
4101 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4102 method that take ref and out parameters.
4104 Fixes #77119 which was a late change in the spec.
4106 2005-12-23 Miguel de Icaza <miguel@novell.com>
4108 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4109 parent if its the same scope. Fixes #77060.
4111 2005-12-21 Miguel de Icaza <miguel@novell.com>
4113 * driver.cs: Report the case of no source files and no -out:
4116 2005-12-20 Raja R Harinath <rharinath@novell.com>
4119 * expression.cs (ComposedCast.GetSignatureForError): Define.
4121 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4125 * namespace.cs (NamespaceEntry): Add extern_aliases as a
4126 ListDictionary, to contain the ExternAliasEntry entries (in
4127 addition to the NamespaceEntry.aliases hashtable). This field is
4128 shared between the original entry and its doppelganger (bodyless
4130 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4131 extern_aliases field.
4132 (NamespaceEntry.Lookup): Move the IsImplicit check after the
4133 lookup in extern_aliases.
4135 2005-12-16 Raja R Harinath <rharinath@novell.com>
4138 * class.cs (TypeContainer.Mark_HasEquals): New.
4139 (TypeContainer.Mark_HasGetHashCode): New.
4140 (ClassPart): Override them.
4141 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4144 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4145 'parent' argument to the base constructor.
4147 Remove all mention of TypeContainer from decl.cs.
4148 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4149 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4150 (DeclSpace.DeclSpace): Likewise.
4151 (DeclSpace.DefineMembers): Remove unused argument.
4152 * cs-parser.jay (pop_current_class): Update to changes. Simplify
4153 debugging check -- we don't care if the debug code throws an
4154 InvalidCastException instead of an InternalErrorException.
4155 * class.cs (TypeContainer.DefineMembers): Update to changes.
4156 (TypeContainer.DoDefineMembers): Likewise.
4157 (TypeContainer.GetMethods): Likewise.
4158 (PropertyMember.Define): Likewise.
4159 (MemberBase.Parent): New property that forwards to
4160 MemberCore.Parent, but ensures that we get a TypeContainer.
4161 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4162 (RootContext.PopulateTypes): Likewise. Remove special case code
4163 for !RootContext.StdLib: DefineMembers is idempotent.
4165 2005-12-14 Miguel de Icaza <miguel@novell.com>
4167 * convert.cs (ExplicitConversionCore): Check the return value from
4168 ExplicitConversionCore which can return null on failure. Fixes #76914
4170 2005-12-13 Marek Safar <marek.safar@seznam.cz>
4172 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4174 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
4176 * doc.cs : The search for referenced namespace was insufficient to
4177 get global one as it used to do. Fixed bug #76965.
4179 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
4181 * doc.cs : check name in cref in the last phase that whether it is
4184 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4186 * cs-tokenizer.cs : reverted the latest change: it somehow broke
4189 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4191 * doc.cs : so it turned out that we cannot skip override check for
4192 interface members. Fixed bug #76954.
4194 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4196 * cs-tokenizer.cs : fixed bug #75984:
4197 - #warning and #error should not be handled when the source line
4199 - #line is not checked strictly when the source line is disabled.
4200 - #define and #undef is on the other hand checked strictly at any
4203 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
4205 * cs-tokenizer.cs : missing Location (actually, filename) in one of
4208 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4210 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4212 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4214 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4215 (FieldBase.Initializer): Initializer is now optional.
4216 (EventField.Define): Only event field can have initializer.
4218 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4220 * const.cs (Const): Reuse initializer.
4222 * cs-parser.jay: Updated after FieldBase changes.
4223 Added current_array_type to simplify array initializers.
4225 * ecore.cs (NullCast.IsDefaultValue): Implemented.
4227 * expression.cs, iterators.cs: Updated.
4229 * namespace.cs (NamespaceEntry): Made UsingFound private.
4231 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4233 * parameterCollection.cs: Obsolete, removed.
4234 * parser.cs: Obsolete, removed.
4236 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4239 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4241 * enum.cs (Enum.Define): Set obsolete context here.
4243 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
4246 - FindDocumentedMember() now expects 1) paramList as null
4247 when "we don't have to check the number of parameters" and
4248 2) Type.EmptyTypes when "there is no arguments".
4249 - Introduced FoundMember struct to hold the exact type which was
4250 used to find the documented member (the above change broke
4251 test-xml-044; it might be better just to use DeclaringType than
4252 what MS does, like this change does, but it depends on usage.)
4254 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
4256 * doc.cs : documented member might be from DeclaringType for nested
4257 types. Fixed bug #76782.
4259 2005-12-03 Ben Maurer <bmaurer@ximian.com>
4261 * anonymous.cs: Have the param code handle leaving copies on the
4262 stack etc. Allows anonymous params to take part in the assignment
4263 code (++, +=, etc). Fixes bug #76550
4265 * expression.cs: Handle the prepare_for_load/leave_copy by passing
4266 it down to the anon code.
4268 * iterators.cs: Use dummy var here
4270 * codegen.cs: Handle new vars
4272 2005-12-01 Marek Safar <marek.safar@seznam.cz>
4275 * class.cs (MethodData.Define): Set proper Obsolete context.
4277 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4279 (FieldExpr.DoResolve): Ditto.
4281 2005-12-01 Marek Safar <marek.safar@seznam.cz>
4284 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4285 parent is not obsolete.
4287 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
4289 * doc.cs : (FindDocumentedMember) find parameterless members first
4290 and get CS0419 in the early stage. Fixed first case of bug #76727.
4292 2005-11-30 Marek Safar <marek.safar@seznam.cz>
4295 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4296 no error was reported.
4298 *expression.cs (Binary.DoResolve): left can be null.
4300 2005-11-22 Marek Safar <marek.safar@seznam.cz>
4303 * class.cs (MethodData.Emit): Parameters should be labeled first.
4305 2005-11-21 Marek Safar <marek.safar@seznam.cz>
4308 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4310 2005-11-18 Marek Safar <marek.safar@seznam.cz>
4312 * attribute.cs (AreParametersCompliant): Moved to Parameter.
4314 * class.cs (MethodCore): Parameter clean up.
4315 (IMethodData): Added ParameterInfo.
4316 (MethodData): Parameter clean up.
4317 (Indexer.Define): Parameter clean up.
4329 * typemanager.cs: Parameter clean up.
4331 * delegate.cs (Define): Get rid of duplicated code.
4333 * expression.cs (ParameterReference): Removed useless parameters
4335 (Invocation): Ditto.
4337 * parameter.cs (ParamsParameter): New class, params specialization.
4338 (ArglistParameter): Attemp to separate arglist.
4339 (Parameter): Refactored to be reusable and faster.
4340 (Parameter.Modifier): Made understandable.
4341 (Parameters): Changed to be used as a class for `this' assembly
4342 parameters. Refactored to use new specialized classes.
4344 * support.cs (ParameterData): Added Types property.
4345 (InternalParameters): Deleted.
4347 2005-08-20 Martin Baulig <martin@ximian.com>
4349 Merging this patch from GMCS to fix #75867.
4351 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4352 scope if we don't already have it.
4354 2005-11-17 Martin Baulig <martin@ximian.com>
4357 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4358 inherit the scope from our parent. Fixes #76653.
4360 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4362 * doc.cs : the previous patch does not actually fix the bug.
4363 PropertyInfo override check is now implemented and really fixed it.
4364 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4366 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4368 * doc.cs : apply "override filter" also to properties.
4371 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4373 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4374 no need to check overrides. For classes, omit those results from
4375 interfaces since they must exist in the class. Fixed bug #76726.
4377 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4379 * typemanager.cs : (GetFullNameSignature) differentiate indexers
4380 with different parameters. Fixed the second problem in #76685.
4382 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4384 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4385 get expected 'protected' access in CheckValidFamilyAccess()).
4388 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4390 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4391 Fixed bug #76705. CS1569 was incorrectly commented out.
4393 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
4395 * doc.cs : use Invocation.IsOverride() to do real override check.
4396 * expression.cs : made Invocation.IsOverride() internal.
4398 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
4400 * doc.cs : use TypeManager.FindMembers() instead of (possible)
4401 TypeBuilder.FindMembers() and filter overriden base members out.
4404 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4406 * doc.cs : ref/out parameters are represented as '@' (instead of
4407 '&' in type FullName). Fixed bug #76630 (additionally crefs).
4409 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4411 * doc.cs : when there was no '.' in cref to methods in doc comment,
4412 then parameters were missing in the output. Fixed bug #76691.
4414 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4416 * driver.cs : don't output docs when there is an error.
4419 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4422 Now it should detect indexers. Fixed primary concern in bug #76685.
4423 Fixed CS0419 message to not show the identical member signature in
4426 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
4428 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4429 instead of Type.FindMembers() since it does not handle events.
4432 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
4434 * codegen.cs: Fixed typo (speficied -> specified).
4436 2005-11-11 Marek Safar <marek.safar@seznam.cz>
4439 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4441 2005-11-11 Marek Safar <marek.safar@seznam.cz>
4443 * attribute.cs: Changed error message.
4445 * cs-tokenizer.cs: One more check.
4447 2005-11-10 Marek Safar <marek.safar@seznam.cz>
4449 * statement.cs (Block.Resolve): Ignore empty statement.
4451 2005-11-10 Marek Safar <marek.safar@seznam.cz>
4453 * report.cs: Made error/warning methods more strict to avoid
4456 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4457 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4458 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4459 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4461 2005-11-08 Marek Safar <marek.safar@seznam.cz>
4463 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4464 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4466 * class.cs (TypeContainer.IsComImport): New property.
4467 (Constructor.Define): Create proper ctor for ComImport types.
4469 * expression.cs (New.CheckComImport): Fixed.
4471 2005-11-07 Miguel de Icaza <miguel@novell.com>
4473 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4474 that a parameter has been captured does not mean that we do not
4475 have to do the rest of the processing. This fixes the second part
4476 of #76592. If there was another anonymous method capturing
4477 values in the past, the Scope would never be set for the second
4478 method that captured the same parameter.
4480 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4481 properly manipulate the stack. Second part of fix for #76592.
4483 * expression.cs (New): Add support for invoking "new" on
4484 interfaces that have been flagged with the ComImport attribute and
4485 the CoClass. Fixes #76637
4487 * statement.cs (Try.DoEmit): When a variable is captured, do not
4488 try to emit the vi.LocalBuilder variable as it has been captured.
4489 Create a temporary variable and store the results on the
4490 FieldBuilder. Fixes #76642
4492 2005-11-07 Marek Safar <marek.safar@seznam.cz>
4494 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4496 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4498 * expression.cs (Binary.DoResolve): Added && optimalization.
4500 * typemanager.cs (AddUserType): Removed useless argument.
4502 2005-11-04 Marek Safar <marek.safar@seznam.cz>
4504 * statement.cs (Block.variables): Uses ListDictionary.
4506 2005-11-03 Marek Safar <marek.safar@seznam.cz>
4509 * class.cs (PartialContainer.EmitType): Customized to emit
4510 security attributes.
4511 (ClassPart.ApplyAttributeBuilder): Transform security attribute
4512 for partial classes.
4514 2005-11-03 Marek Safar <marek.safar@seznam.cz>
4517 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4518 access has to be fixed.
4520 * typemanager.cs (IsUnmanagedType): Wrong common field type.
4522 2005-11-01 Marek Safar <marek.safar@seznam.cz>
4525 * ecore.cs (NullCast.Reduce): Implemented.
4527 * expression.cs (ArrayCreation.CheckIndices): Correcly check
4530 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4532 (Foreach.Resolve): Catch null properly.
4534 2005-10-29 Marek Safar <marek.safar@seznam.cz>
4536 * cs-tokenizer.cs: Warning text fix.
4538 * driver.cs: AllWarningNumbers exposed on public interface.
4540 * report.cs (): Reviewed warning numbers.
4541 (IsValidWarning): Use binary search.
4543 2005-10-29 Marek Safar <marek.safar@seznam.cz>
4545 * driver.cs: Implemeted resource visibility.
4546 (Resources): New class for code sharing between /res: and
4549 2005-10-28 Marek Safar <marek.safar@seznam.cz>
4552 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4555 * convert (Convert.ImplicitReferenceConversion): NullCast holds
4558 * ecore.cs (NullCast): Child is contant only.
4560 * literal.cs (NullLiteral.Reduce): null can be converted to any
4563 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
4565 * driver.cs: Use Encoding.Default as default code page instead
4568 2005-10-27 Raja R Harinath <rharinath@novell.com>
4571 * expression.cs (Invocation.Error_InvalidArguments): Handle
4572 __arglist parameters.
4573 (Invocation.VerifyArgumentsCompat): Likewise.
4574 * support.cs (ReflectionParameters.GetSignatureForError): Print
4575 __arglist parameters.
4576 (InternalParamters.GetSignatureForError): Likewise.
4577 * parameter.cs (Parameters.GetSignatureForError): Likewise.
4579 2005-10-26 Marek Safar <marek.safar@seznam.cz>
4581 * attribute.cs (GetPropertyValue): Made public.
4583 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4585 Add new property WrapNonExceptionThrows to handle 2.0 assembly
4587 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4590 * driver.cs: Reflect method name change.
4592 * statement.cs (Try.Resolve): Warn when try has both general
4595 * typemanager.cs: runtime_compatibility_attr_type new predefined
4598 2005-10-26 Raja R Harinath <harinath@gmail.com>
4601 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4602 treat it as an empty parameter list.
4604 2005-10-26 Raja R Harinath <rharinath@novell.com>
4607 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
4608 ResolveAsTypeStep silent.
4609 * statement.cs (Block.AddConstant): Mark block as used.
4610 (Block.ResolveMeta): Avoid piling on error messages
4611 if a constant initializer resolution fails.
4613 2005-10-25 Raja R Harinath <rharinath@novell.com>
4615 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4617 (NamespaceEntry.VerifyAllUsing): New.
4618 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
4619 behaviour. Delegates actual resolution of alias to ...
4620 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
4621 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4623 * driver.cs (Driver.MainDriver): Update.
4625 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4626 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4628 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4630 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4631 RootNamespace.DefineNamespacesForAll.
4633 2005-10-24 Raja R Harinath <harinath@gmail.com>
4635 * typemanager.cs (assemblies, external_aliases, modules)
4636 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4637 (ComputeNamespaces, GetRootNamespace): Remove extra staging
4638 overhead. Move resposibility ...
4639 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
4640 * driver.cs, attribute.cs, codegen.cs: Update to changes.
4642 2005-10-23 Raja R Harinath <harinath@gmail.com>
4644 * namespace.cs (RootNamespace.all_namespaces): Renamed from
4645 cached_namespaces. Improve usage.
4646 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4647 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4648 Move from GlobalRootNamespace and simplify.
4649 (RootNamespace.Global): Make instance variable.
4650 (RootNamespace.RootNamespace): Add "alias name" parameter.
4651 (GlobalRootNamespace): Simplify drastically.
4652 (Namespace.Lookup): Don't use GetNamespace.
4653 * typemanager.cs (GetRootNamespace): Rename from
4654 ComputeNamespaceForAlias.
4655 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4657 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4659 * anonymous.cs (AnonymousContainer): Don't crash when container
4662 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4664 * expression.cs (Binary.DoResolve): Warn when comparing same
4667 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4670 * expression.cs (Binary.DoResolve): It looks like there are no
4671 convetsion rules in enum context.
4673 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4675 Add support for extern alias qualifiers.
4676 * typemanager.cs: Move some LookupTypeReflection code
4677 to namespace.cs, to have cleaner code. Added some methods
4678 to help us keep track of the extern aliased references.
4679 * driver.cs: Add suport for extern alias assemblies on command
4680 line and check for their warnings/errors. Also keep track of the
4681 extern aliased assemblies.
4682 * namespace.cs: Move the global functionality of Namespace
4683 to GlobalRootNamespace/RootNamespace. Now the global namespace
4684 is GlobalRootNamespace.Globa. Also the code moved from
4685 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
4686 Finally added LocalAliasEntry (AliasEntry before) and
4687 ExternAliasEntry, to handle alias statements.
4688 * cs-parser.jay: Add support in the grammar for extern alias
4690 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
4691 Update callings to Namespace (now in GlobalRootNamespace).
4693 2005-10-18 Raja R Harinath <rharinath@novell.com>
4696 * class.cs (TypeContainer.DefineType): Move updating of
4697 topological sort earlier in the code.
4698 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4700 2005-10-18 Marek Safar <marek.safar@seznam.cz>
4703 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4705 * constant.cs (Constant.TryReduce): Moved from Cast class.
4706 (Reduce): Made little bit more OO and fixed missing conversions.
4708 * ecore.cs (Reduce): Implemented.
4709 (Binary.EnumLiftUp): New method to upgrade values to enum values.
4711 * literal.cs (Reduce): Implemented.
4713 * class.cs: Reverted Miguel's wrong commit.
4715 2005-10-14 Miguel de Icaza <miguel@novell.com>
4717 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4719 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
4721 * cs-parser.jay, expression.cs : CS0214 was missing error location
4722 for constants. Fixed bug #76404.
4724 2005-10-11 Marek Safar <marek.safar@seznam.cz>
4727 * convert.cs (ExplicitConversionCore): Fixed object->enum
4730 2005-10-10 Raja R Harinath <rharinath@novell.com>
4732 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4734 (PropertyExpr.EmitCall): Likewise.
4735 * expression.cs (Invocation.EmitArguments): Handle case where
4737 (Invocation.EmitCall): Avoid allocating temporary variable if
4738 there are no arguments.
4740 2005-10-07 Raja R Harinath <rharinath@novell.com>
4743 * convert.cs (ImplicitConversionStandard): Move conversion of
4744 void* to arbitrary pointer types ...
4745 (ExplicitConversionStandard): .. here.
4746 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4747 error to always print typenames.
4749 2005-10-07 Raja R Harinath <rharinath@novell.com>
4751 * convert.cs (GetConversionOperator): Rename from
4752 GetConversionOperators. Move operator selection code from ...
4753 (UserDefinedConversion): ... here.
4755 2005-10-06 Marek Safar <marek.safar@seznam.cz>
4757 * convert.cs (ExplicitConversionCore): Removed duplicate enum
4760 2005-10-05 Marek Safar <marek.safar@seznam.cz>
4762 * assign.cs (Assign.DoResolve): Error method changed.
4764 * cfold.cs (DoConstantNumericPromotions): Error method changed.
4766 * const.cs (ResolveValue): Reset in_transit immediately.
4768 * constant.cs: Error method changed.
4770 * convert.cs: Removed useless location parameter.
4771 (ExplicitNumericConversion): Don't do double enum check.
4772 (ExplicitConversionCore): Renamed from ExplicitConversion.
4773 (ExplicitUnsafe): Extracted from ExplicitConversion.
4774 (ExplicitConversion): Uses for error reporting.
4776 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4778 (ResolveBoolean): Uses common error method.
4779 (CastToDecimal): Get rid of ec.
4780 (CastFromDecimal): Optimized.
4781 (ConvCast): Get rid of ec.
4783 * enum.cs (ResolveValue): Reset in_transit immediately.
4784 (Emit): Return after first error.
4786 * expression.cs: Convert changes.
4788 * literal.cs: Error method changed.
4790 * statement.cs: Error method changed.
4792 2005-10-03 Raja R Harinath <rharinath@novell.com>
4794 * support.cs (SeekableStreamReader.Position): Don't error out when
4795 the requested position is just beyond the end of the current
4798 2005-09-28 Raja R Harinath <rharinath@novell.com>
4800 * support.cs (SeekableStreamReader): Simplify drastically. Don't
4801 try to keep in sync with the byte count of the underlying Stream.
4802 However, this limits us to a window size of 2048 characters: i.e.,
4803 the maximum lookahead of our lexer/parser can be 2048 characters.
4805 2005-09-28 Marek Safar <marek.safar@seznam.cz>
4808 * driver.cs: Fix compilation files with full root path.
4810 2005-09-25 Miguel de Icaza <miguel@novell.com>
4812 * report.cs (SymbolRelatedToPreviousError): Format the output so
4813 it does not use an open parenthesis that is never closed.
4815 * driver.cs: Follow coding guidelines
4817 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4820 * const.cs (Const.ResolveValue): Check for assigning non-null
4821 value to reference type.
4823 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4825 * anonymous.cs: Implemented ExprClassName.
4827 * assign.cs (Assign.DoResolve): Don't chrash when type is not
4830 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4833 * class.cs (StaticClass.DefineContainerMembers): Report protected
4836 * codegen.cs: if(ed) PRODUCTION.
4838 * convert.cs (Error_CannotImplicitConversion): Better error
4841 * cs-parser.jay: More error checks.
4843 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4845 * driver.cs (CSCParseOption): Enabled wrong option check.
4847 * ecore.cs (Expression.ExprClassName): Turned to property.
4848 (MemberExpr.CheckIntermediateModification): For checking boxed
4849 value types modification.
4851 * statement.cs (Fixed.Resolve): Expression type must be
4852 convertible to fixed type.
4853 (CollectionForeach.GetEnumeratorFilter,TryType):
4854 Small refactoring for easier error checking.
4856 2005-09-26 Marek Safar <marek.safar@seznam.cz>
4858 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4861 * class.cs (GeneratedBaseInitializer): New class for customization
4862 compiler generated initializers.
4863 (MemberBase.DoDefine): Check Obsolete attribute here.
4864 (FieldMember.DoDefine): Ditto.
4866 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4869 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4870 (MemberCore.GetObsoleteAttribute): Removed argument.
4871 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4872 (MemberCore.CheckObsoleteType): New helper.
4876 * statement.cs: Updates after MemberCore changes.
4878 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4879 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4881 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4882 obsolete attribute for compiler construct.
4883 (As.DoResolve): Cache result.
4885 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4887 2005-09-26 Raja R Harinath <rharinath@novell.com>
4890 * expression.cs (This.VerifyFixed): In a value type T, the type of
4891 'this' is T&, iow, 'this' is either an out or ref parameter. In a
4892 value type R, 'this' is treated as a value parameter.
4894 2005-09-22 Miguel de Icaza <miguel@novell.com>
4896 * statement.cs (Lock): Use the TemporaryVariable class instead of
4897 manually using local variables as those do not work when variables
4900 * ecore.cs: Moved the TemporaryVariable class from being a nested
4901 class inside Foreach to be a public class that can be employed in
4904 2005-09-19 Marek Safar <marek.safar@seznam.cz>
4906 * cs-parser.jay: interface_accessors replaced by
4907 accessor_declarations.
4909 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4912 * statement.cs (GotoCase.Resolve): Convert null constant to
4914 (SwitchLabel.ResolveAndReduce): Ditto.
4915 (SwitchLabel.NullStringCase): Custom null stamp.
4916 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4918 typemanager.cs (CSharpSignature): Don't skip first argument
4921 2005-09-18 Miguel de Icaza <miguel@novell.com>
4923 * driver.cs: Set InEmacs based on the environment variable EMACS.
4925 * location.cs (InEmacs): in this mode, do not report column
4926 location as it confuses Emacs.
4928 2005-09-16 Marek Safar <marek.safar@seznam.cz>
4930 * cfold.cs, constant.cs, convert.cs, ecore.cs,
4931 expression.cs, iterators.cs, literal.cs: Store constants and
4934 * class.cs (MemberBase.ShortName): Pass location.
4936 * cs-parser.jay: Some location fixes.
4938 * ecore.cs (Expression.Location): Made virtual.
4940 2005-09-05 Miguel de Icaza <miguel@novell.com>
4942 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4943 if the underlying types are the same, otherwise we need to produce
4944 code that will do the proper cast.
4946 This was exposed by Marek's constant rewrite which produced
4947 invalid code for the call site:
4950 void Method (X v) {}
4954 This fixes test-49.cs
4956 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4958 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4959 Type/Object should be allowed as well. Fixed bug #75968.
4961 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4963 * expression.cs : (Binary.DoResolve): when one is enum constant and
4964 another is constant 0, then return enum one *as enum type*.
4967 2005-09-02 Raja R Harinath <rharinath@novell.com>
4969 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4973 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4974 flow-branching for LocalVariableReferences in case we were invoked
4975 from a MemberAccess.
4976 * expression.cs (LocalVariableReference.VerifyAssigned): New.
4978 (LocalVariableReference.DoResolveBase): ... this.
4979 (MemberAccess.Resolve): Do the check that was disabled during
4982 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4985 (PartialContainer.Create): check abstract/sealed/static strictly
4986 but abstract/sealed can exist only at one side. Fixed bug #75883.
4988 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
4991 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4992 specified, don't default to UnmanagedType.I4.
4994 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4996 * expression.cs : conditional operator should check possibly
4997 incorrect assign expression. Fixed bug #75946.
4999 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
5001 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5002 Reverting the change. gmcs is much complex than mcs on this matter.
5004 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
5006 * cs-tokenizer.cs : To read another token ahead of the actual
5007 consumption, use new SavedToken and cache token instead of moving
5008 back the stream with SeekableStreamReader (it seemed problematic).
5010 driver.cs : Thus use StreamReader directly.
5011 * support.cs : Thus removed SeekableStreamReader.
5013 2005-08-30 Raja R Harinath <rharinath@novell.com>
5016 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5017 (ScopeInfo.EmitScopeType): Use it to construct field names from
5018 names of captured locals.
5021 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5022 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5023 Pass 'target_type' to BoxedCast. Don't default to 'object'.
5024 (ExplicitConversion): Remove enum cases already handled by
5025 implicit conversion. Move implicit conversion check to the beginning.
5026 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5027 * expression.cs (ArrayCreation.EmitDynamicInitializers):
5028 Don't treat System.Enum as a struct.
5030 2005-08-30 Jb Evain <jbevain@gmail.com>
5032 * attribute.cs: handles as expression in parameters.
5034 2005-08-30 Raja R Harinath <rharinath@novell.com>
5037 * class.cs (TypeContainer.VerifyClsName): Don't use a
5038 PartialContainer when verifying CLS compliance.
5039 (AbstractPropertyEventMethod): Set Parent here, ...
5040 (PropertyMethod): ... not here.
5042 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
5044 * attribute.cs : escaped attribute name should not be allowed to be
5045 resolved (e.g. @class as classAttribute). Fixed bug #75930.
5047 2005-08-29 Raja R Harinath <rharinath@novell.com>
5050 * convert.cs (ImplicitStandardConversionExists): Allow zero also
5051 when converting a long constant to unsigned long.
5052 * expression.cs (Invocation.OverloadResolve): Add sanity check to
5053 detect where IsApplicable and VerifyArgumentsCompat disagree.
5055 2005-08-29 Raja R Harinath <rharinath@novell.com>
5056 and Carlos Alberto Cortez <carlos@unixmexico.org>
5059 * class.cs (TypeContainer.CanElideInitializer): New helper.
5060 (TypeContainer.EmitFieldInitializers): Use it to determine if we
5061 can safely emitting the initializer of a field.
5063 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5065 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5066 allowed inside a switch (without loop). Fixed bug #75433.
5068 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
5070 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5071 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5073 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5075 * driver.cs : kinda reverting the default encoding changes (not exact
5076 revert since I noticed that "codepage:reset" might not work fine).
5078 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5080 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5081 Location. Now getter and setter store location correctly.
5082 (errors/cs0111-12.cs now reports the expected location.)
5084 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5086 * driver.cs : Use default encoding on the environment.
5087 Removed (now that) extra parameter for SeekableStreamReader.
5088 * support.cs : (SeekableStreamReader) third .ctor() argument for
5089 StreamReader is not required (always true). preamble size could
5090 be acquired in simpler and safe way.
5092 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
5094 * cs-parser.jay: report CS0642 at warning level 3
5095 and report CS0642 for an if else statement also
5096 fixes bug #74745. Patch by John Luke (and a bit
5098 Removed extra CS0642 warning check for "while",
5100 * statement.cs: In Block.Resolve(), CS0642 check
5101 is reimplemented to check a sequence of an empty
5102 statement and a block.
5104 Both fix bug #66777.
5106 2005-08-24 Marek Safar <marek.safar@seznam.cz>
5108 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5109 detection until I fix it.
5111 * cs-tokenizer.cs: Changed error message.
5113 * cs-parser.jay: Fixed 2 error locations.
5115 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5116 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5119 * enum.cs (GetSignatureForError): Fixed.
5121 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5125 * typemanager.cs (RegisterProperty): Removed.
5127 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5129 2005-08-24 Raja R Harinath <rharinath@novell.com>
5132 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5133 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5135 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5137 * expression.cs : tiny fix is required for not warning positive ulong.
5140 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5142 * expression.cs : add CS0652 check for constant and integral
5143 expression. Fixed bug #53974.
5145 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5147 * expression.cs : in DoNumericPromotions(), check if there is implicit
5148 conversion overload for string (to check CS0034). Fixed bug #52492.
5150 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5152 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5154 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5156 * ecore.cs : report location when it is *not* Null.
5158 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5164 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5165 correctly. Fixed bug #75721.
5167 2005-08-23 Raja R Harinath <rharinath@novell.com>
5169 * support.cs (SeekableStreamReader.Position): Avoid an expensive
5170 loop that performs 'min (pos, char_count)'.
5173 * expression.cs (Unary.ResolveOperator): Don't discard implicit
5174 converted value in Operator.OnesComplement.
5176 2005-08-22 Ben Maurer <bmaurer@ximian.com>
5178 * anonymous.cs: If the anon method is pulled into a helper class,
5179 it needs to be `internal' not `private'. Fixes runtime behavior on
5182 2005-08-20 Martin Baulig <martin@ximian.com>
5184 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5185 scope if we don't already have it.
5187 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5188 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5191 2005-08-17 Marek Safar <marek.safar@seznam.cz>
5194 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5197 2005-08-16 Marek Safar <marek.safar@seznam.cz>
5199 The big constants rewrite
5200 Fix #75746, #75685 and more
5201 As a side effect saved 1MB for MWF ;-)
5203 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5204 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5205 enum based for corlib compilation.
5207 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5210 * class.cs (FixedField.Define): Use ResolveAsConstant.
5212 * const.cs (IConstant): Interface constants and enums.
5213 (Const.ResolveValue): New method for constant resolvning.
5214 (ExternalConstant): Constants from imported assemblies.
5216 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5217 conversion; like enums.
5218 (Constant.ToType): Converts this constant to different type.
5219 (Constant.Increment): Adds 1.
5221 * convert.cs (ImplicitConversionRequired): Simplified.
5223 * cs-parser.jay: Create EnumMember directly.
5225 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5227 * doc.cs (GenerateEnumDocComment): Removed.
5229 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5230 (ConvertIntLiteral): Removed.
5231 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5233 * enum.cs (EnumMember): Implement IConstant.
5234 (Enum.IsValidEnumConstant): Removed.
5235 (Enum.GetNextDefaultValue): Removed.
5236 (Enum.FindMembers): Updated.
5237 (Enum.GenerateDocComment): Iterate enum members.
5239 * expression.cs (Cast.TryReduce): Handle enums correctly.
5240 (New.Constantify): Made public.
5241 (MemberAccess.DoResolve): Removed contant specific if(s).
5243 * literal.cs (NullLiteral): Implement new abstract methods.
5245 * statement.cs (GotoCase.Resolve): Use new constant methods.
5246 (SwitchLabel.ResolveAndReduce): Use new constant methods.
5248 * typemanager.cs (LookupEnum): Removed.
5249 (IsEnumType): Fixed to work with corlib.
5250 (RegisterConstant): Removed.
5251 (LookupConstant): Removed.
5252 (GetConstant): Changed to work with IConstant.
5254 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
5256 * location.cs : Fixed overflown (>255) column number.
5258 2005-08-03 Raja R Harinath <rharinath@novell.com>
5260 First cut of the qualified-alias-member feature.
5261 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5263 * cs-parser.jay (DOUBLE_COLON): New token.
5264 (namespace_or_type_name): Add rule for recognizing
5265 qualified-alias-members.
5266 (primary_expression): Likewise.
5267 (element_access): Allow QualifiedAliasMember as a possible
5268 type-bearing expression.
5269 (local_variable_type, local_variable_pointer_type): Likewise.
5270 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
5271 aliases in the current and enclosing namespace declarations.
5272 (NamespaceEntry.UsingAlias): Add CS0440 warning.
5273 * decl.cs (MemberName.is_double_colon): New.
5274 (MemberName.MemberName): Add new constructor for alias-member.
5275 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5276 * expression.cs (QualifiedAliasMember): New expression type.
5278 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5280 * location.cs : it borked when no argument was specified.
5282 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5284 * location.cs : tiny ToString() format fix.
5286 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5288 * statement.cs : oops, it was missing.
5290 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5292 A set of fixes for precise line/column location.
5295 "token" field now holds a file/line "delta", a line number offset
5296 from the segment, and a column number. See also:
5297 http://lists.ximian.com/pipermail/mono-devel-list/2004-
5298 December/009508.html
5299 Removed static IsNull. Use instance IsNull property instead.
5301 For some tokens it stores Location. For Identifier it stores
5302 LocatedToken which is a pair of string name and location.
5303 Column numbers are adjusted only at getChar().
5305 Use Location.ToString() for reporting (it now contains column).
5307 Largely modified to use LocatedToken instead of
5308 string (IDENTIFIER), and to acquire Location from some tokens.
5309 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5310 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5312 Now MemberName holds Location. DeclSpace.ctor() receives Location
5313 as a parameter. Removed extra parameters to all derived classes.
5314 Replaced Location.IsNull() with instance property.
5315 * assign.cs, expression.cs :
5316 Added .ctor() overload that omits Location.
5318 Added "nameEscaped" flag that indicates the identifier was escaped
5319 in the source file. This fixes bug #57047.
5321 2005-08-02 Marek Safar <marek.safar@seznam.cz>
5323 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5324 New method, looking for lo-case imported cls type.
5326 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5329 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5331 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5333 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5335 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5337 Optimized to save 3.5 MB for SWF compilation.
5339 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5341 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5342 (PartialContainer.Create): Moved logic AddToContainer.
5343 (PartialContainer.MarkForDuplicationCheck): Shares name.
5345 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5348 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5350 (Namespace.GetSignatureForError): New method.
5352 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5353 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5355 2005-08-01 Raja R Harinath <rharinath@novell.com>
5358 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5359 member lookup rather than qualifier_type, since qualifier_type can
5362 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5364 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5367 2005-07-31 Miguel de Icaza <miguel@novell.com>
5369 * statement.cs: Copy the local exception into the exception
5370 captured local. Fixes 75674
5372 2005-07-31 Raja R Harinath <harinath@gmail.com>
5375 * expression.cs (Invocation.OverloadResolve): Don't report error
5376 CS1501 if error CS1502 has been reported.
5377 (New.DoResolve): Delegate CS1501 reporting to
5378 Invocation.OverloadResolve.
5381 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5382 invariant-meaning-in-block property in an enclosing block if
5385 2005-07-29 Marek Safar <marek.safar@seznam.cz>
5387 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5388 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5389 (Switch.CheckSwitch): Just save 50kb for SWF.
5391 2005-07-27 Martin Baulig <martin@ximian.com>
5393 * anonymous.cs (CaptureContext.AddField): Added
5394 `AnonymousContainer am' argument; compute its toplevel scope if
5395 it's not already computed. Fixes #75649.
5397 2005-07-26 Raja R Harinath <rharinath@novell.com>
5400 * class.cs (Constructor.Emit): Reset block to null if the block
5403 2005-07-25 Marek Safar <marek.safar@seznam.cz>
5405 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5407 2005-07-25 Marek Safar <marek.safar@seznam.cz>
5409 * class.cs (MethodData.Define): Check whether accessor implementing
5410 interface is public.
5412 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5414 2005-07-22 Marek Safar <marek.safar@seznam.cz>
5417 * namespace.cs (LookupType): Moved same type check to...
5419 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5422 2005-07-21 Raja R Harinath <rharinath@novell.com>
5424 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5425 already found a typebuilder.
5426 * class.cs (MethodCore.IsDuplicateImplementation): Compare
5427 MemberNames, not strings.
5429 * const.cs (Error_ExpressionMustBeConst):
5430 Rename from Error_EpressionMustBeConst.
5431 * const.cs, class.cs, statement.cd: Update.
5433 2005-07-21 Marek Safar <marek.safar@seznam.cz>
5437 * const.cs (Const.LookupConstantValue): Report missing contant expression
5439 (Error_EpressionMustBeConstant): Only one error method.
5441 * class.cs, statement.c: Updated.
5443 2005-07-20 Raja R Harinath <rharinath@novell.com>
5445 * statement.cs (Block.Flags): Add back HasVarargs.
5446 (Block.flags): Make protected.
5447 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5449 * typemanager.cs (types, typecontainers, user_types): Remove.
5450 (UserTypes, TypeContainers): Likewise.
5451 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5452 (CleanUp, Reset): Update.
5453 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
5454 (GetNestedType): Use Type.GetNestedType.
5455 (CoreLookupType): Take two arguments, the namespace and the
5456 basename of the type. Update to use the Namespace.Lookup
5458 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5459 (RealMemberLookup): Use IsNestedChildOf instead of playing with
5460 string concatenation and substring matches.
5461 * class.cs, enum.cs, delegate.cs: Update to changes.
5463 2005-07-20 Marek Safar <marek.safar@seznam.cz>
5465 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5466 Expression and made virtual.
5468 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5469 (ImplicitStandardConversionExists): Fixed `byte' typo ?
5471 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5473 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5476 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5479 2005-07-18 Marek Safar <marek.safar@seznam.cz>
5482 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5483 AssemblyCultureAttribute is not used on executable.
5486 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5488 2005-07-16 Raja R Harinath <rharinath@novell.com>
5491 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5492 New. Reports CS0252/CS0253.
5493 Mostly taken from preliminary patch by Duncak Mak.
5494 (Binary.DoResolveOperator): Store results of operator lookup.
5495 Use them to detect if we need to warn about unintended reference
5498 2005-07-15 Raja R Harinath <rharinath@novell.com>
5501 * namespace.cs (Namespace.Lookup): Add back location parameter.
5502 (Namespace.LookupType): Add CS0436 report. Add location parameter.
5503 * delegate.cs, ecore.cs, expression.cs: Update to changes.
5505 * codegen.cs (EmitContext.DeclSpace): Make readonly.
5506 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5507 (Namespace.LookupType): ... this.
5508 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5510 * typemanager.cs (LookupTypeReflection): Remove buggy code that
5511 purported to handle pointers.
5512 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5515 2005-07-15 Marek Safar <marek.safar@seznam.cz>
5517 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5520 2005-07-15 Raja R Harinath <rharinath@novell.com>
5522 * namespace.cs (Namespace.Lookup): Drop location parameter.
5523 (NamespaceEntry.LookupAlias): Remove. Merge into ...
5524 (NamespaceEntry.Lookup): ... this.
5525 (NamespaceEntry.Error_AmbiguousTypeReference):
5526 Move here from DeclSpace.
5527 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5529 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5530 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5531 Move to NamespaceEntry.
5532 * delegate.cs, expression.cs: Update to changes.
5534 2005-07-14 Marek Safar <marek.safar@seznam.cz>
5536 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5537 CheckAttributeType and refactored.
5538 (Attribute.ResolvePossibleAttributeType): Changed to reuse
5539 ResolveAsTypeTerminal error handling.
5540 (ResolveAsTypeTerminal): Introduced because of global attributes extra
5542 (GetSignatureForError): Print errors in same way.
5545 * codegen.cs: Reflect attribute GetSignatureForError change.
5548 * expression.cs: Add silent parameter to ResolveAsTypeStep.
5550 * namespace.cs (UsingEntry): Refactored to make fields private.
5553 statement.cs: Error_UnexpectedKind has extra parameter.
5555 2005-07-14 Raja R Harinath <rharinath@novell.com>
5557 * ecore.cs (IAlias): Remove.
5558 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
5559 that implement the interface.
5560 * namespace.cs (Namespace): Likewise.
5561 (Namespace.declspaces): Renamed from 'defined_names'.
5562 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
5563 DeclSpace instead of an IAlias.
5564 * tree.cs (Tree.AddDecl): Update.
5566 2005-07-12 Raja R Harinath <rharinath@novell.com>
5568 * statement.cs (Block.Flags); Remove HasVarargs.
5569 (Block.HasVarargs): Move to ToplevelBlock.
5570 (Block.ThisVariable, Block.AddThisVariable): Likewise.
5571 (Block.Variables): Make protected. Initialize variable hashtable
5573 (Block.AddVariable): Update.
5574 (Block.Resolve): Update to changes.
5575 (ToplevelBlock.HasVarargs): New boolean.
5576 (ToplevelBlock.ThisVariable): Move here from Block.
5577 (ToplevelBlock.AddThisVariable): Likewise.
5578 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
5579 * expression.cs (This.ResolveBase): Update to changes.
5580 (ArglistAccess.DoResolve): Likewise.
5582 2005-07-11 Marek Safar <marek.safar@seznam.cz>
5585 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5587 * class.cs (TypeContainer.VerifyMembers): Distinguish between
5588 not used and not used & assigned.
5589 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5591 2005-07-11 Marek Safar <marek.safar@seznam.cz>
5594 * expression.cs (Is.DoResolve): null is never provided type.
5596 2005-07-08 Marek Safar <marek.safar@seznam.cz>
5599 * cs-parser.jay: Less strict event error rule to catch more errors.
5601 2005-07-08 Martin Baulig <martin@ximian.com>
5603 Fix test-iter-10.cs - distinguish whether we `yield' in a property
5604 gettter (allowed) or setter (not allowed).
5606 * class.cs (Accessor): Implement IIteratorContainer.
5607 (Accessor.Yields): New public field.
5608 (PropertyBase.PropertyMethod.Define): Handle iterators on a
5612 (get_accessor_declaration, set_accessor_declaration): Set the
5613 `yields' flag on the accessor, not the property.
5614 (property_declaration): Do the iterators check on a per-accessor
5615 basis and not for the whole property.
5617 2005-07-08 Martin Baulig <martin@ximian.com>
5619 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5620 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5622 2005-07-07 Marek Safar <marek.safar@seznam.cz>
5625 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5626 (ExtractSecurityPermissionSet): Cope with self referencing security
5627 attributes properly.
5629 * driver.cs (SetOutputFile): Made public property OutputFile.
5631 2005-07-07 Raja R Harinath <rharinath@novell.com>
5634 * class.cs (TypeContainer.first_nonstatic_field): Rename from
5635 has_nonstatic_fields. Make into a FieldBase pointer.
5636 (TypeContainer.AddField): Add CS0282 check.
5637 (TypeContainer.EmitType): Update.
5639 2005-07-06 Miguel de Icaza <miguel@novell.com>
5641 * cs-tokenizer.cs (consume_identifier): Do not create strings to
5642 compare if they start with __.
5644 2005-07-06 Raja R Harinath <rharinath@novell.com>
5646 * statement.cs (Switch.SwitchGoverningType): Only look at
5647 UserCasts that don't need implicit standard conversions to one of
5648 the allowed switch types (Fixes test-322.cs).
5649 (LocalInfo.Resolve): Re-enable sanity-test.
5651 2005-07-06 Marek Safar <marek.safar@seznam.cz>
5653 * cs-tokenizer.cs (consume_identifier): Detect double undescores
5655 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5657 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5659 2005-07-06 Raja R Harinath <rharinath@novell.com>
5662 * ecore.cs (SimpleName.GetSignatureForError): Add.
5663 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5664 (MemberAccess.GetSignatureForError): Add.
5666 2005-07-05 Marek Safar <marek.safar@seznam.cz>
5668 The big error and warning messages review.
5698 * typemanager.cs: Updated.
5700 * class.cs: (MethodCore.SetYields): Moved here to share.
5701 (PropertyMethod.Define): Moved iterator setup here.
5703 * iterators.cs: Add orig_method to have full access to parent
5706 2005-07-05 Raja R Harinath <rharinath@novell.com>
5708 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5709 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5710 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5711 variable of struct type.
5712 * expression.cs (Unary.ResolveOperator): Update to change.
5713 (Indirection.VerifyFixed): Likewise.
5714 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5715 (ParameterReference.VerifyFixed): Value parameters are fixed.
5716 (This.VerifyFixed): Treat 'this' as a value parameter.
5717 * statement.cs (LocalInfo.IsFixed): Remove.
5719 2005-07-01 Martin Baulig <martin@ximian.com>
5721 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5722 `ec.EmitThis ()' to get the correct scope.
5724 2005-07-01 Martin Baulig <martin@ximian.com>
5726 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5727 instance is a ParameterReference; fixes #75299.
5729 2005-07-01 Martin Baulig <martin@ximian.com>
5731 Reverted Marek's latest patch (r46725):
5732 - it contains structural changes which are neither mentioned in
5733 the ChangeLog nor explained anywhere; for example the additional
5734 argument of EmitContext's and Iterator's .ctor's and the
5735 TypeContainer.DefineMembers() change.
5736 - structural changes like this should go in in seperate patches
5737 and not be hidden in a huge patch which just seems to affect
5738 warnings and errors.
5739 a big and hard to understand patch.
5740 - it breaks iterators and causes regressions, for instance in
5743 2005-06-30 Raja R Harinath <rharinath@novell.com>
5746 * expression.cs (Indexers.map): Remove.
5747 (Indexers.Append): Filter out inaccessible setters and getters.
5748 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5751 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
5753 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5754 (FieldExpr.Emit, PropertyExpr.Emit): Update.
5755 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5756 * expression.cs (Invocation.EmitCall): Add CS0120 check.
5758 2005-06-30 Marek Safar <marek.safar@seznam.cz>
5761 * class.cs (FieldBase.GetInitializerExpression): One more field
5764 2005-06-28 Miguel de Icaza <miguel@novell.com>
5766 * pending.cs: Do not define a proxy if the base method is virtual,
5767 it will be picked up by the runtime (bug 75270).
5769 2005-06-08 Martin Baulig <martin@ximian.com>
5771 The big Iterators rewrite :-)
5773 * iterators.cs: Rewrite this to use the anonymous methods framework.
5775 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5776 before the TypeContainers; see 2test-21.cs.
5779 (TypeContainer.DefineType): Don't create a new EmitContext if we
5780 already have one (this only happens if we're an Iterator).
5781 (TypeContainer.Define): Also call Define() on all our iterators.
5782 (Method.CreateEmitContext): Added support for iterators.
5785 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5786 (AnonymousContainer.CreateMethodHost): Moved here from
5787 AnonymousMethod and made abstract.
5788 (AnonymousContainer.CreateScopeType): New abstract method.
5789 (AnonymousContainer.IsIterator): New public property.
5790 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5791 get the ScopeTypeBuilder rather than manually defining it here.
5792 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5795 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5796 before RootContext.DefineTypes().
5798 * codegen.cs (EmitContext.RemapToProxy): Removed.
5799 (EmitContext.CurrentAnonymousMethod): Changed type from
5800 AnonymousMethod -> AnonymousContainer.
5801 (EmitContext.ResolveTopBlock): Protect from being called twice.
5802 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5803 (EmitContext.EmitThis): Removed the iterators hacks; use the
5804 anonymous methods framework for that.
5807 (ToplevelBlock.Container): Make this a property, not a field.
5808 (ToplevelBlock.ReParent): New public method; move the
5809 ToplevelBlock into a new container.
5810 (Foreach.TemporaryVariable): Simplify.
5812 2005-06-05 Martin Baulig <martin@ximian.com>
5814 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5815 (Block.AddTemporaryVariable): New public method; creates a new
5816 `LocalInfo' for a temporary variable.
5817 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5819 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5820 non-iterator variables.
5822 2005-06-05 Martin Baulig <martin@ximian.com>
5824 * statement.cs (Foreach.TemporaryVariable): Create the
5825 LocalBuilder in the Emit phase and not in Resolve since in some
5826 situations, we don't have an ILGenerator during Resolve; see
5827 2test-19.cs for an example.
5829 2005-06-04 Martin Baulig <martin@ximian.com>
5831 **** Merged r45395 from GCS ****
5833 The big Foreach rewrite - Part II.
5835 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5836 with `PropertyInfo ienumerator_getcurrent'.
5838 * codegen.cs (VariableStorage): Removed.
5841 (Foreach): Derive from Statement, not ExceptionStatement.
5842 (Foreach.CollectionForeach): New nested class. Moved all the code
5843 dealing with collection foreach here.
5844 (Foreach.ForeachHelperMethods): Removed.
5845 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5847 2005-05-23 Martin Baulig <martin@ximian.com>
5849 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5850 don't need to. Fix #75014.
5852 2005-05-20 Martin Baulig <martin@ximian.com>
5854 Merged r44808 from GMCS.
5856 * class.cs (TypeContainer.CircularDepException): Removed.
5857 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5858 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5859 (CS0146) and interface (CS0529) dependencies here.
5861 2005-06-21 Raja R Harinath <rharinath@novell.com>
5863 * expression.cs (Invocation.EmitCall): Fix initialization
5864 'this_call' to reflect current behaviour. Fix indentation.
5866 * convert.cs (FindMostEncompassedType): Add two trivial special
5867 cases (number_of_types == 0 || number_of_types == 1).
5868 (FindMostEncompasingType): Likewise.
5870 2005-06-17 Raja R Harinath <rharinath@novell.com>
5872 Some cleanups preparing for the fix of #75283.
5873 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5875 (EventExpr.InstanceResolve): Likewise.
5876 (EventExpr.DoResolve): Remove redundant checks.
5878 2005-06-10 Duncan Mak <duncan@novell.com>
5880 * cs-tokenizer.cs (process_directives): New flag for controlling
5881 the processing of preprocessor directives.
5882 (x_token): After seeing a '#', return Token.NONE instead of going
5883 to handle_preprocessing_directive() when not processing
5884 directives. This avoids unnecessary processing during the token peek in
5889 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5890 the existing error reporting methods instead of Report.Error.
5892 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5893 after Raja's rewrite.
5895 2005-06-08 Miguel de Icaza <miguel@novell.com>
5897 * class.cs: Small fix.
5899 2005-06-08 Raja R Harinath <rharinath@novell.com>
5902 * class.cs (GetPartialBases): Fix return value check of
5905 2005-06-07 Raja R Harinath <rharinath@novell.com>
5907 Ensure that partial classes are registered in their enclosing
5908 namespace. Initial part of fix of #75160.
5909 * tree.cs (Tree.RecordDecl): Add new namespace argument.
5910 Register declspace with namespace here, not in
5911 DeclSpace.RecordDecl.
5912 * cs-parser.jay: Pass namespace to RecordDecl.
5913 * class.cs (PartialContainer.Create): Likewise.
5914 (ClassPart.DefineType): New sanity-check. Throws an exception if
5916 * decl.cs (Declspace.RecordDecl): Remove.
5917 * namespace.cs (NamespaceEntry.DefineName): Remove.
5919 2005-06-06 Marek Safar <marek.safar@seznam.cz>
5921 * rootcontext.cs: Reset TargetExt as well.
5923 2005-06-03 Raja R Harinath <rharinath@novell.com>
5925 * ecore.cs (Expression.Resolve): Emit CS0654 error when
5928 2005-06-02 Raja R Harinath <rharinath@novell.com>
5930 Fix #75080, cs0119.cs.
5931 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
5933 (Expression.Resolve): ... this. Use it. Remove bogus code
5934 allowing ExprClass.Type and ExprClass.Namespace for
5935 ResolveFlags.VariableOrValue.
5936 (Expression.Resolve) [1-argument variant]: Change default resolve
5937 flags based on language version.
5938 (Expression.Error_UnexpectedKind): Use a simple string array
5939 rather than an ArrayList.
5940 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5942 (TypeOfVoid.DoResolve): Likewise.
5943 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
5944 flags argument -- it always has the same value.
5946 2005-05-31 Raja R Harinath <rharinath@novell.com>
5949 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5950 Use it in the error message.
5951 * assign.cs, expression.cs, statement.cs: Update.
5953 2005-05-30 Raja R Harinath <rharinath@novell.com>
5956 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5957 the "almostMatchedMember" case too.
5958 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5959 that failed the accessibility checks to 'almost_match'.
5961 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
5963 * attribute.cs: Use internal MethodBuilder methods to set
5964 ExactSpelling and SetLastError on PInvoke methods, instead
5965 of passing them via charset. Fixes #75060.
5967 2005-05-27 Raja R Harinath <rharinath@novell.com>
5969 * parameter.cs (Parameter): Remove TODO comment.
5970 (Parameter.DefineParameter): Remove Location parameter.
5971 (Parameters.LabelParameters): Likewise.
5972 * class.cs (Constructor.Emit): Update to change.
5973 (MethodData.Emit): Likewise.
5974 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
5975 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5977 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
5980 Removed Parameters.Location and added Parameter.Location instead.
5981 Removed Location parameter from Emit() and GetSignature().
5988 Modified all related calls.
5990 2005-05-26 Raja R Harinath <rharinath@novell.com>
5992 Improve user-defined conversion handling.
5993 * convert.cs (GetConversionOperators): Rewrite. Return only the
5994 applicable operators.
5995 (AddConversionOperators): New. Helper for GetConversionOperators.
5996 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5997 there is only one most encompassed/encompassing type.
5998 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5999 "applicable operator" handling.
6000 (UserConversion): Move cache here from GetConversionOperators.
6001 Directly cache the chosen operator, rather than the whole
6003 (ExplicitNumericConversion): Fix buggy implementation of Decimal
6004 case. Allow conversion of decimal to sbyte and byte too.
6005 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6006 New static methods. Used to avoid allocating EmptyExpressions in
6009 2005-05-24 Duncan Mak <duncan@novell.com>
6011 * ecore.cs (CastFromDecimal): New class for casting a decimal to
6012 another class, used in Convert.ExplicitNumericConversion.
6013 (CastToDecimal): New class, similar to above, but casts to
6014 System.Decimal, used in Convert.ImplicitNumericConversion and also
6015 in explicit convesion from double/float to decimal.
6017 * convert.cs (ImplicitNumericConversion): Handle implicit
6018 conversions to System.Decimal.
6019 (ExplicitNumericConversion): handle explicit conversions to
6024 2005-05-20 Miguel de Icaza <miguel@novell.com>
6026 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6027 know the type at this stage, just break through. Fixes #75008
6029 2005-05-19 Martin Baulig <martin@ximian.com>
6032 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6033 to disable error reporting.
6035 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6036 here since we don't want to report an error; see the new test-336.cs.
6038 2005-05-19 Raja R Harinath <rharinath@novell.com>
6040 * statement.cs (ToplevelBlock.GetParameterReference)
6041 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6042 Move here from class Block.
6043 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6044 * expression.cs (ParameterReference.DoResolveBase): Likewise.
6046 2005-05-18 Martin Baulig <martin@ximian.com>
6051 (FlowBranching.Reachability): Add non-static public And() and Or()
6053 (FlowBranchingSwitch): New class; do the `break_origins' thing
6054 like in FlowBranchingLoop.
6055 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6056 reachability, not just locals and parameters.
6057 (FlowBranching.MergeChild): Remove some of the hacks for loop and
6058 switch; MergeBreakOrigins() now takes care of that.
6060 2005-05-18 Martin Baulig <martin@ximian.com>
6062 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6063 a loop and may leave it, reset the barrier; fixes #74974.
6065 2005-05-17 Marek Safar <marek.safar@seznam.cz>
6067 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6070 * cs-parser.jay: Catch more lexical errors.
6072 * report.cs: Add one more Error method.
6075 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6077 2005-05-17 Martin Baulig <martin@ximian.com>
6079 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6082 2005-05-16 Raja R Harinath <rharinath@novell.com>
6084 Fix test-382.cs. Emit values of decimal constants.
6085 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6087 (TypeContainer.AddField): ... this.
6088 (TypeContainer.EmitFieldInitializers): Allow the list of fields
6089 with initializers to include 'Const's.
6090 (ClassPart.RegisterFieldForInitialization): Forward to
6092 * const.cs (Const.Const): Pass initializer to base class.
6093 (Const.Define): In case of decimal constants, register them for
6094 initialization in a static constructor.
6096 2005-05-14 Martin Baulig <martin@ximian.com>
6098 * statement.cs (Block.Resolve): Correctly handle unreachable code;
6099 do not call ResolveUnreachable() on unreachable statements in
6100 here, see the comment in the source code.
6102 2005-05-13 Raja R Harinath <rharinath@novell.com>
6105 * expression.cs (BinaryResolveOperator): If one of the operands of
6106 an equality comparison is 'null' and the other is a pointer type,
6107 convert the null to a NullPointer.
6108 * convert.cs (ImplicitReferenceConversion): If the expression is a
6109 NullLiteral and the target type is a pointer type, return a
6110 NullPointer instead.
6111 (ImplicitConversionStandard): Likewise.
6113 2005-05-13 Marek Safar <marek.safar@seznam.cz>
6115 * cs-parser.jay: Set readonly context based on special constructs.
6117 * expression.cs (LocalVariableReference.DoResolveBase): Improved
6118 readonly variable error handling.
6120 * rootcontext.cs (EmitCode): Don't verify members when error
6123 * statement.cs (LocalInfo): Add reaodnly context information.
6124 (SetReadOnlyContext, GetReadOnlyContext): New methods.
6126 2005-05-13 Raja R Harinath <rharinath@novell.com>
6128 * statement.cs (Block.Resolve): Revert change below. Modify fix
6129 for #74041 to initialize 'resolved' to false only for explicit
6130 blocks. Fixes #74873.
6132 2005-05-12 Raja R Harinath <harinath@gmail.com>
6135 * typemanager.cs (unmanaged_enclosing_types): New.
6136 (IsUnmanagedType): Avoid infloops by using
6137 'unmanaged_enclosing_types' to talk with recursive invocations.
6139 2005-05-13 Martin Baulig <martin@ximian.com>
6141 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6142 instance variable, not a local. Fix #74873.
6143 (Block.ResolveUnreachable): Set it to true here.
6145 2005-05-11 Duncan Mak <duncan@novell.com>
6147 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6148 continuing to process for 'arg'.
6149 (handle_preprocessing_directive): Check the argument of the #endif
6150 directive and report error CS1025 if there are any trailing
6153 According to the C# spec, having even whitespace after the #endif
6154 directive is illegal; however, because we call arg.TrimEnd ()
6155 beforehand, we have the same behavior as csc, allowing whitespace
6156 after the directive.
6160 2005-05-11 Marek Safar <marek.safar@seznam.cz>
6164 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6165 (Constructor.GetObsoleteAttribute): Implemented correctly.
6167 2005-05-10 Martin Baulig <martin@ximian.com>
6169 * support.cs (ReflectionParameters.ParameterModifier): Use
6170 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6171 and `ParameterAttributes.In'. Fixes #74884.
6173 2005-05-10 Marek Safar <marek.safar@seznam.cz>
6175 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6177 * expression.cs (Argument.GetParameterModifier): Turned to property.
6178 (Invocation.Error_InvalidArguments): Add more descriptive errors.
6180 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6183 2005-05-09 Raja R Harinath <rharinath@novell.com>
6186 * decl.cs (MemberCache.AddMethods): Register override methods,
6187 rather than non-override methods.
6188 * typemanager.cs (RegisterOverride): New.
6189 (IsOverride): Update.
6191 2005-05-09 Marek Safar <marek.safar@seznam.cz>
6195 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6196 recursive declaration.
6198 * statement.cs (Block.ResolveMeta): Report any error in resolving.
6200 2005-05-06 Marek Safar <marek.safar@seznam.cz>
6202 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6204 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6206 2005-05-05 Raja R Harinath <rharinath@novell.com>
6209 * decl.cs (DeclSpace.FamilyAccessible):
6210 Use TypeManager.IsNestedFamilyAccessible.
6212 Fix reopened #64812.
6213 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6216 2005-05-04 Raja R Harinath <rharinath@novell.com>
6217 Abin Thomas <projectmonokochi@rediffmail.com>
6218 Anoob V E <projectmonokochi@rediffmail.com>
6219 Harilal P R <projectmonokochi@rediffmail.com>
6222 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6223 allow access to all static members.
6225 2005-05-04 Martin Baulig <martin@ximian.com>
6227 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6229 2005-05-04 Martin Baulig <martin@ximian.com>
6233 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6234 section at the end; make things work if `default' is not the last
6237 2005-05-04 Martin Baulig <martin@ximian.com>
6241 * statement.cs (Switch): Replaced the `got_default' field with a
6242 `default_section' one.
6243 (Switch.CheckSwitch): Set `default_section' here.
6244 (Switch.Resolve): If we're a constant switch and the constant is
6245 not found, use the default section.
6247 2005-05-03 Martin Baulig <martin@ximian.com>
6249 * expression.cs (ArrayAccess.EmitGetLength): New public method.
6251 * statement.cs (Foreach.ArrayForeach): New nested class.
6252 (Foreach.TemporaryVariable): New nested class.
6253 (Foreach.EmitArrayForeach): Removed; this is now in the new
6256 2005-05-03 Raja R Harinath <rharinath@novell.com>
6258 * pending.cs (BaseImplements): Move the #74773 fix here. This is
6260 (VerifyPendingMethods): Revert change below.
6262 * typemanager.cs (IsOverride, RegisterNonOverride): New.
6263 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6264 that used to trigger warning -28. Remove warning -28.
6265 * expression.cs (Invocation.OverloadResolve): Use
6266 TypeManager.IsOverride to distinguish override methods.
6269 * pending.cs (VerifyPendingMethods): If a base type implements the
6270 requested interface, don't bother checking individual methods of
6271 the base type. As a side-effect, this prevents the creation of
6272 unnecessary proxies.
6274 2005-05-02 Martin Baulig <martin@ximian.com>
6278 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6279 Also `And' the locals if the old vector is null.
6280 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6281 null; in this case we basically reset all the variables.
6283 2005-05-02 Martin Baulig <martin@ximian.com>
6287 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6288 Added `FlowBranching branching' argument; always `and' the
6289 variables instead of `or'ing them unless we're an infinite loop.
6291 * statement.cs (While.Resolve): Create a new sibling unless we're
6294 2005-05-02 Martin Baulig <martin@ximian.com>
6298 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6299 arguments; use it instead of creating a new TopLevelBlock.
6300 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6301 our ConstructorInitializer.
6304 (TopLevelBlock.TopLevelBranching): New public property.
6305 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6306 and create our `TopLevelBranching'.
6308 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6309 anonymous method host, use `block.TopLevelBranching' rather than
6310 creating a new branching.
6312 2005-04-20 Miguel de Icaza <miguel@novell.com>
6314 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6315 a ScopeInfo, if any of the current children is a child of the new
6316 entry, move those children there.
6318 2005-04-30 Martin Baulig <martin@ximian.com>
6320 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6321 at the beginning of a SwitchSection. Fix #73335.
6323 2005-04-27 Marek Safar <marek.safar@seznam.cz>
6326 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6328 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6329 (FieldExpr.DoResolve): Obsolete members are ignored for field
6332 2005-04-26 Marek Safar <marek.safar@seznam.cz>
6334 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6335 of arrays detection.
6337 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6339 (Field.VerifyClsCompliance): Volatile fields are not compliant.
6341 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6344 2005-04-25 Ben Maurer <bmaurer@ximian.com>
6346 * cs-parser.jay: Use the prefered version of -unsafe in error
6349 2005-04-22 Marek Safar <marek.safar@seznam.cz>
6351 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6354 2005-04-20 John Luke <john.luke@gmail.com>
6356 * driver.cs: fix typo in error message, --outout to --output
6358 2005-04-20 Marek Safar <marek.safar@seznam.cz>
6360 * codegen.cs (InRefOutArgumentResolving): New field.
6362 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6363 fields outside contructor.
6365 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6367 2005-04-19 Miguel de Icaza <miguel@novell.com>
6369 * anonymous.cs (CaptureContext.EmitParameterInstance): The
6370 parameter code was not completed ever, so it was not as up-to-date
6371 as local variables. Must finish it.
6373 The bug fix was to compare the Toplevel of the block, not the
6374 current block. Thanks for Ben for pointing this out.
6376 2005-04-19 Raja R Harinath <rharinath@novell.com>
6378 * decl.cs (AddMethods): Use the declaring type of the problem
6379 method to determine if we want to squash a warning.
6381 2005-04-19 Marek Safar <marek.safar@seznam.cz>
6383 * attribute.cs: Removed debug output.
6385 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6387 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6390 2005-04-18 Raja R Harinath <rharinath@novell.com>
6393 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6394 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6395 all null comparisons against reference types.
6397 2005-04-18 Marek Safar <marek.safar@seznam.cz>
6400 * class.cs (TypeContainer.CircularDepException) New nested
6402 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6403 (TypeContainer.DefineType): Removed error, reset InTransit before
6405 (Class.DefineType): Throw exception when is in Transit.
6406 Catch exception and report error.
6407 (Struct.DefineType): Throw exception when is in Transit.
6408 Catch exception and report error.
6409 (Interface.DefineType): Throw exception when is in Transit.
6410 Catch exception and report error.
6412 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6413 handle nested exception handlers.
6415 * flowanalysis.cs (InTryWithCatch): New method, search for try with
6418 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6419 InFinally and InCatch storage.
6421 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6422 (Catch.Resolve): Set and Restore ec.InCatch.
6423 (Try.Resolve): Set and Restore ec.InFinally.
6424 (Try.HasCatch): True when try has catch.
6426 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
6428 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6429 for the same event member, so exclude such cases from warning 419.
6432 2005-04-16 Miguel de Icaza <miguel@novell.com>
6434 * expression.cs (Binary.ResolveOperator): Apply patch from John
6435 Luke to fix bug 59864: operators &, | and ^ on enumerations
6436 require that the same enum type on both sides.
6438 * driver.cs: Add warnings to old flag usage, this is to assist
6439 people who produce Makefiles and hope that the Makefiles will be
6442 * class.cs (TypeContainer.EmitType): Moved the definition of the
6443 special $PRIVATE$ field from the resolve phase to the Emit phase.
6444 During resolve we do not know if we are a struct with
6445 HasExplicitLayout, we know this only after the attributes for the
6448 Set the FieldOffset to zero on the dummy field that we create for
6449 the class. Fixes 74590.
6451 2005-04-16 Raja R Harinath <rharinath@novell.com>
6454 * ecore.cs (PropertyExpr.resolved): New.
6455 (DoResolve): Use it to handle a case of double resolution here.
6456 Handle a case of identical-name-and-type-name.
6457 * expression.cs (ArrayCreation.CheckIndices): Avoid double
6458 resolution by storing the results of expression resolution back
6459 into the "probes" array.
6461 2005-04-15 Raja R Harinath <rharinath@novell.com>
6463 Fix cs0208-7.cs and cs0208-8.cs.
6464 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6465 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
6466 error reporting to point out the reason a struct is not unmanaged.
6468 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
6470 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
6471 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6473 2005-04-13 Raja R Harinath <rharinath@novell.com>
6476 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6477 IdenticalNameAndTypeName here.
6478 (EventExpr.InstanceResolve): Likewise.
6480 2005-04-13 Marek Safar <marek.safar@seznam.cz>
6482 C# 2.0 DefaultCharSetAttribute implementation
6484 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6485 which allows us to set GlobalNamespace for every resolve.
6486 (Attribute.ResolveArguments): Cut from Resolve.
6487 (Attribute.GetCharSetValue): Returns CharSet named argument.
6488 (Attribute.DefinePInvokeMethod): Gets default charset from
6490 (GlobalAttribute.ResolveAsTypeStep): Override.
6491 (GlobalAttribute.ResolveArguments): Override.
6493 * class.cs (TypeAttr): Is protected.
6495 * codegen.cs (ModuleClass.DefaultCharSet): New member.
6496 (ModuleClass.DefaultCharSetType): New memeber.
6497 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6499 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6500 charset from module.
6502 * delegate.cs (TypeAttr): Override.
6503 (Delegate.DefineType): Use this TypeAttr.
6505 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6506 at very early stage (before types are defined) to resolve model
6507 module attributes. It will probably not work with corlib but it
6510 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6511 charset from module.
6513 * typemanager.cs (default_charset_type): New type.
6515 2005-04-13 Raja R Harinath <rharinath@novell.com>
6517 * decl.cs (MemberCache.AddMethods): Don't warn if
6518 System.Object.Finalize has buggy MethodAttributes.
6520 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6523 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
6525 * doc.cs : detect ambiguous reference to overloaded members.
6526 Fixed bug #71603. MS 1.1 csc does not detect it.
6528 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
6530 * doc.cs : delegates must not be referenced with parameters.
6533 2005-04-12 Miguel de Icaza <miguel@novell.com>
6535 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6537 2005-04-10 Miguel de Icaza <miguel@novell.com>
6539 * driver.cs (MainDriver): Stop processing if the CLS stage found
6542 (CompilerCallableEntryPoint.InvokeCompiler): Always
6543 reset after execution; Take a TextWriter argument for the
6546 * report.cs: Use the error stream instead of hardcoding stderr.
6548 2005-04-09 Miguel de Icaza <miguel@novell.com>
6550 * class.cs: Reduce code paths to test, too small of an
6551 optimization to make it worth the extra testing. Always perform
6554 2005-04-08 Raja R Harinath <rharinath@novell.com>
6557 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6558 operators that had errors reported on them.
6560 2005-04-08 Marek Safar <marek.safar@seznam.cz>
6562 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6564 (Attribute.Resolve): Add named argument type checking.
6566 * class.cs (FixedField.Define): Use IsPrimitiveType
6568 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6570 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6571 unsafe parameter types.
6573 * statement.cs (Using.ResolveExpression): Add better error description.
6575 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6577 2005-04-08 Raja R Harinath <rharinath@novell.com>
6580 * attribute.cs (Attribute.GetAttributeUsage): Resolve
6581 AttributeUsageAttribute in the emitcontext of the attribute class,
6582 not in the emitcontext of the attributable entity it was attached to.
6583 * cs-parser.jay: Use 'current_class', not 'current_container',
6584 when creating a GlobalAttribute.
6586 2005-04-08 Alp Toker <alp@atoker.com>
6588 * pending.cs: The fix to #58413 failed to compile methods implementing
6589 interfaces with/without params modifiers and vice versa, even though
6590 params modifiers aren't part of the signature. Make the modifier check
6591 less strict as in csc.
6593 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
6594 Anoob V E <projectmonokochi@rediffmail.com>
6595 Harilal P R <projectmonokochi@rediffmail.com>
6598 * pending.cs (TypeAndMethods.mods): New. Store the parameter
6599 modifiers of pending methods.
6600 (PendingImplementation.PendingImplementation): Initialize it.
6601 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6602 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6603 with ParameterData. Add check for modifiers.
6604 * class.cs (MethodData.Define): Update to changes.
6606 2005-04-07 Raja R Harinath <rharinath@novell.com>
6608 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6610 2005-04-07 Marek Safar <marek.safar@seznam.cz>
6612 * class.cs (PropertyMethod.Define): Check private accessor in abstract
6615 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6618 * typemanager.cs: Registered RequiredAttributeAttribute.
6620 2005-04-06 Marek Safar <marek.safar@seznam.cz>
6622 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6623 Warning CS0169 is back at level 3.
6624 (IMethodData.SetMemberIsUsed): New method.
6626 * decl.cs (IsUsed): New value; moved from FieldBase.Status
6627 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6629 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6631 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6633 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6636 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6639 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6640 to avoid the problems with nested types.
6642 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
6643 Anoob V.E <projectmonokochi@rediffmail.com>
6644 Harilal P.R <projectmonokochi@rediffmail.com>
6645 Raja R Harinath <rharinath@novell.com>
6648 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6650 * typemanager (GetConstructor): Make public.
6652 2005-04-05 John Luke <john.luke@gmail.com>
6653 Raja R Harinath <rharinath@novell.com>
6656 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6657 struct too. Return false quicker in a few cases.
6658 (VerifyUnManaged): Use it.
6660 2005-04-05 Raja R Harinath <rharinath@novell.com>
6663 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6664 not 'unreachable_seen'.
6666 2005-04-04 Marek Safar <marek.safar@seznam.cz>
6668 * attribute.cs (Attribute.GetValue): Removed unused.
6670 * codegen.cs (CodeGen.TrimExt): Removed unused.
6672 * cs-parser.jay (output): Removed unused.
6674 * cs-tokenizer.cs (hex_digits): Removed unused.
6676 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6678 * expression.cs (Indirection.LoadExprValue): Removed unused.
6679 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6681 * iterators.cs (Iterator.param_types): Removed unused.
6683 * statement.cs (Goto.block): Removed unused.
6684 (ToplevelBlock.did): Removed unused.
6685 (Switch.ResolveConstantSwitch): Removed unused.
6687 2005-04-01 Ben Maurer <bmaurer@ximian.com>
6689 * rootcontext.cs: Allow mcs to bootstrap with the compilation
6692 2005-04-01 Raja R Harinath <rharinath@novell.com>
6694 Fix #74232 and cs0208-3.cs.
6695 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6696 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6697 unmanaged type. Don't use FieldBuilders when 't' is a
6698 TypeBuilder. Use ModFlags and MemberType fields.
6699 * class.cs (MemberBase.member_type): Rename from MemberType.
6700 (MemberBase.MemberType): New property. Determines member_type on
6702 (MemberBase.DoDefine): Don't initialize MemberType here.
6703 (FieldMember.Define): Likewise.
6705 2005-04-01 Marek Safar <marek.safar@seznam.cz>
6708 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6709 Attributes are emitted there.
6711 2005-04-01 Raja R Harinath <rharinath@novell.com>
6713 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6714 keyword in 'partial enum' too.
6715 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6717 Report from Kamil Skalski <nazgul@omega.pl>.
6720 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6721 have partial containers too.
6723 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6724 in block' checks to Block.CheckInvariantMeaningInBlock.
6725 * statement.cs (Block.GetKnownVariableInfo): Make private.
6726 (Block.IsVariableUsedInChildBlock): Remove.
6727 (Block.IsVariableUsedInBlock): Likewise.
6728 (Block.CheckInvariantMeaningInBlock): New. Show location of
6729 conflicting declaration.
6730 (Block.AddVariable): Make error messages less long-winded and more
6731 specific. Show location of conflicting declaration.
6732 * parameter.cs (Parameters.Location): New readonly property.
6734 2005-03-31 Raja R Harinath <rharinath@novell.com>
6736 Clean up semantics of invoking ResolveMemberAccess.
6737 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6738 can have an instance, ensure that we pass in a non-TypeExpression
6739 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
6740 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6741 argument. Update to changes and simplify.
6742 (FieldExpr.Emitinstance): Remove CS0120 check.
6743 (PropertyExpr.EmitInstance): Likewise.
6744 * expression.cs (Argument.Resolve): Likewise.
6745 (Invocation.DoResolve): Update to changes in semantics of
6748 2005-03-31 Marek Safar <marek.safar@seznam.cz>
6751 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6754 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6756 2005-03-31 Raja R Harinath <rharinath@novell.com>
6758 Fix difference in behaviour with commandline invocation.
6759 * driver.cs (Driver.Reset): New.
6760 (CompilerCallableEntryPoint): Call it.
6762 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6763 variable" warnings if the boolean expression failed to resolve.
6765 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6767 * attribute.cs: Fix the union of several permissions when some of them
6768 are unrestricted (so the result isn't an unrestricted permission set).
6771 2005-03-30 Raja R Harinath <rharinath@novell.com>
6773 * ecore.cs (MemberExpr): New class. Convert from interface
6775 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6776 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6778 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6779 (MethodGroupExpr.IsExplicitImpl): Remove.
6780 (Expression.GetFieldFromEvent): Remove.
6781 (SimpleName.MemberStaticCheck): Remove.
6782 (SimpleName.DoSimpleNameResolve): Update to changes.
6783 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6784 (MemberAccess.IdenticalNameAndTypeName): Remove.
6785 (MemberAccess.error176): Move to MemberExpr.
6786 (MemberAccess.DoResolve): Update to changes.
6787 (BaseAccess.DoResolve): Likewise.
6789 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6791 C# 2.0 Conditional attribute class implementation
6793 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6794 Analyzes class whether it has attribute which has ConditionalAttribute
6795 and its condition is not defined.
6797 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6798 (Class.IsExcluded): New method. Search for at least one defined
6799 condition in ConditionalAttribute of attribute class.
6801 2005-03-30 Raja R Harinath <rharinath@novell.com>
6803 * ecore.cs (PropertyExpr): Derive from Expression, not
6804 ExpressionStatement.
6805 (PropertyExpr.EmitStatement): Remove.
6807 2005-03-29 Raja R Harinath <rharinath@novell.com>
6810 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6811 internal field "value__" of an enum be private. The examples for
6812 "value__" that I found on MSDN all used FieldAttributes.Private.
6814 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6815 Don't mention IL method attribute names.
6817 Fix #47991. Remove a TODO.
6818 * statement.cs (Block.Toplevel): Make into a field.
6819 (Block.Parameters): Move into ToplevelBlock.
6820 (Block.known_variables): Rename from child_variable_names.
6821 (Block.Block): Remove variants that take Parameters. Initialize
6822 'Toplevel' with the immediately surrounding toplevel block.
6823 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6824 LocalInfo parameter.
6825 (Block.GetKnownVariableInfo): New.
6826 (Block.IsVariableNameUsedInChildBlock): Update.
6827 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6828 the block, even though it may not be in scope.
6829 (Block.AddVariable): Remove Parameters parameter. Use
6830 Toplevel.Parameters instead.
6831 (Block.AddConstant): Remove Parameters parameter.
6832 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6833 (Block.IsParamaterReference): Likewise.
6834 (Block.IsLocalParameter): Likewise. Simplify a lot.
6835 (ToplevelBlock.Parameters): New. Moved from Block.
6836 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6837 initialize Parameters to a non-null value.
6838 * cs-parser.jay: Update to changes.
6839 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6840 simple names that mean different things in the same block. Use
6841 Block.IsVariableNameUsedInBlock.
6843 2005-03-28 Raja R Harinath <rharinath@novell.com>
6845 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6846 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6847 GetTypeHandle. It is possible for a reflected type to derive from
6848 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6849 System.Array during mscorlib compilation).
6850 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6851 contain a method_hash, don't create one either. Don't create a
6852 deep copy of the base cache's method_hash.
6853 (MemberCache.SetupCache): Rename back from DeepCopy.
6854 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6855 already initialized. If we see an override function, add its
6856 underlying base virtual function to the member_hash too.
6858 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6860 2005-03-26 Raja R Harinath <harinath@acm.org>
6863 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6864 fails to resolve, ensure that the LHS is still resolved as an
6867 2005-03-25 Raja R Harinath <harinath@acm.org>
6869 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6871 (Enum.current_ec): Remove.
6872 (Enum.LookupEnumValue): Remove EmitContext argument.
6873 Just uses the one created during DefineType.
6874 (Enum.FindMembers): Update.
6875 * expression.cs (MemberAccess.DoResolve): Update.
6877 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6879 * assign.cs (Assign.DoResolve): Check for CS1717 when
6880 source and target are same (uses Equals).
6882 * expression.cs (LocalVariableReference, ParameterReference,
6883 This): Implemented Equals, GetHashCode.
6885 * statement.cs (Block.GetParameterReference): Removed useless
6888 2005-03-22 Raja R Harinath <rharinath@novell.com>
6891 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6892 blocks before deciding whether the error is cs0136 or cs0128.
6894 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6895 (using_alias_directive, using_namespace_directive): Pass
6896 MemberName, not an expression to Namespace.UsingAlias and
6898 (MakeName): Use the MemberName of the namespace.
6899 * namespace.cs (Namespace.MemberName): New.
6900 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6901 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6903 * decl.cs (MemberName.Name): Make readonly.
6904 (MemberName.FromDotted): New "constructor".
6905 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6906 (MemberCore.Name): Compute from MemberName on demand.
6907 (MemberCore.SetMemberName): Provide a way to change the
6909 (MemberCore.AddToContainer): Don't take a fullname parameter.
6910 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6911 fully qualified name of the container to the member name.
6912 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6913 only if the type is a member of the root container.
6914 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6915 MemberName.Left rather than searching for an embedded ".".
6916 (PartialContainer.CreatePart): Update to changes in RootContext.
6917 (MemberBase.ShortName): Turn into a property. Use
6918 MemberCore.SetMemberName.
6919 (MemberBase.ExplicitInterfaceName): Remove.
6920 (MemberBase.UpdateMemberName): Remove.
6921 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6922 (PropertyBase.SetMemberName): New override.
6923 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6924 (Tree.GetDecl): New.
6925 (Tree.AllDecls): Rename from Decls.
6926 * attribute.cs, enum.cs, report.cs: Update to changes.
6927 * driver.cs (MainDriver): Use MemberName.FromDotted on
6928 RootContext.MainClass.
6930 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6932 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6935 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6937 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6939 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6940 property accessor modifiers.
6942 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6943 fixed buffer attribute (CS1716).
6944 (PropertyMethod.HasCustomAccessModifier): When property accessor
6945 has custom modifier.
6947 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6949 (PropertyExpr.DoResolveLValue): Add CS0272.
6951 2005-03-17 Miguel de Icaza <miguel@novell.com>
6953 * convert.cs: When converting to a pointer, use the proper Conv.U
6954 or Conv.I depending on the source data type.
6956 * cs-tokenizer.cs: Make the size for large decimal constants,
6959 2005-03-17 Martin Baulig <martin@ximian.com>
6961 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6962 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6964 2005-03-17 Martin Baulig <martin@ximian.com>
6966 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6967 to bool so we can return an error condition.
6968 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6971 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6973 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6976 2005-03-16 Raja R Harinath <rharinath@novell.com>
6978 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6979 Refactor to avoid traversing the list of assemblies, and to avoid
6980 string concatenation.
6981 * typemanager.cs (guid_attr_type): Remove.
6982 (negative_hits, pointers, references): Remove hashes.
6984 (GetConstructedType): New. Uses type_hash to handle constructed
6985 types (arrays, references, pointers).
6986 (GetReferenceType, GetPointerType): Use it.
6987 (GetNestedType): New. Uses type_hash to handle nested types of
6989 (LookupType, LookupTypeDirect): Remove.
6990 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6991 'types' hash and LookupTypeReflection directly.
6992 (params_string, params_object): Use GetConstructedType.
6993 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6995 (Namespace.Lookup): Use cached_types.
6996 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6997 provided by old TypeManager.LookupType.
6998 * rootcontext.cs (MakeFQN): Remove.
6999 * decl.cs (DeclSpace.MakeFQN): Likewise.
7000 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7001 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7002 TypeManager.GetConstructedType.
7003 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7005 2005-03-15 Marek Safar <marek.safar@seznam.cz>
7007 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7010 * cs-parser.jay: Reports CS1527 for any namespace element.
7012 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7015 * expression.cs (ParameterReference.IsAssigned): Changed error to
7017 (Error_WrongNumArguments): Moved CS0245 detection here.
7019 * statement.cs (Return.Resolve): Add CS1622 report.
7021 2005-03-11 Marek Safar <marek.safar@seznam.cz>
7023 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7025 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
7027 * attribute.cs expression.cs: Get rid of some allocations.
7029 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
7031 * doc.cs : just eliminate the latest change.
7033 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7035 * doc.cs : commented out the latest change. It breaks xml-030.cs
7037 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7039 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7040 fail. So invoke CreateType() in FindDocumentedType().
7042 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7044 * cs-tokenizer.cs : added IsKeyword().
7045 * doc.cs : Detect keyword incorrectly used as identifier.
7046 Allow identifiers prefixed by @.
7048 2005-03-10 Marek Safar <marek.safar@seznam.cz>
7050 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7051 It caused exception in namespace resolving (again!).
7053 * class.cs (Class.ctor): Removed exit.
7054 (PropertyMethod.ctor): ditto.
7056 * codegen.cs (Codegen.Reset): Reset static data.
7057 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7059 * cs-tokenizer.cs (Cleanup): Removed.
7061 * driver.cs (GetSystemDir): Rewrote to one line command.
7062 It caused problem with unloaded dynamic modules.
7063 (UnixParseOption): Removed Exit.
7064 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7065 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7066 Now can be mcs used as library.
7068 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7071 * location.cs (Reset): Reset static data.
7073 * namespace.cs (Reset): Reset static data.
7075 * report.cs (Report.Reset): Reset static data.
7077 * rootcontext.cs (RootContext.Reset): Reset static data.
7079 * tree.cs (RootTypes.ctor): Use Location.Null
7081 * typemanager.cs (TypeManager.Reset): Reset static data.
7082 (CoreLookupType): Removed Exit.
7083 (TypeHandle.Reset): Reset static data.
7085 2005-03-10 Raja R Harinath <rharinath@novell.com>
7088 * typemanager.cs (ComputeNamespaces): Import namespaces from
7089 referenced modules too.
7091 2005-03-09 Raja R Harinath <rharinath@novell.com>
7093 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7096 2005-03-09 Raja R Harinath <rharinath@novell.com>
7098 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7099 enclosing DeclSpace. This ensures that a name-lookup populates
7100 more caches and there are fewer 'TypeExpression's. Carve out
7101 nested type lookup into ...
7102 (LookupNestedTypeInHierarchy): ... this.
7104 2005-03-09 Raja R Harinath <rharinath@novell.com>
7106 Clean up a few partial-class semantics.
7107 Fixes test-357.cs and cs1618-2.cs.
7108 * cs-parser.jay (struct_declaration): Use 'current_class' as
7109 parent of newly-created struct. Remove call to Register ().
7110 Use 'pop_current_class' to complete handing the current struct.
7111 (interface_declaration): Likewise.
7112 (class_declaration): Likewise.
7113 (enum_declaration): Use 'current_class' as parent of newly created
7115 (delegate_declaration): Likewise.
7116 (pop_current_class): New function. This is used to handle closing
7117 up the 'current_class' and 'current_container', and pointing them
7118 to the enclosing class/container.
7119 (CSharpParser): Initialize 'current_class' too.
7120 * decl.cs (MemberCore): Add check for invariant: a partial
7121 container is not a parsed entity, and thus does not enclose any
7123 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7124 (DeclSpace.BaseTypeExpr): Use it.
7125 (DeclSpace.LookupType): Add check for invariant.
7126 * class.cs (TypeContainer): Add check for invariant: a nested
7127 class should have the same NamespaceEntry as its enclosing class.
7128 (TypeContainer.EmitFieldInitializers): Make virtual.
7129 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7131 (TypeContainer.Register): Remove.
7132 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7133 null. Use TypeResolveEmitContext for resolving base types and
7134 interfaces. Move initialization of Parts.TypeBuilder here from
7136 (TypeContainer.DefineNestedTypes): ... here.
7137 (PartialContainer): Take a Namespace not a NamespaceEntry.
7138 (PartialContainer.Create): Don't use Register. Call the
7139 appropriate Add... function directly.
7140 (ClassPart): Take both the PartialContainer and the enclosing
7141 class as constructor arguments.
7142 (ClassPart.EmitFieldInitializers): Override.
7143 (ClassPart.PartFindNestedTypes): Remove.
7144 (FieldBase.GetInitializerExpression): Resolve the initializer
7145 expression in the emit context of the enclosing class.
7146 * tree.cs (RootTypes): Remove Register ().
7148 2005-03-08 Marek Safar <marek.safar@seznam.cz>
7150 * cs-parser.jay: Removed CS0134.
7152 * driver.cs: Removed CS1901.
7154 * expression.cs (SizeOf.DoResolve): Don't report CS0233
7155 for predefined types.
7157 2005-03-07 Duncan Mak <duncan@novell.com>
7159 * codegen.cs (Save): Catch UnauthorizedAccessException as
7160 well. Fixes bug #73454.
7162 2005-03-07 Marek Safar <marek.safar@seznam.cz>
7164 * cs-tokenizer.cs (xtoken): Add CS1035.
7166 * class.cs (MethodData.Define): Add CS0683.
7167 (FieldMember.ctor): Add CS0681.
7169 2005-03-07 Raja R Harinath <rharinath@novell.com>
7171 * ecore.cs (SimpleName.DoResolve): Rename from
7172 SimpleName.DoResolveAllowStatic.
7173 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7174 Pass 'intermediate' flag to MemberStaticCheck.
7175 (SimpleName.MemberStaticCheck): Skip "static check" only in case
7176 of "intermediate" lookups via MemberAccess.
7177 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
7178 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7180 2005-03-07 Raja R Harinath <rharinath@novell.com>
7183 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7184 slipped in because of variable names that are identical to a
7185 builtin type's BCL equivalent ('string String;', 'int Int32;').
7186 (PropertyExpr.EmitInstance): Likewise.
7188 2005-03-04 Marek Safar <marek.safar@seznam.cz>
7190 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7192 * report.cs (warning_ignore_table): Made public.
7194 2005-03-04 Raja R Harinath <rharinath@novell.com>
7197 * class.cs (MethodData.Emit): Pass 'container' to
7198 container.GetObsoleteAttribute instead of 'container.Parent'.
7200 2005-03-03 Marek Safar <marek.safar@seznam.cz>
7202 * cs-parser.jay: Add 1534 error test.
7204 * iterators.cs (Yield.CheckContext): Add error 1629.
7205 (Iterator.ctor): Save unsafe modifier.
7206 (MoveNextMethod.DoEmit): Restore unsafe context.
7208 * namespace.cs (UsingAlias): Better error message.
7210 2005-03-03 Dan Winship <danw@novell.com>
7212 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7213 the warning message [#73219]
7215 2005-03-03 Raja R Harinath <rharinath@novell.com>
7217 Fix compile with MCS 1.0.0.0.
7218 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7219 w_restore to not depend on string constant folding.
7221 2005-03-03 Raja R Harinath <rharinath@novell.com>
7223 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
7224 CS0246 check to users who passed 'silent = false'.
7225 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7227 (SimpleName.SimpleNameResolve): Update.
7228 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7229 (MemberAccess.IdenticalNameAndTypeName): Update.
7230 * doc.cs (FindDocumentedTypeNonArray): Update.
7232 2005-03-03 Raja R Harinath <rharinath@novell.com>
7234 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7235 * parameters.cs (ComputeAndDefineParameters): Remove.
7236 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7237 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7238 Use GetParameterInfo.
7240 2005-03-02 Marek Safar <marek.safar@seznam.cz>
7242 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7244 2005-03-02 Raja R Harinath <rharinath@novell.com>
7246 Unify DeclSpace.LookupType and DeclSpace.FindType.
7247 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
7248 is in charge of defining nested types on demand.
7249 (DeclSpace.LookupType): Use it when the current_type is a
7250 TypeBuilder. Use LookupTypeDirect for reflected types.
7251 (DeclSpace.FindType): Remove.
7252 (DeclSpace.LookupInterfaceOrClass): Likewise.
7253 (DeclSpace.DefineTypeAndParents): Likewise.
7254 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7255 DeclSpace.LookupType.
7256 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7257 * typemanager.cs (LookupType): Simplify.
7258 (AddUserType): Remove type from negative_hits.
7259 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7260 * class.cs (TypeContainer.FindMembers): Move handling of nested
7262 (TypeContainer.FindMembers_NestedTypes): ... here.
7263 (TypeContainer.FindNestedType): Implement override.
7264 (ClassPart.FindNestedType): Delegate to PartialContainer.
7265 (ClassPart.PartFindNestedType): Looks up the nested types of the
7268 2005-03-02 Martin Baulig <martin@ximian.com>
7270 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7271 static constructor in static classes.
7273 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
7275 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7276 sizeParamIndex is not specified.
7278 2005-03-01 Marek Safar <marek.safar@seznam.cz>
7281 * report.cs (WarningMessage.IsEnabled): Missing null check.
7283 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7285 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7286 in the fields and not in the properties.
7288 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
7290 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
7293 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7295 * attribute.cs: Small refactoring (improved robustness).
7296 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7297 (ValidateGuid): Removed.
7298 (Resolve): Removed referenced to above mentioned.
7299 (GetAttributeUsage): Made private and changed to work without
7301 (GetIndexerAttributeValue): Don't crash.
7302 (GetConditionalAttributeValue): Ditto.
7303 (GetClsCompliantAttributeValue): Ditto.
7304 (ExtractSecurityPermissionSet): All attributes exceptions are
7306 (GetPropertyValue): New helper.
7307 (GetMethodImplOptions): New method.
7308 (DefinePInvokeMethod): Reuse common code. Implemented handling of
7309 some missing properties.
7311 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7312 (Method.ApplyAttributeBuilder): Updated.
7314 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7317 2005-02-28 Raja R Harinath <rharinath@novell.com>
7320 * report.cs (Report.SymbolRelatedToPreviousError): Handle
7321 non-simple types (array, pointer, reference).
7323 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7325 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7327 * class.cs (MethodCore.IsDuplicateImplementation): Special error
7329 (Method.CheckBase): Catch wrong destructor here.
7330 (MethodData.Define): Add errors 550, 668.
7332 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7334 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7336 * pending.cs (VerifyPendingMethods): Add error 551.
7338 * typemanager.cs (CSharpName): Next error report helper.
7340 2005-02-25 Marek Safar <marek.safar@seznam.cz>
7342 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7343 attributes. Removed useless attribute double check.
7344 It saves almost 2MBs for corlib.
7346 2005-02-25 Raja R Harinath <rharinath@novell.com>
7349 * statement.cs (ExpressionStatement.Resolve): Make robust to being
7350 called twice in case of error.
7352 2005-02-23 Chris Toshok <toshok@ximian.com>
7354 Fix compiler portions of #72827.
7355 * statement.cs (Block.Emit): call Begin/EndScope on the
7356 EmitContext instead of the ILGenerator.
7358 * codegen.cs (EmitContext.BeginScope): new method, call
7359 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7361 (EmitContext.BeginScope): same, but EndScope and CloseScope
7363 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7364 offset and call the superclass's OpenScope(int) with it.
7365 (SymbolWriter.CloseScope): get the current il
7366 offset and call superclass's CloseScope(int) with it.
7368 2005-02-23 Marek Safar <marek.safar@seznam.cz>
7370 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7371 CS1677 for out and ref as well.
7373 * class.cs (Method.Define): Add error CS1599 detection.
7375 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7377 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7379 * delegate.cs (Delegate.Define): Add error CS1599 detection.
7381 * support.cs.cs (ModifierDesc): New helper method.
7383 2005-02-23 Raja R Harinath <rharinath@novell.com>
7384 Abin Thomas <projectmonokochi@rediffmail.com>
7385 Anoob V E <projectmonokochi@rediffmail.com>
7386 Harilal P R <projectmonokochi@rediffmail.com>
7389 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7390 MemberLookup (used for error reporting) actually returns a result.
7391 Fix error report number (122, not 112).
7393 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
7394 Anoob V E <projectmonokochi@rediffmail.com>
7395 Harilal P R <projectmonokochi@rediffmail.com>
7398 * pending.cs (PendingImplementation.GetAbstractMethods):
7399 Find NonPublic members too.
7401 2005-02-22 Marek Safar <marek.safar@seznam.cz>
7403 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7406 * class.cs (MethodCore.CheckMethodAgainstBase):
7407 Add error 239 report.
7409 2005-02-21 Raja R Harinath <rharinath@novell.com>
7412 * expression.cs (Invocation.IsApplicable): Make public.
7413 (Invocation.IsParamsMethodApplicable): Likewise.
7414 * delegate.cs (Delegate.VerifyApplicability): Don't use
7415 Invocation.VerifyArgumentCompat for parameter applicability
7416 testing. Use Invocation.IsApplicable and
7417 Invocation.IsParamsMethodApplicable.
7419 2005-02-21 Marek Safar <marek.safar@seznam.cz>
7421 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7423 * class.cs (Operator.Define): Add error 217 report.
7425 2005-02-21 Raja R Harinath <rharinath@novell.com>
7427 * namespace.cs (UsingEntry.Resolve): Undo change below.
7429 2005-02-21 Raja R Harinath <rharinath@novell.com>
7432 * ecore.cs (Expression.MemberLookupFailed): Add argument to
7433 disable the error message when the extended MemberLookup also
7435 (Expression.MemberLookupFinal): Update.
7436 (SimpleName.DoSimpleNameResolve): Update.
7437 * expression.cs (MemberAccess.ResolveNamespaceOrType):
7438 Don't use MemberLookupFinal.
7439 (New.DoResolve): Update.
7440 (BaseAccess.CommonResolve): Update.
7442 2005-02-21 Raja R Harinath <rharinath@novell.com>
7445 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7446 occured previously, don't resolve again.
7448 2005-02-21 Marek Safar <marek.safar@seznam.cz>
7451 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7452 argument. Call ResolveAttributeUsage for unresolved.
7453 when types doesn't match ctor arguments.
7455 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7456 for nested attribute classes.
7457 (Class.attribute_usage): Removed.
7458 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7459 for attribute class.
7461 * ecore.cs (IsAttribute): Removed.
7463 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7465 * rootcontext.cs (RegisterAttribute): Removed, attributes are
7467 (attribute_types): Removed.
7468 (EmitCode): Global attributes are emited as the latest.
7470 2005-02-18 Marek Safar <marek.safar@seznam.cz>
7472 * class.cs (EmitFieldInitializers): Don't emit field initializer
7473 for default values when optimilization is on.
7475 * constant.cs (Constant.IsDefaultValue): New property.
7477 * driver.cs: Add /optimize handling.
7481 * literal.cs: Implement new IsDefaultValue property.
7483 * rootcontext.cs (Optimize): New field, holds /optimize option.
7485 2005-02-18 Raja R Harinath <rharinath@novell.com>
7487 Fix crasher in re-opened #72347.
7488 * namespace.cs (Namespace.Lookup): Return null if
7489 DeclSpace.DefineType returns null.
7492 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7494 2005-02-18 Raja R Harinath <rharinath@novell.com>
7496 Fix remainder of #63202. Change semantics of DoResolveLValue: it
7497 now returns null if it cannot resolve to an lvalue.
7498 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7499 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7500 returned null. Remove check for SimpleName.
7501 (EventExpr.DoResolveLValue): New.
7502 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7503 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
7505 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
7507 (Unary.ResolveOperator): Move CS0211 check ...
7508 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
7510 (Unary.DoResolveLValue): Simplify.
7511 (AddressOf.DoResolveLValue): New.
7512 (ArrayAccess.DoResolveLValue): New.
7514 2005-02-16 Marek Safar <marek.safar@seznam.cz>
7516 * attribute.cs (Attribute.Resolve): Add arguments casting for
7517 when types doesn't match ctor arguments.
7519 2005-02-16 Raja R Harinath <rharinath@novell.com>
7521 Fix parts of #63202.
7522 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7523 lookup of operator in base type. Ensure that all checks happen
7524 when the operator resolves to an "op_..." method.
7526 2005-02-15 Raja R Harinath <rharinath@novell.com>
7529 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7530 'ignore_cs0104' parameter. Pass it to ...
7531 (NamespaceEntry.Lookup): ... this.
7532 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7533 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7534 (TypeLookupExpression.DoResolveAsTypeStep): Update.
7535 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7536 Update. Request that cs0104 errors be ignored.
7537 (ComposedCast.ResolveAsTypeStep): Update.
7539 2005-02-14 Raja R Harinath <rharinath@novell.com>
7542 * expression.cs (Invocation.BetterFunction): Remove support for
7543 comparing virtual functions and their overrides.
7544 (Invocation.IsOverride): New.
7545 (Invocation.OverloadResolve): Don't consider 'override' functions
7546 during candidate selection. Store them in a lookaside list.
7547 If the selected method is a 'virtual' function, use the list to
7548 find any overrides that are closer to the LHS type.
7550 2005-02-14 Marek Safar <marek.safar@seznam.cz>
7552 * expression.cs (New.DoResolve): Add complex core type reduction.
7553 (New.Constantify): Converts complex core type syntax like 'new int ()'
7556 2005-02-14 Raja R Harinath <rharinath@novell.com>
7558 * decl.cs (EntryType.EntryType): New constructor to create an
7559 updated copy of a cache entry.
7560 (MemberCache.AddMethods): Use it.
7561 (MemberCache.ClearDeclaredOnly): Remove.
7562 (MemberCache.MemberCache): Update.
7564 2005-02-11 Miguel de Icaza <miguel@novell.com>
7566 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7567 variable. This one is represents the actual low-level declaration
7568 of the method, as opposed to the semantic level `IsStatic'.
7570 An anonymous method which is hosted into a static method might be
7571 actually an instance method. IsStatic would reflect the
7572 container, while MethodIsStatic represents the actual code
7575 * expression.cs (ParameterReference): Use the new MethodIsStatic
7576 instead of IsStatic.
7578 * anonymous.cs (AnonymousMethod.Compatible): Pass the
7579 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7580 set on the current EmitContext.
7582 * expression.cs (Cast): Overload DoResolveLValue so we can pass
7583 resolve our casted expression as an LValue. This triggers the
7584 proper LValue processing that is later required by Assign.
7588 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7590 2005-02-11 Marek Safar <marek.safar@seznam.cz>
7592 C# 2.0 Fixed buffer implementation
7594 * anonymous.cs: Update after RegisterHelperClass renaming.
7596 * attribute.cs (AttributeTester.fixed_buffer_cache):
7597 Cache of external fixed buffers.
7598 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7599 implementation if field is fixed buffer else null.
7602 (TypeContainer.AddField): Accept FieldMember instead of Field.
7603 (FieldBase.IsFieldClsCompliant): Extracted code from
7604 VerifyClsCompliance descendant customization.
7605 (FixedField): New class handles fixed buffer fields.
7606 (FixedFieldExternal): Keeps information about imported fixed
7608 (IFixedField): Make access to internal or external fixed buffer
7611 * cs-parser.jay: Add fixed buffer parsing.
7613 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7616 * expression.cs (Indirection): Extended implementation to accept
7618 (PointerArithmetic.Emit): Get element from fixed buffer as well.
7619 (ElementAccess.MakePointerAccess): Get type as parameter.
7620 (DoResolve): Add fixed buffer field expression conversion.
7621 (DoResolveLValue): Ditto.
7622 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7623 (ArrayPtr): Derives from FixedBufferPtr.
7624 (ArrayPtr.Emit): Add extra emit for array elements.
7626 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7628 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7629 for compiler generated types.
7630 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7632 * statement.cs (Fixed): Refactored to be easier add fixed buffer
7633 and consume less memory.
7634 (Fixed.Resolve): Add fixed buffer case.
7636 * typemanager.cs (compiler_generated_attr_ctor,
7637 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7638 (HasElementType): Add our own implementation to work on every
7641 2005-02-11 Miguel de Icaza <miguel@novell.com>
7643 * anonymous.cs (CaptureContext): Track whether `this' has been
7646 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
7647 only captured `this' if it was implicitly done (instance
7648 methods/variables were used).
7650 * codegen.cs (EmitContext.CaptureThis): New method to flag that
7651 `this' must be captured.
7653 2005-01-30 Miguel de Icaza <miguel@novell.com>
7655 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7656 is null it means that there has been no need to capture anything,
7657 so we just create a sibling.
7659 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7661 Just a partial fix. The other half is fairly elusive.
7663 2005-02-10 Raja R Harinath <rharinath@novell.com>
7665 Fix #52586, cs0121-4.cs.
7666 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
7667 and return a hashtable.
7668 (MemberCache.ClearDeclaredOnly): New.
7669 (MemberCache.MemberCache): Update to change. Make a deep copy of
7670 the method_hash of a base type too.
7671 (MemberCache.AddMethods): Adapt to having a deep copy of the base
7672 type methods. Overwrite entries with the same MethodHandle so
7673 that the ReflectedType is correct. The process leaves in base
7674 virtual functions and their overrides as distinct entries.
7675 (CacheEntry): Now a class instead of a struct. It shouldn't alter
7676 matters since it was boxed in a ArrayList before.
7677 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7679 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
7680 case of a virtual function and its override (choose the overload
7682 (Invocation.OverloadResolve): Avoid 'override' members during
7683 'applicable_type' calculation.
7685 2005-02-09 Raja R Harinath <rharinath@novell.com>
7687 Combine two near-redundant caches.
7688 * typemanager.cs (method_params): Rename from method_internal_params.
7689 (TypeManager.GetParameterData): New. Replace
7690 Invocation.GetParameterData.
7691 (TypeManager.LookupParametersByBuilder): Remove.
7692 * expression.cs (Invocation.method_parameter_cache): Remove.
7693 (Invocation.GetParameterData): Remove.
7695 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7698 2005-02-08 Raja R Harinath <rharinath@novell.com>
7701 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7702 TypeManager.multicast_delegate_type is null, resolve it by looking
7703 up "System.MulticastDelegate".
7704 * rootcontext.cs (RootContext.ResolveCore): Simplify.
7706 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
7707 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
7708 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
7711 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7712 (LabeledStatement.AddReference): New. Set 'referenced'.
7713 (Goto.Resolve): Use it.
7715 2005-02-05 John Luke <john.luke@gmail.com>
7717 * driver.cs: remove duplicate -doc line in Usage ()
7719 2005-02-04 Raja R Harinath <rharinath@novell.com>
7721 * location.cs (Location.AddFile): Fix CS2002 error report.
7723 2005-02-02 Martin Baulig <martin@ximian.com>
7725 * delegate.cs (Delegate.DefineType): Report an internal error if
7726 TypeManager.multicast_delegate_type is null. See bug #72015 for
7729 2005-02-02 Raja R Harinath <rharinath@novell.com>
7731 Fix a crasher in a variant of #31984.
7732 * const.cs (Constant.CheckBase): New override that defers the
7733 new-or-override check in case the base type hasn't been populated
7735 (Constant.Define): Ensure the new-or-override check is performed.
7737 2005-02-01 Duncan Mak <duncan@ximian.com>
7739 * const.cs (LookupConstantValue): Check that `ce' is not null
7740 before calling GetValue ().
7742 2005-02-01 Raja R Harinath <rharinath@novell.com>
7744 Fix test-334.cs (#69519).
7745 * cs-parser.jay (using_alias_directive): Pass in an expression to
7746 NamespaceEntry.UsingAlias.
7747 (using_namespace_directive): Pass in an expression to
7748 NamespaceEntry.Using.
7749 (namespace_name): Don't flatten to a string.
7750 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7751 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7753 (NamespaceEntry.UsingEntry): Likewise.
7754 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7756 (NamespaceEntry.LookupForUsing): Remove.
7757 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7759 (NamespaceEntry.Lookup): Remove support for dotted names.
7761 2005-02-01 Raja R Harinath <rharinath@novell.com>
7763 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7765 (NamespaceEntry.ImplicitParent): Compute on demand.
7766 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7767 parallels the current.
7768 (NamespaceEntry.LookupForUsing): Use it.
7769 (NamespaceEntry.Lookup): If the current namespace-entry is
7770 implicit, don't search aliases and using tables.
7772 2005-02-01 Raja R Harinath <rharinath@novell.com>
7775 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7777 (TypeContainer.BaseCache): Compute on demand.
7778 (TypeContainer.FindMembers): Define constants and types if they're
7779 not already created.
7780 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7782 * const.cs (Constant.Define): Make idempotent.
7784 2005-01-29 Miguel de Icaza <miguel@novell.com>
7786 * pending.cs: Produce better code (no nops produced by using Ldarg
7789 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7790 i - 1' it should be arg + 1.
7794 2005-01-28 Raja R Harinath <rharinath@novell.com>
7796 * attribute.cs (Attribute.CheckAttributeType): Make private
7798 (Attribute.ResolveType): Make virtual.
7799 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7800 handling of RootContext.Tree.Types.
7802 2005-01-27 Raja R Harinath <rharinath@novell.com>
7804 Update attribute-handling to use the SimpleName/MemberAccess
7806 * cs-parser.jay (attribute): Pass in an expression to the
7807 constructors of Attribute and GlobalAttribute.
7808 * attribute.cs (Attribute): Take an expression for the name.
7809 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7810 passed in attribute name expression.
7811 (Attribute.CheckAttributeType): Use it.
7812 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7813 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7814 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7815 argument to prevent error messages if the lookup fails.
7817 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7819 * expression.cs (Indirection): Implemented IVariable interface
7820 to support indirection in AddressOf operator.
7821 (PointerArithmetic.Emit): Add optimalization for case where
7822 result can be precomputed.
7824 2005-01-26 Martin Baulig <martin@ximian.com>
7826 * class.cs (TypeContainer.AttributeTargets): Return the correct
7827 AttributeTargets depending on our `Kind' instead of throwing an
7828 exception; fixes #71632.
7830 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7833 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7836 2005-01-25 Raja R Harinath <rharinath@novell.com>
7839 * expression.cs (MemberAccess.DoResolve): Don't complain with
7840 cs0572 when the LHS of a member access has identical name and type
7843 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7846 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7848 Create custom PermissionSet only for PermissionSetAttribute.
7850 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7853 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7854 delegates in static class.
7856 2005-01-24 Martin Baulig <martin@ximian.com>
7858 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7859 merging an implicit block, just use its reachability.
7861 * statement.cs (Block.Resolve): Make the unreachable code check
7862 work wrt. implicit blocks; see test-337 from #63842.
7864 2005-01-21 Alp Toker <alp@atoker.com>
7866 * cs-parser.jay: destructor_declaration's container is PartialContainer
7867 not Class when partial types are used, so use Kind prop instead of
7870 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7872 * cs-parser.jay: Improve error reporting when an interface
7875 2005-01-20 Dick Porter <dick@ximian.com>
7877 * support.cs: SeekableStreamReader fix from Sandor Dobos
7878 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7879 chars are read. Fixes bug 70369.
7881 2005-01-20 Raja R Harinath <rharinath@novell.com>
7883 * cs-parser.jay (catch_clause): Simplify current_block handling
7886 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7888 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7889 code with ImplicitStandardConversion to handle the implicit
7890 conversion of method groups into valid delegate invocations.
7892 The problem is that in parameter handling we were using this code
7893 path. Fixes bug #64698
7895 2005-01-19 Raja R Harinath <rharinath@novell.com>
7897 * cs-parser.jay: Fix several infelicities.
7898 - Avoid assigning to the parser value stack. Code like
7899 '$3 = null' is unclean. Synthesize a value for the code block
7901 - Avoid using oob_stack for storing location information. Use ...
7902 (_mark_): ... this. New (empty) rule. Saves the current location
7904 (foreach_statement): Avoid using oob_stack for current_block
7905 handling. Use technique used in for_statement and
7906 using_statement. Synthesize a value for the code block to store
7907 additional intermediate information.
7909 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7911 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7912 of a different type is only allowed to private fields of a
7913 containing type, not on fields of a base class.
7915 See test-174.cs and error cs0122-9.cs
7917 2005-01-13 Raja R Harinath <rharinath@novell.com>
7919 Fix test-335.cs (bug #58126).
7920 * cs-parser.jay (argument): Split out non-expression parts of the
7921 rule into 'non_simple_argument'.
7922 (invocation_expression): Support parenthesized invocations with
7923 multiple arguments, and with single non-simple arguments.
7925 2005-01-13 Raja R Harinath <rharinath@novell.com>
7927 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7930 2005-01-12 Raja R Harinath <rharinath@novell.com>
7932 Fix cs0038-1.cs, cs1640-6.cs.
7933 * ecore.cs (Expression.Resolve): Remove special-case for
7934 SimpleName in error-handling.
7935 (Expression.almostMatchedMembers): Relax access permission to
7937 (Expression.MemberLookupFailed): Handle duplicates in
7938 almostMatchedMembers list.
7939 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7940 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7941 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7942 overload if the passed in MemberInfo is a MethodBase.
7944 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7947 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7948 for non-CAS & merge permission sets properly.
7950 2005-01-11 Raja R Harinath <rharinath@novell.com>
7952 Improve standard-compliance of simple name and member access
7953 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7954 * ecore.cs (FullNamedExpression): New abstract base class
7955 for Namespaces and TypeExpressions.
7956 (ResolveFlags.SimpleName): Remove.
7957 (SimpleName): Remove support for dotted names.
7958 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7959 DeclSpace.FindType and DeclSpace.LookupType.
7960 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7961 (Expression.ExprClassName): Make member function.
7962 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7963 a namespace. Remove creation of dotted "SimpleName"s.
7964 (MemberAccess.DoResolve): Likewise.
7965 * decl.cs (DeclSpace.Cache): Make private.
7966 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7967 (DeclSpace.FindType): Update.
7968 (DeclSpace.LookupType): Move here from RootContext. Return a
7969 FullNamedExpression.
7970 * namespace.cs (Namespace): Derive from FullNamedExpression
7971 so that it can be part of expression resolution.
7972 (Namespace.Lookup): Return an FullNamedExpression.
7973 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7975 * rootcontext.cs (NamespaceLookup): Remove.
7976 (LookupType): Move to DeclSpace.
7977 * attribute.cs (CheckAttributeType): Update.
7978 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7979 (FindDocumentedTypeNonArray): Likewise.
7981 2005-01-11 Raja R Harinath <rharinath@novell.com>
7983 Fix cs0509.cs, cs1632.cs.
7984 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7985 is the same as IsInterface.
7986 (TypeContainer.GetClassBases): Likewise.
7987 * statement.cs (LabeledStatement.ig): New field.
7988 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7990 (LabeledStatement.DoEmit): Check that the label was created with
7991 the same ILGenerator.
7993 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7996 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7997 accessors to its properties.
7999 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8000 from accessors to property.
8002 2005-01-10 Marek Safar <marek.safar@seznam.cz>
8005 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8008 2005-01-08 Miguel de Icaza <miguel@ximian.com>
8010 * attribute.cs: Check for null and empty strings.
8012 I have lost another battle to Paolo.
8014 2005-01-07 Marek Safar <marek.safar@seznam.cz>
8017 * class.cs (PropertyMethod): Set Parent field in ctors.
8018 (SetMethod.InternalParameters): Add unsafe switch hack.
8019 Override MarkForDuplicationCheck where it is appropriate.
8021 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8022 It says whether container allows members with the same name.
8024 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8025 Removed is_method parameter.
8027 2005-01-06 Duncan Mak <duncan@ximian.com>
8029 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8030 because the previous change led to incorrect reporting of CS1032
8031 ("Cannot define/undefine preprocessor symbols after first token in
8032 file"). Instead of using `tokens_seen' as the only flag that
8033 triggers CS1040, introduce `comments_seen'. This new flag is used
8034 to signify having seen comments on the current line, so it is
8035 unset after a newline.
8037 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
8039 * doc.cs : When searching for a type, find nested type too.
8040 This fixes bug #71040.
8042 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
8045 - Warn missing member comment on those classes which also does not
8046 have doc comments. Fixed bug #71041.
8047 - Don't warn missing doc comment on default constructor.
8050 2005-01-06 Duncan Mak <duncan@ximian.com>
8052 * cs-tokenizer.cs (xtoken): After handling traditional C-style
8053 comments, set `tokens_seen' to true. This allows us to detect
8054 misplaced preprocessor directives (i.e. not at the beginning of
8055 the a line, nor after whitespaces). In that case, report error
8056 CS1040. This fixes bug #56460.
8058 * cs-parser.jay (interface_member_declaration): Add checks for
8059 IsExplicitImpl, and report CS0541 error if an interface member is
8060 defined as an explicit interface declaration.
8062 2005-01-06 Marek Safar <marek.safar@seznam.cz>
8065 * class.cs (PropertyMethod): Set Parent field in ctors.
8066 (SetMethod.InternalParameters): Add unsafe switch hack.
8068 * decl.cs (MemberCore.Parent): Cannot be readonly.
8070 2005-01-06 Raja R Harinath <rharinath@novell.com>
8072 * decl.cs (DeclSpace.ResolveType): Remove.
8073 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8074 Merge in code from ...
8075 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
8076 * class.cs, enum.cs: Update to changes.
8078 2005-01-06 Miguel de Icaza <miguel@ximian.com>
8080 * anonymous.cs: Ensure that we init the scope of our parent if it
8081 has not been initialized yet.
8083 2004-12-30 Duncan Mak <duncan@ximian.com>
8085 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8086 if field.FieldBuilder is null. Fixes #70758.
8088 * convert.cs: Fixed some typos and updated some of the comments.
8089 (ImplicitStandardConversionExists):
8090 (TryImplicitIntConversion): If `target_type' is an interface and
8091 the type of `ic' implements this interface, return true or a new
8092 BoxedCast instead of null. This fixes #70468.
8094 2004-12-29 Duncan Mak <duncan@ximian.com>
8096 * expression.cs (Argument.Emit): Check that Expr is
8097 IMemoryLocation before casting to it, and report CS1510 otherwise.
8101 2004-12-21 Ben Maurer <bmaurer@ximian.com>
8103 * statement.cs (Block.ThisVariable): remove the recursion here, to
8104 make the --profile more sane.
8106 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
8108 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8109 assembly, by JB Evain.
8111 2004-12-17 Raja R Harinath <rharinath@novell.com>
8113 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
8114 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8115 "parent" refers to enclosing type/class. "base" refers to superclass.
8117 2004-12-17 Raja R Harinath <rharinath@novell.com>
8119 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8120 Ensure that we only have GlobalAttributes.
8121 * attribute.cs (Attribute.Emit): Make non-virtual.
8122 (GlobalAttribute.Emit): Remove.
8123 (Attribute.Resolve): Make virtual.
8124 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
8125 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8126 the argument. Don't create one.
8127 (Attribute.GetObsoleteAttribute): Likewise.
8128 (Attribute.GetClsCompliantAttributeValue): Likewise.
8129 * class.cs, decl.cs: Update to changes.
8131 2004-12-17 Marek Safar <marek.safar@seznam.cz>
8133 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8135 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8137 * statement.cs (Foreach.Resolve): Add error 186 report.
8139 2004-12-16 Marek Safar <marek.safar@seznam.cz>
8141 * expression.cs (Conditional.DoResolve): Add warning 429.
8143 * statement.cs (If.Resolve): Add warning 665.
8145 2004-12-16 Raja R Harinath <rharinath@novell.com>
8147 New invariant: RootContext.Tree.Types.NamespaceEntry == null
8148 except when in the parser, and in GlobalAttribute.
8149 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8150 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8151 RootContext.Tree.Types.NamespaceEntry once work is done.
8152 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
8153 and resets RootContext.Tree.Types.NamespaceEntry.
8155 2004-12-15 Marek Safar <marek.safar@seznam.cz>
8157 * cs-parser.jay: Don't create a block for every variable.
8159 2004-12-14 Miguel de Icaza <miguel@ximian.com>
8161 * location.cs: Provide extra information.
8163 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8164 variables from the captured environment, it is the ldarg_0.
8166 2004-12-14 Marek Safar <marek.safar@seznam.cz>
8168 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8171 * class.cs: Changed warning level for 169 to avoid developer
8172 displeasure from warning flooding. It will be changed back when they
8173 fix most of current BCL warnings.
8175 * RootContext.cs: Pushed default WarningLevel to 3.
8177 * statement.cs: Removed unused variable.
8179 2004-12-14 Marek Safar <marek.safar@seznam.cz>
8181 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8182 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8183 Add error 502 report.
8184 (StaticClass.DefineType): Add error 441 report.
8185 (Class.AllowedModifiersProp): New virtual property as temporary
8186 extension to AllowedModifiers.
8187 (Class.DefineType): Add error 418 report. Moved ModFlags check here
8188 to share implementation with StaticClass and don't call virtual
8191 * driver.cs (MainDriver): Add error 1558 test.
8193 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8194 report. Moved error 36 test here.
8196 * statement.cs (Throw.Resolve): Add error 724 report.
8198 * typemanager.cs: Add out_attribute_type core type.
8200 2004-12-13 Marek Safar <marek.safar@seznam.cz>
8202 * class.cs (TypeContainer.VerifyClsCompliance): Add error
8204 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8206 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8209 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8211 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
8212 Add error 3023 report.
8213 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8215 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8218 2004-12-12 John Luke <john.luke@gmail.com>
8220 * driver.cs (AddArgs): take -- into account when
8221 adding arguments, fixes bug 65710
8223 2004-12-12 Martin Baulig <martin@ximian.com>
8225 * expression.cs (Unary.TryReduceNegative): Added support for
8226 SByteConstant and ByteConstant.
8227 (Unary.Reduce): Check error values from TryReduceNegative().
8229 2004-12-10 Marek Safar <marek.safar@seznam.cz>
8231 * attributes.cs (Attribute.Resolve): Avoid multiple error report
8232 and report exception as error 182.
8234 2004-12-10 Raja R Harinath <rharinath@novell.com>
8236 * driver.cs (Main): Fix message when there are warnings.
8238 2004-12-09 Miguel de Icaza <miguel@ximian.com>
8240 * delegate.cs: Fixed my fix from yesterday, sorry about that.
8242 2004-12-09 Marek Safar <marek.safar@seznam.cz>
8244 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
8245 Reduced number of warnings.
8247 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8249 2004-12-08 Miguel de Icaza <miguel@ximian.com>
8251 * driver.cs: Removed message.
8253 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8255 2004-12-08 <vargaz@freemail.hu>
8257 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8259 2004-12-08 Martin Baulig <martin@ximian.com>
8261 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8262 instead of a CS3002 for properties and indexer.
8264 2004-12-08 Martin Baulig <martin@ximian.com>
8266 * decl.cs (MemberName.ToString): Make this work again.
8268 2004-12-08 Marek Safar <marek.safar@seznam.cz>
8270 * attribute.cs (Resolve): Add error 591 detection.
8272 * class.cs (FieldMember.Define): Add error 1547 detection.
8273 (Indexer.Define): Add error 620 detection.
8274 (Operator.Define): Add error 590 detection.
8276 * ecore.cs: Missing argument for error 79.
8278 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8281 2004-12-07 Marek Safar <marek.safar@seznam.cz>
8284 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8287 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
8289 * cs-parser.jay : handle doc comments on implicit/explicit operators.
8290 Some operator comments were suppressed.
8291 * doc.cs : Implicit/explicit operator name in doc comments are like
8292 "op_Explicit(type)~returnType", so added suffix handling.
8294 2004-12-07 Martin Baulig <martin@ximian.com>
8297 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8298 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8299 (DeclSpace.ec): New protected field; store the EmitContext here.
8300 (DeclSpace.EmitContext): New public property; moved here from
8302 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8305 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8306 (Enum.Emit): Don't create a new EmitContext.
8308 * delegate.cs (Delegate.DefineType): Always create the
8311 * iterators.cs (Iterators.DefineIterator): Create a new
8312 EmitContext and store it in `ec'.
8314 2004-08-24 Martin Baulig <martin@ximian.com>
8317 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8318 this for accessibility checks.
8319 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8320 IsNestedFamilyAccessible.
8321 (TypeManager.IsSubclassOf): New method, do what the name actually
8324 2004-12-06 Raja R Harinath <rharinath@novell.com>
8326 Fix crash on cs0657-17.cs.
8327 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8328 Use RootContext.Tree.Types, not 'new RootTypes ()'.
8329 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8330 the case where the NamespaceEntry gets overwritten.
8332 2004-12-06 Marek Safar <marek.safar@seznam.cz>
8334 Fixed #69195, #56821
8335 * ecore.cs (ResolveBoolean): Tiny refactoring.
8337 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8338 of right expression resolving when left is false constant and
8339 operator is LogicalAnd OR true constant and operator is LogicalOr.
8341 * statement.cs (ResolveUnreachable): Always reports warning.
8343 2004-12-05 Miguel de Icaza <miguel@ximian.com>
8345 * class.cs: Distinguish between 1721 and 1722 (just a little help
8346 for the programmer).
8348 2004-12-03 Miguel de Icaza <miguel@ximian.com>
8350 * delegate.cs: Only allow this on new versions of the language.
8352 2004-12-02 Duncan Mak <duncan@ximian.com>
8354 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8356 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8357 here as a static method. Take an additional bool out parameter
8358 `must_do_cs1540_check' for signaling to InstanceResolve.
8359 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8360 member field from PropertyExpr class and made it an argument of
8362 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8363 check for MarshalByRefObject, and report CS0122 instead of CS1540.
8364 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8365 and `remove_accessor' as well as InstanceResolve: report CS0122
8370 2004-12-03 Raja R Harinath <rharinath@novell.com>
8372 Fix test-327.cs, test-328.cs, and put in early infrastructure
8373 for eventually fixing #52697.
8374 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8375 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8377 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8378 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8379 (VerifyUsing, error246): Update.
8380 * rootcontext.cs (RootContext.NamespaceLookup): Just use
8381 'NamespaceEntry.LookupNamespaceOrType'.
8383 2004-12-03 Martin Baulig <martin@ximian.com>
8385 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8386 method as our child, call AnonymousMethod.Compatible() on it.
8388 2004-12-03 Raja R Harinath <rharinath@novell.com>
8390 Disable XML documentation support in 'basic' profile.
8391 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8392 Redirect XmlElement to System.Object.
8393 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8394 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8395 * mcs.exe.sources: Add doc-bootstrap.cs.
8396 * doc-bootstrap.cs: New file. Contains empty stub implementation
8399 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
8401 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8402 comments are allowed.
8404 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8406 * delegate.cs: Add checks for subtypes in paramaters and return values
8407 in VerifyMethod () to add support for Covariance/Contravariance
8410 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8412 * report.cs: Remove extra closing parenthesis.
8414 * convert.cs (Error_CannotImplicitConversion): If the name of the
8415 types are the same, provide some extra information.
8417 * class.cs (FieldBase): Use an unused bit field from the field to
8418 encode the `has_offset' property from the FieldMember. This saves
8419 a couple of Ks on bootstrap compilation.
8421 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8422 method as our child, return the AnonymousMethod resolved
8425 * expression.cs (New.DoResolve): Allow return values from
8426 NewDelegate to also include AnonymousMethods.
8430 2004-12-02 Marek Safar <marek.safar@seznam.cz>
8433 * attribute.cs (Resolve): Improved implementation of params
8434 attribute arguments.
8436 * support.cs (ParameterData): Add HasParams to be faster.
8438 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
8440 all things are for /doc support:
8442 * doc.cs: new file that supports XML documentation generation.
8443 * mcs.exe.sources: added doc.cs.
8445 Handle /doc command line option.
8446 Report error 2006 instead of 5 for missing file name for /doc.
8447 Generate XML documentation when required, after type resolution.
8449 Added support for picking up documentation (/// and /** ... */),
8450 including a new XmlCommentState enumeration.
8452 Added lines to fill Documentation element for field, constant,
8453 property, indexer, method, constructor, destructor, operator, event
8454 and class, struct, interface, delegate, enum.
8455 Added lines to warn incorrect comment.
8457 Added Documentation field (passed only when /doc was specified).
8459 Added DocComment, DocCommentHeader, GenerateDocComment() and
8460 OnGenerateDocComment() and some supporting private members for
8461 /doc feature to MemberCore.
8463 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8465 Added overriden DocCommentHeader.
8467 Added overriden DocCommentHeader and GenerateDocComment().
8469 2004-12-01 Miguel de Icaza <miguel@ximian.com>
8471 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8472 unwrapping the enumeration values, chain to
8473 DoConstantNumericPromotions again, so we can promote things to the
8474 fundamental types (takes care of enums that are bytes, sbytes).
8478 2004-12-01 Raja R Harinath <rharinath@novell.com>
8480 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8481 Fix long-standing bug in type-lookup. Use FindType instead of
8482 LookupType when ec.ResolvingTypeTree.
8483 (Attribute.ResolveType, Attribute.Resolve)
8484 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8486 (Attributes.Search): Remove internal version. Update.
8487 (Attributes.SearchMulti): Update.
8488 (Attributes.GetClsCompliantAttribute): Remove.
8489 (Attributes.GetIndexerNameAttribute): Remove.
8490 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8491 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8492 * class.cs (Indexer.Define): Likewise.
8494 2004-12-01 Marek Safar <marek.safar@seznam.cz>
8497 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8498 MarshallByReference members access.
8500 * expression.cs: Use CheckMarshallByRefAccess;
8501 Better error CS0197 message.
8503 * report.cs: Print whole related error message.
8505 2004-11-30 Raja R Harinath <rharinath@novell.com>
8507 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8508 the current directory to help debugging.
8510 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8512 * class (GetClassBases): Better error 60 report.
8513 (EventProperty): Disabled warning 67 detection.
8515 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8518 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8520 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8523 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8526 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8528 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8530 2004-11-26 Miguel de Icaza <miguel@ximian.com>
8532 * attribute.cs (Attribute.Resolve): Refine error reporting and
8533 report a cs0117 if the identifier does not exist, to distinguish
8534 from 0617 which is a miss-use of the actual identifier.
8536 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8537 between cs0070 and cs0079.
8539 * class.cs (MemberBase.DoDefine): When reporting a wrong
8540 accessibility level, we use MethodCore to compare instead of
8541 Method (this was a regression in some refactoring effort).
8543 So now we correctly report cs0056 again.
8545 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8546 testing the target_type (which was known to be object_type) and
8547 not the source type (which is anonymous_method).
8549 Fixed reporting of error cs1660.
8551 * expression.cs (UserCast.Source): Expose the underlying cast.
8553 * statement.cs (Switch.SwitchGoverningType): Sort the list of
8554 allowed types to find a match to int32 first (most common).
8556 In addition, it ignores any ImplicitUserConversions that did an
8557 internal implicit conversion (as the switch statement allows only
8558 one integral conversion to exist).
8560 * class.cs (PartialContainer.Create): rename `name' to
8561 `member_name' for clarity. Then replace the string calls with a
8562 call to MemberName.GetPartialName, as now using
8563 MemberName.ToString is an error (this is due to the side effects
8564 it had, that were fixed in the past).
8566 This will restore the error reporting on a number of partial class
8567 errors that were missusing this (and getting an exception as a
8568 results, which is now just a plain textual warning, because
8569 yyparse debug output would crash otherwise).
8571 2004-11-26 Raja R Harinath <rharinath@novell.com>
8573 * Makefile (PROGRAM_INSTALL_DIR): Remove.
8575 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8577 * rootcontext.cs (LookupType): Make sure to cache lookups that
8578 don't give us a negative result. This saves about 5% of corlib
8581 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8583 * report.cs (AbstractMessage.Print): messages are sent to stderr
8585 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8586 non-interface in the list of interfaces (at this point, either
8587 parent was properly set, or a base class is being listed in the
8588 interfaces section).
8590 This flags error 1722, and resolves the crash from bug 69259.
8592 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8594 * statement.cs (Using.EmitExpressionFinally): make this work right
8595 for valuetypes. Fixes 69926.
8597 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8599 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8600 converted to an enum" here, before we try to change the underlying
8601 type. This code exists, but it is a different code path than the
8602 one used while encoding constants.
8604 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8605 old bug: when converting from the null literal to a pointer,
8606 return an EmptyCast, not the NullLiteral.
8608 This fixes #69921, the recent null_type changes probably made this
8611 (ImplicitReferenceConversionExists): In addition, resynchronized
8612 the code here, so it matches the same code in
8613 ImplicitReferenceConversionExists for the `from any class-type S
8614 to any interface-type T'.
8617 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8619 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8621 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8623 * cs-parser.jay: Use verbosity accordingly.
8625 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8627 * expression.cs (Unary.ResolveOperator): Do not report warning;
8628 AddressOf reads from variable.
8630 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8632 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8636 * attribute.cs (Attributable): Removed CheckTargets.
8637 (Attributes.Emit): Explicit attribute targets are tested here.
8639 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8640 not enabled for interfaces.
8642 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8643 (GetAssemblyName): Ouch next bug there.
8645 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8647 * expression.cs: Error 275 added.
8649 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8651 Fix bug #69177 (Implemented decimal constant support)
8653 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8654 (BinaryFold): Add DecimalConstant.
8656 * const.cs (Define): Decimal constant
8658 (ChangeType): Add decimal type handling.
8659 (LookupConstantValue): Don't set value for decimal type but
8660 emit DecimalConstantAttribute. Needed for constant optimization.
8662 * constant.cs (ToDecimal): New method.
8663 (ConvertToDecimal): New method.
8664 (IntConstant): Implemented ConvertToDecimal.
8665 (DecimalConstant.Emit): Emit optimized version for decimals in
8668 * expression.cs (ResolveOperator): Changed order of constant
8669 reduction to work correctly with native types which have
8670 overloaded operators.
8671 (ResolveMemberAccess): Extract constant value from attribute
8674 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8676 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8677 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8678 (ChangeType): Decimal is special.
8679 (TypeToCoreType): Add decimal type.
8681 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8683 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8686 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8688 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8691 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8693 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8695 * pending.cs (PendingImplementation): Grab only interfaces.
8697 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8699 * statement.cs (ForeachHelperMethods): Add location member and
8700 error 202 detection.
8702 2004-11-19 Raja R Harinath <rharinath@novell.com>
8704 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
8705 automatically handled by executable.make.
8706 (PROGRAM): Make profile-specific.
8708 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8710 * expression.cs (DoResolveBase): Fixed wrong warning for out
8713 2004-11-18 Martin Baulig <martin@ximian.com>
8715 Merged latest changes into gmcs. Please keep this comment in
8716 here, it makes it easier for me to see what changed in MCS since
8717 the last time I merged.
8719 2004-11-17 Raja R Harinath <rharinath@novell.com>
8721 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8722 (TypeHandle.GetMemberCache): New.
8723 (TypeHandle.TypeHandle): Update.
8724 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8725 (TypeManager.LookupParentInterfacesCache):
8726 Rename from LookupInterfaceCache. Optimize slightly.
8727 (TypeManager.MemberLookup_FindMembers): Update.
8728 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8730 (AddCacheContents): Rename from AddHashtable.
8731 * class.cs (TypeContainer.parent_container): Remove.
8732 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8733 (TypeContainer.DoDefineMembers): Don't initialize it.
8734 Update to name changes.
8736 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8738 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8739 that factors the code to check access modifiers on override.
8741 (PropertyBase): Use the code here.
8743 Patch from Lluis S'anchez, fixes bug #69361.
8745 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8747 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8748 routine that is used to report the use of a captured variable
8749 whose address has been taken.
8751 There are two checks: one when variables are being captured and
8752 the other check is when the address of a variable is taken.
8754 (because an anonymous methods might be resolved before *or* after
8755 the address has been taken) and
8757 * expression.cs (Conditional.DoResolve): Remove the special
8758 casing that Martin added to trueExpr and falseExpr being both
8759 NullLiteral. We get the right behavior now just by introducing
8760 the null_type into the compiler.
8762 * convert.cs (ExplicitConversion): Change the code to use
8763 null_type instead of testing `expr is NullLiteral'.
8764 (ImplicitConversionStandard): use null_type too.
8765 (ImplicitReferenceConversionExists): use null_type too.
8766 (ImplicitReferenceConversion): use null_type too.
8768 * literal.cs: The type of `NullLiteral' is now null_type instead
8770 (Resolve): Set the type here.
8772 * typemanager.cs: Introduce null_type.
8774 2004-11-17 Martin Baulig <martin@ximian.com>
8776 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8777 direction, like FindMembers() does. Fixes #69546, testcase is in
8780 2004-11-16 Martin Baulig <martin@ximian.com>
8782 This is based on a patch from Marek Safar, see bug #69082.
8783 Fixes bugs #63705 and #67130.
8785 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8786 method; create a MemberCache for an interface type and cache the
8789 * decl.cs (IMemberContainer.ParentContainer): Removed.
8790 (IMemberContainer.ParentCache): New property.
8791 (MemberCache.SetupCacheForInterface): Removed.
8792 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8793 to create a cache for an interface's "parent".
8795 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8798 2004-11-16 Martin Baulig <martin@ximian.com>
8800 Merged back from gmcs; these changes already went into gmcs a
8801 couple of weeks ago.
8804 (TypeManager.AddUserType): Removed the `ifaces' argument.
8805 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8807 (TypeManager.AddUserInterface): Removed.
8808 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8810 (TypeManager.GetInterfaces): Likewise.
8811 (TypeManager.GetExplicitInterfaces): Likewise.
8813 * ecore.cs (TypeExpr.GetInterfaces): Removed.
8815 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8816 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8818 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8820 * statement.cs: Avoid adding bools to a hashtable.
8822 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8824 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8825 calling an unsafe method from a safe location.
8827 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8830 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8832 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8834 * namespace.cs (VerifyUsing): use GetPartialName instead of
8837 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8839 * statement.cs (Return.Resolve): Fix regression in typo: if
8840 `in_exc', we have to request a NeedReturnLabel, this was a typo
8841 introduced in the anonymous method check-in. Fixes #69131.
8843 * Indexers were using the ShortName when defining themselves,
8844 causing a regression in the compiler bootstrap when applying the
8845 patch from 2004-11-02 (first part), now they use their full name
8846 and the bug is gone.
8848 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8850 * driver.cs: Strip the path from the names of embedded resources. Fixes
8853 2004-11-04 Raja R Harinath <rharinath@novell.com>
8855 Fix error message regression: cs0104-2.cs.
8856 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8857 (AliasEntry.Resolve): Update.
8858 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8860 (RootContext.LookupType): Update.
8862 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8864 * cs-parser.jay: Add support for handling accessor modifiers
8865 * class: Add support port accessor modifiers and error checking,
8866 define PropertyMethod.Define as virtual (not abstract anymore)
8867 * ecore.cs: Add checking for proeprties access with access modifiers
8868 * iterators.cs: Modify Accessor constructor call based in the modified
8870 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8872 * expression.cs (StringConcat): Handle being called twice,
8873 as when we have a concat in a field init with more than two
8876 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8878 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8879 special case explicit implementations, we should always produce
8880 the .property or .event declaration.
8882 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8883 since it will not return correct data if people use this
8884 unresolved in the presence of using statements (see test-313).
8886 * class.cs (MethodData.Define): If we are an explicit interface
8887 implementation, set the method name to the full name of the
8888 interface plus the name of the method.
8890 Notice that using the method.MethodName.GetFullName() does not
8891 work, as it will only contain the name as declared on the source
8892 file (it can be a shorthand in the presence of using statements)
8893 and not the fully qualifed type name, for example:
8897 class D : ICloneable {
8898 object ICloneable.Clone () {
8902 Would produce a method called `ICloneable.Clone' instead of
8903 `System.ICloneable.Clone'.
8905 * namespace.cs (Alias.Resolve): Use GetPartialName.
8907 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8909 * cs-parser.jay: Add error 1055 report.
8911 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8913 * assign.cs (Assign.DoResolve): Only do the transform of
8914 assignment into a New if the types are compatible, if not, fall
8915 through and let the implicit code deal with the errors and with
8916 the necessary conversions.
8918 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8920 * cs-parser.jay: Add error 1031 report.
8922 * cs-tokenizer.cs: Add location for error 1038.
8924 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8926 * cs-parser.jay: Add error 1016 report.
8928 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8930 * cs-parser.jay: Add errors 1575,1611 report.
8932 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8934 * cs-parser.jay: Add error 1001 report.
8936 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8939 * attribute.cs (GetMarshal): Add method argument for
8940 caller identification.
8942 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8943 agument for GetMarshal and RuntimeMissingSupport.
8945 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8947 * attribute.cs (ExtractSecurityPermissionSet): Removed
8948 TypeManager.code_access_permission_type.
8950 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8952 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8954 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8955 for obsolete use of a variable here. Fixes regression on errors
8956 cs0619-25 and cs0619-26.
8958 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8960 Fix #62358, implemented security attribute encoding.
8962 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8963 Tests permitted SecurityAction for assembly or other types.
8964 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8965 data from SecurityPermissionAttribute to PermisionSet class.
8967 * class.cs (ApplyAttributeBuilder): Added special handling
8968 for System.Security.Permissions.SecurityAttribute based types.
8970 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8971 special handling for System.Security.Permissions.SecurityAttribute
8974 * enum.cs (ApplyAttributeBuilder): Added special handling
8975 for System.Security.Permissions.SecurityAttribute based types.
8977 * parameter.cs (ApplyAttributeBuilder): Added special handling
8978 for System.Security.Permissions.SecurityAttribute based types.
8980 * rootcontext.cs: Next 2 core types.
8982 * typemanager.cs (TypeManager.security_permission_attr_type):
8983 Built in type for the SecurityPermission Attribute.
8984 (code_access_permission_type): Build in type.
8986 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8988 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8989 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8990 all of this information into
8991 EmitContext.EmitCapturedVariableInstance.
8993 * codegen.cs (EmitCapturedVariableInstance): move here the
8994 funcionality of emitting an ldarg.0 in the presence of a
8995 remapping. This centralizes the instance emit code.
8997 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8998 then emit a load of this: it means that we have reached the
8999 topmost ScopeInfo: the one that contains the pointer to the
9000 instance of the class hosting the anonymous method.
9002 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9003 captures to the topmost CaptureContext.
9005 2004-10-12 Miguel de Icaza <miguel@ximian.com>
9007 * expression.cs (LocalVariableReference): Move the knowledge about
9008 the iterators into codegen's EmitCapturedVariableInstance.
9010 2004-10-11 Miguel de Icaza <miguel@ximian.com>
9012 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9013 all code paths return a value from an anonymous method (it is the
9014 same as the 161 error, but for anonymous methods).
9016 2004-10-08 Miguel de Icaza <miguel@ximian.com>
9018 The introduction of anonymous methods in the compiler changed
9019 various ways of doing things in the compiler. The most
9020 significant one is the hard split between the resolution phase
9021 and the emission phases of the compiler.
9023 For instance, routines that referenced local variables no
9024 longer can safely create temporary variables during the
9025 resolution phase: they must do so from the emission phase,
9026 since the variable might have been "captured", hence access to
9027 it can not be done with the local-variable operations from the runtime.
9031 (Block.Flags): New flag `IsTopLevel' to indicate that this block
9032 is a toplevel block.
9034 (ToplevelBlock): A new kind of Block, these are the blocks that
9035 are created by the parser for all toplevel method bodies. These
9036 include methods, accessors and anonymous methods.
9038 These contain some extra information not found in regular blocks:
9039 A pointer to an optional CaptureContext (for tracking captured
9040 local variables and parameters). A pointer to the parent
9043 (Return.Resolve): Catch missmatches when returning a value from an
9044 anonymous method (error 1662).
9045 Invoke NeedReturnLabel from the Resolve phase instead of the emit
9048 (Break.Resolve): ditto.
9050 (SwitchLabel): instead of defining the labels during the
9051 resolution phase, we now turned the public ILLabel and ILLabelCode
9052 labels into methods called GetILLabelCode() and GetILLabel() that
9053 only define the label during the Emit phase.
9055 (GotoCase): Track the SwitchLabel instead of the computed label
9056 (its contained therein). Emit the code by using
9057 SwitchLabel.GetILLabelCode ().
9059 (LocalInfo.Flags.Captured): A new flag has been introduce to track
9060 whether the Local has been captured or not.
9062 (LocalInfo.IsCaptured): New property, used to tell whether the
9063 local has been captured.
9065 * anonymous.cs: Vastly updated to contain the anonymous method
9068 The main classes here are: CaptureContext which tracks any
9069 captured information for a toplevel block and ScopeInfo used to
9070 track the activation frames for various local variables.
9072 Each toplevel block has an optional capture context associated
9073 with it. When a method contains an anonymous method both the
9074 toplevel method and the anonymous method will create a capture
9075 context. When variables or parameters are captured, they are
9076 recorded on the CaptureContext that owns them, for example:
9080 MyDelegate d = delegate {
9085 Here `a' will be recorded as captured on the toplevel
9086 CapturedContext, the inner captured context will not have anything
9087 (it will only have data if local variables or parameters from it
9088 are captured in a nested anonymous method.
9090 The ScopeInfo is used to track the activation frames for local
9091 variables, for example:
9093 for (int i = 0; i < 10; i++)
9094 for (int j = 0; j < 10; j++){
9095 MyDelegate d = delegate {
9100 At runtime this captures a single captured variable `i', but it
9101 captures 10 different versions of the variable `j'. The variable
9102 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9103 recorded on a child.
9105 The toplevel ScopeInfo will also track information like the `this'
9106 pointer if instance variables were referenced (this is necessary
9107 as the anonymous method lives inside a nested class in the host
9108 type of the method).
9110 (AnonymousMethod): Expanded to track the Toplevel, implement
9111 `AnonymousMethod.Compatible' to tell whether an anonymous method
9112 can be converted to a target delegate type.
9114 The routine now also produces the anonymous method content
9116 (AnonymousDelegate): A helper class that derives from
9117 DelegateCreation, this is used to generate the code necessary to
9118 produce the delegate for the anonymous method that was created.
9120 * assign.cs: API adjustments for new changes in
9121 Convert.ImplicitStandardConversionExists.
9123 * class.cs: Adjustments to cope with the fact that now toplevel
9124 blocks are of type `ToplevelBlock'.
9126 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9127 insteda of standard blocks.
9129 Flag errors if params arguments are passed to anonymous methods.
9131 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9132 `CurrentAnonymousMethod' which points to the current Anonymous
9133 Method. The variable points to the AnonymousMethod class that
9134 holds the code being compiled. It is set in the new EmitContext
9135 created for the anonymous method.
9137 (EmitContext.Phase): Introduce a variable and an enumeration to
9138 assist in enforcing some rules about when and where we are allowed
9139 to invoke certain methods (EmitContext.NeedsReturnLabel is the
9140 only one that enfonces this right now).
9142 (EmitContext.HaveCaptureInfo): new helper method that returns
9143 whether we have a CapturedContext initialized.
9145 (EmitContext.CaptureVariable): New method used to register that a
9146 LocalInfo must be flagged for capturing.
9148 (EmitContext.CapturedParameter): New method used to register that a
9149 parameters must be flagged for capturing.
9151 (EmitContext.CapturedField): New method used to register that a
9152 field must be flagged for capturing.
9154 (EmitContext.HaveCapturedVariables,
9155 EmitContext.HaveCapturedFields): Return whether there are captured
9156 variables or fields.
9158 (EmitContext.EmitMethodHostInstance): This is used to emit the
9159 instance for the anonymous method. The instance might be null
9160 (static methods), this (for anonymous methods that capture nothing
9161 and happen to live side-by-side with the current method body) or a
9162 more complicated expression if the method has a CaptureContext.
9164 (EmitContext.EmitTopBlock): Routine that drives the emission of
9165 code: it will first resolve the top block, then emit any metadata
9166 and then emit the code. The split is done so that we can extract
9167 any anonymous methods and flag any captured variables/parameters.
9169 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9170 during this phase, the ILGenerator should not be used as labels
9171 and local variables declared here might not be accessible to any
9172 code that is part of an anonymous method.
9174 Exceptions to this include the temporary variables that are
9175 created by some statements internally for holding temporary
9178 (EmitContext.EmitMeta): New routine, in charge of emitting all the
9181 (EmitContext.TemporaryReturn): This method is typically called
9182 from the Emit phase, and its the only place where we allow the
9183 ReturnLabel to be defined other than the EmitMeta. The reason is
9184 that otherwise we would have to duplicate a lot of logic in the
9185 Resolve phases of various methods that today is on the Emit
9188 (EmitContext.NeedReturnLabel): This no longer creates the label,
9189 as the ILGenerator is not valid during the resolve phase.
9191 (EmitContext.EmitThis): Extended the knowledge in this class to
9192 work in anonymous methods in addition to iterators.
9194 (EmitContext.EmitCapturedVariableInstance): This emits whatever
9195 code is necessary on the stack to access the instance to a local
9196 variable (the variable will be accessed as a field).
9198 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9199 EmitContext.EmitAddressOfParameter): Routines to support
9200 parameters (not completed at this point).
9202 Removals: Removed RemapLocal and RemapLocalLValue. We probably
9203 will also remove the parameters.
9205 * convert.cs (Convert): Define a `ConstantEC' which points to a
9206 null. This is just to prefity some code that uses
9207 ImplicitStandardConversion code and do not have an EmitContext
9210 The idea is to flag explicitly that at that point in time, it is
9211 known that the conversion will not trigger the delegate checking
9212 code in implicit conversions (which requires a valid
9215 Everywhere: pass new EmitContext parameter since
9216 ImplicitStandardConversionExists now requires it to check for
9217 anonymous method conversions.
9219 (Convert.ImplicitStandardConversionExists): If the type of an
9220 expression is the anonymous_method_type, and the type is a
9221 delegate, we invoke the AnonymousMethod.Compatible method to check
9222 whether an implicit conversion is possible.
9224 (Convert.ImplicitConversionStandard): Only do implicit method
9225 group conversions if the language level is not ISO_1.
9227 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9228 MethodInfo for the Invoke method. used by Delegate and
9231 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9232 method conversions if the target type is a delegate.
9234 Removed extra debugging nops.
9236 (LocalVariableReference): Turn the `local_info' into a public
9239 Add `prepared' field, the same hack used for FieldExprs to cope
9240 with composed assignments, as Local variables do not necessarily
9241 operate purely on the stack as they used to: they can be captured
9244 Add `temp' for a temporary result, like fields.
9246 Refactor DoResolve and DoResolveLValue into DoResolveBase.
9248 It now copes with Local variables that are captured and emits the
9249 proper instance variable to load it from a field in the captured
9252 (ParameterReference.DoResolveBase): During the resolve phase,
9253 capture parameters if we are in an anonymous method.
9255 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9256 anonymous method, use the EmitContext helper routines to emit the
9257 parameter reference.
9259 * iterators.cs: Set RemapToProxy to true/false during the
9262 * parameters.cs (GetParameterByName): New helper method.
9264 * typemanager.cs (anonymous_method_type) a new type that
9265 represents an anonyous method. This is always an internal type,
9266 used as a fencepost to test against the anonymous-methodness of an
9269 2004-10-20 Marek Safar <marek.safar@seznam.cz>
9271 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9273 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9275 2004-10-18 Martin Baulig <martin@ximian.com>
9277 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9278 `Type' directly, but call ResolveType() on it.
9279 (Catch.Resolve): Likewise.
9280 (Foreach.Resolve): Likewise.
9282 2004-10-18 Martin Baulig <martin@ximian.com>
9284 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9285 `Type' directly, but call ResolveType() on it.
9286 (Probe.DoResolve): Likewise.
9287 (ArrayCreation.LookupType): Likewise.
9288 (TypeOf.DoResolve): Likewise.
9289 (SizeOf.DoResolve): Likewise.
9291 2004-10-18 Martin Baulig <martin@ximian.com>
9293 * expression.cs (Invocation.BetterFunction): Put back
9294 TypeManager.TypeToCoreType().
9296 2004-10-18 Raja R Harinath <rharinath@novell.com>
9298 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9301 2004-10-18 Martin Baulig <martin@ximian.com>
9303 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
9304 `Type' directly, but call ResolveType() on it.
9306 2004-10-18 Martin Baulig <martin@ximian.com>
9308 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9309 `Type' directly, but call ResolveType() on it.
9310 (MemberBase.DoDefine): Likewise.
9312 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9313 `Type' directly, but call ResolveType() on it.
9314 (ComposedCast.DoResolveAsTypeStep): Likewise.
9316 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9317 `Type' directly, but call ResolveType() on it.
9319 2004-10-17 John Luke <john.luke@gmail.com>
9321 * class.cs (Operator.GetSignatureForError): use CSharpName
9323 * parameter.cs (Parameter.GetSignatureForError): Returns
9324 correct name even if was not defined.
9326 2004-10-13 Raja R Harinath <rharinath@novell.com>
9329 * class.cs (TypeContainer.EmitContext): New property.
9330 (DefineNestedTypes): Create an emitcontext for each part.
9331 (MethodCore.DoDefineParameters): Use container's emitcontext.
9332 Pass type array to InternalParameters.
9333 (MemberBase.DoDefine): Use container's emitcontext.
9334 (FieldMember.Define): Likewise.
9335 (Event.Define): Likewise.
9336 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9337 Pass type array to InternalParameters.
9338 (SetIndexerMethod.GetParameterInfo): Likewise.
9339 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9340 * delegate.cs (Define): Pass emitcontext to
9341 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9342 array to InternalParameters.
9343 * expression.cs (ParameterReference.DoResolveBase): Pass
9344 emitcontext to GetParameterInfo.
9345 (ComposedCast.DoResolveAsTypeStep): Remove check on
9346 ec.ResolvingTypeTree.
9347 * parameter.cs (Parameter.Resolve): Change argument to
9348 EmitContext. Use ResolveAsTypeTerminal.
9349 (Parameter.GetSignature): Change argument to EmitContext.
9350 (Parameters.ComputeSignature): Likewise.
9351 (Parameters.ComputeParameterTypes): Likewise.
9352 (Parameters.GetParameterInfo): Likewise.
9353 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9354 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9355 * support.cs (InternalParameters..ctor): Remove variant that takes
9357 * typemanager.cs (system_intptr_expr): New.
9358 (InitExpressionTypes): Initialize it.
9360 2004-10-12 Chris Toshok <toshok@ximian.com>
9362 * cs-parser.jay: fix location for try_statement and catch_clause.
9364 2004-10-11 Martin Baulig <martin@ximian.com>
9366 * report.cs: Don't make --fatal abort on warnings, we have
9367 -warnaserror for that.
9369 2004-10-07 Raja R Harinath <rharinath@novell.com>
9371 More DeclSpace.ResolveType avoidance.
9372 * decl.cs (MemberCore.InUnsafe): New property.
9373 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9374 with newly created EmitContext.
9375 (FieldMember.Define): Likewise.
9376 * delegate.cs (Delegate.Define): Likewise.
9377 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9378 only if normal name-lookup fails.
9379 (TypeExpr.DoResolve): Enable error-checking.
9380 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9381 (SizeOf.DoResolve): Likewise.
9382 (ComposedCast.DoResolveAsTypeStep): Likewise.
9383 (StackAlloc.DoResolve): Likewise.
9384 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9385 (Block.Unsafe): New property.
9386 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9387 (Unsafe): Set 'unsafe' flag of contained block.
9388 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9389 (Fixed.Resolve): Likewise.
9390 (Catch.Resolve): Likewise.
9391 (Using.ResolveLocalVariableDecls): Likewise.
9392 (Foreach.Resolve): Likewise.
9394 2004-10-05 John Luke <john.luke@gmail.com>
9396 * cs-parser.jay: add location to error CS0175
9398 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9400 * ecore.cs (Expression.Constantity): Add support for turning null
9403 * const.cs (Const.Define): Allow constants to be reference types
9404 as long as the value is Null.
9406 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9408 * namespace.cs (NamespaceEntry.Using): No matter which warning
9409 level is set, check if this namespace name has already been added.
9411 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9413 * expression.cs: reftype [!=]= null should always use br[true,false].
9416 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9419 * attribute.cs: Enum conversion moved to
9420 GetAttributeArgumentExpression to be applied to the all
9423 2004-10-01 Raja R Harinath <rharinath@novell.com>
9425 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9426 * class.c (TypeContainer.DefineType): Flag error if
9427 base types aren't accessible due to access permissions.
9428 * decl.cs (DeclSpace.ResolveType): Move logic to
9429 Expression.ResolveAsTypeTerminal.
9430 (DeclSpace.ResolveTypeExpr): Thin layer over
9431 Expression.ResolveAsTypeTerminal.
9432 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9433 Refactor code into NestedAccess. Use it.
9434 (DeclSpace.NestedAccess): New.
9435 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9436 argument to silence errors. Check access permissions.
9437 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9438 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9439 (Cast.DoResolve): Likewise.
9440 (New.DoResolve): Likewise.
9441 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9442 (TypeOf.DoResolve): Likewise.
9444 * expression.cs (Invocation.BetterConversion): Return the Type of
9445 the better conversion. Implement section 14.4.2.3 more faithfully.
9446 (Invocation.BetterFunction): Make boolean. Make correspondence to
9447 section 14.4.2.2 explicit.
9448 (Invocation.OverloadResolve): Update.
9449 (Invocation): Remove is_base field.
9450 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9451 (Invocation.Emit): Likewise.
9453 2004-09-27 Raja R Harinath <rharinath@novell.com>
9455 * README: Update to changes.
9457 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9459 * cs-parser.jay: Reverted 642 warning fix.
9461 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9464 * decl.cs (FindMemberWithSameName): Indexer can have more than
9467 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9469 * expression.cs (LocalVariableReference.DoResolveLValue):
9470 Do not report warning 219 for out values.
9471 (EmptyExpression.Null): New member to avoid extra allocations.
9473 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9475 * cs-parser.jay: Fix wrong warning 642 report.
9477 * cs-tokenizer.cs (CheckNextToken): New helper;
9478 Inspect next character if is same as expected.
9480 2004-09-23 Martin Baulig <martin@ximian.com>
9482 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9483 (Convert.ImplicitReferenceConversionExists): Likewise.
9485 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9487 * class.cs (Operator.Define): Add error 448 and 559 report.
9489 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9491 * class.cs (MemberBase.IsTypePermitted): New protected
9492 method for checking error CS0610.
9494 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9496 * class.cs (TypeContainer.HasExplicitLayout): New property
9497 Returns whether container has StructLayout attribute set Explicit.
9498 (FieldMember): New abstract class for consts and fields.
9499 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9500 (Field): Reuse FieldMember.
9502 * const.cs (Const): Reuse FieldMember.
9504 * rootcontext.cs: EmitConstants call moved to class.
9506 2004-09-22 Martin Baulig <martin@ximian.com>
9508 Thanks to Peter Sestoft for this bug report.
9510 * expression.cs (Conditional): If both the `trueExpr' and the
9511 `falseExpr' is a NullLiteral, return a NullLiteral.
9513 2004-09-22 Martin Baulig <martin@ximian.com>
9515 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9516 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9517 for the "get_Current" call.
9519 2004-09-22 Martin Baulig <martin@ximian.com>
9521 Marek and me just fixed one of our oldest bugs: #28562 :-)
9523 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9525 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9526 we're an EnumConstant, just return that.
9527 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9528 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9529 to get the value which'll actually be written into the attribute.
9530 However, we have to use GetValue() to access the attribute's value
9533 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9535 * constant.cs (Constant.IsNegative): New abstract property
9538 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9539 (StackAlloc.DoResolve): Reused IsNegative.
9541 2004-09-21 Martin Baulig <martin@ximian.com>
9543 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9544 if we're used in an iterator, we may be called from different
9547 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9548 we actually have an exception block.
9550 2004-09-20 John Luke <jluke@cfl.rr.com>
9552 * class.cs, cs-parser.jay: Improve the error report for 1520:
9553 report the actual line where the error happens, not where the
9556 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9557 Pass location information that was available elsewhere.
9559 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
9561 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9562 runtime to delay sign assemblies.
9564 2004-09-19 Miguel de Icaza <miguel@ximian.com>
9566 * cs-parser.jay: Do not report the stack trace, this is barely
9569 2004-08-22 John Luke <john.luke@gmail.com>
9571 * driver.cs : check that a resource id is not already used
9572 before adding it, report CS1508 if it is, bug #63637
9574 2004-09-19 Miguel de Icaza <miguel@ximian.com>
9576 * ecore.cs: Removed dead code.
9578 2004-09-18 Marek Safar <marek.safar@seznam.cz>
9580 * class.cs: Do not report warning CS0067 on the interfaces.
9582 2004-09-16 Marek Safar <marek.safar@seznam.cz>
9584 * cs-parser.jay: Add error 504 report.
9586 2004-09-16 Marek Safar <marek.safar@seznam.cz>
9588 * rootcontext.cs: WarningLevel is 4 by default now.
9590 * statement.cs (Fixed.Resolve): Do not null
9593 2004-09-16 Marek Safar <marek.safar@seznam.cz>
9596 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9597 deep search when property is not virtual.
9598 (PropertyExpr.ResolveAccessors): Make one call for both
9601 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9604 * statement.cs: Error 152 report constains also location.
9606 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9609 * const.cs: Explicitly set constant as static.
9611 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9614 * cs-parser.jay: Add error 1017 report.
9616 2004-09-15 Marek Safar <marek.safar@seznam.cz>
9618 Fixed bug #59980, #64224
9619 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9621 * typemanager.cs (IsSpecialMethod): Simplified
9623 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9625 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9626 condition with better params.
9628 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9631 * attribute.cs (Resolve): Property has to have both
9634 2004-09-14 Martin Baulig <martin@ximian.com>
9636 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9638 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9641 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9642 called and is obsolete then this member suppress message
9643 when call is inside next [Obsolete] method or type.
9645 * expression.cs: Use TestObsoleteMethodUsage member.
9647 2004-09-14 Martin Baulig <martin@ximian.com>
9649 * cs-parser.jay: Sync a bit with the GMCS version.
9651 2004-09-14 Martin Baulig <martin@ximian.com>
9653 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9654 (CSharpParser.yacc_verbose_flag): New public field.
9656 * genericparser.cs: Removed.
9658 2004-09-14 Raja R Harinath <rharinath@novell.com>
9660 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9662 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9664 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9666 2004-09-10 Martin Baulig <martin@ximian.com>
9668 Backported my MemberName changes from GMCS into MCS.
9670 - we are now using a special `MemberName' class instead of using
9671 strings; in GMCS, the `MemberName' also contains the type
9674 - changed the grammar rules a bit:
9675 * the old `member_name' is now a `namespace_or_type_name':
9676 The rule is that we use `namespace_or_type_name' everywhere
9677 where we expect either a "member name" (GetEnumerator) or a
9678 "member name" with an explicit interface name
9679 (IEnumerable.GetEnumerator).
9680 In GMCS, the explicit interface name may include type arguments
9681 (IEnumerable<T>.GetEnumerator).
9682 * we use `member_name' instead of just `IDENTIFIER' for
9684 The rule is that we use `member_name' wherever a member may
9685 have type parameters in GMCS.
9687 * decl.cs (MemberName): New public class.
9688 (MemberCore.MemberName): New public readonly field.
9689 (MemberCore.ctor): Take a `MemberName' argument, not a string.
9690 (DeclSpace): Likewise.
9692 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9693 * enum.cs (Enum.ctor): Likewise.
9695 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9697 (AliasEntry.ctor): Take a MemberName, not an Expression.
9698 (AliasEntry.UsingAlias): Likewise.
9700 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9701 (IMethodData.MemberName): Changed type from string to MemberName.
9702 (MemberBase.ExplicitInterfaceName): Likewise.
9703 (AbstractPropertyEventMethod.SetupName): Make this private.
9704 (AbstractPropertyEventMethod.ctor): Added `string prefix'
9705 argument; compute the member name here.
9706 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9707 on the `member.MemberName' and the `prefix'.
9709 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9711 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9712 thus, we get a `MemberName' instead of a `string'. These
9713 declarations may have type parameters in GMCS.
9714 (interface_method_declaration, delegate_declaration): Likewise.
9715 (class_declaration, interface_declaration): Likewise.
9716 (method_header): Use `namespace_or_type_name' instead of
9717 `member_name'. We may be an explicit interface implementation.
9718 (property_declaration, event_declaration): Likewise.
9719 (member_name): This is now just an `IDENTIFIER', not a
9720 `namespace_or_type_name'.
9721 (type_name, interface_type): Removed.
9722 (namespace_or_type_name): Return a MemberName, not an Expression.
9723 (primary_expression): Use `member_name' instead of `IDENTIFIER';
9724 call GetTypeExpression() on the MemberName to get an expression.
9725 (IndexerDeclaration.interface_type): Changed type from string to
9727 (MakeName): Operate on MemberName's instead of string's.
9729 2004-09-13 Raja R Harinath <rharinath@novell.com>
9732 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9733 (NamespaceEntry.Lookup): Add new argument to flag if we want the
9734 lookup to avoid symbols introduced by 'using'.
9735 * rootcontext.cs (NamespaceLookup): Update.
9737 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9739 * class.cs (TypeContainer.DoDefineMembers): Do not call
9740 DefineDefaultConstructor for static classes.
9742 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9744 * attribute.cs (Attribute.Resolve): Add error 653 report.
9746 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9748 (Method.ApplyAttributeBuilder): Add error 685 report.
9749 (Operator.Define): Add error 564 report.
9751 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9753 * expression.cs (Invocation.DoResolve): Add error
9756 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9759 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9761 * class.cs (ConstructorInitializer.Resolve):
9762 Wrong error number (515->516).
9764 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9766 * class.cs (Indexer.Define): Add error 631 report.
9768 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9770 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9772 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9774 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9776 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9778 * cs-parser.jay: Added error CS0241 report.
9780 2004-09-10 Raja R Harinath <rharinath@novell.com>
9782 * cs-parser.jay (fixed_statement): Introduce a scope for the
9783 declaration in the 'fixed' statement.
9785 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9787 * cs-parser.jay: Added CS0230 error report.
9789 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9791 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9793 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9795 * expression.cs (Argument.Resolve): Added error CS0192 and
9798 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9800 C# 2.0 #pragma warning feature
9802 * cs-tokenizer.cs (PreProcessPragma): New method;
9803 Handles #pragma directive.
9805 * report.cs (WarningRegions): New class; Support
9806 class for #pragma warning directive. It tests whether
9807 warning is enabled for a given line.
9809 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9811 * const.cs: Add more descriptive error report, tahnks to
9814 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9816 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9818 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9820 * expression.cs: Apply patch from Ben: Remove dead code from
9821 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9822 as that code just threw an exception anwyays.
9824 * const.cs: Remove the call to the turnintoconstant, for details
9827 * literal.cs: The type of the null-literal is the null type; So
9828 we use a placeholder type (literal.cs:System.Null, defined here)
9831 * expression.cs (Conditional.DoResolve): Remove some old code that
9832 is no longer needed, conversions have been fixed.
9834 (ArrayCreationExpression.DoResolve): Return false if we fail to
9835 resolve the inner expression.
9837 2004-09-07 Raja R Harinath <rharinath@novell.com>
9840 * cs-parser.jay (delegate_declaration): Record a delegate
9841 declaration as a type declaration.
9842 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9844 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9846 * parameter.cs: Do not crash if the type can not be resolved.
9848 * expression.cs: Report errors with unsafe pointers, fixes #64896
9850 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9852 * expression.cs: Pointer arith always needs to do a conv.i
9853 if the operand is a long. fix 65320
9855 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9857 Fixed cs0619-37.cs, cs0619-38.cs
9859 * enum.cs (GetObsoleteAttribute): Removed.
9861 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9862 on Enum member is double staged. The first is tested member
9865 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9867 Fixed #56986, #63631, #65231
9869 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9870 adds member to name container.
9871 (TypeContainer.AddToTypeContainer): New method, adds type to
9873 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9874 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9875 AddOperator): Simplified by reusing AddToMemberContainer.
9876 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9878 (Method.CheckForDuplications): Fixed implementation to test all
9880 (MemberBase): Detection whether member is explicit interface
9881 implementation is now in constructor.
9882 (MemberBase.UpdateMemberName): Handles IndexerName.
9883 (Accessor): Changed to keep also location information.
9884 (AbstractPropertyEventMethod): Is derived from MemberCore.
9885 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9886 will be emited or not.
9887 (PropertyBase.AreAccessorsDuplicateImplementation):
9888 Tests whether accessors are not in collision with some method.
9889 (Operator): Is derived from MethodCore to simplify common
9892 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9894 (DeclSpace.AddToContainer): Adds the member to defined_names
9895 table. It tests for duplications and enclosing name conflicts.
9897 * enum.cs (EnumMember): Clean up to reuse the base structures
9899 2004-09-03 Martin Baulig <martin@ximian.com>
9901 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9902 into TypeContainer, to make partial classes work again.
9904 2004-09-03 Martin Baulig <martin@ximian.com>
9906 * rootcontext.cs (RootContext.V2): Removed.
9908 2004-03-23 Martin Baulig <martin@ximian.com>
9910 * expression.cs (Invocation.OverloadResolve): Added `bool
9911 may_fail' argument and use it instead of the Location.IsNull() hack.
9913 2004-09-03 Martin Baulig <martin@ximian.com>
9915 Merged latest changes into gmcs. Please keep this comment in
9916 here, it makes it easier for me to see what changed in MCS since
9917 the last time I merged.
9919 2004-09-03 Raja R Harinath <rharinath@novell.com>
9922 * expression.cs (BetterConversion): Don't allow either conversion
9923 to be null. Remove redundant implicit conversion test when 'q ==
9924 null' -- when this function is invoked, we already know that the
9925 implicit conversion exists.
9926 (BetterFunction): Assume that 'best' is non-null. Remove
9927 redundant reimplementation of IsApplicable when 'best' is null.
9928 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9929 number of arguments.
9930 (IsAncestralType): Extract from OverloadResolve.
9931 (OverloadResolve): Make robust to the MethodGroupExpr being
9932 unsorted. Implement all the logic of Section 14.5.5.1, and
9933 support overloading of methods from multiple applicable types.
9934 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9936 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9937 (RealError, Warning): Append type of report to related symbol.
9939 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9941 * enum.cs: Fixed CLS-Compliance checks for enum members.
9942 Error tests cs3008-8.cs, cs3014-8.cs
9944 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9946 Fixed bug #62342, #63102
9947 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9948 like ImplementMethod.
9950 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9952 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9955 2004-09-02 Martin Baulig <martin@ximian.com>
9957 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9958 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9961 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9963 C# 2.0 Static classes implemented
9965 * class.cs (TypeContainer): instance_constructors,
9966 initialized_fields, initialized_static_fields,
9967 default_constructor, base_inteface_types are protected to be
9968 accessible from StaticClass.
9969 (TypeContainer.DefineDefaultConstructor): New virtual method
9970 for custom default constructor generating
9971 (StaticClass): New class to handle "Static classes" feature.
9973 * cs-parser.jay: Handle static keyword on class like instance
9976 * driver.cs: Added "/langversion" command line switch with two
9977 options (iso-1, default).
9979 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9981 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9983 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9985 * delegate.cs: Style.
9987 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9989 * delegate.cs: Add seperate instance expr field for miguel.
9991 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9993 * PointerArithmetic (Resolve): make sure we are not doing
9994 pointer arith on void*. Also, make sure we are resolved
9995 by not setting eclass until resolve.
9997 All callers: Make sure that PointerArithmetic gets resolved.
9999 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
10001 * ArrayCreation (LookupType): If the type does not resolve
10002 to an array, give an error.
10004 2004-08-27 Marek Safar <marek.safar@seznam.cz>
10006 * statement.cs (Try.Resolve): Fixed bug #64222
10008 2004-08-27 Martin Baulig <martin@ximian.com>
10011 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10014 2004-08-26 Marek Safar <marek.safar@seznam.cz>
10016 * ecore.cs (Constantify): Get underlying type via
10017 System.Enum.GetUnderlyingType to avoid StackOverflow on the
10018 Windows in special cases.
10020 2004-08-26 Marek Safar <marek.safar@seznam.cz>
10022 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10023 for obtaining also private methods.
10024 (GetRemoveMethod): Used GetRemoveMethod (true)
10025 for obtaining also private methods.
10027 2004-08-24 Martin Baulig <martin@ximian.com>
10029 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10030 MethodAttributes.HideBySig for operators.
10032 2004-08-23 Martin Baulig <martin@ximian.com>
10034 Back to the old error reporting system :-)
10036 * report.cs (Message): Removed.
10037 (Report.MessageData, ErrorData, WarningData): Removed.
10038 (Report.Error, Warning): Back to the old system.
10040 2004-08-23 Martin Baulig <martin@ximian.com>
10042 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10044 * class.cs (TypeContainer.ParentContainer): New public virtual
10045 method; replaces the explicit interface implementation.
10046 (ClassPart.ParentContainer): Override.
10048 2004-08-23 Martin Baulig <martin@ximian.com>
10050 * statement.cs (Switch): Added support for constant switches; see
10051 #59428 or test-285.cs.
10053 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10056 * statement.cs (GetEnumeratorFilter): Removed useless
10057 logic because C# specs is strict. GetEnumerator must be
10060 2004-08-22 Martin Baulig <martin@ximian.com>
10062 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10063 a switch and may break, reset the barrier. Fixes #59867.
10065 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10067 CLS-Compliance speed up (~5% for corlib)
10069 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10070 New method. Tests container for CLS-Compliant names
10072 * class.cs (TypeContainer.VerifyClsName): New method.
10073 Checks whether container name is CLS Compliant.
10074 (Constructor): Implements IMethodData.
10076 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10077 low-case table for CLS Compliance test.
10078 (MemberCache.VerifyClsParameterConflict): New method.
10079 Checks method parameters for CS3006 error.
10081 * enum.cs (EnumMember): Is derived from MemberCore.
10082 (Enum.VerifyClsName): Optimized for better performance.
10084 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10086 * report.cs: Renamed Error_T to Error and changed all
10089 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10091 * class.cs (TypeContainer.IndexerArrayList): New inner class
10092 container for indexers.
10093 (TypeContainer.DefaultIndexerName): New constant for default
10094 indexer name. Replaced all "Item" with this constant.
10095 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10097 * typemanager.cs (TypeManager.default_member_ctor): Cache here
10098 DefaultMemberAttribute constructor.
10100 2004-08-05 Martin Baulig <martin@ximian.com>
10102 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10105 2004-08-05 Marek Safar <marek.safar@seznam.cz>
10107 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10108 multi platforms problem.
10110 * compiler.csproj: Included shared files.
10112 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10114 Fix bug 60333, 55971 in the more general way
10115 * attribute.cs (Attribute.GetAttributeArgumentExpression):
10116 Added arg_type argument for constant conversion.
10117 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10119 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10122 * class.cs (TypeContainer ): New inner classes MethodArrayList,
10123 OperatorArrayList, MethodCoreArrayList for typecontainer
10124 containers. Changed class member types to these new types.
10125 (MethodArrayList.DefineMembers): Added test for CS0659.
10127 2004-08-04 Miguel de Icaza <miguel@ximian.com>
10129 * cfold.cs: Synchronize the folding with the code in expression.cs
10130 Binary.DoNumericPromotions for uint operands.
10132 * attribute.cs: Revert patch from Raja, it introduced a regression
10133 while building Blam-1.2.1 (hard to isolate a test case).
10135 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10139 (TypeContainer.Define): Renamed to DefineContainerMembers because of
10141 (MethodCore.parent_method): New member. The method we're overriding
10142 if this is an override method.
10143 (MethodCore.CheckBase): Moved from Method class and made common.
10144 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10146 (MethodCore.CheckForDuplications): New abstract method. For custom
10147 member duplication search in a container
10148 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10149 method and its return type.
10150 (Event.conflict_symbol): New member. Symbol with same name in the
10154 (MemberCache.FindMemberWithSameName): New method. The method
10155 is looking for conflict with inherited symbols.
10157 2004-08-04 Martin Baulig <martin@ximian.com>
10159 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10161 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10163 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10165 * report.cs (Message): New enum for better error, warning reference in
10167 (MessageData): New inner abstract class. It generally handles printing of
10168 error and warning messages.
10169 Removed unused Error, Warning, Message methods.
10171 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10173 Fix for cs0592-8.cs test
10175 (Attributable.ValidAttributeTargets): Made public.
10176 (Attribute.ExplicitTarget): New member for explicit target value.
10177 (Attribute.CheckTargets): Now we translate explicit attribute
10178 target to Target here.
10180 2004-08-03 Ben Maurer <bmaurer@ximian.com>
10182 * ecore.cs (MethodGroupExpr): new IsBase property.
10184 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10186 * delegate.cs (DelegateCreation): store a MethodGroupExpr
10187 rather than an instance expr.
10189 (DelegateCreation.Emit): Use the method group rather than
10190 the instance expression. Also, if you have base.Foo as the
10191 method for a delegate, make sure to emit ldftn, not ldftnvirt.
10193 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
10195 (NewDelegate.DoResolve): Only check for the existance of Invoke
10196 if the method is going to be needed. Use MethodGroupExpr.
10198 (NewDelegate.Emit): Remove, DelegateCreation implements this.
10200 * expression.cs: For pointer arith., make sure to use
10201 the size of the type, not the size of the pointer to
10204 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10207 * class.cs (Class): Added error CS0502 test.
10209 2004-08-03 John Luke <jluke@cfl.rr.com>
10210 Raja R Harinath <rharinath@novell.com>
10213 * attribute.cs (Attribute.complained_before): New flag.
10214 (Attribute.ResolveType, Attribute.Resolve),
10215 (Attribute.DefinePInvokeMethod): Set it.
10216 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10218 2004-08-03 Martin Baulig <martin@ximian.com>
10220 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10221 use a user-defined operator; we still need to do numeric
10222 promotions in case one argument is a builtin type and the other
10223 one has an implicit conversion to that type. Fixes #62322.
10225 2004-08-02 Martin Baulig <martin@ximian.com>
10227 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10228 (LocalInfo.IsThis): New public property.
10229 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10231 2004-08-01 Martin Baulig <martin@ximian.com>
10233 * class.cs (TypeContainer.GetClassBases): Don't set the default
10234 here since we may get called from GetPartialBases().
10235 (TypeContainer.DefineType): If GetClassBases() didn't return a
10236 parent, use the default one.
10238 2004-07-30 Duncan Mak <duncan@ximian.com>
10240 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10242 2004-07-30 Martin Baulig <martin@ximian.com>
10244 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10246 * class.cs (SourceMethod): New public class, derive from the
10247 symbol writer's ISourceMethod.
10248 (Method): Use the new symbol writer API.
10250 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10251 as argument and use the new symbol writer.
10254 (SourceFile): Implement the symbol writer's ISourceFile.
10255 (Location.SymbolDocument): Removed.
10256 (Location.SourceFile): New public property.
10258 * symbolwriter.cs: Use the new symbol writer API.
10260 2004-07-30 Raja R Harinath <rharinath@novell.com>
10262 * Makefile (install-local): Remove. Functionality moved to
10265 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10267 * Makefile: Install mcs.exe.config file together with mcs.exe.
10268 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10269 correct runtime version.
10271 2004-07-25 Martin Baulig <martin@ximian.com>
10274 (TypeContainer.RegisterOrder): Removed, this was unused.
10275 (TypeContainer, interface_order): Removed.
10276 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10277 TypeContainer as argument since we can also be called with a
10278 `PartialContainer' for a partial class/struct/interface.
10279 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10280 of checking whether we're an `Interface' - we could be a
10281 `PartialContainer'.
10282 (PartialContainer.Register): Override; call
10283 AddClass()/AddStruct()/AddInterface() on our parent.
10285 * cs-parser.jay (interface_member_declaration): Add things to the
10286 `current_container', not the `current_class'.
10288 * rootcontext.cs (RegisterOrder): The overloaded version which
10289 takes an `Interface' was unused, removed.
10291 * typemanager.cs (TypeManager.LookupInterface): Return a
10292 `TypeContainer', not an `Interface'.
10293 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10294 contain a `PartialContainer' for an interface, so check it's
10295 `Kind' to figure out what it is.
10297 2004-07-25 Martin Baulig <martin@ximian.com>
10299 * class.cs (Class.DefaultTypeAttributes): New public constant.
10300 (Struct.DefaultTypeAttributes): Likewise.
10301 (Interface.DefaultTypeAttributes): Likewise.
10302 (PartialContainer.TypeAttr): Override this and add the
10303 DefaultTypeAttributes.
10305 2004-07-25 Martin Baulig <martin@ximian.com>
10307 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10308 we can just use the `Parent' field instead.
10310 2004-07-25 Martin Baulig <martin@ximian.com>
10312 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10314 2004-07-25 Martin Baulig <martin@ximian.com>
10316 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10317 our parts before defining any methods.
10318 (TypeContainer.VerifyImplements): Make this virtual.
10319 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10320 on our PartialContainer.
10322 2004-07-25 Martin Baulig <martin@ximian.com>
10324 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10326 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10327 argument, we can just use the `Parent' field instead.
10330 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10331 (MemberBase.DoDefine): Likewise.
10333 2004-07-24 Martin Baulig <martin@ximian.com>
10335 * decl.cs (MemberCore.Parent): New public field.
10336 (DeclSpace.Parent): Moved to MemberCore.
10338 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10339 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10341 (FieldBase, Field, Operator): Likewise.
10342 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10343 (EventField, Event): Likewise.
10345 2004-07-23 Martin Baulig <martin@ximian.com>
10347 * class.cs (PartialContainer): New public class.
10348 (ClassPart): New public class.
10349 (TypeContainer): Added support for partial classes.
10350 (TypeContainer.GetClassBases): Splitted some of the functionality
10351 out into GetNormalBases() and GetPartialBases().
10353 * cs-tokenizer.cs (Token.PARTIAL): New token.
10354 (Tokenizer.consume_identifier): Added some hacks to recognize
10355 `partial', but only if it's immediately followed by `class',
10356 `struct' or `interface'.
10358 * cs-parser.jay: Added support for partial clases.
10360 2004-07-23 Martin Baulig <martin@ximian.com>
10362 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10363 a `DeclSpace' and also made it readonly.
10364 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10365 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10366 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10368 * cs-parser.jay: Pass the `current_class', not the
10369 `current_container' (at the moment, this is still the same thing)
10370 to a new Method, Property, Event, Indexer or Constructor.
10372 2004-07-23 Martin Baulig <martin@ximian.com>
10374 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10375 and removed the `current_interface' one.
10376 (struct_declaration, class_declaration, interface_declaration):
10377 Set `current_class' to the newly created class/struct/interface;
10378 set their `Bases' and call Register() before parsing their body.
10380 2004-07-23 Martin Baulig <martin@ximian.com>
10382 * class.cs (Kind): New public enum.
10383 (TypeContainer): Made this class abstract.
10384 (TypeContainer.Kind): New public readonly field.
10385 (TypeContainer.CheckDef): New public method; moved here from
10387 (TypeContainer.Register): New public abstract method.
10388 (TypeContainer.GetPendingImplementations): New public abstract
10390 (TypeContainer.GetClassBases): Removed the `is_class' and
10391 `is_iface' parameters.
10392 (TypeContainer.DefineNestedTypes): Formerly known as
10394 (ClassOrStruct): Made this class abstract.
10396 * tree.cs (RootTypes): New public type.
10398 2004-07-20 Martin Baulig <martin@ximian.com>
10400 * tree.cs (Tree.RecordNamespace): Removed.
10401 (Tree.Namespaces): Removed.
10403 * rootcontext.cs (RootContext.IsNamespace): Removed.
10405 * cs-parser.jay (namespace_declaration): Just create a new
10406 NamespaceEntry here.
10408 2004-07-20 Martin Baulig <martin@ximian.com>
10410 * statement.cs (ExceptionStatement): New abstract class. This is
10411 now used as a base class for everyone who's using `finally'.
10412 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10413 our local variables before using them.
10415 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10416 virtual method. This is used by Yield.Resolve() to "steal" an
10417 outer block's `finally' clauses.
10418 (FlowBranchingException): The .ctor now takes an ExceptionStatement
10421 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10422 version which takes an ExceptionStatement. This version must be
10423 used to create exception branchings.
10426 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10427 (Iterator.EmitMoveNext): Added exception support; protect the
10428 block with a `fault' clause, properly handle 'finally' clauses.
10429 (Iterator.EmitDispose): Run all the `finally' clauses here.
10431 2004-07-20 Martin Baulig <martin@ximian.com>
10433 * iterator.cs: This is the first of a set of changes in the
10434 iterator code. Match the spec more closely: if we're an
10435 IEnumerable, then GetEnumerator() must be called. The first time
10436 GetEnumerator() is called, it returns the current instance; all
10437 subsequent invocations (if any) must create a copy.
10439 2004-07-19 Miguel de Icaza <miguel@ximian.com>
10441 * expression.cs: Resolve the constant expression before returning
10444 2004-07-19 Martin Baulig <martin@ximian.com>
10446 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10447 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10448 the return type of the new EmitContext.
10450 2004-07-18 Martin Baulig <martin@ximian.com>
10452 * class.cs (Property.Define): Fix iterators.
10454 * iterators.cs (Iterator.Define): Moved the
10455 `container.AddInterator (this)' call here from the .ctor; only do
10456 it if we resolved successfully.
10458 2004-07-17 Miguel de Icaza <miguel@ximian.com>
10460 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10461 `true' for preprocessing directives that we parse. The return
10462 value indicates whether we should return to regular tokenizing or
10463 not, not whether it was parsed successfully.
10465 In the past if we were in: #if false ... #line #endif, we would
10466 resume parsing after `#line'. See bug 61604.
10468 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10469 building: IsEnumType should return true only for enums, not for
10470 enums or System.Enum itself. This fixes #61593.
10472 Likely what happened is that corlib was wrong: mcs depended on
10473 this bug in some places. The bug got fixed, we had to add the
10474 hack, which caused bug 61593.
10476 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10477 that was a workaround for the older conditions.
10479 2004-07-16 Ben Maurer <bmaurer@ximian.com>
10481 * assign.cs: IAssignMethod has a new interface, as documented
10482 inline. All assignment code now uses this new api.
10484 * ecore.cs, expression.cs: All classes which implement
10485 IAssignMethod now use the new interface.
10487 * expression.cs (Invocation): add a hack to EmitCall so that
10488 IndexerAccess can be the target of a compound assignment without
10489 evaluating its arguments twice.
10491 * statement.cs: Handle changes in Invocation api.
10493 2004-07-16 Martin Baulig <martin@ximian.com>
10495 * iterators.cs: Rewrote this. We're now using one single Proxy
10496 class for both the IEnumerable and the IEnumerator interface and
10497 `Iterator' derives from Class so we can use the high-level API.
10499 * class.cs (TypeContainer.AddIterator): New method.
10500 (TypeContainer.DoDefineType): New protected virtual method, which
10501 is called from DefineType().
10502 (TypeContainer.DoDefineMembers): Call DefineType() and
10503 DefineMembers() on all our iterators.
10504 (TypeContainer.Emit): Call Emit() on all our iterators.
10505 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10507 * codegen.cs (EmitContext.CurrentIterator): New public field.
10509 2004-07-15 Martin Baulig <martin@ximian.com>
10512 (TypeManager.not_supported_exception_type): New type.
10514 2004-07-14 Martin Baulig <martin@ximian.com>
10516 * iterators.cs: Use real error numbers.
10518 2004-07-14 Martin Baulig <martin@ximian.com>
10520 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10521 requires this to be a System.Collection.IEnumerable and not a
10522 class implementing that interface.
10523 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10525 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10527 * class.cs: Fixed previous fix, it broke some error tests.
10529 2004-07-12 Martin Baulig <martin@ximian.com>
10531 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10534 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10536 * assign.cs (LocalTemporary): Add new argument: is_address,If
10537 `is_address' is true, then the value that we store is the address
10538 to the real value, and not the value itself.
10540 * ecore.cs (PropertyExpr): use the new local temporary
10541 stuff to allow us to handle X.Y += z (where X is a struct)
10543 2004-07-08 Martin Baulig <martin@ximian.com>
10545 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10546 not always return, just like we're doing in Using.Resolve().
10548 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10550 * cs-parser.jay (fixed_statement): flag this as Pinned.
10552 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10554 * typemanager.cs (TypeManager): Removed MakePinned method, this
10555 mechanism is replaced with the .NET 2.x compatible mechanism of
10556 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10558 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10559 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10560 `IsFixed' property which has a different meaning.
10562 2004-07-02 Raja R Harinath <rharinath@novell.com>
10564 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10565 visible from inside a nested class, not just the names of the
10566 immediately enclosing class.
10567 Fix for bug #60730.
10569 2004-06-24 Raja R Harinath <rharinath@novell.com>
10571 * expression.cs (BetterConversion): Remove buggy special-case
10572 handling of "implicit constant expression conversions". At this
10573 point, we already know that the conversion is possible -- we're
10574 only checking to see which is better.
10576 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10578 * cs-parser.jay: Added error CS0210 test.
10580 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10582 * cs-parser.jay: Added error CS0134 test.
10584 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10587 * cs-parser.jay: Added error CS0145 test.
10589 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10591 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10593 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10595 * expression.cs (StackAlloc.Resolve): The argument may not
10596 be a constant; deal with this case.
10598 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10600 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10601 GetIndexerAttributeValue.
10602 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10604 * class.cs (Indexer.Define): Added error tests for CS0415,
10607 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10609 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10612 2004-06-23 Martin Baulig <martin@ximian.com>
10614 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10615 neither return nor throw, reset the barrier as well. Fixes #60457.
10617 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10619 * class.cs : EventAttributes is now set to None by default.
10620 This fixes bug #60459.
10622 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10625 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10626 Don't throw exception but return null (it's sufficient now).
10628 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10630 * typemanager.cs (GetArgumentTypes): Faster implementation.
10632 2004-06-18 Martin Baulig <martin@ximian.com>
10634 * attribute.cs (Attribute.Resolve): Check whether we're an
10635 EmptyCast which a Constant child. Fixes #60333.
10637 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10639 * statement.cs (EmitCollectionForeach): Account for the fact that
10640 not all valuetypes are in areas which we can take the address of.
10641 For these variables, we store to a temporary variable. Also, make
10642 sure that we dont emit a `callvirt' on a valuetype method.
10644 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10646 * expression.cs (StackAlloc.DoReSolve): Added test for
10647 negative parameter (CS0247).
10649 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10652 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10654 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10657 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10660 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10662 Fix bug #58254 & cs1555.cs, cs1556.cs
10663 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10665 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10667 * cs-parser.jay: Added error CS1669 test for indexers.
10669 2004-06-11 Martin Baulig <martin@ximian.com>
10671 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10672 call this twice: for params and varargs methods.
10674 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10677 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10679 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10681 * attribute.cs (Attribute.GetValidTargets): Made public.
10684 (AbstractPropertyEventMethod): New class for better code sharing.
10685 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10687 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10689 2004-06-11 Raja R Harinath <rharinath@novell.com>
10692 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10693 that the call to Resolve is part of a MemberAccess.
10694 (Expression.Resolve): Use it for SimpleName resolution.
10695 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10696 Add 'intermediate' boolean argument.
10697 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
10698 error message when the SimpleName can be resolved ambiguously
10699 between an expression and a type.
10700 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10702 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10703 call on the left-side.
10705 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10708 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10710 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10712 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10714 2004-06-11 Martin Baulig <martin@ximian.com>
10716 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10717 varargs methods if applicable.
10719 2004-06-11 Martin Baulig <martin@ximian.com>
10721 * expression.cs (Invocation.EmitCall): Don't use
10722 `method.CallingConvention == CallingConventions.VarArgs' since the
10723 method could also have `CallingConventions.HasThis'.
10725 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10727 * class.cs (Event.GetSignatureForError): Implemented.
10728 Fixed crash in error test cs3010.cs
10730 2004-06-10 Miguel de Icaza <miguel@ximian.com>
10732 * cs-tokenizer.cs: Change the way we track __arglist to be
10733 consistent with the other keywords.
10735 2004-06-09 Miguel de Icaza <miguel@ximian.com>
10737 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10740 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
10742 * codegen.cs: Check that all referenced assemblies have a strongname
10743 before strongnaming the compiled assembly. If not report error CS1577.
10744 Fix bug #56563. Patch by Jackson Harper.
10745 * typemanager.cs: Added a method to return all referenced assemblies.
10746 Fix bug #56563. Patch by Jackson Harper.
10748 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10751 (Method.ApplyAttributeBuilder): Moved and added conditional
10752 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10755 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10757 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10760 * class.cs: (EventField.attribute_targets): Changed default target.
10762 2004-06-08 Martin Baulig <martin@ximian.com>
10764 * expression.cs (Invocation.EmitCall): Enable varargs methods.
10766 2004-06-08 Martin Baulig <martin@ximian.com>
10768 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10770 2004-06-07 Martin Baulig <martin@ximian.com>
10772 Added support for varargs methods.
10774 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10777 * cs-parser.jay: Added support for `__arglist'.
10779 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10781 * expression.cs (Argument.AType): Added `ArgList'.
10782 (Invocation): Added support for varargs methods.
10783 (ArglistAccess): New public class.
10784 (Arglist): New public class.
10786 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10788 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
10789 a method's top-level block if the method has varargs.
10791 * support.cs (ReflectionParameters, InternalParameters): Added
10792 support for varargs methods.
10794 2004-06-07 Miguel de Icaza <miguel@ximian.com>
10796 * class.cs: Provide location in indexer error report.
10798 * driver.cs: Use standard names.
10800 * namespace.cs: Catch the use of using after a namespace has been
10801 declared also on using aliases.
10803 2004-06-03 Raja R Harinath <rharinath@novell.com>
10806 * typemanager.cs (closure_private_ok, closure_invocation_type)
10807 (closure_qualifier_type, closure_invocation_assembly)
10808 (FilterWithClosure): Move to ...
10809 (Closure): New internal nested class.
10810 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10811 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10812 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10813 (MemberLookup, MemberLookupFailed): Use it.
10814 * expression.cs (New.DoResolve): Treat the lookup for the
10815 constructor as being qualified by the 'new'ed type.
10816 (Indexers.GetIndexersForTypeOrInterface): Update.
10818 2004-06-03 Marek Safar <marek.safar@seznam.cz>
10821 (GetConditionalAttributeValue): New method. Returns
10822 condition of ConditionalAttribute.
10823 (SearchMulti): New method. Returns all attributes of type 't'.
10824 Use it when attribute is AllowMultiple = true.
10825 (IsConditionalMethodExcluded): New method.
10828 (Method.IsExcluded): Implemented. Returns true if method has conditional
10829 attribute and the conditions is not defined (method is excluded).
10830 (IMethodData): Extended interface for ConditionalAttribute support.
10831 (PropertyMethod.IsExcluded): Implemented.
10834 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10837 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10840 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
10842 * expression.cs (ArrayCreationExpression): Make this just an
10843 `expression'. It can't be a statement, so the code here was
10846 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10849 * typemanager.cs (GetFullNameSignature): New method for
10852 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10855 * class.cs (MemberBase.GetSignatureForError): New virtual method.
10856 Use this method when MethodBuilder is null.
10857 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10858 Added test for error CS0626 (MONO reports error for this situation).
10859 (IMethodData.GetSignatureForError): Extended interface.
10861 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10864 (AttributeTester.GetObsoleteAttribute): Returns instance of
10865 ObsoleteAttribute when type is obsolete.
10868 (TypeContainer.VerifyObsoleteAttribute): Override.
10869 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10870 (MethodCode.VerifyObsoleteAttribute): Override.
10871 (MemberBase.VerifyObsoleteAttribute): Override.
10874 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10875 and report proper error.
10878 Delegate.VerifyObsoleteAttribute): Override.
10881 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10882 and report proper error.
10883 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10886 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10890 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10891 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10892 Added test for ObsoleteAttribute.
10895 (Catch): Derived from Statement.
10897 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10899 Fixed bug #59071 & cs0160.cs
10901 * statement.cs (Try.Resolve): Check here whether order of catch
10902 clauses matches their dependencies.
10904 2004-05-31 Miguel de Icaza <miguel@ximian.com>
10906 * Reverted patch to namespace.cs (Use lookuptypedirect). This
10907 caused a regression: #59343. Referencing nested classes from an
10908 assembly stopped working.
10910 2004-05-31 Martin Baulig <martin@ximian.com>
10912 MCS is now frozen for beta 2.
10914 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10916 * convert.cs: add a trivial cache for overload operator resolution.
10918 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10920 * decl.cs: If possible, use lookuptypedirect here. We can only do
10921 this if there is no `.' after the namespace. Avoids using
10922 LookupType, which does lots of slow processing.
10923 (FindNestedType) New method, does what it says :-).
10924 * namespace.cs: use LookupTypeDirect.
10925 * rootcontext.cs: use membercache, if possible.
10926 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10928 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10931 According to the spec,
10933 In a member access of the form E.I, if E is a single identifier,
10934 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10935 field, property, localvariable, or parameter with the same type as
10936 the meaning of E as a type-name (§3.8), then both possible
10937 meanings of E are permitted.
10939 We did not check that E as a simple-name had the same type as E as
10942 This trivial check gives us 5-7% on bootstrap time.
10944 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10946 * expression.cs (Invocation.OverloadResolve): Avoid the
10947 use of hashtables and boxing here by allocating on demand.
10949 2004-05-30 Martin Baulig <martin@ximian.com>
10951 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10952 we're doing a silent lookup. Don't try to lookup nested types in
10953 TypeManager.object_type (thanks to Ben Maurer).
10955 2004-05-30 Martin Baulig <martin@ximian.com>
10957 Committing a patch from Ben Maurer.
10959 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10961 2004-05-29 Martin Baulig <martin@ximian.com>
10963 * class.cs (IMethodData.ShouldIgnore): New method.
10965 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10966 `Location' argument, we don't need it anywhere. Use
10967 `IMethodData.ShouldIgnore ()' instead of
10968 `MethodData.GetMethodFlags ()'.
10969 (TypeManager.AddMethod): Removed.
10970 (TypeManager.AddMethod2): Renamed to AddMethod.
10972 2004-05-29 Martin Baulig <martin@ximian.com>
10974 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10976 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10977 converting from a class type S to an interface type and we already
10978 have an object on the stack, don't box it again. Fixes #52578.
10980 2004-05-29 Martin Baulig <martin@ximian.com>
10982 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10983 Added support for `params' parameters. Fixes #59267.
10985 2004-05-29 Martin Baulig <martin@ximian.com>
10987 * literal.cs (NullPointer): Provide a private .ctor which sets
10988 `type' to TypeManager.object_type. Fixes #59048.
10990 2004-05-29 Martin Baulig <martin@ximian.com>
10992 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10993 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10995 * ecore.cs (EventExpr.instance_expr): Make the field private.
10997 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10999 Fixed bug #50080 & cs0214-2.cs
11000 * expression.cs (Cast.DoResolve): Check unsafe context here.
11002 * statement.cs (Resolve.DoResolve): Likewise.
11004 2004-05-26 Martin Baulig <martin@ximian.com>
11006 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11008 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11009 (RootContext.LookupType): Pass down the `silent' flag.
11011 2004-05-25 Martin Baulig <martin@ximian.com>
11014 (MethodGroupExpr.IdenticalTypeName): New public property.
11015 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11016 expression actually refers to a type.
11018 2004-05-25 Martin Baulig <martin@ximian.com>
11020 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11021 for #56176 and made it actually work.
11023 2004-05-25 Martin Baulig <martin@ximian.com>
11025 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11026 (FieldExpr, PropertyExpr): Override and implement
11027 CacheTemporaries. Fixes #52279.
11029 2004-05-25 Miguel de Icaza <miguel@ximian.com>
11031 * location.cs: In the new compiler listing a file twice is a
11032 warning, not an error.
11034 2004-05-24 Martin Baulig <martin@ximian.com>
11036 * enum.cs (Enum.DefineType): For the `BaseType' to be a
11037 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
11039 2004-05-24 Martin Baulig <martin@ximian.com>
11041 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11042 walking the `using' list. Fixes #53921.
11044 2004-05-24 Martin Baulig <martin@ximian.com>
11046 * const.cs (Const.LookupConstantValue): Added support for
11047 EmptyCast's; fixes #55251.
11049 2004-05-24 Martin Baulig <martin@ximian.com>
11051 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11052 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11053 which does the CS0135 check. The reason is that we first need to
11054 check whether the variable actually exists.
11056 2004-05-24 Martin Baulig <martin@ximian.com>
11058 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11059 than RootContext.LookupType() to find the explicit interface
11060 type. Fixes #58584.
11062 2004-05-24 Raja R Harinath <rharinath@novell.com>
11064 * Makefile: Simplify. Use executable.make.
11065 * mcs.exe.sources: New file. List of sources of mcs.exe.
11067 2004-05-24 Anders Carlsson <andersca@gnome.org>
11071 Use the invariant culture when doing String.Compare for CLS case
11074 2004-05-23 Martin Baulig <martin@ximian.com>
11076 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11077 don't have any dots. Fixes #52622, added cs0246-8.cs.
11079 * namespace.cs (NamespaceEntry.Lookup): Likewise.
11081 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11083 * class.cs (MemberBase.Define): Reuse MemberType member for
11084 resolved type. Other methods can use it too.
11086 2004-05-23 Martin Baulig <martin@ximian.com>
11088 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11089 the variable also exists in the current block (otherwise, we need
11090 to report a CS0103). Fixes #58670.
11092 2004-05-23 Martin Baulig <martin@ximian.com>
11094 * flowanalysis.cs (Reachability.Reachable): Compute this
11095 on-the-fly rather than storing it as a field.
11097 2004-05-23 Martin Baulig <martin@ximian.com>
11099 * flowanalysis.cs (Reachability.And): Manually compute the
11100 resulting `barrier' from the reachability.
11102 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11105 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11106 instance of ObsoleteAttribute when symbol is obsolete.
11109 (IMethodData): Extended interface for ObsoleteAttribute support.
11111 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11113 * attribute.cs: Fix bug #55970
11115 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11119 (GetObsoleteAttribute): New method. Creates the instance of
11121 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11122 ObsoleteAttribute when member is obsolete.
11123 (AttributeTester.Report_ObsoleteMessage): Common method for
11124 Obsolete error/warning reporting.
11127 (TypeContainer.base_classs_type): New member for storing parent type.
11130 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11131 for this MemberCore.
11133 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11135 * attribute.cs, const.cs: Fix bug #58590
11137 2004-05-21 Martin Baulig <martin@ximian.com>
11139 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11140 out parameters if the end of the method is unreachable. Fixes
11143 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11145 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11146 Hari was right, why extra method.
11148 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11150 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11152 2004-05-20 Martin Baulig <martin@ximian.com>
11154 Merged this back from gmcs to keep the differences to a minumum.
11156 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11157 instead of a Declspace.
11158 (Attribute.ResolveType): Likewise.
11159 (Attributes.Search): Likewise.
11160 (Attributes.Contains): Likewise.
11161 (Attributes.GetClsCompliantAttribute): Likewise.
11163 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11165 (MethodData.ApplyAttributes): Take an EmitContext instead of a
11168 2004-05-19 Marek Safar <marek.safar@seznam.cz>
11170 Fix bug #58688 (MCS does not report error when the same attribute
11173 * attribute.cs (Attribute.Emit): Distinction between null and default.
11175 2004-05-19 Raja R Harinath <rharinath@novell.com>
11177 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11178 of a top-level attribute without an attribute target.
11179 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
11181 (Attribute.Conditional_GetConditionName),
11182 (Attribute.Obsolete_GetObsoleteMessage): Update.
11183 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
11184 part of ScanForIndexerName.
11185 (Attribute.CanIgnoreInvalidAttribute): New function.
11186 (Attribute.ScanForIndexerName): Move to ...
11187 (Attributes.ScanForIndexerName): ... here.
11188 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11189 (Attributes.Search): New internal variant that can choose not to
11190 complain if types aren't resolved. The original signature now
11192 (Attributes.GetClsCompliantAttribute): Use internal variant, with
11193 complaints suppressed.
11194 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11195 only if it not useful.
11196 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11197 top-level for attributes that are shared between the assembly
11198 and a top-level class.
11199 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11200 * class.cs: Update to reflect changes.
11201 (DefineIndexers): Fuse loops.
11202 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
11203 a couple more variants of attribute names.
11205 2004-05-18 Marek Safar <marek.safar@seznam.cz>
11207 Fix bug #52585 (Implemented explicit attribute declaration)
11210 (Attributable.ValidAttributeTargets): New abstract method. It gets
11211 list of valid attribute targets for explicit target declaration.
11212 (Attribute.Target): It holds target itself.
11213 (AttributeSection): Removed.
11214 (Attribute.CheckTargets): New method. It checks whether attribute
11215 target is valid for the current element.
11218 (EventProperty): New class. For events that are declared like
11219 property (with add and remove accessors).
11220 (EventField): New class. For events that are declared like field.
11223 * cs-parser.jay: Implemented explicit attribute target declaration.
11225 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
11226 Override ValidAttributeTargets.
11229 (ReturnParameter): Class for applying custom attributes on
11231 (ParameterAtribute): New class. Class for applying custom
11232 attributes on the parameter type.
11234 2004-05-17 Miguel de Icaza <miguel@ximian.com>
11236 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11239 (Method): Allow UNSAFE here.
11241 * modifiers.cs: Support unsafe reporting.
11243 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11245 * decl.cs: Fix bug #58478.
11247 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11249 * statement.cs: When checking for unreachable code on an EmptyStatement,
11250 set the location. Fixes bug #58488.
11252 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11254 * driver.cs: Add -pkg handling.
11256 From Gonzalo: UseShelLExecute=false
11258 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11261 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11263 (Attribute.IsClsCompliaceRequired): Moved to base for better
11265 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11266 when attribute is AttributeUsageAttribute.
11267 (Attribute.GetValidTargets): Simplified.
11268 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11269 attribute for this type.
11270 (Attribute.ApplyAttributes): Method renamed to Emit and make
11272 (GlobalAttributeSection): New class for special handling of global
11273 attributes (assembly, module).
11274 (AttributeSection.Emit): New method.
11276 * class.cs: Implemented Attributable abstract methods.
11277 (MethodCore.LabelParameters): Moved to Parameter class.
11278 (Accessor): Is back simple class.
11279 (PropertyMethod): Implemented Attributable abstract class.
11280 (DelegateMethod): Implemented Attributable abstract class.
11281 (Event): New constructor for disctintion between normal Event
11282 and Event with accessors.
11284 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11286 * codegen.cs, const.cs, decl.cs, delegate.cs:
11287 (CommonAssemblyModulClass): Implemented Attributable abstract class
11290 * enum.cs: Implement IAttributeSupport interface.
11291 (EnumMember): New class for emum members. Implemented Attributable
11295 (ParameterBase): Is abstract.
11296 (ReturnParameter): New class for easier [return:] attribute handling.
11298 * typemanager.cs: Removed builder_to_attr.
11300 2004-05-11 Raja R Harinath <rharinath@novell.com>
11303 * attribute.cs (Attribute.GetPositionalValue): New function.
11304 * class.cs (TypeContainer.VerifyMembers): New function.
11305 (TypeContainer.Emit): Use it.
11306 (ClassOrStruct): New base class for Class and Struct.
11307 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11308 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11310 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11311 then each non-static field should have a FieldOffset attribute.
11312 Otherwise, none of the fields should have a FieldOffset attribute.
11313 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11314 and FieldOffset attributes.
11315 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11316 (TypeManager.field_offset_attribute_type): New core types.
11317 (TypeManager.InitCoreTypes): Initialize them.
11319 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11321 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11322 Return correct type.
11325 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11327 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11328 be implicitly converted to ulong.
11330 * expression.cs: The logic for allowing operator &, | and ^ worked
11331 was wrong, it worked before because we did not report an error in
11332 an else branch. Fixes 57895.
11334 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11335 allow volatile fields to be reference types.
11337 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11339 * driver.cs: Add support for /debug-
11341 2004-05-07 Raja R Harinath <rharinath@novell.com>
11343 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11344 Add a 'complain' parameter to silence errors.
11345 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11346 silently overlooked type-resolutions.
11347 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11348 to reflect changes.
11349 (Attributes.Search): New function.
11350 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11351 (Attributes.GetAttributeFullName): Remove hack.
11352 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11353 Update to reflect changes.
11354 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11355 Use Attributes.Search instead of nested loops.
11357 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11360 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11361 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11362 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11364 * report.cs: (Report.Warning): Renamed to Warning_T because of
11365 parameter collision.
11367 2004-05-05 Raja R Harinath <rharinath@novell.com>
11369 * expression.cs (MemberAccess.ResolveMemberAccess):
11370 Exit with non-zero status after Report.Error.
11371 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11373 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11375 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11377 * support.cs: Don't hang when the file is empty.
11379 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11381 * support.cs: In SeekableStreamReader, compute the preamble size of the
11382 underlying stream. Position changes should take into account that initial
11385 2004-05-03 Todd Berman <tberman@sevenl.net>
11387 * driver.cs: remove unused GetSysVersion function.
11389 2004-05-03 Todd Berman <tberman@sevenl.net>
11391 * driver.cs: Remove the hack from saturday, as well as the hack
11392 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11393 link_paths to get that bit proper.
11395 2004-05-01 Todd Berman <tberman@sevenl.net>
11397 * driver.cs: Try a LoadFrom before a Load, this checks the current
11398 path. This is currently a bug in mono that is be fixed, however, this
11399 provides a workaround for now. This will be removed when the bug
11402 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11404 * CryptoConvert.cs: Updated to latest version. Fix issue with
11405 incomplete key pairs (#57941).
11407 2004-05-01 Todd Berman <tberman@sevenl.net>
11409 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11412 2004-04-30 Jackson Harper <jackson@ximian.com>
11414 * codegen.cs: Open keys readonly.
11416 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11418 * typemanager.cs: don't report cyclic struct layout when a struct
11419 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11420 which has 2 Pango.Rectangle fields.
11422 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11424 * expression.cs: Handle IntPtr comparisons with IL code
11425 rather than a method call.
11427 2004-04-29 Martin Baulig <martin@ximian.com>
11429 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11430 the list of PropertyInfo's in class hierarchy and find the
11431 accessor. Fixes #56013.
11433 2004-04-29 Martin Baulig <martin@ximian.com>
11435 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11437 2004-04-29 Martin Baulig <martin@ximian.com>
11439 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11441 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11443 2004-04-29 Martin Baulig <martin@ximian.com>
11445 * class.cs (ConstructorInitializer.Resolve): Check whether the
11446 parent .ctor is accessible. Fixes #52146.
11448 2004-04-29 Martin Baulig <martin@ximian.com>
11450 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11452 * statement.cs (Using.EmitLocalVariableDecls): Use
11453 TypeManager.idisposable_type, not typeof (IDisposable).
11454 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11456 2004-04-29 Martin Baulig <martin@ximian.com>
11458 * class.cs (Event.Define): Don't emit the field and don't set
11459 RTSpecialName and SpecialName for events on interfaces. Fixes
11462 2004-04-29 Raja R Harinath <rharinath@novell.com>
11464 Refactor Attribute.ApplyAttributes.
11465 * attribute.cs (Attributable): New base class for objects that can
11466 have Attributes applied on them.
11467 (Attribute): Make AttributeUsage fields public.
11468 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11469 (Attribute.IsInternalCall): New property.
11470 (Attribute.UsageAttr): Convert to a public read-only property.
11471 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11472 (Attribute.ResolveType, Attribute.Resolve)
11473 (Attribute.ScanForIndexerName): Update to reflect changes.
11474 (Attribute.CheckAttributeTarget): Re-format.
11475 (Attribute.ApplyAttributes): Refactor, to various
11476 Attributable.ApplyAttributeBuilder methods.
11477 * decl.cs (MemberCore): Make Attributable.
11478 * class.cs (Accessor): Make Attributable.
11479 (MethodData.ApplyAttributes): Use proper attribute types, not
11481 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11482 (TypeContainer.ApplyAttributeBuilder)
11483 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11484 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11485 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11486 (Operator.ApplyAttributeBuilder): New factored-out methods.
11487 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11488 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11489 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11490 * parameter.cs (ParameterBase): New Attributable base class
11491 that can also represent Return types.
11492 (Parameter): Update to the changes.
11494 2004-04-29 Jackson Harper <jackson@ximian.com>
11496 * driver.cs: Prefer the corlib system version when looking for
11497 assemblies in the GAC. This is still a hack, but its a better hack
11500 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11502 * decl.cs, enum.cs: Improved error 3005 reporting.
11504 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11505 (related_symbols): New private member for list of symbols
11506 related to reported error/warning.
11508 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11510 2004-04-29 Martin Baulig <martin@ximian.com>
11512 * ecore.cs (Expression.Constantify): If we're an enum and
11513 TypeManager.TypeToCoreType() doesn't give us another type, use
11514 t.UnderlyingSystemType. Fixes #56178.
11516 2004-04-29 Martin Baulig <martin@ximian.com>
11518 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11519 interfaces and for each interface, only add members directly
11520 declared in that interface. Fixes #53255.
11522 2004-04-28 Martin Baulig <martin@ximian.com>
11524 * expression.cs (ConditionalLogicalOperator): Use a temporary
11525 variable for `left' to avoid that we evaluate it more than once;
11528 2004-04-28 Martin Baulig <martin@ximian.com>
11530 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11533 2004-04-28 Martin Baulig <martin@ximian.com>
11535 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11538 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11539 whether the type is not void (CS1547).
11541 2004-04-28 Martin Baulig <martin@ximian.com>
11543 * expression.cs (Unary.DoResolveLValue): Override this and report
11544 CS0131 for anything but Operator.Indirection.
11546 2004-04-28 Martin Baulig <martin@ximian.com>
11548 Committing a patch from Ben Maurer; see bug #50820.
11550 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11553 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11556 2004-04-28 Martin Baulig <martin@ximian.com>
11558 Committing a patch from Ben Maurer; see bug #50820.
11560 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11563 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11566 2004-04-28 Martin Baulig <martin@ximian.com>
11568 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11569 (Block.AddLabel): Call DoLookupLabel() to only search in the
11572 2004-04-28 Martin Baulig <martin@ximian.com>
11574 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11575 comparing StringConstants and NullLiterals in Equality and Inequality.
11577 2004-04-28 Jackson Harper <jackson@ximian.com>
11579 * driver.cs: Attempt to load referenced assemblies from the
11580 GAC. This is the quick and dirty version of this method that
11581 doesnt take into account versions and just takes the first
11582 canidate found. Will be good enough for now as we will not have more
11583 then one version installed into the GAC until I update this method.
11585 2004-04-28 Martin Baulig <martin@ximian.com>
11587 * typemanager.cs (TypeManager.CheckStructCycles): New public
11588 static method to check for cycles in the struct layout.
11590 * rootcontext.cs (RootContext.PopulateTypes): Call
11591 TypeManager.CheckStructCycles() for each TypeContainer.
11592 [Note: We only need to visit each type once.]
11594 2004-04-28 Martin Baulig <martin@ximian.com>
11596 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11598 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11599 success and added `out object value'. Use a `bool resolved' field
11600 to check whether we've already been called rather than
11601 `ConstantValue != null' since this breaks for NullLiterals.
11603 2004-04-28 Raja R Harinath <rharinath@novell.com>
11605 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11606 setting of this flag, since the 'set' method may be non-public.
11608 2004-04-28 Raja R Harinath <rharinath@novell.com>
11610 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11611 check on current_vector.Block.
11613 2004-04-27 Martin Baulig <martin@ximian.com>
11615 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11616 a field initializer. Fixes #56459.
11618 2004-04-27 Martin Baulig <martin@ximian.com>
11620 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11621 we're not attempting to use an indexer. Fixes #52154.
11623 2004-04-27 Martin Baulig <martin@ximian.com>
11625 * statement.cs (Return): Don't create a return label if we don't
11626 need it; reverts my change from January 20th. Thanks to Ben
11629 2004-04-27 Martin Baulig <martin@ximian.com>
11631 According to the spec, `goto' can only leave a nested scope, but
11634 * statement.cs (Block.LookupLabel): Only lookup in the current
11635 block, don't recurse into parent or child blocks.
11636 (Block.AddLabel): Check in parent and child blocks, report
11637 CS0140/CS0158 if we find a duplicate.
11638 (Block): Removed this indexer for label lookups.
11639 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11640 this already does the error reporting for us.
11643 (FlowBranching.UsageVector.Block): New public variable; may be null.
11644 (FlowBranching.CreateSibling): Added `Block' argument.
11645 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11646 label for the target of a `goto' and check whether we're not
11647 leaving a `finally'.
11649 2004-04-27 Martin Baulig <martin@ximian.com>
11651 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11652 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11655 2004-04-27 Martin Baulig <martin@ximian.com>
11657 * statement.cs (Block.AddLabel): Also check for implicit blocks
11658 and added a CS0158 check.
11660 2004-04-27 Martin Baulig <martin@ximian.com>
11662 * flowanalysis.cs (FlowBranchingLoop): New class.
11663 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11664 UsageVector's instead of an ArrayList.
11665 (FlowBranching.Label): Likewise.
11666 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11667 (FlowBranching.AddBreakVector): New method.
11669 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11671 * attribute.cs: Small regression fix: only convert the type if we
11672 the type is different, fixes System.Drawing build.
11674 2004-04-27 Martin Baulig <martin@ximian.com>
11676 * attribute.cs (Attribute.Resolve): If we have a constant value
11677 for a named field or property, implicity convert it to the correct
11680 2004-04-27 Raja R Harinath <rharinath@novell.com>
11682 * statement.cs (Block.Block): Implicit blocks share
11683 'child_variable_names' fields with parent blocks.
11684 (Block.AddChildVariableNames): Remove.
11685 (Block.AddVariable): Mark variable as "used by a child block" in
11686 every surrounding block.
11687 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11688 been used in a child block, complain about violation of "Invariant
11689 meaning in blocks" rule.
11690 * cs-parser.jay (declare_local_variables): Don't use
11691 AddChildVariableNames.
11692 (foreach_statement): Don't create an implicit block: 'foreach'
11693 introduces a scope.
11695 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11697 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11698 converting from 0L to ulong. Fixes 57522.
11700 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11702 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11703 derived class hides via 'new' keyword field from base class (test-242.cs).
11704 TODO: Handle this in the more general way.
11706 * class.cs (CheckBase): Ditto.
11708 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11710 * decl.cs (caching_flags): New member for storing cached values
11712 (MemberCore.Flags): New enum where bit flags for caching_flags
11714 (MemberCore.cls_compliance): Moved to caching_flags.
11715 (DeclSpace.Created): Moved to caching_flags.
11717 * class.cs: Use caching_flags instead of DeclSpace.Created
11719 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11721 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11722 if we are only a derived class, not a nested class.
11724 * typemanager.cs: Same as above, but do this at the MemberLookup
11725 level (used by field and methods, properties are handled in
11726 PropertyExpr). Allow for the qualified access if we are a nested
11729 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11731 * class.cs: Refactoring.
11732 (IMethodData): New inteface; Holds links to parent members
11733 to avoid member duplication (reduced memory allocation).
11734 (Method): Implemented IMethodData interface.
11735 (PropertyBase): New inner classes for get/set methods.
11736 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11737 (Event): New inner classes for add/remove methods.
11738 (Event.DelegateMethod): Implemented IMethodData interface.
11740 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11741 EmitContext (related to class.cs refactoring).
11743 2004-04-21 Raja R Harinath <rharinath@novell.com>
11745 * delegate.cs (Delegate.VerifyApplicability): If the number of
11746 arguments are the same as the number of parameters, first try to
11747 verify applicability ignoring any 'params' modifier on the last
11751 2004-04-16 Raja R Harinath <rharinath@novell.com>
11753 * class.cs (TypeContainer.AddIndexer): Use
11754 'ExplicitInterfaceName' to determine if interface name was
11755 explicitly specified. 'InterfaceType' is not initialized at this time.
11756 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11757 Indexers array is already in the required order. Initialize
11758 'IndexerName' only if there are normal indexers.
11759 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11760 (TypeContainer.Emit): Emit DefaultMember attribute only if
11761 IndexerName is initialized.
11764 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11766 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11769 2004-04-15 Raja R Harinath <rharinath@novell.com>
11771 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11775 * attribute.cs (Attribute.Resolve): Check for duplicate named
11779 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11781 * iterators.cs (MarkYield): track whether we are in an exception,
11782 and generate code accordingly. Use a temporary value to store the
11783 result for our state.
11785 I had ignored a bit the interaction of try/catch with iterators
11786 since their behavior was not entirely obvious, but now it is
11787 possible to verify that our behavior is the same as MS .NET 2.0
11791 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11793 * iterators.cs: Avoid creating temporaries if there is no work to
11796 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11797 Enumerations, use TypeManager.EnumToUnderlying and call
11800 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11803 (This.Emit): Use EmitContext.EmitThis to emit our
11806 (This.EmitAssign): Ditto.
11808 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11809 codepaths, we will move all the functionality into
11812 (FieldExpr.EmitAssign): Ditto.
11814 This fixes several hidden bugs that I uncovered while doing a code
11815 review of this today.
11817 * codegen.cs (EmitThis): reworked so the semantics are more clear
11818 and also support value types "this" instances.
11820 * iterators.cs: Changed so that for iterators in value types, we
11821 do not pass the value type as a parameter.
11823 Initialization of the enumerator helpers is now done in the caller
11824 instead of passing the parameters to the constructors and having
11825 the constructor set the fields.
11827 The fields have now `assembly' visibility instead of private.
11829 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11831 * expression.cs (Argument.Resolve): Check if fields passed as ref
11832 or out are contained in a MarshalByRefObject.
11834 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11835 another compiler type.
11837 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11839 * class.cs (Indexer.Define): use the new name checking method.
11840 Also, return false on an error.
11841 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11842 (is_identifier_[start/part]_character): make static.
11844 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11846 * expression.cs (Binary.ResolveOperator): Do no append strings
11847 twice: since we can be invoked more than once (array evaluation)
11848 on the same concatenation, take care of this here. Based on a fix
11849 from Ben (bug #56454)
11851 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11853 * codegen.cs: Fix another case where CS1548 must be reported (when
11854 delay-sign isn't specified and no private is available #56564). Fix
11855 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11856 error when MCS is used on the MS runtime and we need to delay-sign
11857 (which seems unsupported by AssemblyBuilder - see #56621).
11859 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11861 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11862 (TypeManager.ComputeNamespaces): Faster implementation for
11865 * compiler.csproj: Updated AssemblyName to mcs.
11867 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11869 * rootcontext.cs: Add new types to the boot resolution.
11871 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11872 MulticastDelegate is not allowed.
11874 * typemanager.cs: Add new types to lookup: System.TypedReference
11877 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11878 check for TypedReference or ArgIterator, they are not allowed.
11880 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11881 makes us properly catch 1510 in some conditions (see bug 56016 for
11884 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11886 * CryptoConvert.cs: update from corlib version
11889 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11891 * class.cs (Indexer.Define): Check indexername declaration
11893 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11895 * attribute.cs (IsClsCompliant): Fixed problem with handling
11896 all three states (compliant, not-compliant, undetected).
11898 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11900 * attribute.cs (Attribute): Location is now public.
11901 (Resolve): Store resolved arguments (pos_values) in attribute class.
11902 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11903 (GetClsCompliantAttributeValue): New method that gets
11904 CLSCompliantAttribute value.
11905 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11906 if exists else null.
11907 (AttributeTester): New class for CLS-Compliant verification routines.
11909 * class.cs (Emit): Add CLS-Compliant verification.
11910 (Method.GetSignatureForError): Implemented.
11911 (Constructor.GetSignatureForError): Implemented
11912 (Constructor.HasCompliantArgs): Returns if constructor has
11913 CLS-Compliant arguments.
11914 (Constructor.Emit): Override.
11915 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11916 is needed to test only parameters.
11917 (FieldBase.GetSignatureForError): Implemented.
11918 (TypeContainer): New member for storing base interfaces.
11919 (TypeContainer.FindMembers): Search in base interfaces too.
11921 * codegen.cs (GetClsComplianceAttribute): New method that gets
11922 assembly or module CLSCompliantAttribute value.
11923 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11925 (ModuleClass.Emit): Add error 3012 test.
11927 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11929 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11930 state for all decl types.
11931 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11932 if CLS-Compliant tests are required.
11933 (IsClsCompliaceRequired): New method. Analyze whether code
11934 must be CLS-Compliant.
11935 (IsExposedFromAssembly): New method. Returns true when MemberCore
11936 is exposed from assembly.
11937 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11938 value or gets cached value.
11939 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11940 is explicitly marked with CLSCompliantAttribute.
11941 (IsIdentifierClsCompliant): New abstract method. This method is
11942 used to testing error 3005.
11943 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11944 for identifier and parameters CLS-Compliant testing.
11945 (VerifyClsCompliance): New method. The main virtual method for
11946 CLS-Compliant verifications.
11947 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11948 null. I don't know why is null (too many public members !).
11949 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11950 and get value of first CLSCompliantAttribute that found.
11952 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11953 (VerifyClsCompliance): Override and add extra tests.
11955 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11956 clscheck- disable CLS-Compliant verification event if assembly is has
11957 CLSCompliantAttribute(true).
11959 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11960 ApllyAttribute is now called in emit section as in the other cases.
11961 Possible future Emit integration.
11962 (IsIdentifierClsCompliant): New override.
11963 (VerifyClsCompliance): New override.
11964 (GetEnumeratorName): Returns full enum name.
11966 * parameter.cs (GetSignatureForError): Implemented.
11968 * report.cs (WarningData): New struct for Warning message information.
11969 (LocationOfPreviousError): New method.
11970 (Warning): New method. Reports warning based on the warning table.
11971 (Error_T): New method. Reports error based on the error table.
11973 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11974 verifications are done here.
11976 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11978 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11979 CLSCompliantAttribute.
11980 (all_imported_types): New member holds all imported types from other
11982 (LoadAllImportedTypes): New method fills static table with exported types
11983 from all referenced assemblies.
11984 (Modules): New property returns all assembly modules.
11986 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11988 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11989 throwing a parser error.
11991 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11992 which removes the hardcoded get_/set_ prefixes for properties, as
11993 IL allows for the properties to be named something else.
11997 * expression.cs: Do not override operand before we know if it is
11998 non-null. Fix 56207
12000 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12002 * typemanager.cs: support for pinned variables.
12004 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12006 * decl.cs, typemanager.cs: Avoid using an arraylist
12007 as a buffer if there is only one result set.
12009 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12011 * expression.cs: Make sure you cant call a static method
12012 with an instance expression, bug #56174.
12014 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12016 * class.cs (IsDuplicateImplementation): Improve error reporting to
12017 flag 663 (method only differs in parameter modifier).
12019 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12020 in preprocessor directives.
12022 * location.cs (LookupFile): Allow for the empty path.
12024 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12025 better approach for some of that patch, but its failing with the
12026 CharSet enumeration. For now try/catch will do.
12028 * typemanager.cs: Do not crash if a struct does not have fields.
12031 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12033 * expression.cs: cs0213, cant fix a fixed expression.
12036 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12038 * cs-parser.jay: detect invalid embeded statements gracefully.
12041 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12043 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12046 the invocation type may not be a subclass of the tye of the item/
12047 The type of the item must be a subclass of the invocation item.
12052 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12054 * attribute.cs: Added methods to get a string and a bool from an
12055 attribute. Required to information from AssemblyKeyFileAttribute,
12056 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12057 * codegen.cs: Modified AssemblyName creation to include support for
12058 strongnames. Catch additional exceptions to report them as CS1548.
12059 * compiler.csproj: Updated include CryptoConvert.cs.
12060 * compiler.csproj.user: Removed file - user specific configuration.
12061 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12062 Mono.Security assembly. The original class is maintained and tested in
12063 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12064 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12065 like CSC 8.0 (C# v2) supports.
12066 * Makefile: Added CryptoConvert.cs to mcs sources.
12067 * rootcontext.cs: Added new options for strongnames.
12069 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12071 * driver.cs: For --expect-error, report error code `2'
12072 if the program compiled with no errors, error code `1' if
12073 it compiled with an error other than the one expected.
12075 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12077 * compiler.csproj: Updated for Visual Studio .NET 2003.
12078 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12079 * compiler.sln: Updated for Visual Studio .NET 2003.
12081 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12083 * expression.cs: Fix bug #47234. We basically need to apply the
12084 rule that we prefer the conversion of null to a reference type
12085 when faced with a conversion to 'object' (csc behaviour).
12087 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12089 * statement.cs: Shorter form for foreach, eliminates
12090 a local variable. r=Martin.
12092 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12094 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12095 checks if we can use brtrue/brfalse to test for 0.
12096 * expression.cs: use the above in the test for using brtrue/brfalse.
12097 cleanup code a bit.
12099 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12101 * expression.cs: Rewrite string concat stuff. Benefits:
12103 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12104 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12105 rather than a concat chain.
12107 * typemanager.cs: Add lookups for more concat overloads.
12109 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12111 * expression.cs: Emit shorter il code for array init.
12128 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12130 * statement.cs: Before, two switch blocks would be merged if the
12131 total size of the blocks (end_item - begin_item + 1) was less than
12132 two times the combined sizes of the blocks.
12134 Now, it will only merge if after the merge at least half of the
12139 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12141 * class.cs : csc build fix for GetMethods(). See bug #52503.
12143 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12145 * expression.cs: Make sure fp comparisons work with NaN.
12146 This fixes bug #54303. Mig approved this patch a long
12147 time ago, but we were not able to test b/c the runtime
12150 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12152 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12154 2004-03-19 Martin Baulig <martin@ximian.com>
12156 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12157 error here and not in our caller.
12159 2004-03-19 Martin Baulig <martin@ximian.com>
12161 * interface.cs: Completely killed this file.
12162 (Interface): We're now a TypeContainer and live in class.cs.
12164 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12165 argument; we're now also called for interfaces.
12166 (TypeContainer.DefineMembers): Allow this method being called
12168 (TypeContainer.GetMethods): New public method; formerly known as
12169 Interface.GetMethod(). This is used by PendingImplementation.
12170 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12171 it's now private and non-static.
12172 (Interface): Moved this here; it's now implemented similar to
12174 (Method, Property, Event, Indexer): Added `bool is_interface'
12175 argument to their .ctor's.
12176 (MemberBase.IsInterface): New public field.
12178 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12179 instances instead of InterfaceMethod, InterfaceProperty, etc.
12180 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12181 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12183 2004-03-19 Martin Baulig <martin@ximian.com>
12185 * class.cs (MethodCore.IsDuplicateImplementation): New private
12186 method which does the CS0111 checking.
12187 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12188 Use IsDuplicateImplementation().
12190 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12192 * decl.cs (FindMemberToOverride): New method to find the correct
12193 method or property to override in the base class.
12195 - Make Method/Property use the above method to find the
12196 version in the base class.
12197 - Remove the InheritableMemberSignatureCompare as it is now
12200 This patch makes large code bases much faster to compile, as it is
12201 O(n) rather than O(n^2) to do this validation.
12203 Also, it fixes bug 52458 which is that nested classes are not
12204 taken into account when finding the base class member.
12206 Reviewed/Approved by Martin.
12208 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12210 * interface.cs: In all interface classes removed redundant
12211 member initialization.
12213 2004-03-16 Martin Baulig <martin@ximian.com>
12215 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12217 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12219 * decl.cs (DefineTypeAndParents): New helper method to define a
12220 type's containers before the type itself is defined; This is a
12221 bug exposed by the recent changes to Windows.Forms when an
12222 implemented interface was defined inside a class that had not been
12225 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12227 (Check): Loop correctly to report errors modifiers
12228 (UNSAFE was not in the loop, since it was the same as TOP).
12230 * interface.cs: Every interface member now takes a ModFlags,
12231 instead of a "is_new" bool, which we set on the base MemberCore.
12233 Every place where we called "UnsafeOk" in the interface, now we
12234 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12235 the unsafe settings from the member declaration instead of the
12236 container interface.
12238 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12240 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12241 `set_indexer_name' to the pending bits (one per type).
12243 We fixed a bug today that was picking the wrong method to
12244 override, since for properties the existing InterfaceMethod code
12245 basically ignored the method name. Now we make sure that the
12246 method name is one of the valid indexer names.
12248 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12250 * support.cs (SeekableStreamReader): Keep track of stream byte
12251 positions and don't mix them with character offsets to the buffer.
12253 Patch from Gustavo Giráldez
12255 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12257 * interface.cs (InterfaceSetGetBase): Removed double member
12258 initialization, base class does it as well.
12260 2004-03-13 Martin Baulig <martin@ximian.com>
12262 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12263 when compiling corlib.
12265 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12267 * convert.cs (ExplicitConversion): We were reporting an error on
12268 certain conversions (object_type source to a value type, when the
12269 expression was `null') before we had a chance to pass it through
12270 the user defined conversions.
12272 * driver.cs: Replace / and \ in resource specifications to dots.
12275 * class.cs: Add check for duplicate operators. Fixes 52477
12277 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12279 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12280 that are in the middle of the statements, not only at the end.
12283 * class.cs (TypeContainer.AddField): No longer set the
12284 `HaveStaticConstructor' flag, now we call it
12285 `UserDefineStaticConstructor' to diferentiate the slightly
12286 semantic difference.
12288 The situation is that we were not adding BeforeFieldInit (from
12289 Modifiers.TypeAttr) to classes that could have it.
12290 BeforeFieldInit should be set to classes that have no static
12295 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12297 And most importantly Zoltan's comment:
12299 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12301 "I think beforefieldinit means 'it's ok to initialize the type sometime
12302 before its static fields are used', i.e. initialization does not need
12303 to be triggered by the first access to the type. Setting this flag
12304 helps the JIT to compile better code, since it can run the static
12305 constructor at JIT time, and does not need to generate code to call it
12306 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12307 this flag for lots of classes like String.
12309 csc sets this flag if the type does not have an explicit static
12310 constructor. The reasoning seems to be that if there are only static
12311 initalizers for a type, and no static constructor, then the programmer
12312 does not care when this initialization happens, so beforefieldinit
12315 This bug prevents the AOT compiler from being usable, since it
12316 generates so many calls to mono_runtime_class_init that the AOT code
12317 is much slower than the JITted code. The JITted code is faster,
12318 because it does not generate these calls if the vtable is type is
12319 already initialized, which is true in the majority of cases. But the
12320 AOT compiler can't do this."
12322 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12324 * class.cs (MethodData.Emit): Refactor the code so symbolic
12325 information is generated for destructors; For some reasons we
12326 were taking a code path that did not generate symbolic information
12329 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12331 * class.cs: Create a Constructor.CheckBase method that
12332 takes care of all validation type code. The method
12333 contains some code that was moved from Define.
12335 It also includes new code that checks for duplicate ctors.
12336 This fixes bug #55148.
12338 2004-03-09 Joshua Tauberer <tauberer@for.net>
12340 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12341 a { ... }-style array creation invokes EmitStaticInitializers
12342 which is not good for reference-type arrays. String, decimal
12343 and now null constants (NullCast) are not counted toward
12344 static initializers.
12346 2004-03-05 Martin Baulig <martin@ximian.com>
12348 * location.cs (SourceFile.HasLineDirective): New public field;
12349 specifies whether the file contains or is referenced by a "#line"
12351 (Location.DefineSymbolDocuments): Ignore source files which
12352 either contain or are referenced by a "#line" directive.
12354 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12356 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12357 direct access to our parent, so check the method inline there.
12359 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12361 * expression.cs (Invocation.EmitCall): Miguel's last commit
12362 caused a regression. If you had:
12367 In Foo the implict this would be null.
12369 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12371 * expression.cs (Invocation.EmitCall): If the method is not
12372 virtual, do not emit a CallVirt to it, use Call.
12374 * typemanager.cs (GetFullNameSignature): Improve the method to
12375 cope with ".ctor" and replace it with the type name.
12377 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12378 as an argument the ConstructorBuilder where it is being defined,
12379 to catch the recursive constructor invocations.
12381 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12383 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12384 routines to check if a type is an enumerable/enumerator allow
12385 classes that implement the IEnumerable or IEnumerator interfaces.
12387 * class.cs (Property, Operator): Implement IIteratorContainer, and
12388 implement SetYields.
12390 (Property.Define): Do the block swapping for get_methods in the
12391 context of iterators. We need to check if Properties also
12392 include indexers or not.
12394 (Operator): Assign the Block before invoking the
12395 OperatorMethod.Define, so we can trigger the Iterator code
12398 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12399 Property and Operator classes are not created when we parse the
12400 declarator but until we have the block completed, so we use a
12401 singleton SimpleIteratorContainer.Simple to flag whether the
12402 SetYields has been invoked.
12404 We propagate this setting then to the Property or the Operator to
12405 allow the `yield' to function.
12407 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12409 * codegen.cs: Implemented attribute support for modules.
12410 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12411 Assembly/Module functionality.
12413 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12414 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12415 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12417 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12419 * interface.cs (FindMembers): The operation is performed on all base
12420 interfaces and not only on the first. It is required for future CLS Compliance patch.
12422 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12424 * statement.cs, codegen.cs:
12425 This patch deals with patterns such as:
12427 public class List : IEnumerable {
12429 public MyEnumerator GetEnumerator () {
12430 return new MyEnumerator(this);
12433 IEnumerator IEnumerable.GetEnumerator () {
12437 public struct MyEnumerator : IEnumerator {
12442 Before, there were a few things we did wrong:
12443 1) we would emit callvirt on a struct, which is illegal
12444 2) we emited ldarg when we needed to emit ldarga
12445 3) we would mistakenly call the interface methods on an enumerator
12446 type that derived from IEnumerator and was in another assembly. For example:
12448 public class MyEnumerator : IEnumerator
12450 Would have the interface methods called, even if there were public impls of the
12451 method. In a struct, this lead to invalid IL code.
12453 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12455 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12458 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12460 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12462 * cs-parser.jay: Fix small regression: we were not testing V2
12463 compiler features correctly.
12465 * interface.cs: If the emit context is null, then create one
12467 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12469 * decl.cs (GetSignatureForError): New virtual method to get full name
12470 for error messages.
12472 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12473 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12475 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12476 Duplicated members and code in these classes has been removed.
12477 Better encapsulation in these classes.
12479 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12481 * assign.cs (Assign.DoResolve): When dealing with compound
12482 assignments, there is a new rule in ECMA C# 2.4 (might have been
12483 there before, but it is documented here) that states that in:
12487 If b is of type int, and the `op' is a shift-operator, then the
12488 above is evaluated as:
12492 * expression.cs (Binary.ResolveOperator): Instead of testing for
12493 int/uint/long/ulong, try to implicitly convert to any of those
12494 types and use that in pointer arithmetic.
12496 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12497 method to print information for from the type, not from the
12498 null-method we were given.
12500 2004-02-01 Duncan Mak <duncan@ximian.com>
12502 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12503 parsing for cmd, fixes bug #53694.
12505 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12507 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12508 in the member name duplication tests. Property and operator name duplication
12509 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12511 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12513 * interface.cs (PopulateMethod): Fixed crash when interface method
12514 returns not existing type (error test cs0246-3.cs).
12516 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12518 * cs-parser.jay (interface_accessors): Re-write actions to also
12519 store attributes attached to get and set methods. Fix spelling
12522 (inteface_property_declaration): Modify accordingly.
12524 (InterfaceAccessorInfo): New helper class to store information to pass
12525 around between rules that use interface_accessors.
12527 * interface.cs (Emit): Apply attributes on the get and set
12528 accessors of properties and indexers too.
12530 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12531 right MethodBuilder when applying attributes to the get and set accessors.
12533 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12535 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12537 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12539 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12541 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12543 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12544 changes that treat `yield' specially when present before `break'
12545 or `return' tokens.
12547 * cs-tokenizer.cs: yield is no longer a keyword.
12549 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12551 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12552 setting for default constructors.
12553 For default constructors are almost every time set wrong Modifier. The
12554 generated IL code has been alright. But inside mcs this values was
12555 wrong and this was reason why several of my CLS Compliance tests
12558 2004-01-22 Martin Baulig <martin@ximian.com>
12560 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12561 not a QualifiedIdentifier. This is what `type_name_expression'
12562 was previously doing.
12563 (type_name_expression): Removed; the code is now in
12564 `namespace_or_type_name'.
12565 (qualified_identifier): Removed, use `namespace_or_type_name'
12567 (QualifiedIdentifier): Removed this class.
12569 2004-01-22 Martin Baulig <martin@ximian.com>
12571 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12572 not a string as alias name.
12574 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12576 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12577 #52730 bug, and instead compute correctly the need to use a
12578 temporary variable when requesting an address based on the
12579 static/instace modified of the field and the constructor.
12581 2004-01-21 Martin Baulig <martin@ximian.com>
12583 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12584 class and namespace before looking up aliases. Fixes #52517.
12586 2004-01-21 Martin Baulig <martin@ximian.com>
12588 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12589 assinged in a 'try'; fixes exception4.cs.
12591 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12592 * class.cs : Implemented parameter-less constructor for TypeContainer
12594 * decl.cs: Attributes are now stored here. New property OptAttributes
12596 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12598 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12600 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12602 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12603 (CSharpSignature): New method for indexer and property signature.
12605 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12607 * pending.cs (IsVirtualFilter): Faster implementation.
12609 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12611 * typemanager.cs: Avoid inclusion of same assembly more than once.
12613 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12615 * cs-parser.jay: Fixed problem where the last assembly attribute
12616 has been applied also to following declaration (class, struct, etc.)
12618 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12620 * class.cs: Added error CS0538, CS0539 reporting.
12621 Fixed crash on Microsoft runtime when field type is void.
12623 * cs-parser.jay: Added error CS0537 reporting.
12625 * pending.cs: Added error CS0535 reporting.
12626 Improved error report for errors CS0536, CS0534.
12628 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12630 Merge a few bits from the Anonymous Method MCS tree.
12632 * statement.cs (ToplevelBlock): New class for toplevel methods,
12633 will hold anonymous methods, lifted variables.
12635 * cs-parser.jay: Create toplevel blocks for delegates and for
12636 regular blocks of code.
12638 2004-01-20 Martin Baulig <martin@ximian.com>
12640 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12641 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12642 and `NeedExplicitReturn'; added `IsLastStatement'.
12643 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12644 have a `ReturnLabel' or we're not unreachable.
12646 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12647 child's reachability; don't just override ours with it. Fixes
12648 #58058 (lluis's example).
12649 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12650 InFinally(), InLoop(), InSwitch() and
12651 BreakCrossesTryCatchBoundary() methods.
12653 * statement.cs (Return): Do all error checking in Resolve().
12654 Unless we are the last statement in a top-level block, always
12655 create a return label and jump to it.
12656 (Break, Continue): Do all error checking in Resolve(); also make
12657 sure we aren't leaving a `finally'.
12658 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12659 statement in a top-level block.
12660 (Block.Flags): Added `IsDestructor'.
12661 (Block.IsDestructor): New public property.
12663 2004-01-20 Martin Baulig <martin@ximian.com>
12665 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12667 2004-01-20 Martin Baulig <martin@ximian.com>
12669 * statement.cs (Statement.ResolveUnreachable): New public method.
12670 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12671 (Block.Resolve): Resolve unreachable statements.
12673 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12675 * expression.cs: We need to fix the case where we do
12676 not have a temp variable here.
12678 * assign.cs: Only expression compound assignments need
12679 temporary variables.
12681 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12683 * flowanalysis.cs: Reduce memory allocation in a few ways:
12684 - A block with no variables should not allocate a bit
12686 - A method with no out parameters does not need any tracking
12687 for assignment of the parameters, so we need not allocate
12690 public readonly Type[] VariableTypes;
12691 public readonly string[] VariableNames;
12692 Are redundant. The data is already stored in the variable
12693 map, so we need not allocate another array for it.
12694 - We need to add alot of checks for if (params | locals) == null
12695 due to the first two changes.
12697 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12699 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12700 implement IMemoryLocation, we store a copy on a local variable and
12701 take the address of it. Patch from Benjamin Jemlich
12703 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12704 to use a special "type_name_expression" rule which reduces the
12705 number of "QualifiedIdentifier" classes created, and instead
12706 directly creates MemberAccess expressions.
12708 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12710 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12711 that fixes #52853. Null literal assignment to ValueType
12713 * class.cs (MethodData.Emit): Instead of checking the name of the
12714 method to determine if its a destructor, create a new derived
12715 class from Method called Destructor, and test for that.
12717 * cs-parser.jay: Create a Destructor object instead of a Method.
12719 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12723 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12725 * expression.cs (Binary.ResolveOperator): Perform an implicit
12726 conversion from MethodGroups to their delegate types on the
12727 Addition operation.
12729 * delegate.cs: Introduce a new class DelegateCreation that is the
12730 base class for `NewDelegate' and `ImplicitDelegateCreation',
12731 factor some code in here.
12733 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12734 conversion from MethodGroups to compatible delegate types.
12736 * ecore.cs (Expression.Resolve): Do not flag error 654
12737 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12738 we allow conversions from MethodGroups to delegate types now.
12740 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12741 assignments in v2 either.
12743 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12745 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12746 static read-only fields in ctors.
12748 Applied patch from Benjamin Jemlich
12750 * expression.cs (UnaryMutator): Avoid leaking local variables.
12752 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12754 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12755 here to return true, as they can be used like this:
12757 (XXX) int.MEMBER ()
12759 Fixed 49836 and all the other dups
12761 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12763 * driver.cs: Implement /win32res and /win32icon.
12765 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12767 * cs-parser.jay: Add a rule to improve error handling for the
12768 common mistake of placing modifiers after the type.
12770 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12772 * cs-parser.jay (interface_event_declaration): Catch
12773 initialization of events on interfaces, and report cs0068
12775 * cs-parser.jay (interface_event_declaration): Catch
12776 initialization of events.
12778 * ecore.cs: Better report missing constructors.
12780 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12781 the error reporting done in the wrong place. Fix.
12783 * expression.cs (Binary.ResolveOperator): Catch the
12784 operator + (E x, E y) error earlier, and later allow for implicit
12785 conversions in operator +/- (E e, U x) from U to the underlying
12788 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12789 52596, if the container class is abstract, the default constructor
12790 is protected otherwise its public (before, we were always public).
12792 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12795 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12796 Jemlich that fixes bug #52597, MCS was generating invalid code for
12797 idisposable structs. Thanks to Ben for following up with this
12800 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12802 * driver.cs: Allow assemblies without code to be generated, fixes
12805 2004-01-07 Nick Drochak <ndrochak@gol.com>
12807 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12809 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12811 * cs-parser.jay: Add rules to improve error reporting if fields or
12812 methods are declared at the namespace level (error 116)
12814 * Add rules to catch event add/remove
12816 2004-01-04 David Sheldon <dave-mono@earth.li>
12818 * expression.cs: Added matching ")" to error message for
12821 2004-01-03 Todd Berman <tberman@gentoo.org>
12823 * ecore.cs, attribute.cs:
12824 Applying fix from #52429.
12826 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12828 * ecore.cs, expression.cs, statement.cs:
12829 Total rewrite of how we handle branching. We
12830 now handle complex boolean expressions with fewer
12831 jumps. As well if (x == 0) no longer emits a ceq.
12833 if (x is Foo) is much faster now, because we generate
12836 Overall, we get a pretty big improvement on our benchmark
12837 tests. The code we generate is smaller and more readable.
12839 I did a full two-stage bootstrap. The patch was reviewed
12840 by Martin and Miguel.
12842 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12844 * cs-parser.jay: Make primary_expression not take a QI.
12845 we dont need this because the member_access rule covers
12846 us here. So we replace the rule with just IDENTIFIER.
12848 This has two good effects. First, we remove a s/r conflict.
12849 Second, we allocate many fewer QualifiedIdentifier objects.
12851 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12853 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12854 set the correct information via SRE. This prevents
12855 hanging on the MS runtime. Fixes #29374.
12857 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12859 * convert.cs: correctly handle conversions to value types
12860 from Enum and ValueType as unboxing conversions.
12862 Fixes bug #52569. Patch by Benjamin Jemlich.
12864 2004-01-02 Ravi Pratap <ravi@ximian.com>
12866 * expression.cs (BetterConversion): Prefer int -> uint
12867 over int -> ulong (csc's behaviour). This fixed bug #52046.
12869 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12871 * decl.cs (MemberCache.FindMembers): now returns a
12874 * typemanager.cs: In general, go with with ^^.
12875 (CopyNewMethods): take an IList.
12876 (RealMemberLookup): Only allocate an arraylist
12877 if we copy from two sets of methods.
12879 This change basically does two things:
12880 1) Fewer array lists allocated due to CopyNewMethods.
12881 2) the explicit cast in MemberList costed ALOT.
12883 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12885 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12886 a hashtable to avoid needless string allocations when an identifier is
12887 used more than once (the common case).
12889 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12891 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12892 is broken, it will not return anything. So, we
12893 have to use the information we have in mcs to
12896 * typemanager.cs: Add a cache for GetInterfaces,
12897 since this will now be used more often (due to ^^)
12899 (GetExplicitInterfaces) New method that gets the
12900 declared, not effective, interfaces on a type
12901 builder (eg, if you have interface IFoo, interface
12902 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12905 This patch makes MCS able to bootstrap itself on
12908 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12910 * expression.cs: Remove the Nop's that Miguel put
12913 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12915 * report.cs, codegen.cs: Give the real stack trace to
12916 the error when an exception is thrown.
12918 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12920 * decl.cs: only allocate hashtables for ifaces if
12923 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12925 * expression.cs: fix the error from cs0121-2.cs
12926 (a parent interface has two child interfaces that
12927 have a function with the same name and 0 params
12928 and the function is called through the parent).
12930 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12932 * class.cs, rootcontext.cs, typmanager.cs: do not
12935 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12937 * codegen.cs: remove stack for the ec flow branching.
12938 It is already a linked list, so no need.
12940 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12942 * Makefile: Allow custom profiler here.
12944 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12946 * typemanager.cs (LookupType):
12947 - Use a static char [], because split takes
12948 a param array for args, so it was allocating
12950 - Do not store true in a hashtable, it boxes.
12952 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12954 * flowanalysis.cs: bytify common enums.
12956 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12958 * modifiers.cs: Add a new set of flags for the
12959 flags allowed on explicit interface impls.
12960 * cs-parser.jay: catch the use of modifiers in
12961 interfaces correctly.
12962 * class.cs: catch private void IFoo.Blah ().
12964 All related to bug #50572.
12966 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12968 * decl.cs: Rewrite the consistant accessability checking.
12969 Accessability is not linear, it must be implemented in
12970 a tableish way. Fixes #49704.
12972 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12974 * expression.cs: Handle negation in a checked context.
12975 We must use subtraction from zero. Fixes #38674.
12977 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12979 * class.cs: Ignore static void main in DLLs.
12980 * rootcontext.cs: Handle the target type here,
12981 since we are have to access it from class.cs
12982 * driver.cs: account for the above.
12984 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12986 * report.cs: Give line numbers and files if available.
12988 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12990 * driver.cs: Implement /addmodule.
12992 * typemanager.cs: Change 'modules' field so it now contains Modules not
12995 2003-12-20 Martin Baulig <martin@ximian.com>
12997 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12998 (FieldBase.IsAssigned): Removed this field.
12999 (FieldBase.SetAssigned): New public method.
13000 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13002 2003-12-20 Martin Baulig <martin@ximian.com>
13004 * expression.cs (LocalVariableReference.DoResolve): Don't set
13005 `vi.Used' if we're called from DoResolveLValue().
13007 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13008 returns the usage vector it just merged into the current one -
13009 pass this one to UsageWarning().
13010 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13011 of the `EmitContext', don't call this recursively on our children.
13013 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13015 * driver.cs: Implement /target:module.
13017 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13019 * support.cs (CharArrayHashtable): New helper class.
13021 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13022 char arrays, not strings, so we can avoid creating a string in
13023 consume_identifier if the identifier is a keyword.
13025 2003-12-16 Martin Baulig <martin@ximian.com>
13027 * statement.cs (LocalInfo.Assigned): Removed this property.
13028 (LocalInfo.Flags): Removed `Assigned'.
13029 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13030 and uses flow analysis.
13031 (Block.UsageWarning): Made this method private.
13032 (Block.Resolve): Call UsageWarning() if appropriate.
13034 * expression.cs (LocalVariableReference.DoResolve): Always set
13035 LocalInfo.Used here.
13037 2003-12-13 Martin Baulig <martin@ximian.com>
13039 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13040 any value here; we're now using flow analysis to figure out
13041 whether a statement/block returns a value.
13043 2003-12-13 Martin Baulig <martin@ximian.com>
13045 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13047 (FlowBranching.MergeFinally): Don't call
13048 `branching.CheckOutParameters()' here, this is called in
13050 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13051 when adding the `finally' vector.
13053 2003-12-13 Martin Baulig <martin@ximian.com>
13056 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13057 actually work and also fix #48962.
13059 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13061 * decl.cs: Do not check System.Object for nested types,
13062 since we know it does not have any. Big bang for buck:
13065 Run 1: 8.35 seconds
13066 Run 2: 8.32 seconds
13067 corlib: 17.99 seconds
13069 Run 1: 8.17 seconds
13070 Run 2: 8.17 seconds
13071 corlib: 17.39 seconds
13073 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13075 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13076 time we are returning 0 members, so we save alot here.
13078 2003-12-11 Martin Baulig <martin@ximian.com>
13080 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13081 `MergeChild()', also just take the `FlowBranching' as argument;
13082 call Merge() on it and return the result.
13083 (FlowBranching.Merge): We don't need to do anything if we just
13086 2003-12-11 Martin Baulig <martin@ximian.com>
13088 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13089 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13090 Maurer for this idea.
13092 2003-12-11 Martin Baulig <martin@ximian.com>
13094 * flowanalysis.cs (MergeResult): This class is now gone; we now
13095 use the `UsageVector' for this. The reason for this is that if a
13096 branching just has one sibling, we don't need to "merge" them at
13097 all - that's the next step to do.
13098 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13101 2003-12-11 Martin Baulig <martin@ximian.com>
13103 Reworked flow analyis and made it more precise and bug-free. The
13104 most important change is that we're now using a special `Reachability'
13105 class instead of having "magic" meanings of `FlowReturns'. I'll
13106 do some more cleanups and optimizations and also add some more
13107 documentation this week.
13109 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13110 largely reworked this class.
13111 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13112 the new `Reachability' class instead of having "magic" values here.
13113 (FlowBranching): We're now using an instance of `Reachability'
13114 instead of having separate `Returns', `Breaks' etc. fields.
13116 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13117 based on flow analysis; ignore the return value of block.Emit ().
13119 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13121 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13122 if they are private.
13124 2003-12-09 Martin Baulig <martin@ximian.com>
13126 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13127 call them directly on the UsageVector.
13129 2003-12-09 Martin Baulig <martin@ximian.com>
13131 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13132 Changed return type from `FlowReturns' to `Reachability'.
13134 2003-12-09 Martin Baulig <martin@ximian.com>
13136 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13137 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13138 `Reachable' fields with a single `Reachability' one.
13140 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13142 * class.cs (FindMembers): Remove foreach's.
13147 Run 1: 8.74 seconds
13148 Run 2: 8.71 seconds
13151 Run 1: 8.64 seconds
13152 Run 2: 8.58 seconds
13155 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13160 This patch does a few things:
13161 1. EmptyStatement is now a singleton, so it is never reallocated.
13162 2. All blah is EmptyStatement constructs have been changed to
13163 blah == EmptyStatement.Value, which is much faster and valid
13164 now that EmptyStatement is a singleton.
13165 3. When resolving a block, rather than allocating a new array for
13166 the non-empty statements, empty statements are replaced with
13167 EmptyStatement.Value
13168 4. Some recursive functions have been made non-recursive.
13169 Mainly the performance impact is from (3), however (1) and (2) are needed for
13170 this to work. (4) does not make a big difference in normal situations, however
13171 it makes the profile look saner.
13176 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13177 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13178 Total memory allocated: 56397 KB
13181 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13182 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13183 Total memory allocated: 55666 KB
13185 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13187 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13188 than the hashtable in a hashtable version
13190 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13191 we always end up concating a string. This results in a huge perf
13192 loss, because many strings have to be tracked by the GC. In this
13193 patch, we first use a hashtable that works with two keys, so that
13194 the strings do not need to be concat'ed.
13198 Run 1: 8.74 seconds
13199 Run 2: 8.71 seconds
13202 Run 1: 8.65 seconds
13203 Run 2: 8.56 seconds
13205 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13207 * Makefile: Add a new target `do-time' that does a quick and simple
13208 profile, leaving easy to parse output.
13210 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13212 * codegen.cs (Init): Create the dynamic assembly with
13213 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13215 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13217 * support.cs: Make the PtrHashtable use only one
13218 instance of its comparer.
13220 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13222 * typemanager.cs: Fix lookup of GetNamespaces.
13224 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13226 * expression.cs: Removed redundant line.
13228 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13229 ArrayLists, use for loops with bounds.
13231 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13234 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13235 arraylists, use for loop with bounds.
13237 The above three changes give us a 0.071 second performance
13238 improvement out of 3.294 seconds down to 3.223. On my machine
13239 the above changes reduced the memory usage by 1,387 KB during
13240 compiler bootstrap.
13242 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13243 QualifiedIdentifiers. Before we created a new string through
13244 concatenation, and mostly later on, the result would be
13245 manipulated by DecomposeQI through string manipulation.
13247 This reduced the compiler memory usage for bootstrapping from
13248 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13249 compile times in 0.05 seconds.
13251 2003-11-28 Dick Porter <dick@ximian.com>
13253 * support.cs: Do string compares with the Invariant culture.
13261 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13262 the comparison is done with the Invariant culture.
13264 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13266 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13267 GetEnumerator method.
13269 (ProbeCollectionType): Iterate starting at the most specific type
13270 upwards looking for a GetEnumerator
13272 * expression.cs: Shift count can be up to 31 for int/uint and 63
13275 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13277 * statement.cs (Block.LookupLabel): Also look for the label on the
13278 children blocks. Use a hash table to keep track of visited
13281 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13282 we actually did transform the other operand, otherwise fall back
13283 to the common codepath that casts to long.
13285 * cs-tokenizer.cs: Use the same code pattern as the int case.
13286 Maybe I should do the parsing myself, and avoid depending on the
13287 Parse routines to get this done.
13289 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13291 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13292 which fixes bug 51347. This time test it.
13294 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13295 attributes for example can not tell the difference between these.
13296 The difference was only a syntax feature of the language.
13298 * attribute.cs: Apply attributes to delegates.
13300 * delegate.cs: Call the apply attributes method.
13302 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13304 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13305 comparing 0 vs Byte.MinValue, not the value
13307 (ImplicitConversionRequired): When reporting a conversion error,
13308 use error 31 to print out the constant error instead of the
13311 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13312 which fixes bug 51347.
13314 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13316 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13317 which fixes the -warnaserror command line option.
13319 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13321 * cfold.cs (DoNumericPromotions): During constant folding of
13322 additions on UIntConstant, special case intconstants with
13323 IntConstants like we do on the expression binary operator.
13325 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13327 * convert.cs (ImplicitReferenceConversion): We were missing a case
13328 (System.Enum are not value types or class types, so we need to
13329 classify them separatedly).
13331 * driver.cs: We do not support error 2007.
13333 2003-11-12 Jackson Harper <jackson@ximian.com>
13335 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13336 system directory. Also use the full file name so users can
13337 libraries names mscorlib-o-tron.dll in a non system dir.
13339 2003-11-10 Martin Baulig <martin@ximian.com>
13341 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13342 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13343 calling `ResolveType()' on them, directly assign their `Type'.
13345 2003-11-08 Martin Baulig <martin@ximian.com>
13347 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13348 return value and the `out parent' parameter.
13349 (TypeContainer.DefineType): Moved the CS0644 check into
13350 GetClassBases(). Don't pass the interface types to the
13351 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13352 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13354 * ecore.cs (TypeExpr.IsAttribute): New property.
13355 (TypeExpr.GetInterfaces): New method.
13357 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13358 TypeExpr instead of a Type.
13359 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13360 (Interface.DefineType): Don't pass the interface types to the
13361 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13362 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13364 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13365 instead of a `Type[]'.
13366 (TypeManager.RegisterBuilder): Likewise.
13367 (TypeManager.AddUserInterface): Likewise.
13368 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13369 `Type[]' and also return a `TypeExpr[]'.
13370 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13372 2003-11-08 Martin Baulig <martin@ximian.com>
13374 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13377 2003-11-08 Martin Baulig <martin@ximian.com>
13379 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13380 TypeManager.ResolveExpressionTypes().
13382 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13383 instead of an Expression.
13384 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13385 (TypeExpression): New public class; formerly known as `TypeExpr'.
13387 * expression.cs (ComposedCast): Derive from TypeExpr.
13389 * typemanager.cs (TypeManager.system_*_expr): These are now
13390 TypExpr's instead of Expression's.
13391 (TypeManager.ResolveExpressionTypes): New public static function;
13392 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13395 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13397 * expression.cs (New.DoResolve): Do not dereference value that
13398 might be a null return.
13400 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13401 sure that the constant value has the right type. Fixes an
13402 unreported bug, similar to 50425.
13404 * const.cs (Const.LookupConstantValue): Call
13405 ImplicitStandardConversionExists before doing a conversion to
13406 avoid havng the TypeManager.ChangeType do conversions.
13408 Reduced the number of casts used
13410 (Const.ChangeType): New routine to enable reuse of the constant
13411 type changing code from statement.
13413 * typemanager.cs (ChangeType): Move common initialization to
13414 static global variables.
13418 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13419 every value type to go through, even if it was void. Fix that.
13421 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13422 character of the define, and the is_identifier_part_character for
13423 the rest of the string.
13425 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13427 * expression.cs (UnaryMutator.EmitCode): When I updated
13428 LocalVariableReference.DoResolve, I overdid it, and dropped an
13429 optimization done on local variable references.
13431 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13433 * ecore.cs: Convert the return from Ldlen into an int.
13435 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13437 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13438 the accessibility, this is a special case for toplevel non-public
13439 classes (internal for instance).
13441 2003-10-20 Nick Drochak <ndrochak@gol.com>
13443 * ecore.cs: Fix typo and build. Needed another right paren.
13445 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13447 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13448 `internal' case regular and protected, but not allowing protected
13449 to be evaluated later. Bug 49840
13451 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13453 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13454 to kb.Nlast, and not the kb.nFirst to isolate the switch
13457 Extract the underlying type, so enumerations of long/ulong are
13458 treated like long/ulong.
13460 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13462 * expression.cs (New): Overload the meaning of RequestedType to
13463 track the possible creation of the NewDelegate type, since
13464 DoResolve is invoked more than once for new constructors on field
13467 See bugs: #48800 and #37014
13469 * cs-parser.jay (declare_local_constants): Take an arraylist
13470 instead of a single constant.
13472 (local_constant_declaration): It should take a
13473 constant_declarators, not a constant_declarator. Fixes 49487
13475 * convert.cs: Fix error report.
13477 2003-10-13 Jackson Harper <jackson@ximian.com>
13479 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13482 2003-10-09 Martin Baulig <martin@ximian.com>
13484 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13486 (MethodCore.DoDefineParameters): Removed the TypeContainer
13487 argument; use the DeclSpace which was passed to the .ctor instead.
13488 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13489 TypeContainer; we only need a DeclSpace here.
13491 2003-10-09 Martin Baulig <martin@ximian.com>
13493 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13495 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13496 EmitContext's .ctor.
13498 2003-10-09 Martin Baulig <martin@ximian.com>
13500 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13501 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13502 AsAccessible(), moved them as well.
13504 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13506 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13508 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13510 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13512 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13513 generation for >=, as spotted by Paolo, bug 48679.
13514 Patch from David Waite.
13516 * cs-tokenizer.cs: Add handling for #pragma.
13518 * cs-parser.jay: Allow for both yield and yield return in the
13519 syntax. The anti-cobolization of C# fight will go on!
13521 * class.cs (TypeBuilder.DefineType): Catch error condition here
13522 (Parent.DefineType erroring out and returning null).
13524 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13525 coping with enumerations variables, we were mistakenly processing
13526 them as a regular value type instead of built-in types. Fixes the
13529 * typemanager.cs (IsBuiltinOrEnum): New method.
13531 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13533 * cs-parser.jay: Upgrade: yield now needs the return clause.
13535 2003-09-19 Martin Baulig <martin@ximian.com>
13537 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13538 `MemberCache parent' argument. Normally, an interface doesn't
13539 have a parent type except System.Object, but we use this in gmcs
13540 for generic type parameters.
13542 2003-09-18 Martin Baulig <martin@ximian.com>
13544 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13545 on `type.IsInterface'; don't check whether the type has a parent
13546 to determine whether it's an interface.
13548 2003-09-15 Martin Baulig <martin@ximian.com>
13550 * class.cs (TypeContainer.DefineType): Added an error flag to
13551 avoid reporting duplicate CS0146's ("class definition is
13554 * driver.cs (Driver.MainDriver): Abort if
13555 RootContext.ResolveTree() reported any errors.
13557 2003-09-07 Martin Baulig <martin@ximian.com>
13559 * report.cs (Error, Warning): Added overloaded versions which take
13560 a `params object[] args' and call String.Format().
13562 2003-09-07 Martin Baulig <martin@ximian.com>
13564 * decl.cs (DeclSpace..ctor): Don't call
13565 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13566 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13567 (DeclSpace.RecordDecl): New method.
13569 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13571 2003-09-02 Ravi Pratap <ravi@ximian.com>
13573 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13574 value attributes to be applied to ParameterBuilders.
13576 * class.cs (MethodCore.LabelParameters): Make static and more
13577 generic so that it can be used from other places - like interface
13578 methods, for instance.
13580 * interface.cs (Interface.Emit): Call LabelParameters before
13581 emitting attributes on the InterfaceMethod.
13583 2003-08-26 Martin Baulig <martin@ximian.com>
13585 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13586 resolving aliases; fixes #47927.
13588 2003-08-26 Martin Baulig <martin@ximian.com>
13590 * statement.cs (Using.DoResolve): This is internally emitting a
13591 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13592 do not always return. Fixes #47681.
13594 2003-08-26 Martin Baulig <martin@ximian.com>
13596 * decl.cs (MemberCore): Moved WarningNotHiding(),
13597 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13599 (AdditionResult): Make this nested in DeclSpace.
13600 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13601 argument; call NamespaceEntry.Define() unless we're nested in a
13604 * namespace.cs (Namespace.DefineName): New public function. This
13605 is called from DeclSpace's .ctor to add
13606 (Namespace.Lookup): Include DeclSpaces in the lookup.
13608 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13610 * const.cs (Const): Derive from MemberBase, not MemberCore.
13612 2003-08-25 Martin Baulig <martin@ximian.com>
13614 * convert.cs (Convert.ExplicitReferenceConversion): When
13615 converting from an interface type to a class, unbox if the target
13616 type is a struct type. Fixes #47822.
13618 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13620 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13623 2003-08-22 Martin Baulig <martin@ximian.com>
13625 * class.cs (TypeManager.DefineType): When defining a nested type,
13626 call DefineType() on our parent; fixes #47801.
13628 2003-08-22 Martin Baulig <martin@ximian.com>
13630 * class.cs (MethodData.Define): While checking if a method is an
13631 interface implementation, improve the test a bit more to fix #47654.
13633 2003-08-22 Martin Baulig <martin@ximian.com>
13635 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13636 correctly; fixes #47722.
13638 2003-08-22 Martin Baulig <martin@ximian.com>
13640 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13641 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13643 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13645 2003-08-22 Martin Baulig <martin@ximian.com>
13647 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13648 can only be assigned in static constructors. Fixes #47161.
13650 2003-08-22 Martin Baulig <martin@ximian.com>
13652 Rewrote and improved the flow analysis code.
13654 * flowbranching.cs (FlowBranching): Make this class abstract.
13655 (FlowBranching.CreateBranching): New static function to create a
13656 new flow branching.
13657 (FlowBranchingBlock, FlowBranchingException): New classes.
13658 (FlowBranching.UsageVector.Type): New public readonly field.
13659 (FlowBranching.UsageVector.Breaks): Removed the setter.
13660 (FlowBranching.UsageVector.Returns): Removed the setter.
13661 (FlowBranching.UsageVector): Added Break(), Return(),
13662 NeverReachable() and Throw() methods to modify the reachability.
13663 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13664 done by FlowBranching.Merge().
13665 (FlowBranching.UsageVector.MergeChild): New method; merges the
13666 merge result into the current vector.
13667 (FlowBranching.Merge): New abstract method to merge a branching.
13669 2003-08-12 Martin Baulig <martin@ximian.com>
13671 * expression.cs (Indirection.CacheTemporaries): Create the
13672 LocalTemporary with the pointer type, not its element type.
13674 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13676 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13677 token was a keyword or not.
13679 Add `error' options where an IDENTIFIER was expected; Provide
13680 CheckToken and CheckIdentifierToken convenience error reporting
13683 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13685 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13686 NameSpaceEntry NameSpaceEntry.
13688 (LookupInterfaceOrClass): Avoid creating a full qualified name
13689 from namespace and name: avoid doing lookups when we know the
13690 namespace is non-existant. Use new Tree.LookupByNamespace which
13691 looks up DeclSpaces based on their namespace, name pair.
13693 * driver.cs: Provide a new `parser verbose' to display the
13694 exception thrown during parsing. This is turned off by default
13695 now, so the output of a failure from mcs is more graceful.
13697 * namespace.cs: Track all the namespaces defined in a hashtable
13700 (IsNamespace): New method
13702 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13704 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13705 we know that we need to concatenate (full typename can never be
13710 * statement.cs: Use a bitfield; Do not initialize to null things
13711 which are done by the constructor by default.
13713 * cs-parser.jay: bug fix, parameter was 4, not 3.
13715 * expression.cs: Just use the property;
13717 * statement.cs: No need for GetVariableInfo method.
13719 2003-08-08 Martin Baulig <martin@ximian.com>
13721 * flowanalysis.cs (FlowReturns): This is now nested in the
13722 `FlowBranching' class.
13723 (MyBitVector): Moved this here from statement.cs.
13724 (FlowBranching.SiblingType): New enum type.
13725 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13727 2003-08-07 Martin Baulig <martin@ximian.com>
13729 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13730 `FlowBranching' class and called `BranchingType'.
13732 2003-08-07 Martin Baulig <martin@ximian.com>
13734 * flowanalysis.cs: Moved all the control flow analysis code into
13737 2003-08-07 Martin Baulig <martin@ximian.com>
13739 * assign.cs (Assign.DoResolve): `target' must either be an
13740 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13743 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13745 * expression.cs (BinaryMethod): This kind of expression is created by the
13746 Binary class if it determines that the operator has to be handled
13749 (BinaryDelegate): This kind of expression is created if we are
13750 dealing with a + or - operator on delegates.
13752 (Binary): remove method, argumetns, and DelegateOperator: when
13753 dealing with methods,
13755 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13757 * statement.cs (Block): use bitfields for the three extra booleans
13758 we had in use. Remove unused topblock parameter.
13760 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13762 * assign.cs: Drop extra unneeded tests.
13764 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13766 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13768 * statement.cs (Foreach): Use VariableStorage instead of
13771 * codegen.cs (VariableStorage): New class used by clients that
13772 require a variable stored: locals or fields for variables that
13773 need to live across yield.
13775 Maybe provide a convenience api for EmitThis+EmitLoad?
13777 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13780 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13782 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13783 RemapParameterLValue): New methods that are used to turn a
13784 precomputed FieldInfo into an expression like this:
13788 The idea is to use this instead of making LocalVariableReference
13789 have more than one meaning.
13791 * cs-parser.jay: Add error production to BASE.
13793 * ecore.cs: Deal with TypeManager.GetField returning null, which
13794 is now a valid return value.
13796 (FieldExprNoAddress): New expression for Fields whose address can
13799 * expression.cs (LocalVariableReference): During the resolve
13800 phases, create new expressions if we are in a remapping context.
13801 Remove code that dealt with remapping here.
13803 (ParameterReference): same.
13805 (ProxyInstance): New expression, like the `This' expression, but
13806 it is born fully resolved. We know what we are doing, so remove
13807 the errors that are targeted to user-provided uses of `this'.
13809 * statement.cs (Foreach): our variable is now stored as an
13810 Expression; During resolution, follow the protocol, dont just
13811 assume it will return this.
13813 2003-08-06 Martin Baulig <martin@ximian.com>
13815 * support.cs (SeekableStreamReader.cs): New public class.
13817 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13818 SeekableStreamReader instead of the normal StreamReader.
13820 2003-08-04 Martin Baulig <martin@ximian.com>
13822 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13823 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13824 deambiguate casts and delegate invocations.
13825 (parenthesized_expression): Use the new tokens to ensure this is
13826 not a cast of method invocation.
13828 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13829 when reading a `)' and Deambiguate_CloseParens () was previously
13832 * expression.cs (ParenthesizedExpression): New class. This is
13833 just used for the CS0075 test.
13834 (Binary.DoResolve): Check for CS0075.
13836 2003-07-29 Ravi Pratap <ravi@ximian.com>
13838 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13839 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13840 reference comparison.
13842 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13843 examine the ReturnType for equality - this is necessary in the
13844 cases of implicit and explicit operators whose signature also
13845 includes the return type.
13847 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13849 * namespace.cs: Cache the result of the namespace computation,
13850 instead of computing it every time.
13852 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13854 * decl.cs: Use a global arraylist that we reuse over invocations
13855 to avoid excesive memory consumption. Reduces memory usage on an
13856 mcs compile by one meg (45 average).
13858 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13859 private, work around that.
13861 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13863 * literal.cs (IntLiteral): Define Zero and One static literals.
13865 * cs-parser.jay (integer_literal): use static literals to reduce
13866 memory usage for the most used literals (0, 1 and -1). 211kb
13867 reduced in memory usage.
13869 Replace all calls to `new ArrayList' with `new
13870 ArrayList(4)' which is a good average number for most allocations,
13871 and also requires only 16 bytes of memory for its buffer by
13874 This reduced MCS memory usage in seven megabytes for the RSS after
13877 2003-07-28 Ravi Pratap <ravi@ximian.com>
13879 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13880 handle params methods the correct way by forming only one
13881 applicable set with params and normal methods in them. Earlier we
13882 were looking at params methods only if we found no normal methods
13883 which was not the correct thing to do.
13885 (Invocation.BetterFunction): Take separate arguments indicating
13886 when candidate and the best method are params methods in their
13889 This fixes bugs #43367 and #46199.
13891 * attribute.cs: Documentation updates.
13893 (CheckAttribute): Rename to CheckAttributeTarget.
13894 (GetValidPlaces): Rename to GetValidTargets.
13896 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13897 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13901 2003-07-28 Martin Baulig <martin@ximian.com>
13903 * class.cs (TypeContainer.DefineMembers): Use the base type's full
13904 name when looking up the base class of a nested class. Fixes #46977.
13906 2003-07-26 Martin Baulig <martin@ximian.com>
13908 * expression.cs (Indexers.Indexer): New nested struct; contains
13909 getter, setter and the indexer's type.
13910 (Indexers.Properties): This is now an ArrayList of
13911 Indexers.Indexer's.
13912 (IndexerAccess.DoResolveLValue): Correctly set the type if the
13913 indexer doesn't have any getters.
13915 * assign.cs (Assign.DoResolve): Also do the implicit conversions
13916 for embedded property and indexer assignments.
13918 2003-07-26 Martin Baulig <martin@ximian.com>
13920 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13921 preprocessor directive is not the first non-whitespace character
13924 2003-07-26 Martin Baulig <martin@ximian.com>
13926 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13927 namespace parsing, follow the spec more closely.
13929 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13930 NamespaceEntry.Lookup().
13932 2003-07-25 Martin Baulig <martin@ximian.com>
13934 * MethodCore.cs (OverridesSomething): New public field; it's set
13935 from TypeContainer.DefineMembers if this method overrides
13936 something (which doesn't need to be a method). Fix #39462.
13938 2003-07-25 Ravi Pratap <ravi@ximian.com>
13940 * typemanager.cs (GetMembers): Ensure that the list of members is
13941 reversed. This keeps things in sync.
13943 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13944 find an AttributeUsage attribute.
13946 * expression.cs (Invocation.OverloadResolve): Perform the check
13947 which disallows Invoke to be directly called on a Delegate.
13949 (Error_InvokeOnDelegate): Report error cs1533.
13951 2003-07-25 Martin Baulig <martin@ximian.com>
13953 * expression.cs (Indexers.GetIndexersForType): Only look in the
13954 interface hierarchy if the requested type is already an
13955 interface. Fixes #46788 while keeping #46502 fixed.
13957 2003-07-25 Martin Baulig <martin@ximian.com>
13959 * class.cs (TypeContainer.DefineMembers): Check whether all
13960 readonly fields have been assigned and report warning CS0649 if
13963 * statement.cs (LocalInfo.IsFixed): Always return true if this is
13966 2003-07-24 Ravi Pratap <ravi@ximian.com>
13968 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13969 returned from GetMethods to make things consistent with the
13970 assumptions MCS makes about ordering of methods.
13972 This should comprehensively fix bug #45127 and it does :-)
13974 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13975 ordering is actually reverse.
13977 * Clean up some debug messages I left lying around.
13979 * interface.cs (Populate*): Get rid of code which emits attributes
13980 since the stage in which we emit attributes is the 'Emit' stage,
13981 not the define stage.
13983 (Emit): Move attribute emission for interface members here.
13985 2003-07-22 Ravi Pratap <ravi@ximian.com>
13987 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13988 closely: we eliminate methods in base types when we have an
13989 applicable method in a top-level type.
13991 Please see section 14.5.5.1 for an exact description of what goes
13994 This fixes bug #45127 and a host of other related to corlib compilation.
13996 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13997 array is the method corresponding to the top-level type (this is
13998 because of the changes made to icall.c) so we change this
14001 (MethodGroupExpr.Name): This too.
14003 * typemanager.cs (GetElementType): New method which does the right
14004 thing when compiling corlib.
14006 * everywhere: Make use of the above in the relevant places.
14008 2003-07-22 Martin Baulig <martin@ximian.com>
14010 * cs-parser.jay (invocation_expression): Moved
14011 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14012 `cast_expression', but create a InvocationOrCast which later
14013 resolves to either an Invocation or a Cast.
14015 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14016 method; call this before EmitStatement() to make sure that this
14017 expression can be used as a statement.
14019 * expression.cs (InvocationOrCast): New class; resolves to either
14020 an Invocation or a Cast.
14022 * statement.cs (StatementExpression): Call ResolveStatement() on
14023 the ExpressionStatement before emitting it.
14025 2003-07-21 Martin Baulig <martin@ximian.com>
14027 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14028 `ref' and `out' attributes match; fixes #46220.
14029 (MemberAccess.ResolveMemberAccess): You can't reference a type
14030 through an expression; fixes #33180.
14031 (Indexers.GetIndexersForType): Don't return the indexers from
14032 interfaces the class implements; fixes #46502.
14034 2003-07-21 Martin Baulig <martin@ximian.com>
14036 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14037 CS0661 checks; fixes bug #30442.
14039 2003-07-21 Martin Baulig <martin@ximian.com>
14041 * decl.cs (AdditionResult): Added `Error'.
14043 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14045 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14046 makes cs0031.cs actually work.
14048 2003-07-20 Martin Baulig <martin@ximian.com>
14050 * namespace.cs: Fixed that bug which caused a crash when compiling
14051 the debugger's GUI.
14053 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14055 * typemanager.cs (LookupTypeReflection): Never expose types which
14056 are NotPublic, NestedPrivate, NestedAssembly, or
14057 NestedFamANDAssem. We used to return these, and later do a check
14058 that would report a meaningful error, but the problem is that we
14059 would not get the real match, if there was a name override.
14061 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14063 * namespace.cs (Namespace, Name): Do not compute the namespace
14064 name dynamically, compute it in the constructor. This reduced
14065 memory usage by 1697 KB.
14067 * driver.cs: Use --pause to pause at the end.
14069 2003-07-17 Peter Williams <peter@newton.cx>
14071 * Makefile: Change the name of the test target so that it doesn't
14072 conflict with the recursive test target.
14074 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14076 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14077 AddressOf): Do not use EmitThis, that was wrong, use the actual
14080 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14082 * class.cs (MethodData.Define): While checking if a method is an
14083 interface implementation, improve the test: If we are not public
14084 (use new test here: use the computed MethodAttributes directly,
14085 instead of the parsed modifier flags) check if the `implementing'
14086 method comes from an interface or not.
14088 * pending.cs (VerifyPendingMethods): Slightly better error
14091 * makefile: add test target that does the mcs bootstrap.
14093 2003-07-16 Ravi Pratap <ravi@ximian.com>
14095 * interface.cs (Define): Do nothing here since there are no
14096 members to populate etc. Move the attribute emission out of here
14097 since this was just totally the wrong place to put it. Attribute
14098 application happens during the 'Emit' phase, not in the 'Define'
14101 (Emit): Add this method and move the attribute emission here
14103 * rootcontext.cs (EmitCode): Call the Emit method on interface
14106 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14108 * expression.cs (OverloadResolve): Report error only if Location
14109 is not 'Null' which means that there was a probe going on.
14111 2003-07-14 Martin Baulig <martin@ximian.com>
14113 * expression.cs (ConditionalLogicalOperator): New public class to
14114 implement user defined conditional logical operators.
14115 This is section 14.11.2 in the spec and bug #40505.
14117 2003-07-14 Martin Baulig <martin@ximian.com>
14119 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14121 2003-07-14 Martin Baulig <martin@ximian.com>
14123 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14125 * ecore.cs (IVariable.VerifyFixed): New interface method.
14127 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14128 operator, check whether the variable is actually fixed. Fixes bug
14129 #36055. Set a variable definitely assigned when taking its
14130 address as required by the spec.
14132 * statement.cs (LocalInfo.IsFixed): New field.
14133 (LocalInfo.MakePinned): Set `IsFixed' to true.
14135 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14137 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14138 for .ctors, ensure that we only ask for members declared in the
14139 attribute type (BindingFlags.DeclaredOnly).
14143 * expression.cs (Error_WrongNumArguments): Report error 1501
14144 correctly the way CSC does.
14146 2003-07-13 Martin Baulig <martin@ximian.com>
14148 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14149 lookup on the fully qualified name, to make things like "X.X" work
14150 where "X.X" is a fully qualified type name, but we also have a
14151 namespace "X" in the using list. Fixes #41975.
14153 2003-07-13 Martin Baulig <martin@ximian.com>
14155 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14156 function. If we're a CompoundAssign, we need to create an embedded
14157 CompoundAssign, not an embedded Assign.
14158 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14161 2003-07-13 Martin Baulig <martin@ximian.com>
14163 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14164 work to fix bug #46088.
14166 2003-07-13 Ravi Pratap <ravi@ximian.com>
14168 * class.cs (Operator.Emit): Do not emit attributes here - it is
14169 taken care of by the Method class that we delegate too. This takes
14170 care of bug #45876.
14172 2003-07-10 Martin Baulig <martin@ximian.com>
14174 * expression.cs (TypeOfVoid): New class.
14175 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14177 2003-07-10 Martin Baulig <martin@ximian.com>
14179 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14182 2003-07-10 Martin Baulig <martin@ximian.com>
14184 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14185 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14187 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14189 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14191 2003-07-10 Martin Baulig <martin@ximian.com>
14193 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14194 of decimal. Fixes #42850.
14196 NOTE: I also fixed the created byte blob, but this doesn't work on
14197 the MS runtime and csc never produces any byte blobs for decimal
14200 2003-07-10 Martin Baulig <martin@ximian.com>
14202 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14203 structs; fixes #32068.
14204 (Block.AddChildVariableNames): Fixed #44302.
14206 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14208 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14210 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14212 * attribute.cs: And this test is onger needed.
14214 2003-07-08 Martin Baulig <martin@ximian.com>
14216 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14217 inaccessible types. Fixes #36313.
14219 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14221 * namespace.cs (NamespaceEntry): Create implicit entries for all
14222 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14223 implicit entries for N1.N2 and N1.
14225 2003-07-08 Martin Baulig <martin@ximian.com>
14227 Rewrote the handling of namespaces to fix a lot of the issues
14228 wrt. `using' aliases etc.
14230 * namespace.cs (Namespace): Splitted this class into a
14231 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14233 * typemanager.cs (TypeManager.IsNamespace): Removed.
14234 (TypeManager.ComputeNamespaces): Only compute namespaces from
14235 loaded assemblies here, not the namespaces from the assembly we're
14236 currently compiling.
14238 2003-07-08 Martin Baulig <martin@ximian.com>
14240 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14242 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14244 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14247 I thought about the memory savings here, but LookupTypeReflection
14248 is used under already very constrained scenarios. Compiling
14249 corlib or mcs only exposes one hit, so it would not really reduce
14250 any memory consumption.
14252 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14254 * typemanager.cs: fixes bug #45889 by only adding public types from
14255 other assemblies to the list of known types.
14257 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14259 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14260 on the type we resolved.
14262 2003-07-05 Martin Baulig <martin@ximian.com>
14264 * pending.cs (PendingImplementation.ParentImplements): Don't
14265 create the proxy if the parent is abstract.
14267 * class.cs (TypeContainer.DefineIndexers): Process explicit
14268 interface implementations first. Fixes #37714.
14270 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14272 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14273 defined recursively; but since we modify the input parameters
14274 (left is set to `this' temporarily), we reset this value if the
14275 left_is_explicit is false, which gives the original semantics to
14278 * literal.cs (NullPointer): new class used to represent a null
14279 literal in a pointer context.
14281 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14282 type is a pointer, use a NullPointer object instead of a
14283 NullLiteral. Closes 43687
14285 (ExplicitConversion): Convert pointer values using
14286 the conv opcode to the proper type.
14288 * ecore.cs (New): change ValueTypeVariable property into a method,
14289 that returns whether the valuetype is suitable for being used.
14291 * expression.cs (Binary.DoNumericPromotions): Only return if we
14292 the int constant was a valid uint, and we can return both left and
14293 right as uints. If not, we continue processing, to trigger the
14294 type conversion. This fixes 39018.
14296 * statement.cs (Block.EmitMeta): During constant resolution, set
14297 the CurrentBlock property on the emitcontext, so that we resolve
14298 constants propertly.
14300 2003-07-02 Martin Baulig <martin@ximian.com>
14302 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14303 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14305 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14306 than emitting it here.
14308 * statement.cs: Fixed some more flow analysis bugs.
14310 2003-07-02 Martin Baulig <martin@ximian.com>
14312 * class.cs (MethodData.Define): When implementing interface
14313 methods, set Final unless we're Virtual.
14315 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14316 check work for interface methods.
14318 2003-07-01 Martin Baulig <martin@ximian.com>
14320 * ecore.cs (EmitContext.This): Replaced this property with a
14321 GetThis() method which takes a Location argument. This ensures
14322 that we get the correct error location for a CS0188.
14324 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14326 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14327 ImplicitStandardConversion.
14329 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14331 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14333 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14336 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14338 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14341 (MethodData.Define): Turn off initlocals for unsafe methods.
14343 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14345 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14346 complete; Fixes #37521.
14348 * delegate.cs: Use Modifiers.TypeAttr to compute the
14349 TypeAttributes, instead of rolling our own. This makes the flags
14350 correct for the delegates.
14352 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14354 * class.cs (Constructor.Define): Set the private flag for static
14355 constructors as well.
14357 * cs-parser.jay (statement_expression): Set the return value to
14358 null, to avoid a crash when we catch an error.
14360 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14362 * cs-parser.jay: Applied patch from Jackson that adds support for
14363 extern and unsafe modifiers to destructor declarations.
14365 * expression.cs: Report error 21 if the user is trying to index a
14368 * driver.cs: Add an error message, suggested by the bug report.
14370 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14371 if we do not have a ": this ()" constructor initializer. Fixes 45149
14373 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14375 * namespace.cs: Add some information to reduce FAQs.
14377 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14379 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14380 underlying enumeration types. Fixes #43915.
14382 * expression.cs: Treat ushort/short as legal values to be used in
14383 bitwise operations.
14385 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14387 * delegate.cs: transfer custom attributes for paramenters from
14388 the delegate declaration to Invoke and BeginInvoke.
14390 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14392 * attribute.cs: handle custom marshalers and emit marshal info
14395 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14397 * makefile.gnu: Added anonymous.cs to the compiler sources.
14399 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14401 * iterators.cs: Change the name of the proxy class to include two
14404 * cs-parser.jay: Update grammar to include anonymous methods.
14406 * anonymous.cs: new file.
14408 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14410 * class.cs (Field.Define): Add missing test for pointers and
14413 2003-05-27 Ravi Pratap <ravi@ximian.com>
14415 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14416 we use the stobj opcode.
14418 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14419 since it wasn't the correct fix.
14421 It still is puzzling that we are required to use stobj for IntPtr
14422 which seems to be a ValueType.
14424 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14426 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14427 during regular simple name resolution. Now, the trick is that
14428 instead of returning for processing the simplename, we do a
14429 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14430 contextual lookup type). If a match is found, return that, if
14431 not, return for further composition.
14433 This fixes long-standing 30485.
14435 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14436 using the address to initialize an object, do an Stobj instead of
14437 using the regular Stelem.
14439 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14440 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14441 Because if we are a BaseIndexerAccess that value will be true.
14444 * statement.cs (GotoCase.Resolve): Return after reporting an
14445 error, do not attempt to continue.
14447 * expression.cs (PointerArithmetic.Emit): If our operand is a
14448 long, convert our constants to match the operand before
14449 multiplying. Convert to I type before adding. Fixes 43670.
14451 2003-05-14 Ravi Pratap <ravi@ximian.com>
14453 * enum.cs (ImplicitConversionExists) : Rename to
14454 ImplicitEnumConversionExists to remove ambiguity.
14456 * ecore.cs (NullCast): New type of cast expression class which
14457 basically is very similar to EmptyCast with the difference being
14458 it still is a constant since it is used only to cast a null to
14460 (eg. (string) null)
14462 * convert.cs (ImplicitReferenceConversion): When casting a null
14463 literal, we return a NullCast.
14465 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14466 should be around anymore.
14468 The renaming (reported was slightly wrong). Corrections:
14470 ConvertImplicitStandard -> ImplicitConversionStandard
14471 ConvertExplicitStandard -> ExplicitConversionStandard
14473 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14474 before passing them in !
14476 * convert.cs (ImplicitConversionStandard): When comparing for
14477 equal expr and target types, ensure that expr is not a
14480 In general, we must not be checking (expr_type ==
14481 target_type) in the top level conversion methods
14482 (ImplicitConversion, ExplicitConversion etc). This checking is
14483 done in the methods that they delegate to.
14485 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14487 * convert.cs: Move Error_CannotConvertType,
14488 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14489 ImplicitNumericConversion, ImplicitConversionExists,
14490 ImplicitUserConversionExists, StandardConversionExists,
14491 FindMostEncompassedType, FindMostSpecificSource,
14492 FindMostSpecificTarget, ImplicitUserConversion,
14493 ExplicitUserConversion, GetConversionOperators,
14494 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14495 TryImplicitIntConversion, Error_CannotConvertImplicit,
14496 ConvertImplicitRequired, ConvertNumericExplicit,
14497 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14498 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14501 Perform the following renames:
14503 StandardConversionExists -> ImplicitStandardConversionExists
14504 ConvertImplicit -> ImplicitConversion
14505 ConvertImplicitStandard -> ImplicitStandardConversion
14506 TryImplicitIntConversion -> ImplicitIntConversion
14507 ConvertImplicitRequired -> ImplicitConversionRequired
14508 ConvertNumericExplicit -> ExplicitNumericConversion
14509 ConvertReferenceExplicit -> ExplicitReferenceConversion
14510 ConvertExplicit -> ExplicitConversion
14511 ConvertExplicitStandard -> ExplicitStandardConversion
14513 2003-05-19 Martin Baulig <martin@ximian.com>
14515 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14516 (TypeInfo): Added support for structs having structs as fields.
14518 * ecore.cs (FieldExpr): Implement IVariable.
14519 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14520 VariableInfo for the field.
14522 2003-05-18 Martin Baulig <martin@ximian.com>
14524 * expression.cs (This.DoResolve): Report a CS0027 if we're
14525 emitting a field initializer.
14527 2003-05-18 Martin Baulig <martin@ximian.com>
14529 * expression.cs (This.ResolveBase): New public function.
14530 (This.DoResolve): Check for CS0188.
14532 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14535 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14536 `instance_expression' to null if we don't have any non-static
14539 2003-05-18 Martin Baulig <martin@ximian.com>
14541 Reworked the way how local variables and parameters are handled by
14542 the flow analysis code.
14544 * statement.cs (TypeInfo, VariableMap): New public classes.
14545 (VariableInfo): New public class. This is now responsible for
14546 checking whether a variable has been assigned. It is used for
14547 parameters and local variables.
14548 (Block.EmitMeta): Take the InternalParameters as argument; compute
14549 the layout of the flow vectors here.
14550 (Block.LocalMap, Block.ParameterMap): New public properties.
14551 (FlowBranching): The .ctor doesn't get the InternalParameters
14552 anymore since Block.EmitMeta() now computes the layout of the flow
14554 (MyStructInfo): This class is now known as `StructInfo' and nested
14555 in `TypeInfo'; we don't access this directly anymore.
14557 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14558 property and removed IsAssigned(), IsFieldAssigned(),
14559 SetAssigned() and SetFieldAssigned(); we now call them on the
14560 VariableInfo so we don't need to duplicate this code everywhere.
14562 * expression.cs (ParameterReference): Added `Block block' argument
14564 (LocalVariableReference, ParameterReference, This): The new
14565 VariableInfo class is now responsible for all the definite
14568 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14569 IsParameterAssigned, SetParameterAssigned): Removed.
14571 2003-05-18 Martin Baulig <martin@ximian.com>
14573 * typemanager.cs (InitCoreTypes): Try calling
14574 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14575 the 3-args-version. Corlib now also needs our `void_type'.
14576 (GetMethod): Added overloaded version which takes an optional
14577 `bool report_errors' to allow lookups of optional methods.
14579 2003-05-12 Martin Baulig <martin@ximian.com>
14581 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14582 only used for locals and not for parameters.
14584 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14586 * support.cs (InternalParameters.ParameterType): Return the
14587 ExternalType of the parameter.
14589 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14592 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14594 * class.cs (MethodData.Define): Do not set the `newslot' on
14595 interface members, if they are also flagged as "override".
14597 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14598 better code for ++i and i++. This only works for static fields
14599 and local variables.
14601 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14602 want to pull the DeclSpace out of the builder_to_declspace instead
14603 of the TypeBuilder (like in TypeContainer.FindMembers).
14605 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14606 instead of LookupTypeContainer. Fixes the crash on .NET for
14607 looking up interface members.
14609 * const.cs: Create our own emit context during the Definition
14610 stage, so that constants are evaluated in the proper context, when
14611 a recursive definition happens.
14613 2003-05-11 Martin Baulig <martin@ximian.com>
14615 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14616 new block for a switch section.
14617 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14618 the adding/lookup in the switch block. Fixes #39828.
14620 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14622 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14623 functionality: I needed to convert the data after I had performed
14624 the add/sub operation into the operands type size.
14626 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14627 pass the type for the box operation, otherwise the resulting
14628 object would have been of type object.
14630 (BoxedCast): Add constructor to specify the type to box as.
14632 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14634 * iterators.cs: I was reusing the `count' variable inadvertently,
14635 take steps to not allow this to happen.
14637 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14639 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14640 by creating an array at the point where the params starts and
14641 putting all those arguments there, then adjusting the size of the
14644 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14646 * expression.cs (New.AddressOf): Implement interface
14647 IMemoryLocation. This is used when the `new' operator is used in
14648 the context of an invocation to a method on a value type.
14650 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14653 * namespace.cs: Also check the using aliases here.
14655 * driver.cs: Move the test for using validity after the types have
14656 been entered, so we do a single pass that also includes the using
14659 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14660 in the regular case. CreateSiblingForFinally is doing extra
14663 * attribute.cs (GetAttributeArgumentExpression): Store the result
14664 on an out value, and use the return value to indicate failure
14665 instead of using null (which is a valid return for Constant.GetValue).
14667 * statement.cs: Perform the analysis flow for the increment
14668 portion after the statement, because this will be the real flow of
14669 execution. Fixes #42385
14671 * codegen.cs (EmitContext.EmitArgument,
14672 EmitContext.EmitStoreArgument): New helper functions when the
14673 RemapToProxy flag is set.
14675 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14678 Add support for remapping parameters.
14680 * iterators.cs: Propagate parameter values; Store parameter
14681 values in the proxy classes.
14683 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14685 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14686 need a proxy reference; I do not know what I was thinking
14688 * cs-parser.jay (constructor_initializer): catch another error,
14689 and display nice message.
14691 (field_declaration): catch void field declaration
14692 to flag a better error.
14694 * class.cs (MemberBase.CheckBase): Report an error instead of a
14695 warning if a new protected member is declared in a struct.
14696 (Field.Define): catch the error of readonly/volatile.
14698 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14700 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14701 volatile variable is taken
14703 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14705 * statement.cs (Fixed.Resolve): Report an error if we are not in
14708 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14710 * typemanager.cs: reuse the code that handles type clashes for
14711 delegates and enumerations.
14713 * class.cs (Report28): Always report.
14715 * expression.cs (EncodeAsAttribute): Allow nulls here.
14717 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14719 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14720 the functionality for testing whether an expression is valid for
14721 an attribute here. Also handle the case of arrays of elements
14724 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14725 encoding a linear array into an array of objects that are suitable
14726 to be passed to an CustomAttributeBuilder.
14728 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14730 * ecore.cs: (FieldExpr): Handle field remapping here.
14732 * iteratators.cs: Pass the instance variable (if the method is an
14733 instance method) to the constructors, so we can access the field
14734 variables on the class.
14736 TODO: Test this with structs. I think the THIS variable on
14737 structs might have to be a pointer, and not a refenrece
14739 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14741 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14742 local variables to fields in a proxy class.
14744 * iterators.cs (PopulateProxy): Rename our internal fields to
14746 Create a <THIS> field if we are an instance method, so we can
14747 reference our parent container variables.
14748 (MapVariable): Called back from the EmitContext code to enter a
14749 new variable to field mapping into the proxy class (we just create
14753 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14754 for using the remapped locals to fields.
14756 I placed the code here, because that gives the same semantics to
14757 local variables, and only changes the Emit code.
14759 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14760 statements inside iterators.
14761 (VariableInfo): Add a FieldBuilder for the cases when we are
14762 remapping local variables to fields in a proxy class
14764 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14765 current_block != null.
14767 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14768 not cope with strings, as it has been moved to the
14769 TableSwitchEmit. Fixed bug in switch generation.
14771 * expression.cs (New.DoResolve): Provide more context for the user
14772 when reporting an error.
14774 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14777 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14778 check the permissions for it. Note than in a type-resolution
14779 context the check was already present in DeclSpace.ResolveType,
14780 but was missing from the MemberAccess.
14782 (ArrayCreation.CheckIndices): warn if the user has
14783 more nested levels of expressions, but there are no more
14784 dimensions specified. Avoids crash on bug 41906.
14786 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14788 * statement.cs (Block): replace Implicit bool, for a generic
14790 New flag: `Unchecked'. This is used during the EmitMeta phase
14791 (which is out-of-line with the regular Resolve/Emit process for a
14792 statement, as this is done ahead of time, but still gets a chance
14793 to call constant resolve).
14795 (Block.Flags): new enum for adding a new flag.
14797 (Block.EmitMeta): track the state of unchecked.
14799 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14800 to enable constant resolution to work there as well.
14802 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14804 * typemanager.cs (ienumerable_type): Also look up
14805 System.Collections.IEnumerable.
14807 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14809 TODO: Test more than one conditional per method.
14811 * class.cs (Indexer.Define): Report the location where the user is
14812 referencing the unsupported feature.
14814 (MethodData): Overload the use of `conditionals' to
14815 minimize the creation of needless ArrayLists. This saves roughly
14816 212kb on my machine.
14818 (Method): Implement the new IIteratorContainer interface.
14819 (Method.SetYields): Implement the method by setting the ModFlags
14820 to contain METHOD_YIELDS.
14822 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14823 which just got set to null.
14825 * iterators.cs: New file.
14827 (Yield, YieldBreak): New statements.
14829 * statement.cs (Return.Resolve): Flag an error if we are used in
14830 an iterator method.
14832 * codegen.cs (InIterator): New flag set if the code is being
14833 compiled in an iterator method.
14835 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14836 internal modifier, and we just use it to avoid adding extra
14837 fields, as this is seldom used.
14839 * cs-parser.jay: Add yield_statement (yield and yield break).
14841 * driver.cs: New flag -v2 to turn on version 2 features.
14843 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14844 hashtable when v2 is enabled.
14846 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14848 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14849 there is already a namespace defined with this name.
14851 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14852 people upgraded their corlibs.
14854 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14855 always use fully qualified types, no need to use the compiler
14858 (TypeManager.IsNamespace): Use binarysearch.
14860 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14861 AddDelegate): I did not quite use the new IsValid API properly: I
14862 have to pass the short-name and the fullname. I was passing only
14863 the basename instead of the fullname sometimes.
14865 (TypeContainer.DefineType): call NamespaceClash.
14867 * interface.cs (Interface.DefineType): use NamespaceClash before
14870 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14873 * enum.cs: (Enum.DefineType): use NamespaceClash before
14876 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14877 speed increase. First, use the negative_hits cache when we get a
14878 negative. Second, add the type with its full original name
14879 instead of the new . and + encoded name (reflection uses + to
14880 separate type from a nested type). Use LookupTypeReflection
14881 directly which bypasses the type->name hashtable (that we already
14882 know does not contain the type.
14884 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14885 location/container type.
14887 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14889 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14891 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14893 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14894 method is being referenced in the method group from a static
14895 context, and report error 120 if so.
14897 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14900 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14901 is created, we create the A namespace).
14903 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14906 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14908 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14909 invocation to ModuleBuilder.GetType with the same values will
14910 return a new type instance, so we need to cache its return
14913 * expression.cs (Binary.ResolveOperator): Only allow the compare
14914 operators on enums if they are of the same type.
14916 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14917 types of ValueType on their own case. Before we were giving them
14918 the same treatment as objects.
14920 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14921 fullname. Short name is used to compare against container name.
14922 Fullname is used to check against defined namespace names.
14924 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14925 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14927 (Method.CheckBase): Call parent.
14928 (MemberBase.CheckBase): Check for protected members on sealed
14930 (PropertyBase.CheckBase): Call parent.
14931 (Field.Define): Call parent.
14933 * report.cs: Negative error codes are now mapped to 8000 - code,
14934 so that the display is render more nicely.
14936 * typemanager.cs: Do not use try/catch, instead report a regular
14939 (GetPointerType, GetReferenceType): These methods provide
14940 mechanisms to obtain the T* and T& from a T. We had the code
14941 previously scattered around the code base, and it also used
14942 TypeManager.LookupType that would go through plenty of caches.
14943 This one goes directly to the type source.
14945 In some places we did the Type.GetType followed by
14946 ModuleBuilder.GetType, but not in others, so this unifies the
14947 processing as well.
14949 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14950 statements now that we have namespace information.
14952 * typemanager.cs (IsNamespace): New method, returns whether the
14953 string presented is a namespace or not.
14955 (ComputeNamespaces): New public entry point, computes the list of
14956 available namespaces, using the GetNamespaces API call in Mono, or
14957 the slower version in MS.NET.
14959 Now before we start the semantic analysis phase, we have a
14960 complete list of namespaces including everything that the user has
14963 Deleted old code to cache namespaces in .nsc files.
14965 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14967 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14968 class/struct location definition Location for the implicit
14969 constructor location.
14971 (Operator.Define): Use the location of the operator for the
14972 implicit Method definition.
14974 (Constructor.Emit): use the constructor location for the implicit
14975 base initializer constructor.
14977 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14978 and the Expression class now contains two new methods:
14980 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14981 isolate type lookup from the rest of the resolution process.
14983 Since we use Expressions to hold type definitions due to the way
14984 we parse the input we have historically overloaded Resolve to
14985 perform the Type lookups if a special flag is passed. Now this is
14986 eliminated and two methods take their place.
14988 The differences in the two methods between xStep and xTerminal is
14989 that xStep is involved in our current lookup system that uses
14990 SimpleNames to compose a name, while xTerminal is used just to
14991 catch the case where the simplename lookup failed.
14993 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14995 * expression.cs (ResolveMemberAccess): Remove redundant code.
14996 TypeExpr expressions are always born fully resolved.
14998 * interface.cs (PopulateMethod): Do not lookup the types twice.
14999 We were doing it once during SemanticAnalysis and once during
15002 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15003 in local variable type definitions, were being returned as a
15004 SimpleName (we decomposed everything into a string), that is
15005 because primary_expression was being used instead of a type in the
15006 grammar (reduce/reduce conflicts).
15008 The part that was wrong is that we converted the expression into a
15009 string (an oversimplification in one hand, compounded with primary
15010 expressions doing string concatenation).
15016 Would return "A.B.C[]" as a SimpleName. This stopped things like
15017 using clauses from working on this particular context. And a type
15018 was being matched directly against "A.B.C[]".
15020 We now use the correct approach, and allow for ComposedCast to be
15021 part of the unary expression. So the "A.B.C []" become a composed
15022 cast of "A.B.C" (as a nested group of MemberAccess with a
15023 SimpleName at the end) plus the rank composition "[]".
15027 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15029 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15030 for the access level checking.
15032 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15033 `TypeContainer container', because I kept getting confused when I
15034 was debugging this code.
15036 * expression.cs (Indexers): Instead of tracking getters/setters,
15037 we now track them in parallel. We create one arraylist less, but
15038 most importantly it is possible now for the LValue code to find a
15039 matching get for a set.
15041 (IndexerAccess.DoResolveLValue): Update the code.
15042 GetIndexersForType has been modified already to extract all the
15043 indexers from a type. The code assumed it did not.
15045 Also make the code set the correct return type for the indexer.
15046 This was fixed a long time ago for properties, but was missing for
15047 indexers. It used to be void_type.
15049 (Binary.Emit): Test first for doubles instead of
15050 floats, as they are more common.
15052 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15053 when dealing with floats and the <=, >= operators. This fixes bug
15056 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15057 to load the array value by emitting a load on the foreach variable
15058 type. This was incorrect.
15060 We now emit the code to load an element using the the array
15061 variable type, and then we emit the conversion operator.
15065 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15067 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15069 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15071 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15072 test for protection before we test for signatures.
15074 (MethodSignature.ToString): implement.
15076 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15077 to the case where we reduced into a LongConstant.
15079 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15080 depend on whether the information is acurrate, because the
15081 Microsoft runtime will always claim that the array type is public,
15082 regardless of the real state.
15084 If the type is a pointer, another problem happens: the type is
15085 reported as non-public in Microsoft.
15087 In both cases we have to call CheckAccessLevel recursively with
15088 the underlying type as the argument to be tested.
15090 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15092 * assign.cs (Assign.Emit): If we are dealing with a compound
15093 assignment expression, we should use the code path that stores the
15094 intermediate result in a temporary value. This fixes #40903.
15096 *expression.cs (Indirection.ToString): Provide ToString method for
15099 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15101 * class.cs: Null out fields holding references to Block objects so
15102 they can be garbage collected.
15104 * expression.cs (OverloadResolve): Remove unused local.
15106 2003-04-07 Martin Baulig <martin@ximian.com>
15108 * codegen.cs (EmitContext.CurrentFile): New public field.
15109 (EmitContext.Mark): Use the CurrentFile to check whether the
15110 location is in the correct file.
15111 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15113 2003-04-07 Martin Baulig <martin@ximian.com>
15115 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15117 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15118 location. [FIXME: The location argument which gets passed to this
15119 method is sometimes wrong!]
15121 2003-04-07 Nick Drochak <ndrochak@gol.com>
15123 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15125 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15127 * expression.cs (Indirection.EmitAssign): We were using the
15128 temporary, but returning immediately instead of continuing the
15131 2003-04-06 Martin Baulig <martin@ximian.com>
15133 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15134 if it's a nested child, but also deriving from the outer class.
15137 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15138 nested child, but also deriving from the outer class. See
15140 (FilterWithClosure): We may access private members of the outer
15141 class if we're a nested child and deriving from the outer class.
15142 (RealMemberLookup): Only set `closure_private_ok' if the
15143 `original_bf' contained BindingFlags.NonPublic.
15145 2003-04-05 Martin Baulig <martin@ximian.com>
15147 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15149 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15151 * class.cs (Event.Define): Do not allow abstract events to have
15154 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15156 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15157 block in event declarations.
15159 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15160 value type, get its address.
15162 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15163 leaving a class on the stack instead of a boolean value (int
15164 0/1). Change the code so we compare against null, and then the
15165 result against zero.
15167 * class.cs (TypeContainer.GetClassBases): We were checking for the
15168 parent class being sealed too late.
15170 * expression.cs (Binary.Emit): For <= and >= when dealing with
15171 floating point values, use cgt.un and clt.un instead of cgt and
15174 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15176 * statement.cs: Apply the same optimization as MS: skip the
15177 GetEnumerator returning an IEnumerator, and use the one returning a
15178 CharEnumerator instead. This allows us to avoid the try-finally block
15181 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15183 * cs-parser.jay: Attributes cannot be applied to
15184 namespaces. Fixes #40473
15186 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15189 (Add*): check if the name is valid using the full name for constants,
15190 fields, properties and events.
15192 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15194 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15195 char constants to be part of the enumeration.
15197 * expression.cs (Conditional.DoResolve): Add support for operator
15198 true. Implements the missing functionality from 14.12
15200 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15201 operator true/false as required by the spec.
15203 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15204 implicit conversion to boolean.
15206 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15207 also one where the type implements `operator true'.
15209 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15210 get an expression that will invoke operator true based on an
15213 (GetConversionOperators): Removed the hack that called op_True
15216 (Expression.ResolveBoolean): Move this from Statement.
15218 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15220 * ecore.cs (FieldExpr): do not allow initialization of initonly
15221 fields on derived classes
15223 2003-03-13 Martin Baulig <martin@ximian.com>
15225 * statement.cs (Block.Emit): Call ig.BeginScope() and
15226 ig.EndScope() when compiling with debugging info; call
15227 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15229 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15231 * expression.cs (Indexers): Do not construct immediately, allow
15232 for new members to be appended as we go. Fixes 38143
15234 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15236 * expression.cs: save/restore context when resolving an unchecked
15239 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15241 * cfold.cs: Catch division by zero in modulus operator during
15244 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15246 * interface.cs (Interface.DefineMembers): Avoid defining members
15249 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15251 * driver.cs: handle the +/- options for -noconfig
15253 * statement.cs (Unckeched.Resolve): Also track the state of
15254 unchecked in the Resolve phase.
15256 2003-02-27 Martin Baulig <martin@ximian.com>
15258 * ecore.cs (Expression.MemberLookup): Don't create a
15259 MethodGroupExpr for something which is not a method. Fixes #38291.
15261 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15263 * class.cs (MemberBase.CheckParameters): Also check that the type
15264 is unmanaged if it is a pointer.
15266 * expression.cs (SizeOf.Resolve): Add location information.
15268 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15269 a managed type is declared.
15271 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15272 parameter modifiers as well. Fixes bug 38606
15274 * class.cs: Very sad. Am backing out the speed up changes
15275 introduced by the ArrayList -> Array in the TypeContainer, as they
15276 were not actually that much faster, and introduced a bug (no error
15277 reports on duplicated methods).
15279 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15280 source first, this will guarantee that we have a valid expression
15281 before calling in lower levels functions that will require a
15282 resolved object. Then use this original_source in the
15283 target.ResolveLValue instead of the original source that was
15286 Another change. Use target.Resolve instead of LValueResolve.
15287 Although we are resolving for LValues, we will let the Assign code
15288 take care of that (it will be called again from Resolve). This
15289 basically allows code like this:
15291 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15292 class Y { void A (X x) { x [0] += o; }
15294 The problem was that the indexer was trying to resolve for
15295 set_Item (idx, object o) and never finding one. The real set_Item
15296 was set_Item (idx, X). By delaying the process we get the right
15301 2003-02-23 Martin Baulig <martin@ximian.com>
15303 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15304 while calling DoEmit ().
15306 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15307 source files; if you use the #line directive inside a method, the
15308 compiler stops emitting line numbers for the debugger until it
15309 reaches the end of the method or another #line directive which
15310 restores the original file.
15312 2003-02-23 Martin Baulig <martin@ximian.com>
15314 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15316 2003-02-23 Martin Baulig <martin@ximian.com>
15318 * statement.cs (Block.AddChildVariableNames): We need to call this
15319 recursively, not just for our immediate children.
15321 2003-02-23 Martin Baulig <martin@ximian.com>
15323 * class.cs (Event.Define): Always make the field private, like csc does.
15325 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15326 actually work, fixes bug #37521.
15328 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15330 * delegate.cs: When creating the various temporary "Parameters"
15331 classes, make sure that we call the ComputeAndDefineParameterTypes
15332 on those new parameters (just like we do with the formal ones), to
15333 allow them to be resolved in the context of the DeclSpace.
15335 This fixes the bug that Dick observed in Bugzilla #38530.
15337 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15339 * expression.cs (ResolveMemberAccess): When resolving a constant,
15340 do not attempt to pull a constant if the value was not able to
15341 generate a valid constant.
15343 * const.cs (LookupConstantValue): Do not report more errors than required.
15345 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15347 * expression.cs: fixes bug #38328.
15349 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15351 * class.cs: Changed all the various members that can be part of a
15352 class from being an ArrayList to be an Array of the right type.
15353 During the DefineType type_list, interface_list, delegate_list and
15354 enum_list are turned into types, interfaces, delegates and enums
15357 And during the member population, indexer_list, event_list,
15358 constant_list, field_list, instance_constructor_list, method_list,
15359 operator_list and property_list are turned into their real arrays.
15361 Although we could probably perform this operation earlier, for
15362 good error reporting we need to keep the lists and remove the
15363 lists for longer than required.
15365 This optimization was triggered by Paolo profiling the compiler
15366 speed on the output of `gen-sample-program.pl' perl script.
15368 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15369 not crash in methods like MemberLookupFailed that use this field.
15371 This problem arises when the compiler fails to resolve a type
15372 during interface type definition for example.
15374 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15376 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15377 inherit from System.Object, so we have to stop at null, not only
15378 when reaching System.Object.
15380 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15382 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15383 DeclaredOnly because the parent indexer might have had a different
15384 name, but did not loop until the top of the hierarchy was reached.
15386 The problem this one fixes is 35492: when a class implemented an
15387 indexer from an interface, we were getting the interface method
15388 (which was abstract) and we were flagging an error (can not invoke
15391 This also keeps bug 33089 functioning, and test-148 functioning.
15393 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15394 out if a method is special is to see if it is declared in a
15395 property or event, or whether it is one of the predefined operator
15396 names. This should fix correctly #36804.
15398 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15400 The goal here is to remove the dependency on EmptyCast.Peel ().
15401 Killing it completely.
15403 The problem is that currently in a number of places where
15404 constants are expected, we have to "probe" for an EmptyCast, and
15405 Peel, which is not the correct thing to do, as this will be
15406 repetitive and will likely lead to errors.
15408 The idea is to remove any EmptyCasts that are used in casts that
15409 can be reduced to constants, so we only have to cope with
15412 This bug hunt was triggered by Bug 37363 and the desire to remove
15413 the duplicate pattern where we were "peeling" emptycasts to check
15414 whether they were constants. Now constants will always be
15417 * ecore.cs: Use an enumconstant here instead of wrapping with
15420 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15421 throwing me off. By handling this we can get rid of a few hacks.
15423 * statement.cs (Switch): Removed Peel() code.
15425 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15427 * class.cs: Location information for error 508
15429 * expression.cs (New.DoResolve): Add a guard against double
15430 resolution of an expression.
15432 The New DoResolve might be called twice when initializing field
15433 expressions (see EmitFieldInitializers, the call to
15434 GetInitializerExpression will perform a resolve on the expression,
15435 and later the assign will trigger another resolution
15437 This leads to bugs (#37014)
15439 * delegate.cs: The signature for EndInvoke should contain any ref
15440 or out parameters as well. We were not doing this in the past.
15442 * class.cs (Field.Define): Do not overwrite the type definition
15443 inside the `volatile' group. Turns out that volatile enumerations
15444 were changing the type here to perform a validity test, which
15447 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15449 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15450 and structs, we do not want to load the instance variable
15452 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15453 enum_type has to be handled like an object reference (implicit
15454 conversions exists from this to object), but the regular IsClass
15455 and IsValueType tests will never return true for this one.
15457 Also we use TypeManager.IsValueType instead of type.IsValueType,
15458 just for consistency with the rest of the code (this is only
15459 needed if we ever use the construct exposed by test-180.cs inside
15460 corlib, which we dont today).
15462 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15464 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15467 2003-02-09 Martin Baulig <martin@ximian.com>
15469 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15470 (Namespace.DefineNamespaces): New static public method; this is
15471 called when we're compiling with debugging to add all namespaces
15472 to the symbol file.
15474 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15475 pass it to the Namespace's .ctor.
15477 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15478 and MethodBase arguments; pass the namespace ID to the symwriter;
15479 pass the MethodBase instead of the token to the symwriter.
15480 (SymbolWriter.DefineNamespace): New method to add a namespace to
15483 2003-02-09 Martin Baulig <martin@ximian.com>
15485 * symbolwriter.cs: New file. This is a wrapper around
15486 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15487 methods here in near future.
15489 2003-02-09 Martin Baulig <martin@ximian.com>
15491 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15492 ILGenerator.MarkSequencePoint() which are actually used by the
15495 2003-02-09 Martin Baulig <martin@ximian.com>
15497 * location.cs (SourceFile): New public sealed class. This
15498 contains the name and an index which is used in the location's token.
15499 (Location): Reserve an appropriate number of bits in the token for
15500 the source file instead of walking over that list, this gives us a
15501 really huge performance improvement when compiling with debugging.
15503 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15504 `SourceFile' argument instead of a string.
15505 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15506 but don't parse/tokenize here, we need to generate the list of all
15507 source files before we do that.
15508 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15511 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15512 instead of a string.
15514 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15517 2003-02-09 Martin Baulig <martin@ximian.com>
15519 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15520 filename on `#line default'.
15522 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15524 * statement.cs: don't clear the pinned var when the fixed statement
15525 returns from the method (fixes bug#37752).
15527 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15529 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15532 2003-02-07 Martin Baulig <martin@ximian.com>
15534 * driver.cs: Removed the `--debug-args' command line argument.
15536 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15537 automatically by the AsssemblyBuilder.
15538 (CodeGen.InitializeSymbolWriter): We don't need to call any
15539 initialization function on the symbol writer anymore. This method
15540 doesn't take any arguments.
15542 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15544 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15545 from referenced assemblies as well.
15547 2003-02-02 Martin Baulig <martin@ximian.com>
15549 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15551 2003-02-02 Martin Baulig <martin@ximian.com>
15553 * class.cs (Constructor.Emit): Open the symbol writer before
15554 emitting the constructor initializer.
15555 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15556 single-stepping through constructor initializers.
15558 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15560 * class.cs: Handle error 549: do not allow virtual methods in
15563 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15565 * decl.cs: Check access levels when resolving types
15567 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15569 * statement.cs: Add parameters and locals set in catch blocks that might
15570 return to set vector
15572 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15574 * class.cs (Operator): Set the SpecialName flags for operators.
15576 * expression.cs (Invocation.DoResolve): Only block calls to
15577 accessors and operators on SpecialName methods.
15579 (Cast.TryReduce): Handle conversions from char constants.
15582 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15584 * statement.cs: small memory and time optimization in FlowBranching.
15586 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15588 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15589 problem that the last fix but in the other sid (Set).
15591 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15592 access when there is no indexer in the hierarchy.
15594 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15596 * class.cs: Combine some if statements.
15598 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15600 * driver.cs: fixed bug #37187.
15602 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15604 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15605 any indexer, it's needed to build a list with all the indexers in the
15606 hierarchy (AllGetters), else we have problems. Fixes #35653.
15608 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15610 * class.cs (MethodData.Define): It is wrong for an interface
15611 implementation to be static in both cases: explicit and implicit.
15612 We were only handling this in one case.
15614 Improve the if situation there to not have negations.
15616 * class.cs (Field.Define): Turns out that we do not need to check
15617 the unsafe bit on field definition, only on usage. Remove the test.
15619 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15621 * driver.cs: use assembly.Location instead of Codebase (the latest
15622 patch made mcs fail when using MS assemblies).
15624 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15626 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15627 get the path to *corlib.dll.
15629 2003-01-21 Nick Drochak <ndrochak@gol.com>
15633 * typemanager.cs: Remove compiler warnings
15635 2003-01-20 Duncan Mak <duncan@ximian.com>
15637 * AssemblyInfo.cs: Bump the version number to 0.19.
15639 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15641 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15643 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15645 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15647 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15649 * cs-parser.jay: Small fix: we were not comparing the constructor
15650 name correctly. Thanks to Zoltan for the initial pointer.
15652 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15654 * cs-tokenizer.cs: Set file name when specified with #line
15656 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15658 * cs-parser.jay: Only perform the constructor checks here if we
15659 are named like the class; This will help provider a better
15660 error. The constructor path is taken when a type definition is
15661 not found, but most likely the user forgot to add the type, so
15662 report that rather than the constructor error.
15664 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15666 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15669 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15671 * cs-parser.jay: Add cleanup call.
15673 2003-01-13 Duncan Mak <duncan@ximian.com>
15675 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15676 consistent with other methods.
15678 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15680 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15682 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15684 * attribute.cs: only set GuidAttr to true when we have a
15687 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15691 * typemanager.cs: fixes to allow mcs compile corlib with the new
15692 Type.IsSubclassOf fix.
15694 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15696 * expression.cs (LocalVariableReference.DoResolve): Classify a
15697 constant as a value, not as a variable. Also, set the type for
15700 * cs-parser.jay (fixed_statement): take a type instead of a
15701 pointer_type, so we can produce a better error message later.
15703 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15706 (For.DoEmit): Make inifinite loops have a
15707 non-conditional branch back.
15709 (Fixed.DoEmit): First populate the pinned variables, then emit the
15710 statement, then clear the variables. Before I was emitting the
15711 code once for each fixed piece.
15714 2003-01-08 Martin Baulig <martin@ximian.com>
15716 * statement.cs (FlowBranching.MergeChild): A break in a
15717 SWITCH_SECTION does not leave a loop. Fixes #36155.
15719 2003-01-08 Martin Baulig <martin@ximian.com>
15721 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15722 lives in the same number space than `param_map'. Fixes #36154.
15724 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15726 * cs-parser.jay (constructor_declaration): Set the
15727 Constructor.ModFlags before probing for it. This makes the
15728 compiler report 514, 515 and 132 (the code was there, but got
15731 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15732 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15733 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15735 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15737 * enum.cs: create the enum static fields using the enum type.
15739 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15741 * class.cs: don't try to create the ParamBuilder for the return
15742 type if it's not needed (and handle it breaking for the ms runtime
15745 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15747 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15749 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15751 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15752 the command. This showed up while compiling the JANET source
15753 code, which used \r as its only newline separator.
15755 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15757 * class.cs (Method.Define): If we are an operator (because it
15758 reuses our code), then set the SpecialName and HideBySig. #36128
15760 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15762 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15763 exception, report error 120 `object reference required'.
15765 * driver.cs: Add --pause option, used during to measure the size
15766 of the process as it goes with --timestamp.
15768 * expression.cs (Invocation.DoResolve): Do not allow methods with
15769 SpecialName to be invoked.
15771 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15773 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15774 number before adding it.
15776 2002-12-21 Ravi Pratap <ravi@ximian.com>
15778 * ecore.cs (StandardImplicitConversion): When in an unsafe
15779 context, we allow conversion between void * to any other pointer
15780 type. This fixes bug #35973.
15782 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15784 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15785 is not thrown when extensionless outputs are used
15787 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15789 * rootcontext.cs: fixed compilation of corlib.
15791 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15793 * attribute.cs (Attributes.Contains): Add new method.
15795 * class.cs (MethodCore.LabelParameters): if the parameter is an
15796 `out' parameter, check that no attribute `[In]' has been passed.
15798 * enum.cs: Handle the `value__' name in an enumeration.
15800 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15802 * decl.cs: Added special case to allow overrides on "protected
15805 2002-12-18 Ravi Pratap <ravi@ximian.com>
15807 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15808 since it makes much more sense.
15810 (Attributes.ctor): Don't require a Location parameter.
15812 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15814 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15815 since we already have that information per attribute.
15817 * everywhere : make appropriate changes.
15819 * class.cs (LabelParameters): Write the code which actually
15820 applies attributes to the return type. We can't do this on the MS
15821 .NET runtime so we flag a warning in the case an exception is
15824 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15826 * const.cs: Handle implicit null conversions here too.
15828 2002-12-17 Ravi Pratap <ravi@ximian.com>
15830 * class.cs (MethodCore.LabelParameters): Remove the extra
15831 Type [] parameter since it is completely unnecessary. Instead
15832 pass in the method's attributes so that we can extract
15833 the "return" attribute.
15835 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15837 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15838 of ignoring it and letting the compile continue.
15840 * typemanager.cs (ChangeType): use an extra argument to return an
15841 error condition instead of throwing an exception.
15843 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15845 * expression.cs (Unary.TryReduce): mimic the code for the regular
15846 code path. Perform an implicit cast in the cases where we can
15847 implicitly convert to one of the integral types, and then reduce
15848 based on that constant. This fixes bug #35483.
15850 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15852 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15854 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15856 * namespace.cs: fixed bug #35489.
15858 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15860 * class.cs: Remove some dead code.
15862 * cs-parser.jay: Estimate the number of methods needed
15863 (RootContext.MethodCount);
15865 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15866 numbers instead of StringBuilders.
15868 * support.cs (PtrHashtable): Add constructor with initial size;
15869 We can now reduce reallocations of the method table.
15871 2002-12-10 Ravi Pratap <ravi@ximian.com>
15873 * attribute.cs (ApplyAttributes): Keep track of the emitted
15874 attributes on a per-target basis. This fixes bug #35413.
15876 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15878 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15879 default to the Windows 1252 encoding.
15881 (UnixParseOption): Support version, thanks to Alp for the missing
15884 * AssemblyInfo.cs: Add nice assembly information.
15886 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15889 * cs-parser.jay: Allow a trailing comma before the close bracked
15890 in the attribute_section production.
15892 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15893 address of the instance was being taken, I will take this out,
15894 because we take the address of the object immediately here.
15896 2002-12-09 Ravi Pratap <ravi@ximian.com>
15898 * typemanager.cs (AreMultipleAllowed): Take care of the most
15899 obvious case where attribute type is not in the current assembly -
15902 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15904 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15905 definitions, instead of doing that afterwards.
15907 Also we use a nice little hack, depending on the constructor, we
15908 know if we are a "composed" name or a simple name. Hence, we
15909 avoid the IndexOf test, and we avoid
15911 * codegen.cs: Add code to assist in a bug reporter to track down
15912 the source of a compiler crash.
15914 2002-12-07 Ravi Pratap <ravi@ximian.com>
15916 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15917 types have been emitted for a given element and flag an error
15918 if something which does not have AllowMultiple set is used more
15921 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15922 attribute types and their corresponding AllowMultiple properties
15924 (AreMultipleAllowed): Check the property for a given type.
15926 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15927 property in the case we have a TypeContainer.
15929 (Attributes.AddAttribute): Detect duplicates and just skip on
15930 adding them. This trivial fix catches a pretty gross error in our
15931 attribute emission - global attributes were being emitted twice!
15933 Bugzilla bug #33187 is now fixed.
15935 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15937 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15938 instead of pp_and).
15940 * expression.cs (Binary.ResolveOperator): I can only use the
15941 Concat (string, string, string) and Concat (string, string,
15942 string, string) if the child is actually a concatenation of
15945 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15947 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15948 context where we need a 2-character lookahead.
15950 * pending.cs (PendingImplementation): Rework so we can keep track
15951 of interface types all the time, and flag those which were
15952 implemented by parents as optional.
15954 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15956 * expression.cs (Binary.ResolveOperator): Use
15957 String.Concat(string,string,string) or
15958 String.Concat(string,string,string,string) when possible.
15960 * typemanager: More helper methods.
15963 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15965 * pending.cs: remove the bogus return from GetMissingInterfaces()
15966 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15968 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15970 * namespace.cs: avoid duplicated 'using xxx' being added to
15971 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15972 when we get more than one 'using' statement for the same namespace.
15973 Report a CS0105 warning for it.
15975 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15977 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15978 of calling getChar/putback, uses internal knowledge of it.
15980 (xtoken): Reorder tokenizer so most common patterns are checked
15981 first. This reduces the compilation time in another 5% (from 8.11s
15982 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15984 The parsing time is 22% of the compilation in mcs, and from that
15985 64% is spent on the tokenization process.
15987 I tried using a binary search for keywords, but this is slower
15988 than the hashtable. Another option would be to do a couple of
15991 * Not use a StringBuilder, instead use an array of chars,
15992 with a set value. Notice that this way we could catch
15993 the 645 error without having to do it *afterwards*.
15995 * We could write a hand-parser to avoid the hashtable
15996 compares altogether.
15998 The identifier consumption process takes 37% of the tokenization
15999 time. Another 15% is spent on is_number. 56% of the time spent
16000 on is_number is spent on Int64.Parse:
16002 * We could probably choose based on the string length to
16003 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16006 Another 3% is spend on wrapping `xtoken' in the `token' function.
16008 Handle 0xa0 as whitespace (#34752)
16010 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16012 * typemanager.cs (IsCLRType): New routine to tell whether a type
16013 is one of the builtin types.
16015 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16016 typecode in more places instead of doing pointer comparissions.
16017 We could leverage some knowledge about the way the typecodes are
16020 New code to cache namespaces in assemblies, it is currently not
16021 invoked, to be used soon.
16023 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16025 * expression.cs (Binary.ResolveOperator): specially handle
16026 strings, and do not perform user-defined operator overloading for
16029 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16031 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16032 internalcall as it is a pretty simple operation; Avoid whenever
16033 possible to call Char.IsLetter.
16035 (consume_identifier): Cut by half the number of
16036 hashtable calls by merging the is_keyword and GetKeyword behavior.
16038 Do not short-circuit, because if we do, we
16039 report errors (ie, #if false && true would produce an invalid
16043 2002-11-24 Martin Baulig <martin@ximian.com>
16045 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16046 check constant ranges and report a CS0221. Fixes #33186.
16048 2002-11-24 Martin Baulig <martin@ximian.com>
16050 * cs-parser.jay: Make this work for uninitialized variable
16051 declarations in the `for' initializer. Fixes #32416.
16053 2002-11-24 Martin Baulig <martin@ximian.com>
16055 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16056 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16058 2002-11-24 Martin Baulig <martin@ximian.com>
16060 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16061 argument; if true, we also check for user-defined conversions.
16062 This is only needed if both arguments are of a user-defined type.
16063 Fixes #30443, added test-175.cs.
16064 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16066 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16068 2002-11-24 Martin Baulig <martin@ximian.com>
16070 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16071 function to get the store opcode.
16072 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16073 only emit the Ldelema if the store opcode is Stobj. You must run
16074 both test-34 and test-167 to test this. Fixes #34529.
16076 2002-11-23 Martin Baulig <martin@ximian.com>
16078 * ecore.cs (Expression.MemberLookup): Added additional
16079 `qualifier_type' argument which is used when we're being called
16080 from MemberAccess.DoResolve() and null if we're called from a
16082 (Expression.MemberLookupFailed): New method to report errors; this
16083 does the CS1540 check and reports the correct error message.
16085 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16086 argument for the CS1540 check and redone the way how we're dealing
16087 with private members. See the comment in the source code for details.
16088 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16089 `closure_start_type' to `closure_qualifier_type' and check whether
16090 it's not null. It was not this filter being broken, it was just
16091 being called with the wrong arguments.
16093 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16094 and pass it the correct `qualifier_type'; this also does the error
16097 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16099 * expression.cs (Invocation.EmitParams): If the we are dealing
16100 with a non-built-in value type, load its address as well.
16102 (ArrayCreation): Use a a pretty constant instead
16103 of the hardcoded value 2. Use 6 instead of 2 for the number of
16104 static initializers.
16106 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16107 because they are not really value types, just glorified integers.
16109 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16111 * ecore.cs: Remove redundant code for enumerations, make them use
16112 the same code path as everything else, fixes the casting issue
16113 with enumerations in Windows.Forms.
16115 * attribute.cs: Do only cast to string if it is a string, the
16116 validation happens later.
16118 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16119 people upgrade their corlibs.
16121 * ecore.cs: Oops, enumerations were not following the entire code path
16123 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16125 * typemanager.cs (FilterWithClosure): Commented out the test for
16126 1540 in typemanager.cs, as it has problems when accessing
16127 protected methods from a parent class (see test-174.cs).
16129 * attribute.cs (Attribute.ValidateGuid): new method.
16130 (Attribute.Resolve): Use above.
16132 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16134 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16136 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16137 handling for enumerations, as we only needed the TypeContainer
16138 functionality to begin with (this is required for the fix below to
16139 work for enums that reference constants in a container class for
16142 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16144 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16145 a valid TypeBuilder to perform lookups on.o
16147 * class.cs (InheritableMemberSignatureCompare): Use true in the
16148 call to GetGetMethod and GetSetMethod, because we are comparing
16149 the signature, and we need to get the methods *even* if they are
16152 (PropertyBase.CheckBase): ditto.
16154 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16155 GotoCase.Resolve): Use Peel on EmpytCasts.
16157 * ecore.cs (EmptyCast): drop child, add Peel method.
16159 2002-11-17 Martin Baulig <martin@ximian.com>
16161 * ecore.cs (EmptyCast.Child): New public property.
16163 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16164 label resolved to an EmptyCast. Fixes #34162.
16165 (GotoCase.Resolve): Likewise.
16166 (Block.EmitMeta): Likewise.
16168 2002-11-17 Martin Baulig <martin@ximian.com>
16170 * expression.cs (Invocation.BetterConversion): Prefer int over
16171 uint; short over ushort; long over ulong for integer literals.
16172 Use ImplicitConversionExists instead of StandardConversionExists
16173 since we also need to check for user-defined implicit conversions.
16174 Fixes #34165. Added test-173.cs.
16176 2002-11-16 Martin Baulig <martin@ximian.com>
16178 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16179 with the `true' and `false' literals. Fixes #33151.
16181 2002-11-16 Martin Baulig <martin@ximian.com>
16183 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16184 October 22nd; don't do the cs1540 check for static members.
16186 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16187 now using our own filter here and doing the cs1540 check again.
16189 2002-11-16 Martin Baulig <martin@ximian.com>
16191 * support.cs (InternalParameters): Don't crash if we don't have
16192 any fixed parameters. Fixes #33532.
16194 2002-11-16 Martin Baulig <martin@ximian.com>
16196 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16197 when looking up static methods to make this work on Windows.
16200 2002-11-16 Martin Baulig <martin@ximian.com>
16202 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16203 a setter rather than using PropertyInfo.CanWrite.
16205 2002-11-15 Nick Drochak <ndrochak@gol.com>
16207 * class.cs: Allow acces to block member by subclasses. Fixes build
16210 2002-11-14 Martin Baulig <martin@ximian.com>
16212 * class.cs (Constructor.Emit): Added the extern/block check.
16215 2002-11-14 Martin Baulig <martin@ximian.com>
16217 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16218 iteration while looking for indexers, this is needed because the
16219 indexer may have a different name in our base classes. Fixed the
16220 error reporting (no indexers at all, not get accessor, no
16221 overloaded match). Fixes bug #33089.
16222 (IndexerAccess.DoResolveLValue): Likewise.
16224 2002-11-14 Martin Baulig <martin@ximian.com>
16226 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16227 indexers. Fixes the first part of bug #33089.
16228 (MethodSignature.InheritableMemberSignatureCompare): Added support
16231 2002-11-13 Ravi Pratap <ravi@ximian.com>
16233 * attribute.cs (Attribute.Resolve): Catch the
16234 NullReferenceException and report it since it isn't supposed to
16237 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16239 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16240 LogicalOr and LogicalAnd that can benefit from recursively
16241 handling EmitBranchable. The code now should be nice for Paolo.
16243 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16245 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16246 the Type lookups, as we perform quite a number of lookups on
16247 non-Types. This can be removed once we can deterministically tell
16248 whether we have a type or a namespace in advance.
16250 But this might require special hacks from our corlib.
16254 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16255 and double which avoids a conversion from an integer to a double.
16257 * expression.cs: tiny optimization, avoid calling IsConstant,
16258 because it effectively performs the lookup twice.
16260 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16262 But a bogus return here to keep the semantics of the old code
16263 until the Mono runtime is fixed.
16265 * pending.cs (GetMissingInterfaces): New method used to remove all
16266 the interfaces that are already implemented by our parent
16267 classes from the list of pending methods.
16269 * interface.cs: Add checks for calls after ResolveTypeExpr.
16271 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16273 * class.cs (Class.Emit): Report warning 67: event not used if the
16274 warning level is beyond 3.
16276 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16277 being a NullLiteral.
16279 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16282 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16283 path that might fail if a type can not be resolved.
16285 * expression.cs (Binary.Emit): Emit unsigned versions of the
16288 * driver.cs: use error 5.
16290 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16292 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16294 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16296 * cs-parser.jay (switch_section): A beautiful patch from Martin
16297 Baulig that fixed 33094.
16299 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16301 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16302 Check whether the base is abstract and report an error if so.
16304 * expression.cs (IndexerAccess.DoResolveLValue,
16305 IndexerAccess.DoResolve): ditto.
16307 (Invocation.DoResolve): ditto.
16309 (Invocation.FullMethodDesc): Improve the report string.
16311 * statement.cs (Block): Eliminate IsVariableDefined as it is
16312 basically just a wrapper for GetVariableInfo.
16314 * ecore.cs (SimpleName): Use new
16316 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16317 type, as we return the actual parameter ref/unref state on a
16320 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16322 * support.cs: Return proper flags REF/OUT fixing the previous
16325 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16326 not used to mean `ref' but `ref or out' in ParameterReference
16328 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16329 full type signature instead of calling TypeManger.CSharpName
16332 * support.cs (InternalParameters.ParameterDesc): Do not compare
16333 directly to the modflags, because REF/OUT will actually be bitsets
16336 * delegate.cs (VerifyMethod): Check also the modifiers.
16338 * cs-tokenizer.cs: Fix bug where floating point values with an
16339 exponent where a sign was missing was ignored.
16341 * driver.cs: Allow multiple assemblies to be specified in a single
16344 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16346 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16347 because identifiers after a parenthesis would end up in this kind
16348 of production, and we needed to desamiguate it for having casts
16351 (UserDefinedType *) xxx
16353 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16355 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16356 we should set on the Bindingflags.NonPublic, but not turn on
16357 private_ok. private_ok controls whether a Private member is
16358 returned (this is chekced on the filter routine), while the
16359 BindingFlags.NonPublic just controls whether private/protected
16360 will be allowed. This fixes the problem part of the problem of
16361 private properties being allowed to be used in derived classes.
16363 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16364 so we can call the children DoResolveLValue method (this will
16365 properly signal errors on lvalue assignments to base properties)
16367 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16368 getter are null, and we have a property info, we know that this
16369 happened because the lookup failed, so we report an error 122 for
16370 protection level violation.
16372 We also silently return if setter and getter are null in the
16373 resolve functions, this condition only happens if we have flagged
16374 the error before. This is the other half of the problem.
16376 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16377 not have accessibility information, that is why we were returning
16378 true in the filter function in typemanager.cs.
16380 To properly report 122 (property is inaccessible because of its
16381 protection level) correctly, we report this error in ResolveAccess
16382 by failing if both the setter and the getter are lacking (ie, the
16385 DoResolve and DoLResolve have been modified to check for both
16386 setter/getter being null and returning silently, the reason being
16387 that I did not want to put the knowledge about this error in upper
16390 int old = Report.Errors;
16391 x = new PropertyExpr (...);
16392 if (old != Report.Errors)
16397 So the property expr is returned, but it is invalid, so the error
16398 will be flagged during the resolve process.
16400 * class.cs: Remove InheritablePropertySignatureCompare from the
16401 class, as we no longer depend on the property signature to compute
16402 whether it is possible to implement a method or not.
16404 The reason is that calling PropertyInfo.GetGetMethod will return
16405 null (in .NET, in Mono it works, and we should change this), in
16406 cases where the Get Method does not exist in that particular
16411 class X { public virtual int A { get { return 1; } } }
16413 class Z : Y { public override int A { get { return 2; } } }
16415 Would fail in Z because the parent (Y) would not have the property
16416 defined. So we avoid this completely now (because the alternative
16417 fix was ugly and slow), and we now depend exclusively on the
16420 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16421 reference method, instead of using the property.
16423 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16424 routines are gone now.
16426 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16427 names, they were incorrectly named.
16429 * cs-tokenizer.cs: Return are more gentle token on failure.
16431 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16432 had an out-of-sync index variable, which caused it to remove from
16433 the list of pending methods the wrong method sometimes.
16435 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16437 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16438 CanWrite, because those refer to this particular instance of the
16439 property, and do not take into account the fact that we can
16440 override single members of a property.
16442 Constructor requires an EmitContext. The resolution process does
16443 not happen here, but we need to compute the accessors before,
16444 because the resolution does not always happen for properties.
16446 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16447 subclass, before we did not update this flag, but we did update
16450 (GetAccessors): Drop this routine, as it did not work in the
16451 presence of partially overwritten set/get methods.
16453 Notice that this broke the cs1540 detection, but that will require
16456 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16460 * driver.cs: issue a warning instead of an error if we don't support
16461 debugging for the platform. Also ignore a couple of errors that may
16462 arise when trying to write the symbols. Undo my previous patch.
16464 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16466 * driver.cs: ignore /debug switch except for Unix platforms.
16468 2002-10-23 Nick Drochak <ndrochak@gol.com>
16470 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16472 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16474 * driver.cs: Do not make mcs-debug conditional, so we do not break
16475 builds that use it.
16477 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16478 review this patch. But basically after all the children variables
16479 have been merged, the value of "Breaks" was not being set to
16480 new_breaks for Switch blocks. I think that it should be set after
16481 it has executed. Currently I set this to the value of new_breaks,
16482 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16483 conservative, but I do not understand this code very well.
16485 I did not break anything in the build, so that is good ;-)
16487 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16489 2002-10-20 Mark Crichton <crichton@gimp.org>
16491 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16493 2002-10-20 Nick Drochak <ndrochak@gol.com>
16495 * cfold.cs: Fixed compile blocker.
16497 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16499 * driver.cs: I was chekcing the key, not the file.
16501 2002-10-19 Ravi Pratap <ravi@ximian.com>
16503 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16504 message that we were generating - we just need to silently return
16507 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16509 * class.cs (Event.Define): Change my previous commit, as this
16510 breaks the debugger. This is a temporary hack, as it seems like
16511 the compiler is generating events incorrectly to begin with.
16513 * expression.cs (Binary.ResolveOperator): Added support for
16514 "U operator - (E x, E y)"
16516 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16519 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16520 init-only variables, but this path did not take into account that
16521 there might be also instance readonly variables. Correct this
16524 This fixes bug 32253
16526 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16529 * driver.cs: Change the extension for modules to `netmodule'
16531 * cs-parser.jay: Improved slightly the location tracking for
16532 the debugger symbols.
16534 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16535 modifiers that were specified instead of the hardcoded value
16536 (FamAndAssem). This was basically ignoring the static modifier,
16537 and others. Fixes 32429.
16539 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16540 fixed a bug in the process (32476)
16542 * expression.cs (ArrayAccess.EmitAssign): Patch from
16543 hwang_rob@yahoo.ca that fixes bug 31834.3
16545 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16547 * driver.cs: Make the module extension .netmodule.
16549 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16551 * driver.cs: Report an error if the resource file is not found
16552 instead of crashing.
16554 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16555 false, like Emit does.
16557 2002-10-16 Nick Drochak <ndrochak@gol.com>
16559 * typemanager.cs: Remove unused private member. Also reported mcs
16560 bug to report this as a warning like csc.
16562 2002-10-15 Martin Baulig <martin@gnome.org>
16564 * statement.cs (Statement.Emit): Made this a virtual method; emits
16565 the line number info and calls DoEmit().
16566 (Statement.DoEmit): New protected abstract method, formerly knows
16567 as Statement.Emit().
16569 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16571 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16573 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16574 have fixed a remaining problem: not every AddXXXX was adding a
16575 fully qualified name.
16577 Now everyone registers a fully qualified name in the DeclSpace as
16578 being defined instead of the partial name.
16580 Downsides: we are slower than we need to be due to the excess
16581 copies and the names being registered this way.
16583 The reason for this is that we currently depend (on the corlib
16584 bootstrap for instance) that types are fully qualified, because
16585 we dump all the types in the namespace, and we should really have
16586 types inserted into the proper namespace, so we can only store the
16587 basenames in the defined_names array.
16589 2002-10-10 Martin Baulig <martin@gnome.org>
16591 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16592 from bug #31834, see the bug report for a testcase which is
16595 2002-10-10 Martin Baulig <martin@gnome.org>
16597 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16598 flow analysis code for this.
16600 * statement.cs (Do, While, For): Tell the flow analysis code about
16602 (FlowBranching.UsageVector): Added support for infinite loops.
16603 (Block.Resolve): Moved the dead code elimination here and use flow
16606 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16608 * class.cs (Field.Define): Catch cycles on struct type
16611 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16612 fields if the fields are static. We only need to check instance
16615 * expression.cs (As.DoResolve): Test for reference type.
16617 * statement.cs (Using.ResolveExpression): Use
16618 ConvertImplicitRequired, not ConvertImplicit which reports an
16620 (Using.ResolveLocalVariableDecls): ditto.
16622 * expression.cs (Binary.ResolveOperator): Report errors in a few
16623 places where we had to.
16625 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16627 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16629 * expression.cs: Use StoreFromPtr instead of extracting the type
16630 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16632 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16633 an enumeration value to a System.Enum, but System.Enum is not a
16634 value type, but an class type, so we need to box.
16636 (Expression.ConvertExplicit): One codepath could return
16637 errors but not flag them. Fix this. Fixes #31853
16639 * parameter.cs (Resolve): Do not allow void as a parameter type.
16641 2002-10-06 Martin Baulig <martin@gnome.org>
16643 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16644 if it's a class type and not a struct. Fixes #31815.
16646 2002-10-06 Martin Baulig <martin@gnome.org>
16648 * statement.cs: Reworked the flow analysis code a bit to make it
16649 usable for dead code elimination.
16651 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16653 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16655 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16657 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16658 to fix the test 165, will investigate deeper.
16660 2002-10-04 Martin Baulig <martin@gnome.org>
16662 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16663 finally blocks actually work.
16664 (Try.Resolve): We don't need to create a sibling for `finally' if
16665 there is no finally block.
16667 2002-10-04 Martin Baulig <martin@gnome.org>
16669 * class.cs (Constructor.Define): The default accessibility for a
16670 non-default constructor is private, not public.
16672 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16674 * class.cs (Constructor): Make AllowedModifiers public, add
16677 * cs-parser.jay: Perform the modifiers test here, as the
16678 constructor for the Constructor class usually receives a zero
16679 because of the way we create it (first we create, later we
16680 customize, and we were never checking the modifiers).
16682 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16683 is a version of LookupTypeReflection that includes the type-name
16684 cache. This can be used as a fast path for functions that know
16685 the fully qualified name and are only calling into *.GetType() to
16686 obtain a composed type.
16688 This is also used by TypeManager.LookupType during its type
16691 (LookupType): We now also track the real type name, as sometimes
16692 we can get a quey for the real type name from things like
16693 ComposedCast. This fixes bug 31422.
16695 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16696 complete type fullname, it does not have to go through the type
16697 resolution system to obtain the composed version of the type (for
16698 obtaining arrays or pointers).
16700 (Conditional.Emit): Use the EmitBoolExpression to
16701 generate nicer code, as requested by Paolo.
16703 (ArrayCreation.CheckIndices): Use the patch from
16704 hwang_rob@yahoo.ca to validate the array initializers.
16706 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16708 * class.cs (ConstructorInitializer.Emit): simplify code by using
16709 Invocation.EmitCall, and at the same time, fix the bugs in calling
16710 parent constructors that took variable arguments.
16712 * ecore.cs (Expression.ConvertNumericExplicit,
16713 Expression.ImplicitNumericConversion): Remove the code that
16714 manually wrapped decimal (InternalTypeConstructor call is now gone
16717 * expression.cs (Cast.TryReduce): Also handle decimal types when
16718 trying to perform a constant fold on the type.
16720 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16722 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16723 that only turned off an error report, and did nothing else.
16725 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16727 * driver.cs: Handle and ignore /fullpaths
16729 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16731 * expression.cs (Binary.ResolveOperator): Catch the case where
16732 DoNumericPromotions returns true,
16734 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16736 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16738 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16741 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16743 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16744 conversion exists, but it is also required that the conversion be
16745 performed. This manifested in "(Type64Enum) 2".
16747 * class.cs (TypeManager.AddMethod): The fix is not to change
16748 AddEnum, because that one was using a fully qualified name (every
16749 DeclSpace derivative does), but to change the AddMethod routine
16750 that was using an un-namespaced name. This now correctly reports
16751 the duplicated name.
16753 Revert patch until I can properly fix it. The issue
16754 is that we have a shared Type space across all namespaces
16755 currently, which is wrong.
16757 Options include making the Namespace a DeclSpace, and merge
16758 current_namespace/current_container in the parser.
16760 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16762 * cs-parser.jay: Improve error reporting when we get a different
16763 kind of expression in local_variable_type and
16764 local_variable_pointer_type.
16766 Propagate this to avoid missleading errors being reported.
16768 * ecore.cs (ImplicitReferenceConversion): treat
16769 TypeManager.value_type as a target just like object_type. As
16774 Is valid, and needs to result in the int 1 being boxed before it
16775 is assigned to the value type v.
16777 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16778 to validate the enumeration name.
16780 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16781 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16782 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16784 * ecore.cs (TryImplicitIntConversion): When doing an
16785 implicit-enumeration-conversion, check if the type is 64-bits and
16786 perform a conversion before passing to EnumConstant.
16788 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16790 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16791 report ambiguous type references. Unlike the MS version, we
16792 report what the ambiguity is. Innovation at work ;-)
16794 (DeclSpace.FindType): Require a location argument to
16795 display when we display an ambiguous error.
16797 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16799 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16801 * expression.cs (EmitDynamicInitializers): Apply patch from
16802 hwang_rob@yahoo.ca that fixes the order in which we emit our
16805 2002-09-21 Martin Baulig <martin@gnome.org>
16807 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16808 delegate takes no arguments.
16810 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16812 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16815 * expression.cs: Extract the underlying type.
16817 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16819 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16821 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16823 * class.cs (TypeContainer.DefineType): We can not use the nice
16824 PackingSize with the size set to 1 DefineType method, because it
16825 will not allow us to define the interfaces that the struct
16828 This completes the fixing of bug 27287
16830 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16831 means also structs. This fixes part of the problem.
16832 (Expresion.ImplicitReferenceConversionExists): ditto.
16834 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16835 error if there were no errors reported during the type lookup
16836 process, to avoid duplicates or redundant errors. Without this
16837 you would get an ambiguous errors plus a type not found. We have
16838 beaten the user enough with the first error.
16840 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16843 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16844 during the resolution process, stop the lookup, this avoids
16845 repeated error reports (same error twice).
16847 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16849 * typemanager.cs (LookupType): Redo the type lookup code to match
16850 the needs of System.Reflection.
16852 The issue is that System.Reflection requires references to nested
16853 types to begin with a "+" sign instead of a dot. So toplevel
16854 types look like: "NameSpace.TopLevelClass", and nested ones look
16855 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16858 2002-09-19 Martin Baulig <martin@gnome.org>
16860 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16861 says that a method always returns or always throws an exception,
16862 don't report the CS0161.
16864 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16865 set `Returns = new_returns'.
16867 2002-09-19 Martin Baulig <martin@gnome.org>
16869 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16870 to an enum constant, check for a CS0176.
16872 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16874 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16875 for operators that must be in pairs and report errors.
16877 * ecore.cs (SimpleName.DoResolveType): During the initial type
16878 resolution process, when we define types recursively, we must
16879 check first for types in our current scope before we perform
16880 lookups in the enclosing scopes.
16882 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16884 (Invocation.VerifyArgumentsCompat): Call
16885 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16886 I thought we were supposed to always call this, but there are a
16887 few places in the code where we dont do it.
16889 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16891 * driver.cs: Add support in -linkres and -resource to specify the
16892 name of the identifier.
16894 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16896 * ecore.cs (StandardConversionExists): Sync with the conversion
16897 code: allow anything-* to void* conversions.
16899 (FindMostSpecificSource): Use an Expression argument
16900 instead of a Type, because we might be handed over a Literal which
16901 gets a few more implicit conversions that plain types do not. So
16902 this information was being lost.
16904 Also, we drop the temporary type-holder expression when not
16907 2002-09-17 Martin Baulig <martin@gnome.org>
16909 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16910 this is an explicit interface implementation.
16912 2002-09-17 Martin Baulig <martin@gnome.org>
16914 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16915 different `IndexerName' attributes.
16917 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16918 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16919 virtual CommonResolve().
16921 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16923 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16924 and convert that to the UnderlyingType.
16926 * statement.cs (Foreach.Resolve): Indexers are just like variables
16927 or PropertyAccesses.
16929 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16930 inside quoted strings, we were not doing this before.
16932 2002-09-16 Martin Baulig <martin@gnome.org>
16934 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16935 resolve it. This is needed for the definite assignment check of the
16936 instance expression, fixes bug #29846.
16937 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16939 2002-09-16 Nick Drochak <ndrochak@gol.com>
16941 * parameter.cs: Fix compile error. Cannot reference static member
16942 from an instance object. Is this an mcs bug?
16944 2002-09-14 Martin Baulig <martin@gnome.org>
16946 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16947 multiple times. Fixes bug #30295, added test-166.cs.
16949 2002-09-14 Martin Baulig <martin@gnome.org>
16951 * statement.cs (Block.Emit): Don't emit unreachable code.
16952 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16953 `break' statements.
16954 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16956 2002-09-14 Martin Baulig <martin@gnome.org>
16958 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16961 2002-09-14 Martin Baulig <martin@gnome.org>
16963 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16964 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16965 be false on the ms runtime.
16967 2002-09-13 Martin Baulig <martin@gnome.org>
16969 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16970 the CS0038 error message.
16972 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16974 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16975 constant inside, return it.
16977 2002-09-12 Martin Baulig <martin@gnome.org>
16979 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16980 implicit conversion can be done between enum types.
16982 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16983 check whether an implicit conversion to the current enum's UnderlyingType
16984 exists and report an error if not.
16986 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16987 without debugging support.
16989 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16990 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16992 2002-09-12 Martin Baulig <martin@gnome.org>
16994 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16996 * ecore.cs (IMemberExpr.DeclaringType): New property.
16997 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16998 nonstatic member of an outer type (CS0038).
17000 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17002 * driver.cs: Activate the using-error detector at warning level
17003 4 (at least for MS-compatible APIs).
17005 * namespace.cs (VerifyUsing): Small buglett fix.
17007 * pending.cs (PendingImplementation): pass the container pointer.
17009 * interface.cs (GetMethods): Allow for recursive definition. Long
17010 term, I would like to move every type to support recursive
17011 definitions, not the current ordering mechanism that we have right
17014 The situation is this: Attributes are handled before interfaces,
17015 so we can apply attributes to interfaces. But some attributes
17016 implement interfaces, we will now handle the simple cases
17017 (recursive definitions will just get an error).
17019 * parameter.cs: Only invalidate types at the end if we fail to
17022 2002-09-09 Martin Baulig <martin@gnome.org>
17024 * ecore.cs (PropertyExpr.Emit): Also check for
17025 TypeManager.system_int_array_get_length so this'll also work when
17026 compiling corlib. Fixes #30003.
17028 2002-09-09 Martin Baulig <martin@gnome.org>
17030 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17031 and throw an exception if we can't get the type's size. Fixed #30040,
17034 2002-09-09 Martin Baulig <martin@gnome.org>
17036 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17038 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17039 context. Fixes bug #30027.
17041 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17042 virtual functions. Fixes bug #30043, added test-164.cs.
17044 2002-09-08 Ravi Pratap <ravi@ximian.com>
17046 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17048 2002-09-08 Nick Drochak <ndrochak@gol.com>
17050 * driver.cs: Use an object to get the windows codepage since it's not a
17053 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17055 * statement.cs (For.Emit): for infinite loops (test == null)
17056 return whether there is a break inside, not always "true".
17058 * namespace.cs (UsingEntry): New struct to hold the name of the
17059 using definition, the location where it is defined, and whether it
17060 has been used in a successful type lookup.
17062 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17067 2002-09-06 Ravi Pratap <ravi@ximian.com>
17069 * attribute.cs : Fix incorrect code which relied on catching
17070 a NullReferenceException to detect a null being passed in
17071 where an object was expected.
17073 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17075 * statement.cs (Try): flag the catch variable as assigned
17077 * expression.cs (Cast): Simplified by using ResolveType instead of
17078 manually resolving.
17080 * statement.cs (Catch): Fix bug by using ResolveType.
17082 2002-09-06 Ravi Pratap <ravi@ximian.com>
17084 * expression.cs (BetterConversion): Special case for when we have
17085 a NullLiteral as the argument and we have to choose between string
17086 and object types - we choose string the way csc does.
17088 * attribute.cs (Attribute.Resolve): Catch the
17089 NullReferenceException and report error #182 since the Mono
17090 runtime no more has the bug and having this exception raised means
17091 we tried to select a constructor which takes an object and is
17094 2002-09-05 Ravi Pratap <ravi@ximian.com>
17096 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17097 message (1502, 1503) when we can't locate a method after overload
17098 resolution. This is much more informative and closes the bug
17101 * interface.cs (PopulateMethod): Return if there are no argument
17102 types. Fixes a NullReferenceException bug.
17104 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17105 expressions too. Previously we were checking only in one place for
17106 positional arguments leaving out named arguments.
17108 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17109 type to the enum type is not allowed. Remove code corresponding to
17112 (ConvertNumericExplicit): Allow explicit conversions from
17113 the underlying type to enum type. This precisely follows the spec
17114 and closes a bug filed by Gonzalo.
17116 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17119 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17121 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17123 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17124 it was important that we stored the right value after the
17125 reduction in `converted'.
17127 2002-09-04 Martin Baulig <martin@gnome.org>
17129 * location.cs (Location.SymbolDocument): Use full pathnames for the
17132 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17134 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17135 of the expression resolve mechanism, because that will catch the
17136 SimpleName error failures.
17138 (Conditional): If we can not resolve the
17139 expression, return, do not crash.
17141 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17144 (location): display token name instead of its number.
17146 2002-08-28 Martin Baulig <martin@gnome.org>
17148 * expression.cs (Binary.ResolveOperator): Don't silently return
17149 but return an error if an operator cannot be applied between two
17152 2002-08-28 Martin Baulig <martin@gnome.org>
17154 * class.cs (Constructor.Define): Set the permission attributes
17155 correctly instead of making all constructors public.
17157 2002-08-28 Martin Baulig <martin@gnome.org>
17159 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17160 for private members before reporting a CS0103; if we find anything,
17163 2002-08-28 Martin Baulig <martin@gnome.org>
17165 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17166 to check whether `closure_start_type == closure_invocation_type',
17167 we also need to check whether `m.DeclaringType == closure_invocation_type'
17168 before bypassing the permission checks. We might be accessing
17169 protected/private members from the base class.
17170 (TypeManager.RealMemberLookup): Only set private_ok if private
17171 members were requested via BindingFlags.NonPublic.
17173 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17175 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17176 MethodGroupExpr.IsExplicitImpl if appropriate.
17177 (Invocation.DoResolve): Don't report the CS0120 for explicit
17178 interface implementations.
17180 2002-08-27 Martin Baulig <martin@gnome.org>
17182 * expression.cs (Invocation.DoResolve): If this is a static
17183 method and we don't have an InstanceExpression, we must report
17186 2002-08-25 Martin Baulig <martin@gnome.org>
17188 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17189 `==' between a valuetype and an object.
17191 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17193 * ecore.cs (TypeExpr): Provide a ToString method.
17195 2002-08-24 Martin Baulig <martin@gnome.org>
17197 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17198 now called proggie.dbg and it's a binary file.
17200 2002-08-23 Martin Baulig <martin@gnome.org>
17202 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17204 2002-08-23 Martin Baulig <martin@gnome.org>
17206 * struct.cs (MyStructInfo.ctor): Make this work with empty
17207 structs; it's not allowed to use foreach() on null.
17209 2002-08-23 Martin Baulig <martin@gnome.org>
17211 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17212 writer the full pathname of the generated assembly.
17214 2002-08-23 Martin Baulig <martin@gnome.org>
17216 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17217 A `finally' block never returns or breaks; improved handling of
17220 2002-08-23 Martin Baulig <martin@gnome.org>
17222 * statement.cs (Throw.Resolve): Allow `throw null'.
17224 2002-08-23 Martin Baulig <martin@gnome.org>
17226 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17227 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17228 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17229 MemberLookup would return a wrong event if this is an explicit
17230 interface implementation and the class has an event with the same
17233 2002-08-23 Martin Baulig <martin@gnome.org>
17235 * statement.cs (Block.AddChildVariableNames): New public method.
17236 (Block.AddChildVariableName): Likewise.
17237 (Block.IsVariableNameUsedInChildBlock): Likewise.
17238 (Block.AddVariable): Check whether a variable name has already
17239 been used in a child block.
17241 * cs-parser.jay (declare_local_variables): Mark all variable names
17242 from the current block as being used in a child block in the
17245 2002-08-23 Martin Baulig <martin@gnome.org>
17247 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17248 find the symbol writer.
17250 * driver.cs: csc also allows the arguments to /define being
17251 separated by commas, not only by semicolons.
17253 2002-08-23 Martin Baulig <martin@gnome.org>
17255 * interface.cs (Interface.GetMembers): Added static check for events.
17257 2002-08-15 Martin Baulig <martin@gnome.org>
17259 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17260 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17262 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17263 why the MethodData.EmitDestructor() change was necessary.
17265 2002-08-20 Martin Baulig <martin@gnome.org>
17267 * class.cs (TypeContainer.FindMembers): Added static check for events.
17269 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17271 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17272 use Type.GetEvents(), not Type.FindMembers().
17274 2002-08-20 Martin Baulig <martin@gnome.org>
17276 * decl.cs (MemberCache): Added a special method cache which will
17277 be used for method-only searched. This ensures that a method
17278 search will return a MethodInfo with the correct ReflectedType for
17281 2002-08-20 Martin Baulig <martin@gnome.org>
17283 * decl.cs (DeclSpace.FindMembers): Made this public.
17285 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17287 * delegate.cs: fixed build on windows.
17288 [FIXME: Filed as bug #29150: MCS must report these errors.]
17290 2002-08-19 Ravi Pratap <ravi@ximian.com>
17292 * ecore.cs (StandardConversionExists): Return a false
17293 if we are trying to convert the void type to anything else
17294 since that is not allowed.
17296 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17297 we flag error 70 in the event an event is trying to be accessed
17298 directly from outside the declaring type.
17300 2002-08-20 Martin Baulig <martin@gnome.org>
17302 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17303 MemberCache from typemanager.cs to decl.cs.
17305 2002-08-19 Martin Baulig <martin@gnome.org>
17307 * class.cs (TypeContainer): Implement IMemberContainer.
17308 (TypeContainer.DefineMembers): Create the MemberCache.
17309 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17310 return public members if BindingFlags.Public was given, check
17311 whether members are static.
17313 2002-08-16 Martin Baulig <martin@gnome.org>
17315 * decl.cs (DeclSpace.Define): Splitted this in Define and
17316 DefineMembers. DefineMembers is called first and initializes the
17319 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17320 DefineMembers() on all our DeclSpaces.
17322 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17323 but call DefineMembers() on all nested interfaces. We call their
17324 Define() in our new Define() function.
17326 * interface.cs (Interface): Implement IMemberContainer.
17327 (Interface.Define): Moved all code except the attribute stuf to
17329 (Interface.DefineMembers): Initialize the member cache.
17331 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17332 need this anymore since we can use MemberCache.FindMembers directly.
17334 2002-08-19 Martin Baulig <martin@gnome.org>
17336 * typemanager.cs (MemberCache): When creating the cache for an
17337 interface type, add all inherited members.
17338 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17339 to `out bool used_cache' and documented it.
17340 (TypeManager.MemberLookup): If we already used the cache in the first
17341 iteration, we don't need to do the interfaces check.
17343 2002-08-19 Martin Baulig <martin@gnome.org>
17345 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17346 here from IMemberFinder and don't implement this interface anymore.
17347 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17349 * typemanager.cs (IMemberFinder): This interface is now only used by
17350 classes which actually support the member cache.
17351 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17352 since we only put DeclSpaces into this Hashtable.
17353 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17354 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17356 2002-08-16 Martin Baulig <martin@gnome.org>
17358 * typemanager.cs (ICachingMemberFinder): Removed.
17359 (IMemberFinder.MemberCache): New property.
17360 (TypeManager.FindMembers): Merged this with RealFindMembers().
17361 This function will never be called from TypeManager.MemberLookup()
17362 so we can't use the cache here, just the IMemberFinder.
17363 (TypeManager.MemberLookup_FindMembers): Check whether the
17364 IMemberFinder has a MemberCache and call the cache's FindMembers
17366 (MemberCache): Rewrote larger parts of this yet another time and
17367 cleaned it up a bit.
17369 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17371 * driver.cs (LoadArgs): Support quoting.
17373 (Usage): Show the CSC-like command line arguments.
17375 Improved a few error messages.
17377 2002-08-15 Martin Baulig <martin@gnome.org>
17379 * typemanager.cs (IMemberContainer.Type): New property.
17380 (IMemberContainer.IsInterface): New property.
17382 The following changes are conditional to BROKEN_RUNTIME, which is
17383 defined at the top of the file.
17385 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17386 class'es members, but add all members from TypeHandle.ObjectType
17387 if we're an interface.
17388 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17389 is the current type.
17390 (MemberCache.CacheEntry.Container): Removed this field.
17391 (TypeHandle.GetMembers): Include inherited members.
17393 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17395 * typemanager.cs: fixed compilation and added a comment on a field that
17398 2002-08-15 Martin Baulig <martin@gnome.org>
17400 * class.cs (ConstructorInitializer.Resolve): In the
17401 Expression.MemberLookup call, use the queried_type as
17404 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17405 declared' attribute, it's always true.
17406 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17407 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17408 temporary wrapper for FindMembers which tells MemberLookup whether
17409 members from the base classes are included in the return value.
17410 This will go away soon.
17411 (TypeManager.MemberLookup): Use this temporary hack here; once the
17412 new MemberCache is completed, we don't need to do the DeclaredOnly
17413 looping here anymore since the MemberCache will take care of this.
17414 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17415 (MemberCache): When creating the MemberCache for a class, get
17416 members from the current class and all its base classes.
17417 (MemberCache.CacheEntry.Container): New field. This is a
17418 temporary hack until the Mono runtime is fixed to distinguish
17419 between ReflectedType and DeclaringType. It allows us to use MCS
17420 with both the MS runtime and the unfixed Mono runtime without
17421 problems and without accecting performance.
17422 (MemberCache.SearchMembers): The DeclaredOnly looping from
17423 TypeManager.MemberLookup is now done here.
17425 2002-08-14 Martin Baulig <martin@gnome.org>
17427 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17428 Type.GetFields on dynamic types but get the fields from the
17429 corresponding TypeContainer.
17430 (MyStructInfo.GetStructInfo): Added check for enum types.
17432 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17433 (MemberList.SyncRoot): Implemented.
17434 (TypeManager.FilterWithClosure): No need to check permissions if
17435 closure_start_type == closure_invocation_type, don't crash if
17436 closure_invocation_type is null.
17438 2002-08-13 Martin Baulig <martin@gnome.org>
17440 Rewrote TypeContainer.FindMembers to use a member cache. This
17441 gives us a speed increase of about 35% for the self-hosting MCS
17442 build and of about 15-20% for the class libs (both on GNU/Linux).
17444 * report.cs (Timer): New class to get enhanced profiling. This
17445 whole class is "TIMER" conditional since it remarkably slows down
17448 * class.cs (MemberList): New class. This is an IList wrapper
17449 which we're now using instead of passing MemberInfo[]'s around to
17450 avoid copying this array unnecessarily.
17451 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17452 (ICachingMemberFinder, IMemberContainer): New interface.
17453 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17454 has already been checked, otherwise use it for the name comparision.
17455 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17456 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17457 if possible. Returns a MemberList, not a MemberInfo [].
17458 (TypeHandle): New class, implements IMemberContainer. We create
17459 one instance of this class per type, it contains a MemberCache
17460 which is used to do the member lookups.
17461 (MemberCache): New class. Each instance of this class contains
17462 all members of a type and a name-based hash table.
17463 (MemberCache.FindMembers): This is our new member lookup
17464 function. First, it looks up all members of the requested name in
17465 the hash table. Then, it walks this list and sorts out all
17466 applicable members and returns them.
17468 2002-08-13 Martin Baulig <martin@gnome.org>
17470 In addition to a nice code cleanup, this gives us a performance
17471 increase of about 1.4% on GNU/Linux - not much, but it's already
17472 half a second for the self-hosting MCS compilation.
17474 * typemanager.cs (IMemberFinder): New interface. It is used by
17475 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17476 Enum, Delegate or Interface.
17477 (TypeManager.finder_to_member_finder): New PtrHashtable.
17478 (TypeManager.finder_to_container): Removed.
17479 (TypeManager.finder_to_delegate): Removed.
17480 (TypeManager.finder_to_interface): Removed.
17481 (TypeManager.finder_to_enum): Removed.
17483 * interface.cs (Interface): Implement IMemberFinder.
17485 * delegate.cs (Delegate): Implement IMemberFinder.
17487 * enum.cs (Enum): Implement IMemberFinder.
17489 * class.cs (TypeContainer): Implement IMemberFinder.
17491 2002-08-12 Martin Baulig <martin@gnome.org>
17493 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17495 2002-08-12 Martin Baulig <martin@gnome.org>
17497 * ecore.cs (ITypeExpression): New interface for expressions which
17499 (TypeExpression): Renamed to TypeLookupExpression.
17500 (Expression.DoResolve): If we're doing a types-only lookup, the
17501 expression must implement the ITypeExpression interface and we
17502 call DoResolveType() on it.
17503 (SimpleName): Implement the new ITypeExpression interface.
17504 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17505 hack, the situation that we're only looking up types can't happen
17506 anymore when this method is called. Moved the type lookup code to
17507 DoResolveType() and call it.
17508 (SimpleName.DoResolveType): This ITypeExpression interface method
17509 is now doing the types-only lookup.
17510 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17511 (ResolveFlags): Added MaskExprClass.
17513 * expression.cs (MemberAccess): Implement the ITypeExpression
17515 (MemberAccess.DoResolve): Added support for a types-only lookup
17516 when we're called via ITypeExpression.DoResolveType().
17517 (ComposedCast): Implement the ITypeExpression interface.
17519 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17520 Expression.Resolve() with ResolveFlags.Type instead.
17522 2002-08-12 Martin Baulig <martin@gnome.org>
17524 * interface.cs (Interface.Define): Apply attributes.
17526 * attribute.cs (Attribute.ApplyAttributes): Added support for
17527 interface attributes.
17529 2002-08-11 Martin Baulig <martin@gnome.org>
17531 * statement.cs (Block.Emit): Only check the "this" variable if we
17532 do not always throw an exception.
17534 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17535 whether the property has a set accessor.
17537 2002-08-11 Martin Baulig <martin@gnome.org>
17539 Added control flow analysis support for structs.
17541 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17542 with control flow analysis turned off.
17543 (IVariable): New interface.
17544 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17545 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17546 (FieldExpr.DoResolve): Resolve the instance expression with flow
17547 analysis turned off and do the definite assignment check after the
17548 resolving when we know what the expression will resolve to.
17550 * expression.cs (LocalVariableReference, ParameterReference):
17551 Implement the new IVariable interface, only call the flow analysis
17552 code if ec.DoFlowAnalysis is true.
17553 (This): Added constructor which takes a Block argument. Implement
17554 the new IVariable interface.
17555 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17556 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17557 This does the definite assignment checks for struct members.
17559 * class.cs (Constructor.Emit): If this is a non-static `struct'
17560 constructor which doesn't have any initializer, call
17561 Block.AddThisVariable() to tell the flow analysis code that all
17562 struct elements must be initialized before control returns from
17565 * statement.cs (MyStructInfo): New public class.
17566 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17567 argument to this indexer. If non-zero, check an individual struct
17568 member, not the whole struct.
17569 (FlowBranching.CheckOutParameters): Check struct members.
17570 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17571 overloaded versions of these methods which take an additional
17572 `int field_idx' argument to check struct members.
17573 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17574 overloaded versions of these methods which take an additional
17575 `string field_name' argument to check struct member.s
17576 (VariableInfo): Implement the IVariable interface.
17577 (VariableInfo.StructInfo): New public property. Returns the
17578 MyStructInfo instance of the variable if it's a struct or null.
17579 (Block.AddThisVariable): New public method. This is called from
17580 Constructor.Emit() for non-static `struct' constructor which do
17581 not have any initializer. It creates a special variable for the
17582 "this" instance variable which will be checked by the flow
17583 analysis code to ensure that all of the struct's fields are
17584 initialized before control returns from the constructor.
17585 (UsageVector): Added support for struct members. If a
17586 variable/parameter is a struct with N members, we reserve a slot
17587 in the usage vector for each member. A struct is considered fully
17588 initialized if either the struct itself (slot 0) or all its
17589 members are initialized.
17591 2002-08-08 Martin Baulig <martin@gnome.org>
17593 * driver.cs (Driver.MainDriver): Only report an error CS5001
17594 if there were no compilation errors.
17596 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17597 `UnsafeContext' property to determine whether the parent is in
17598 unsafe context rather than checking the parent's ModFlags:
17599 classes nested in an unsafe class are unsafe as well.
17601 2002-08-08 Martin Baulig <martin@gnome.org>
17603 * statement.cs (UsageVector.MergeChildren): Distinguish between
17604 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17605 we return. Added test17() and test18() to test-154.cs.
17607 2002-08-08 Martin Baulig <martin@gnome.org>
17609 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17610 Family access, make sure the invoking type isn't a subclass of the
17611 queried type (that'd be a CS1540).
17613 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17614 this method which takes an additional `Type invocation_type'.
17616 * expression.cs (BaseAccess.DoResolve): Use the base type as
17617 invocation and query type.
17618 (MemberAccess.DoResolve): If the lookup failed and we're about to
17619 report a CS0122, try a lookup with the ec.ContainerType - if this
17620 succeeds, we must report a CS1540.
17622 2002-08-08 Martin Baulig <martin@gnome.org>
17624 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17625 (MethodGroupExpr): Implement the IMemberExpr interface.
17627 * expression (MemberAccess.ResolveMemberAccess): No need to have
17628 any special code for MethodGroupExprs anymore, they're now
17631 2002-08-08 Martin Baulig <martin@gnome.org>
17633 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17634 Family, FamANDAssem and FamORAssem permissions.
17635 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17637 2002-08-08 Martin Baulig <martin@gnome.org>
17639 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17640 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17643 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17645 * driver.cs: implemented /resource option to embed managed resources.
17647 2002-08-07 Martin Baulig <martin@gnome.org>
17649 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17650 (FieldBase.HasFieldInitializer): New public property.
17651 (FieldBase.GetInitializerExpression): New public method. Resolves and
17652 returns the field initializer and makes sure it is only resolved once.
17653 (TypeContainer.EmitFieldInitializers): Call
17654 FieldBase.GetInitializerExpression to get the initializer, this ensures
17655 that it isn't resolved multiple times.
17657 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17658 the resolving process (SimpleName/MemberLookup) that we're currently
17659 emitting a field initializer (which must not access any instance members,
17660 this is an error CS0236).
17662 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17663 argument, if the `IsFieldInitializer' flag is set, we must report and
17664 error CS0236 and not an error CS0120.
17666 2002-08-07 Martin Baulig <martin@gnome.org>
17668 * ecore.cs (IMemberExpr): New public interface.
17669 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17670 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17671 if the expression is an IMemberExpr.
17673 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17674 to be null, implicitly default to `this' if we're non-static in
17675 this case. Simplified the code a lot by using the new IMemberExpr
17676 interface. Also fixed bug #28176 here.
17678 2002-08-06 Martin Baulig <martin@gnome.org>
17680 * cs-parser.jay (SimpleLookup): Removed. We need to create
17681 ParameterReferences during semantic analysis so that we can do a
17682 type-only search when resolving Cast, TypeOf and SizeOf.
17683 (block): Pass the `current_local_parameters' to the Block's
17686 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17687 argument to the constructor.
17688 (ConstructorInitializer.Resolve): Create a temporary implicit
17689 block with the parameters.
17691 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17692 references here if we aren't doing a type-only search.
17694 * statement.cs (Block): Added constructor which takes a
17695 `Parameters parameters' argument.
17696 (Block.Parameters): New public property.
17698 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17699 to `Parameters' and made it public readonly.
17701 2002-08-06 Martin Baulig <martin@gnome.org>
17703 * ecore.cs (Expression.Warning): Made this public as well.
17705 * report.cs (Report.Debug): Print the contents of collections.
17707 2002-08-06 Martin Baulig <martin@gnome.org>
17709 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17710 used to tell Resolve() which kinds of expressions it may return.
17711 (Expression.Resolve): Added overloaded version of this method which
17712 takes a `ResolveFlags flags' argument. This can be used to tell
17713 Resolve() which kinds of expressions it may return. Reports a
17715 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17716 ResolveFlags.SimpleName.
17717 (Expression.Error118): Added overloaded version of this method which
17718 takes a `ResolveFlags flags' argument. It uses the flags to determine
17719 which kinds of expressions are allowed.
17721 * expression.cs (Argument.ResolveMethodGroup): New public method.
17722 Resolves an argument, but allows a MethodGroup to be returned.
17723 This is used when invoking a delegate.
17725 * TODO: Updated a bit.
17727 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17729 Fixed compilation with csc.
17731 * ecore.cs: Expression.Error made public. Is this correct? Should
17732 Warning be made public too?
17734 * expression.cs: use ea.Location instead of ea.loc.
17735 [FIXME: Filed as bug #28607: MCS must report these errors.]
17737 2002-08-06 Martin Baulig <martin@gnome.org>
17739 * ecore.cs (Expression.loc): Moved the location here instead of
17740 duplicating it in all derived classes.
17741 (Expression.Location): New public property.
17742 (Expression.Error, Expression.Warning): Made them non-static and
17743 removed the location argument.
17744 (Expression.Warning): Added overloaded version which takes an
17745 `int level' argument.
17746 (Expression.Error118): Make this non-static and removed the
17747 expression and location arguments.
17748 (TypeExpr): Added location argument to the constructor.
17750 * expression.cs (StaticCallExpr): Added location argument to
17752 (Indirection, PointerArithmetic): Likewise.
17753 (CheckedExpr, UnCheckedExpr): Likewise.
17754 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17755 (StringPtr): Likewise.
17758 2002-08-05 Martin Baulig <martin@gnome.org>
17760 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17762 * assign.cs (Assign.DoResolve): Check whether the source
17763 expression is a value or variable.
17765 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17766 while resolving the corresponding blocks.
17768 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17769 an error, don't silently return null.
17771 * statement.cs (Block.AddVariable): Do the error reporting here
17772 and distinguish between CS0128 and CS0136.
17773 (Block.DoResolve): Report all unused labels (warning CS0164).
17774 (LabeledStatement): Pass the location to the constructor.
17775 (LabeledStatement.HasBeenReferenced): New property.
17776 (LabeledStatement.Resolve): Set it to true here.
17778 * statement.cs (Return.Emit): Return success even after reporting
17779 a type mismatch error (CS0126 or CS0127), this is what csc does and
17780 it avoids confusing the users with any consecutive errors.
17782 2002-08-05 Martin Baulig <martin@gnome.org>
17784 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17786 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17788 * expression.cs (MemberAccess.DoResolve): Silently return if an
17789 error has already been reported.
17791 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17792 error has already been reported.
17794 2002-08-05 Martin Baulig <martin@gnome.org>
17796 * statement.cs (UsageVector): Only initialize the `parameters'
17797 vector if we actually have any "out" parameters.
17799 2002-08-05 Martin Baulig <martin@gnome.org>
17801 * expression.cs (Binary.ResolveOperator): When combining delegates,
17802 they must have the same type.
17804 2002-08-05 Martin Baulig <martin@gnome.org>
17806 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17807 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17808 work with the ms runtime and we also don't need it: if we're a
17809 PropertyBuilder and not in the `indexer_arguments' hash, then we
17810 are a property and not an indexer.
17812 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17813 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17814 since the latter one doesn't work with the ms runtime.
17816 2002-08-03 Martin Baulig <martin@gnome.org>
17818 Fixed bugs #27998 and #22735.
17820 * class.cs (Method.IsOperator): New public field.
17821 (Method.CheckBase): Report CS0111 if there's already a method
17822 with the same parameters in the current class. Report CS0508 when
17823 attempting to change the return type of an inherited method.
17824 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17825 and it's not marked abstract or extern.
17826 (PropertyBase): New abstract base class for Property and Indexer.
17827 (PropertyBase.CheckBase): Moved here from Property and made it work
17829 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17830 the same so we can reuse it there.
17831 (Property, Indexer): Derive from PropertyBase.
17832 (MethodSignature.inheritable_property_signature_filter): New delegate
17833 to find properties and indexers.
17835 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17836 argument and improved error reporting.
17838 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17839 EmptyReadOnlyParameters and made it a property.
17841 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17842 version of this method which takes a `PropertyInfo indexer'.
17843 (TypeManager.RegisterIndexer): New method.
17845 * class.cs: Added myself as author of this file :-)
17847 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17849 * class.cs: fixed compilation on windoze.
17851 2002-08-03 Martin Baulig <martin@gnome.org>
17853 * interface.cs (Interface.GetInterfaceBases): Check whether all
17854 base interfaces are at least as accessible than the current one.
17856 * class.cs (TypeContainer.GetClassBases): Check whether base types
17857 are at least as accessible than the current type.
17858 (TypeContainer.AsAccessible): Implemented and made non-static.
17859 (MemberBase.CheckParameters): Report errors if the accessibility
17862 * delegate.cs (Delegate.Delegate): The default visibility is
17863 internal for top-level types and private for nested types.
17864 (Delegate.Define): Report errors if the accessibility checks fail.
17866 * enum.cs (Enum.Enum): The default visibility is internal for
17867 top-level types and private for nested types.
17868 (Enum.DefineType): Compute the correct visibility.
17870 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17871 function which takes a `bool is_toplevel' instead of a TypeContainer.
17873 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17876 2002-08-02 Martin Baulig <martin@gnome.org>
17878 * expression.cs (LocalVariableReferenc): Added constructor which
17879 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17880 (LocalVariableReference.IsReadOnly): New property.
17881 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17882 variable is readonly, use our own readonly flag to do this; you can
17883 use the new constructor to get a writable reference to a read-only
17886 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17887 reference to the local variable.
17889 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17891 * rootcontext.cs (ResolveCore): Also include System.Exception
17893 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17894 we reach an EmptyStatement.
17896 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17899 * expression.cs (Binary.ResolveOperator): Check error result in
17902 use brtrue/brfalse directly and avoid compares to null.
17904 2002-08-02 Martin Baulig <martin@gnome.org>
17906 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17907 Fixes bug #28407, added test-155.cs.
17909 2002-08-01 Martin Baulig <martin@gnome.org>
17911 * class.cs (Event.EmitDefaultMethod): Make this work with static
17912 events. Fixes #28311, added verify-3.cs.
17914 2002-08-01 Martin Baulig <martin@gnome.org>
17916 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17917 `is_disposable' fields.
17918 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17919 `hm.is_disposable' if we're using the collection pattern.
17920 (Foreach.EmitCollectionForeach): Use the correct type for the
17921 enumerator's local variable, only emit the try/finally block if
17922 necessary (fixes #27713).
17924 2002-08-01 Martin Baulig <martin@gnome.org>
17926 * ecore.cs (Expression.report118): Renamed to Error118 and made
17929 * statement.cs (Throw.Resolve): Check whether the expression is of
17930 the correct type (CS0118) and whether the type derives from
17931 System.Exception (CS0155).
17932 (Catch.Resolve): New method. Do the type lookup here and check
17933 whether it derives from System.Exception (CS0155).
17934 (Catch.CatchType, Catch.IsGeneral): New public properties.
17936 * typemanager.cs (TypeManager.exception_type): Added.
17938 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17940 * driver.cs: Updated About function.
17942 2002-07-31 Martin Baulig <martin@gnome.org>
17944 Implemented Control Flow Analysis.
17946 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17947 (EmitContext.CurrentBranching): Added.
17948 (EmitContext.StartFlowBranching): Added.
17949 (EmitContext.EndFlowBranching): Added.
17950 (EmitContext.KillFlowBranching): Added.
17951 (EmitContext.IsVariableAssigned): Added.
17952 (EmitContext.SetVariableAssigned): Added.
17953 (EmitContext.IsParameterAssigned): Added.
17954 (EmitContext.SetParameterAssigned): Added.
17955 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17956 Added control flow analysis stuff here.
17958 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17959 resolve the expression as lvalue.
17960 (LocalVariableReference.DoResolve): Check whether the variable has
17961 already been assigned.
17962 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17963 the parameter as assigned here.
17964 (ParameterReference.DoResolve): Check whether the parameter has already
17966 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17967 expression as lvalue.
17969 * statement.cs (FlowBranching): New class for the flow analysis code.
17970 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17971 (LabeledStatement.IsDefined): New public property.
17972 (LabeledStatement.AddUsageVector): New public method to tell flow
17973 analyis that the label may be reached via a forward jump.
17974 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17976 (VariableInfo.Number): New public field. This is used by flow analysis
17977 to number all locals of a block.
17978 (Block.CountVariables): New public property. This is the number of
17979 local variables in this block (including the locals from all parent
17981 (Block.EmitMeta): Number all the variables.
17983 * statement.cs: Added flow analysis support to all classes.
17985 2002-07-31 Martin Baulig <martin@gnome.org>
17987 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17988 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17989 then use this argument.
17991 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17993 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17994 use this to specify /define options.
17996 2002-07-29 Martin Baulig <martin@gnome.org>
17998 * statement.cs (Fixed): Moved all code that does variable lookups
17999 and resolvings from Emit to Resolve.
18001 * statement.cs (For): Moved all code that does variable lookups
18002 and resolvings from Emit to Resolve.
18004 * statement.cs (Using): Moved all code that does variable lookups
18005 and resolvings from Emit to Resolve.
18007 2002-07-29 Martin Baulig <martin@gnome.org>
18009 * attribute.cs (Attribute.Resolve): Explicitly catch a
18010 System.NullReferenceException when creating the
18011 CustromAttributeBuilder and report a different warning message.
18013 2002-07-29 Martin Baulig <martin@gnome.org>
18015 * support.cs (ParameterData.ParameterName): Added method to
18016 get the name of a parameter.
18018 * typemanager.cs (TypeManager.IsValueType): New public method.
18020 2002-07-29 Martin Baulig <martin@gnome.org>
18022 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18023 is a flag which specifies that it's either ref or out.
18024 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18025 the out parameter to `out Parameter.Modifier mod', also set the
18026 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18028 * support.cs (InternalParameters.ParameterModifier): Distinguish
18029 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18030 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18032 * expression.cs (Argument.GetParameterModifier): Distinguish
18033 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18034 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18036 2002-07-29 Martin Baulig <martin@gnome.org>
18038 * expression.cs (ParameterReference.ParameterReference): Added
18039 `Location loc' argument to the constructor.
18041 * cs-parser.jay: Pass location to ParameterReference.
18043 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18045 * statement.cs (Try): Initialize the location.
18047 * cs-parser.jay: pass location to Try.
18049 * expression.cs (Unary.Reduce): Change the prototype to return
18050 whether a constant fold could be performed or not. The result is
18051 returned in an out parameters. In the case of Indirection and
18052 AddressOf, we want to perform the full tests.
18054 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18056 * statement.cs (Statement.Emit): Flag dead code.
18058 2002-07-27 Andrew Birkett <andy@nobugs.org>
18060 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18062 2002-07-27 Martin Baulig <martin@gnome.org>
18064 * class.cs (MethodData.Define): Put back call to
18065 TypeManager.AddMethod(), accidentally commented this out.
18067 * report.cs (Debug): New public method to print debugging information,
18068 this is `[Conditional ("DEBUG")]'.
18070 2002-07-26 Martin Baulig <martin@gnome.org>
18072 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18073 (switch_statement): Push the current_block to the switch_stack and
18074 pop it again when we're done with the switch.
18075 (switch_section): The new block is a child of the current_block.
18076 Fixes bug #24007, added test-152.cs.
18078 2002-07-27 Martin Baulig <martin@gnome.org>
18080 * expression.cs (Invocation.EmitArguments): When calling a varargs
18081 function with only its fixed arguments, we need to pass an empty
18084 2002-07-27 Martin Baulig <martin@gnome.org>
18086 Mono 0.13 has been released.
18088 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18090 * driver.cs: Rename --resource to --linkres, because that is what
18091 we do currently, we dont support --resource yet.
18093 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18095 2002-07-25 Martin Baulig <martin@gnome.org>
18097 * class.cs (MethodData): New public class. This is a `method builder'
18098 class for a method or one accessor of a Property/Indexer/Event.
18099 (MethodData.GetMethodFlags): Moved here from MemberBase.
18100 (MethodData.ApplyAttributes): Likewise.
18101 (MethodData.ApplyObsoleteAttribute): Likewise.
18102 (MethodData.ApplyConditionalAttribute): Likewise.
18103 (MethodData.ApplyDllImportAttribute): Likewise.
18104 (MethodData.CheckAbstractAndExternal): Likewise.
18105 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18106 (MethodData.Emit): Formerly known as Method.Emit().
18107 (MemberBase): Moved everything which was specific to a single
18108 accessor/method to MethodData.
18109 (Method): Create a new MethodData and call Define() and Emit() on it.
18110 (Property, Indexer, Event): Create a new MethodData objects for each
18111 accessor and call Define() and Emit() on them.
18113 2002-07-25 Martin Baulig <martin@gnome.org>
18115 Made MethodCore derive from MemberBase to reuse the code from there.
18116 MemberBase now also checks for attributes.
18118 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18119 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18121 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18122 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18123 (MemberBase.ApplyAttributes): New virtual method; applies the
18124 attributes to a method or accessor.
18125 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18126 (MemberBase.ApplyConditionalAttribute): Likewise.
18127 (MemberBase.ApplyDllImportAttribute): Likewise.
18128 (MemberBase.CheckAbstractAndExternal): Likewise.
18129 (MethodCore.ParameterTypes): This is now a property instead of a
18130 method, it's initialized from DoDefineParameters().
18131 (MethodCore.ParameterInfo): Removed the set accessor.
18132 (MethodCore.DoDefineParameters): New protected virtual method to
18133 initialize ParameterTypes and ParameterInfo.
18134 (Method.GetReturnType): We can now simply return the MemberType.
18135 (Method.GetMethodFlags): Override the MemberBase version and add
18136 the conditional flags.
18137 (Method.CheckBase): Moved some code from Define() here, call
18138 DoDefineParameters() here.
18139 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18140 here to avoid some larger code duplication.
18141 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18142 ensure that abstract and external accessors don't declare a body.
18144 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18145 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18146 lookup in the attribute's parent classes, so we need to abort as soon
18147 as we found the first match.
18148 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18149 the attribute has no arguments.
18151 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18154 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18156 * cs-parser.jay: reverted previous patch.
18158 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18160 * cs-parser.jay: fixed bug #22119.
18162 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18164 * attribute.cs: fixed compilation. The error was:
18165 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18166 be assigned to before control leaves the current method."
18167 [FIXME: Filed as bug #28186: MCS must report this error.]
18169 2002-07-25 Martin Baulig <martin@gnome.org>
18171 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18172 method to pull the condition name ouf of a Conditional attribute.
18173 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18174 the obsolete message and error flag out of an Obsolete attribute.
18176 * class.cs (Method.GetMethodFlags): New public method to get the
18177 TypeManager.MethodFlags for this method.
18178 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18180 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18181 if we're overriding a virtual function, set the new private variable
18182 `parent_method'; call the new TypeManager.AddMethod().
18184 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18185 the MethodBuilder and the Method in a PtrHashtable.
18186 (TypeManager.builder_to_method): Added for this purpose.
18187 (TypeManager.MethodFlags): Added IsObsoleteError.
18188 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18189 Obsolete and Conditional arguments in MethodBuilders. If we discover
18190 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18191 the message from the attribute.
18193 2002-07-24 Martin Baulig <martin@gnome.org>
18195 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18196 preprocessor directives, ensure that the argument to #define/#undef is
18197 exactly one identifier and that it's actually an identifier.
18199 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18202 2002-07-24 Martin Baulig <martin@gnome.org>
18204 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18205 initialize it to TypeManager.object_type in the constructor.
18206 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18207 of the `hm.get_current' method if we're using the collection pattern.
18208 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18209 for the explicit conversion to make it work when we're using the collection
18210 pattern and the `Current' property has a different return type than `object'.
18213 2002-07-24 Martin Baulig <martin@gnome.org>
18215 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18216 does not match, but don't report any errors. This method is called in
18217 order for all methods in a MethodGroupExpr until a matching method is
18218 found, so we don't want to bail out if the first method doesn't match.
18219 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18220 matches, report the 123. Fixes #28070.
18222 2002-07-24 Martin Baulig <martin@gnome.org>
18224 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18225 TypeManager.TypeToCoreType() to the top of the method so the
18226 following equality checks will work. Fixes #28107.
18228 2002-07-24 Martin Baulig <martin@gnome.org>
18230 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18231 operand is of type uint, and the other operand is of type sbyte,
18232 short or int, the operands are converted to type long." -
18233 Actually do what this comment already told us. Fixes bug #28106,
18236 2002-07-24 Martin Baulig <martin@gnome.org>
18238 * class.cs (MethodBase): New abstract class. This is now a base
18239 class for Property, Indexer and Event to avoid some code duplication
18240 in their Define() and DefineMethods() methods.
18241 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18242 generic methods for Define() and DefineMethods().
18243 (FieldBase): Derive from MemberBase, not MemberCore.
18244 (Property): Derive from MemberBase, not MemberCore.
18245 (Property.DefineMethod): Moved all the code from this method to the
18246 new MethodBase.DefineAccessor(), just call it with appropriate
18248 (Property.Define): Call the new Property.DoDefine(), this does some
18249 sanity checks and we don't need to duplicate the code everywhere.
18250 (Event): Derive from MemberBase, not MemberCore.
18251 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18252 accessors, this will also make them work with interface events.
18253 (Indexer): Derive from MemberBase, not MemberCore.
18254 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18255 (Indexer.Define): Use the new MethodBase functions.
18257 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18258 argument to the constructor.
18259 (Interface.FindMembers): Added support for interface events.
18260 (Interface.PopluateEvent): Implemented.
18262 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18264 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18266 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18267 but this is required to check for a method name being the same as
18268 the containing class.
18272 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18274 * interface.cs: initialize variable.
18276 2002-07-23 Martin Baulig <martin@gnome.org>
18278 Implemented the IndexerName attribute in interfaces.
18280 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18281 name if this is an explicit interface implementation.
18282 (Indexer.InterfaceIndexerName): New public variable. If we're
18283 implementing an interface indexer, this is the IndexerName in that
18284 interface. Otherwise, it's the IndexerName.
18285 (Indexer.DefineMethod): If we're implementing interface indexer,
18286 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18287 and Pending.ImplementIndexer methods.
18288 (Indexer.Define): Also define the PropertyBuilder if we're
18289 implementing an interface indexer and this is neither an explicit
18290 interface implementation nor do the IndexerName match the one in
18293 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18294 If a method is defined here, then we always need to create a proxy
18295 for it. This is used when implementing interface indexers.
18296 (Pending.IsInterfaceIndexer): New public method.
18297 (Pending.ImplementIndexer): New public method.
18298 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18299 This is used when implementing interface indexers to define a proxy
18301 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18302 define a proxy if necessary.
18304 * interface.cs (Interface.IndexerName): New public variable.
18305 (Interface.PopulateIndexer): Set the IndexerName.
18306 (Interface.DefineIndexers): New private method. Populate all the
18307 indexers and make sure their IndexerNames match.
18309 * typemanager.cs (IndexerPropertyName): Added support for interface
18312 2002-07-22 Martin Baulig <martin@gnome.org>
18314 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18315 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18316 ret if HasReturnLabel.
18317 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18320 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18321 and set the ec.LoopBeginTryCatchLevel.
18322 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18323 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18324 the current ec.TryCatchLevel, the branch goes out of an exception
18325 block. In this case, we need to use Leave and not Br.
18327 2002-07-22 Martin Baulig <martin@gnome.org>
18329 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18330 block unless the block does not always return or it is contained in
18331 another try { ... } catch { ... } block. Fixes bug #26506.
18332 Added verify-1.cs to the test suite.
18334 2002-07-22 Martin Baulig <martin@gnome.org>
18336 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18337 then we do not always return. Fixes bug #24985.
18339 2002-07-22 Martin Baulig <martin@gnome.org>
18341 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18342 lookup on a per-class level; ie. walk up the class hierarchy until we
18343 found at least one applicable method, then choose the best among them.
18344 Fixes bug #24463 and test-29.cs.
18346 2002-07-22 Martin Baulig <martin@gnome.org>
18348 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18349 return types of the methods. The return type is not part of the
18350 signature and we must not check it to make the `new' modifier work.
18351 Fixes bug #27999, also added test-147.cs.
18352 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18354 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18355 on the method's return type.
18357 2002-07-21 Martin Baulig <martin@gnome.org>
18359 * assign.cs: Make this work if the rightmost source is a constant and
18360 we need to do an implicit type conversion. Also adding a few more tests
18361 to test-38.cs which should have caught this.
18363 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18364 target in the makefile for this. The makefile.gnu is primarily intended
18365 for end-users who don't want to debug the compiler.
18367 2002-07-21 Martin Baulig <martin@gnome.org>
18369 * assign.cs: Improved the Assign class so it can now handle embedded
18370 assignments (X = Y = Z = something). As a side-effect this'll now also
18371 consume less local variables. test-38.cs now passes with MCS, added
18372 a few new test cases to that test.
18374 2002-07-20 Martin Baulig <martin@gnome.org>
18376 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18377 instructions. Fixes bug #27977, also added test-146.cs.
18379 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18381 * cs-tokenizer.cs: fixed getHex ().
18383 2002-07-19 Martin Baulig <martin@gnome.org>
18385 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18386 not Type.GetType() to lookup the array type. This is needed when
18387 we're constructing an array of a user-defined type.
18388 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18389 single-dimensional arrays, but also for single-dimensial arrays of
18392 2002-07-19 Martin Baulig <martin@gnome.org>
18394 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18395 this function is called, it's not allowed to share LocalBuilders
18396 among ILGenerators.
18398 2002-07-19 Martin Baulig <martin@gnome.org>
18400 * expression.cs (Argument.Resolve): Report an error 118 when trying
18401 to pass a type as argument.
18403 2002-07-18 Martin Baulig <martin@gnome.org>
18405 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18406 Conv_R_Un for the signed `long' type.
18408 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18410 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18411 `expr' for the temporary result, as that will fail if we do
18412 multiple resolves on the same expression.
18414 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18416 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18417 ec.TypeContainer for looking up aliases.
18419 * class.cs (TypeContainer): Remove LookupAlias from here.
18421 * decl.cs (DeclSpace); Move here.
18423 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18425 * class.cs (FindMembers): Only call filter if the constructor
18426 bulider is not null.
18428 Also handle delegates in `NestedTypes' now. Now we will perform
18429 type lookups using the standard resolution process. This also
18432 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18433 This uses Expressions (the limited kind that can be parsed by the
18434 tree) instead of strings.
18436 * expression.cs (ComposedCast.ToString): Implement, used to flag
18437 errors since now we have to render expressions.
18439 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18442 * ecore.cs (SimpleName.ToString): ditto.
18444 * cs-parser.jay: Instead of using strings to assemble types, use
18445 Expressions to assemble the type (using SimpleName, ComposedCast,
18446 MemberAccess). This should fix the type lookups in declarations,
18447 because we were using a different code path for this.
18449 * statement.cs (Block.Resolve): Continue processing statements
18450 even when there is an error.
18452 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18454 * class.cs (Event.Define): Also remove the `remove' method from
18455 the list of pending items.
18457 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18458 generate more compact code.
18460 2002-07-17 Martin Baulig <martin@gnome.org>
18462 * const.cs (Const.LookupConstantValue): Add support for constant
18463 `unchecked' and `checked' expressions.
18464 Also adding test case test-140.cs for this.
18466 2002-07-17 Martin Baulig <martin@gnome.org>
18468 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18469 check whether mi.ReturnType implements the IEnumerator interface; the
18470 `==' and the IsAssignableFrom() will fail in this situation.
18472 2002-07-16 Ravi Pratap <ravi@ximian.com>
18474 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18477 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18479 * expression.cs: fixed bug #27811.
18481 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18483 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18484 Molaro: when we are a ref, the value already contains a pointer
18485 value, do not take the address of it.
18487 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18488 * removed mb-parser.jay and mb-tokenizer.cs
18490 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18492 * expression.cs: check against the building corlib void type.
18494 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18496 * ecore.cs: fix for valuetype static readonly fields: when
18497 initializing them, we need their address, not the address of a copy.
18499 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18501 * typemanager.cs: register also enum_type in corlib.
18503 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18505 * class.cs: allow calling this (but not base) initializers in structs.
18507 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18509 * ecore.cs: make sure we compare against the building base types
18512 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18514 * typemanager.cs: fix TypeToCoreType() to handle void and object
18515 (corlib gets no more typerefs after this change).
18517 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18519 * expression.cs (ArrayCreation.EmitArrayArguments): use
18520 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18522 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18523 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18524 array indexes, the runtime actually forbids them.
18526 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18527 for array arguments here.
18529 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18530 instead of the default for ValueTypes.
18532 (New.DoEmit): Use IsValueType instead of
18533 IsSubclassOf (value_type)
18534 (New.DoResolve): ditto.
18535 (Invocation.EmitCall): ditto.
18537 * assign.cs (Assign): ditto.
18539 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18540 Statements *are* currently doing part of their resolution during
18543 Expressions do always resolve during resolve, but statements are
18544 only required to propagate resolution to their children.
18546 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18548 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18550 (LoadAssembly): Do not add the dll if it is already specified
18552 (MainDriver): Add the System directory to the link path at the end,
18553 after all the other -L arguments.
18555 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18556 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18557 ldelem.u1) and using the opposite for sbytes.
18559 This fixes Digger, and we can finally run it.
18561 * driver.cs (UnixParseOption): Move the option parsing here.
18562 (CSCParseOption): Implement CSC-like parsing of options.
18564 We now support both modes of operation, the old Unix way, and the
18565 new CSC-like way. This should help those who wanted to make cross
18566 platform makefiles.
18568 The only thing broken is that /r:, /reference: and /lib: are not
18569 implemented, because I want to make those have the same semantics
18570 as the CSC compiler has, and kill once and for all the confussion
18571 around this. Will be doing this tomorrow.
18573 * statement.cs (Unsafe.Resolve): The state is checked during
18574 resolve, not emit, so we have to set the flags for IsUnsfe here.
18576 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18578 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18579 not catch the Error_ObjectRefRequired in SimpleName (as it is
18580 possible to have a class/instance variable name that later gets
18581 deambiguated), we have to check this here.
18583 2002-07-10 Ravi Pratap <ravi@ximian.com>
18585 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18586 make static and put into Expression.
18588 (Event.Define): Register the private field of the event with the
18589 TypeManager so that GetFieldFromEvent can get at it.
18591 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18592 keep track of the private field associated with an event which
18595 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18598 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18600 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18602 * expression.cs (Binary.EmitBranchable): this routine emits the
18603 Binary expression in a branchable context. This basically means:
18604 we need to branch somewhere, not just get the value on the stack.
18606 This works together with Statement.EmitBoolExpression.
18608 * statement.cs (Statement.EmitBoolExpression): Use
18611 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18613 * statement.cs (For): Reduce the number of jumps in loops.
18615 (For): Implement loop inversion for the For statement.
18617 (Break): We can be breaking out of a Try/Catch controlled section
18618 (foreach might have an implicit try/catch clause), so we need to
18619 use Leave instead of Br.
18621 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18622 now). If the instace expression supports IMemoryLocation, we use
18623 the AddressOf method from the IMemoryLocation to extract the
18624 address instead of emitting the instance.
18626 This showed up with `This', as we were emitting the instance
18627 always (Emit) instead of the Address of This. Particularly
18628 interesting when This is a value type, as we dont want the Emit
18629 effect (which was to load the object).
18631 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18633 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18635 * statement.cs (Checked): Set the CheckedState during the resolve
18636 process too, as the ConvCast operations track the checked state on
18637 the resolve process, and not emit.
18639 * cs-parser.jay (namespace_member_declaration): Flag that we have
18640 found a declaration when we do. This is used to flag error 1529
18642 * driver.cs: Report ok when we display the help only.
18644 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18646 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18648 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18650 * cs-tokenizer.cs (define): We also have to track locally the
18651 defines. AllDefines is just used for the Conditional Attribute,
18652 but we also need the local defines for the current source code.
18654 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18656 * statement.cs (While, For, Do): These loops can exit through a
18657 Break statement, use this information to tell whether the
18658 statement is the last piece of code.
18660 (Break): Flag that we break.
18662 * codegen.cs (EmitContexts): New `Breaks' state variable.
18664 2002-07-03 Martin Baulig <martin@gnome.org>
18666 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18667 modifiers in method declarations in structs. Otherwise, you won't
18668 be able to override things like Object.Equals().
18670 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18672 * class.cs (Method, Property, Indexer): Do not allow the public
18673 modifier to be used in explicit interface implementations.
18675 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18676 override modifiers in method declarations in structs
18678 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18680 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18681 integer or real overflow, report an error
18683 2002-07-02 Martin Baulig <martin@gnome.org>
18685 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18686 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18687 to tell the runtime about our newly created System.Object and
18688 System.ValueType types.
18690 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18692 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18693 struct instead of Ldarg/Starg.
18695 2002-07-02 Martin Baulig <martin@gnome.org>
18697 * expression.cs (Indirection.Indirection): Call
18698 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18700 2002-07-02 Martin Baulig <martin@gnome.org>
18702 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18703 ValueType, call TypeManager.TypeToCoreType() on it.
18704 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18705 the OpCodes.Newarr argument.
18707 2002-07-02 Martin Baulig <martin@gnome.org>
18709 * expression.cs (Invocation.EmitCall): When compiling corlib,
18710 replace all calls to the system's System.Array type to calls to
18711 the newly created one.
18713 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18714 System.Array methods.
18715 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18716 from the system's System.Array type which must be replaced.
18718 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18720 * typemanager.cs: load unverifiable_code_ctor so we can build
18721 corlib using the correct type. Avoid using GetTypeCode() with
18723 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18724 TypeManager.object_type to allow building corlib.
18726 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18728 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18730 2002-07-01 Martin Baulig <martin@gnome.org>
18732 * class.cs: Make the last change actually work, we need to check
18733 whether `ifaces != null' to avoid a crash.
18735 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18737 * class.cs: when we build structs without fields that implement
18738 interfaces, we need to add the interfaces separately, since there is
18739 no API to both set the size and add the interfaces at type creation
18742 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18744 * expression.cs: the dimension arguments to the array constructors
18745 need to be converted if they are a long.
18747 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18749 * class.cs: don't emit ldarg.0 if there is no parent constructor
18750 (fixes showstopper for corlib).
18752 2002-06-29 Martin Baulig <martin@gnome.org>
18754 MCS now compiles corlib on GNU/Linux :-)
18756 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18757 ie. check for MethodImplOptions.InternalCall.
18759 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18760 and TypeManager.attribute_type are null, so we must explicitly check
18761 whether parent is not null to find out whether it's an attribute type.
18762 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18763 and SetBuilder, not only if the property is neither abstract nor external.
18764 This is necessary to set the MethodImplOptions on the accessor methods.
18765 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18766 SetBuilder, see Property.Emit().
18768 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18769 populate "System.Object", "System.ValueType" and "System.Attribute" since
18770 they've already been populated from BootCorlib_PopulateCoreTypes().
18772 2002-06-29 Martin Baulig <martin@gnome.org>
18774 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18775 is the NullLiteral, we also need to make sure that target_type is not
18778 2002-06-29 Martin Baulig <martin@gnome.org>
18780 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18781 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18782 before calling BootstrapCorlib_ResolveDelegate ().
18784 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18786 * statement.cs: fixed build-breaker. All tests passed ok.
18788 2002-06-27 Martin Baulig <martin@gnome.org>
18790 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18791 for System.Decimal when compiling corlib.
18793 2002-06-27 Martin Baulig <martin@gnome.org>
18795 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18796 switch blocks which contain nothing but a default clause.
18798 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18800 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18802 2002-06-27 Martin Baulig <martin@gnome.org>
18804 * ecore.cs (PropertyExpr.PropertyExpr): Call
18805 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18807 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18808 is already a TypeBuilder.
18810 2002-06-27 Martin Baulig <martin@gnome.org>
18812 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18813 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18814 the "from an array-type to System.Array" case. This makes it work
18815 when compiling corlib.
18817 2002-06-27 Martin Baulig <martin@gnome.org>
18819 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18820 non-static PropertyExpr, set its InstanceExpression. This makes
18821 the `ICollection.Count' property work in System/Array.cs.
18823 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18825 * driver.cs: Made error handling more consistent. Errors now
18826 tracked by Report class, so many methods which used to return int
18827 now return void. Main() now prints success/failure and
18828 errors/warnings message.
18830 Renamed '--probe' compiler argument to '--expect-error'. Removed
18831 the magic number return values (123 and 124). Now, if the
18832 expected error occurs, the compiler exits with success (exit value
18833 0). If the compilation completes without seeing that particular
18834 error, the compiler exits with failure (exit value 1). The
18835 makefile in mcs/errors has been changed to handle the new behaviour.
18837 * report.cs: Made 'expected error' number a property and renamed
18838 it from 'Probe' to 'ExpectedError'.
18840 * genericparser.cs: Removed error handling support, since it is
18841 now all done by Report class.
18843 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18844 class, so parse() no longer returns an int.
18846 * namespace.cs: Use Report.Error instead of GenericParser.error
18848 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18850 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18851 TypeContainer.AddOperator): At the front of the list put the
18852 explicit implementations, so they get resolved/defined first.
18854 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18856 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18857 interface type is implemented by this TypeContainer. Used during
18858 explicit interface implementation.
18860 (Property.Define, Indexer.Define, Method.Define): Validate that
18861 the given interface in the explicit implementation is one of the
18862 base classes for the containing type.
18864 Also if we are explicitly implementing an interface, but there is
18865 no match in the pending implementation table, report an error.
18867 (Property.Define): Only define the property if we are
18868 not explicitly implementing a property from an interface. Use the
18869 correct name also for those properties (the same CSC uses,
18870 although that is really not needed).
18872 (Property.Emit): Do not emit attributes for explicitly implemented
18873 properties, as there is no TypeBuilder.
18875 (Indexer.Emit): ditto.
18877 Hiding then means that we do not really *implement* a pending
18878 implementation, which makes code fail.
18880 2002-06-22 Martin Baulig <martin@gnome.org>
18882 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18883 the return value of Object.GetType(). [FIXME: we need to do this whenever
18884 we get a type back from the reflection library].
18886 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18888 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18890 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18892 * attribute.cs: Return null if we can not look up the type.
18894 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18895 the interface types found.
18897 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18898 interface types found.
18900 * typemanager.cs (GetInterfaces): Make this routine returns alll
18901 the interfaces and work around the lame differences between
18902 System.Type and System.Reflection.Emit.TypeBuilder in the results
18903 result for GetInterfaces.
18905 (ExpandInterfaces): Given an array of interface types, expand and
18906 eliminate repeated ocurrences of an interface. This expands in
18907 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18910 2002-06-21 Martin Baulig <martin@gnome.org>
18912 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18915 2002-06-21 Martin Baulig <martin@gnome.org>
18917 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18918 and called with one of the core types, return the corresponding typebuilder for
18921 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18924 2002-06-21 Martin Baulig <martin@gnome.org>
18926 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18927 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18928 (Expression.ConvertReferenceExplicit): Likewise.
18930 * expression.cs (ElementAccess.DoResolve): Likewise.
18931 (ElementAccess.DoResolveLValue): Likewise.
18933 2002-06-10 Martin Baulig <martin@gnome.org>
18935 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18936 add the "value" parameter to the parameter list.
18938 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18941 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18943 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18944 the argument to an int, uint, long or ulong, per the spec. Also
18945 catch negative constants in array creation.
18947 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18949 * class.cs: do not allow the same interface to appear twice in
18950 the definition list.
18952 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18954 * ecore.cs: don't use ldlen with System.Array.
18956 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18958 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18960 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18962 * modifiers.cs: produce correct field attributes for protected
18963 internal. Easy fix so miguel can work on ther harder stuff:-)
18965 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18967 * pending.cs: New file. Move the code from class.cs here.
18968 Support clearning the pending flag for all methods (when not doing
18969 explicit interface implementation).
18971 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18973 * rootcontext.cs: added a couple more types needed to bootstrap.
18975 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18977 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18978 constructor in the type, instead of any constructor in the type
18979 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18980 a bug in the Mono runtime when applying the params attribute).
18982 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18983 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18985 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18987 * expression.cs (Unary.ResolveOperator): Use TypeManager
18988 to resolve the type.
18990 2002-06-13 Ravi Pratap <ravi@ximian.com>
18992 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18995 * enum.cs (AddEnumMember): Add support to store the attributes associated
18996 with each member too.
18998 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18999 field builders too - this takes care of the enum member case.
19001 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19003 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19004 address-of operator on both value types and pointers.
19006 2002-06-10 Martin Baulig <martin@gnome.org>
19008 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19009 PropertyBuilder to the `property_builders' list.
19011 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19012 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19013 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19014 find any indexers which are inherited from an interface.
19016 2002-06-09 Martin Baulig <martin@gnome.org>
19018 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19019 the same type as the constant if necessary. There's also a test-130.cs
19022 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19024 * typemanager.cs (TypeManager.ChangeType): Previously known as
19025 Enum.ChangeEnumType().
19027 2002-06-09 Martin Baulig <martin@gnome.org>
19029 * expression.cs (Cast.TryReduce): Added support for consts.
19031 2002-06-08 Ravi Pratap <ravi@ximian.com>
19033 * class.cs (Accessor): Hold attributes information so we can pass
19036 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19037 Modify to pass in attributes attached to the methods.
19039 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19041 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19042 to handle the Accessor kind :-)
19044 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19046 2002-06-08 Martin Baulig <martin@gnome.org>
19048 * expression.cs (Unary.TryReduceNegative): Added support for
19051 2002-06-08 Martin Baulig <martin@gnome.org>
19053 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19054 name can't be found in the `defined_names' - the caller will do a
19055 MemberLookup in this case and thus find methods in System.Enum
19056 such as Enum.IsDefined().
19058 2002-06-08 Martin Baulig <martin@gnome.org>
19060 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19061 Convert.ChangeType() which works with TypeBuilder created types.
19062 (Enum.LookupEnumValue, Enum.Define): Use it here.
19064 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19065 `TypeBuilder.BaseType != null' check.
19066 (TypeContainer.FindMembers): Only lookup parent members if we
19067 actually have a parent.
19068 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19069 (ConstructorInitializer.Resolve): Likewise.
19071 * interface.cs (Interface.FindMembers): Added
19072 `TypeBuilder.BaseType != null' check.
19074 * rootcontext.cs (RootContext.ResolveCore): Added
19075 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19076 classes_second_stage.
19078 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19079 debug_type and trace_type when compiling with --nostdlib.
19081 2002-06-07 Martin Baulig <martin@gnome.org>
19083 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19084 (AddField): Set it to true when adding a non-static field.
19085 (DefineType): Use `have_nonstatic_fields' to find out whether we
19086 have non-static fields, not `Fields != null'.
19088 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19090 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19091 dereferencing a null on the static-field code path)
19093 2002-05-30 Martin Baulig <martin@gnome.org>
19095 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19096 to take command line arguments. Use reflection to call the new
19097 custom `Initialize' function on the symbol writer and pass it the
19098 command line arguments.
19100 * driver.cs (--debug-args): New command line argument to pass command
19101 line arguments to the symbol writer.
19103 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19105 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19106 the target type for indexers and properties. Thanks to Joe for
19109 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19111 * typemanager.cs (MethodFlags): returns the method flags
19112 (Obsolete/ShouldIgnore) that control warning emission and whether
19113 the invocation should be made, or ignored.
19115 * expression.cs (Invocation.Emit): Remove previous hack, we should
19116 not do this on matching a base type, we should do this based on an attribute
19118 Only emit calls to System.Diagnostics.Debug and
19119 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19120 on the command line.
19122 * rootcontext.cs: Global settings for tracing and debugging.
19124 * cs-tokenizer.cs (define): New utility function to track
19125 defines. Set the global settings for TRACE and DEBUG if found.
19127 2002-05-25 Ravi Pratap <ravi@ximian.com>
19129 * interface.cs (Populate*): Pass in the TypeContainer as well as
19130 the DeclSpace as parameters so that we can create EmitContexts and
19131 then use that to apply attributes etc.
19133 (PopulateMethod, PopulateEvent, PopulateProperty)
19134 (PopulateIndexer): Apply attributes everywhere.
19136 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19139 (ApplyAttributes): Update accordingly.
19141 We now apply interface attributes for all members too.
19143 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19145 * class.cs (Indexer.Define); Correctly check if we are explicit
19146 implementation (instead of checking the Name for a ".", we
19147 directly look up if the InterfaceType was specified).
19149 Delay the creation of the PropertyBuilder.
19151 Only create the PropertyBuilder if we are not an explicit
19152 interface implementation. This means that explicit interface
19153 implementation members do not participate in regular function
19154 lookups, and hence fixes another major ambiguity problem in
19155 overload resolution (that was the visible effect).
19157 (DefineMethod): Return whether we are doing an interface
19160 * typemanager.cs: Temporary hack until we get attributes in
19161 interfaces (Ravi is working on that) and we get IndexerName
19162 support in interfaces.
19164 * interface.cs: Register the indexers as properties.
19166 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19167 warning, I have verified that this is a bug in the .NET runtime
19168 (JavaScript suffers of the same problem).
19170 * typemanager.cs (MemberLookup): When looking up members for
19171 interfaces, the parent of an interface is the implicit
19172 System.Object (so we succeed in searches of Object methods in an
19173 interface method invocation. Example: IEnumerable x; x.ToString
19176 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19178 * class.cs (Event): Events should also register if they do
19179 implement the methods that an interface requires.
19181 * typemanager.cs (MemberLookup); use the new GetInterfaces
19184 (GetInterfaces): The code used to lookup interfaces for a type is
19185 used in more than one place, factor it here.
19187 * driver.cs: Track the errors at the bottom of the file, we kept
19190 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19191 instance if the method we are calling is static!
19193 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19195 * attribute.cs (ApplyAttributes): Make this function filter out
19196 the IndexerName attribute (as that attribute in reality is never
19197 applied) and return the string constant for the IndexerName
19200 * class.cs (TypeContainer.Emit): Validate that all the indexers
19201 have the same IndexerName attribute, and if so, set the
19202 DefaultName attribute on the class.
19204 * typemanager.cs: The return value might contain other stuff (not
19205 only methods). For instance, consider a method with an "Item"
19206 property and an Item method.
19208 * class.cs: If there is a problem with the parameter types,
19211 2002-05-24 Ravi Pratap <ravi@ximian.com>
19213 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19214 looks at user defined conversion after making a call to
19215 StandardConversionExists - we need this for overload resolution.
19217 * expression.cs : Update accordingly the various method calls.
19219 This fixes 2 bugs filed against implicit user defined conversions
19221 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19223 * statement.cs: Track the result of the assignment.
19225 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19227 * expression.cs (MemberAccess): Improved error reporting for
19228 inaccessible members.
19230 2002-05-22 Martin Baulig <martin@gnome.org>
19232 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19233 itself with debugging support.
19235 2002-05-22 Martin Baulig <martin@gnome.org>
19237 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19238 Removed, this isn't needed anymore.
19240 2002-05-20 Martin Baulig <martin@gnome.org>
19242 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19243 be underlying type for an enum.
19245 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19247 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19248 that splits out the loading of just the core types.
19250 * rootcontext.cs (ResolveCore): Split the struct resolution in
19251 two, so we can load the enumeration underlying types before any
19254 * expression.cs (Is): Bandaid until we fix properly Switch (see
19255 bug #24985 for details).
19257 * typemanager.cs (ImplementsInterface): The hashtable will contain
19258 a null if there are no interfaces implemented.
19260 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19262 * cs-parser.jay (indexer_declarator): It is fine to have array
19265 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19267 * typemanager.cs: (RegisterBuilder): New function used to register
19268 TypeBuilders that implement interfaces. Since
19269 TypeBuilder.GetInterfaces (as usual) does not work with lame
19271 (AddUserType): register interfaces.
19273 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19274 dealing with TypeBuilder. Also, arrays are showing up as
19275 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19276 methods can not be invoked on them!
19278 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19279 (ImplicitReferenceConversionExists): Split out from
19280 StandardConversionExists.
19282 * expression.cs (As): We were only implementing one of the three
19283 cases for the as operator. We now implement them all.
19284 (Is): Implement the various other cases for Is as well.
19286 * typemanager.cs (CACHE): New define used to control if we want or
19287 not the FindMembers cache. Seems to have a negative impact on
19288 performance currently
19290 (MemberLookup): Nested types have full acess to
19291 enclosing type members
19293 Remove code that coped with instance/static returns for events, we
19294 now catch this in RealFindMembers.
19296 (RealFindMembers): only perform static lookup if the instance
19297 lookup did not return a type or an event.
19299 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19301 * assign.cs (CompoundAssign): We pass more semantic information
19302 now to Compound Assignments than we did before: now we have all
19303 the information at hand, and now we resolve the target *before* we
19304 do the expression expansion, which allows the "CacheValue" method
19305 to have the effect we intended (before, a [x] += 1 would generate
19306 two differen ArrayAccess expressions from the ElementAccess,
19307 during the resolution process).
19309 (CompoundAssign.DoResolve): Resolve target and original_source here.
19311 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19313 * expression.cs (ArrayAccess): dropped debugging information.
19315 * typemanager.cs: Small bug fix: I was always returning i_members,
19316 instead of one of i_members or s_members (depending on which had
19319 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19320 method is invoked before any code generation takes place, and it
19321 is a mechanism to inform that the expression will be invoked more
19322 than once, and that the method should use temporary values to
19323 avoid having side effects
19325 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19327 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19330 * expression.cs (Indirection, ArrayAccess): Add support for
19331 CacheTemporaries in these two bad boys.
19333 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19334 ldobj or ldind_ref.
19335 (StoreFromPtr): Handle stobj as well.
19337 * expression.cs (UnaryMutator): Share more code.
19339 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19340 down: I was not tracking the Filter function as well, which
19341 was affecting the results of the cache.
19343 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19345 * attribute.cs: Remove the hack to handle the CharSet property on
19348 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19350 * attribute.cs (DoResolve): More uglyness, we now only try to
19351 resolve the attribute partially, to extract the CharSet
19352 information (only if we are a StructLayout attribute). Otherwise
19354 (GetExtraTypeInfo): Add some code to conditionally kill in the
19355 future this. I am more and more convinced that the .NET
19356 framework has special code to handle the attribute setting on
19359 * expression.cs (IsParamsMethodApplicable): Revert my previous
19360 foreach change here, it was wrong.
19362 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19364 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19365 (pp_expr): do not abort on unknown input, just return.
19366 (eval): abort if there are pending chars.
19368 * attribute.cs (Attribute.Resolve): Positional parameters are
19369 optional. Deal with that case.
19371 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19372 the Ansi/Unicode/Auto information for the type.
19374 (TypeContainer.DefineType): instantiate the EmitContext here, as
19375 we will be using it during the type definition (to resolve
19376 attributes) and during the emit phase.
19378 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19379 to pull type information out of the attributes
19381 (Attribute.Resolve): track the constructor builder, and allow for
19382 multiple invocations (structs and classes will use this).
19384 * ecore.cs (MemberLookupFinal): new version with all the
19385 parameters customizable.
19387 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19388 constructors. Return if the result value is null (as the error
19389 would have been flagged already by MemberLookupFinal)
19391 Do not allow instances of abstract classes or interfaces to be
19394 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19395 We have to compare the assembly property here when dealing with
19396 FamANDAssem and Assembly access modifiers, because we might be
19397 creating an assembly from *modules* (that means that we are not
19398 getting TypeBuilders for types defined in other modules that are
19399 part of this assembly).
19401 (Method.Emit): If the method is marked abstract and has a body,
19404 (TypeContainer.DefineMembers): If both the defined member and the
19405 parent name match are methods, then do not emit any warnings: let
19406 the Method.Define routine take care of flagging warnings. But if
19407 there is a mismatch (method overrides something else, or method is
19408 overriwritten by something, then emit warning).
19410 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19411 set to null, this means `do not check for the return type on the
19414 (Method.Define): set the return type for the method signature to
19415 null, so that we get methods with the same name and parameters and
19416 different return types. This is used to flag warning 114 (you are
19417 hiding a method, and you probably want to use the new/override
19420 * typemanager.cs (MemberLookup): Implemented proper access
19421 control, closing a long standing set of bug reports. The problem
19422 was that the Framework only has two bits: Public and NonPublic,
19423 and NonPublic includes private and protected methods, but we need
19424 to enforce the FamANDAssem, FamOrAssem and Family.
19426 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19428 * statement.cs (GotoCase): Return true: Ammounts to giving up
19429 knowledge on whether we return or not, and letting the other case
19430 be responsible for it.
19432 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19434 * driver.cs: Do not load directories for each file processed, only
19435 do it if there is a pattern.
19437 * ecore.cs: Report readonly assigns here as well, as we might have
19438 been resolved only by MemberAccess.
19440 (SimpleName.SimpleNameResolve): Also be useful for LValue
19441 resolution. We need this to propagate assign to local readonly variables
19443 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19444 do not want to reuse potential criteria memory.
19446 * class.cs (MyEventBuilder): Set reflected_type;
19448 * ecore.cs (Constantify): Added support for constifying bools.
19450 (RootContext.LookupType): Added a cache for values looked up in
19451 the declaration space.
19453 * typemanager.cs (FindMembers): Now is a front-end to
19454 RealFindMembers, and provides a two-level hashtable-based cache to
19457 15% performance improvement: from 22.5 to 19.2 seconds.
19459 * expression.cs (IsParamsMethodApplicable): use foreach.
19460 (Invocation.DoResolve): ditto.
19461 (New.DoResolve): ditto.
19462 (ArrayCreation.DoResolve): ditto.
19464 * ecore.cs (FindMostEncompassingType): use foreach.
19466 * delegate.cs (NewDelegate.DoResolve): Use foreach
19468 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19469 (RemoveMethods): use foreach.
19471 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19472 nested foreach statements instead of for, and also break out of
19473 the inner loop once a match is found.
19475 (Invocation.OverloadResolve): Use foreach, simplify the code.
19477 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19479 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19480 we actually unwrap the expression to allow for extra information
19483 * expression.cs: Use Shr_Un on unsigned operations.
19485 2002-05-08 Ravi Pratap <ravi@ximian.com>
19487 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19488 applicable operators was not being considered correctly. This closes
19489 the bug Miguel reported.
19491 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19493 * attribute.cs: check that the type derives from System.Attribute
19494 and report the correct error in that case (moved the duplicate code to
19495 its own method, too).
19497 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19499 * attribute.cs: lookup attribute type name as the spec says: first the
19500 bare attribute name and then name + "Attribute" (nant compiles with
19501 mcs after this fix).
19503 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19505 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19506 Because of the way we parse things, we should try to see if a
19507 UIntConstant can fit in an integer.
19509 2002-05-07 Ravi Pratap <ravi@ximian.com>
19511 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19512 when we are in an explicit context.
19514 (ConvertReferenceExplicit): When converting from Iface type S to Class
19515 T make sure the rules are implemented as an OR.
19517 * parameter.cs (ParameterType): Make it a property for now although the
19518 purpose really isn't anything immediate.
19520 * expression.cs (Is*Applicable): Do better checking on the parameter type
19521 of a ref/out parameter. The ones from the system assemblies are already
19522 marked with the correct type so we don't need to do any correction.
19524 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19525 the object type is standard too so include that.
19527 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19529 * ecore.cs (StandardConversionExists): Augment with missing code:
19530 deal with IntConstant, LongConstants and Enumerations.
19532 * assign.cs: Report the error, instead of failing silently
19534 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19535 typecontainer that they are declared, because the
19536 typecontainer/namespace will have the list of using clauses that
19537 need to be applied.
19539 Assembly Attributes were escaping the normal registration
19542 (EmitCode): Apply attributes within an EmitContext that represents
19543 the container they were declared on.
19545 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19547 2002-05-06 Ravi Pratap <ravi@ximian.com>
19549 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19550 Revamp completely - make much cleaner as we now operate only
19553 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19554 to implement the logic detailed in the spec more correctly.
19556 (UserDefinedConversion): Update accordingly.
19558 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19560 * statement.cs: Return flow analysis information up.
19562 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19565 (token): Do not consume an extra character before calling
19568 2002-05-06 Piers Haken <piersh@friskit.com>
19570 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19572 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19574 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19575 EmitContext during the instance constructor initializer
19576 resolution, to stop access to instance variables.
19578 This is mandated by the spec, last paragraph of the `constructor
19579 initializers' section.
19581 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19583 * cs-parser.jay, class.cs (Accessor): new class used to represent
19584 an accessor (get or set). In the past we used `null' to represent
19585 a missing accessor. But this is ambiguous because there was no
19586 way to tell in abstract indexers/properties if one of them was
19589 Now there is a way of addressing that.
19591 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19592 instead of FindMembers.
19594 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19595 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19597 * attribute.cs: Treat indexers and properties as the same in terms
19598 of applying attributes
19600 * ecore.cs (FindMostEncompassedType): Use statically initialized
19601 EmptyExpressions()s like we do elsewhere to avoid creating useless
19602 objects (and we take this out of the tight loop).
19604 (GetConversionOperators): Move the code to extract the actual
19605 operators to a separate routine to clean things up.
19607 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19609 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19610 events are always registered FieldBuilders.
19612 * class.cs (FieldBase): New class shared by Fields
19614 * delegate.cs: If we are a toplevel delegate, use our full name.
19615 If we are a nested delegate, then only use our tail name.
19617 2002-05-02 Ravi Pratap <ravi@ximian.com>
19619 * expression.cs (IsApplicable): Ensure that we add the "&" to
19620 ref/out types before comparing it with the type of the argument.
19622 (IsParamsMethodApplicable): Ditto.
19624 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19627 * delegate.cs : Handle the case when we have more than one applicable
19628 method. Flag an error only when we finish checking all.
19630 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19632 * expression.cs: Add support for boolean static initializers.
19634 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19636 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19638 * parameter.cs (ComputeParameterTypes,
19639 ComputeAndDefineParameterTypes): Better error handling: now we
19640 clear the `types' cache if we fail during any of the type lookups.
19641 We also return the status code correctly to our caller
19643 * delegate.cs: If we fail to define a delegate, abort the extra
19646 * expression.cs (Binary.ResolveOperator): for
19647 operator==(object,object) and operator !=(object, object) we also
19648 have to verify that there is an implicit conversion from one to
19651 (ArrayAccess.DoResolve): Array Access can operate on
19654 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19656 * assign.cs (CompoundAssign): A new class used as a "flag" that
19657 the assignment actually is happening as part of a compound
19658 assignment operator.
19660 During compound assignment, a few new rules exist to enable things
19667 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19668 to the type of x) if y is implicitly convertible to the type of x,
19669 and the operator is a builtin operator and the return type of the
19670 operator is explicitly convertible to the type of x.
19672 * rootcontext.cs: Reset warning level to 2. 4 catches various
19673 "interesting" features in mcs, we must clean this up at some
19674 point, but currently am trying to kill other bugs ;-)
19676 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19677 in container classes as well.
19679 * expression.cs (Binary.ResolveOperator): Handle string case
19680 before anything else (as operator overloading does emit an error
19681 before doing anything else).
19683 This code could go away when we move to a table driven model, but
19684 i could not come up with a good plan last night.
19686 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19688 * typemanager.cs (CSharpName): reimplementation using regex.
19689 * class.cs: added null check for fields in Emit
19690 * rootcontext.cs: set warninglevel to 4
19692 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19694 * typemanager.cs (CSharpName): reimplemented with Lupus
19697 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19699 * statement.cs (If): correclty implement Resolve, because we were
19700 not catching sem errors in there. The same process is needed
19702 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19705 (Statement.Warning_DeadCodeFound): Factorize code.
19706 (While): Report dead code here too.
19708 (Statement): Added Resolve virtual method to allow
19709 for resolution split from the emit code.
19711 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19713 * statement.cs (EmitBoolExpression): No longer try to resolve the
19715 (MakeBoolean): New utility function that resolve, implicitly
19716 converts to boolean and tags the expression.
19719 (If, Do): Implement dead code elimination.
19720 (While): Implement loop inversion
19722 (Do, While, For, If): Resolve the expression prior to calling our
19725 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19728 - added method Report28 (warning: program has more than one entry point)
19729 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19730 - modified method Method.Define, the part at the end of the method
19732 * rootcontext.cs: added static public Location EntryPointLocation;
19734 * ../errors/cs0028.cs : Add test case for the above warning.
19737 - modified method CSharpName to allow arrays of primitive type to
19738 be printed nicely (e.g. instead of System.Int32[][] it now prints
19740 - added method CSharpSignature: returns the signature of a method
19741 in string format to be used in reporting errors, warnings, etc.
19743 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19746 2002-04-26 Ravi Pratap <ravi@ximian.com>
19748 * delegate.cs (Define): Fix extremely silly bug where I was
19749 setting the type of the 'object' parameter of the BeginInvoke
19750 method to System.IAsyncResult instead of System.Object ;-)
19752 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19754 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19757 (Constructor.Emit): return if we fail to initialize the
19758 constructor. Another door closed!
19760 * expression.cs (New.DoResolve): Improve error message (from -6 to
19761 1501). Use DeclaredOnly lookup to find the exact constructor.
19763 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19764 loop. This is useful.
19766 * cs-parser.jay: Adjust the default parameters so that destructors
19767 have the proper signature.
19769 2002-04-26 Martin Baulig <martin@gnome.org>
19771 * driver.cs (LoadAssembly): If `assembly' contains any characters
19772 which are only valid in path names and not in assembly names
19773 (currently slash, backslash and point), use Assembly.LoadFrom ()
19774 instead of Assembly.Load () on the `assembly' (before iteration
19775 over the link_paths).
19777 2002-04-26 Martin Baulig <martin@gnome.org>
19779 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19781 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19783 * class.cs (Property): use the new typemanager.MemberLookup
19785 (TypeContainer.MemberLookup): Implement using the
19786 TypeManager.MemberLookup now.
19788 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19789 and return MemberInfos, so that these can be used without an
19790 EmitContext (what we had before).
19792 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19794 * expression.cs: Fix the case where the argument to params if the
19795 type of the params. I omitted handling this before. Fixed
19797 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19799 * driver.cs: Call BootCorlib_PopulateCoreType
19801 * class.cs (Property.CheckBase): Check for properties only, not
19804 * interface.cs: Temporary hack: try/catch around the
19805 CustomAttributeBuilder, because I am getting an exception that I
19808 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19809 types whose definitions are required to be there (attributes are
19810 defined before standard types).
19812 Compute definitions as we boot the various types, as they are used
19813 immediately (value_type class will need object_type, but if we do
19814 not initialize object_type, we will pass a null, which will let
19815 the runtime pick the System.Object from the existing corlib, which
19816 is not what we want).
19818 2002-04-22 Patrik Torstensson <totte@labs2.com>
19820 * cs-tokenizer.cs: fixed a number of trim() issues.
19822 2002-04-22 Ravi Pratap <ravi@ximian.com>
19824 * expression.cs (Argument.Type): Ensure that we return the correct
19825 type when we have out or ref parameters [in which case we
19828 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19830 * class.cs (Property, Indexer): Allow extern modifier in there.
19832 * typemanager.cs (InitBaseTypes): Initializes object_type and
19833 value_type, since those will be used early on during the bootstrap
19834 process to compile corlib.
19836 (InitCoreTypes): Move code from here to InitBaseTypes.
19838 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19840 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19841 single-dimension arrays as using the ldlen opcode.
19843 Daniel Lewis discovered this optimization.
19845 * typemanager.cs: Add signature for System.Array::get_Length
19847 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19849 * statement.cs: report the error when the foreach does not apply to an
19850 array nor a collection.
19852 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19854 * expression.cs: Add implicit conversions to the operator ~.
19856 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19858 * typemanager.cs: Locate the decimal constructor.
19860 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19862 * attribute.cs: use the new property of TypeOf.
19863 * expression.cs: added 'get' property around typearg.
19865 These changes fix a build breaker reported by NickD. Is this the
19866 correct way to fix? If not, please, revert my changes and make it
19869 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19871 * attribute.cs: Add support for typeof in attribute invocations.
19872 I am not sure that this is right though.
19874 2002-04-14 Duncan Mak <duncan@ximian.com>
19876 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19877 Binary.Operator.Division case.
19879 2002-04-13 Ravi Pratap <ravi@ximian.com>
19881 * class.cs (DefineType): Ensure that we do a proper check on
19882 attribute types and also register it with the TypeManager.
19884 (TypeContainer.Targets): The default for attribute types is
19885 AttributeTargets.All.
19887 * attribute.cs (ApplyAttributes): Registering the attribute type
19888 is done elsewhere, not when we discover we have a Usage attribute.
19890 2002-04-12 Ravi Pratap <ravi@ximian.com>
19892 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19893 and get rid of is_delegate parameter.
19895 * everywhere : update.
19897 2002-04-12 Ravi Pratap <ravi@ximian.com>
19899 * cs-parser.jay (compilation_unit): Revamp completely to use
19900 some new ideas that I got from Rhys' grammar to solve the problems
19901 with assembly level attributes.
19903 (outer_declaration): New grammar production.
19905 (attribute_sections): Add.
19907 (opt_attributes): Base on attribute_sections
19909 (namespace_declaration): Allow opt_attributes to tackle the case
19910 when we have assembly level attributes - we are clever in this
19913 * attribute.cs (ApplyAttributes): Do not worry about assembly
19914 attributes in the non-global context.
19916 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19917 instead of SetGlobalAttributes.
19919 * class.cs, rootcontext.cs : Ensure we define and generate
19920 attribute types before anything else.
19922 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19923 and flag the new error -20 for the case when the attribute type
19924 does not have valid targets specified. csc does not catch this.
19926 * ../errors/errors.txt : update for error # -20
19928 2002-04-11 Ravi Pratap <ravi@ximian.com>
19930 * support.cs (InternalParameters.ParameterModifier): Do some null
19931 checking and return sane values.
19933 * class.cs (Method.Define): If we are a PInvoke method, ensure
19934 that we are static and extern. Report error # 601
19936 * ../errors/cs0601.cs : Add test case for the above error.
19938 2002-04-07 Ravi Pratap <ravi@ximian.com>
19940 * rootcontext.cs (attribute_types): We need to keep type of
19941 all attribute types separately and emit code for them first.
19943 (RegisterAttribute) : Implement.
19945 * class.cs (DefineType): Check if the current Type is a custom
19946 attribute type and register it accordingly.
19948 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19949 adding the first attribute twice and rename to
19951 (SetGlobalAttributes): this.
19953 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19956 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19957 if we are processing global arguments. Hmm, I am unsure of this.
19959 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19961 * expression.cs: added static array of strings to avoid calling
19962 Enum.ToString () for Operator in Binary. Significant recover of
19965 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19967 * class.cs (FindMembers): Allow the Builders of the various
19968 members to be null. If they are skip them. This only happens
19969 during the PInvoke declaration.
19971 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19973 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19974 failure, so we do not keep going afterwards.
19976 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19977 wanted to pass `false' as the `is_delegate' argument. If this is
19978 the case, why not use delegate_type == null to mean `is_delegate =
19979 false' and anything else as is_delegate = true.
19981 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19983 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19984 code for the section, not the beginning of the tests.
19986 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19988 * cfold.cs: Handle operator + (Enum x, Underlying x)
19990 * expression.cs (Binary): same. Warn about errors where we have
19991 Enum/Enum in operator + as well.
19993 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19996 - added support for switch(bool)
19997 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19998 - add TableSwitchEmit() to handle table-based switch statements
20000 2002-04-05 Ravi Pratap <ravi@ximian.com>
20002 * expression.cs (Invocation.OverloadResolve): Factor out code which
20003 does parameter compatibility checking with arguments so that we can
20004 re-use the code even from Delegate.VerifyApplicability
20006 (VerifyArgumentsCompat): Move above code here.
20008 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20009 and instead make a call to the above method.
20011 2002-03-31 Ravi Pratap <ravi@ximian.com>
20013 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20014 We use it to keep track of classes which are attribute types.
20016 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20018 * delegate.cs (Delegate.Define): Correctly define the types in the
20019 presence of fixed and array parameters.
20021 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20024 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20025 include NonPublic after the first iteration.
20027 * class.cs (Indexer.CheckBase): Only check if both parents are
20030 * cs-parser.jay (accessor_body): If empty, set to null.
20032 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20033 same code path here to resolve constants names that we did have in
20034 MemberAccess.DoResolve. There is too much code duplicated here.
20036 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20038 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20040 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20043 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20044 tokens, numbers and strings.
20046 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20049 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20050 asyncronous parameters and the regular parameters.
20052 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20053 specify the target directory.
20055 * expression.cs: (This.DoResolve): Simplify
20056 (As.Emit): Optimize, do not generate IsInst if the expression is
20057 always of the given type.
20059 (Is.DoResolve): Bug fix, we were reporting both always/never for
20062 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20063 creating too many unnecessary arrays.
20065 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20067 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20068 fields instead of rolling our own initializer. Takes care of all
20069 implicit conversions, and drops unnecessary static checks/argument.
20071 2002-03-31 Dick Porter <dick@ximian.com>
20073 * driver.cs: use the GetDirectories() return values properly, and
20074 use "/" as path separator.
20076 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20078 * expression.cs (Unary): Optimize - - expr into expr.
20079 (Binary): Optimize a + (-b) into a -b.
20081 * codegen.cs (CodeGen): Made all methods static.
20083 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20087 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20088 TypeBuilder property.
20090 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20093 * tree.cs: Removed the various RecordXXXX, and replaced with a
20094 single RecordDecl. Removed all the accessor methods, and just
20095 left a single access point Type
20097 * enum.cs: Rename DefineEnum to DefineType.
20099 * decl.cs: New abstract method `DefineType' used to unify the
20100 Defines for Enumerations, Interfaces, TypeContainers and
20103 (FindType): Moved LookupInterfaceOrClass here. Moved the
20104 LookupBaseClasses method that used to live in class.cs and
20105 interface.cs here, and renamed to FindType.
20107 * delegate.cs: Implement DefineType. Take advantage of the
20108 refactored pattern for locating the parent builder without taking
20109 the parent_builder argument (which we know does not work if we are
20110 nested, and triggering a toplevel definition).
20112 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20114 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20115 accessibility of a member has changed during override and report
20118 * class.cs (Method.Define, Property.Define): Only complain on
20119 overrides if the method is private, any other accessibility is
20120 fine (and since we just checked the permission is the same, we are
20123 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20124 and elif are processed always. The other pre-processing
20125 directives are only processed if we are "taking" the path
20127 2002-03-29 Martin Baulig <martin@gnome.org>
20129 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20130 current location is not Null.
20132 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20133 a separate method so we can profile it.
20135 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20136 `span.Seconds' are just seconds, but no minutes or hours.
20137 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20139 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20141 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20142 Remove the gratuitous set of Final:
20144 // If an interface implementation, then we can set Final.
20145 if (((flags & MethodAttributes.Abstract) == 0) &&
20146 implementing.DeclaringType.IsInterface)
20147 flags |= MethodAttributes.Final;
20149 I do not know what I was smoking when I used that.
20152 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20153 step into fixing the name resolution issues for delegates and
20154 unifying the toplevel name resolution.
20156 2002-03-28 Martin Baulig <martin@gnome.org>
20158 * class.cs (Method.Emit): If we have a symbol writer, call its
20159 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20160 tell it about the current method.
20162 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20163 writer that we're going to emit the first byte of IL code for a new
20164 statement (a new source line).
20165 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20166 EmitContext.Mark() before emitting any code.
20168 * location.cs (SymbolDocument): Return null when we're Null.
20170 * statement.cs (Statement): Moved the `Location loc' variable here.
20171 (Statement.EmitBoolExpression): If we have a symbol writer, call
20172 ec.Mark() before emitting any code to tell it that we're at the
20173 beginning of a new statement.
20174 (StatementExpression): Added `Location' argument to the constructor.
20175 (Block): Added public readonly variable `StartLocation' and public
20176 variable `EndLocation'. The latter is to be set using SetEndLocation().
20177 (Block): Added constructor which takes a start and end location.
20178 (Block.SetEndLocation): New method. This sets the end location.
20179 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20180 local variables we create.
20181 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20182 each statement and do also mark the begin and end of the block.
20184 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20185 tell it the current lexer.Location, use Location.Null for the end of the
20187 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20188 current block, set its end location using SetEndLocation().
20189 (statement_expression): StatementExpression constructor now takes the
20190 lexer.Location as additional argument.
20191 (for_statement, declare_local_variables): Likewise.
20192 (declare_local_variables): When creating a new implicit block, use the
20193 new Block constructor and pass it the lexer.Location.
20195 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20197 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20198 members also on the parent interfaces recursively.
20200 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20202 * report.cs: Use new formats, since Gonzalo finished the missing
20205 * expression.cs (Binary.ResolveOperator): added missing operator|
20206 operator& and operator^ for bool/bool.
20208 * cs-parser.jay: CheckDef now takes a Location argument that is
20209 used to report errors more precisly (instead of reporting the end
20210 of a definition, we try to track something which is a lot closer
20211 to the source of the problem).
20213 * cs-tokenizer.cs: Track global token use, so we can properly flag
20214 the use of #define/#undef after the first token has been seen.
20216 Also, rename the reportXXXX to Error_DescriptiveName
20218 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20219 TypeContainer, so that Enum and Interface can use this too.
20221 * class.cs (TypeContainer.LookupInterfaceOrClass,
20222 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20223 `builder' argument. Typically this was used to pass the parent
20224 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20227 The problem is that a nested class could trigger the definition of
20228 a toplevel class, and the builder would be obviously wrong in that
20231 So we drop this argument, and we compute dynamically the
20232 TypeBuilder/ModuleBuilder (the correct information was available
20233 to us anyways from DeclSpace.Parent)
20235 * interface.cs (Interface.DefineInterface): Drop builder
20236 parameter cleanup like class.cs
20238 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20241 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20244 (Try.Emit): Propagate the returns value from the statement.
20246 (Return.Emit): Even if we are leavning
20248 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20250 * modifiers.cs: Fix the computation of MethodAttributes flags.
20252 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20254 * driver.cs: allow compilation of files that start with '/'.
20255 Add a default case when checking the argument of --target.
20257 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20259 * interface.cs: Implement the same search algorithm for types in
20260 the interface code.
20262 * delegate.cs: Do not allow multiple definition.
20264 * Recovered ChangeLog that got accidentally amputated
20266 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20268 * rootcontext.cs: Load manually enum to allow core classes to
20269 contain enumerations.
20271 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20272 Update to new static methods in TypeManager.
20274 * typemanager.cs (GetMethod, GetConstructor): Use our
20275 implementation of FindMembers to find the members, since during
20276 corlib compilation, the types are TypeBuilders and GetMethod and
20277 GetConstructor do not work.
20279 Make all methods in TypeManager static.
20281 (InitCodeHelpers): Split the functionality from
20282 the InitCodeTypes function.
20284 * driver.cs: Call InitCodeHelpers after we have populated the
20287 * cs-parser.jay (delegate_declaration): we did not used to compute
20288 the delegate name correctly for void delegates.
20290 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20292 * rootcontext.cs (RootContext): Init the interface_resolve_order
20293 and type_container_resolve_order always.
20295 (ResolveCore, BootstrapCorlib_ResolveClass,
20296 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20297 compiler when compiling with --nostdlib
20299 * class.cs (TypeContainer.DefineType): Check that our parent is
20300 not null. This test is most important when we are bootstraping
20303 * codegen.cs: Split out the symbol writing code.
20305 2002-03-25 Martin Baulig <martin@gnome.org>
20307 * driver.cs (-g): Made -g an alias for --debug.
20309 2002-03-24 Martin Baulig <martin@gnome.org>
20311 * codegen.cs (SymbolWriter): New public variable. Returns the
20312 current symbol writer.
20313 (CodeGen): Added `bool want_debugging_support' argument to the
20314 constructor. If true, tell the ModuleBuild that we want debugging
20315 support and ask it for the ISymbolWriter.
20316 (Save): If we have a symbol writer, call it's Close() method after
20317 saving the assembly.
20319 * driver.c (--debug): New command line argument to create a
20320 debugger information file.
20322 * location.cs (SymbolDocument): New public property. Returns an
20323 ISymbolDocumentWriter object for the current source file or null
20324 if we don't have a symbol writer.
20326 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20328 * driver.cs (LoadAssembly): Correctly return when all the paths
20329 have been tried and not before.
20331 * statement.cs (Switch.Emit): return the actual coverage for this
20332 statement (returns/not-returns)
20334 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20335 switch of the statement if we are the last switch section. That
20336 kills two problems: try/catch problems (we used to emit an empty
20337 nop at the end) and switch statements where all branches would
20340 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20342 * driver.cs: Add default assemblies (the equivalent to the
20343 Microsoft CSC.RSP file)
20345 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20346 also update tokens_seen and set it to false.
20348 * driver.cs: Implement --recurse for Mike.
20350 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20351 correctly splitting out the paths.
20353 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20355 * interface.cs (Interface.PopulateProperty): Instead of using
20356 `parent' as the declaration space for the set parameters, use
20359 * support.cs (InternalParameters): InternalParameters constructor
20360 takes a DeclSpace instead of a TypeContainer.
20362 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20363 types are being initialized, load the address of it before calling
20366 (New): Provide a mechanism to disable the generation of local
20367 value type temporaries when the caller will be providing us with
20368 an address to store it.
20370 (ArrayCreation.EmitDynamicInitializers): Use it.
20372 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20374 * expression.cs (Invocation.EmitArguments): Only probe for array
20375 property if there is more than one argument. Sorry about that.
20377 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20378 empty param arrays.
20380 * class.cs (Method.LabelParameters): Fix incorrect code path that
20381 prevented the `ParamArrayAttribute' from being applied to the
20384 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20386 * support.cs (ReflectionParameters): Correctly compute whether the
20387 last argument is a params array. Fixes the problem with
20390 * typemanager.cs: Make the assemblies array always be non-null
20391 (empty, but non-null)
20393 * tree.cs (RecordDecl): New function that abstracts the recording
20394 of names. This reports error 101, and provides a pointer to the
20395 previous declaration. Fixes a crash in the compiler.
20397 * cs-parser.jay (constructor_declaration): Update to new grammar,
20398 and provide a constructor_body that can be empty.
20400 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20402 * driver.cs: Add support for --resources.
20404 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20405 Make all types for the various array helper methods be integer.
20407 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20408 CheckState to ConvCast.
20410 (ConvCast): Now it takes a `checked' state argument, to avoid
20411 depending on the emit context for the conversion, and just using
20412 the resolve time setting.
20414 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20415 instead of Invocation.EmitArguments. We do not emit the original
20416 arguments, instead we emit those which have been converted to
20417 unsigned int expressions.
20419 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20421 * codegen.cs: ditto.
20423 * expression.cs (LocalVariableReference): Drop the use of the
20424 Store function that depended on the variable index.
20426 * statement.cs (VariableInfo): Drop the `Idx' property from this
20427 class, as this is not taking into account the indexes for
20428 temporaries tat we generate during the execution, getting the
20431 * class.cs: First emit class initializers, then call the parent
20434 * expression.cs (Binary): Fix opcode emision.
20435 (UnaryMutator.EmitCode): Support checked code generation
20437 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20438 matches for events for both the Static and Instance scans,
20439 pointing to the same element. Fix that.
20441 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20443 * rootcontext.cs (ResolveTree): Always set the
20444 interface_resolve_order, because nested interfaces will be calling
20447 * class.cs (GetInterfaceOrClass): Track the same resolution
20448 process used by TypeManager.LookupType. This fixes the nested
20449 type lookups in class declarations (separate path from
20452 (TypeContainer.DefineType): Also define nested interfaces.
20453 (TypeContainer.RegisterOrder): New public function used to
20454 register the order in which child interfaces need to be closed.
20456 Nested interfaces need to be closed after their parents have been
20459 * interface.cs (InterfaceAttr): Put all the logic for computing
20460 the interface attribute here.
20462 (DefineInterface): Register our interface order with the
20463 RootContext or with the TypeContainer depending on the case.
20465 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20467 * cs-parser.jay: rework foreach statement to work with the new
20468 changes to the policy on SimpleNames.
20470 * report.cs: support Stacktrace on warnings as well.
20472 * makefile: drop --unsafe and /unsafe from the compile.
20474 2002-03-13 Ravi Pratap <ravi@ximian.com>
20476 * ecore.cs (StandardConversionExists): Modify to take an Expression
20477 as the first parameter. Ensure we do null -> reference type conversion
20480 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20481 temporary Expression objects.
20483 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20485 * interface.cs: workaround bug in method overloading resolution
20486 (there is already a bugzilla bug for it).
20488 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20490 We could also solve this problem by having a separate path for
20491 performing type lookups, instead of DoResolve, we could have a
20492 ResolveType entry point, and only participating pieces of the
20493 production (simplename, deref, array) would implement this.
20495 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20496 signal SimpleName to only resolve type names and not attempt to
20497 resolve anything else.
20499 * expression.cs (Cast): Set the flag.
20501 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20503 * class.cs: Only report 108 if there is no `new' modifier.
20505 * cs-parser.jay: rework foreach statement to work with the new
20506 changes to the policy on SimpleNames.
20508 * report.cs: support Stacktrace on warnings as well.
20510 * makefile: drop --unsafe and /unsafe from the compile.
20512 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20514 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20515 lookups here, instead of doing that at parse time. This means
20516 that our grammar will not introduce `LocalVariableReferences' as
20517 expressions at this point. That solves the problem of code like
20521 static void Main ()
20525 This is only half the fix. The full fix requires parameters to
20526 also be handled in this way.
20528 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20529 makes the use more obvious of the DeclSpace. The
20530 ec.TypeContainer.TypeBuilder is now only used to pull the
20531 TypeBuilder for it.
20533 My theory is that I can get rid of the TypeBuilder completely from
20534 the EmitContext, and have typecasts where it is used (from
20535 DeclSpace to where it matters).
20537 The only pending problem is that the code that implements Aliases
20538 is on TypeContainer, and probably should go in DeclSpace.
20540 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20541 lookups here, instead of doing that at parse time. This means
20542 that our grammar will not introduce `LocalVariableReferences' as
20543 expressions at this point. That solves the problem of code like
20547 static void Main ()
20551 This is only half the fix. The full fix requires parameters to
20552 also be handled in this way.
20554 * class.cs (Property.DefineMethod): When implementing an interface
20555 method, set newslot, when implementing an abstract method, do not
20556 set the flag (before we tried never setting it, or always setting
20557 it, which is the difference).
20558 (Indexer.DefineMethod): same.
20559 (Method.DefineMethod): same.
20561 * ecore.cs: Only set the status used flag if we get back a Field.
20563 * attribute.cs: Temporary hack, so Paolo can keep working.
20565 2002-03-08 Ravi Pratap <ravi@ximian.com>
20567 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20568 the unmanaged type in the case we have a MarshalAs attribute.
20570 (Resolve): Handle the case when we are parsing the special MarshalAs
20571 attribute [we need to store the unmanaged type to use later]
20573 * typemanager.cs (marshal_as_attr_type): Built in type for the
20574 MarshalAs Attribute.
20576 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20577 on parameters and accordingly set the marshalling info.
20579 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20581 * class.cs: Optimizing slightly by removing redundant code after
20582 we switched to the `NoTypes' return value.
20583 (Property.DefineMethod): use NoTypes here too.
20585 This fixes the bug I introduced in my last batch of changes.
20587 2002-03-05 Ravi Pratap <ravi@ximian.com>
20589 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20591 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20592 Enums since those are types too.
20594 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20596 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20597 thanks to a call during the lookup process.
20599 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20601 * statement.cs (Foreach): Lots of work to accomodate a particular
20602 kind of foreach statement that I had not kept in mind. It is
20603 possible to have foreachs on classes that provide a GetEnumerator
20604 method that return objects that implement the "pattern" for using
20605 a foreach, there is no need to support GetEnumerator
20608 This is needed to compile nant.
20610 * decl.cs: Only report 114 if the member is not `Finalize' and if
20611 the warning level is at least 2.
20613 * class.cs: Moved the compare function from Method to
20616 (MethodSignature.InheritableMemberSignatureCompare): Add new
20617 filter function that is used to extract inheritable methods from a
20620 (Method.Define): Use the new `inheritable_method_signature_filter'
20623 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20626 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20628 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20630 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20632 * expression.cs: Pass location information to
20633 ConvertImplicitStandard.
20635 * class.cs: Added debugging code to track return values from
20638 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20640 * expression.cs (Is.DoResolve): If either side of the `is' is an
20641 interface, do not flag the warning.
20643 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20646 * report.cs: Allow for --fatal to be used with --probe.
20648 * typemanager.cs (NoTypes): Move the definition for the empty Type
20651 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20653 (TypeContainer.DefineProxy): New function used to proxy to parent
20654 implementations when implementing interfaces.
20655 (TypeContainer.ParentImplements): used to lookup if our parent
20656 implements a public function that is required by an interface.
20657 (TypeContainer.VerifyPendingMethods): Hook this up.
20659 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20660 `modules' and `assemblies' arraylists into arrays. We only grow
20661 these are the very early start up of the program, so this improves
20662 the speedof LookupType (nicely measured).
20664 * expression.cs (MakeByteBlob): Replaced unsafe code with
20665 BitConverter, as suggested by Paolo.
20667 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20668 folding of string concatenation, but if either side is a string,
20669 and the other is not, then return null, and let the runtime use
20670 the concatenation on the string plus the object (using
20671 `Object.ToString').
20673 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20675 Constant Folding has been implemented now.
20677 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20678 the error instead on types that are not supported in one's
20681 * constant.cs (Constant and all children): New set of functions to
20682 perform implict and explicit conversions.
20684 * ecore.cs (EnumConstant): Implement the new functions to perform
20685 conversion by proxying to the child expression.
20687 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20688 own separate setting that can not be turned off from the command
20689 line using --unchecked or --checked and is only controlled using
20690 the checked/unchecked statements and expressions. This setting is
20691 used by the constant folder to flag errors.
20693 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20694 ConstantCheckState as well.
20696 During Resolve, they also have to flag the state, because the
20697 constant folder runs completely in the Resolve phase.
20699 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20702 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20704 * cfold.cs: New file, this file contains the constant folder.
20706 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20707 argument to track whether we are using the resulting address to
20708 load or store a value and provide better error messages.
20710 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20711 new AddressOf arguments.
20713 * statement.cs (Foreach.EmitCollectionForeach): Update
20715 * expression.cs (Argument.Emit): Call AddressOf with proper
20716 arguments to track usage.
20718 (New.DoEmit): Call AddressOf with new arguments.
20720 (Unary.Emit): Adjust AddressOf call.
20722 2002-03-01 Ravi Pratap <ravi@ximian.com>
20724 * cs-parser.jay (member_access): Change the case for pre-defined types
20725 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20728 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20731 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20732 essentially like methods and apply attributes like MethodImplOptions to them too.
20734 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20737 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20738 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20741 * Update code everywhere accordingly.
20743 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20745 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20747 2002-02-28 Ravi Pratap <ravi@ximian.com>
20749 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20750 try performing lookups against those instead of jumping straight into using
20751 the 'using' clauses.
20753 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20755 (LookupType): Perform lookups in implicit parents too.
20757 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20758 sequence as RootContext.LookupType.
20760 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20761 the various cases of namespace lookups into this method.
20763 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20765 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20766 in positional arguments)
20768 * class.cs (Operator): Update the AllowedModifiers to contain
20771 * cs-parser.jay: Update operator declaration to allow for the
20772 operator body to be empty.
20774 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20777 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20779 * class.cs (Method.Emit): Label parameters.
20781 * driver.cs: Return 1 or 0 as the program exit code.
20783 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20785 * expression.cs: Special case the `null' object when trying to
20786 auto-compute the type, as anything can be explicitly converted to
20789 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20790 spotting this Paolo.
20792 (Expression.ImplicitNumericConversion): Perform comparissions of
20793 the type using the underlying type in the case of an enumeration
20794 rather than using the enumeration type for the compare.
20796 Cope with the underlying == type case, which is not possible to
20799 (Expression.ConvertNumericExplicit): Perform comparissions of
20800 the type using the underlying type in the case of an enumeration
20801 rather than using the enumeration type for the compare.
20803 * driver.cs: If the user does not supply an extension, assume .exe
20805 * cs-parser.jay (if_statement): Rewrote so that we can track the
20806 location for the if statement.
20808 * expression.cs (Binary.ConstantFold): Only concat strings when
20809 the operation is "+", not everything ;-)
20811 * statement.cs (Statement.EmitBoolExpression): Take a location
20813 (If, While, Do): Track location.
20815 * expression.cs (Binary.ResolveOperator): In the object + string
20816 case, I was missing a call to ConvertImplicit
20818 2002-02-25 Ravi Pratap <ravi@ximian.com>
20820 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20821 Location arguments. Ensure we use RootContext.LookupType to do our work
20822 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20824 * interface.cs (PopulateMethod): Handle the type of the parameter being
20827 * expression.cs (Invocation.BetterFunction): Handle the case when we
20828 have a params method with no fixed arguments and a call is made with no
20831 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20833 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20834 the verbatim-string-literal
20836 * support.cs (InternalParameters.ParameterModifier): handle null
20838 (InternalParameters.ParameterType): ditto.
20840 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20841 duplicating the name of the variable parameter.
20842 (GetParameterByName): Fix bug where we were not looking up array
20843 paramters if they were the only present (thanks Paolo!).
20844 (GetParameterInfo): We only have an empty set of types if both
20845 fixed and array are set to null.
20846 (GetParameterInfo-idx): Handle FixedParameter == null
20848 * cs-parser.jay: Handle the case where there is no catch
20849 statements (missing null test).
20851 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20853 * driver.cs (MainDriver): Be conservative on our command line
20856 Catch DirectoryNotFoundException when calling GetFiles.
20858 (SplitPathAndPattern): Used to split the input specification into
20859 a path and a pattern that we can feed to Directory.GetFiles.
20861 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20863 * statement.cs (Fixed): Implement the last case of the Fixed
20864 statement (string handling).
20866 * expression.cs (StringPtr): New class used to return a char * to
20867 a string; Used by the Fixed statement.
20869 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20871 * expression.cs (Binary.ResolveOperator): Remove redundant
20872 MemberLookup pn parent type.
20873 Optimize union call, we do not need a union if the types are the same.
20874 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20877 Specialize the use of MemberLookup everywhere, instead of using
20878 the default settings.
20880 (StackAlloc): Implement stackalloc keyword.
20882 * cs-parser.jay: Add rule to parse stackalloc.
20884 * driver.cs: Handle /h, /help, /?
20886 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20887 before we supported unsafe code.
20889 * makefile: add --unsafe to the self compilation of mcs.
20891 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20893 * expression.cs (PointerArithmetic): New class that is used to
20894 perform pointer arithmetic.
20895 (Binary.Resolve): Handle pointer arithmetic
20896 Handle pointer comparission.
20897 (ArrayPtr): Utility expression class that is used to take the
20898 address of an array.
20900 (ElementAccess): Implement array access for pointers
20902 * statement.cs (Fixed): Implement fixed statement for arrays, we
20903 are missing one more case before we are done.
20905 * expression.cs (Indirection): Implement EmitAssign and set the
20906 ExprClass to Variable. This allows pointer dereferences to be
20907 treated as variables, and to have values assigned to them.
20909 * ecore.cs (Expression.StoreFromPtr): New utility function to
20910 store values dereferencing.
20912 2002-02-20 Ravi Pratap <ravi@ximian.com>
20914 * expression.cs (Binary.ResolveOperator): Ensure that we are
20915 not trying to operate on a void type - this fixes the reported
20918 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20919 the parent implementation is sealed.
20921 * ../errors/cs0239.cs : Add.
20923 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20925 * typemanager.cs (unverifiable_code_type): Corresponds to
20926 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20927 which have unsafe code in them.
20929 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20932 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20934 * cs-tokenizer.cs: Add support for @"litreal strings"
20936 Make tokenizer accept pre-processor directives
20937 on any column (remove the old C-like limitation).
20939 * rootcontext.cs (EmitCode): Emit any global attributes.
20940 (AddGlobalAttributes): Used to keep track of assembly attributes.
20942 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20944 * cs-parser.jay: Add support for global attributes.
20946 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20948 * expression.cs (Indirection): New helper class. Unary will
20949 create Indirection classes to be able to implement the
20950 IMemoryLocation interface on it.
20952 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20954 * cs-parser.jay (fixed_statement): reference the right statement.
20956 * statement.cs (Fixed.Emit): Finish implementing the fixed
20957 statement for the &x case.
20959 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20961 * class.cs (Property.Define, Method.Define): Remove newslot when
20964 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20965 wrong. NewSlot should only be used if the `new' keyword is present.
20967 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20968 locating our system dir. Sorry about this.
20970 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20972 * driver.cs (GetSystemDir): Compute correctly the location of our
20973 system assemblies. I was using the compiler directory instead of
20974 the library directory.
20976 2002-02-13 Ravi Pratap <ravi@ximian.com>
20978 * expression.cs (BetterFunction): Put back in what Miguel commented out
20979 since it is the correct fix. The problem is elsewhere ;-)
20981 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20982 parameters of the parms method are themselves compatible or not !
20984 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20985 to check that a class implements an interface before saying that an implicit
20986 conversion was allowed. Use ImplementsInterface to do the checking.
20988 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20990 * class.cs (Method.Define): Track whether we are an explicit
20991 implementation or not. And only call DefineMethodOverride if we
20992 are an explicit implementation.
20994 (Property.DefineMethod): Ditto.
20996 2002-02-11 Ravi Pratap <ravi@ximian.com>
20998 * expression.cs (BetterFunction): Catch hideous bug which was
20999 preventing us from detecting ambiguous calls due to implicit casts i.e
21002 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21004 * support.cs (Pair): Remove un-needed method. I figured why I was
21005 getting the error in cs-parser.jay, the variable in a foreach loop
21006 is readonly, and the compiler does not really treat this as a variable.
21008 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21009 instead of EQUALS in grammar.
21011 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21013 * expression.cs (Unary.DoResolve): Check whether the argument is
21016 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21018 * support.cs: Api for Pair to set a value. Despite the fact that
21019 the variables are public the MS C# compiler refuses to compile
21020 code that accesses the field if the variable is part of a foreach
21023 * statement.cs (Fixed): Begin implementation of the fixed
21026 (Block.AddVariable): Return the VariableInfo on success and null
21027 on failure instead of true/false.
21029 * cs-parser.jay (foreach): Catch errors on variables already
21030 defined (we were ignoring this value before) and properly unwind
21031 the block hierarchy
21033 (fixed_statement): grammar for the fixed statement.
21035 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21037 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21038 pointer types to be incretemented.
21040 (SizeOf): Implement.
21042 * cs-parser.jay (pointer_member_access): Implement
21043 expr->IDENTIFIER production.
21045 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21046 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21049 (Unary): Implement indirection.
21051 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21052 use in non-unsafe context).
21054 (SimpleName.DoResolve): Check for pointers in field access on safe
21057 (Expression.LoadFromPtr): Factor the load-indirect code in this
21058 function. This was duplicated in UnboxCast and ParameterReference
21060 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21062 * expression.cs (ComposedCast): report an error if a pointer cast
21063 is used in a safe region.
21065 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21066 pointer type casts in unsafe context.
21068 * codegen.cs (EmitContext): Set up IsUnsafe.
21070 * cs-parser.jay (non_expression_type): Add productions for pointer
21073 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21074 code. We should not use force into static mode if the method is
21075 not virtual. Fixes bug in MIS
21077 * statement.cs (Do.Emit, While.Emit, For.Emit,
21078 Statement.EmitBoolExpression): Add support to Do and While to
21079 propagate infinite loop as `I do return' semantics.
21081 Improve the For case to also test for boolean constants.
21083 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21084 to the list of attributes we can add.
21086 Remove `EmitContext' argument.
21088 * class.cs (Method.Define): Apply parameter attributes.
21089 (Constructor.Define): Apply parameter attributes.
21090 (MethodCore.LabelParameters): Move here the core of labeling
21093 * support.cs (ReflectionParameters.ParameterModifier,
21094 InternalParameters.ParameterModifier): Use IsByRef on the type and
21095 only return the OUT bit for these parameters instead of in/out/ref
21098 This is because I miss-understood things. The ParameterInfo.IsIn
21099 and IsOut represent whether the parameter has the [In] and [Out]
21102 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21104 * ecore.cs (FieldExpr.Emit): Release temporaries.
21106 * assign.cs (LocalTemporary.Release): new function.
21108 * codegen.cs (EmitContext.GetTemporaryStorage,
21109 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21110 temporary storage. Now we can "put back" localbuilders when we
21113 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21115 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21116 need to make a copy of the variable to generate verifiable code.
21118 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21120 * driver.cs: Compute dynamically the system directory.
21122 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21123 Slower, but more generally useful. Used by the abstract
21124 registering implementation.
21126 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21127 the rules for the special rule on Type/instances. First check if
21128 we have the same name, and if so, try that special static path
21129 rather than the instance path.
21131 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21133 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21136 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21137 Enum, ValueType, Delegate or Array for non-corlib compiles.
21139 * cs-tokenizer.cs: Catch long identifiers (645)
21141 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21144 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21145 fix, we were returning too early, so we were not registering
21146 pending methods from abstract classes.
21148 Do not register pending methods if the class is abstract.
21150 * expression.cs (Conditional.DoResolve): Report circular implicit
21151 conversions when we neecd to compute it for conditional
21154 (Is.DoResolve): If the expression is always of the provided type,
21155 flag warning 183. If the expression can not ever be of the
21156 provided type flag warning 184.
21158 * class.cs: Catch 169 as well.
21160 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21163 2002-01-18 Nick Drochak <ndrochak@gol.com>
21165 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21167 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21169 * interface.cs: (PopulateMethod): Check for pointers being defined
21170 only if the unsafe context is active.
21171 (PopulateProperty): ditto.
21172 (PopulateIndexer): ditto.
21174 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21175 specified. If pointers are present, make sure that they are
21176 present in an unsafe context.
21177 (Constructor, Constructor.Define): ditto.
21178 (Field, Field.Define): ditto.
21179 (Property, Property.Define): ditto.
21180 (Event, Event.Define): ditto.
21182 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21183 hashtable if there are classes or structs defined.
21185 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21186 code, as the constant resolution moved.
21188 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21189 the metadata, so we can flag error 133.
21191 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21192 pointer is being declared in an unsafe context.
21194 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21196 * modifiers.cs (Modifiers.Check): Require a Location argument.
21197 Report error 227 for Unsafe use.
21199 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21201 * statement.cs (For.Emit): If the test is null, then report that
21202 we do `return', as we wont reach anything afterwards.
21204 (Switch.SwitchGoverningType): Track the expression that matched
21207 * driver.cs: Allow negative numbers as an error code to flag.
21209 * cs-parser.jay: Handle 1551.
21211 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21213 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21215 * cs-parser.jay: Report 1518 (type declaration can only contain
21216 class, struct, interface, enum or delegate)
21218 (switch_label): Report 1523 (keywords `case' or `default' must
21221 (opt_switch_sections): Report 1522 (empty switch)
21223 * driver.cs: Report 1515 (response file specified multiple times)
21224 Report 1516 (Source file specified multiple times).
21226 * expression.cs (Argument.Resolve): Signal 1510
21228 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21229 access not allowed in static code)
21231 2002-01-11 Ravi Pratap <ravi@ximian.com>
21233 * typemanager.cs (IsPointerType): Utility method which we are going
21236 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21237 the object type, so we take care of that.
21239 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21241 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21242 added to non-params parameters :-)
21244 * typemanager.cs (CSharpName): Include 'void' type too.
21246 (void_ptr_type): Include in the set of core types.
21248 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21251 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21254 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21255 completely forgotten about it.
21257 2002-01-10 Ravi Pratap <ravi@ximian.com>
21259 * cs-parser.jay (pointer_type): Add. This begins our implementation
21260 of parsing rules for unsafe code.
21262 (unsafe_statement): Implement.
21264 (embedded_statement): Modify to include the above.
21266 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21268 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21269 if the current context is an unsafe one.
21271 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21272 are handled differently, we need separate rules for them.
21274 (local_variable_declaration): Update to use local_variable_pointer_type
21275 to allow variable declarations of unmanaged pointer types.
21277 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21278 in unsafe contexts.
21280 * ../errors/cs0214.cs : Add.
21282 2002-01-16 Nick Drochak <ndrochak@gol.com>
21284 * makefile: remove 'response' file when cleaning.
21286 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21288 * cs-parser.jay: Report 1524.
21290 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21292 * typemanager.cs (RegisterMethod): drop checking if we have
21293 registered this from here
21295 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21297 * class.cs (Method.EmitDestructor): Implement calling our base
21300 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21301 value of InFinally.
21303 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21304 this routine and will wrap the call in a try/catch block. Deal
21307 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21309 * ecore.cs (Expression.MemberLookup): instead of taking a
21310 parameter `same_type' that was used to tell whether we could
21311 access private members we compute our containing type from the
21314 (FieldExpr): Added partial support for volatile fields. This does
21315 not work for volatile fields exposed from assemblies, as I can not
21316 figure out how to extract the modreq from it.
21318 Updated all the source files to use this.
21320 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21321 because it is referenced by MemberLookup very often.
21323 2002-01-09 Ravi Pratap <ravi@ximian.com>
21325 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21326 TypeBuilder.GetCustomAttributes to retrieve what we need.
21328 Get rid of redundant default_member_attr_type as this is the same as
21329 default_member_type which already exists.
21331 * interface.cs, attribute.cs : Update accordingly.
21333 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21335 * typemanager.cs: Enable IndexerPropertyName again. It does not
21336 work for TYpeBuilders though. Ravi, can you please fix this?
21338 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21340 * expression.cs (Argument.Emit): Handle the case of ref objects
21341 being passed to ref functions;
21343 (ParameterReference.EmitLoad): Loads the content of the pointer
21344 without dereferencing.
21346 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21348 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21350 2002-01-08 Ravi Pratap <ravi@ximian.com>
21352 * class.cs (Indexer.DefineMethod): Incorporate the interface
21353 type in the name of the method if we are doing explicit interface
21356 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21358 (BetterConversion): Fix extremely trivial bug where we were referring to
21359 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21362 * ../errors/bug16.cs : Add although we have fixed it.
21364 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21366 * expression.cs (BaseIndexer): Begin implementation.
21368 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21370 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21371 production directly to remove a shift/reduce, and implement
21372 explicit interface implementation.
21374 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21375 after a floating point suffix.
21377 * expression.cs (DoNumericPromotions): Improved the conversion for
21378 uint/uint. If we have a constant, we avoid doing a typecast to a
21381 * class.cs (Indexer): Implement explicit interface implementation
21384 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21386 * class.cs: make the default instance constructor public and hidebysig.
21388 2001-01-03 Ravi Pratap <ravi@ximian.com>
21390 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21391 so we can call it from elsewhere.
21393 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21394 we emit it internally if the class has a defined indexer; otherwise the user
21395 emits it by decorating the class definition with the DefaultMemberAttribute.
21397 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21398 attribute is not used on a type which defines an indexer.
21400 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21401 character when we skip whitespace.
21403 * ../errors/cs0646.cs : Add.
21405 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21407 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21410 * makefile: Add practical target `mcs3.exe' which builds the third
21411 generation compiler.
21413 * expression.cs (New): Fix structures constructor calling.
21415 * class.cs (Property, Method, Indexer): Emit Final flag on the
21416 method if we are an interface implementation and we are not
21419 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21420 whether this property is referencing a `base' method.
21422 * expression.cs (Invocation.EmitCall): take an extra argument:
21423 is_base, this is used to determine whether the `call' or
21424 `callvirt' opcode should be used.
21427 * delegate.cs: update EmitCall.
21429 * class.cs (Method.Define): Set NewSlot for the cases where we are
21430 not implementing an interface method.
21432 (Property.Define): ditto.
21434 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21436 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21437 'r'. Allows mcs to parse itself fully.
21439 2002-01-02 Ravi Pratap <ravi@ximian.com>
21441 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21442 of the number of initializers that require the InitializeArray method.
21444 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21445 update the above field where necessary.
21447 (MakeByteBlob): Update accordingly.
21449 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21452 (EmitDynamicInitializers): Update in accordance with the new optimization.
21454 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21455 same OpCode applies.
21457 * cs-parser.jay : Fix some glaring errors I introduced.
21459 2002-01-01 Ravi Pratap <ravi@ximian.com>
21461 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21462 so that we can check for name clashes there too.
21464 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21465 for interface indexers.
21467 * interfaces.cs (Define): Emit the default member attribute.
21469 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21470 variable was being referred to while setting the value ;-)
21472 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21474 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21475 byte-by-byte information when we know the data is zero.
21477 Make the block always a multiple of 4, because
21478 DefineInitializedData has a bug.
21480 * assign.cs: Fix, we should assign from the temporary, not from
21483 * expression.cs (MakeByteBlob): Fix my incorrect code.
21485 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21487 * typemanager.cs (EnumToUnderlying): This function is used to get
21488 the underlying type from an enumeration, because it does not
21491 * constant.cs: Use the I4_S form for values between -128 and 127.
21493 * statement.cs (Block.LookupLabel): Looks up a label.
21494 (Block): Drop support for labeled blocks.
21496 (LabeledStatement): New kind of statement that represents a label
21499 (Goto): Finally implement this bad boy.
21501 * cs-parser.jay: Update to reflect new mechanism to implement
21504 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21506 * codegen.cs (EmitContext.This): a codegen property that keeps the
21507 a single instance of this instead of creating many different this
21510 * delegate.cs (Delegate.DoResolve): Update to use the property;
21512 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21514 * expression.cs (BaseAccess.DoResolve): Ditto.
21516 2001-12-29 Ravi Pratap <ravi@ximian.com>
21518 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21519 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21521 (InitCoreTypes): Update accordingly.
21523 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21524 so we can quickly store the state.
21526 (ApplyAttributes): Set the correct implementation flags
21527 for InternalCall methods.
21529 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21531 * expression.cs (EmitCall): if a method is not virtual, then do
21532 not use callvirt on it.
21534 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21535 user defined stuff) requires the use of stobj, which takes an
21536 address on the stack instead of an array and an index. So emit
21537 the Ldelema operation for it.
21539 (EmitStoreOpcode): Use stobj for valuetypes.
21541 (UnaryMutator.EmitCode): Use the right 1 value depending on
21542 whether we are dealing with int64/uint64, float or doubles.
21544 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21545 constructors that I implemented last night.
21547 (Constructor.IsDefault): Fix to work properly for static
21550 * cs-parser.jay (CheckDef): report method signature errors.
21551 Update error number 103 to be 132.
21553 * decl.cs: New AdditionResult enumeration value: MethodExists.
21554 Although we do this check for methods later on in the semantic
21555 analysis, catching repeated default constructors is so easy that
21556 we catch these here.
21558 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21561 (ParameterReference.EmitAssign, Emit): handle
21564 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21565 (ArrayAccess.EmitStoreOpcode): ditto.
21567 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21569 * expression.cs (MakeByteBlob): Complete all the missing types
21570 (uint, short, ushort, byte, sbyte)
21572 * class.cs: Only init instance field initializers on instance
21575 Rename `constructors' to instance_constructors.
21577 (TypeContainer.AddConstructor): Only add constructors to the list
21578 if it is not static.
21580 Make sure that we handle default_static_constructor independently
21581 everywhere where we handle instance_constructors
21583 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21585 * class.cs: Do not lookup or create a base initializer for a
21586 static constructor.
21588 (ConstructorInitializer.Resolve): use the proper type to lookup
21591 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21593 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21596 * decl.cs: CloseType is now an virtual method, the default
21597 implementation just closes this type.
21599 2001-12-28 Ravi Pratap <ravi@ximian.com>
21601 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21602 to PreserveSig by default. Also emit HideBySig on such methods.
21604 Basically, set the defaults to standard values.
21606 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21607 argument, if candidate is better, it can't be worse than the best !
21609 (Invocation): Re-write bits to differentiate between methods being
21610 applicable in their expanded form and their normal form - for params
21613 Get rid of use_standard everywhere as only standard conversions are allowed
21614 in overload resolution.
21616 More spec conformance.
21618 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21620 * driver.cs: Add --timestamp, to see where the compiler spends
21623 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21624 `this' in static code.
21626 (SimpleName.DoResolve): Implement in terms of a helper function
21627 that allows static-references to be passed upstream to
21630 (Expression.ResolveWithSimpleName): Resolve specially simple
21631 names when called by MemberAccess to implement the special
21634 (Expression.ImplicitReferenceConversion): Handle conversions from
21635 Null to reference types before others, as Null's type is
21638 * expression.cs (Invocation.EmitCall): Handle the special case of
21639 calling methods declared on a reference type from a ValueType
21640 (Base classes System.Object and System.Enum)
21642 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21643 the left hand side is a TypeExpr, not on every enumeration.
21645 (Binary.Resolve): If types are reference types, then do a cast to
21646 object on operators != and == of both arguments.
21648 * typemanager.cs (FindMembers): Extract instance and static
21649 members if requested.
21651 * interface.cs (PopulateProperty): Use void_type instead of null
21652 as the return type for the setter method.
21654 (PopulateIndexer): ditto.
21656 2001-12-27 Ravi Pratap <ravi@ximian.com>
21658 * support.cs (ReflectionParameters): Fix minor bug where we
21659 were examining the wrong parameter for the ParamArray attribute.
21661 Cope with requests for the type of the parameter at position
21662 greater than the params parameter's. We now return the element
21663 type of the params array as that makes more sense.
21665 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21666 accordingly as we no longer have to extract the element type
21669 (Invocation.OverloadResolve): Update.
21671 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21673 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21674 against IEnumerator, test whether the return value is a descendant
21675 of the IEnumerator interface.
21677 * class.cs (Indexer.Define): Use an auxiliary method to implement
21678 the other bits of the method definition. Begin support for
21679 explicit interface implementation.
21681 (Property.DefineMethod): Use TypeManager.void_type instead of null
21682 for an empty return value.
21684 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21686 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21687 dealing with a FieldExpr which is composed of a FieldBuilder, in
21688 the code path we did extract the constant, but we should have
21689 obtained the underlying value to be able to cast it (otherwise we
21690 end up in an infinite loop, this is what Ravi was running into).
21692 (ArrayCreation.UpdateIndices): Arrays might be empty.
21694 (MemberAccess.ResolveMemberAccess): Add support for section
21695 14.5.4.1 that deals with the special case of E.I when E is a type
21696 and something else, that I can be a reference to a static member.
21698 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21699 handle a particular array type to create byte blobs, it is just
21700 something we dont generate byteblobs for.
21702 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21705 * location.cs (Push): remove the key from the hashtable that we
21706 are about to add. This happens for empty files.
21708 * driver.cs: Dispose files after we have parsed them.
21710 (tokenize): new function that only runs the tokenizer on its
21711 input, for speed testing.
21713 2001-12-26 Ravi Pratap <ravi@ximian.com>
21715 * class.cs (Event.Define): Define the private field only if there
21716 are no accessors defined.
21718 * expression.cs (ResolveMemberAccess): If there is no associated
21719 field with the event, that means we have an event defined with its
21720 own accessors and we should flag error cs0070 since transforming
21721 ourselves into a field is not valid in that case.
21723 * ecore.cs (SimpleName.DoResolve): Same as above.
21725 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21726 and charset to sane values.
21728 2001-12-25 Ravi Pratap <ravi@ximian.com>
21730 * assign.cs (DoResolve): Perform check on events only if they
21731 are being accessed outside the declaring type.
21733 * cs-parser.jay (event_declarations): Update rules to correctly
21734 set the type of the implicit parameter etc.
21736 (add_accessor, remove_accessor): Set current local parameters.
21738 * expression.cs (Binary): For delegate addition and subtraction,
21739 cast the return value from the method into the appropriate delegate
21742 2001-12-24 Ravi Pratap <ravi@ximian.com>
21744 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21745 of these as the workaround is unnecessary.
21747 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21748 delegate data - none of that is needed at all.
21750 Re-write bits to extract the instance expression and the delegate method
21753 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21756 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21757 of attaching attributes instead of duplicating code everywhere.
21759 * everywhere : Update code to do attribute emission using the above method.
21761 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21763 * expression.cs (IsParamsMethodApplicable): if there are not
21764 parameters, return immediately.
21766 * ecore.cs: The 0 literal can be implicity converted to an enum
21769 (SimpleName.DoResolve): First lookup the type, then lookup the
21772 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21773 want to get its address. If the InstanceExpression is not
21774 addressable, store the result in a temporary variable, then get
21777 * codegen.cs: Only display 219 errors on warning level or above.
21779 * expression.cs (ArrayAccess): Make it implement the
21780 IMemoryLocation interface.
21782 (Binary.DoResolve): handle the operator == (object a, object b)
21783 and operator != (object a, object b) without incurring into a
21784 BoxedCast (because 5 != o should never be performed).
21786 Handle binary enumerator operators.
21788 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21789 value type, otherwise use Ldelem_ref.
21791 Use precomputed names;
21793 (AddressOf): Implement address of
21795 * cs-parser.jay (labeled_statement): Fix recursive block
21796 addition by reworking the production.
21798 * expression.cs (New.DoEmit): New has a special case:
21800 If we are dealing with a ValueType, we have a few
21801 situations to deal with:
21803 * The target of New is a ValueType variable, that is
21804 easy, we just pass this as the variable reference
21806 * The target of New is being passed as an argument,
21807 to a boxing operation or a function that takes a
21810 In this case, we need to create a temporary variable
21811 that is the argument of New.
21814 2001-12-23 Ravi Pratap <ravi@ximian.com>
21816 * rootcontext.cs (LookupType): Check that current_type is not null before
21817 going about looking at nested types.
21819 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21820 not implement the IAssignMethod interface any more.
21822 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21823 where we tranform them into FieldExprs if they are being resolved from within
21824 the declaring type.
21826 * ecore.cs (SimpleName.DoResolve): Do the same here.
21828 * assign.cs (DoResolve, Emit): Clean up code considerably.
21830 * ../errors/bug10.cs : Add.
21832 * ../errors/cs0070.cs : Add.
21834 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21836 * assign.cs : Get rid of EventIsLocal everywhere.
21838 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21840 * ecore.cs (ConvertIntLiteral): finished the implementation.
21842 * statement.cs (SwitchLabel): Convert the value we are using as a
21843 key before looking up the table.
21845 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21847 * codegen.cs (EmitTopBlock): Require a Location argument now.
21849 * cs-parser.jay (constructor_declarator): We need to setup
21850 current_local_parameters before we parse the
21851 opt_constructor_initializer, to allow the variables to be bound
21852 to the constructor arguments.
21854 * rootcontext.cs (LookupType): First lookup nested classes in our
21855 class and our parents before we go looking outside our class.
21857 * expression.cs (ConstantFold): Extract/debox the values at the
21860 * rootcontext.cs (EmitCode): Resolve the constants first before we
21861 resolve the types. This is not really needed, but it helps debugging.
21863 * statement.cs: report location.
21865 * cs-parser.jay: pass location to throw statement.
21867 * driver.cs: Small bug fix.
21869 * report.cs: Updated format to be 4-zero filled digits.
21871 2001-12-22 Ravi Pratap <ravi@ximian.com>
21873 * expression.cs (CheckIndices): Fix minor bug where the wrong
21874 variable was being referred to ;-)
21876 (DoEmit): Do not call EmitStaticInitializers when the
21877 underlying type is System.Object.
21879 2001-12-21 Ravi Pratap <ravi@ximian.com>
21881 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21882 and do the usual workaround for SRE.
21884 * class.cs (MyEventBuilder.EventType): New member to get at the type
21885 of the event, quickly.
21887 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21889 * assign.cs (Assign.DoResolve): Handle the case when the target
21890 is an EventExpr and perform the necessary checks.
21892 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21895 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21897 (EventExpr): Set the type in the constructor itself since we
21898 are meant to be born fully resolved.
21900 (EventExpr.Define): Revert code I wrote earlier.
21902 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21903 instance expression is null. The instance expression is a This in that case
21904 or a null, depending on whether it is a static method or not.
21906 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21907 refers to more than one method.
21909 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21910 and accordingly flag errors.
21912 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21914 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21916 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21918 * location.cs (ToString): Provide useful rutine.
21920 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21922 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21923 objects, return the actual integral boxed.
21925 * statement.cs (SwitchLabel): define an ILLabel for each
21928 (Switch.CheckSwitch): If the value is a Literal, extract
21929 the underlying literal.
21931 Also in the unused hashtable we had, add the SwitchLabel so we can
21932 quickly look this value up.
21934 * constant.cs: Implement a bunch of new constants. Rewrite
21935 Literal based on this. Made changes everywhere to adapt to this.
21937 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21938 dereferencing array only once, and also copes with enumrations.
21940 bytes are two bytes wide, not one.
21942 (Cast): Perform constant conversions.
21944 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21945 wrappers to the literals here.
21947 * expression.cs (DoNumericPromotions): long literals can converted
21948 to ulong implicity (this is taken care of elsewhere, but I was
21949 missing this spot).
21951 * ecore.cs (Expression.Literalize): Make the return type Literal,
21952 to improve type checking.
21954 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21956 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21958 * literal.cs: Revert code from ravi that checked the bounds. The
21959 bounds are sane by the definition of the type itself.
21961 * typemanager.cs: Fix implementation of ImplementsInterface. We
21962 need to actually look up in our parent hierarchy for interfaces
21965 * const.cs: Use the underlying type for enumerations
21967 * delegate.cs: Compute the basename for the delegate creation,
21968 that should fix the delegate test case, and restore the correct
21969 Type Lookup semantics in rootcontext
21971 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21972 referencing a nested type with the Reflection API is using the "+"
21975 * cs-parser.jay: Do not require EOF token at the end.
21977 2001-12-20 Ravi Pratap <ravi@ximian.com>
21979 * rootcontext.cs (LookupType): Concatenate type names with
21980 a '.' instead of a '+' The test suite passes again.
21982 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21983 field of the enumeration.
21985 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21986 the case when the member is an EventExpr.
21988 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21989 static has an associated instance expression.
21991 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21993 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21995 * class.cs (Event.Define): Register event and perform appropriate checks
21998 We define the Add and Remove methods even if the use provides none because
21999 in that case, we provide default implementations ourselves.
22001 Define a private field of the type of the event. This is done by the CSC compiler
22002 and we should be doing it too ;-)
22004 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22005 More methods we use in code we generate.
22007 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22010 (InitCoreTypes): Update accordingly for the above.
22012 * class.cs (Event.Emit): Generate code for default accessors that we provide
22014 (EmitDefaultMethod): Do the job in the above.
22016 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22019 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22021 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22022 builders even if we were missing one.
22024 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22025 pass the Basename as our class name instead of the Name. The
22026 basename will be correctly composed for us.
22028 * parameter.cs (Paramters): Now takes a Location argument.
22030 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22031 make all the code call directly LookupType in RootContext and take
22032 this chance to pass the Location information everywhere.
22034 * Everywhere: pass Location information.
22036 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22038 * class.cs (Constructor.Define): Updated way of detecting the
22039 length of the parameters.
22041 (TypeContainer.DefineType): Use basename as the type name for
22044 (TypeContainer.Define): Do not recursively define types here, as
22045 definition is taken care in order by the RootContext.
22047 * tree.cs: Keep track of namespaces in a per-file basis.
22049 * parameter.cs (Parameter.ComputeSignature): Update to use
22052 (Parameters.GetSignature): ditto.
22054 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22055 instead of a TypeContainer.
22057 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22058 resolve names. Because we need to be resolve in our context, not
22061 * driver.cs: Implement response files.
22063 * class.cs (TypeContainer.DefineType): If we are defined, do not
22064 redefine ourselves.
22066 (Event.Emit): Emit the code for add/remove handlers.
22067 (Event.Define): Save the MethodBuilders for add/remove.
22069 * typemanager.cs: Use pair here too.
22071 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22072 DictionaryEntry requires the first argument to be non-null.
22074 (enum_declaration): Compute full name for registering the
22077 (delegate_declaration): Instead of using
22078 formal_parameter_list, use opt_formal_parameter_list as the list
22081 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22082 (EventParsing): New property that controls whether `add' and
22083 `remove' are returned as tokens or identifiers (for events);
22085 2001-12-19 Ravi Pratap <ravi@ximian.com>
22087 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22088 use MyEventBuilder only and let it wrap the real builder for us.
22090 (MyEventBuilder): Revamp constructor etc.
22092 Implement all operations that we perform on EventBuilder in precisely the same
22095 (FindMembers): Update to use the EventBuilder member.
22097 (Event.Emit): Update accordingly.
22099 2001-12-18 Ravi Pratap <ravi@ximian.com>
22101 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22102 by calling the appropriate methods.
22104 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22107 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22109 2001-12-17 Ravi Pratap <ravi@ximian.com>
22111 * delegate.cs (Delegate.Populate): Check that the return type
22112 and various parameters types are indeed accessible.
22114 * class.cs (Constructor.Define): Same here.
22116 (Field.Define): Ditto.
22118 (Event.Define): Ditto.
22120 (Operator.Define): Check that the underlying Method defined itself
22121 correctly - so it's MethodBuilder should not be null.
22123 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22124 expression happens to be null.
22126 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22127 members but as of now we don't seem to be able to do anything really useful with it.
22129 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22130 not the EventBuilder.
22132 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22134 * cs-tokenizer.cs: Add support for defines.
22135 Add support for #if, #elif, #else, #endif
22137 (eval_var): evaluates a variable.
22138 (eval): stubbed for evaluating functions.
22140 * cs-parser.jay: Pass the defines information
22142 * driver.cs: Add --define command line option.
22144 * decl.cs: Move MemberCore here.
22146 Make it the base class for DeclSpace. This allows us to catch and
22147 report 108 and 109 for everything now.
22149 * class.cs (TypeContainer.Define): Extract all the members
22150 before populating and emit the warning 108 (new keyword required
22151 to override) instead of having each member implement this.
22153 (MemberCore.Define): New abstract method, we will be using this in
22154 the warning reporting engine in Populate.
22156 (Operator.Define): Adjust to new MemberCore protocol.
22158 * const.cs (Const): This does not derive from Expression, it is a
22159 temporary object we use to create fields, it is a MemberCore.
22161 * class.cs (Method.Define): Allow the entry point to be in a
22164 * driver.cs: Rewrite the argument handler to clean it up a bit.
22166 * rootcontext.cs: Made it just an auxiliary namespace feature by
22167 making everything static.
22169 * driver.cs: Adapt code to use RootContext type name instead of
22172 * delegate.cs: Remove RootContext argument.
22174 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22177 * class.cs (Event.Define): The lookup can fail.
22179 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22181 * expression.cs: Resolve the this instance before invoking the code.
22183 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22185 * cs-parser.jay: Add a production in element_access that allows
22186 the thing to become a "type" reference. This way we can parse
22187 things like "(string [])" as a type.
22189 Note that this still does not handle the more complex rules of
22193 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22195 * ecore.cs: (CopyNewMethods): new utility function used to
22196 assemble the list of methods from running FindMembers.
22198 (MemberLookup): Rework FindMembers so that
22200 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22202 * class.cs (TypeContainer): Remove Delegates who fail to be
22205 * delegate.cs (Populate): Verify that we dont get null return
22206 values. TODO: Check for AsAccessible.
22208 * cs-parser.jay: Use basename to emit error 574 (destructor should
22209 have the same name as container class), not the full name.
22211 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22212 possible representation.
22214 Also implements integer type suffixes U and L.
22216 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22218 * expression.cs (ArrayCreation.DoResolve): We need to do the
22219 argument resolution *always*.
22221 * decl.cs: Make this hold the namespace. Hold the root context as
22223 (LookupType): Move here.
22225 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22227 * location.cs (Row, Name): Fixed the code, it was always returning
22228 references to the first file.
22230 * interface.cs: Register properties defined through interfaces.
22232 * driver.cs: Add support for globbing on the command line
22234 * class.cs (Field): Make it derive from MemberCore as well.
22237 2001-12-15 Ravi Pratap <ravi@ximian.com>
22239 * class.cs (Event::Define): Check that the type of the event is a delegate
22240 type else flag error #66.
22242 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22245 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22246 values of EntryPoint, CharSet etc etc.
22248 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22250 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22251 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22252 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22253 which needs this to do its work.
22255 * ../errors/cs0066.cs : Add.
22257 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22259 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22262 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22263 clears out the parameters field.
22264 (MemberSignatureCompare): Cleanup
22266 (MemberCore): New base class used to share code between MethodCore
22269 (RegisterRequiredImplementations) BindingFlags.Public requires
22270 either BindingFlags.Instace or Static. Use instance here.
22272 (Property): Refactored code to cope better with the full spec.
22274 * parameter.cs (GetParameterInfo): Return an empty array instead
22277 * class.cs (Property): Abstract or extern properties have no bodies.
22279 * parameter.cs (GetParameterInfo): return a zero-sized array.
22281 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22282 method modifier validation to the typecontainer so we can reuse
22283 this on properties.
22285 (MethodCore.ParameterTypes): return an empty sized array of types.
22287 (Property.Define): Test property modifier validity.
22289 Add tests for sealed/override too.
22291 (Method.Emit): abstract or extern methods have no bodies.
22293 2001-12-14 Ravi Pratap <ravi@ximian.com>
22295 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22298 (Method::Define, ::Emit): Modify accordingly.
22300 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22302 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22304 * makefile: Pass in /unsafe.
22306 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22308 * class.cs (MakeKey): Kill routine.
22310 * class.cs (TypeContainer.Define): Correctly define explicit
22311 method implementations (they require the full interface name plus
22314 * typemanager.cs: Deply the PtrHashtable here and stop using the
22315 lame keys. Things work so much better.
22317 This of course broke everyone who depended on `RegisterMethod' to
22318 do the `test for existance' test. This has to be done elsewhere.
22320 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22321 the object stupid Equals method (because, that like fails all over
22322 the place). We still do not use it.
22324 * class.cs (TypeContainer.SetRequiredInterface,
22325 TypeContainer.RequireMethods): Killed these two routines and moved
22326 all the functionality to RegisterRequiredImplementations.
22328 (TypeContainer.RegisterRequiredImplementations): This routine now
22329 registers all the implementations required in an array for the
22330 interfaces and abstract methods. We use an array of structures
22331 which can be computed ahead of time to reduce memory usage and we
22332 also assume that lookups are cheap as most classes will not
22333 implement too many interfaces.
22335 We also avoid creating too many MethodSignatures.
22337 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22338 clear the "pending" bit if we find that there are problems with
22341 (TypeContainer.VerifyPendingMethods): Update to report errors of
22342 methods that look like implementations but are not.
22344 (TypeContainer.Define): Add support for explicit interface method
22347 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22349 * typemanager.cs: Keep track of the parameters here instead of
22350 being a feature of the TypeContainer.
22352 * class.cs: Drop the registration of parameters here, as
22353 InterfaceMethods are also interface declarations.
22355 * delegate.cs: Register methods with the TypeManager not only with
22356 the TypeContainer. This code was buggy.
22358 * interface.cs: Full registation here.
22360 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22362 * expression.cs: Remove reducer for binary expressions, it can not
22365 * const.cs: Put here the code that used to go into constant.cs
22367 * constant.cs: Put here the code for constants, this is a new base
22368 class for Literals.
22370 * literal.cs: Make Literal derive from Constant.
22372 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22374 * statement.cs (Return.Emit): Report error 157 if the user
22375 attempts to return from a finally block.
22377 (Return.Emit): Instead of emitting a return, jump to the end of
22380 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22381 LocalBuilder to store the result of the function. ReturnLabel is
22382 the target where we jump.
22385 2001-12-09 Radek Doulik <rodo@ximian.com>
22387 * cs-parser.jay: remember alias in current namespace
22389 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22392 * class.cs (LookupAlias): lookup alias in my_namespace
22394 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22396 (LookupAlias): lookup alias in this and if needed in parent
22399 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22403 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22404 making things static. I need this to avoid passing the
22405 TypeContainer when calling ParameterType.
22407 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22408 that did string manipulation to compute the type and then call
22409 GetType. Use Parameter.ParameterType instead.
22411 * cs-tokenizer.cs: Consume the suffix for floating values.
22413 * expression.cs (ParameterReference): figure out whether this is a
22414 reference parameter or not. Kill an extra variable by computing
22415 the arg_idx during emission.
22417 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22418 function that returns whether a parameter is an out/ref value or not.
22420 (Parameter.ParameterType): The type of the parameter (base,
22421 without ref/out applied).
22423 (Parameter.Resolve): Perform resolution here.
22424 (Parameter.ExternalType): The full type (with ref/out applied).
22426 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22427 support for expressions on the using statement.
22429 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22431 * statement.cs (Using.EmitLocalVariableDecls): Split the
22432 localvariable handling of the using statement.
22434 (Block.EmitMeta): Keep track of variable count across blocks. We
22435 were reusing slots on separate branches of blocks.
22437 (Try.Emit): Emit the general code block, we were not emitting it.
22439 Check the type of the declaration to be an IDisposable or
22440 something that can be implicity converted to it.
22442 Emit conversions if required.
22444 * ecore.cs (EmptyExpression): New utility class.
22445 (Expression.ImplicitConversionExists): New utility function.
22447 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22449 * statement.cs (Using): Implement.
22451 * expression.cs (LocalVariableReference): Support read only variables.
22453 * statement.cs: Remove the explicit emit for the Leave opcode.
22454 (VariableInfo): Add a readonly field.
22456 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22458 * ecore.cs (ConvCast): new class used to encapsulate the various
22459 explicit integer conversions that works in both checked and
22460 unchecked contexts.
22462 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22463 properly generate the overflow opcodes.
22465 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22467 * statement.cs: The correct type for the EmptyExpression is the
22468 element_type, not the variable type. Ravi pointed this out.
22470 2001-12-04 Ravi Pratap <ravi@ximian.com>
22472 * class.cs (Method::Define): Handle PInvoke methods specially
22473 by using DefinePInvokeMethod instead of the usual one.
22475 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22476 above to do the task of extracting information and defining the method.
22478 2001-12-04 Ravi Pratap <ravi@ximian.com>
22480 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22481 of the condition for string type.
22483 (Emit): Move that here.
22485 (ArrayCreation::CheckIndices): Keep string literals in their expression
22488 (EmitDynamicInitializers): Handle strings appropriately.
22490 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22492 * codegen.cs (EmitContext): Replace multiple variables with a
22493 single pointer to the current Switch statement.
22495 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22498 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22502 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22505 (Foreach.Emit): Foreach on arrays was not setting
22506 up the loop variables (for break/continue).
22508 (GotoCase): Semi-implented.
22510 2001-12-03 Ravi Pratap <ravi@ximian.com>
22512 * attribute.cs (CheckAttribute): Handle system attributes by using
22513 Attribute.GetAttributes to examine information we need.
22515 (GetValidPlaces): Same here.
22517 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22519 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22521 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22523 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22525 (Method::Emit): Handle the case when we are a PInvoke method.
22527 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22529 * expression.cs: Use ResolveWithSimpleName on compound names.
22531 2001-12-02 Ravi Pratap <ravi@ximian.com>
22533 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22534 before trying to reduce it.
22536 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22538 * constant.cs (LookupConstantValue): Implement.
22540 (EmitConstant): Use the above in emitting the constant.
22542 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22543 that are user-defined by doing a LookupConstantValue on them.
22545 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22548 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22550 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22552 (BaseAccess.DoResolve): Implement.
22554 (MemberAccess.DoResolve): Split this routine into a
22555 ResolveMemberAccess routine that can be used independently
22557 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22559 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22560 As that share bits of the implementation. Is returns a boolean,
22561 while As returns the Type that is being probed.
22563 2001-12-01 Ravi Pratap <ravi@ximian.com>
22565 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22566 instead of a Literal - much easier.
22568 (EnumInTransit): Remove - utterly useless :-)
22570 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22572 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22574 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22575 chain when we have no associated expression.
22577 2001-11-30 Ravi Pratap <ravi@ximian.com>
22579 * constant.cs (Define): Use Location while reporting the errror.
22581 Also emit a warning when 'new' is used and there is no inherited
22584 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22587 (LookupEnumValue): Implement to lookup an enum member's value and define it
22590 (Populate): Re-write accordingly to use the above routine.
22592 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22594 * expression.cs (This): Fix prototype for DoResolveLValue to
22595 override the base class DoResolveLValue.
22597 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22600 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22601 (we need to load the address of the field here). This fixes
22604 (FieldExpr.DoResolveLValue): Call the DoResolve
22605 function to initialize the Instance expression.
22607 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22608 correctly the GetEnumerator operation on a value type.
22610 * cs-parser.jay: Add more simple parsing error catches.
22612 * statement.cs (Switch): Add support for string switches.
22613 Handle null specially.
22615 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22617 2001-11-28 Ravi Pratap <ravi@ximian.com>
22619 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22621 (declare_local_constant): New helper function.
22623 * statement.cs (AddConstant): Keep a separate record of constants
22625 (IsConstant): Implement to determine if a variable is a constant.
22627 (GetConstantExpression): Implement.
22629 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22631 * statement.cs (IsVariableDefined): Re-write.
22633 2001-11-27 Ravi Pratap <ravi@ximian.com>
22635 * class.cs (TypeContainer::FindMembers): Look for constants
22636 in the case when we are looking for MemberTypes.Field
22638 * expression.cs (MemberAccess::DoResolve): Check that in the
22639 case we are a FieldExpr and a Literal, we are not being accessed
22640 by an instance reference.
22642 * cs-parser.jay (local_constant_declaration): Implement.
22644 (declaration_statement): Implement for constant declarations.
22646 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22648 * statement.cs (Switch): Catch double defaults.
22650 (Switch): More work on the switch() statement
22651 implementation. It works for integral values now, need to finish
22655 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22657 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22658 integer literals into other integer literals. To be used by
22661 2001-11-24 Ravi Pratap <ravi@ximian.com>
22663 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22666 (EmitDynamicInitializers): Cope with the above since we extract data
22667 directly from ArrayData now.
22669 (ExpectInitializers): Keep track of whether initializers are mandatory
22672 (Bounds): Make it a hashtable to prevent the same dimension being
22673 recorded for every element in that dimension.
22675 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22678 Also fix bug which was causing the indices to be emitted in the reverse
22681 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22683 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22684 unfinished. They do not work, because the underlying code is
22687 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22689 * cs-parser.jay: Remove bogus fixme.
22691 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22692 on Switch statement.
22694 2001-11-23 Ravi Pratap <ravi@ximian.com>
22696 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22699 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22700 parameter. Apparently, any expression is allowed.
22702 (ValidateInitializers): Update accordingly.
22704 (CheckIndices): Fix some tricky bugs thanks to recursion.
22706 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22707 I was being completely brain-dead.
22709 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22710 and re-write acordingly.
22712 (DelegateInvocation): Re-write accordingly.
22714 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22716 (MakeByteBlob): Handle types more correctly.
22718 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22719 initialization from expressions but it is incomplete because I am a complete
22722 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22724 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22725 on If. Basically, we have to return `true' (ie, we do return to
22726 our caller) only if both branches of the if return.
22728 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22729 short-circuit operators, handle them as short circuit operators.
22731 (Cast.DoResolve): Resolve type.
22732 (Cast.Cast): Take an expression as the target type.
22734 * cs-parser.jay (cast_expression): Remove old hack that only
22735 allowed a limited set of types to be handled. Now we take a
22736 unary_expression and we resolve to a type during semantic
22739 Use the grammar productions from Rhys to handle casts (this is
22740 not complete like Rhys syntax yet, we fail to handle that corner
22741 case that C# has regarding (-x), but we will get there.
22743 2001-11-22 Ravi Pratap <ravi@ximian.com>
22745 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22746 field which is an array type.
22748 * cs-parser.jay (declare_local_variables): Support array initialization too.
22750 * typemanager.cs (MakeKey): Implement.
22752 (everywhere): Use the above appropriately.
22754 * cs-parser.jay (for_statement): Update for array initialization while
22755 declaring variables.
22757 * ecore.cs : The error message was correct, it's the variable's names that
22758 were misleading ;-) Make the code more readable.
22760 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22761 the correct type etc.
22763 (ConvertExplicit): Handle Enum types by examining the underlying type.
22765 2001-11-21 Ravi Pratap <ravi@ximian.com>
22767 * parameter.cs (GetCallingConvention): Always return
22768 CallingConventions.Standard for now.
22770 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22772 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22773 and `r' after calling DoNumericPromotions.
22775 * ecore.cs: Fix error message (the types were in the wrong order).
22777 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22778 BindingFlags.Instance as well
22780 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22781 implicit int literal conversion in an empty cast so that we
22782 propagate the right type upstream.
22784 (UnboxCast): new class used to unbox value types.
22785 (Expression.ConvertExplicit): Add explicit type conversions done
22788 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22789 the target type before applying the implicit LongLiterals to ULong
22792 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22794 * cs-parser.jay (for_statement): Reworked the way For works: now
22795 we declare manually any variables that are introduced in
22796 for_initializer to solve the problem of having out-of-band code
22797 emition (that is what got for broken).
22799 (declaration_statement): Perform the actual variable declaration
22800 that used to be done in local_variable_declaration here.
22802 (local_variable_declaration): Do not declare anything, just pass
22803 the information on a DictionaryEntry
22805 2001-11-20 Ravi Pratap <ravi@ximian.com>
22807 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22808 re-write of the logic to now make it recursive.
22810 (UpdateIndices): Re-write accordingly.
22812 Store element data in a separate ArrayData list in the above methods.
22814 (MakeByteBlob): Implement to dump the array data into a byte array.
22816 2001-11-19 Ravi Pratap <ravi@ximian.com>
22818 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22821 * constant.cs (Define): Implement.
22823 (EmitConstant): Re-write fully.
22825 Pass in location info.
22827 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22830 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22831 DictionaryEntry since we need location info too.
22833 (constant_declaration): Update accordingly.
22835 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22836 code into another method : UpdateIndices.
22838 2001-11-18 Ravi Pratap <ravi@ximian.com>
22840 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22841 some type checking etc.
22843 2001-11-17 Ravi Pratap <ravi@ximian.com>
22845 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22846 bits to provide dimension info if the user skips doing that.
22848 Update second constructor to store the rank correctly.
22850 2001-11-16 Ravi Pratap <ravi@ximian.com>
22852 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22853 and try to implement.
22855 * ../errors/cs0150.cs : Add.
22857 * ../errors/cs0178.cs : Add.
22859 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22861 * statement.cs: Implement foreach on multi-dimensional arrays.
22863 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22864 name of the params argument.
22866 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22867 initializing the array.
22869 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22870 we can use this elsewhere.
22872 * statement.cs: Finish implementation of foreach for single
22875 * cs-parser.jay: Use an out-of-band stack to pass information
22876 around, I wonder why I need this.
22878 foreach_block: Make the new foreach_block the current_block.
22880 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22881 function used to return a static Parameters structure. Used for
22882 empty parameters, as those are created very frequently.
22884 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22886 2001-11-15 Ravi Pratap <ravi@ximian.com>
22888 * interface.cs : Default modifier is private, not public. The
22889 make verify test passes again.
22891 2001-11-15 Ravi Pratap <ravi@ximian.com>
22893 * support.cs (ReflectionParameters): Fix logic to determine
22894 whether the last parameter is a params one. Test 9 passes again.
22896 * delegate.cs (Populate): Register the builders we define with
22897 RegisterParameterForBuilder. Test 19 passes again.
22899 * cs-parser.jay (property_declaration): Reference $6 instead
22900 of $$ to get at the location.
22902 (indexer_declaration): Similar stuff.
22904 (attribute): Ditto.
22906 * class.cs (Property): Register parameters for the Get and Set methods
22907 if they exist. Test 23 passes again.
22909 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22910 call to EmitArguments as we are sure there aren't any params arguments.
22911 Test 32 passes again.
22913 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22914 IndexOutOfRangeException.
22916 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22917 Test 33 now passes again.
22919 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22921 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22922 broke a bunch of things. Will have to come up with a better way
22923 of tracking locations.
22925 * statement.cs: Implemented foreach for single dimension arrays.
22927 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22929 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22930 an error. This removes the lookup from the critical path.
22932 * cs-parser.jay: Removed use of temporary_loc, which is completely
22935 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22937 * support.cs (ReflectionParameters.ParameterModifier): Report
22938 whether the argument is a PARAMS argument or not.
22940 * class.cs: Set the attribute `ParamArrayAttribute' on the
22941 parameter argument.
22943 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22944 and cons_param_array_attribute (ConstructorInfo for
22945 ParamArrayAttribute).,
22947 * codegen.cs: Emit the return using the `Return' statement, that
22948 way we can report the error correctly for missing return values.
22950 * class.cs (Method.Emit): Clean up.
22952 * expression.cs (Argument.Resolve): Take another argument: the
22953 location where this argument is used. Notice that this is not
22954 part of the "Argument" class as to reduce the size of the
22955 structure (we know the approximate location anyways).
22957 Test if the argument is a variable-reference, if not, then
22958 complain with a 206.
22960 (Argument.Emit): Emit addresses of variables.
22962 (Argument.FullDesc): Simplify.
22964 (Invocation.DoResolve): Update for Argument.Resolve.
22966 (ElementAccess.DoResolve): ditto.
22968 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22969 method should be virtual, as this method is always virtual.
22971 (NewDelegate.DoResolve): Update for Argument.Resolve.
22973 * class.cs (ConstructorInitializer.DoResolve): ditto.
22975 * attribute.cs (Attribute.Resolve): ditto.
22977 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22979 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22981 * expression.cs (ParameterReference): Drop IStackStorage and implement
22982 IAssignMethod instead.
22984 (LocalVariableReference): ditto.
22986 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22987 IAssignMethod instead.
22989 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22991 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22992 enumerations that are used in heavily used structures derive from
22993 byte in a laughable and pathetic attempt to reduce memory usage.
22994 This is the kind of pre-optimzations that you should not do at
22995 home without adult supervision.
22997 * expression.cs (UnaryMutator): New class, used to handle ++ and
22998 -- separatedly from the other unary operators. Cleans up the
22999 code, and kills the ExpressionStatement dependency in Unary.
23001 (Unary): Removed `method' and `Arguments' from this class, making
23002 it smaller, and moving it all to SimpleCall, so I can reuse this
23003 code in other locations and avoid creating a lot of transient data
23004 strucutres when not required.
23006 * cs-parser.jay: Adjust for new changes.
23008 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23010 * enum.cs (Enum.Populate): If there is a failure during
23013 * cs-parser.jay (opt_enum_base): we used to catch type errors
23014 here, but this is really incorrect. The type error should be
23015 catched during semantic analysis.
23017 2001-12-11 Ravi Pratap <ravi@ximian.com>
23019 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23020 current_local_parameters as expected since I, in my stupidity, had forgotten
23023 * attribute.cs (GetValidPlaces): Fix stupid bug.
23025 * class.cs (Method::Emit): Perform check on applicability of attributes.
23027 (Constructor::Emit): Ditto.
23029 (Field::Emit): Ditto.
23031 (Field.Location): Store location information.
23033 (Property, Event, Indexer, Operator): Ditto.
23035 * cs-parser.jay (field_declaration): Pass in location for each field.
23037 * ../errors/cs0592.cs : Add.
23039 2001-11-12 Ravi Pratap <ravi@ximian.com>
23041 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23043 (InitCoreTypes): Update accordingly.
23045 (RegisterAttrType, LookupAttr): Implement.
23047 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23048 info about the same.
23050 (Resolve): Update to populate the above as necessary.
23052 (Error592): Helper.
23054 (GetValidPlaces): Helper to the above.
23056 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23058 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23060 2001-11-12 Ravi Pratap <ravi@ximian.com>
23062 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23064 * ../errors/cs0617.cs : Add.
23066 2001-11-11 Ravi Pratap <ravi@ximian.com>
23068 * enum.cs (Emit): Rename to Populate to be more consistent with what
23069 we expect it to do and when exactly it is called.
23071 * class.cs, rootcontext.cs : Update accordingly.
23073 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23074 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23076 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23078 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23079 of a fieldinfo using the above, when dealing with a FieldBuilder.
23081 2001-11-10 Ravi Pratap <ravi@ximian.com>
23083 * ../errors/cs0031.cs : Add.
23085 * ../errors/cs1008.cs : Add.
23087 * ../errrors/cs0543.cs : Add.
23089 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23092 (FindMembers): Implement.
23094 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23095 enums and delegates too.
23097 (enum_types): Rename to builder_to_enum.
23099 (delegate_types): Rename to builder_to_delegate.
23101 * delegate.cs (FindMembers): Implement.
23103 2001-11-09 Ravi Pratap <ravi@ximian.com>
23105 * typemanager.cs (IsEnumType): Implement.
23107 * enum.cs (Emit): Re-write parts to account for the underlying type
23108 better and perform checking etc.
23110 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23111 of the underlying type.
23113 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23116 * enum.cs (error31): Helper to report error #31.
23118 * cs-parser.jay (enum_declaration): Store location of each member too.
23120 * enum.cs (member_to_location): New hashtable.
23122 (AddEnumMember): Update location hashtable.
23124 (Emit): Use the location of each member while reporting errors.
23126 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23128 * cs-parser.jay: A for_initializer if is a
23129 local_variable_declaration really ammount to have an implicit
23130 block with the variable declaration and no initializer for for.
23132 * statement.cs (For.Emit): Cope with null initializers.
23134 This fixes the infinite loop on for initializers.
23136 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23138 * enum.cs: More cleanup.
23140 * ecore.cs: Remove dead code.
23142 * class.cs (Property.Emit): More simplification.
23143 (Event.Emit): ditto.
23145 Reworked to have less levels of indentation.
23147 2001-11-08 Ravi Pratap <ravi@ximian.com>
23149 * class.cs (Property): Emit attributes.
23159 * enum.cs (Emit): Ditto.
23161 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23164 * class.cs (Field, Event, etc.): Move attribute generation into the
23165 Emit method everywhere.
23167 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23168 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23169 as we had no way of defining nested enums !
23171 * rootcontext.cs : Adjust code accordingly.
23173 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23175 2001-11-07 Ravi Pratap <ravi@ximian.com>
23177 * expression.cs (EvalConstantExpression): Move into ecore.cs
23179 * enum.cs (Enum): Rename some members and make them public and readonly
23180 according to our convention.
23182 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23185 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23187 (Enum::Emit): Write a simple version for now which doesn't try to compute
23188 expressions. I shall modify this to be more robust in just a while.
23190 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23192 (TypeContainer::CloseType): Create the Enum types too.
23194 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23196 * expression.cs (EvalConstantExpression): Get rid of completely.
23198 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23199 user-defined values and other cases.
23201 (IsValidEnumLiteral): Helper function.
23203 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23204 out there in the case we had a literal FieldExpr.
23206 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23208 (Literalize): Revamp a bit to take two arguments.
23210 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23212 2001-11-06 Ravi Pratap <ravi@ximian.com>
23214 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23216 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23218 (Resolve): Use the above to ensure we have proper initializers.
23220 2001-11-05 Ravi Pratap <ravi@ximian.com>
23222 * expression.cs (Expression::EvalConstantExpression): New method to
23223 evaluate constant expressions.
23225 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23227 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23229 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23232 (Binary.ResolveOperator): Handle operator != (object a, object b)
23233 and operator == (object a, object b);
23235 (Binary.DoNumericPromotions): Indicate whether the numeric
23236 promotion was possible.
23238 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23241 Made the ArrayAccess implement interface IAssignMethod instead of
23242 IStackStore as the order in which arguments are passed reflects
23245 * assign.cs: Instead of using expr.ExprClass to select the way of
23246 assinging, probe for the IStackStore/IAssignMethod interfaces.
23248 * typemanager.cs: Load InitializeArray definition.
23250 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23251 static data that can be used to initialize arrays.
23253 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23255 * expression.cs: Handle operator== and operator!= for booleans.
23257 (Conditioal.Reduce): Implement reducer for the ?: operator.
23259 (Conditional.Resolve): Implement dead code elimination.
23261 (Binary.Resolve): Catch string literals and return a new
23262 concatenated string.
23264 (Unary.Reduce): Implement reduction of unary expressions.
23266 * ecore.cs: Split out the expression core handling here.
23268 (Expression.Reduce): New method used to perform constant folding
23269 and CSE. This is needed to support constant-expressions.
23271 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23272 targets, and optimize for !x.
23274 2001-11-04 Ravi Pratap <ravi@ximian.com>
23276 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23277 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23278 set custom atttributes.
23280 * literal.cs (Literal::GetValue): New abstract method to return the actual
23281 value of the literal, cast as an object.
23283 (*Literal): Implement GetValue method.
23285 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23286 expressions to the arraylist but objects of type Argument.
23288 * class.cs (TypeContainer::Emit): Emit our attributes too.
23290 (Method::Emit, Constructor::Emit): Ditto.
23292 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23293 to be ignoring earlier.
23295 2001-11-03 Ravi Pratap <ravi@ximian.com>
23297 * attribute.cs (AttributeSection::Define): Implement to do the business
23298 of constructing a CustomAttributeBuilder.
23300 (Attribute): New trivial class. Increases readability of code.
23302 * cs-parser.jay : Update accordingly.
23304 (positional_argument_list, named_argument_list, named_argument): New rules
23306 (attribute_arguments): Use the above so that we are more correct.
23308 2001-11-02 Ravi Pratap <ravi@ximian.com>
23310 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23311 to perform all checks for a method with a params parameter.
23313 (Invocation::OverloadResolve): Update to use the above method and therefore
23314 cope correctly with params method invocations.
23316 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23319 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23320 constructors in our parent too because we can't afford to miss out on
23323 * attribute.cs (AttributeSection): New name for the class Attribute
23325 Other trivial changes to improve readability.
23327 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23328 use the new class names.
23330 2001-11-01 Ravi Pratap <ravi@ximian.com>
23332 * class.cs (Method::Define): Complete definition for params types too
23334 (Indexer::Define): Ditto.
23336 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23337 Cope everywhere with a request for info about the array parameter.
23339 2001-11-01 Ravi Pratap <ravi@ximian.com>
23341 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23343 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23344 local_variable_type to extract the string corresponding to the type.
23346 (local_variable_type): Fixup the action to use the new helper method.
23348 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23351 * expression.cs : Clean out code which uses the above.
23353 2001-10-31 Ravi Pratap <ravi@ximian.com>
23355 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23356 and bale out if necessary by returning a false.
23358 (RegisterProperty): Ditto.
23360 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23361 and print out appropriate error messages.
23363 * interface.cs (everywhere): Ditto.
23365 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23366 location to constructor.
23368 * class.cs (Property, Event, Indexer): Update accordingly.
23370 * ../errors/cs111.cs : Added.
23372 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23373 of a method, as laid down by the spec.
23375 (Invocation::OverloadResolve): Use the above method.
23377 2001-10-31 Ravi Pratap <ravi@ximian.com>
23379 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23380 now take a TypeContainer and a Parameters object.
23382 (ParameterData): Modify return type of ParameterModifier method to be
23383 Parameter.Modifier and not a string.
23385 (ReflectionParameters, InternalParameters): Update accordingly.
23387 * expression.cs (Argument::GetParameterModifier): Same here.
23389 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23390 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23391 symbol in it at all so maybe this is only for now.
23393 2001-10-30 Ravi Pratap <ravi@ximian.com>
23395 * support.cs (InternalParameters): Constructor now takes an extra argument
23396 which is the actual Parameters class.
23398 (ParameterDesc): Update to provide info on ref/out modifiers.
23400 * class.cs (everywhere): Update call to InternalParameters to pass in
23401 the second argument too.
23403 * support.cs (ParameterData): Add ParameterModifier, which is a method
23404 to return the modifier info [ref/out etc]
23406 (InternalParameters, ReflectionParameters): Implement the above.
23408 * expression.cs (Argument::ParameterModifier): Similar function to return
23409 info about the argument's modifiers.
23411 (Invocation::OverloadResolve): Update to take into account matching modifiers
23414 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23415 a new SetFormalParameters object which we pass to InternalParameters.
23417 2001-10-30 Ravi Pratap <ravi@ximian.com>
23419 * expression.cs (NewArray): Merge into the ArrayCreation class.
23421 2001-10-29 Ravi Pratap <ravi@ximian.com>
23423 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23424 NewUserdefinedArray into one as there wasn't much of a use in having
23427 * expression.cs (Argument): Change field's name to ArgType from Type.
23429 (Type): New readonly property which returns the proper type, taking into
23430 account ref/out modifiers.
23432 (everywhere): Adjust code accordingly for the above.
23434 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23435 whether we are emitting for a ref or out parameter.
23437 * expression.cs (Argument::Emit): Use the above field to set the state.
23439 (LocalVariableReference::Emit): Update to honour the flag and emit the
23442 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23444 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23446 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23448 (ReflectionParameters, InternalParameters): Implement the above method.
23450 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23453 (Invocation::FullMethodDesc): Ditto.
23455 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23457 * cs-parser.jay: Add extra production for the second form of array
23460 * expression.cs (ArrayCreation): Update to reflect the above
23463 * Small changes to prepare for Array initialization.
23465 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23467 * typemanager.cs (ImplementsInterface): interface might be null;
23468 Deal with this problem;
23470 Also, we do store negative hits on the cache (null values), so use
23471 this instead of calling t.GetInterfaces on the type everytime.
23473 2001-10-28 Ravi Pratap <ravi@ximian.com>
23475 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23477 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23478 split functionality out into different classes.
23480 (New::FormArrayType): Move into NewBuiltinArray.
23482 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23485 (NewBuiltinArray): New class to handle creation of built-in arrays.
23487 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23488 account creation of one-dimensional arrays.
23490 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23492 (NewUserdefinedArray::DoResolve): Implement.
23494 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23496 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23497 we maintain inside the TypeManager. This is necessary to perform lookups on the
23500 (LookupType): Update to perform GetType on the module builders too.
23502 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23504 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23506 2001-10-23 Ravi Pratap <ravi@ximian.com>
23508 * expression.cs (New::DoResolve): Implement guts of array creation.
23510 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23512 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23514 * expression.cs: Fix bug I introduced lsat night that broke
23517 (Expression.Resolve): Report a 246 error (can not resolve name)
23518 if we find a SimpleName in the stream.
23520 (Expression.ResolveLValue): Ditto.
23522 (Expression.ResolveWithSimpleName): This function is a variant of
23523 ResolveName, this one allows SimpleNames to be returned without a
23524 warning. The only consumer of SimpleNames is MemberAccess
23526 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23528 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23529 might arrive here. I have my doubts that this is correct.
23531 * statement.cs (Lock): Implement lock statement.
23533 * cs-parser.jay: Small fixes to support `lock' and `using'
23535 * cs-tokenizer.cs: Remove extra space
23537 * driver.cs: New flag --checked, allows to turn on integer math
23540 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23541 Threading.Monitor.Exit
23543 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23545 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23546 Expression Class to be IndexerAccess.
23548 Notice that Indexer::DoResolve sets the eclass to Value.
23550 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23552 * class.cs (TypeContainer::Emit): Emit code for indexers.
23554 * assign.cs (IAssignMethod): New interface implemented by Indexers
23555 and Properties for handling assignment.
23557 (Assign::Emit): Simplify and reuse code.
23559 * expression.cs (IndexerAccess, PropertyExpr): Implement
23560 IAssignMethod, clean up old code.
23562 2001-10-22 Ravi Pratap <ravi@ximian.com>
23564 * typemanager.cs (ImplementsInterface): New method to determine if a type
23565 implements a given interface. Provides a nice cache too.
23567 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23570 (ConvertReferenceExplicit): Ditto.
23572 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23573 various methods, with correct names etc.
23575 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23576 Operator.UnaryNegation.
23578 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23579 we have a unary plus or minus operator.
23581 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23584 * everywhere : update accordingly.
23586 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23589 * class.cs (Method::Define): For the case where we are implementing a method
23590 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23591 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23593 2001-10-21 Ravi Pratap <ravi@ximian.com>
23595 * interface.cs (FindMembers): Implement to work around S.R.E
23598 * typemanager.cs (IsInterfaceType): Implement.
23600 (FindMembers): Update to handle interface types too.
23602 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23603 use IsAssignableFrom as that is not correct - it doesn't work.
23605 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23606 and accordingly override EmitStatement.
23608 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23609 using the correct logic :-)
23611 2001-10-19 Ravi Pratap <ravi@ximian.com>
23613 * ../errors/cs-11.cs : Add to demonstrate error -11
23615 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23617 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23618 then pass this as a hint to ResolveLValue.
23620 * expression.cs (FieldExpr): Add Location information
23622 (FieldExpr::LValueResolve): Report assignment to readonly
23625 (Expression::ExprClassFromMemberInfo): Pass location information.
23627 (Expression::ResolveLValue): Add new method that resolves an
23630 (Expression::DoResolveLValue): Default invocation calls
23633 (Indexers): New class used to keep track of indexers in a given
23636 (IStackStore): Renamed from LValue, as it did not really describe
23637 what this did. Also ResolveLValue is gone from this interface and
23638 now is part of Expression.
23640 (ElementAccess): Depending on the element access type
23642 * typemanager.cs: Add `indexer_name_type' as a Core type
23643 (System.Runtime.CompilerServices.IndexerNameAttribute)
23645 * statement.cs (Goto): Take a location.
23647 2001-10-18 Ravi Pratap <ravi@ximian.com>
23649 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23650 if two delegates are compatible.
23652 (NewDelegate::DoResolve): Update to take care of the case when
23653 we instantiate a delegate from another delegate.
23655 * typemanager.cs (FindMembers): Don't even try to look up members
23656 of Delegate types for now.
23658 2001-10-18 Ravi Pratap <ravi@ximian.com>
23660 * delegate.cs (NewDelegate): New class to take care of delegate
23663 * expression.cs (New): Split the delegate related code out into
23664 the NewDelegate class.
23666 * delegate.cs (DelegateInvocation): New class to handle delegate
23669 * expression.cs (Invocation): Split out delegate related code into
23670 the DelegateInvocation class.
23672 2001-10-17 Ravi Pratap <ravi@ximian.com>
23674 * expression.cs (New::DoResolve): Implement delegate creation fully
23675 and according to the spec.
23677 (New::DoEmit): Update to handle delegates differently.
23679 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23680 because of which we were printing out arguments in reverse order !
23682 * delegate.cs (VerifyMethod): Implement to check if the given method
23683 matches the delegate.
23685 (FullDelegateDesc): Implement.
23687 (VerifyApplicability): Implement.
23689 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23690 delegate invocations too.
23692 (Invocation::Emit): Ditto.
23694 * ../errors/cs1593.cs : Added.
23696 * ../errors/cs1594.cs : Added.
23698 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23700 2001-10-16 Ravi Pratap <ravi@ximian.com>
23702 * typemanager.cs (intptr_type): Core type for System.IntPtr
23704 (InitCoreTypes): Update for the same.
23706 (iasyncresult_type, asynccallback_type): Ditto.
23708 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23711 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23714 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23715 the builders for the 4 members of a delegate type :-)
23717 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23720 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23722 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23724 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23726 * statement.cs (Break::Emit): Implement.
23727 (Continue::Emit): Implement.
23729 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23730 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23731 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23732 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23735 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23736 properties that track the label for the current loop (begin of the
23737 loop and end of the loop).
23739 2001-10-15 Ravi Pratap <ravi@ximian.com>
23741 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23742 use of emitting anything at all.
23744 * class.cs, rootcontext.cs : Get rid of calls to the same.
23746 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23748 (Populate): Define the constructor correctly and set the implementation
23751 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23754 (AddDelegateType): Implement.
23756 (IsDelegateType): Implement helper method.
23758 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23760 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23761 and accordingly handle it.
23763 * delegate.cs (Populate): Take TypeContainer argument.
23764 Implement bits to define the Invoke method. However, I still haven't figured out
23765 how to take care of the native int bit :-(
23767 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23768 Qualify the name of the delegate, not its return type !
23770 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23773 (StandardConversionExists): Checking for array types turns out to be recursive.
23775 (ConvertReferenceExplicit): Implement array conversion.
23777 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23779 2001-10-12 Ravi Pratap <ravi@ximian.com>
23781 * cs-parser.jay (delegate_declaration): Store the fully qualified
23782 name as it is a type declaration.
23784 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23787 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23788 as TypeContainer::DefineType.
23790 (Populate): Method in which all the definition of the various methods (Invoke)
23793 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23796 (CloseDelegate): Finally creates the delegate.
23798 * class.cs (TypeContainer::DefineType): Update to define delegates.
23799 (Populate, Emit and CloseType): Do the same thing here too.
23801 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23802 delegates in all these operations.
23804 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23806 * expression.cs: LocalTemporary: a new expression used to
23807 reference a temporary that has been created.
23809 * assign.cs: Handle PropertyAccess back here, so that we can
23810 provide the proper semantic access to properties.
23812 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23813 a few more explicit conversions.
23815 * modifiers.cs: `NEW' modifier maps to HideBySig.
23817 * expression.cs (PropertyExpr): Make this into an
23818 ExpressionStatement, and support the EmitStatement code path.
23820 Perform get/set error checking, clean up the interface.
23822 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23823 them into toplevel access objects.
23825 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23827 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23830 * typemanager.cs: Keep track here of our PropertyBuilders again to
23831 work around lameness in SRE.
23833 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23835 * expression.cs (LValue::LValueResolve): New method in the
23836 interface, used to perform a second resolution pass for LValues.
23838 (This::DoResolve): Catch the use of this in static methods.
23840 (This::LValueResolve): Implement.
23842 (This::Store): Remove warning, assigning to `this' in structures
23845 (Invocation::Emit): Deal with invocation of
23846 methods on value types. We need to pass the address to structure
23847 methods rather than the object itself. (The equivalent code to
23848 emit "this" for structures leaves the entire structure on the
23849 stack instead of a pointer to it).
23851 (ParameterReference::DoResolve): Compute the real index for the
23852 argument based on whether the method takes or not a `this' pointer
23853 (ie, the method is static).
23855 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23856 value types returned from functions when we need to invoke a
23857 method on the sturcture.
23860 2001-10-11 Ravi Pratap <ravi@ximian.com>
23862 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23863 defining the type in the Modulebuilder or Typebuilder. This is to take
23864 care of nested types which need to be defined on the TypeBuilder using
23865 DefineNestedMethod.
23867 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23868 methods in RootContext, only ported to be part of TypeContainer.
23870 (TypeContainer::GetInterfaceOrClass): Ditto.
23872 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23874 * interface.cs (Interface::DefineInterface): New method. Does exactly
23875 what RootContext.CreateInterface did earlier, only it takes care of nested types
23878 (Interface::GetInterfaces): Move from RootContext here and port.
23880 (Interface::GetInterfaceByName): Same here.
23882 * rootcontext.cs (ResolveTree): Re-write.
23884 (PopulateTypes): Re-write.
23886 * class.cs (TypeContainer::Populate): Populate nested types too.
23887 (TypeContainer::Emit): Emit nested members too.
23889 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23890 instead just use the name argument passed in as it is already fully
23893 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23894 to TypeContainer mapping to see if a type is user-defined.
23896 * class.cs (TypeContainer::CloseType): Implement.
23898 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23899 the default constructor.
23901 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23904 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23906 * interface.cs (CloseType): Create the type here.
23908 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23911 Remove all the methods which are now in TypeContainer.
23913 2001-10-10 Ravi Pratap <ravi@ximian.com>
23915 * delegate.cs (Define): Re-write bits to define the delegate
23918 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23920 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23922 * expression.cs (ImplicitReferenceConversion): handle null as well
23923 as a source to convert to any reference type.
23925 * statement.cs (Return): Perform any implicit conversions to
23926 expected return type.
23928 Validate use of return statement.
23930 * codegen.cs (EmitContext): Pass the expected return type here.
23932 * class.cs (Method, Constructor, Property): Pass expected return
23933 type to EmitContext.
23935 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23937 * expression.cs: Make DoResolve take an EmitContext instead of a
23940 Replaced `l' and `location' for `loc', for consistency.
23942 (Error, Warning): Remove unneeded Tc argument.
23944 * assign.cs, literal.cs, constant.cs: Update to new calling
23947 * codegen.cs: EmitContext now contains a flag indicating whether
23948 code is being generated in a static method or not.
23950 * cs-parser.jay: DecomposeQI, new function that replaces the old
23951 QualifiedIdentifier. Now we always decompose the assembled
23952 strings from qualified_identifier productions into a group of
23955 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23957 * rootcontext.cs: Deal with field-less struct types correctly now
23958 by passing the size option to Define Type.
23960 * class.cs: Removed hack that created one static field.
23962 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23964 * statement.cs: Moved most of the code generation here.
23966 2001-10-09 Ravi Pratap <ravi@ximian.com>
23968 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23971 (ElementAccess): Remove useless bits for now - keep checks as the spec
23974 2001-10-08 Ravi Pratap <ravi@ximian.com>
23976 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23977 and start performing checks according to the spec.
23979 2001-10-07 Ravi Pratap <ravi@ximian.com>
23981 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23982 rank_specifiers instead.
23984 (rank_specifiers): Change the order in which the rank specifiers are stored
23986 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23988 * expression.cs (ElementAccess): Implement the LValue interface too.
23990 2001-10-06 Ravi Pratap <ravi@ximian.com>
23992 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23993 except that user defined conversions are not included.
23995 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23996 perform the conversion of the return type, if necessary.
23998 (New::DoResolve): Check whether we are creating an array or an object
23999 and accordingly do the needful.
24001 (New::Emit): Same here.
24003 (New::DoResolve): Implement guts of array creation.
24005 (New::FormLookupType): Helper function.
24007 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24009 * codegen.cs: Removed most of the code generation here, and move the
24010 corresponding code generation bits to the statement classes.
24012 Added support for try/catch/finalize and throw.
24014 * cs-parser.jay: Added support for try/catch/finalize.
24016 * class.cs: Catch static methods having the flags override,
24017 virtual or abstract.
24019 * expression.cs (UserCast): This user cast was not really doing
24020 what it was supposed to do. Which is to be born in fully resolved
24021 state. Parts of the resolution were being performed at Emit time!
24025 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24027 * expression.cs: Implicity convert the result from UserCast.
24029 2001-10-05 Ravi Pratap <ravi@ximian.com>
24031 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24032 prevented it from working correctly.
24034 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24035 merely ConvertImplicit.
24037 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24039 * typemanager.cs: Make the LookupTypeContainer function static,
24040 and not per-instance.
24042 * class.cs: Make static FindMembers (the one that takes a Type
24045 * codegen.cs: Add EmitForeach here.
24047 * cs-parser.jay: Make foreach a toplevel object instead of the
24048 inline expansion, as we need to perform semantic analysis on it.
24050 2001-10-05 Ravi Pratap <ravi@ximian.com>
24052 * expression.cs (Expression::ImplicitUserConversion): Rename to
24053 UserDefinedConversion.
24055 (Expression::UserDefinedConversion): Take an extra argument specifying
24056 whether we look for explicit user conversions too.
24058 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24060 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24062 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24063 with the appropriate arguments.
24065 * cs-parser.jay (cast_expression): Record location too.
24067 * expression.cs (Cast): Record location info.
24069 (Expression::ConvertExplicit): Take location argument.
24071 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24072 to determine if we are doing explicit conversions.
24074 (UserCast::Emit): Update accordingly.
24076 (Expression::ConvertExplicit): Report an error if everything fails.
24078 * ../errors/cs0030.cs : Add.
24080 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24082 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24083 virtual and newslot bits.
24085 * class.cs (TypeContainer::RegisterRequiredImplementations):
24086 Record methods we need.
24088 (TypeContainer::MakeKey): Helper function to make keys for
24089 MethodBases, since the Methodbase key is useless.
24091 (TypeContainer::Populate): Call RegisterRequiredImplementations
24092 before defining the methods.
24094 Create a mapping for method_builders_to_methods ahead of time
24095 instead of inside a tight loop.
24097 (::RequireMethods): Accept an object as the data to set into the
24098 hashtable so we can report interface vs abstract method mismatch.
24100 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24102 * report.cs: Make all of it static.
24104 * rootcontext.cs: Drop object_type and value_type computations, as
24105 we have those in the TypeManager anyways.
24107 Drop report instance variable too, now it is a global.
24109 * driver.cs: Use try/catch on command line handling.
24111 Add --probe option to debug the error reporting system with a test
24114 * report.cs: Add support for exiting program when a probe
24115 condition is reached.
24117 2001-10-03 Ravi Pratap <ravi@ximian.com>
24119 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24120 we do a forcible conversion regardless of type, to check if
24121 ForceConversion returns a null.
24123 (Binary::error19): Use location to report error.
24125 (Unary::error23): Use location here too.
24127 * ../errors/cs0019.cs : Check in.
24129 * ../errors/cs0023.cs : Check in.
24131 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24132 case of a non-null MethodInfo object with a length of 0 !
24134 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24135 an applicable member - according to the spec :-)
24136 Also fix logic to find members in base types.
24138 (Unary::ResolveOperator): Same here.
24140 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24141 as I was getting thoroughly confused between this and error19 :-)
24143 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24144 (::FindMostEncompassedType): Implement.
24145 (::FindMostEncompassingType): Implement.
24146 (::StandardConversionExists): Implement.
24148 (UserImplicitCast): Re-vamp. We now need info about most specific
24149 source and target types so that we can do the necessary conversions.
24151 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24152 mathematical union with no duplicates.
24154 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24156 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24157 in order from base classes to child classes, so that we can in
24158 child classes look up in our parent for method names and
24159 attributes (required for handling abstract, virtual, new, override
24160 constructs: we need to instrospect our base class, and if we dont
24161 populate the classes in order, the introspection might be
24162 incorrect. For example, a method could query its parent before
24163 the parent has any methods and would determine that the parent has
24164 no abstract methods (while it could have had them)).
24166 (RootContext::CreateType): Record the order in which we define the
24169 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24171 * class.cs (TypeContainer::Populate): Also method definitions can
24172 fail now, keep track of this.
24174 (TypeContainer::FindMembers): Implement support for
24175 DeclaredOnly/noDeclaredOnly flag.
24177 (Constructor::Emit) Return the ConstructorBuilder.
24179 (Method::Emit) Return the MethodBuilder.
24180 Check for abstract or virtual methods to be public.
24182 * rootcontext.cs (RootContext::CreateType): Register all the
24183 abstract methods required for the class to be complete and the
24184 interface methods that must be implemented.
24186 * cs-parser.jay: Report error 501 (method requires body if it is
24187 not marked abstract or extern).
24189 * expression.cs (TypeOf::Emit): Implement.
24191 * typemanager.cs: runtime_handle_type, new global type.
24193 * class.cs (Property::Emit): Generate code for properties.
24195 2001-10-02 Ravi Pratap <ravi@ximian.com>
24197 * expression.cs (Unary::ResolveOperator): Find operators on base type
24198 too - we now conform exactly to the spec.
24200 (Binary::ResolveOperator): Same here.
24202 * class.cs (Operator::Define): Fix minor quirk in the tests.
24204 * ../errors/cs0215.cs : Added.
24206 * ../errors/cs0556.cs : Added.
24208 * ../errors/cs0555.cs : Added.
24210 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24212 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24213 single integer which is really efficient
24215 2001-10-01 Ravi Pratap <ravi@ximian.com>
24217 * expression.cs (Expression::ImplicitUserConversion): Use location
24218 even in the case when we are examining True operators.
24220 * class.cs (Operator::Define): Perform extensive checks to conform
24221 with the rules for operator overloading in the spec.
24223 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24224 some of the other conversions mentioned in the spec.
24226 * typemanager.cs (array_type): New static member for the System.Array built-in
24229 (cloneable_interface): For System.ICloneable interface.
24231 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24232 we start resolving the tree and populating types.
24234 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24236 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24238 * expression.cs (Expression::ExprClassFromMemberInfo,
24239 Expression::Literalize): Create literal expressions from
24240 FieldInfos which are literals.
24242 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24243 type casts, because they were wrong. The test suite in tests
24246 (ImplicitNumericConversion): ushort to ulong requires a widening
24249 Int32 constant to long requires widening cast as well.
24251 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24252 for integers because the type on the stack is not i4.
24254 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24256 * expression.cs (report118): require location argument.
24258 * parameter.cs: Do not dereference potential null value.
24260 * class.cs: Catch methods that lack the `new' keyword when
24261 overriding a name. Report warnings when `new' is used without
24262 anything being there to override.
24264 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24266 * class.cs: Only add constructor to hashtable if it is non-null
24267 (as now constructors can fail on define).
24269 (TypeManager, Class, Struct): Take location arguments.
24271 Catch field instance initialization in structs as errors.
24273 accepting_filter: a new filter for FindMembers that is static so
24274 that we dont create an instance per invocation.
24276 (Constructor::Define): Catch errors where a struct constructor is
24279 * cs-parser.jay: Pass location information for various new
24282 * delegate.cs (Delegate): take a location argument.
24284 * driver.cs: Do not call EmitCode if there were problesm in the
24285 Definition of the types, as many Builders wont be there.
24287 * decl.cs (Decl::Decl): Require a location argument.
24289 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24290 into integers, and find the most appropiate integer for it.
24292 * literal.cs: Implement ULongLiteral.
24294 * rootcontext.cs: Provide better information about the location of
24295 failure when CreateType fails.
24297 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24299 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24302 * expression.cs (Binary::CheckShiftArguments): Add missing type
24304 (Binary::ResolveOperator): Add type to the logical and and logical
24305 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24308 (Binary::DoNumericPromotions): In the case where either argument
24309 is ulong (and most signed types combined with ulong cause an
24310 error) perform implicit integer constant conversions as well.
24312 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24314 * expression.cs (UserImplicitCast): Method should always be
24316 (Invocation::BetterConversion): Simplified test for IntLiteral.
24318 (Expression::ImplicitNumericConversion): Split this routine out.
24319 Put the code that performs implicit constant integer conversions
24322 (Expression::Resolve): Become a wrapper around DoResolve so we can
24323 check eclass and type being set after resolve.
24325 (Invocation::Badness): Remove this dead function
24327 (Binary::ResolveOperator): Do not compute the expensive argumnets
24328 unless we have a union for it.
24330 (Probe::Emit): Is needs to do an isinst and then
24331 compare against null.
24333 (::CanConvert): Added Location argument. If the Location argument
24334 is null (Location.Null), then we do not report errors. This is
24335 used by the `probe' mechanism of the Explicit conversion. We do
24336 not want to generate an error for something that the user
24337 explicitly requested to be casted. But the pipeline for an
24338 explicit cast first tests for potential implicit casts.
24340 So for now, if the Location is null, it means `Probe only' to
24341 avoid adding another argument. Might have to revise this
24344 (ClassCast): New class used to type cast objects into arbitrary
24345 classes (used in Explicit Reference Conversions).
24347 Implement `as' as well.
24349 Reverted all the patches from Ravi below: they were broken:
24351 * The use of `level' as a mechanism to stop recursive
24352 invocations is wrong. That was there just to catch the
24353 bug with a strack trace but not as a way of addressing
24356 To fix the problem we have to *understand* what is going
24357 on and the interactions and come up with a plan, not
24358 just get things going.
24360 * The use of the type conversion cache that I proposed
24361 last night had an open topic: How does this work across
24362 protection domains. A user defined conversion might not
24363 be public in the location where we are applying the
24364 conversion, a different conversion might be selected
24365 (ie, private A->B (better) but public B->A (worse),
24366 inside A, A->B applies, but outside it, B->A will
24369 * On top of that (ie, even if the above is solved),
24370 conversions in a cache need to be abstract. Ie, `To
24371 convert from an Int to a Short use an OpcodeCast', not
24372 `To convert from an Int to a Short use the OpcodeCast on
24373 the variable 5' (which is what this patch was doing).
24375 2001-09-28 Ravi Pratap <ravi@ximian.com>
24377 * expression.cs (Invocation::ConversionExists): Re-write to use
24378 the conversion cache
24380 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24381 cache all conversions done, not just user-defined ones.
24383 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24384 to determine if a conversion exists instead of acutually trying to
24385 perform the conversion. It's faster too.
24387 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24388 and only then attempt the implicit conversion.
24390 2001-09-28 Ravi Pratap <ravi@ximian.com>
24392 * expression.cs (ConvertImplicit): Use a cache for conversions
24393 already found. Check level of recursion and bail out if necessary.
24395 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24397 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24398 Export standard methods that we expect for string operations.
24400 * statement.cs (Block::UsageWarning): Track usage of variables and
24401 report the errors for not used variables.
24403 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24406 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24408 * codegen.cs: remove unnneded code
24410 * expression.cs: Removed BuiltinTypeAccess class
24412 Fix the order in which implicit conversions are
24415 The previous fixed dropped support for boxed conversions (adding a
24416 test to the test suite now)
24418 (UserImplicitCast::CanConvert): Remove test for source being null,
24419 that code is broken. We should not feed a null to begin with, if
24420 we do, then we should track the bug where the problem originates
24421 and not try to cover it up here.
24423 Return a resolved expression of type UserImplicitCast on success
24424 rather than true/false. Ravi: this is what I was talking about,
24425 the pattern is to use a static method as a "constructor" for
24428 Also, do not create arguments until the very last minute,
24429 otherwise we always create the arguments even for lookups that
24430 will never be performed.
24432 (UserImplicitCast::Resolve): Eliminate, objects of type
24433 UserImplicitCast are born in a fully resolved state.
24435 * typemanager.cs (InitCoreTypes): Init also value_type
24436 (System.ValueType).
24438 * expression.cs (Cast::Resolve): First resolve the child expression.
24440 (LValue): Add new method AddressOf to be used by
24443 Change the argument of Store to take an EmitContext instead of an
24444 ILGenerator, because things like FieldExpr need to be able to call
24445 their children expression to generate the instance code.
24447 (Expression::Error, Expression::Warning): Sugar functions for
24450 (Expression::MemberLookup): Accept a TypeContainer instead of a
24451 Report as the first argument.
24453 (Expression::ResolvePrimary): Killed. I still want to improve
24454 this as currently the code is just not right.
24456 (Expression::ResolveMemberAccess): Simplify, but it is still
24459 (Unary::Resolve): Catch errors in AddressOf operators.
24461 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24462 index to a byte for the short-version, or the compiler will choose
24463 the wrong Emit call, which generates the wrong data.
24465 (ParameterReference::Emit, ::Store): same.
24467 (FieldExpr::AddressOf): Implement.
24469 * typemanager.cs: TypeManager: made public variable instead of
24472 * driver.cs: document --fatal.
24474 * report.cs (ErrorMessage, WarningMessage): new names for the old
24475 Error and Warning classes.
24477 * cs-parser.jay (member_access): Turn built-in access to types
24478 into a normal simplename
24480 2001-09-27 Ravi Pratap <ravi@ximian.com>
24482 * expression.cs (Invocation::BetterConversion): Fix to cope
24483 with q being null, since this was introducing a bug.
24485 * expression.cs (ConvertImplicit): Do built-in conversions first.
24487 2001-09-27 Ravi Pratap <ravi@ximian.com>
24489 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24491 2001-09-27 Ravi Pratap <ravi@ximian.com>
24493 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24494 I had introduced long ago (what's new ?).
24496 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24497 the work of all the checking.
24498 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24499 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24501 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24502 that is the right way.
24504 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24505 overloading resolution. Use everywhere instead of cutting and pasting code.
24507 (Binary::ResolveOperator): Use MakeUnionSet.
24509 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24510 we have to convert to bool types. Not complete yet.
24512 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24514 * typemanager.cs (TypeManager::CSharpName): support ushort.
24516 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24517 to provide an expression that performsn an implicit constant int
24518 conversion (section 6.1.6).
24519 (Expression::ConvertImplicitRequired): Reworked to include
24520 implicit constant expression conversions.
24522 (Expression::ConvertNumericExplicit): Finished.
24524 (Invocation::Emit): If InstanceExpression is null, then it means
24525 that we perform a call on this.
24527 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24529 * expression.cs (Unary::Emit): Remove some dead code.
24530 (Probe): Implement Resolve and Emit for `is'.
24531 (Expression::ConvertImplicitRequired): Attempt to do constant
24532 expression conversions here. Maybe should be moved to
24533 ConvertImplicit, but I am not sure.
24534 (Expression::ImplicitLongConstantConversionPossible,
24535 Expression::ImplicitIntConstantConversionPossible): New functions
24536 that tell whether is it possible to apply an implicit constant
24537 expression conversion.
24539 (ConvertNumericExplicit): Started work on explicit numeric
24542 * cs-parser.jay: Update operator constants.
24544 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24545 (Parameters::GetSignature): Hook up VerifyArgs here.
24546 (Parameters::VerifyArgs): Verifies that no two arguments have the
24549 * class.cs (Operator): Update the operator names to reflect the
24550 ones that the spec expects (as we are just stringizing the
24553 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24554 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24555 previous usage did only work for our methods.
24556 (Expression::ConvertImplicit): Handle decimal implicit numeric
24557 conversions as well.
24558 (Expression::InternalTypeConstructor): Used to invoke constructors
24559 on internal types for default promotions.
24561 (Unary::Emit): Implement special handling for the pre/post
24562 increment/decrement for overloaded operators, as they need to have
24563 the same semantics as the other operators.
24565 (Binary::ResolveOperator): ditto.
24566 (Invocation::ConversionExists): ditto.
24567 (UserImplicitCast::Resolve): ditto.
24569 2001-09-26 Ravi Pratap <ravi@ximian.com>
24571 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24572 operator, return after emitting body. Regression tests pass again !
24574 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24575 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24576 (Invocation::OverloadResolve): Ditto.
24577 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24579 * everywhere : update calls to the above methods accordingly.
24581 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24583 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24585 * expression.cs (ExpressionStatement): New base class used for
24586 expressions that can appear in statements, so that we can provide
24587 an alternate path to generate expression that do not leave a value
24590 (Expression::Emit, and all the derivatives): We no longer return
24591 whether a value is left on the stack or not. Every expression
24592 after being emitted leaves a single value on the stack.
24594 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24595 facilties of ExpressionStatement if possible.
24597 * cs-parser.jay: Update statement_expression.
24599 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24601 * driver.cs: Change the wording of message
24603 2001-09-25 Ravi Pratap <ravi@ximian.com>
24605 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24606 the type of the expression to the return type of the method if
24607 we have an overloaded operator match ! The regression tests pass again !
24608 (Unary::ResolveOperator): Ditto.
24610 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24611 to find "op_Implicit", not "implicit" ;-)
24612 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24613 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24615 * everywhere : Correct calls to the above accordingly.
24617 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24618 (ConvertImplicit): Do user-defined conversion if it exists.
24620 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24622 * assign.cs: track location.
24623 (Resolve): Use implicit conversions on assignment.
24625 * literal.cs: Oops. Not good, Emit of short access values should
24626 pass (Bytes) or the wrong argument will be selected.
24628 * expression.cs (Unary::Emit): Emit code for -expr.
24630 (Unary::ResolveOperator): Handle `Substract' for non-constants
24631 (substract from zero from the non-constants).
24632 Deal with Doubles as well.
24634 (Expression::ConvertImplicitRequired): New routine that reports an
24635 error if no implicit conversion exists.
24637 (Invocation::OverloadResolve): Store the converted implicit
24638 expressions if we make them
24640 2001-09-24 Ravi Pratap <ravi@ximian.com>
24642 * class.cs (ConstructorInitializer): Take a Location argument.
24643 (ConstructorBaseInitializer): Same here.
24644 (ConstructorThisInitializer): Same here.
24646 * cs-parser.jay : Update all calls accordingly.
24648 * expression.cs (Unary, Binary, New): Take location argument.
24649 Update accordingly everywhere.
24651 * cs-parser.jay : Update all calls to the above to take a location
24654 * class.cs : Ditto.
24656 2001-09-24 Ravi Pratap <ravi@ximian.com>
24658 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24659 (Invocation::BetterConversion): Same here
24660 (Invocation::ConversionExists): Ditto.
24662 (Invocation::ConversionExists): Implement.
24664 2001-09-22 Ravi Pratap <ravi@ximian.com>
24666 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24667 Also take an additional TypeContainer argument.
24669 * All over : Pass in TypeContainer as argument to OverloadResolve.
24671 * typemanager.cs (CSharpName): Update to check for the string type and return
24674 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24677 2001-09-21 Ravi Pratap <ravi@ximian.com>
24679 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24680 (Invocation::BetterFunction): Implement.
24681 (Invocation::BetterConversion): Implement.
24682 (Invocation::ConversionExists): Skeleton, no implementation yet.
24684 Okay, things work fine !
24686 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24688 * typemanager.cs: declare and load enum_type, delegate_type and
24691 * expression.cs (Expression::Emit): Now emit returns a value that
24692 tells whether a value is left on the stack or not. This strategy
24693 might be reveted tomorrow with a mechanism that would address
24694 multiple assignments.
24695 (Expression::report118): Utility routine to report mismatches on
24698 (Unary::Report23): Report impossible type/operator combination
24701 (Unary::IsIncrementableNumber): Whether the type can be
24702 incremented or decremented with add.
24703 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24705 (Unary::ResolveOperator): Implement ++, !, ~,
24707 (Invocation::Emit): Deal with new Emit convetion.
24709 * All Expression derivatives: Updated their Emit method to return
24710 whether they leave values on the stack or not.
24712 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24713 stack for expressions that are statements.
24715 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24717 * expression.cs (LValue): New interface. Must be implemented by
24719 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24722 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24723 interface for generating code, simplifies the code.
24725 2001-09-20 Ravi Pratap <ravi@ximian.com>
24727 * expression.cs (everywhere): Comment out return statements in ::Resolve
24728 methods to avoid the warnings.
24730 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24732 * driver.cs (parse): Report error 2001 if we can not open the
24735 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24738 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24741 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24742 otherwise nested blocks end up with the same index.
24744 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24746 * expression.cs: Instead of having FIXMEs in the Resolve
24747 functions, throw exceptions so it is obvious that we are facing a
24750 * cs-parser.jay (invocation_expression): Pass Location information.
24752 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24753 Use a basename for those routines because .NET does not like paths
24756 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24759 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24761 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24762 are loading the correct data types (throws an exception if not).
24763 (TypeManager::InitCoreTypes): Use CoreLookupType
24765 * expression.cs (Unary::ResolveOperator): return the child
24766 expression for expressions which are just +expr.
24767 (Unary::ResolveOperator): Return negative literals for -LITERAL
24768 expressions (otherwise they are Unary {Literal}).
24769 (Invocation::Badness): Take into account `Implicit constant
24770 expression conversions'.
24772 * literal.cs (LongLiteral): Implement long literal class.
24773 (IntLiteral): export the `Value' of the intliteral.
24775 2001-09-19 Ravi Pratap <ravi@ximian.com>
24777 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24779 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24780 instead of 'Operator'
24782 * expression.cs (Binary::ResolveOperator): Update accordingly.
24783 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24786 * cs-parser.jay (unary_expression): Update to use the new names.
24788 * gen-treedump.cs (GetUnary): Same here.
24790 * expression.cs (Unary::Resolve): Implement.
24791 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24792 operators are found instead of making noise ;-)
24793 (Unary::ResolveOperator): New method to do precisely the same thing which
24794 Binary::ResolveOperator does for Binary expressions.
24795 (Unary.method, .Arguments): Add.
24796 (Unary::OperName): Implement.
24797 (Unary::ForceConversion): Copy and Paste !
24799 * class.cs (Operator::Define): Fix a small bug for the case when we have
24802 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24803 for the inbuilt operators. Only overloading works for now ;-)
24805 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24807 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24808 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24810 * expression.cs (This::Emit): Implement.
24811 (This::Resolve): Implement.
24812 (TypeOf:Resolve): Implement.
24813 (Expression::ResolveSimpleName): Add an implicit this to instance
24815 (MemberAccess::Resolve): Deal with Parameters and Fields.
24816 Bind instance variable to Field expressions.
24817 (FieldExpr::Instance): New field used to track the expression that
24818 represents the object instance.
24819 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24821 (FieldExpr::Emit): Implement.
24823 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24824 the last instruction contains a return opcode to avoid generating
24825 the last `ret' instruction (this generates correct code, and it is
24826 nice to pass the peverify output).
24828 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24829 initializer for static and instance variables.
24830 (Constructor::Emit): Allow initializer to be null in the case of
24831 static constructors. Only emit initializer for instance
24834 (TypeContainer::FindMembers): Return a null array if there are no
24837 Also fix the code for the MemberTypes.Method branch, as it was not
24838 scanning that for operators (or tried to access null variables before).
24840 * assign.cs (Assign::Emit): Handle instance and static fields.
24844 * driver.cs: Stop compilation if there are parse errors.
24846 * cs-parser.jay (constructor_declaration): Provide default base
24847 initializer for non-static constructors.
24848 (constructor_declarator): Do not provide a default base
24849 initializers if none was specified.
24850 Catch the fact that constructors should not have parameters.
24852 * class.cs: Do not emit parent class initializers for static
24853 constructors, that should be flagged as an error.
24855 2001-09-18 Ravi Pratap <ravi@ximian.com>
24857 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24858 Move back code into TypeContainer::Populate.
24860 2001-09-18 Ravi Pratap <ravi@ximian.com>
24862 * class.cs (TypeContainer::AddConstructor): Fix the check to
24863 compare against Name, not Basename.
24864 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24866 * cs-parser.jay : Update accordingly.
24868 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24869 for methods, don't forget to look into the operators too.
24870 (RegisterMethodBuilder): Helper method to take care of this for
24871 methods, constructors and operators.
24872 (Operator::Define): Completely revamp.
24873 (Operator.OperatorMethod, MethodName): New fields.
24874 (TypeContainer::Populate): Move the registering of builders into
24875 RegisterMethodBuilder.
24876 (Operator::Emit): Re-write.
24878 * expression.cs (Binary::Emit): Comment out code path to emit method
24879 invocation stuff for the case when we have a user defined operator. I am
24880 just not able to get it right !
24882 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24884 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24887 (Expression::MemberLookup): Provide a version that allows to
24888 specify the MemberTypes and BindingFlags.
24890 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24891 so it was not fetching variable information from outer blocks.
24893 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24894 Beforefieldinit as it was buggy.
24896 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24897 that Ravi put here.
24899 * class.cs (Constructor::Emit): Only emit if block is not null.
24900 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24901 deal with this by semantically definining it as if the user had
24904 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24905 constructors as we now "emit" them at a higher level.
24907 (TypeContainer::DefineDefaultConstructor): Used to define the
24908 default constructors if none was provided.
24910 (ConstructorInitializer): Add methods Resolve and Emit.
24912 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24914 2001-09-17 Ravi Pratap <ravi@ximian.com>
24916 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24917 the default constructor builder with our hashtable for methodbuilders
24920 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24921 and argument_count is 0 in which case we have a match.
24922 (Binary::ResolveOperator): More null checking and miscellaneous coding
24925 2001-09-17 Ravi Pratap <ravi@ximian.com>
24927 * rootcontext.cs (IsNameSpace): Compare against null.
24929 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24931 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24932 and Unary::Operator.
24934 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24937 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24938 we have overloaded operators.
24939 (Binary::ResolveOperator): Implement the part which does the operator overload
24942 * class.cs (Operator::Emit): Implement.
24943 (TypeContainer::Emit): Emit the operators we have too.
24945 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24946 the case when we have a user-defined operator.
24948 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24950 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24952 2001-09-16 Ravi Pratap <ravi@ximian.com>
24954 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24955 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24956 (Constructor::Emit): Implement.
24957 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24958 if we have no work to do.
24959 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24962 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24963 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24965 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24968 2001-09-15 Ravi Pratap <ravi@ximian.com>
24970 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24972 (Tree::RecordNamespace): Method to do what the name says ;-)
24973 (Tree::Namespaces): Property to get at the namespaces hashtable.
24975 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24978 * rootcontext.cs (IsNamespace): Fixed it :-)
24980 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24982 * class.cs (TypeContainer::FindMembers): Add support for
24984 (MethodCore): New class that encapsulates both the shared aspects
24985 of a Constructor and a Method.
24986 (Method, Constructor): Factored pieces into MethodCore.
24988 * driver.cs: Added --fatal which makes errors throw exceptions.
24989 Load System assembly as well as part of the standard library.
24991 * report.cs: Allow throwing exceptions on errors for debugging.
24993 * modifiers.cs: Do not use `parent', instead use the real type
24994 container to evaluate permission settings.
24996 * class.cs: Put Ravi's patch back in. He is right, and we will
24997 have to cope with the
24999 2001-09-14 Ravi Pratap <ravi@ximian.com>
25001 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25002 FamORAssem, not FamANDAssem.
25004 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25006 * driver.cs: Added --parse option that only parses its input files
25009 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25010 incorrect. IsTopLevel is not used to tell whether an object is
25011 root_types or not (that can be achieved by testing this ==
25012 root_types). But to see if this is a top-level *class* (not
25013 necessarly our "toplevel" container).
25015 2001-09-14 Ravi Pratap <ravi@ximian.com>
25017 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25018 parent instead of a direct call to GetType.
25020 2001-09-14 Ravi Pratap <ravi@ximian.com>
25022 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25023 Modifiers.TypeAttr. This should just be a call to that method.
25025 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25026 object so that we can determine if we are top-level or not.
25028 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25031 * enum.cs (Enum::Define): Ditto.
25033 * modifiers.cs (FieldAttr): Re-write.
25035 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25036 (TypeContainer::HaveStaticConstructor): New property to provide access
25037 to precisely that info.
25039 * modifiers.cs (MethodAttr): Re-write.
25040 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25042 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25043 of top-level types as claimed.
25045 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25047 * expression.cs (MemberLookup): Fruitless attempt to lookup
25048 constructors. Maybe I need to emit default constructors? That
25049 might be it (currently .NET emits this for me automatically).
25050 (Invocation::OverloadResolve): Cope with Arguments == null.
25051 (Invocation::EmitArguments): new function, shared by the new
25052 constructor and us.
25053 (Invocation::Emit): Handle static and instance methods. Emit
25054 proper call instruction for virtual or non-virtual invocations.
25055 (New::Emit): Implement.
25056 (New::Resolve): Implement.
25057 (MemberAccess:Resolve): Implement.
25058 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25059 to track instances.
25060 (FieldExpr::Resolve): Set type.
25062 * support.cs: Handle empty arguments.
25064 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25065 SimpleLookup): Auxiliary routines to help parse a qualifier
25068 Update qualifier_identifier rule.
25070 * codegen.cs: Removed debugging messages.
25072 * class.cs: Make this a global thing, this acts just as a "key" to
25073 objects that we might have around.
25075 (Populate): Only initialize method_builders_to_methods once.
25077 * expression.cs (PropertyExpr): Initialize type from the
25080 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25081 Resolve pattern. Attempt to implicitly convert value to boolean.
25084 * expression.cs: Set the type for the int32/int32 argument case.
25085 (Binary::ResolveOperator): Set the return type to boolean for
25086 comparission operators
25088 * typemanager.cs: Remove debugging print code.
25090 (Invocation::Resolve): resolve type.
25092 * class.cs: Allocate a MemberInfo of the correct size, as the code
25093 elsewhere depends on the test to reflect the correct contents.
25095 (Method::) Keep track of parameters, due to System.Reflection holes
25097 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25100 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25101 of the exact size and return that.
25103 (Class::LookupMethodByBuilder): New function that maps
25104 MethodBuilders to its methods. Required to locate the information
25105 on methods because System.Reflection bit us again.
25107 * support.cs: New file, contains an interface ParameterData and
25108 two implementations: ReflectionParameters and InternalParameters
25109 used to access Parameter information. We will need to grow this
25112 * expression.cs (Invocation::GetParameterData): implement a cache
25113 and a wrapper around the ParameterData creation for methods.
25114 (Invocation::OverloadResolve): Use new code.
25116 2001-09-13 Ravi Pratap <ravi@ximian.com>
25118 * class.cs (TypeContainer::EmitField): Remove and move into
25119 (Field::Define): here and modify accordingly.
25120 (Field.FieldBuilder): New member.
25121 (TypeContainer::Populate): Update accordingly.
25122 (TypeContainer::FindMembers): Implement.
25124 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25126 * statement.cs: (VariableInfo::VariableType): New field to be
25127 initialized with the full type once it is resolved.
25129 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25131 * parameter.cs (GetParameterInfo): Use a type cache to compute
25132 things only once, and to reuse this information
25134 * expression.cs (LocalVariableReference::Emit): Implement.
25135 (OpcodeCast::Emit): fix.
25137 (ParameterReference::Resolve): Implement.
25138 (ParameterReference::Emit): Implement.
25140 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25141 that are expressions need to stay as Expressions.
25143 * typemanager.cs (CSharpName): Returns the C# name of a type if
25146 * expression.cs (Expression::ConvertImplicit): New function that
25147 implements implicit type conversions.
25149 (Expression::ImplicitReferenceConversion): Implements implicit
25150 reference conversions.
25152 (EmptyCast): New type for transparent casts.
25154 (OpcodeCast): New type for casts of types that are performed with
25155 a sequence of bytecodes.
25157 (BoxedCast): New type used for casting value types into reference
25158 types. Emits a box opcode.
25160 (Binary::DoNumericPromotions): Implements numeric promotions of
25161 and computation of the Binary::Type.
25163 (Binary::EmitBranchable): Optimization.
25165 (Binary::Emit): Implement code emission for expressions.
25167 * typemanager.cs (TypeManager): Added two new core types: sbyte
25170 2001-09-12 Ravi Pratap <ravi@ximian.com>
25172 * class.cs (TypeContainer::FindMembers): Method which does exactly
25173 what Type.FindMembers does, only we don't have to use reflection. No
25174 implementation yet.
25176 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25177 typecontainer objects as we need to get at them.
25178 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25180 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25181 typecontainer object.
25183 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25184 of just a Report object.
25186 2001-09-11 Ravi Pratap <ravi@ximian.com>
25188 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25190 (TypeContainer::Populate): Now define the delegates of the type too.
25191 (TypeContainer.Delegates): Property to access the list of delegates defined
25194 * delegates.cs (Delegate::Define): Implement partially.
25196 * modifiers.cs (TypeAttr): Handle more flags.
25198 2001-09-11 Ravi Pratap <ravi@ximian.com>
25200 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25202 (Operator::Define): Re-write logic to get types by using the LookupType method
25203 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25204 (Indexer::Define): Ditto.
25205 (Event::Define): Ditto.
25206 (Property::Define): Ditto.
25208 2001-09-10 Ravi Pratap <ravi@ximian.com>
25210 * class.cs (TypeContainer::Populate): Now define operators too.
25211 (TypeContainer.Operators): New property to access the list of operators
25213 (Operator.OperatorMethodBuilder): New member to hold the method builder
25214 for the operator we are defining.
25215 (Operator::Define): Implement.
25217 2001-09-10 Ravi Pratap <ravi@ximian.com>
25219 * class.cs (Event::Define): Make the prefixes of the accessor methods
25220 addOn_ and removeOn_
25222 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25223 of the location being passed in too. Ideally, this should go later since all
25224 error reporting should be done through the Report object.
25226 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25227 (Populate): Iterate thru the indexers we have and define them too.
25228 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25229 for the get and set accessors.
25230 (Indexer::Define): Implement.
25232 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25234 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25235 my previous implementation, did not work.
25237 * typemanager.cs: Add a couple of missing types (the longs).
25239 * literal.cs: Use TypeManager.bool_type instead of getting it.
25241 * expression.cs (EventExpr): New kind of expressions.
25242 (Expressio::ExprClassFromMemberInfo): finish
25244 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25246 * assign.cs: Emit stores to static fields differently.
25248 2001-09-08 Ravi Pratap <ravi@ximian.com>
25250 * Merge in changes and adjust code to tackle conflicts. Backed out my
25251 code in Assign::Resolve ;-)
25253 2001-09-08 Ravi Pratap <ravi@ximian.com>
25255 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25256 instead Report.Error and also pass in the location.
25257 (CSharpParser::Lexer): New readonly property to return the reference
25258 to the Tokenizer object.
25259 (declare_local_variables): Use Report.Error with location instead of plain
25263 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25264 (Operator.CheckBinaryOperator): Ditto.
25266 * cs-parser.jay (operator_declarator): Update accordingly.
25268 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25269 (CheckBinaryOperator): Same here.
25271 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25272 on the name without any prefixes of namespace names etc. This is because we
25273 already might have something already fully qualified like
25274 'System.Console.WriteLine'
25276 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25278 2001-09-07 Ravi Pratap <ravi@ximian.com>
25280 * cs-tokenizer.cs (location): Return a string which also contains
25283 * expression.cs (ElementAccess): New class for expressions of the
25284 type 'element access.'
25285 (BaseAccess): New class for expressions of the type 'base access.'
25286 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25289 * cs-parser.jay (element_access): Implement action.
25290 (base_access): Implement actions.
25291 (checked_expression, unchecked_expression): Implement.
25293 * cs-parser.jay (local_variable_type): Correct and implement.
25294 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25296 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25298 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25299 name and the specifiers.
25301 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25303 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25304 making them all public ;-)
25306 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25309 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25311 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25313 (FieldExpr, PropertyExprs): New resolved expressions.
25314 (SimpleName::MemberStaticCheck): Perform static checks for access
25315 to non-static fields on static methods. Maybe this should be
25316 generalized for MemberAccesses.
25317 (SimpleName::ResolveSimpleName): More work on simple name
25320 * cs-parser.jay (primary_expression/qualified_identifier): track
25321 the parameter index.
25323 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25324 (EmitContext::EmitBoolExpression): Chain to expression generation
25325 instead of temporary hack.
25326 (::EmitStatementExpression): Put generic expression code generation.
25328 * assign.cs (Assign::Emit): Implement variable assignments to
25329 local variables, parameters and fields.
25331 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25333 * statement.cs (Block::GetVariableInfo): New method, returns the
25334 VariableInfo for a variable name in a block.
25335 (Block::GetVariableType): Implement in terms of GetVariableInfo
25337 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25338 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25340 2001-09-06 Ravi Pratap <ravi@ximian.com>
25342 * cs-parser.jay (operator_declaration): Continue on my quest : update
25343 to take attributes argument.
25344 (event_declaration): Ditto.
25345 (enum_declaration): Ditto.
25346 (indexer_declaration): Ditto.
25348 * class.cs (Operator::Operator): Update constructor accordingly.
25349 (Event::Event): Ditto.
25351 * delegate.cs (Delegate::Delegate): Same here.
25353 * enum.cs (Enum::Enum): Same here.
25355 2001-09-05 Ravi Pratap <ravi@ximian.com>
25357 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25359 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25361 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25362 being passed around as an arraylist.
25363 (Attributes::AddAttribute): Method to add attribute sections.
25365 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25366 (struct_declaration): Update accordingly.
25367 (constant_declaration): Update.
25368 (field_declaration): Update.
25369 (method_header): Update.
25370 (fixed_parameter): Update.
25371 (parameter_array): Ditto.
25372 (property_declaration): Ditto.
25373 (destructor_declaration): Ditto.
25375 * class.cs (Struct::Struct): Update constructors accordingly.
25376 (Class::Class): Ditto.
25377 (Field::Field): Ditto.
25378 (Method::Method): Ditto.
25379 (Property::Property): Ditto.
25380 (TypeContainer::OptAttribute): update property's return type.
25382 * interface.cs (Interface.opt_attributes): New member.
25383 (Interface::Interface): Update to take the extra Attributes argument.
25385 * parameter.cs (Parameter::Parameter): Ditto.
25387 * constant.cs (Constant::Constant): Ditto.
25389 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25390 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25391 the attributes as a parameter.
25392 (InterfaceProperty): Update constructor call.
25393 (InterfaceEvent): Ditto.
25394 (InterfaceMethod): Ditto.
25395 (InterfaceIndexer): Ditto.
25397 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25398 pass the attributes too.
25399 (interface_event_declaration): Ditto.
25400 (interface_property_declaration): Ditto.
25401 (interface_method_declaration): Ditto.
25402 (interface_declaration): Ditto.
25404 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25406 * class.cs (Method::Define): Track the "static Main" definition to
25407 create an entry point.
25409 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25410 EntryPoint if we find it.
25412 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25413 (EmitContext::ig): Make this variable public.
25415 * driver.cs: Make the default output file be the first file name
25416 with the .exe extension.
25418 Detect empty compilations
25420 Handle various kinds of output targets. Handle --target and
25421 rename -t to --dumper.
25423 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25424 methods inherited from Expression return now an Expression. This
25425 will is used during the tree rewriting as we resolve them during
25428 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25429 the spec. Missing entirely is the information about
25430 accessability of elements of it.
25432 (Expression::ExprClassFromMemberInfo): New constructor for
25433 Expressions that creates a fully initialized Expression based on
25434 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25437 (Invocation::Resolve): Begin implementing resolution of invocations.
25439 * literal.cs (StringLiteral): Implement Emit.
25441 2001-09-05 Ravi Pratap <ravi@ximian.com>
25443 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25446 2001-09-04 Ravi Pratap <ravi@ximian.com>
25448 * cs-parser.jay (attribute_arguments): Implement actions.
25449 (attribute): Fix bug in production. Implement action.
25450 (attribute_list): Implement.
25451 (attribute_target): Implement.
25452 (attribute_target_specifier, opt_target_specifier): Implement
25453 (CheckAttributeTarget): New method to check if the attribute target
25455 (attribute_section): Implement.
25456 (opt_attributes): Implement.
25458 * attribute.cs : New file to handle attributes.
25459 (Attribute): Class to hold attribute info.
25461 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25462 (attribute_section): Modify production to use 2 different rules to
25463 achieve the same thing. 1 s/r conflict down !
25464 Clean out commented, useless, non-reducing dimension_separator rules.
25466 * class.cs (TypeContainer.attributes): New member to hold list
25467 of attributes for a type.
25468 (Struct::Struct): Modify to take one more argument, the attribute list.
25469 (Class::Class): Ditto.
25470 (Field::Field): Ditto.
25471 (Method::Method): Ditto.
25472 (Property::Property): Ditto.
25474 * cs-parser.jay (struct_declaration): Update constructor call to
25475 pass in the attributes too.
25476 (class_declaration): Ditto.
25477 (constant_declaration): Ditto.
25478 (field_declaration): Ditto.
25479 (method_header): Ditto.
25480 (fixed_parameter): Ditto.
25481 (parameter_array): Ditto.
25482 (property_declaration): Ditto.
25484 * constant.cs (Constant::Constant): Update constructor similarly.
25485 Use System.Collections.
25487 * parameter.cs (Parameter::Parameter): Update as above.
25489 2001-09-02 Ravi Pratap <ravi@ximian.com>
25491 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25492 (TypeContainer.delegates): New member to hold list of delegates.
25494 * cs-parser.jay (delegate_declaration): Implement the action correctly
25495 this time as I seem to be on crack ;-)
25497 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25499 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25500 tell whether an identifier represents a namespace.
25502 * expression.cs (NamespaceExpr): A namespace expression, used only
25503 temporarly during expression resolution.
25504 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25505 utility functions to resolve names on expressions.
25507 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25509 * codegen.cs: Add hook for StatementExpressions.
25511 * class.cs: Fix inverted test for static flag in methods.
25513 2001-09-02 Ravi Pratap <ravi@ximian.com>
25515 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25516 to make it coincide with MS' number.
25517 (Operator::CheckBinaryOperator): Ditto.
25519 * ../errors/errors.txt : Remove error numbers added earlier.
25521 * ../errors/cs1019.cs : Test case for error # 1019
25523 * ../errros/cs1020.cs : Test case for error # 1020
25525 * cs-parser.jay : Clean out commented cruft.
25526 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25527 used anywhere - non-reducing rule.
25528 (namespace_declarations): Non-reducing rule - comment out.
25530 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25531 with TypeContainer::AddEnum.
25533 * delegate.cs : New file for delegate handling classes.
25534 (Delegate): Class for declaring delegates.
25536 * makefile : Update.
25538 * cs-parser.jay (delegate_declaration): Implement.
25540 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25542 * class.cs (Event::Define): Implement.
25543 (Event.EventBuilder): New member.
25545 * class.cs (TypeContainer::Populate): Update to define all enums and events
25547 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25548 readonly fields for all these cases ?
25550 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25552 * class.cs (Property): Revamp to use the convention of making fields readonly.
25553 Accordingly modify code elsewhere.
25555 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25556 the Define method of the Property class.
25558 * class.cs : Clean up applied patch and update references to variables etc. Fix
25560 (TypeContainer::Populate): Update to define all the properties we have. Also
25561 define all enumerations.
25563 * enum.cs (Define): Implement.
25565 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25567 * cs-parser.jay (overloadable_operator): The semantic value is an
25568 enum of the Operator class.
25569 (operator_declarator): Implement actions.
25570 (operator_declaration): Implement.
25572 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25573 validity of definitions.
25574 (Operator::CheckBinaryOperator): Static method to check for binary operators
25575 (TypeContainer::AddOperator): New method to add an operator to a type.
25577 * cs-parser.jay (indexer_declaration): Added line to actually call the
25578 AddIndexer method so it gets added ;-)
25580 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25581 already taken care of by the MS compiler ?
25583 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25585 * class.cs (Operator): New class for operator declarations.
25586 (Operator::OpType): Enum for the various operators.
25588 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25590 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25591 ostensibly handle this in semantic analysis.
25593 * cs-parser.jay (general_catch_clause): Comment out
25594 (specific_catch_clauses, specific_catch_clause): Ditto.
25595 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25596 (catch_args, opt_catch_args): New productions.
25597 (catch_clause): Rewrite to use the new productions above
25598 (catch_clauses): Modify accordingly.
25599 (opt_catch_clauses): New production to use in try_statement
25600 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25601 and re-write the code in the actions to extract the specific and
25602 general catch clauses by being a little smart ;-)
25604 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25605 Hooray, try and catch statements parse fine !
25607 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25609 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25610 string from the hashtable of variables.
25612 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25613 I end up making that mistake ;-)
25614 (catch_clauses): Fixed gross error which made Key and Value of the
25615 DictionaryEntry the same : $1 !!
25617 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25619 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25621 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25622 when the add and remove accessors are specified.
25624 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25626 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25627 information about indexer_declarator.
25628 (indexer_declarator): Implement actions.
25629 (parsing_indexer): New local boolean used to keep track of whether
25630 we are parsing indexers or properties. This is necessary because
25631 implicit_parameters come into picture even for the get accessor in the
25632 case of an indexer.
25633 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25635 * class.cs (Indexer): New class for indexer declarations.
25636 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25637 (TypeContainer::indexers): New member to hold list of indexers for the
25640 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25642 * cs-parser.jay (add_accessor_declaration): Implement action.
25643 (remove_accessor_declaration): Implement action.
25644 (event_accessors_declaration): Implement
25645 (variable_declarators): swap statements for first rule - trivial.
25647 * class.cs (Event): New class to hold information about event
25649 (TypeContainer::AddEvent): New method to add an event to a type
25650 (TypeContainer::events): New member to hold list of events.
25652 * cs-parser.jay (event_declaration): Implement actions.
25654 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25656 * cs-parser.jay (dim_separators): Implement. Make it a string
25657 concatenating all the commas together, just as they appear.
25658 (opt_dim_separators): Modify accordingly
25659 (rank_specifiers): Update accordingly. Basically do the same
25660 thing - instead, collect the brackets here.
25661 (opt_rank_sepcifiers): Modify accordingly.
25662 (array_type): Modify to actually return the complete type string
25663 instead of ignoring the rank_specifiers.
25664 (expression_list): Implement to collect the expressions
25665 (variable_initializer): Implement. We make it a list of expressions
25666 essentially so that we can handle the array_initializer case neatly too.
25667 (variable_initializer_list): Implement.
25668 (array_initializer): Make it a list of variable_initializers
25669 (opt_array_initializer): Modify accordingly.
25671 * expression.cs (New::NType): Add enumeration to help us
25672 keep track of whether we have an object/delegate creation
25673 or an array creation.
25674 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25675 members to hold data about array creation.
25676 (New:New): Modify to update NewType
25677 (New:New): New Overloaded contructor for the array creation
25680 * cs-parser.jay (array_creation_expression): Implement to call
25681 the overloaded New constructor.
25683 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25685 * class.cs (TypeContainer::Constructors): Return member
25686 constructors instead of returning null.
25688 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25690 * typemanager.cs (InitCoreTypes): Initialize the various core
25691 types after we have populated the type manager with the user
25692 defined types (this distinction will be important later while
25693 compiling corlib.dll)
25695 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25696 on Expression Classification. Now all expressions have a method
25697 `Resolve' and a method `Emit'.
25699 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25700 generation from working. Also add some temporary debugging
25703 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25705 * codegen.cs: Lots of code generation pieces. This is only the
25706 beginning, will continue tomorrow with more touches of polish. We
25707 handle the fundamentals of if, while, do, for, return. Others are
25708 trickier and I need to start working on invocations soon.
25710 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25713 * codegen.cs (EmitContext): New struct, used during code
25714 emission to keep a context. Most of the code generation will be
25717 * cs-parser.jay: Add embedded blocks to the list of statements of
25718 this block. So code generation proceeds in a top down fashion.
25720 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25722 * statement.cs: Add support for multiple child blocks.
25724 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25726 * codegen.cs (EmitCode): New function, will emit the code for a
25727 Block of code given a TypeContainer and its ILGenerator.
25729 * statement.cs (Block): Standard public readonly optimization.
25730 (Block::Block constructors): Link children.
25731 (Block::Child): Child Linker.
25732 (Block::EmitVariables): Emits IL variable declarations.
25734 * class.cs: Drop support for MethodGroups here, delay until
25736 (Method::): Applied the same simplification that I did before, and
25737 move from Properties to public readonly fields.
25738 (Method::ParameterTypes): Returns the parameter types for the
25739 function, and implements a cache that will be useful later when I
25740 do error checking and the semantic analysis on the methods is
25742 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25743 and made a method, optional argument tells whether this is a class
25744 or a structure to apply the `has-this' bit.
25745 (Method::GetCallingConvention): Implement, returns the calling
25747 (Method::Define): Defines the type, a second pass is performed
25748 later to populate the methods.
25750 (Constructor::ParameterTypes): implement a cache similar to the
25751 one on Method::ParameterTypes, useful later when we do semantic
25754 (TypeContainer::EmitMethod): New method. Emits methods.
25756 * expression.cs: Removed MethodGroup class from here.
25758 * parameter.cs (Parameters::GetCallingConvention): new method.
25760 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25762 * class.cs (TypeContainer::Populate): Drop RootContext from the
25765 (Constructor::CallingConvention): Returns the calling convention.
25766 (Constructor::ParameterTypes): Returns the constructor parameter
25769 (TypeContainer::AddConstructor): Keep track of default constructor
25770 and the default static constructor.
25772 (Constructor::) Another class that starts using `public readonly'
25773 instead of properties.
25775 (Constructor::IsDefault): Whether this is a default constructor.
25777 (Field::) use readonly public fields instead of properties also.
25779 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25780 track of static constructors; If none is used, turn on
25781 BeforeFieldInit in the TypeAttributes.
25783 * cs-parser.jay (opt_argument_list): now the return can be null
25784 for the cases where there are no arguments.
25786 (constructor_declarator): If there is no implicit `base' or
25787 `this', then invoke the default parent constructor.
25789 * modifiers.cs (MethodAttr): New static function maps a set of
25790 modifiers flags into a MethodAttributes enum
25791 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25792 MethodAttr, TypeAttr to represent the various mappings where the
25793 modifiers are used.
25794 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25796 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25798 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25801 * interface.cs (PopulateIndexer): Implemented the code generator
25802 for interface indexers.
25804 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25806 * interface.cs (InterfaceMemberBase): Now we track the new status
25809 (PopulateProperty): Implement property population. Woohoo! Got
25810 Methods and Properties going today.
25812 Removed all the properties for interfaces, and replaced them with
25813 `public readonly' fields.
25815 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25817 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25818 initialize their hashtables/arraylists only when they are needed
25819 instead of doing this always.
25821 * parameter.cs: Handle refs and out parameters.
25823 * cs-parser.jay: Use an ArrayList to construct the arguments
25824 instead of the ParameterCollection, and then cast that to a
25827 * parameter.cs: Drop the use of ParameterCollection and use
25828 instead arrays of Parameters.
25830 (GetParameterInfo): Use the Type, not the Name when resolving
25833 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25835 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25836 and instead use public readonly fields.
25838 * class.cs: Put back walking code for type containers.
25840 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25842 * class.cs (MakeConstant): Code to define constants.
25844 * rootcontext.cs (LookupType): New function. Used to locate types
25847 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25849 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25850 this System.Reflection code is. Kudos to Microsoft
25852 * typemanager.cs: Implement a type cache and avoid loading all
25853 types at boot time. Wrap in LookupType the internals. This made
25854 the compiler so much faster. Wow. I rule!
25856 * driver.cs: Make sure we always load mscorlib first (for
25857 debugging purposes, nothing really important).
25859 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25860 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25862 * rootcontext.cs: Lookup types on their namespace; Lookup types
25863 on namespaces that have been imported using the `using' keyword.
25865 * class.cs (TypeContainer::TypeAttr): Virtualize.
25866 (Class::TypeAttr): Return attributes suitable for this bad boy.
25867 (Struct::TypeAttr): ditto.
25868 Handle nested classes.
25869 (TypeContainer::) Remove all the type visiting code, it is now
25870 replaced with the rootcontext.cs code
25872 * rootcontext.cs (GetClassBases): Added support for structs.
25874 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25876 * interface.cs, statement.cs, class.cs, parameter.cs,
25877 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25878 Drop use of TypeRefs, and use strings instead.
25880 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25884 * class.cs (Struct::Struct): set the SEALED flags after
25885 checking the modifiers.
25886 (TypeContainer::TypeAttr): new property, returns the
25887 TypeAttributes for a class.
25889 * cs-parser.jay (type_list): Oops, list production was creating a
25890 new list of base types.
25892 * rootcontext.cs (StdLib): New property.
25893 (GetInterfaceTypeByName): returns an interface by type name, and
25894 encapsulates error handling here.
25895 (GetInterfaces): simplified.
25896 (ResolveTree): Encapsulated all the tree resolution here.
25897 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25900 * driver.cs: Add support for --nostdlib, to avoid loading the
25901 default assemblies.
25902 (Main): Do not put tree resolution here.
25904 * rootcontext.cs: Beginning of the class resolution.
25906 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25908 * rootcontext.cs: Provide better error reporting.
25910 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25912 * rootcontext.cs (CreateInterface): Handle the case where there
25913 are no parent interfaces.
25915 (CloseTypes): Routine to flush types at the end.
25916 (CreateInterface): Track types.
25917 (GetInterfaces): Returns an array of Types from the list of
25918 defined interfaces.
25920 * typemanager.c (AddUserType): Mechanism to track user types (puts
25921 the type on the global type hash, and allows us to close it at the
25924 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25926 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25927 RecordInterface instead.
25929 * cs-parser.jay: Updated to reflect changes above.
25931 * decl.cs (Definition): Keep track of the TypeBuilder type that
25932 represents this type here. Not sure we will use it in the long
25933 run, but wont hurt for now.
25935 * driver.cs: Smaller changes to accomodate the new code.
25937 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25940 * rootcontext.cs (CreateInterface): New method, used to create
25941 the System.TypeBuilder type for interfaces.
25942 (ResolveInterfaces): new entry point to resolve the interface
25944 (CodeGen): Property, used to keep track of the code generator.
25946 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25948 * cs-parser.jay: Add a second production for delegate_declaration
25951 (enum_body): Put an opt_comma here instead of putting it on
25952 enum_body or enum_member_declarations so we can handle trailing
25953 commas on enumeration members. Gets rid of a shift/reduce.
25955 (type_list): Need a COMMA in the middle.
25957 (indexer_declaration): Tell tokenizer to recognize get/set
25959 * Remove old targets.
25961 * Re-add the parser target.
25963 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25965 * cs-parser.jay: Add precendence rules for a number of operators
25966 ot reduce the number of shift/reduce conflicts in the grammar.
25968 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25970 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25973 Get rid of old crufty code.
25975 * rootcontext.cs: Use this to keep track of the parsed
25976 representation and the defined types available to the program.
25978 * gen-treedump.cs: adjust for new convention.
25980 * type.cs: Split out the type manager, and the assembly builder
25983 * typemanager.cs: the type manager will live here now.
25985 * cil-codegen.cs: And the code generator here.
25987 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25989 * makefile: Fixed up for easy making.
25991 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25993 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25996 (unary_expression): Expand pre_increment_expression and
25997 post_decrement_expression to reduce a shift/reduce.
25999 2001-07-11 Simon Cozens
26001 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26003 Improve allow_keyword_as_indent name.
26005 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26007 * Adjustments for Beta2.
26009 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26011 * decl.cs: Added `Define' abstract method.
26012 (InTransit): new property, used to catch recursive definitions.
26014 * interface.cs: Implement `Define'.
26016 * modifiers.cs: Map Modifiers.constants to
26017 System.Reflection.TypeAttribute flags.
26019 * class.cs: Keep track of types and user-defined types.
26020 (BuilderInit): New method for creating an assembly
26021 (ResolveType): New function to launch the resolution process, only
26022 used by interfaces for now.
26024 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26025 that are inserted into the name space.
26027 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26029 * ARGH. I have screwed up my tree so many times due to the use of
26030 rsync rather than using CVS. Going to fix this at once.
26032 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26035 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26037 * Experiment successful: Use System.Type rather that our own
26040 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26042 * cs-parser.jay: Removed nsAliases from here.
26044 Use new namespaces, handle `using XXX;'
26046 * namespace.cs: Reimplemented namespace handling, use a recursive
26047 definition of the class. Now we can keep track of using clauses
26048 and catch invalid using clauses.
26050 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26052 * gen-treedump.cs: Adapted for all the renaming.
26054 * expression.cs (Expression): this class now has a Type property
26055 which returns an expression Type.
26057 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26058 `Type', as this has a different meaning now in the base
26060 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26062 * interface.cs, class.cs: Removed from all the sources the
26063 references to signature computation, as we can not do method
26064 signature computation during the parsing time, as we are not
26065 trying to solve at that point distinguishing:
26069 void a (NS.Blah x) {}
26072 Which depending on the context might be valid or not, as we do not
26073 know if Blah is the same thing as NS.Blah at that point.
26075 * Redid everything so the code uses TypeRefs now instead of
26076 Types. TypeRefs are just temporary type placeholders, that need
26077 to be resolved. They initially have a pointer to a string and the
26078 current scope in which they are used. This is used later by the
26079 compiler to resolve the reference to an actual Type.
26081 * DeclSpace is no longer a CIR.Type, and neither are
26082 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26083 are all DeclSpaces, but no Types.
26085 * type.cs (TypeRefManager): This implements the TypeRef manager,
26086 which keeps track of all the types that need to be resolved after
26087 the parsing has finished.
26089 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26091 * ARGH. We are going to have to store `foreach' as a class rather
26092 than resolving it, as we need to verify error 1579 after name
26093 resolution. *OR* we could keep a flag that says `This request to
26094 IEnumerator comes from a foreach statement' which we can then use
26095 to generate the error.
26097 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26099 * class.cs (TypeContainer.AddMethod): we now add methods to the
26100 MethodGroup instead of the method hashtable.
26102 * expression.cs: Add MethodGroup abstraction, which gets us one
26103 step closer to the specification in the way we handle method
26106 * cs-parser.jay (primary_expression): qualified_identifier now
26107 tried to match up an identifier to a local variable reference or
26108 to a parameter reference.
26110 current_local_parameters is now a parser global variable that
26111 points to the current parameters for the block, used during name
26114 (property_declaration): Now creates an implicit `value' argument to
26117 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26119 * parameter.cs: Do not use `param' arguments as part of the
26120 signature, per the spec.
26122 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26124 * decl.cs: Base class for classes, structs and interfaces. This
26125 is the "Declaration Space"
26127 * cs-parser.jay: Use CheckDef for checking declaration errors
26128 instead of having one on each function.
26130 * class.cs: Factor out some code for handling error handling in
26131 accordance to the "Declarations" section in the "Basic Concepts"
26132 chapter in the ECMA C# spec.
26134 * interface.cs: Make all interface member classes derive from
26135 InterfaceMemberBase.
26137 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26139 * Many things: all interfaces are parsed and generated in
26140 gen-treedump. Support for member variables, constructors,
26141 destructors, properties, constants is there.
26143 Beginning of the IL backend, but very little done, just there for
26146 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26148 * cs-parser.jay: Fix labeled statement.
26150 * cs-tokenizer.cs (escape): Escape " and ' always.
26151 ref_line, ref_name: keep track of the line/filename as instructed
26152 by #line by the compiler.
26155 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26157 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26158 to match the values in System.CodeDOM.
26160 Divid renamed to Divide.
26162 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26164 (Statements.set): remove.
26166 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26169 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26170 falseStatements always have valid values.
26172 * cs-parser.jay: Use System.CodeDOM now.